import"./rolldown-runtime-DIIn1E2Q.js";import{o as e}from"./vendor-primevue-_eYbXsHY.js";import{Bt as t,D as n,G as r,I as i,O as a,R as o,Rt as s,b as c,et as l,j as u,kt as d,q as f,ut as p,v as m,vt as h}from"./vendor-vue-core-DO0afONr.js";import"./vendor-markdown-Da9QPS2x.js";import{t as g}from"./markdownRendererUtil-PltcX2Bi.js";var _=[`innerHTML`],v=o({__name:`WidgetMarkdown`,props:r({widget:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(r){let o=p(r,`modelValue`),v=d(!1),y=d(),b=n(()=>g(o.value||``)),startEditing=async()=>{v.value||r.widget.options?.read_only||(v.value=!0,await f(),y.value?.$el?.focus())},handleBlur=()=>{v.value=!1};return(n,r)=>(l(),u(`div`,{class:`widget-markdown relative w-full`,onDblclick:startEditing},[a(`div`,{class:t([`comfy-markdown-content size-full min-h-[60px] overflow-y-auto rounded-lg text-sm`,v.value===!1?`visible`:`invisible`]),tabindex:`0`,"data-capture-wheel":`true`,innerHTML:b.value},null,10,_),h(i(s(e),{ref_key:`textareaRef`,ref:y,modelValue:o.value,"onUpdate:modelValue":r[0]||=e=>o.value=e,"aria-label":`${n.$t(`g.edit`)} ${n.widget.name||n.$t(`g.markdown`)} ${n.$t(`g.content`)}`,class:`absolute inset-0 min-h-[60px] w-full resize-none`,pt:{root:{class:`text-sm w-full h-full`,onBlur:handleBlur}},"data-capture-wheel":`true`,onPointerdownCapture:r[1]||=c(()=>{},[`stop`]),onPointermoveCapture:r[2]||=c(()=>{},[`stop`]),onPointerupCapture:r[3]||=c(()=>{},[`stop`]),onClick:r[4]||=c(()=>{},[`stop`]),onKeydown:r[5]||=c(()=>{},[`stop`])},null,8,[`modelValue`,`aria-label`,`pt`]),[[m,v.value]])],32))}});export{v as default};
//# sourceMappingURL=WidgetMarkdown-DbMcnMPF.js.map