import{d as B,s as f,i as v,o as c,aj as x,w as i,f as o,t as u,u as t,F as $,z as F,c as S,au as p,n as U}from"./Dih1Xbo1.js";import{_ as h}from"./B9xh2bS3.js";import D from"./BPDC05Hd.js";import{_ as L}from"./PX4grvR7.js";import{u as O}from"./DSufQG8x.js";import"./DXKf4i4_.js";import"./A_4S9xP3.js";import"./Bh0_f5g3.js";import"./DoX2iuhV.js";import"./DPsH4b_L.js";import"./Bf7bwUep.js";const T=p(h),j=p(D),A=p(L),N=["id"],z={px1:""},G={class:"flex flex-col gap-4 text-base"},P={class:""},I={class:"mr-1 font-mono mb-0.5"},M={class:"max-w-120 op-80 truncate"},ot=B({__name:"BindingComponentEditor",props:{contentRef:{type:[String,Object,Function]},view:{},getPos:{type:Function},setAttrs:{type:Function},node:{},selected:{},decorations:{},innerDecorations:{}},setup(g){const w=g,{frontmatter:d,frontmatterDoc:_,getComponentProps:V}=O(),{model:e,mdcAttrs:a}=V(w,{value:{type:String},defaultValue:{type:String}}),l=f(()=>e.value?.replace("$doc.","")),b=f(()=>_.value[l.value]||d.value[l.value]||e.value?.defaultValue);function k(m){a.value=`$doc.${m}`}return(m,n)=>{const C=T,E=j,y=A;return c(),v("span",{id:t(e).id,class:U(["group relative",t(e).class]),contenteditable:"false"},[x(y,{tooltip:`${t(e).value}`,"tooltip-classes":"pt1","bg-active":"",rounded:"","inline-block":""},{menu:i(()=>[o("div",G,[o("div",P,[n[1]||(n[1]=o("label",{class:"LABEL"},"Frontmatter value",-1)),(c(!0),v($,null,F({...t(d),...t(_)},(r,s)=>(c(),S(C,{key:s,pressed:l.value===s,class:"rounded TOGGLE_BUTTON text-sm w-full justify-start",onClick:R=>k(s)},{default:i(()=>[o("span",I,u(s)+":",1),o("span",M,u(r),1)]),_:2},1032,["pressed","onClick"]))),128))]),x(E,{modelValue:t(a).defaultValue,"onUpdate:modelValue":n[0]||(n[0]=r=>t(a).defaultValue=r),label:"default value",classes:"flex-col items-start!","input-classes":"w-full max-w-full text-base"},null,8,["modelValue"])])]),default:i(()=>[o("span",z,u(b.value||t(e).defaultValue),1)]),_:1},8,["tooltip"])],10,N)}}});export{ot as default};
