var p=Object.defineProperty;var s=(t,a)=>p(t,"name",{value:a,configurable:!0});import{bq as c,cF as v,cG as w,r as n,E as g,c as k,d as b,e as V,l as M,s as $,v as y,z as x,I as i,br as B,n as h}from"./vendor-other-Cmk2i5tl.js";import{a9 as z}from"./vendor-primevue-CyfaM-iT.js";import{bp as E}from"./index-ClJ8cazm.js";import"./vendor-vue-D63Y1BGo.js";import"./vendor-xterm-CWYFmgbN.js";import"./vendor-three-ClVfPtHN.js";import"./vendor-tiptap-B-QhEHeV.js";const H=["innerHTML"],G=c({__name:"WidgetMarkdown",props:v({widget:{}},{modelValue:{default:""},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=w(t,"modelValue"),l=n(!1),r=n(),d=g(()=>E(a.value||"")),u=s(async()=>{l.value||t.widget.options?.read_only||(l.value=!0,await h(),r.value?.$el?.focus())},"startEditing"),m=s(()=>{l.value=!1},"handleBlur");return(o,e)=>(b(),k("div",{class:"widget-markdown relative w-full",onDblclick:u},[V("div",{class:$(["comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm",l.value===!1?"visible":"invisible"]),innerHTML:d.value},null,10,H),M(x(B(z),{ref_key:"textareaRef",ref:r,modelValue:a.value,"onUpdate:modelValue":e[0]||(e[0]=f=>a.value=f),"aria-label":`${o.$t("g.edit")} ${o.widget.name||o.$t("g.markdown")} ${o.$t("g.content")}`,class:"absolute inset-0 min-h-[60px] w-full resize-none",pt:{root:{class:"text-sm w-full h-full",onBlur:m}},"data-capture-wheel":"true",onClick:e[1]||(e[1]=i(()=>{},["stop"])),onKeydown:e[2]||(e[2]=i(()=>{},["stop"]))},null,8,["modelValue","aria-label","pt"]),[[y,l.value]])],32))}});export{G as default};
//# sourceMappingURL=WidgetMarkdown-Ck5ZYtD-.js.map
