import{ElementBuilder}from"../../base/builder.mjs";import{isEmpty}from"../../base/helpers.mjs";import{View}from"../../view/base.mjs";import{ImageEditorNodeView}from"./base.mjs";const E=new ElementBuilder;class PromptNodeContentView extends View{static tagName="enfugue-region-prompts";static placeholderText="Use the layer options menu to add a prompt. This region will be filled with an image generated from that prompt, <em>instead</em> of the global prompt.<br /><br />Any remaining empty regions will be inpainted.<br /><br />Check <strong>Remove Background</strong> to remove the background before merging down and inpainting.";setPrompts(e,t=null){if(isEmpty(e))this.node.content(E.p().content(this.constructor.placeholderText));else{let o=Array.isArray(e)?e.join(", "):e,r=[E.p().content(o)];if(!isEmpty(t)){let e=Array.isArray(t)?t.join(", "):t;r.push(E.p().content(e))}this.node.content(...r)}}async build(){let e=await super.build();return e.content(E.p().content(this.constructor.placeholderText)),e}}class ImageEditorPromptNodeView extends ImageEditorNodeView{static hideHeader=!1;static canFlipHeader=!1;static nodeName="Prompt";static nodeButtons={};static className="image-editor-prompt-node-view";constructor(e,t,o,r,i,n,s){super(e,t,new PromptNodeContentView(e.config),r,i,n,s)}setPrompts(e,t=null){this.content.setPrompts(e,t)}}export{ImageEditorPromptNodeView};
