@gemafajarramadhan/dynamic-ui 1.4.46 → 1.4.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -124,12 +124,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`),se=te,ce=re),ge===void
124
124
  .dcode-datetimepicker-popover * {
125
125
  pointer-events: auto !important;
126
126
  }
127
- `.trim();let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r)),r.textContent=i}function Pf(e,t=oS){o.watch(e,n=>lW(n,t),{immediate:!0})}const cW=["for"],dW={key:0,class:"ml-1 text-destructive"},uW=["disabled"],fW={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},hW=["id","value","placeholder","disabled","readonly"],mW={key:0,class:"border-r border-gray-200 dark:border-neutral-700 p-2 flex flex-col gap-2 w-32 bg-gray-50/50 dark:bg-neutral-900/50 rounded-l-lg"},pW=["onClick"],gW={class:"px-3 py-3 text-center border-b border-gray-100 dark:border-neutral-800 text-sm text-gray-600 dark:text-gray-400"},yW={key:0},bW={key:1},vW={key:0},wW={key:1},_W={key:2},kW={class:"flex items-center justify-between px-3 pt-3 pb-2 text-primary"},xW={class:"text-center font-bold text-gray-800 dark:text-gray-100 pb-3"},EW={class:"px-2 pb-2"},CW={class:"grid grid-cols-7 mb-2 text-center"},SW=["onClick","onMouseenter"],AW={key:0,class:"text-xs text-destructive mt-1"},eg=o.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},label:{default:""},placeholder:{default:"Pilih tanggal"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},labelPosition:{default:"top"},labelWidth:{default:"150px"}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-datepicker-${n.id||i.label||"date-picker"}-${s}`),l=o.computed(()=>{const Ce=n.required,ne=n["aria-required"];return Ce===""||Ce===!0||Ce==="true"||ne==="true"||ne===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:Ce=>{r("update:modelValue",Ce),r("change",Ce)}}),f=o.computed(()=>i.locale==="en"?Af:zv),h=o.computed(()=>{if(i.disablePast)return on(new Date)}),m=o.computed(()=>{if(i.maxDaysAhead&&i.maxDaysAhead>0)return Aa(xr(new Date,i.maxDaysAhead))}),g=o.ref(!1);let v=null;o.onMounted(()=>{const Ce=document.documentElement,ne=()=>g.value=Ce.classList.contains("dark");ne(),v=new MutationObserver(ne),v.observe(Ce,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{v==null||v.disconnect(),v=null}),Pf(o.toRef(i,"tone"));const y=o.ref(!1),A=o.ref(null),C=o.ref(null),M=o.ref(null),B=o.ref(null),N=o.ref(!1),j=o.ref(""),{floatingStyles:W,isPositioned:P}=Ju(M,C,{strategy:"fixed",placement:o.computed(()=>i.placement||"bottom-start"),whileElementsMounted:Ku,transform:!1,middleware:[Gu(4),Zu({padding:8}),Yu({padding:8})]}),E=o.computed(()=>({...W.value,zIndex:99999,pointerEvents:"auto",visibility:P.value?"visible":"hidden"}));Gn.onClickOutside(A,()=>{y.value&&I()},{ignore:[C]});const k=()=>{i.disabled||i.readonly||(y.value=!0,F())},$=()=>{i.disabled||i.readonly||(y.value?I():k())},I=()=>{y.value=!1},O=Ce=>{if(!Ce)return null;const ne=Os(Ce,i.modelType,new Date);return Hr(ne)?on(ne):null},q=(Ce,ne=i.modelType)=>qo(Ce,ne,{locale:f.value}),X=o.computed(()=>{if(!d.value)return[];if(i.range&&Array.isArray(d.value)){const Ce=O(d.value[0]),ne=O(d.value[1]),ye=[];return Ce&&ye.push(Ce),ne&&ye.push(ne),ye}else if(!i.range&&typeof d.value=="string"){const Ce=O(d.value);return Ce?[Ce]:[]}return[]}),oe=o.computed(()=>i.range?X.value.length===2?`${q(X.value[0],i.displayFormat)} - ${q(X.value[1],i.displayFormat)}`:"":X.value.length===1?q(X.value[0],i.displayFormat):"");o.watch(oe,Ce=>{N.value||(j.value=Ce||"")},{immediate:!0});const ue=Ce=>{if(!Ce||!Ce.trim())return null;const ne=Ce.trim();if(/^\d{8}$/.test(ne)){if(ne.startsWith("19")||ne.startsWith("20"))try{const $e=Os(ne,"yyyyMMdd",new Date);if(Hr($e))return on($e)}catch{}try{const $e=Os(ne,"ddMMyyyy",new Date);if(Hr($e))return on($e)}catch{}}const ye=[i.displayFormat,i.modelType,"dd/MM/yyyy","dd-MM-yyyy","yyyy-MM-dd","yyyy/MM/dd","d/M/yyyy","d-M-yyyy","dd MMMM yyyy","d MMMM yyyy","MMMM dd, yyyy","MMM dd, yyyy"].filter(Boolean),Me=Array.from(new Set(ye));for(const $e of Me)try{const He=Os(ne,$e,new Date,{locale:f.value});if(Hr(He)){const rt=He.getFullYear();if(rt>=1900&&rt<=2100)return on(He)}}catch{}const Ke=new Date(ne);if(Hr(Ke)){const $e=Ke.getFullYear();if($e>=1900&&$e<=2100)return on(Ke)}return null},te=Ce=>{const ne=Ce.split(/\s+-\s+|\s+to\s+|\s*,\s*/);if(ne.length===2){const ye=ue(ne[0]),Me=ue(ne[1]);if(ye&&Me)return qr(ye,Me)?[Me,ye]:[ye,Me]}return null},re=(Ce,ne=!1)=>{const ye=Ce.trim();if(!ye){ne&&(i.clearable?Ie():j.value=oe.value);return}if(i.range){const Me=te(ye);if(Me){const[Ke,$e]=Me;if(K.value=Li(Ke),ne){if(be(Ke)||be($e)){j.value=oe.value;return}let He=$e;if(i.autoRangeDays&&i.autoRangeDays>0){const rt=Aa(xr(Ke,i.autoRangeDays-1));qr(He,rt)&&(He=on(rt))}d.value=[q(Ke),q(He)],we.value=null,j.value=oe.value}}else ne&&(j.value=oe.value)}else{const Me=ue(ye);if(Me){if(K.value=Li(Me),ne){if(be(Me)){j.value=oe.value;return}d.value=q(Me),j.value=oe.value}}else ne&&(j.value=oe.value)}},ge=Ce=>{var ye;if(i.disabled||i.readonly)return;const ne=Ce.target;ne.tagName==="INPUT"||ne.closest("button")||((ye=B.value)==null||ye.focus(),y.value||k())},ce=()=>{i.disabled||i.readonly||(N.value=!0,y.value||k())},se=()=>{i.disabled||i.readonly||y.value||k()},z=()=>{N.value=!1,re(j.value,!0)},G=Ce=>{const ne=Ce.target;j.value=ne.value,re(ne.value,!1)},ee=Ce=>{Ce.key==="Enter"?(Ce.preventDefault(),re(j.value,!0),I()):Ce.key==="Escape"&&(Ce.preventDefault(),j.value=oe.value,I())},K=o.ref(Li(new Date)),Y=o.ref(null),F=()=>{if(X.value.length>0)K.value=Li(X.value[0]);else if(j.value){const Ce=ue(j.value);if(Ce){K.value=Li(Ce);return}K.value=Li(new Date)}else K.value=Li(new Date)},_=()=>{K.value=Vp(K.value,10)},b=()=>{K.value=Vp(K.value,1)},R=()=>{K.value=Qp(K.value)},S=()=>{K.value=Li(new Date)},T=()=>{K.value=yd(K.value,1)},D=()=>{K.value=Sf(K.value,1)},Z=()=>{K.value=Sf(K.value,10)},J=o.computed(()=>qo(K.value,"MMMM yyyy",{locale:f.value})),fe=o.computed(()=>{const Ce=Be(new Date);return Array.from({length:7}).map((ne,ye)=>{const Me=xr(Ce,ye);return{name:qo(Me,"E",{locale:f.value}),isWeekend:Gp(Me)}})}),ae=o.computed(()=>{const Ce=Li(K.value),ne=X2(Ce),ye=Zp(K.value),Me=[],Ke=Qp(K.value),$e=Zp(Ke);for(let Ve=ne-1;Ve>=0;Ve--)Me.push({date:on(new Date(Ke.getFullYear(),Ke.getMonth(),$e-Ve)),isCurrentMonth:!1});for(let Ve=1;Ve<=ye;Ve++)Me.push({date:on(new Date(K.value.getFullYear(),K.value.getMonth(),Ve)),isCurrentMonth:!0});const He=42-Me.length,rt=yd(K.value,1);for(let Ve=1;Ve<=He;Ve++)Me.push({date:on(new Date(rt.getFullYear(),rt.getMonth(),Ve)),isCurrentMonth:!1});return Me}),we=o.ref(null),pe=Ce=>{if(!be(Ce))if(i.range)if(!we.value)we.value=Ce,d.value=null;else{const ne=we.value,ye=Ce;let Me=ne,Ke=ye;if(qr(ne,ye)&&(Me=ye,Ke=ne),i.autoRangeDays&&i.autoRangeDays>0){const $e=Aa(xr(Me,i.autoRangeDays-1));qr(Ke,$e)&&(Ke=on($e))}d.value=[q(Me),q(Ke)],we.value=null,I()}else d.value=q(Ce),I()},ke=Ce=>{Y.value=Ce},be=Ce=>{if(h.value&&Pa(on(Ce),on(h.value))||m.value&&qr(on(Ce),on(m.value)))return!0;if(i.range&&we.value&&i.autoRangeDays&&i.autoRangeDays>0){const ne=on(xr(we.value,i.autoRangeDays-1)),ye=on(tS(we.value,i.autoRangeDays-1));if(qr(on(Ce),ne)||Pa(on(Ce),ye))return!0}return!1},Se=Ce=>{if(i.range){if(X.value.length===2)return Wr(Ce,X.value[0])||Wr(Ce,X.value[1]);if(we.value)return Wr(Ce,we.value)}else if(X.value.length===1)return Wr(Ce,X.value[0]);return!1},ve=Ce=>{if(!i.range)return!1;if(X.value.length===2)return qr(Ce,X.value[0])&&Pa(Ce,X.value[1])||Wr(Ce,X.value[0])||Wr(Ce,X.value[1]);if(we.value&&Y.value){const ne=we.value;let ye=Y.value;if(i.autoRangeDays&&i.autoRangeDays>0){const $e=xr(ne,i.autoRangeDays-1),He=tS(ne,i.autoRangeDays-1);qr(ye,$e)&&(ye=$e),Pa(ye,He)&&(ye=He)}let Me=ne,Ke=ye;return qr(Me,Ke)&&(Me=ye,Ke=ne),qr(Ce,Me)&&Pa(Ce,Ke)||Wr(Ce,Me)||Wr(Ce,Ke)}return!1},Be=Ce=>{const ne=new Date(Ce),ye=ne.getDay(),Me=ne.getDate()-ye;return on(new Date(ne.setDate(Me)))},Ee=Ce=>{const ne=Be(Ce);return Aa(xr(ne,6))},Oe=Ce=>on(Li(Ce)),Ae=Ce=>Aa(new Date(Ce.getFullYear(),Ce.getMonth()+1,0)),Re=o.computed(()=>{if(!i.range)return[];const Ce=new Date,ne=on(Ce),ye=(Me,Ke)=>{let $e=Me;i.disablePast&&Pa($e,ne)&&($e=ne);let He=Ke;if(i.autoRangeDays&&i.autoRangeDays>0){const rt=Aa(xr($e,i.autoRangeDays-1));qr(He,rt)&&(He=rt)}return Pa(He,$e)&&(He=Aa($e)),[$e,He]};return[{label:i.locale==="id"?"Minggu Ini":"This Week",range:ye(Be(Ce),Ee(Ce))},{label:i.locale==="id"?"Bulan Ini":"This Month",range:ye(Oe(Ce),Ae(Ce))}]}),De=Ce=>{Ce.length<2||(d.value=[q(Ce[0]),q(Ce[1])],we.value=null,K.value=Li(Ce[0]),I())},Ie=()=>{d.value=null,we.value=null,j.value="",r("clear")};return(Ce,ne)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full relative",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]]),ref_key:"wrapperRef",ref:A},[e.skeleton?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:"h-4 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{width:"8rem"})},null,4)):o.createCommentVNode("",!0),ne[1]||(ne[1]=o.createElementVNode("div",{class:"h-10 w-full flex-1 rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],2)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",{class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{})},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",dW,"*")):o.createCommentVNode("",!0)],12,cW)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"relative w-full flex-1",ref_key:"inputContainerRef",ref:M},[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",y.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:ge},[o.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.disabled||e.readonly,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer disabled:cursor-not-allowed",onClick:o.withModifiers($,["stop"])},[o.createVNode(o.unref(Ne.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,uW),ne[3]||(ne[3]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",fW,o.toDisplayString(e.prependInner),1),ne[2]||(ne[2]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{ref_key:"inputRef",ref:B,id:a.value,type:"text",value:j.value,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,autocomplete:"off",class:"flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none cursor-text disabled:cursor-not-allowed",onFocus:ce,onBlur:z,onInput:G,onKeydown:ee,onClick:se},null,40,hW),e.clearable&&(d.value||j.value)&&!e.disabled&&!e.readonly?(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",onClick:o.withModifiers(Ie,["stop"]),class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer"},[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"})])):o.createCommentVNode("",!0)],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[y.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:C,"data-dcode-datepicker-popover":"true",style:o.normalizeStyle(E.value),class:"dcode-datepicker-popover pointer-events-auto font-sans bg-white dark:bg-neutral-900 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-xl flex min-w-max max-h-[calc(100vh-24px)] overflow-y-auto"},[e.range&&Re.value.length?(o.openBlock(),o.createElementBlock("div",mW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Re.value,ye=>(o.openBlock(),o.createElementBlock("button",{key:ye.label,type:"button",class:"w-full text-left text-sm px-3 py-2 rounded-md hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors",onClick:Me=>De(ye.range)},o.toDisplayString(ye.label),9,pW))),128))])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["p-0 flex flex-col w-[300px] select-none bg-white dark:bg-neutral-900",[e.range&&Re.value.length?"rounded-r-lg":"rounded-lg"]])},[o.createElementVNode("div",gW,[X.value.length===0&&!we.value?(o.openBlock(),o.createElementBlock("span",yW,"No date selected")):i.range?(o.openBlock(),o.createElementBlock("span",bW,[we.value?(o.openBlock(),o.createElementBlock("span",vW,o.toDisplayString(q(we.value,"MMM dd, yyyy"))+" - ...",1)):(o.openBlock(),o.createElementBlock("span",wW,o.toDisplayString(q(X.value[0],"MMM dd"))+" - "+o.toDisplayString(q(X.value[1],"MMM dd, yyyy")),1))])):(o.openBlock(),o.createElementBlock("span",_W,o.toDisplayString(q(X.value[0],"MMMM dd, yyyy")),1))]),o.createElementVNode("div",kW,[o.createElementVNode("button",{type:"button",onClick:_,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronFirst),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:b,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronsLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:R,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:S,class:"w-7 h-7 flex items-center justify-center rounded bg-primary/10 dark:bg-primary/20 text-primary hover:bg-primary/20 dark:hover:bg-primary/30 transition-colors focus:outline-none",title:"Hari Ini"},[...ne[4]||(ne[4]=[o.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-current"},null,-1)])]),o.createElementVNode("button",{type:"button",onClick:T,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Berikutnya"},[o.createVNode(o.unref(Ne.ChevronRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:D,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Berikutnya"},[o.createVNode(o.unref(Ne.ChevronsRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:Z,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Berikutnya"},[o.createVNode(o.unref(Ne.ChevronLast),{class:"w-4 h-4"})])]),o.createElementVNode("div",xW,o.toDisplayString(J.value),1),o.createElementVNode("div",EW,[o.createElementVNode("div",CW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(fe.value,ye=>(o.openBlock(),o.createElementBlock("div",{key:ye.name,class:o.normalizeClass(["text-xs font-semibold",ye.isWeekend?"text-red-600 dark:text-red-400":"text-gray-700 dark:text-gray-300"])},o.toDisplayString(ye.name),3))),128))]),o.createElementVNode("div",{class:"grid grid-cols-7 text-center gap-y-0.5",onMouseleave:ne[0]||(ne[0]=ye=>Y.value=null)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ae.value,(ye,Me)=>(o.openBlock(),o.createElementBlock("div",{key:Me,class:o.normalizeClass(["relative w-full h-8 flex items-center justify-center text-sm",[ve(ye.date)?"bg-gray-100 dark:bg-neutral-800":"",be(ye.date)?"opacity-30 cursor-not-allowed":"cursor-pointer"]]),onClick:Ke=>pe(ye.date),onMouseenter:Ke=>ke(ye.date)},[o.createElementVNode("div",{class:o.normalizeClass(["w-7 h-7 flex items-center justify-center rounded-full transition-colors",[Se(ye.date)?"bg-gray-100 text-gray-900 font-bold border border-gray-300 dark:bg-neutral-700 dark:text-white dark:border-neutral-500":ve(ye.date)?"bg-gray-50 dark:bg-neutral-800":o.unref(Wr)(ye.date,new Date)?"font-bold text-blue-600 dark:text-blue-400":"hover:bg-gray-200 dark:hover:bg-neutral-700",ye.isCurrentMonth?Se(ye.date)?"":o.unref(Gp)(ye.date)?"text-red-600 dark:text-red-400 font-medium":"text-gray-700 dark:text-gray-200":"text-gray-400 dark:text-gray-500"]])},o.toDisplayString(o.unref(qo)(ye.date,"d")),3)],42,SW))),128))],32)]),ne[5]||(ne[5]=o.createElementVNode("div",{class:"border-t border-gray-100 dark:border-neutral-800 px-3 py-2 text-xs text-center text-gray-600 dark:text-gray-400 bg-gray-50/50 dark:bg-neutral-900/50 rounded-b-lg"}," Use cursor keys to navigate calendar dates ",-1))],2)],4)):o.createCommentVNode("",!0)]))],512)],2),c.value?(o.openBlock(),o.createElementBlock("p",AW,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),TW={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer"},PW=["for"],BW={key:0,class:"ml-1 text-destructive"},NW={type:"button",tabindex:"-1",class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none pointer-events-none"},DW={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},MW=["id","value","placeholder","disabled","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],RW={class:"flex items-center justify-end gap-2 w-full p-2"},IW=["disabled","onClick"],OW={key:1,class:"text-xs text-destructive"},tg=o.defineComponent({name:"DCodeTimePicker",inheritAttrs:!1,__name:"DCodeTimePicker",props:{modelValue:{},label:{default:""},placeholder:{default:"Pilih waktu"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},displayFormat:{default:"HH:mm"},modelType:{default:"HH:mm"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},is24:{type:Boolean,default:!0},enableSeconds:{type:Boolean,default:!1},minutesIncrement:{default:1}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-timepicker-${n.id||i.label||"time-picker"}-${s}`),l=o.computed(()=>{const B=n.required,N=n["aria-required"];return B===""||B===!0||B==="true"||N==="true"||N===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:B=>{r("update:modelValue",B),r("change",B)}}),f=o.computed(()=>i.displayFormat!=="HH:mm"?i.displayFormat:i.enableSeconds?"HH:mm:ss":"HH:mm"),h=o.computed(()=>i.modelType!=="HH:mm"?i.modelType:i.enableSeconds?"HH:mm:ss":"HH:mm"),m=o.ref(null),g=o.ref(!1),v=()=>{!i.disabled&&m.value&&m.value.toggleMenu()},y=()=>{g.value=!0},A=()=>{g.value=!1},C=o.ref(!1);let M=null;return o.onMounted(()=>{const B=document.documentElement,N=()=>C.value=B.classList.contains("dark");N(),M=new MutationObserver(N),M.observe(B,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{M==null||M.disconnect(),M=null}),Pf(o.toRef(i,"tone")),(B,N)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]])},[e.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.label?(o.openBlock(),o.createElementBlock("div",TW)):o.createCommentVNode("",!0),N[2]||(N[2]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",BW,"*")):o.createCommentVNode("",!0)],8,PW)):o.createCommentVNode("",!0),o.createVNode(o.unref(Z1.VueDatePicker),{ref_key:"dpRef",ref:m,modelValue:d.value,"onUpdate:modelValue":N[1]||(N[1]=j=>d.value=j),dark:C.value,disabled:e.disabled,clearable:!1,"time-picker":"","is-24":e.is24,"enable-seconds":e.enableSeconds,"minutes-increment":e.minutesIncrement,"auto-apply":!0,"model-type":h.value,format:f.value,floating:{placement:e.placement,offset:4,arrow:!1,flip:!0,shift:!0},teleport:!0,"menu-class-name":"dcode-timepicker-menu",onOpen:y,onClose:A},{"dp-input":o.withCtx(({value:j,onInput:W,onEnter:P,onTab:E,onBlur:k,onFocus:$,onKeypress:I,onPaste:O})=>[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600 cursor-pointer",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",g.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:o.withModifiers(v,["stop"])},[o.createElementVNode("button",NW,[o.createVNode(o.unref(Ne.Clock),{class:"w-4 h-4 pointer-events-none"})]),N[4]||(N[4]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",DW,o.toDisplayString(e.prependInner),1),N[3]||(N[3]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:a.value,value:j,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:o.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",e.disabled?"cursor-not-allowed":e.readonly?"cursor-default":"cursor-pointer"]),onFocus:q=>$(),onBlur:q=>k(),onInput:q=>W(q),onKeydown:[o.withKeys(q=>P(q),["enter"]),o.withKeys(q=>E(q),["tab"])],onKeypress:q=>I(q),onPaste:q=>O()},null,42,MW)],2)]),"action-buttons":o.withCtx(({selectDate:j,selectionDisabled:W})=>[o.createElementVNode("div",RW,[o.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:N[0]||(N[0]=P=>{var E;return(E=m.value)==null?void 0:E.closeMenu()})},o.toDisplayString(e.cancelLabel),1),o.createElementVNode("button",{type:"button",disabled:W,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:P=>j()},o.toDisplayString(e.selectLabel),9,IW)])]),_:1},8,["modelValue","dark","disabled","is-24","enable-seconds","minutes-increment","model-type","format","floating"]),c.value?(o.openBlock(),o.createElementBlock("p",OW,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),LW=["for"],FW={key:0,class:"ml-1 text-destructive"},$W=["disabled"],zW={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},jW=["id","value","placeholder","disabled","readonly"],UW={class:"px-3 py-3 text-center border-b border-gray-100 dark:border-neutral-800 text-sm font-medium text-gray-700 dark:text-gray-200 bg-gray-50/50 dark:bg-neutral-900/50 rounded-t-lg"},WW={class:"p-0 flex flex-col select-none"},HW={class:"flex items-center justify-between px-3 pt-3 pb-2 text-primary"},qW={class:"text-center font-bold text-gray-800 dark:text-gray-100 pb-3"},KW={class:"px-2 pb-2 border-b border-gray-100 dark:border-neutral-800"},GW={class:"grid grid-cols-7 mb-2 text-center"},YW={class:"grid grid-cols-7 text-center gap-y-0.5"},ZW=["onClick"],XW={class:"px-4 py-3 flex items-center justify-center gap-2 bg-gray-50/30 dark:bg-neutral-900/30"},JW={class:"flex items-center gap-1 border border-gray-300 dark:border-neutral-700 rounded bg-white dark:bg-neutral-800 focus-within:ring-1 focus-within:ring-primary pl-2 pr-1 py-1"},QW=["value"],VW={class:"flex flex-col"},eH={class:"flex items-center gap-1 border border-gray-300 dark:border-neutral-700 rounded bg-white dark:bg-neutral-800 focus-within:ring-1 focus-within:ring-primary pl-2 pr-1 py-1"},tH=["value"],nH={class:"flex flex-col"},iH={class:"flex items-center gap-1 border border-gray-300 dark:border-neutral-700 rounded bg-white dark:bg-neutral-800 focus-within:ring-1 focus-within:ring-primary pl-2 pr-1 py-1"},rH=["value"],oH={class:"flex flex-col"},sH={class:"px-3 py-2 flex justify-end gap-2 border-t border-gray-100 dark:border-neutral-800 bg-white dark:bg-neutral-900"},aH={key:0,class:"text-xs text-destructive mt-1"},ng=o.defineComponent({name:"DCodeDateTimePicker",inheritAttrs:!1,__name:"DCodeDateTimePicker",props:{modelValue:{},label:{default:""},placeholder:{default:"Pilih tanggal & waktu"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},displayFormat:{default:"dd/MM/yyyy HH:mm"},modelType:{default:"yyyy-MM-dd HH:mm"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},is24:{type:Boolean,default:!0},enableSeconds:{type:Boolean,default:!1},minutesIncrement:{default:1},labelPosition:{default:"top"},labelWidth:{default:"150px"}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-datetimepicker-${n.id||i.label||"datetime-picker"}-${s}`),l=o.computed(()=>{const Fe=n.required,Ue=n["aria-required"];return Fe===""||Fe===!0||Fe==="true"||Ue==="true"||Ue===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:Fe=>{r("update:modelValue",Fe),r("change",Fe)}}),f=o.computed(()=>i.locale==="en"?Af:zv),h=o.computed(()=>{if(i.disablePast)return on(new Date)}),m=o.computed(()=>{if(i.maxDaysAhead&&i.maxDaysAhead>0)return Aa(xr(new Date,i.maxDaysAhead))}),g=o.computed(()=>i.displayFormat!=="dd/MM/yyyy HH:mm"?i.displayFormat:i.enableSeconds?"dd/MM/yyyy HH:mm:ss":"dd/MM/yyyy HH:mm"),v=o.computed(()=>i.modelType!=="yyyy-MM-dd HH:mm"?i.modelType:i.enableSeconds?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd HH:mm"),y=o.ref(!1);let A=null;o.onMounted(()=>{const Fe=document.documentElement,Ue=()=>y.value=Fe.classList.contains("dark");Ue(),A=new MutationObserver(Ue),A.observe(Fe,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{A==null||A.disconnect(),A=null}),Pf(o.toRef(i,"tone"));const C=o.ref(!1),M=o.ref(null),B=o.ref(null),N=o.ref(null),j=o.ref(null),W=o.ref(!1),P=o.ref(""),{floatingStyles:E,isPositioned:k}=Ju(N,B,{strategy:"fixed",placement:o.computed(()=>i.placement||"bottom-start"),whileElementsMounted:Ku,transform:!1,middleware:[Gu(4),Zu({padding:8}),Yu({padding:8})]}),$=o.computed(()=>({...E.value,zIndex:99999,pointerEvents:"auto",visibility:k.value?"visible":"hidden"}));Gn.onClickOutside(M,()=>{C.value&&q()},{ignore:[B]});const I=()=>{i.disabled||i.readonly||(C.value=!0,T())},O=()=>{i.disabled||i.readonly||(C.value?q():I())},q=()=>{C.value=!1},X=Fe=>{if(!Fe)return null;const Ue=Os(Fe,v.value,new Date);return Hr(Ue)?Ue:null},oe=(Fe,Ue=v.value)=>qo(Fe,Ue,{locale:f.value}),ue=o.computed(()=>X(d.value)),te=o.computed(()=>ue.value?oe(ue.value,g.value):"");o.watch(te,Fe=>{W.value||(P.value=Fe||"")},{immediate:!0});const re=Fe=>{if(!Fe||!Fe.trim())return null;const Ue=Fe.trim();if(/^\d{8}$/.test(Ue)){let hn=null;if(Ue.startsWith("19")||Ue.startsWith("20"))try{const Jt=Os(Ue,"yyyyMMdd",new Date);Hr(Jt)&&(hn=Jt)}catch{}if(!hn)try{const Jt=Os(Ue,"ddMMyyyy",new Date);Hr(Jt)&&(hn=Jt)}catch{}if(hn){const Jt=Y.value?Y.value.getHours():0,cn=Y.value?Y.value.getMinutes():0,vn=Y.value?Y.value.getSeconds():0;return new Date(hn.getFullYear(),hn.getMonth(),hn.getDate(),Jt,cn,vn)}}const at=[g.value,v.value,"dd/MM/yyyy HH:mm:ss","dd/MM/yyyy HH:mm","dd-MM-yyyy HH:mm:ss","dd-MM-yyyy HH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd'T'HH:mm","yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","dd/MM/yyyy hh:mm a","dd/MM/yyyy h:mm a","dd-MM-yyyy hh:mm a","dd-MM-yyyy h:mm a"].filter(Boolean),nt=Array.from(new Set(at));for(const hn of nt)try{const Jt=Os(Ue,hn,new Date,{locale:f.value});if(Hr(Jt)){const cn=Jt.getFullYear();if(cn>=1900&&cn<=2100)return Jt}}catch{}const Tt=["dd/MM/yyyy","dd-MM-yyyy","yyyy-MM-dd","yyyy/MM/dd","d/M/yyyy","d-M-yyyy","dd MMMM yyyy","d MMMM yyyy","MMMM dd, yyyy","MMM dd, yyyy"];for(const hn of Tt)try{const Jt=Os(Ue,hn,new Date,{locale:f.value});if(Hr(Jt)){const cn=Jt.getFullYear();if(cn>=1900&&cn<=2100){const vn=Y.value?Y.value.getHours():0,gr=Y.value?Y.value.getMinutes():0,Do=Y.value?Y.value.getSeconds():0;return new Date(Jt.getFullYear(),Jt.getMonth(),Jt.getDate(),vn,gr,Do)}}}catch{}const fi=new Date(Ue);if(Hr(fi)){const hn=fi.getFullYear();if(hn>=1900&&hn<=2100)return fi}return null},ge=(Fe,Ue=!1)=>{const at=Fe.trim();if(!at){Ue&&(i.clearable?Ae():P.value=te.value);return}const nt=re(at);if(nt){if(Y.value=new Date(nt),F.value=nt.getHours()>=12?"PM":"AM",S.value=Li(nt),Ue){if(Ee(nt)){P.value=te.value;return}d.value=oe(nt),P.value=te.value}}else Ue&&(P.value=te.value)},ce=Fe=>{var at;if(i.disabled||i.readonly)return;const Ue=Fe.target;Ue.tagName==="INPUT"||Ue.closest("button")||((at=j.value)==null||at.focus(),C.value||I())},se=()=>{i.disabled||i.readonly||(W.value=!0,C.value||I())},z=()=>{i.disabled||i.readonly||C.value||I()},G=()=>{W.value=!1,ge(P.value,!0)},ee=Fe=>{const Ue=Fe.target;P.value=Ue.value,ge(Ue.value,!1)},K=Fe=>{Fe.key==="Enter"?(Fe.preventDefault(),ge(P.value,!0),q()):Fe.key==="Escape"&&(Fe.preventDefault(),P.value=te.value,q())},Y=o.ref(new Date),F=o.ref("AM"),_=o.computed({get:()=>{let Fe=Y.value.getHours();return i.is24||(Fe===0?Fe=12:Fe>12&&(Fe-=12)),Fe},set:Fe=>{let Ue=Fe;i.is24||(F.value==="PM"&&Ue<12&&(Ue+=12),F.value==="AM"&&Ue===12&&(Ue=0)),Y.value=$v(Y.value,Ue)}}),b=o.computed({get:()=>Y.value.getMinutes(),set:Fe=>{Y.value=DU(Y.value,Fe)}}),R=o.computed({get:()=>Y.value.getSeconds(),set:Fe=>{Y.value=MU(Y.value,Fe)}});o.watch(F,Fe=>{let Ue=Y.value.getHours();Fe==="PM"&&Ue<12?Y.value=$v(Y.value,Ue+12):Fe==="AM"&&Ue>=12&&(Y.value=$v(Y.value,Ue-12))});const S=o.ref(Li(new Date)),T=()=>{const Fe=ue.value||(P.value?re(P.value):null)||new Date;Y.value=new Date(Fe),F.value=Y.value.getHours()>=12?"PM":"AM",S.value=Li(Y.value)},D=()=>{S.value=Vp(S.value,10)},Z=()=>{S.value=Vp(S.value,1)},J=()=>{S.value=Qp(S.value)},fe=()=>{S.value=Li(new Date)},ae=()=>{S.value=yd(S.value,1)},we=()=>{S.value=Sf(S.value,1)},pe=()=>{S.value=Sf(S.value,10)},ke=o.computed(()=>qo(S.value,"MMMM yyyy",{locale:f.value})),be=o.computed(()=>{const Fe=Oe(new Date);return Array.from({length:7}).map((Ue,at)=>{const nt=xr(Fe,at);return{name:qo(nt,"E",{locale:f.value}),isWeekend:Gp(nt)}})}),Se=o.computed(()=>{const Fe=Li(S.value),Ue=X2(Fe),at=Zp(S.value),nt=[],Tt=Qp(S.value),fi=Zp(Tt);for(let cn=Ue-1;cn>=0;cn--)nt.push({date:on(new Date(Tt.getFullYear(),Tt.getMonth(),fi-cn)),isCurrentMonth:!1});for(let cn=1;cn<=at;cn++)nt.push({date:on(new Date(S.value.getFullYear(),S.value.getMonth(),cn)),isCurrentMonth:!0});const hn=42-nt.length,Jt=yd(S.value,1);for(let cn=1;cn<=hn;cn++)nt.push({date:on(new Date(Jt.getFullYear(),Jt.getMonth(),cn)),isCurrentMonth:!1});return nt}),ve=Fe=>{Ee(Fe)||(Y.value=new Date(Fe.getFullYear(),Fe.getMonth(),Fe.getDate(),Y.value.getHours(),Y.value.getMinutes(),Y.value.getSeconds()))},Be=()=>{d.value=oe(Y.value),P.value=te.value,q()},Ee=Fe=>!!(h.value&&Pa(on(Fe),on(h.value))||m.value&&qr(on(Fe),on(m.value))),Oe=Fe=>{const Ue=new Date(Fe),at=Ue.getDay(),nt=Ue.getDate()-at;return on(new Date(Ue.setDate(nt)))},Ae=()=>{d.value=null,P.value="",r("clear")},Re=()=>{let Fe=_.value;const Ue=i.is24?23:12,at=i.is24?0:1;Fe=Fe>=Ue?at:Fe+1,_.value=Fe},De=()=>{let Fe=_.value;const Ue=i.is24?23:12,at=i.is24?0:1;Fe=Fe<=at?Ue:Fe-1,_.value=Fe},Ie=Fe=>{const Ue=parseInt(Fe.target.value,10);if(!isNaN(Ue)){const at=i.is24?23:12,nt=i.is24?0:1;_.value=Math.max(nt,Math.min(at,Ue))}},Ce=()=>{let Fe=b.value;const Ue=i.minutesIncrement||1;Fe=Fe+Ue>=60?0:Fe+Ue,b.value=Fe},ne=()=>{let Fe=b.value;const Ue=i.minutesIncrement||1;Fe=Fe-Ue<0?60-Ue:Fe-Ue,b.value=Fe},ye=Fe=>{const Ue=parseInt(Fe.target.value,10);isNaN(Ue)||(b.value=Math.max(0,Math.min(59,Ue)))},Me=()=>{let Fe=R.value;Fe=Fe>=59?0:Fe+1,R.value=Fe},Ke=()=>{let Fe=R.value;Fe=Fe<=0?59:Fe-1,R.value=Fe},$e=Fe=>{const Ue=parseInt(Fe.target.value,10);isNaN(Ue)||(R.value=Math.max(0,Math.min(59,Ue)))},He=o.computed(()=>_.value.toString().padStart(2,"0")),rt=o.computed(()=>b.value.toString().padStart(2,"0")),Ve=o.computed(()=>R.value.toString().padStart(2,"0"));return(Fe,Ue)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full relative",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]]),ref_key:"wrapperRef",ref:M},[e.skeleton?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:"h-4 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{width:"8rem"})},null,4)):o.createCommentVNode("",!0),Ue[1]||(Ue[1]=o.createElementVNode("div",{class:"h-10 w-full flex-1 rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],2)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",{class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{})},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",FW,"*")):o.createCommentVNode("",!0)],12,LW)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"relative w-full flex-1",ref_key:"inputContainerRef",ref:N},[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",C.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:ce},[o.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.disabled||e.readonly,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer disabled:cursor-not-allowed",onClick:o.withModifiers(O,["stop"])},[o.createVNode(o.unref(Ne.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,$W),Ue[3]||(Ue[3]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",zW,o.toDisplayString(e.prependInner),1),Ue[2]||(Ue[2]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{ref_key:"inputRef",ref:j,id:a.value,type:"text",value:P.value,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,autocomplete:"off",class:"flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none cursor-text disabled:cursor-not-allowed",onFocus:se,onBlur:G,onInput:ee,onKeydown:K,onClick:z},null,40,jW),e.clearable&&(d.value||P.value)&&!e.disabled&&!e.readonly?(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",onClick:o.withModifiers(Ae,["stop"]),class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer"},[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"})])):o.createCommentVNode("",!0)],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[C.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:B,"data-dcode-datepicker-popover":"true",style:o.normalizeStyle($.value),class:"dcode-datetimepicker-popover pointer-events-auto font-sans bg-white dark:bg-neutral-900 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-xl flex flex-col min-w-[300px] max-h-[calc(100vh-24px)] overflow-y-auto"},[o.createElementVNode("div",UW,[o.createElementVNode("span",null,o.toDisplayString(oe(Y.value,g.value)),1)]),o.createElementVNode("div",WW,[o.createElementVNode("div",HW,[o.createElementVNode("button",{type:"button",onClick:D,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronFirst),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:Z,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronsLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:J,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:fe,class:"w-7 h-7 flex items-center justify-center rounded bg-primary/10 dark:bg-primary/20 text-primary hover:bg-primary/20 dark:hover:bg-primary/30 transition-colors focus:outline-none",title:"Hari Ini"},[...Ue[4]||(Ue[4]=[o.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-current"},null,-1)])]),o.createElementVNode("button",{type:"button",onClick:ae,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Berikutnya"},[o.createVNode(o.unref(Ne.ChevronRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:we,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Berikutnya"},[o.createVNode(o.unref(Ne.ChevronsRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:pe,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Berikutnya"},[o.createVNode(o.unref(Ne.ChevronLast),{class:"w-4 h-4"})])]),o.createElementVNode("div",qW,o.toDisplayString(ke.value),1),o.createElementVNode("div",KW,[o.createElementVNode("div",GW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(be.value,at=>(o.openBlock(),o.createElementBlock("div",{key:at.name,class:o.normalizeClass(["text-xs font-semibold",at.isWeekend?"text-red-600 dark:text-red-400":"text-gray-700 dark:text-gray-300"])},o.toDisplayString(at.name),3))),128))]),o.createElementVNode("div",YW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Se.value,(at,nt)=>(o.openBlock(),o.createElementBlock("div",{key:nt,class:o.normalizeClass(["relative w-full h-8 flex items-center justify-center text-sm",[Ee(at.date)?"opacity-30 cursor-not-allowed":"cursor-pointer"]]),onClick:Tt=>ve(at.date)},[o.createElementVNode("div",{class:o.normalizeClass(["w-7 h-7 flex items-center justify-center rounded-full transition-colors",[o.unref(Wr)(at.date,Y.value)?"bg-gray-100 text-gray-900 font-bold border border-gray-300 dark:bg-neutral-700 dark:text-white dark:border-neutral-500":o.unref(Wr)(at.date,new Date)?"font-bold text-blue-600 dark:text-blue-400":"hover:bg-gray-200 dark:hover:bg-neutral-700",at.isCurrentMonth?o.unref(Wr)(at.date,Y.value)?"":o.unref(Gp)(at.date)?"text-red-600 dark:text-red-400 font-medium":"text-gray-700 dark:text-gray-200":"text-gray-400 dark:text-gray-500"]])},o.toDisplayString(o.unref(qo)(at.date,"d")),3)],10,ZW))),128))])]),o.createElementVNode("div",XW,[o.createVNode(o.unref(Ne.Clock),{class:"w-4 h-4 text-gray-500 mr-2"}),o.createElementVNode("div",JW,[o.createElementVNode("input",{value:He.value,onChange:Ie,type:"text",class:"w-6 text-center bg-transparent text-sm outline-none text-gray-800 dark:text-gray-200",maxlength:"2"},null,40,QW),o.createElementVNode("div",VW,[o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Re,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronUp),{class:"w-3 h-3"})]),o.createElementVNode("button",{type:"button",onClick:o.withModifiers(De,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"w-3 h-3"})])])]),Ue[6]||(Ue[6]=o.createElementVNode("span",{class:"font-bold text-gray-500 dark:text-gray-400"},":",-1)),o.createElementVNode("div",eH,[o.createElementVNode("input",{value:rt.value,onChange:ye,type:"text",class:"w-6 text-center bg-transparent text-sm outline-none text-gray-800 dark:text-gray-200",maxlength:"2"},null,40,tH),o.createElementVNode("div",nH,[o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Ce,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronUp),{class:"w-3 h-3"})]),o.createElementVNode("button",{type:"button",onClick:o.withModifiers(ne,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"w-3 h-3"})])])]),e.enableSeconds?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[Ue[5]||(Ue[5]=o.createElementVNode("span",{class:"font-bold text-gray-500 dark:text-gray-400"},":",-1)),o.createElementVNode("div",iH,[o.createElementVNode("input",{value:Ve.value,onChange:$e,type:"text",class:"w-6 text-center bg-transparent text-sm outline-none text-gray-800 dark:text-gray-200",maxlength:"2"},null,40,rH),o.createElementVNode("div",oH,[o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Me,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronUp),{class:"w-3 h-3"})]),o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Ke,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"w-3 h-3"})])])])],64)):o.createCommentVNode("",!0),e.is24?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",onClick:Ue[0]||(Ue[0]=o.withModifiers(at=>F.value=F.value==="AM"?"PM":"AM",["stop"])),class:"bg-white dark:bg-neutral-800 border border-gray-300 dark:border-neutral-700 rounded text-sm px-2 py-1 outline-none hover:border-primary hover:text-primary focus:ring-1 focus:ring-primary text-gray-800 dark:text-gray-200 font-medium transition-colors ml-1"},o.toDisplayString(F.value),1))]),o.createElementVNode("div",sH,[o.createElementVNode("button",{type:"button",onClick:q,class:"px-3 py-1.5 text-sm font-medium rounded-md hover:bg-gray-100 dark:hover:bg-neutral-800 text-gray-700 dark:text-gray-300 transition-colors"},o.toDisplayString(e.cancelLabel),1),o.createElementVNode("button",{type:"button",onClick:Be,class:"px-3 py-1.5 text-sm font-medium rounded-md bg-primary text-white hover:bg-primary/90 transition-colors"},o.toDisplayString(e.selectLabel),1)]),Ue[7]||(Ue[7]=o.createElementVNode("div",{class:"border-t border-gray-100 dark:border-neutral-800 px-3 py-1.5 text-xs text-center text-gray-600 dark:text-gray-400 bg-gray-50/50 dark:bg-neutral-900/50 rounded-b-lg"}," Use cursor keys to navigate calendar dates ",-1))])],4)):o.createCommentVNode("",!0)]))],512)],2),c.value?(o.openBlock(),o.createElementBlock("p",aH,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),lH={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},cH=["for"],dH={key:0,class:"ml-1 text-destructive"},uH={class:"relative w-full"},fH={type:"button",tabindex:"-1",class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none pointer-events-none"},hH={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},mH=["id","value","placeholder","disabled"],pH={key:1,class:"text-xs text-destructive mt-1"},sS=o.defineComponent({name:"DCodeMonthPicker",inheritAttrs:!1,__name:"DCodeMonthPicker",props:{modelValue:{},label:{},placeholder:{default:"Pilih bulan"},clearable:{type:Boolean,default:!0},required:{type:Boolean},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!0},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},displayFormat:{default:"MM/yyyy"},modelType:{default:"yyyy-MM"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-monthpicker-${n.id||i.label||"month-picker"}-${s}`),l=o.computed(()=>{if(i.required)return!0;const M=n.required,B=n["aria-required"];return M===""||M===!0||M==="true"||B==="true"||B===!0}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:M=>{r("update:modelValue",M),r("change",M)}}),f=o.ref(!1),h=o.ref(!1);let m=null;o.onMounted(()=>{const M=document.documentElement,B=()=>f.value=M.classList.contains("dark");B(),m=new MutationObserver(B),m.observe(M,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{m==null||m.disconnect(),m=null});const g=o.computed(()=>i.locale==="id"?zv:Af);Pf(o.toRef(i,"tone"));const v=o.ref(null),y=o.ref(null),A=()=>{!i.disabled&&v.value&&v.value.toggleMenu()},C=M=>{y.value&&!y.value.contains(M.target)&&(h.value=!1)};return o.onMounted(()=>{window.addEventListener("click",C)}),o.onBeforeUnmount(()=>{window.removeEventListener("click",C)}),o.watch(d,()=>{h.value=!1}),(M,B)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"componentRef",ref:y,class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]])},[e.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.label?(o.openBlock(),o.createElementBlock("div",lH)):o.createCommentVNode("",!0),B[3]||(B[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",dH,"*")):o.createCommentVNode("",!0)],8,cH)):o.createCommentVNode("",!0),o.createElementVNode("div",uH,[o.createVNode(o.unref(Z1.VueDatePicker),{ref_key:"dpRef",ref:v,modelValue:d.value,"onUpdate:modelValue":B[0]||(B[0]=N=>d.value=N),dark:f.value,"month-picker":"",disabled:e.disabled,clearable:!1,"auto-apply":!0,locale:g.value,"model-type":e.modelType,formats:{input:e.displayFormat},floating:{placement:e.placement,offset:4,arrow:!1,flip:!0,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onOpen:B[1]||(B[1]=N=>h.value=!0),onClose:B[2]||(B[2]=N=>h.value=!1)},{"dp-input":o.withCtx(({value:N})=>[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-primary dark:focus-within:border-primary-600 cursor-pointer",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",h.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:o.withModifiers(A,["stop"])},[o.createElementVNode("button",fH,[o.createVNode(o.unref(Ne.Calendar),{class:"w-4 h-4"})]),B[5]||(B[5]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",hH,o.toDisplayString(e.prependInner),1),B[4]||(B[4]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:a.value,value:N,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:o.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none cursor-pointer pointer-events-none",e.disabled?"cursor-not-allowed":e.readonly?"cursor-default":"cursor-pointer"])},null,10,mH)],2)]),_:1},8,["modelValue","dark","disabled","locale","model-type","formats","floating"])]),c.value?(o.openBlock(),o.createElementBlock("p",pH,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2)),[[o.vShow,e.visible]])}}),gH={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer"},yH=["for"],bH={key:0,class:"ml-1 text-destructive"},vH={class:"w-full"},wH={class:"flex flex-col gap-2"},_H={class:"flex gap-3 items-center flex-wrap"},kH=["title","onClick"],xH=["disabled","title","aria-label"],EH={class:"mb-4"},CH={class:"mb-4"},SH={class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"},AH={class:"mb-4"},TH={class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"},PH={class:"mb-4"},BH={class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"},NH={key:0,class:"mb-4 pb-4 border-b border-gray-200 dark:border-neutral-700"},DH={class:"flex gap-2 flex-wrap"},MH=["title","onClick"],RH={class:"flex items-center gap-2"},IH=["value"],OH={key:1,class:"text-xs text-destructive"},aS=Mn(o.defineComponent({name:"DCodeColorPicker",inheritAttrs:!1,__name:"DCodeColorPicker",props:{modelValue:{},placeholder:{default:"Select a color"},label:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{default:null},tone:{default:"primary"},skeleton:{type:Boolean,default:!1},required:{type:Boolean,default:!1},showPicker:{type:Boolean,default:!0},hidePicker:{type:Boolean,default:!1},fetchOptions:{},options:{},valueKey:{default:"color"},labelKey:{default:"name"},colorKey:{default:"color"},useClassForColor:{type:Boolean,default:!1},classPrefix:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-colorpicker-${n.id||i.label||"color-picker"}-${s}`),l=o.computed(()=>{const S=n.required,T=n["aria-required"];return S===""||S===!0||S==="true"||T==="true"||T===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed(()=>i.showPicker&&!i.hidePicker),f=o.computed({get:()=>i.modelValue||"",set:S=>{r("update:modelValue",S||null),r("change",S||null)}}),h=[{name:"primary",color:"#2563EB"},{name:"emerald",color:"#16A34A"},{name:"amber",color:"#D97706"},{name:"violet",color:"#7C3AED"},{name:"destructive",color:"#DC2626"}],m=o.ref([]),g=o.ref(!1),v=o.computed(()=>i.options&&i.options.length>0?i.options:m.value&&m.value.length>0?m.value:h),y=o.computed(()=>v.value.map(S=>({original:S,_value:S[i.valueKey]!==void 0?S[i.valueKey]:S.color,_label:S[i.labelKey]!==void 0?S[i.labelKey]:S.name,_color:S[i.colorKey]!==void 0?S[i.colorKey]:S.color}))),A=o.computed(()=>y.value.find(S=>S._value===f.value)),C=o.ref(!1),M=o.ref(!1),B=o.ref(null),N=o.ref(null),j=o.ref(null),W=o.ref(null),P=o.ref(0),E=o.ref(100),k=o.ref(50);let $=null,I=null,O=null;const q=o.ref(!1);let X=(S,T)=>T||S;try{const S=Yn.useI18n&&Yn.useI18n();S&&S.t&&(X=S.t)}catch(S){console.error(S)}const oe=()=>{if(!W.value||!j.value)return;const S=W.value.getBoundingClientRect(),T=j.value.getBoundingClientRect(),D={width:window.innerWidth,height:window.innerHeight},Z=12,J=8;let fe=S.bottom+Z,ae=S.left;if(!(fe+T.height+J<=D.height)){const ke=S.top-T.height-Z;ke>=J?fe=ke:fe=D.height-T.height-J}ae+T.width+J>D.width&&(ae=S.right-T.width,ae-J<0&&(ae=J)),j.value.style.left=Math.max(J,ae)+"px",j.value.style.top=fe+"px"};o.onMounted(async()=>{const S=document.documentElement,T=()=>M.value=S.classList.contains("dark");if(T(),$=new MutationObserver(T),$.observe(S,{attributes:!0,attributeFilter:["class"]}),i.fetchOptions){g.value=!0;try{const D=await i.fetchOptions();D&&typeof D=="object"&&!Array.isArray(D)&&Array.isArray(D.data)?m.value=D.data:Array.isArray(D)?m.value=D:m.value=[]}catch(D){console.error(D),m.value=[]}finally{g.value=!1}}}),o.onBeforeUnmount(()=>{$==null||$.disconnect(),$=null,I&&(document.removeEventListener("click",I),I=null),O&&(window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),O=null)}),Pf(o.toRef(i,"tone"));const ue=S=>{const T=S.replace("#",""),D=parseInt(T.slice(0,2),16)/255,Z=parseInt(T.slice(2,4),16)/255,J=parseInt(T.slice(4,6),16)/255,fe=Math.max(D,Z,J),ae=Math.min(D,Z,J);let we=0,pe=0;const ke=(fe+ae)/2;if(fe!==ae){const be=fe-ae;pe=ke>.5?be/(2-fe-ae):be/(fe+ae),fe===D?we=((Z-J)/be+(Z<J?6:0))/6:fe===Z?we=((J-D)/be+2)/6:we=((D-Z)/be+4)/6}return{h:Math.round(we*360),s:Math.round(pe*100),l:Math.round(ke*100)}},te=(S,T,D)=>{const Z=(1-Math.abs(2*D/100-1))*T/100,J=Z*(1-Math.abs(S/60%2-1)),fe=D/100-Z/2;let ae=0,we=0,pe=0;S>=0&&S<60?(ae=Z,we=J):S>=60&&S<120?(ae=J,we=Z):S>=120&&S<180?(we=Z,pe=J):S>=180&&S<240?(we=J,pe=Z):S>=240&&S<300?(ae=J,pe=Z):S>=300&&S<360&&(ae=Z,pe=J);const ke=be=>{const Se=Math.round((be+fe)*255).toString(16);return Se.length===1?"0"+Se:Se};return`#${ke(ae)}${ke(we)}${ke(pe)}`.toUpperCase()},re=()=>{if(!B.value)return;const S=B.value,T=S.getContext("2d");if(!T)return;const D=S.width,Z=S.height;for(let J=0;J<D;J++){const fe=J/D*100;for(let ae=0;ae<Z;ae++){const we=100-ae/Z*100,pe=`hsl(${P.value}, ${fe}%, ${we}%)`;T.fillStyle=pe,T.fillRect(J,ae,1,1)}}try{const J=Math.round(E.value/100*D),fe=Math.round((1-k.value/100)*Z);T.beginPath(),T.strokeStyle="#ffffff",T.lineWidth=3,T.arc(J,fe,7,0,Math.PI*2),T.stroke(),T.beginPath(),T.strokeStyle="#000000",T.lineWidth=1,T.arc(J,fe,7,0,Math.PI*2),T.stroke()}catch(J){console.error("drawSpectrum error",J)}};let ge=!1;const ce=S=>{const T=B.value;if(!T)return null;const D=T.getBoundingClientRect(),Z=S.clientX??S.clientX,J=S.clientY??S.clientY,fe=Math.max(0,Math.min(D.width,Z-D.left)),ae=Math.max(0,Math.min(D.height,J-D.top)),we=Math.round(fe/D.width*T.width),pe=Math.round(ae/D.height*T.height);return{x:we,y:pe,width:T.width,height:T.height}},se=S=>{ge=!0;const T=S.touches?S.touches[0]:S,D=ce(T);D&&(E.value=Math.max(0,Math.min(100,Math.round(D.x/D.width*100))),k.value=Math.max(0,Math.min(100,Math.round((1-D.y/D.height)*100))),f.value=te(P.value,E.value,k.value),re())},z=S=>{if(!ge)return;const T=S.touches?S.touches[0]:S,D=ce(T);D&&(E.value=Math.max(0,Math.min(100,Math.round(D.x/D.width*100))),k.value=Math.max(0,Math.min(100,Math.round((1-D.y/D.height)*100))),f.value=te(P.value,E.value,k.value),re())},G=()=>{ge=!1},ee=async()=>{if(!i.disabled&&d.value)if(C.value=!C.value,C.value){if(f.value){const S=ue(f.value);P.value=S.h,E.value=S.s,k.value=S.l}await o.nextTick(),re(),await new Promise(S=>setTimeout(S,0)),oe(),I=S=>{const T=S.target;j.value&&W.value&&!j.value.contains(T)&&!W.value.contains(T)&&(C.value=!1,I&&document.removeEventListener("click",I))},O=()=>oe(),document.addEventListener("click",I),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O)}else I&&(document.removeEventListener("click",I),I=null),O&&(window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),O=null)},K=async(S,T)=>{f.value=S;const D=T||S;if(D&&D.toString().startsWith("#")){const Z=ue(D);P.value=Z.h,E.value=Z.s,k.value=Z.l}d.value&&C.value&&(await o.nextTick(),re())},Y=()=>{const S=te(P.value,E.value,k.value);f.value=S,re()},F=()=>{const S=te(P.value,E.value,k.value);f.value=S},_=()=>{const S=te(P.value,E.value,k.value);f.value=S},b=S=>{let D=S.target.value.toUpperCase();if(D.startsWith("#")||(D="#"+D),/^#[0-9A-F]{6}$/.test(D)){f.value=D;const Z=ue(D);P.value=Z.h,E.value=Z.s,k.value=Z.l}},R=o.computed(()=>f.value?f.value:M.value?"#1f2937":"#f3f4f6");return(S,T)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]])},[e.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.label?(o.openBlock(),o.createElementBlock("div",gH)):o.createCommentVNode("",!0),T[4]||(T[4]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",bH,"*")):o.createCommentVNode("",!0)],8,yH)):o.createCommentVNode("",!0),o.createElementVNode("div",vH,[o.createElementVNode("div",wH,[o.createElementVNode("div",_H,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(y.value,D=>(o.openBlock(),o.createElementBlock("button",{key:D._value,type:"button",class:o.normalizeClass(["w-12 h-12 shrink-0 rounded-lg border-2 flex items-center justify-center transition-all duration-200 focus:outline-none",[f.value===D._value?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-900 ring-primary border-primary scale-110 shadow-lg z-10":"border-gray-300 dark:border-gray-600 hover:scale-105 opacity-90 hover:opacity-100",i.useClassForColor&&D._color?`${i.classPrefix}${D._color.toLowerCase()}`:""]]),style:o.normalizeStyle(i.useClassForColor?{}:{backgroundColor:D._color}),title:D._label,onClick:Z=>K(D._value,D._color)},[f.value===D._value?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:"w-6 h-6 stroke-[3] text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"})):o.createCommentVNode("",!0)],14,kH))),128)),d.value?(o.openBlock(),o.createElementBlock("button",{key:0,ref_key:"buttonRef",ref:W,type:"button",class:o.normalizeClass(["w-12 h-12 shrink-0 rounded-lg border-2 flex items-center justify-center transition-all duration-200",[i.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:scale-105",!A.value&&f.value?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-900 ring-primary border-primary scale-110 shadow-lg z-10":"border-gray-300 dark:border-gray-600 opacity-90 hover:opacity-100",i.useClassForColor&&A.value&&A.value._color?`${i.classPrefix}${A.value._color.toLowerCase()}`:""]]),style:o.normalizeStyle(!i.useClassForColor||!A.value?{backgroundColor:R.value}:{}),disabled:i.disabled,onClick:ee,title:o.unref(X)("pickColor","Pick color"),"aria-label":o.unref(X)("pickColor","Pick color")},[!A.value&&f.value?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:"w-6 h-6 stroke-[3] text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"})):(o.openBlock(),o.createBlock(o.unref(Ne.Edit),{key:1,class:"w-5 h-5 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"}))],14,xH)):o.createCommentVNode("",!0)])]),o.createVNode(o.Transition,{"enter-active-class":"transition ease-out duration-150","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:o.withCtx(()=>[d.value&&C.value&&!i.disabled?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"panelRef",ref:j,class:"fixed w-80 p-4 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-2xl",style:{"z-index":"99999"},onClick:T[3]||(T[3]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("div",EH,[T[5]||(T[5]=o.createElementVNode("label",{class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"}," Color Spectrum ",-1)),o.createElementVNode("canvas",{ref_key:"spectrumCanvasRef",ref:B,class:"w-full h-40 rounded border border-gray-300 dark:border-neutral-600 cursor-crosshair",width:"300",height:"160",onMousedown:o.withModifiers(se,["prevent"]),onMousemove:o.withModifiers(z,["prevent"]),onMouseup:o.withModifiers(G,["prevent"]),onMouseleave:o.withModifiers(G,["prevent"]),onTouchstartPassive:o.withModifiers(se,["prevent"]),onTouchmovePassive:o.withModifiers(z,["prevent"]),onTouchend:o.withModifiers(G,["prevent"])},null,544)]),o.createElementVNode("div",CH,[o.createElementVNode("label",SH," Hue: "+o.toDisplayString(P.value)+"° ",1),o.withDirectives(o.createElementVNode("input",{ref_key:"hueRef",ref:N,"onUpdate:modelValue":T[0]||(T[0]=D=>P.value=D),type:"range",min:"0",max:"360",class:"w-full h-2 rounded-lg appearance-none cursor-pointer hue-slider",onInput:Y},null,544),[[o.vModelText,P.value]])]),o.createElementVNode("div",AH,[o.createElementVNode("label",TH," Saturation: "+o.toDisplayString(E.value)+"% ",1),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":T[1]||(T[1]=D=>E.value=D),type:"range",min:"0",max:"100",class:"w-full h-2 rounded-lg appearance-none cursor-pointer",style:o.normalizeStyle(`background: linear-gradient(to right, hsl(${P.value}, 0%, ${k.value}%), hsl(${P.value}, 100%, ${k.value}%))`),onInput:F},null,36),[[o.vModelText,E.value]])]),o.createElementVNode("div",PH,[o.createElementVNode("label",BH," Lightness: "+o.toDisplayString(k.value)+"% ",1),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":T[2]||(T[2]=D=>k.value=D),type:"range",min:"0",max:"100",class:"w-full h-2 bg-gradient-to-r from-black via-gray-500 to-white rounded-lg appearance-none cursor-pointer",onInput:_},null,544),[[o.vModelText,k.value]])]),q.value?(o.openBlock(),o.createElementBlock("div",NH,[T[6]||(T[6]=o.createElementVNode("p",{class:"text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2 uppercase"}," General Colors ",-1)),o.createElementVNode("div",DH,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(y.value,D=>(o.openBlock(),o.createElementBlock("button",{key:D._value,type:"button",class:o.normalizeClass(["w-12 h-12 rounded-lg border-2 flex items-center justify-center transition-all duration-200 focus:outline-none",[f.value===D._value?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-800 ring-primary border-primary scale-110 shadow-lg z-10":"border-gray-300 dark:border-gray-600 hover:scale-105 opacity-90 hover:opacity-100",i.useClassForColor&&D._color?`${i.classPrefix}${D._color.toLowerCase()}`:""]]),style:o.normalizeStyle(i.useClassForColor?{}:{backgroundColor:D._color}),title:D._label,onClick:Z=>K(D._value,D._color)},[f.value===D._value?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:"w-6 h-6 stroke-[3] text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"})):o.createCommentVNode("",!0)],14,MH))),128))])])):o.createCommentVNode("",!0),o.createElementVNode("div",null,[T[8]||(T[8]=o.createElementVNode("label",{class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"}," Hex Value ",-1)),o.createElementVNode("div",RH,[T[7]||(T[7]=o.createElementVNode("span",{class:"text-gray-500 dark:text-gray-400 font-semibold"},"#",-1)),o.createElementVNode("input",{value:f.value.replace("#","").toUpperCase(),type:"text",maxlength:"6",placeholder:"000000",class:"flex-1 px-2 py-1 border border-gray-300 dark:border-neutral-600 rounded bg-white dark:bg-neutral-700 text-sm focus:outline-none focus:ring-1 focus:ring-primary font-mono",onInput:b},null,40,IH)])])],512)):o.createCommentVNode("",!0)]),_:1})]),c.value?(o.openBlock(),o.createElementBlock("p",OH,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),[["__scopeId","data-v-02c0b86d"]]),LH=o.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const n=e,i=t,r=kt.useForwardPropsEmits(n,i);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),FH=o.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,i=t,r=Gn.reactiveOmit(n,"class"),s=kt.useForwardPropsEmits(r,i);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(kt.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),o.createVNode(o.unref(kt.DialogContent),o.mergeProps({...o.unref(s),...a.$attrs},{class:o.unref(nn)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default"),o.createVNode(o.unref(kt.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"}),l[0]||(l[0]=o.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),lS=o.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogDescription),o.mergeProps(o.unref(i),{class:o.unref(nn)("text-sm text-muted-foreground",t.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),$H=o.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogTitle),o.mergeProps(o.unref(i),{class:o.unref(nn)("text-lg font-medium leading-none tracking-tight",t.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),zH={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-gray-300 dark:border-neutral-600 bg-gray-200 dark:bg-neutral-700/60 sticky top-0 z-20"},jH={class:"flex items-center gap-3"},UH={class:"flex flex-col"},WH={key:0,class:"flex items-center"},HH={key:1,class:"px-6 py-4 border-t border-neutral-200/60 dark:border-neutral-700/50 bg-neutral-50/50 dark:bg-neutral-900/30 sticky bottom-0 z-20"},qH={class:"flex justify-end gap-3 flex-wrap"},Yo=Mn(o.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:void 0},size:{default:"sm"},persistent:{type:Boolean,default:!0},description:{default:""},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r=o.useAttrs(),s=o.computed(()=>{const{style:d,...f}=r;return f}),a=o.computed(()=>{const d={xs:"400px",sm:"500px",md:"700px",lg:"900px",xl:"1100px","2xl":"1300px",full:"95vw"};let f=n.maxWidth||d[n.size||"sm"]||"500px";return typeof f=="number"?f=`${f}px`:typeof f=="string"&&/^\d+$/.test(f)&&(f=`${f}px`),{width:f,maxWidth:"95vw",margin:"0 auto"}}),l=o.computed(()=>n.icon?tn[n.icon]??null:null),c=d=>{i("update:modelValue",d)};return(d,f)=>(o.openBlock(),o.createBlock(o.unref(LH),{open:e.modelValue,"onUpdate:open":c},{default:o.withCtx(()=>[o.createVNode(o.unref(FH),o.mergeProps(s.value,{style:a.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0 max-w-none",onInteractOutside:f[0]||(f[0]=h=>e.persistent?h.preventDefault():null),onEscapeKeyDown:f[1]||(f[1]=h=>e.persistent?h.preventDefault():null)}),{default:o.withCtx(()=>[e.title||d.$slots["header-append"]?(o.openBlock(),o.createElementBlock("div",zH,[o.createElementVNode("div",jH,[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["p-2 rounded-lg",e.iconClass||"bg-primary/10 text-primary"])},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):o.createCommentVNode("",!0),o.createElementVNode("div",UH,[o.createVNode(o.unref($H),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1}),e.description?(o.openBlock(),o.createBlock(o.unref(lS),{key:0,class:"text-sm text-neutral-500 dark:text-neutral-400 mt-0.5"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.description),1)]),_:1})):(o.openBlock(),o.createBlock(o.unref(lS),{key:1,class:"hidden"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title||"Dialog Content"),1)]),_:1}))])]),d.$slots["header-append"]?(o.openBlock(),o.createElementBlock("div",WH,[o.renderSlot(d.$slots,"header-append",{},void 0,!0)])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",e.contentClass]),style:o.normalizeStyle(e.contentStyle)},[o.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(o.openBlock(),o.createElementBlock("div",HH,[o.createElementVNode("div",qH,[o.renderSlot(d.$slots,"actions",{},void 0,!0)])])):o.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-556446ca"]]),jl=o.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(e){const t=o.useAttrs(),n=e,i=o.computed(()=>Es(n.icon,tn)),r=o.computed(()=>n.textSize?`text-${n.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},a=o.computed(()=>s[n.textSize??"xs"]??"w-3 h-3"),l=o.computed(()=>n.textType==="BOLD"?"font-bold":n.textType==="ITALIC"?"italic font-normal":"font-normal"),c=o.computed(()=>{const f=`${r.value} ${l.value} text-zinc-700 dark:text-zinc-400 ml-1 inline-flex items-center gap-1`,h=t.class??"";return[f,h].filter(Boolean).join(" ")}),d=o.computed(()=>{const{class:f,...h}=t;return h});return(f,h)=>(o.openBlock(),o.createElementBlock("span",o.mergeProps({class:c.value},d.value),[i.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.value),{key:0,class:o.normalizeClass(["shrink-0",a.value,e.iconClass])},null,8,["class"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.label||e.text),1)],16))}}),jv=o.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)(o.unref(KH)({variant:e.variant}),t.class)),role:"alert"},[o.renderSlot(n.$slots,"default")],2))}}),Uv=o.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("text-sm [&_p]:leading-relaxed",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),KH=Vm("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}});function ig(){const e=s=>{var c;const a={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:a,bubbles:!0,composed:!0})),(a.type==="error"?console.error:a.type==="warning"?console.warn:console.log)(`[Toast][${(c=a.type)==null?void 0:c.toUpperCase()}]`,a.title||"",a.message)};return{show:e,success:(s,a)=>e({type:"success",message:s,title:a}),error:(s,a)=>e({type:"error",message:s,title:a}),warning:(s,a)=>e({type:"warning",message:s,title:a}),info:(s,a)=>e({type:"info",message:s,title:a})}}const Wv={xlsx:"FileSpreadsheet",xls:"FileSpreadsheet",csv:"FileSpreadsheet",pdf:"FileText",doc:"FileText",docx:"FileText",txt:"FileText",json:"FileJson",xml:"FileCode",html:"FileCode",zip:"FileArchive",rar:"FileArchive",jpg:"FileImage",jpeg:"FileImage",png:"FileImage",gif:"FileImage",default:"Download"},Zo={label:{ID:"Unduh Template",EN:"Download Template",KR:"템플릿 다운로드"},title:{ID:"File Template",EN:"Template File",KR:"템플릿 파일"},description:{ID:"Unduh template ini sebagai panduan format upload",EN:"Download this template as upload format guide",KR:"이 템플릿을 업로드 형식 가이드로 다운로드하세요"},downloading:{ID:"Mengunduh template...",EN:"Downloading template...",KR:"템플릿 다운로드 중..."},success:{ID:"Template berhasil diunduh",EN:"Template downloaded successfully",KR:"템플릿이 성공적으로 다운로드되었습니다"},error:{ID:"Gagal mengunduh template",EN:"Failed to download template",KR:"템플릿 다운로드 실패"},retrying:{ID:"Mencoba mengunduh ulang...",EN:"Retrying download...",KR:"다시 다운로드 중..."},retry:{ID:"Coba Lagi",EN:"Retry",KR:"다시 시도"},show:{ID:"Tampilkan Template",EN:"Show Template",KR:"템플릿 표시"},hide:{ID:"Sembunyikan Template",EN:"Hide Template",KR:"템플릿 숨기기"}};function cS(e){const{template:t,locale:n,apiUrl:i}=e,r=ig(),s=o.ref(!1),a=o.ref(!0),l=o.ref(null),c=o.computed(()=>{var W;return!!((W=t==null?void 0:t.endpoint)!=null&&W.apiUrl)}),d=o.computed(()=>{if(t!=null&&t.icon)return t.icon;if(t!=null&&t.fileType){const W=t.fileType.toLowerCase();return Wv[W]||Wv.default}return Wv.default}),f=o.computed(()=>y(t==null?void 0:t.labelID,t==null?void 0:t.labelEN,t==null?void 0:t.labelKR,Zo.label)),h=o.computed(()=>y(t==null?void 0:t.titleID,t==null?void 0:t.titleEN,t==null?void 0:t.titleKR,Zo.title)),m=o.computed(()=>y(t==null?void 0:t.descriptionID,t==null?void 0:t.descriptionEN,t==null?void 0:t.descriptionKR,Zo.description)),g=o.computed(()=>{const W=a.value?Zo.hide:Zo.show;return y(W.ID,W.EN,W.KR,W)}),v=o.computed(()=>y(Zo.retry.ID,Zo.retry.EN,Zo.retry.KR,Zo.retry));function y(W,P,E,k){const $=n.value.toLowerCase();return $==="kr"||$==="ko"?E||P||W||(k==null?void 0:k.KR)||(k==null?void 0:k.EN)||(k==null?void 0:k.ID)||"":$==="id"?W||P||(k==null?void 0:k.ID)||(k==null?void 0:k.EN)||"":P||W||(k==null?void 0:k.EN)||(k==null?void 0:k.ID)||""}function A(W){const P=Zo[W];return y(P.ID,P.EN,P.KR,P)}function C(W,P){const E=URL.createObjectURL(W),k=document.createElement("a");k.href=E,k.download=P,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(E)}function M(W,P){var E,k;return W!=null&&W.filename?W.filename:W!=null&&W.name?W.name:(E=W==null?void 0:W.data)!=null&&E.filename?W.data.filename:(k=W==null?void 0:W.data)!=null&&k.name?W.data.name:P||(t==null?void 0:t.filename)||`template_${Date.now()}.${(t==null?void 0:t.fileType)||"file"}`}async function B(){var W;if(!c.value||!((W=t==null?void 0:t.endpoint)!=null&&W.apiUrl)){console.warn("No template endpoint configured");return}if(!s.value){s.value=!0,l.value=null,r.info(A("downloading"));try{const P=t.endpoint,E=await i(P.apiUrl,P.apiMethod||"GET",P.params||{});let k;E instanceof Blob?k=E:(E==null?void 0:E.data)instanceof Blob?k=E.data:typeof E=="string"&&E.startsWith("http")?k=await(await fetch(E)).blob():E!=null&&E.url&&typeof E.url=="string"?k=await(await fetch(E.url)).blob():k=new Blob([JSON.stringify(E)],{type:"application/octet-stream"});const $=M(E,t.filename);C(k,$),r.success(A("success"))}catch(P){console.error("Template download error:",P),l.value=(P==null?void 0:P.message)||A("error"),r.error(A("error"),P==null?void 0:P.message)}finally{s.value=!1}}}function N(){a.value=!a.value}function j(){l.value=null}return{isDownloading:s,isExpanded:a,downloadError:l,hasTemplate:c,resolvedIcon:d,resolvedLabel:f,resolvedTitle:h,resolvedDescription:m,toggleButtonText:g,retryButtonText:v,downloadTemplate:B,toggleExpanded:N,clearError:j}}const GH={class:"flex flex-col gap-3 w-full"},YH={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-dashed border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70 pointer-events-none animate-pulse"},ZH={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-neutral-700/50 bg-slate-50 dark:bg-neutral-900/30 text-slate-400"},XH={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},JH={class:"text-sm font-medium text-slate-500"},QH={class:"flex items-center justify-between gap-2"},VH=["onClick"],eq={key:0,class:"space-y-2"},tq={class:"flex items-center justify-between"},nq=["onClick"],iq={class:"p-3 rounded-lg border border-slate-200 dark:border-neutral-700 bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-950/20 dark:to-indigo-950/20 space-y-2"},rq={class:"flex items-start gap-2"},oq={class:"p-1.5 rounded-lg bg-white dark:bg-neutral-800 shadow-sm"},sq={class:"flex-1"},aq={class:"text-xs font-semibold text-slate-800 dark:text-neutral-200"},lq={class:"text-xs text-slate-600 dark:text-neutral-400 mt-0.5"},cq={class:"flex items-center gap-2"},dq={key:1,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},uq={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},fq=["onClick"],hq=["for","onDrop"],mq={class:"text-xs text-slate-500 dark:text-slate-400"},pq={key:2,class:"text-xs text-slate-400"},gq=["id","disabled","accept","onChange"],yq={class:"flex flex-col items-center justify-center min-h-[300px]"},bq=["src","alt"],vq=["src"],wq={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},_q={class:"text-sm font-medium"},kq=["href"],rg=o.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},labelKR:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0},template:{type:Object,default:null},dummyMode:{type:Boolean,default:!1}},emits:["update:modelValue","uploaded","success"],setup(e,{emit:t}){const n=e,i=t,{t:r,locale:s}=Yn.useI18n(),{apiUrl:a}=o.inject("externalApi")||{},l=o.computed(()=>{const I=n.endpoint;if(!(I!=null&&I.apiUrl))return null;let O=I.apiUrl;if(!O.startsWith("http")&&n.baseUrl){const q=n.baseUrl.replace(/\/$/,""),X=O.startsWith("/")?O:`/${O}`;O=`${q}${X}`}return O}),c=o.computed(()=>{const I=d.value.length;return I<=1?"grid-cols-1":I===2?"grid-cols-1 md:grid-cols-2":I===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":I===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),d=o.ref([]),f=o.ref([]),h=o.ref(new Set),m=o.ref(!0),g=o.ref(!1),v=o.ref(""),y=o.ref(""),A=o.ref(""),C=o.computed(()=>{if(!n.template)return new Map;const I=new Map;return d.value.forEach(O=>{const q=String(O[n.itemValue]||O.id||O.typeDocument||"");q&&I.set(q,cS({template:n.template,locale:o.computed(()=>s.value),apiUrl:a}))}),I}),M=I=>{const O=String(I[n.itemValue]||I.id||I.typeDocument||"");return C.value.get(O)||null},B=I=>{const O=M(I);if(!O)return null;const q=O.resolvedIcon;return tn[q]||tn.Download},N=async()=>{var I;if(m.value=!0,n.items!==void 0){d.value=n.items,m.value=!1;return}if(!((I=n.endpointReference)!=null&&I.apiUrl)||n.dummyMode){m.value=!1;return}try{const O=await a(n.endpointReference.apiUrl,n.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(n.items!==void 0){m.value=!1;return}let q=(O==null?void 0:O.data)||O;Array.isArray(q)||(q=[q]),d.value=q}catch(O){console.error("Failed to fetch dynamic document list",O)}finally{m.value=!1}};o.onMounted(()=>{Array.isArray(n.modelValue)&&n.modelValue.length>0&&(f.value=JSON.parse(JSON.stringify(n.modelValue))),N()}),o.onBeforeUnmount(()=>{f.value.forEach(I=>{I._localPreviewUrl&&URL.revokeObjectURL(I._localPreviewUrl)})}),o.watch(()=>n.modelValue,I=>{if(Array.isArray(I)&&JSON.stringify(I)!==JSON.stringify(f.value)){const O=JSON.parse(JSON.stringify(I));O.forEach(q=>{const X=f.value.find(oe=>{var re,ge,ce,se,z,G,ee,K;const ue=[(re=q.typeDocument)==null?void 0:re.id,(ge=q.typeDocument)==null?void 0:ge.code,q.typeDocument,(ce=q.idDocumentType)==null?void 0:ce.id,(se=q.idDocumentType)==null?void 0:se.code,q.idDocumentType].map(Y=>String(Y)).filter(Y=>Y!=="undefined"&&Y!=="null"&&Y!==""),te=[(z=oe.typeDocument)==null?void 0:z.id,(G=oe.typeDocument)==null?void 0:G.code,oe.typeDocument,(ee=oe.idDocumentType)==null?void 0:ee.id,(K=oe.idDocumentType)==null?void 0:K.code,oe.idDocumentType].map(Y=>String(Y)).filter(Y=>Y!=="undefined"&&Y!=="null"&&Y!=="");return ue.some(Y=>te.includes(Y))});X!=null&&X._localPreviewUrl&&(q._localPreviewUrl=X._localPreviewUrl)}),f.value=O}},{deep:!0}),o.watch(()=>{var I;return(I=n.endpointReference)==null?void 0:I.apiUrl},(I,O)=>{I!==O&&N()}),o.watch(()=>{var I;return(I=n.endpointReference)==null?void 0:I.apiMethod},(I,O)=>{I!==O&&N()}),o.watch(()=>n.items,I=>{d.value=I??[],m.value=!1},{deep:!0,immediate:!0});const j=(I,O)=>{if(!O||!I)return!1;const q=[O[n.itemValue],O.id,O.code,O.value,O.typeDocument].map(ue=>String(ue)).filter(ue=>ue!=="undefined"&&ue!=="null"&&ue!==""),X=[];I.typeDocument&&(typeof I.typeDocument=="object"?X.push(I.typeDocument.id,I.typeDocument.code,I.typeDocument.value):X.push(I.typeDocument)),I.idDocumentType&&(typeof I.idDocumentType=="object"?X.push(I.idDocumentType.id,I.idDocumentType.code,I.idDocumentType.value):X.push(I.idDocumentType)),n.itemValue&&I[n.itemValue]&&(typeof I[n.itemValue]=="object"?X.push(I[n.itemValue].id,I[n.itemValue].code,I[n.itemValue].value):X.push(I[n.itemValue])),I.document&&typeof I.document=="object"?X.push(I.document.id,I.document.code,I.document.value):I.document&&typeof I.document!="string"&&X.push(I.document);const oe=X.map(ue=>String(ue)).filter(ue=>ue!=="undefined"&&ue!=="null"&&ue!=="");return q.some(ue=>oe.includes(ue))},W=I=>f.value.find(O=>j(O,I))||null,P=async(I,O,q)=>{var re,ge,ce,se,z;const X=q.target,oe=(re=X.files)==null?void 0:re[0];if(!oe)return;if(n.dummyMode){const G=I[n.itemValue]||I.id||I.typeDocument,ee=URL.createObjectURL(oe),K=[...f.value],Y=K.findIndex(_=>j(_,I));(ge=K[Y])!=null&&ge._localPreviewUrl&&URL.revokeObjectURL(K[Y]._localPreviewUrl);const F={id:null,idDocument:null,idDocumentType:G,filename:oe.name,document:G,documentUrl:oe.name,typeDocument:G,_localPreviewUrl:ee,_fileType:oe.type};Y>-1?K[Y]={...K[Y],...F}:K.push(F),f.value=K,i("update:modelValue",K),X.value="";return}const ue=I[n.itemValue]||I.id||I.typeDocument,te=URL.createObjectURL(oe);if(!l.value){const G=[...f.value],ee=G.findIndex(Y=>j(Y,I));(ce=G[ee])!=null&&ce._localPreviewUrl&&URL.revokeObjectURL(G[ee]._localPreviewUrl);const K={id:null,idDocument:null,idDocumentType:ue,filename:oe.name,document:ue,documentUrl:oe.name,typeDocument:ue,_localPreviewUrl:te,_fileType:oe.type};ee>-1?G[ee]={...G[ee],...K}:G.push(K),f.value=G,i("update:modelValue",G);return}h.value.add(O);try{const G=new FormData;G.append("doc",oe),G.append("typeDocument",String(ue));const ee=await a(l.value,((se=n.endpoint)==null?void 0:se.apiMethod)||"POST",G),K=Array.isArray(ee==null?void 0:ee.data)?ee.data[0]:(ee==null?void 0:ee.data)||ee,Y=(K==null?void 0:K.url)||(K==null?void 0:K.document)||oe.name,F=(K==null?void 0:K.id)||null,_=(K==null?void 0:K.filename)||(K==null?void 0:K.name)||oe.name,b=[...f.value],R=b.findIndex(T=>j(T,I));(z=b[R])!=null&&z._localPreviewUrl&&URL.revokeObjectURL(b[R]._localPreviewUrl);const S={...K,id:F||(K==null?void 0:K.idDocument)||(K==null?void 0:K.id_document)||null,idDocument:(K==null?void 0:K.idDocument)||F||(K==null?void 0:K.id_document)||null,idDocumentType:ue,filename:_,document:ue,documentUrl:Y,typeDocument:ue,_localPreviewUrl:te,_fileType:oe.type};R>-1?b[R]={...b[R],...S}:b.push(S),f.value=b,i("update:modelValue",b),i("uploaded",K),i("success",K)}catch(G){console.error("Upload failed",G)}finally{h.value.delete(O),X.value=""}},E=I=>{const O=f.value.find(X=>j(X,I));O!=null&&O._localPreviewUrl&&URL.revokeObjectURL(O._localPreviewUrl);const q=f.value.filter(X=>!j(X,I));f.value=q,i("update:modelValue",q)},k=I=>{const O=W(I);if(!O)return;let q=O._localPreviewUrl;if(!q){const ue=O.document&&typeof O.document=="object"?O.document:null,te=O.server||(ue==null?void 0:ue.server),re=O.url||(ue==null?void 0:ue.url);if(te&&re){const ge=String(te).replace(/\/+$/,""),ce=String(re).replace(/^\/+/,"");q=`${ge}/${ce}`}else O.filename&&String(O.filename).startsWith("http")?q=O.filename:q=(typeof O.document=="string"?O.document:null)||O.url||(ue==null?void 0:ue.url)}if(!q)return;const X=O.mime||(O.document&&typeof O.document=="object"?O.document.mime:null)||O._fileType||"",oe=X==="application/pdf"||q.toLowerCase().endsWith(".pdf");oe&&!q.includes("#")&&(q+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),v.value=q,y.value=I[n.itemTitle]||I.name||O.filename||"Preview Document",A.value=X||(oe?"application/pdf":"image/jpeg"),g.value=!0},$=(I,O,q)=>{var ue,te;q.preventDefault();const X=(te=(ue=q.dataTransfer)==null?void 0:ue.files)==null?void 0:te[0];if(!X)return;P(I,O,{target:{files:[X],value:""}})};return(I,O)=>(o.openBlock(),o.createElementBlock("div",GH,[e.label||e.labelID||e.labelEN||e.labelKR?(o.openBlock(),o.createBlock(jl,{key:0,text:e.label||(o.unref(s).toLowerCase().startsWith("kr")||o.unref(s).toLowerCase().startsWith("ko")?e.labelKR:o.unref(s).toLowerCase().startsWith("en")?e.labelEN:e.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:e.required},null,8,["text","required"])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["w-full grid gap-4",c.value])},[d.value.length===0&&m.value?(o.openBlock(),o.createElementBlock("div",YH,[o.createVNode(jl,{text:o.unref(r)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),o.createElementVNode("div",ZH,[o.createVNode(o.unref(Ne.Loader2),{class:"w-6 h-6 animate-spin"})])])):d.value.length===0&&!m.value?(o.openBlock(),o.createElementBlock("div",XH,[o.createVNode(o.unref(Ne.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),o.createElementVNode("span",JH,o.toDisplayString(o.unref(r)("dynamicUploadList.noDocsRequired")),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,(q,X)=>{var oe,ue,te,re,ge,ce,se,z,G,ee,K,Y;return o.openBlock(),o.createElementBlock("div",{key:X,class:"flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg shadow-sm"},[o.createElementVNode("div",QH,[o.createVNode(jl,{text:q[e.itemTitle]||q.name||q.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),W(q)?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"p-1 hover:bg-slate-100 dark:hover:bg-zinc-700 rounded transition-colors text-slate-400 hover:text-primary-500",onClick:F=>k(q)},[o.createVNode(o.unref(Ne.Eye),{class:"w-4 h-4"})],8,VH)):o.createCommentVNode("",!0)]),M(q)&&((oe=M(q))!=null&&oe.hasTemplate)?(o.openBlock(),o.createElementBlock("div",eq,[o.createElementVNode("div",tq,[o.createElementVNode("button",{type:"button",onClick:F=>{var _;return(_=M(q))==null?void 0:_.toggleExpanded()},class:"text-xs font-medium text-slate-600 dark:text-slate-400 hover:text-primary-600 dark:hover:text-primary-400 transition-colors flex items-center gap-1"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent((ue=M(q))!=null&&ue.isExpanded?tn.ChevronDown:tn.ChevronRight),{class:"w-3 h-3"})),o.createTextVNode(" "+o.toDisplayString((te=M(q))==null?void 0:te.toggleButtonText),1)],8,nq)]),o.withDirectives(o.createElementVNode("div",iq,[o.createElementVNode("div",rq,[o.createElementVNode("div",oq,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(B(q)),{class:"w-4 h-4 text-primary-600 dark:text-primary-400"}))]),o.createElementVNode("div",sq,[o.createElementVNode("h4",aq,o.toDisplayString((re=M(q))==null?void 0:re.resolvedTitle),1),o.createElementVNode("p",lq,o.toDisplayString((ge=M(q))==null?void 0:ge.resolvedDescription),1)])]),o.createElementVNode("div",cq,[(ce=M(q))!=null&&ce.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:1,type:"button",size:"sm",variant:"destructive",disabled:((z=M(q))==null?void 0:z.isDownloading)||e.disabled,onClick:F=>{var _;return(_=M(q))==null?void 0:_.downloadTemplate()},class:"text-xs h-7"},{default:o.withCtx(()=>{var F;return[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.RotateCw),{class:"w-3 h-3 mr-1"})),o.createTextVNode(" "+o.toDisplayString((F=M(q))==null?void 0:F.retryButtonText),1)]}),_:2},1032,["disabled","onClick"])):(o.openBlock(),o.createBlock(o.unref(Fr),{key:0,type:"button",size:"sm",disabled:((se=M(q))==null?void 0:se.isDownloading)||e.disabled,onClick:F=>{var _;return(_=M(q))==null?void 0:_.downloadTemplate()},class:"text-xs h-7"},{default:o.withCtx(()=>{var F,_,b;return[(o.openBlock(),o.createBlock(o.resolveDynamicComponent((F=M(q))!=null&&F.isDownloading?tn.Loader2:tn.Download),{class:o.normalizeClass(["w-3 h-3 mr-1",(_=M(q))!=null&&_.isDownloading?"animate-spin":""])},null,8,["class"])),o.createTextVNode(" "+o.toDisplayString((b=M(q))==null?void 0:b.resolvedLabel),1)]}),_:2},1032,["disabled","onClick"])),(G=M(q))!=null&&G.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:2,type:"button",size:"sm",variant:"ghost",onClick:F=>{var _;return(_=M(q))==null?void 0:_.clearError()},class:"text-xs h-7"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.X),{class:"w-3 h-3"}))]),_:1},8,["onClick"])):o.createCommentVNode("",!0)]),(ee=M(q))!=null&&ee.downloadError?(o.openBlock(),o.createBlock(o.unref(jv),{key:0,variant:"destructive",class:"text-xs py-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uv),null,{default:o.withCtx(()=>{var F;return[o.createTextVNode(o.toDisplayString((F=M(q))==null?void 0:F.downloadError),1)]}),_:2},1024)]),_:2},1024)):o.createCommentVNode("",!0)],512),[[o.vShow,(K=M(q))==null?void 0:K.isExpanded]])])):o.createCommentVNode("",!0),W(q)?(o.openBlock(),o.createElementBlock("div",dq,[o.createVNode(o.unref(Ne.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),o.createElementVNode("span",uq,o.toDisplayString(((Y=W(q))==null?void 0:Y.filename)||o.unref(r)("dynamicUploadList.fileUploaded")),1),e.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:F=>E(q)},[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"})],8,fq))])):(o.openBlock(),o.createElementBlock("label",{key:2,for:`dyn-upload-input-${X}`,class:o.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[e.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",h.value.has(X)?"pointer-events-none opacity-70":""]]),onDragover:O[0]||(O[0]=o.withModifiers(()=>{},["prevent"])),onDrop:F=>!e.disabled&&!h.value.has(X)&&$(q,X,F)},[h.value.has(X)?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(o.openBlock(),o.createBlock(o.unref(Ne.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),o.createElementVNode("span",mq,o.toDisplayString(h.value.has(X)?o.unref(r)("dynamicUploadList.uploading"):o.unref(r)("dynamicUploadList.clickOrDrag")),1),e.typeFile?(o.openBlock(),o.createElementBlock("span",pq,o.toDisplayString(e.typeFile),1)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:`dyn-upload-input-${X}`,type:"file",class:"sr-only",disabled:e.disabled||h.value.has(X),accept:e.typeFile,onChange:F=>P(q,X,F)},null,40,gq)],42,hq))])}),128))],2),o.createVNode(Yo,{modelValue:g.value,"onUpdate:modelValue":O[2]||(O[2]=q=>g.value=q),title:y.value,"max-width":A.value==="application/pdf"?720:500,"content-class":A.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:O[1]||(O[1]=q=>g.value=!1)},o.toDisplayString(o.unref(r)("common.close")||"Close"),1)]),default:o.withCtx(()=>[o.createElementVNode("div",yq,[A.value.startsWith("image/")?(o.openBlock(),o.createElementBlock("img",{key:0,src:v.value,alt:y.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,bq)):A.value==="application/pdf"?(o.openBlock(),o.createElementBlock("iframe",{key:1,src:`${v.value}${v.value.includes("#")?"":"#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"}`,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,vq)):(o.openBlock(),o.createElementBlock("div",wq,[o.createVNode(o.unref(Ne.FileText),{class:"w-16 h-16 stroke-1"}),o.createElementVNode("span",_q,o.toDisplayString(o.unref(r)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),o.createElementVNode("a",{href:v.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},o.toDisplayString(o.unref(r)("dynamicUploadList.viewOriginal")||"View Original"),9,kq)]))])]),_:1},8,["modelValue","title","max-width","content-class"])]))}});function dS(){return{setPageTitle:n=>{typeof document<"u"&&(document.title=n||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:n},bubbles:!0,composed:!0}))},setBreadcrumb:n=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:n},bubbles:!0,composed:!0}))}}}function xq(){const e=o.ref(0),t=o.reactive({}),n=o.reactive({}),i=o.reactive({}),r=o.reactive({}),s=o.reactive({}),a=o.ref(!1),l=o.reactive({}),c=o.reactive({}),d=o.reactive({}),f=o.ref(!1),h=o.ref(null),m=o.reactive({}),g=o.reactive({}),v=o.reactive({}),y=o.reactive({}),A=o.reactive({}),C=o.reactive({}),M=o.reactive({}),B=o.ref(null),N=o.reactive({visible:!1,title:"",message:"",action:null,showCancel:!0,okText:"",cancelText:"",isBlocking:!1,redirectUrl:""});return{revision:e,formData:t,originalData:n,tableRowFormData:i,errors:r,touched:s,isSubmitted:a,fieldErrors:l,wizardState:c,inlineState:d,isSubmitting:f,internalSchema:h,rawItemsCache:m,revealedSectionIds:g,revealedFieldModels:v,wizardResponses:y,sectionLoading:A,fieldLoading:C,confirmDialog:N,sectionPagination:M,activeTableAction:B}}var og={exports:{}},Eq=og.exports,uS;function Cq(){return uS||(uS=1,(function(e,t){(function(n,i){e.exports=i()})(Eq,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function n(s){for(var a=[],l=0,c=s.length;l<c;l++)a.indexOf(s[l])===-1&&a.push(s[l]);return a}var i={},r={"==":function(s,a){return s==a},"===":function(s,a){return s===a},"!=":function(s,a){return s!=a},"!==":function(s,a){return s!==a},">":function(s,a){return s>a},">=":function(s,a){return s>=a},"<":function(s,a,l){return l===void 0?s<a:s<a&&a<l},"<=":function(s,a,l){return l===void 0?s<=a:s<=a&&a<=l},"!!":function(s){return i.truthy(s)},"!":function(s){return!i.truthy(s)},"%":function(s,a){return s%a},log:function(s){return console.log(s),s},in:function(s,a){return!a||typeof a.indexOf>"u"?!1:a.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,a,l){if(l<0){var c=String(s).substr(a);return c.substr(0,c.length+l)}return String(s).substr(a,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,a){return parseFloat(s,10)+parseFloat(a,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,a){return parseFloat(s,10)*parseFloat(a,10)})},"-":function(s,a){return a===void 0?-s:s-a},"/":function(s,a){return s/a},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,a){return s.concat(a)},[])},var:function(s,a){var l=a===void 0?null:a,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),f=0;f<d.length;f++)if(c==null||(c=c[d[f]],c===void 0))return l;return c},missing:function(){for(var s=[],a=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<a.length;l++){var c=a[l],d=i.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,a){var l=i.apply({missing:a},this);return a.length-l.length>=s?[]:l}};return i.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},i.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},i.get_operator=function(s){return Object.keys(s)[0]},i.get_values=function(s){return s[i.get_operator(s)]},i.apply=function(s,a){if(Array.isArray(s))return s.map(function(A){return i.apply(A,a)});if(!i.is_logic(s))return s;var l=i.get_operator(s),c=s[l],d,f,h,m,g;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(i.truthy(i.apply(c[d],a)))return i.apply(c[d+1],a);return c.length===d+1?i.apply(c[d],a):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(f=i.apply(c[d],a),!i.truthy(f))return f;return f}else if(l==="or"){for(d=0;d<c.length;d+=1)if(f=i.apply(c[d],a),i.truthy(f))return f;return f}else{if(l==="filter")return m=i.apply(c[0],a),h=c[1],Array.isArray(m)?m.filter(function(A){return i.truthy(i.apply(h,A))}):[];if(l==="map")return m=i.apply(c[0],a),h=c[1],Array.isArray(m)?m.map(function(A){return i.apply(h,A)}):[];if(l==="reduce")return m=i.apply(c[0],a),h=c[1],g=typeof c[2]<"u"?i.apply(c[2],a):null,Array.isArray(m)?m.reduce(function(A,C){return i.apply(h,{current:C,accumulator:A})},g):g;if(l==="all"){if(m=i.apply(c[0],a),h=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!i.truthy(i.apply(h,m[d])))return!1;return!0}else if(l==="none"){if(m=i.apply(c[0],a),h=c[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(i.truthy(i.apply(h,m[d])))return!1;return!0}else if(l==="some"){if(m=i.apply(c[0],a),h=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(i.truthy(i.apply(h,m[d])))return!0;return!1}}if(c=c.map(function(A){return i.apply(A,a)}),r.hasOwnProperty(l)&&typeof r[l]=="function")return r[l].apply(a,c);if(l.indexOf(".")>0){var v=String(l).split("."),y=r;for(d=0;d<v.length;d++){if(!y.hasOwnProperty(v[d]))throw new Error("Unrecognized operation "+l+" (failed at "+v.slice(0,d+1).join(".")+")");y=y[v[d]]}return y.apply(a,c)}throw new Error("Unrecognized operation "+l)},i.uses_data=function(s){var a=[];if(i.is_logic(s)){var l=i.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?a.push(c[0]):c.forEach(function(d){a.push.apply(a,i.uses_data(d))})}return n(a)},i.add_operation=function(s,a){r[s]=a},i.rm_operation=function(s){delete r[s]},i.rule_like=function(s,a){if(a===s||a==="@")return!0;if(a==="number")return typeof s=="number";if(a==="string")return typeof s=="string";if(a==="array")return Array.isArray(s)&&!i.is_logic(s);if(i.is_logic(a)){if(i.is_logic(s)){var l=i.get_operator(a),c=i.get_operator(s);if(l==="@"||l===c)return i.rule_like(i.get_values(s,!1),i.get_values(a,!1))}return!1}if(Array.isArray(a))if(Array.isArray(s)){if(a.length!==s.length)return!1;for(var d=0;d<a.length;d+=1)if(!i.rule_like(s[d],a[d]))return!1;return!0}else return!1;return!1},i})})(og)),og.exports}var Sq=Cq();const go=Xm(Sq);function Hv(){const e=n=>n&&typeof n=="object"&&n._isLogicValue;go.add_operation("var",function(n,i){const r=i===void 0?null:i,s=this;if(n===void 0||n===""||n===null)return s;if(s&&typeof s=="object"&&s._resolveLogicVar){const c=s._resolveLogicVar(String(n));if(c!==void 0)return c}const a=String(n).split(".");let l=s;for(let c=0;c<a.length;c++){if(l==null)return r;const d=a[c];let f=l[d];if(f===void 0&&l&&typeof l=="object"){const h=Object.keys(l).find(m=>m===d||m.endsWith("."+d));h!==void 0&&(f=l[h])}if(f===void 0)return r;l=f}return l}),go.add_operation("length",n=>n==null?0:e(n)?String(n.code??n.id??n.value??n.name??"").length:typeof n=="string"?n.length:typeof n=="number"?String(n).length:Array.isArray(n)?n.length:typeof n=="object"?n.code!==void 0&&n.code!==null?String(n.code).length:n.id!==void 0&&n.id!==null?String(n.id).length:n.value!==void 0&&n.value!==null?String(n.value).length:n.name!==void 0&&n.name!==null?String(n.name).length:Object.keys(n).length:0),["+","-","*","/",">","<",">=","<="].forEach(n=>{go.add_operation(n,(...i)=>{const r=l=>e(l)?Number(l.id??l.code??l.value)||0:typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l):l;if(n==="+"||n==="*"||n==="-"||n==="/")return i.reduce((l,c,d)=>{const f=r(c)||0;if(d===0)return f;switch(n){case"+":return l+f;case"-":return l-f;case"*":return l*f;case"/":return f!==0?l/f:0;default:return l}},n==="*"||n==="/"?1:0);const s=r(i[0]),a=r(i[1]);switch(n){case">":return s>a;case"<":return s<a;case">=":return s>=a;case"<=":return s<=a;default:return 0}})}),go.add_operation("==",(n,i)=>{if(n==null)return i==null;if(i==null)return n==null;const r=l=>e(l)?[String(l.code),String(l.id),String(l.value),String(l.name)]:typeof l=="object"?[String(l.code??l.id??l.value??l.name??"")]:[String(l)],[s,a]=[r(n),r(i)];return s.some(l=>a.some(c=>l===c))}),go.add_operation("!=",(n,i)=>n==null&&i==null?!1:n==null||i===null||i===void 0?!0:e(n)&&e(i)?!(String(n.id)===String(i.id)||String(n.code)===String(i.code)):e(n)?!(String(n.code)===String(i)||String(n.id)===String(i)):e(i)?!(String(i.code)===String(n)||String(i.id)===String(n)):String(n)!==String(i)),go.add_operation("calculate_age",(n,i,r="years")=>{if(!n)return null;const s=new Date(n),a=i&&i!==null&&i!=="null"?new Date(i):new Date;if(isNaN(s.getTime())||isNaN(a.getTime()))return null;const l=s<=a,[c,d]=l?[s,a]:[a,s];let f=d.getFullYear()-c.getFullYear(),h=d.getMonth()-c.getMonth(),m=d.getDate()-c.getDate();if(m<0){h--;const y=new Date(d.getFullYear(),d.getMonth(),0);m+=y.getDate()}h<0&&(f--,h+=12);const g=h,v=l?1:-1;if(r==="years")return f*v;if(r==="months")return g*v;if(r==="days"){const y=d.getTime()-c.getTime();return Math.floor(y/(1e3*60*60*24))*v}return f*v})}function Pt(e){if(!e)return"";const t=e.propsForm||e.propsFormStep||e.propsTable||e.propsTableStep||e.propsDataTableWizard||e.propsWizard||e.props||{};return e.key||t.key||e.id||e.modelKey||t.modelKey||t.modelDatatable||""}const Ye=(e,t)=>{if(t&&!(!e||typeof e!="object")){if(t.includes(".")){const n=t.split(".");if(!Array.isArray(e[n[0]])){const i=n.reduce((r,s)=>r==null?void 0:r[s],e);if(i!=null)return i}}return e[t]!==void 0&&e[t]!==null?e[t]:t.split(".").reduce((n,i)=>n==null?void 0:n[i],e)}},Xt=(e,t,n)=>{if(!t)return;const i=t.split(".");if(i.length>1&&Array.isArray(e[i[0]])){e[t]=n;return}i.length>1&&t in e&&t!==i[0]&&(e[t]=n);let r=e;for(let s=0;s<i.length-1;s++){const a=i[s];(r[a]===void 0||r[a]===null||typeof r[a]!="object")&&(r[a]={}),r=r[a]}r[i[i.length-1]]=n},yo=e=>{const t=o.toRaw(e);if(t==null)return t;if(Array.isArray(t))return t.map(n=>yo(n));if(typeof t=="object"){if(t instanceof Date||t instanceof File||t instanceof Blob)return t;if(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null){const n={};return Object.keys(t).forEach(i=>n[i]=yo(t[i])),n}}return t},sg=e=>{if(!e||typeof e!="object")return[];if("var"in e)return[e.var];let t=[];return Object.values(e).forEach(n=>{Array.isArray(n)?n.forEach(i=>{t=t.concat(sg(i))}):typeof n=="object"&&(t=t.concat(sg(n)))}),t},Aq=e=>e?[...e].sort((t,n)=>(t.seq||0)-(n.seq||0)):[],Bf=(e,t={},n="")=>(!e||typeof e!="object"||Object.keys(e).forEach(i=>{const r=e[i],s=n?`${n}.${i}`:i;t[s]=r,r&&typeof r=="object"&&!Array.isArray(r)&&!r._isLogicValue&&Bf(r,t,s)}),t),bo=(e,t)=>{if(!(!e||typeof e!="object")){if(e[t]!==void 0)return e[t];if(Array.isArray(e))for(const n of e){const i=bo(n,t);if(i!==void 0)return i}else for(const n of Object.keys(e))if(typeof e[n]=="object"){const i=bo(e[n],t);if(i!==void 0)return i}}},qv=(e,t)=>{Object.keys(t).forEach(n=>{t[n]&&typeof t[n]=="object"&&!Array.isArray(t[n])?(e[n]||(e[n]={}),qv(e[n],t[n])):e[n]=t[n]})},vo=(e,t)=>{if(!e||typeof e!="string"||e.startsWith("http")||!t||typeof t!="string")return e;const n=t.replace(/\/$/,""),i=e.startsWith("/")?e:`/${e}`;return`${n}${i}`},kd=e=>{if(!e||typeof e!="object")return!0;const t=["no","action","_index","_isLogicValue"];return!Object.entries(e).some(([n,i])=>t.includes(n)?!1:i!=null&&i!==""?Array.isArray(i)?i.length>0:typeof i=="object"&&!(i instanceof Date)?Object.values(i).some(r=>r!=null&&r!==""):!0:!1)};function Kv({formData:e,errors:t,fieldMap:n,rawItemsCache:i,activeSchema:r,locale:s,tableRowFormData:a,revealedSectionIds:l,revealedFieldModels:c,parentFormData:d,rootFormData:f,activeTableAction:h,activeTableRow:m,tableRows:g}){const v=o.inject("parentFormData",null),y=o.inject("rootFormData",null);o.provide("parentFormData",e),y||o.provide("rootFormData",e);const A=d||v||y||e,C=f||y||e;console.log("[useFormLogic][INIT] Resolved contexts:",{hasParentOption:!!d,hasParentInjected:!!v,parentKeys:Object.keys(A),hasRootOption:!!f,hasRootInjected:!!y,rootKeys:Object.keys(C)});const M=(b,R)=>!b||["DCodeDatePicker","DCodeTextField","DCodeTextArea","DCodeButton","DCodeCheckbox"].includes(b)?!1:["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeSelect","DCodeRadio","DCodeRadioCustom","DCodeMultiSelect"].includes(b)||!!(R.endpoint||R.endpointReference||R.items),B=o.computed(()=>{var b;for(const R in i)(b=i[R])==null||b.length;return j(e)}),N=(b,R,S,T)=>{var pe,ke,be,Se;if(R==null||typeof R=="object"&&R._isLogicValue)return R;let D=S;if(!D){const ve=(ke=(pe=n.value)==null?void 0:pe.paths)==null?void 0:ke.get(b),Be=(Se=(be=n.value)==null?void 0:be.models)==null?void 0:Se.get(b),Ee=ve||(Array.isArray(Be)?Be[0]:null);D=Ee==null?void 0:Ee.field}if(!D)return R;const Z=D.props||D.propsFieldCustom||D.propsFieldGlobal||{},J=i[D.key]||Z.items||Z.options;if(!J||!Array.isArray(J))return M(D.component,Z)?{id:(T==null?void 0:T.id)??R,code:(T==null?void 0:T.code)??R,value:(T==null?void 0:T.value)??R,_isLogicValue:!0,_isFallback:!0}:R;const fe=Z.itemValue||"code",ae=J.find(ve=>String(ve[fe])===String(R)||String(ve.code)===String(R)||String(ve.id)===String(R)||String(ve.name)===String(R)||String(ve.title)===String(R)||Z.itemTitle&&String(ve[Z.itemTitle])===String(R)||typeof R=="string"&&(String(ve[fe]).toUpperCase()===R.toUpperCase()||String(ve.code).toUpperCase()===R.toUpperCase()||String(ve.name).toUpperCase()===R.toUpperCase()||String(ve.title).toUpperCase()===R.toUpperCase())),we=M(D.component,Z);return ae?{...ae,id:ae.id??ae[fe]??R,code:ae.code??ae[fe]??R,name:ae.name??ae[Z.itemTitle||"name"]??ae.title??R,title:ae.title??ae[Z.itemTitle||"title"]??ae.name??R,value:ae.value??ae[fe]??ae.id??R,_isLogicValue:!0}:we?{id:(T==null?void 0:T.id)??R,code:(T==null?void 0:T.code)??R,value:(T==null?void 0:T.value)??R,name:(T==null?void 0:T.name)??(T==null?void 0:T.title)??R,title:(T==null?void 0:T.title)??(T==null?void 0:T.name)??R,_isLogicValue:!0,_isFallback:!0}:R},j=(b,R,S="LOGIC")=>{const T=(D,Z)=>{var fe,ae,we,pe,ke,be,Se,ve,Be;if(D==null||typeof D=="object"&&D._isLogicValue||typeof D=="boolean"||(Ee=>{var Oe;return!Ee||typeof Ee!="object"?!1:Ee instanceof File||Ee instanceof Blob||((Oe=Ee.constructor)==null?void 0:Oe.name)==="File"||Ee.size!==void 0&&typeof Ee.name=="string"})(D))return D;if(typeof D=="number"||typeof D=="string")return Z&&(((ae=(fe=n.value)==null?void 0:fe.paths)==null?void 0:ae.has(Z))||((pe=(we=n.value)==null?void 0:we.models)==null?void 0:pe.has(Z)))?N(Z,D):D;if(typeof D=="object"&&!Array.isArray(D)){const Ee=Z?((be=(ke=n.value)==null?void 0:ke.paths)==null?void 0:be.get(Z))||((Be=(ve=(Se=n.value)==null?void 0:Se.models)==null?void 0:ve.get(Z))==null?void 0:Be[0]):null,Oe=Ee==null?void 0:Ee.field;if(Oe&&M(Oe.component,Oe.props||Oe.propsFieldCustom||Oe.propsFieldGlobal||{})){const Re=(D==null?void 0:D.id)??(D==null?void 0:D.code)??(D==null?void 0:D.value)??(D==null?void 0:D.key)??(D==null?void 0:D.name)??(D==null?void 0:D.title)??D,De=typeof Re=="string"||typeof Re=="number"?N(Z,Re,Oe,D):Re;if(De&&typeof De=="object")return{...D,...De,_isLogicValue:!0}}return D}return D};return R!=null&&R.includes(".")&&R.split(".").slice(0,-1).join("."),new Proxy(b,{get(D,Z){var pe,ke,be,Se,ve,Be;if(Z==="_isNormalizedProxy")return!0;if(typeof Z!="string")return D[Z];if(Z==="parent"){const Ee=A||C;return Ee?Ee._isNormalizedProxy?Ee:j(Ee,void 0,S):void 0}if(Z==="root"){const Ee=C;return Ee?Ee._isNormalizedProxy?Ee:j(Ee,void 0,S):void 0}if(Z.startsWith("parent.")){const Ee=Z.replace(/^parent\./,""),Oe=A||C,Ae=Ye(Oe,Ee)??Oe[Ee];if(Ae!=null)return T(Ae,Ee)}if(Z.startsWith("root.")){const Ee=Z.replace(/^root\./,""),Oe=C,Ae=Ye(Oe,Ee)??Oe[Ee];if(Ae!=null)return T(Ae,Ee)}if(Z==="_resolveLogicVar")return Ee=>{var Ie,Ce,ne,ye;if(!Ee)return;const Oe=Ee.replace(/^formData\./,""),Ae=(Ce=(Ie=n.value)==null?void 0:Ie.paths)==null?void 0:Ce.get(Oe);if(Ae){const Me=Ye(b,Ae.path)??b[Ae.path]??Ye(b,Oe)??b[Oe]??Ye(e,Ae.path);if(Me!==void 0)return T(Me,Oe)}const Re=Oe.split(".");for(let Me=Re.length;Me>0;Me--){const Ke=Re.slice(0,Me).join("."),$e=[];for(const[He,rt]of((ye=(ne=n.value)==null?void 0:ne.paths)==null?void 0:ye.entries())||[])if(He===Ke||He.endsWith("."+Ke)){let Ve=0;if(R){const Fe=He.split("."),Ue=R.split(".");let at=0;for(let nt=0;nt<Math.min(Fe.length,Ue.length)&&Fe[nt]===Ue[nt];nt++)at++;Ve=at}$e.push({ent:rt,key:He,score:Ve})}if($e.length>0){$e.sort((Ue,at)=>at.score!==Ue.score?at.score-Ue.score:Ue.key.length-at.key.length);const He=$e[0],rt=Ye(b,He.ent.path)??b[He.ent.path]??Ye(b,He.key)??b[He.key]??Ye(e,He.ent.path);let Ve=T(rt,He.key);const Fe=Re.slice(Me);for(const Ue of Fe){if(Ve==null){Ve=void 0;break}Ve=Ve[Ue]}if(Ve!==void 0)return Ve}}if(Oe.includes(".")){const Me=Oe.split(".");let Ke=b;for(const $e of Me){if(Ke==null)return;Ke=Ke[$e]}if(Ke!==void 0)return Ke}const De=b[Oe];if(De!==void 0)return De};const J=R?`${R}.${Z}`:Z;S!=="VISIBILITY-SILENT"&&!Z.startsWith("__v_")&&Z!=="_isNormalizedProxy"&&console.log(`[Proxy][GET] ${J} (Target: ${R||"ROOT"}, Debug: ${S})`);const fe=(ke=(pe=n.value)==null?void 0:pe.paths)==null?void 0:ke.get(J);if(fe){const Ee=Ye(D,fe.path)??D[fe.path]??(R?D[`${R}.${Z}`]:void 0)??Ye(e,fe.path);if(Ee&&typeof Ee=="object"&&!Array.isArray(Ee)&&!Ee._isLogicValue&&!Ee._isNormalizedProxy)return j(Ee,J,S);if(Ee!==void 0)return T(Ee,J)}const ae=(Se=(be=n.value)==null?void 0:be.models)==null?void 0:Se.get(Z);if(Array.isArray(ae)&&ae.length>0){const Ee=R!=null&&R.includes(".")?R.split(".").slice(0,-1).join("."):R;if(Ee){const Re=ae.find(De=>{var Ie;return(Ie=De==null?void 0:De.path)==null?void 0:Ie.startsWith(`${Ee}.`)});if(Re){const De=Ye(D,Re.path)??D[Re.path]??Ye(e,Re.path);if(De&&typeof De=="object"&&!Array.isArray(De)&&!De._isLogicValue&&!De._isNormalizedProxy)return j(De,J,S);if(De!==void 0)return T(De,Z)}}const Oe=ae[0];if((ve=Oe.field)!=null&&ve.type&&!((Be=Oe.field)!=null&&Be.model))return j(e,void 0,S);const Ae=Ye(D,Oe.path)??D[Oe.path]??Ye(e,Oe.path);if(Ae&&typeof Ae=="object"&&!Array.isArray(Ae)&&!Ae._isLogicValue&&!Ae._isNormalizedProxy)return j(Ae,J,S);if(Ae!==void 0)return T(Ae,Z)}let we=D[Z];if(we===void 0&&R&&D[`${R}.${Z}`]!==void 0&&(we=D[`${R}.${Z}`]),we===void 0&&a&&typeof Z=="string"&&(we=a[Z]??a[J],we===void 0&&Z.includes(".")&&(we=Ye(a,Z)),we===void 0)){const Ee=Object.keys(a).find(Oe=>Oe.endsWith(`.${Z}`));Ee&&(we=a[Ee])}if(we===void 0&&typeof Z=="string"){const Ee=Object.keys(D).find(Oe=>Oe.endsWith(`.${Z}`));Ee&&(we=D[Ee])}if(we===void 0&&typeof Z=="string"){const Ee=Object.keys(D).some(Oe=>Oe.startsWith(`${Z}.`));if(!Ee&&a&&Object.keys(a).some(Ae=>Ae.startsWith(`${Z}.`)))return j(a,J,S);if(Ee)return j(D,J,S)}if(we===void 0&&typeof Z=="string"){if(A&&A!==D){const Ee=Ye(A,Z)??A[Z];Ee!=null&&(we=Ee)}if(we===void 0&&C&&C!==D&&C!==A){const Ee=Ye(C,Z)??C[Z];Ee!=null&&(we=Ee)}}if((Z==="id"||Z==="code")&&we===void 0){const Oe=D[Z==="id"?"code":"id"];Oe!==void 0&&(we=Oe)}return we&&typeof we=="object"&&!Array.isArray(we)&&!we._isLogicValue&&!we._isNormalizedProxy?j(we,J,S):T(we,J)},has(D,Z){var we,pe,ke,be;if(typeof Z!="string")return Z in D;if(Z==="parent"||Z==="root")return!0;let J=Z;if(Z.startsWith("parent.")?J=Z.replace(/^parent\./,""):Z.startsWith("root.")&&(J=Z.replace(/^root\./,"")),((pe=(we=n.value)==null?void 0:we.paths)==null?void 0:pe.has(J))||((be=(ke=n.value)==null?void 0:ke.models)==null?void 0:be.has(J))||J in D||Object.keys(D).some(Se=>Se.startsWith(`${J}.`)))return!0;const ae=A||C;return!!(ae&&ae!==D&&(J in ae||Ye(ae,J)!==void 0)||C&&C!==D&&C!==ae&&(J in C||Ye(C,J)!==void 0))},ownKeys(D){var fe,ae;const Z=new Set([...Object.keys(D),...(fe=n.value)!=null&&fe.paths?Array.from(n.value.paths.keys()):[],...(ae=n.value)!=null&&ae.models?Array.from(n.value.models.keys()):[]]),J=A||C;return J&&J!==D&&Object.keys(J).forEach(we=>Z.add(we)),C&&C!==D&&C!==J&&Object.keys(C).forEach(we=>Z.add(we)),Array.from(Z)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})},W=o.ref(new Set);function P(){Hv()}function E(b,R,S="LOGIC",T){const D=R?R._isNormalizedProxy?R:j(R,T,S):T?j(e,T,S):B.value;if(b==null||typeof b=="object"&&Object.keys(b).length===0)return!0;if(typeof b=="boolean")return b;if(typeof b=="string")try{return!!new Function("formData",`return ${b};`)(D)}catch{return!1}const Z=fe=>{var ke,be;if(!fe||typeof fe!="object")return fe;if(Array.isArray(fe))return fe.map(Z);const ae=Object.keys(fe)[0],we=fe[ae];if(["==","!=","in","!==","==="].includes(ae)&&Array.isArray(we)&&we.length===2){let Se=we[0],ve=we[1];if((ke=Se==null?void 0:Se.var)!=null&&ke.endsWith(".id")&&typeof ve=="string"&&isNaN(Number(ve))){const Be=Se.var.replace(/\.id$/,".code");return{[ae]:[{var:Be},ve]}}if((be=ve==null?void 0:ve.var)!=null&&be.endsWith(".id")&&typeof Se=="string"&&isNaN(Number(Se))){const Be=ve.var.replace(/\.id$/,".code");return{[ae]:[Se,{var:Be}]}}}const pe={};for(const Se in fe)pe[Se]=Z(fe[Se]);return pe},J=Z(b);JSON.stringify(J)!==JSON.stringify(b)&&S!=="VISIBILITY-SILENT"&&console.log("[evaluateLogic][AUTO-HEAL] Migrated rule from .id to .code for consistency:",JSON.stringify(J));try{P();const fe=go.apply(J,D);let ae=fe;return typeof fe=="number"&&isNaN(fe)&&(ae=void 0),S!=="VISIBILITY-SILENT"&&console.log(`[evaluateLogic][${S}] Rule:`,JSON.stringify(b),"Result:",ae),ae}catch(fe){console.error(`[DynamicForm][ERROR][${S}] Logic evaluation failed:`,fe,{rule:b,contextPath:T});return}}function k(b,R,S,T){return b==null?null:Array.isArray(b)?b.find(D=>!D.condition||E(D.condition,R,S,T))||null:typeof b=="object"&&b!==null&&b.condition&&!b._isLogicValue?E(b.condition,R,S,T)?b:null:b}function $(b,R,S){var J;if(b.isHidden||c&&c[b.model])return!0;const T=R?j(R,S):S?j(e,S):B.value,D=(J=b.logic)==null?void 0:J.visibleRule;if(D==null)return!0;const Z=k(D,T,`VISIBLE-${b.model}`,S);return Z===null?!0:typeof Z=="object"?!!E(Z,T,`VISIBLE-${b.model}`,S):!!Z}function I(b,R,S){var ae;const T=b.props||b.propsFieldCustom||b.propsFieldGlobal||{},D=!!(b.required||T.required),Z=R?j(R,S):S?j(e,S):B.value,J=(ae=b.logic)==null?void 0:ae.requiredRule;if(J==null)return D;const fe=k(J,Z,`REQUIRED-${b.model}`,S);return fe===null?D:typeof fe=="object"?"required"in fe?!!fe.required:!!E(fe,Z,`REQUIRED-${b.model}`,S):!!fe}function O(b,R,S){var ae;const T=b.props||b.propsFieldCustom||b.propsFieldGlobal||{},D=!!(b.disabled||T.disabled),Z=R?j(R,S):S?j(e,S):B.value,J=(ae=b.logic)==null?void 0:ae.disabledRule;if(J==null)return D;const fe=k(J,Z,`DISABLED-${b.model}`,S);return fe===null?D:typeof fe=="object"?"disabled"in fe?!!fe.disabled:!!E(fe,Z,`DISABLED-${b.model}`,S):!!fe}function q(b,R,S){var ae;const T=b.props||b.propsFieldCustom||b.propsFieldGlobal||{},D=!!(b.readonly||T.readonly),Z=R?j(R,S):S?j(e,S):B.value,J=(ae=b.logic)==null?void 0:ae.readonlyRule;if(J==null)return D;const fe=k(J,Z,`READONLY-${b.model}`,S);return fe===null?D:typeof fe=="object"?!!E(fe,Z,`READONLY-${b.model}`,S):!!fe}function X(b,R,S){var J,fe;if(b.isHidden||((J=b.logic)==null?void 0:J.hiddenRule)===!0)return!0;const T=(fe=b.logic)==null?void 0:fe.hiddenRule;if(T==null)return!1;const D=R?j(R,S):S?j(e,S):B.value,Z=k(T,D,`HIDDEN-${b.model}`,S);return Z===null?!1:typeof Z=="object"?!!E(Z,D,`HIDDEN-${b.model}`,S):!!Z}function oe(b){var Z;const R=b.propsForm||b.propsFormStep||b.propsTable||b.propsTableStep||b.propsDataTableWizard||b.propsWizard||b.props||{};let S=s.value==="kr"||s.value==="ko"?R.titleKR||b.titleKR||R.titleEN||b.titleEN||b.labelEN||R.titleID||b.titleID||b.labelID:s.value==="id"?R.titleID||b.titleID||b.labelID:R.titleEN||b.titleEN||b.labelEN,T=s.value==="kr"||s.value==="ko"?R.descriptionKR||b.descriptionKR||R.descriptionEN||b.descriptionEN||R.descriptionID||b.descriptionID:s.value==="id"?R.descriptionID||b.descriptionID:R.descriptionEN||b.descriptionEN;const D=k((Z=b.logic||R.logic)==null?void 0:Z.labelingRule,B.value,"LABEL-SEC");return D&&(S=s.value==="kr"||s.value==="ko"?D.labelKR||D.titleKR||D.labelEN||D.titleEN||D.title||D.labelID||D.titleID:s.value==="id"?D.labelID||D.titleID||D.title:D.labelEN||D.titleEN||D.title,T=s.value==="kr"||s.value==="ko"?D.descriptionKR||D.descriptionEN||D.descriptionID:s.value==="id"?D.descriptionID:D.descriptionEN),{title:S,description:T}}function ue(b,R){var fe;if(!b)return!0;const S=b.propsForm||b.propsFormStep||b.propsTable||b.propsTableStep||b.propsDataTableWizard||b.propsWizard||b.props||{},T=(fe=b.logic||S.logic)==null?void 0:fe.visibleRule,D=R?j(R):B.value;if(T!=null){const ae=k(T,D,"VISIBLE-SEC");let we=!0;return ae===null?we=!0:typeof ae=="object"?we=!!E(ae,D,"VISIBLE-SEC"):we=!!ae,we}const Z=Pt(b);if(Z&&W.value.has(Z))return!!(l&&l[Z]);const J=S.fields||b.fields||[];return J.length===0||J.some(ae=>$(ae,R))}function te(b,R){var J;if(!b)return!1;if(b.isHidden)return!0;const S=b.propsForm||b.propsFormStep||b.propsTable||b.propsTableStep||b.propsDataTableWizard||b.propsWizard||b.props||{},T=(J=b.logic||S.logic)==null?void 0:J.hiddenRule;if(T==null)return!1;if(T===!0)return!0;const D=R?j(R):B.value,Z=k(T,D,"HIDDEN-SEC");return Z===null?!1:typeof Z=="object"?!!E(Z,D,"HIDDEN-SEC"):!!Z}function re(b,R){var D;const S=R?j(R):B.value;return k((D=b.logic)==null?void 0:D.labelingRule,S,`LABEL-${b.model}`)||null}function ge(b,R){var Z;const S=R?j(R):B.value,T=(Z=b.logic)==null?void 0:Z.lengthRule;if(!T){const J=b.props||b.propsFieldCustom||b.propsFieldGlobal||{};return J.minLength!==void 0||J.maxLength!==void 0?{minLength:J.minLength,maxLength:J.maxLength}:null}const D=k(T,S,`LENGTH-${b.model}`);if(!D){const J=b.props||b.propsFieldCustom||b.propsFieldGlobal||{};return{minLength:J.minLength,maxLength:J.maxLength}}return typeof D=="object"&&D!==null&&!D._isLogicValue?"maxLength"in D||"minLength"in D?D:E(D,S,`LENGTH-${b.model}`):D}function ce(b,R,S){var pe,ke;const T=R?j(R,S):S?j(e,S):B.value,D=(pe=b.logic)==null?void 0:pe.defaultValueRule;if(D==null)return;const Z=k(D,T,`DEFAULT-VAL-${b.model}`,S);if(Z===null)return;let J=Z;typeof Z=="object"&&Z!==null&&"value"in Z&&!Z._isLogicValue&&(J=Z.value);let fe;return typeof J=="object"&&J!==null&&!J._isLogicValue?fe=E(J,T,`DEFAULT-VAL-${b.model}`,S):fe=J,((b.props||b.propsFieldCustom||b.propsFieldGlobal||{}).returnObject||((ke=b.logic)==null?void 0:ke.returnObject))&&(typeof fe=="string"||typeof fe=="number")?N(b.model,fe,b):fe}function se(b,R,S){var ae,we,pe;const T=b.props||{};let Z=[...i[b.key]||T.items||T.options||[]];if((ae=b.logic)!=null&&ae.optionsFilterRule){const ke=R?j(R,S,`FILTER-${b.model}`):S?j(e,S,`FILTER-${b.model}`):B.value,be=k(b.logic.optionsFilterRule,ke,`FILTER-${b.model}`,S);if(be){const Se=be.options||be.items;if(Se&&Array.isArray(Se))Z=[...Se];else if(be.values){const ve=be.values||[],Be=new Set(ve.map(String)),Ee=new Set(ve.map(Re=>String(Re).toUpperCase())),Oe=T.itemValue||"id",Ae=T.itemTitle||"name";Z=Z.filter(Re=>{if(Re==null)return!1;if(typeof Re!="object"){const De=String(Re);return Be.has(De)||Ee.has(De.toUpperCase())}return[Oe,Ae,"code","id","value","key","name","title"].some(De=>{const Ie=Re[De];if(Ie==null)return!1;const Ce=String(Ie);return Be.has(Ce)||Ee.has(Ce.toUpperCase())})})}}}const J=h==null?void 0:h.value;if(T.excludeSelectedInTable||(J==null?void 0:J.excludeSelectedInTable)||((we=J==null?void 0:J.propsActionGlobal)==null?void 0:we.excludeSelectedInTable)||((pe=J==null?void 0:J.propsActionCustom)==null?void 0:pe.excludeSelectedInTable)){let ke=[];const be=b.model||b.key,Se=T.itemValue||"id",ve=(ne,ye)=>{if(!ne||typeof ne!="object")return;if(ne[ye]!==void 0&&ne[ye]!==null)return ne[ye];if(ye&&ye.includes(".")){const Ke=ye.split(".").reduce(($e,He)=>$e&&$e[He],ne);if(Ke!=null)return Ke}const Me=ye?ye.split(".").pop():"";if(Me&&ne[Me]!==void 0&&ne[Me]!==null)return ne[Me];for(const[Ke,$e]of Object.entries(ne))if($e!=null&&(ye&&Ke.endsWith(`.${ye}`)||Me&&Ke.endsWith(`.${Me}`)))return $e},Be=ne=>{if(ne==null||ne==="")return null;if(typeof ne=="object"){const ye=ne[Se]??ne.id??ne.code??ne.value??ne.key;return ye!=null?String(ye):null}return String(ne)},Ee=[],Oe=g&&typeof g=="object"&&"value"in g?g.value:g;if(Array.isArray(Oe)&&Oe.length>0)Ee.push(...Oe);else{const ne=A||C||{};for(const ye of Object.values(ne))Array.isArray(ye)&&ye.some(Ke=>ve(Ke,be)!==void 0)&&Ee.push(...ye)}const Ae=m==null?void 0:m.value,Re=Ae?ve(Ae,be):void 0,De=Be(Re);Ee.forEach(ne=>{if(!ne||typeof ne!="object"||Ae&&ne===Ae)return;const ye=ve(ne,be),Me=Be(ye);Me&&(!De||Me!==De)&&ke.push(Me)});const Ie=R?R[be]:Ye(e,be),Ce=Be(Ie);if(Ce&&(ke=ke.filter(ne=>ne!==Ce)),ke.length>0){const ne=new Set(ke);Z=Z.filter(ye=>ye==null?!1:typeof ye!="object"?!ne.has(String(ye)):![Se,"id","code","value","key"].some($e=>{const He=ye[$e];return He!=null&&ne.has(String(He))}))}}return Z}function z(b){var S;return(((S=b.propsWizard)==null?void 0:S.propsSteps)||[]).filter(T=>ue(T)).map((T,D)=>{var we,pe,ke,be,Se,ve,Be;const Z=T.sectionsWizard||T.sections||[],fe=(Array.isArray(Z)?Z:[Z]).map(Ee=>{var Ae;let Oe=(Ae=Ee.type)==null?void 0:Ae.toUpperCase();return Oe||(Ee.propsForm||Ee.propsFormStep||Ee.fields?Oe="FORM":Ee.propsTable||Ee.propsTableStep||Ee.propsDataTableWizard||Ee.isDataTable?Oe="TABLE":Ee.propsButton||Ee.propsButtonStep?Oe="BUTTON":Oe="UNKNOWN"),{...Ee,type:Oe}}),ae=oe(T);return{key:T.modelKey||T.key||`step-${D}`,title:ae.title,description:ae.description,icon:T.icon||void 0,sections:fe,actions:((we=T.propsComponent)==null?void 0:we.actionComponent)||T.actionComponent||[],isSubmit:T.isSubmit||((pe=T.propsStep)==null?void 0:pe.isSubmit)||!1,endpointActionStepNext:((ke=T.propsStep)==null?void 0:ke.endpointActionStepNext)||T.endpointActionStepNext||((be=T.propsStep)==null?void 0:be.endpointSave)||T.endpointSave,endpointActionStepPrev:((Se=T.propsStep)==null?void 0:Se.endpointActionStepPrev)||T.endpointActionStepPrev,fieldMapping:((ve=T.propsStep)==null?void 0:ve.fieldMapping)||T.fieldMapping||{},responseMapping:((Be=T.propsStep)==null?void 0:Be.responseMapping)||T.responseMapping||{}}})}function G(){var b;if((b=r.value)!=null&&b.sections)for(let R=0;R<3;R++){let S=!1;if(r.value.sections.forEach(T=>{const D=(Z,J)=>{var pe,ke;const fe=J,we=(Z.propsForm||Z.propsFormStep||Z.propsTable||Z.propsTableStep||Z.propsDataTableWizard||Z.props||{}).fields||Z.fields||[];Z.component==="DynamicTableSection"||Z.type==="TABLE"||Z.type==="DATATABLE"||(we.forEach(be=>{if(!be.logic||typeof be.logic!="object")return;Object.keys(be.logic).filter(ve=>ve.toLowerCase().includes("calculaterule")&&be.logic[ve]&&typeof be.logic[ve]=="object").forEach(ve=>{const Be=be.logic[ve],Ee=Object.keys(Be)[0];if(!Ee)return;const Oe=fe?`${fe}.${Ee}`:Ee;let Ae=Be[Ee];if(Ae&&typeof Ae=="object"&&!Array.isArray(Ae)&&"formula"in Ae){if(Ae.condition&&!E(Ae.condition,e,`CALC-COND-${Ee}`,Oe))return;Ae=Ae.formula}const Re=E(Ae,e,`CALC-${Ee}`,Oe),De=Ye(e,Oe);Re!==void 0&&(Number.isNaN(Re)?!Number.isNaN(De):JSON.stringify(De)!==JSON.stringify(Re))&&(Xt(e,Oe,Re),S=!0)}),be.logic.copyRule&&(Array.isArray(be.logic.copyRule)?be.logic.copyRule:[be.logic.copyRule]).forEach(Be=>{const Ee=fe?`${fe}.${be.model}`:be.model,Oe=Be.condition?E(Be.condition,e,`COPY-COND-${be.model}`,Ee):!0;if(console.log(`[useFormLogic][COPY-RULE] Evaluating for field: ${be.model}, path: ${Ee}`,{conditionMet:Oe,source:Be.source}),Oe){let Ae;if(typeof Be.source=="string"?(Ae=B.value[Be.source],console.log(`[useFormLogic][COPY-RULE] Resolved source "${Be.source}" from normalizedData:`,Ae)):Be.source&&typeof Be.source=="object"&&(Ae=E(Be.source,e,`COPY-SRC-${be.model}`,Ee),console.log("[useFormLogic][COPY-RULE] Resolved object source:",Ae)),Ae!==void 0){const Re=Ye(e,Ee);console.log(`[useFormLogic][COPY-RULE] Comparing values for ${be.model}:`,{currentVal:Re,sourceVal:Ae,isDiff:JSON.stringify(Re)!==JSON.stringify(Ae)});let De=Ae;Ae&&typeof Ae=="object"&&Ae._isLogicValue&&(M(be.component,be.props||be.propsFieldCustom||be.propsFieldGlobal||{})||(De=Ae.code??Ae.id??Ae.value??Ae,console.log(`[useFormLogic][COPY-RULE] Unwrapping LogicValue for non-select target ${be.model}:`,De))),JSON.stringify(Re)!==JSON.stringify(De)&&(Xt(e,Ee,De),S=!0,console.log(`[useFormLogic][COPY-RULE] SUCCESS! Copied value to ${be.model}:`,De))}else console.log("[useFormLogic][COPY-RULE] Source value is undefined for source:",Be.source)}})}),((pe=Z.type)==null?void 0:pe.toUpperCase())==="WIZARD"&&(((ke=Z.propsWizard)==null?void 0:ke.propsSteps)||[]).forEach(Se=>{const ve=Se.key||Se.id,Be=Se.sectionsWizard||Se.sections||[];(Array.isArray(Be)?Be:[Be]).forEach(Oe=>D(Oe,ve))}))};D(T)}),!S)break}}function ee(b,R){if(!$(b)||!I(b))return!1;const S=R?`${R}.${b.model}`:b.model,T=n.value.paths.get(S),D=T?Ye(e,T.path):e[b.model];return Array.isArray(D)?D.length===0:D==null||D===""}function K(b){return b.sections.flatMap(S=>(S.propsForm||S.propsTable||S.props||{}).fields||S.fields||[]).some(S=>ee(S,b.key))}function Y(b){var T;if(!ue(b))return!1;const R=Pt(b);return(((T=b.propsForm)==null?void 0:T.fields)||b.fields||[]).some(D=>ee(D,R))?!0:b.type==="WIZARD"?z(b).some(K):!1}const F=o.computed(()=>{var b;return(b=r.value)!=null&&b.sections?Object.keys(t).length>0?!0:r.value.sections.some(Y):!1});function _(b){const R=new Set,S=(b==null?void 0:b.sections)||[];function T(D){D.forEach(Z=>{var ae;((Z.propsForm||Z.propsFormStep||Z.propsTable||Z.propsTableStep||Z.props||{}).fields||Z.fields||[]).forEach(we=>{var be,Se,ve,Be;(Array.isArray((be=we.logic)==null?void 0:be.fetchRule)?we.logic.fetchRule:[(Se=we.logic)==null?void 0:Se.fetchRule].filter(Boolean)).forEach(Ee=>{Array.isArray(Ee.revealSections)&&Ee.revealSections.forEach(Oe=>R.add(Oe))}),(Array.isArray((ve=we.logic)==null?void 0:ve.autoFetchRule)?we.logic.autoFetchRule:[(Be=we.logic)==null?void 0:Be.autoFetchRule].filter(Boolean)).forEach(Ee=>{Array.isArray(Ee.revealSections)&&Ee.revealSections.forEach(Oe=>R.add(Oe))})}),Z.type==="WIZARD"&&((ae=Z.propsWizard)!=null&&ae.propsSteps)&&Z.propsWizard.propsSteps.forEach(we=>{Array.isArray(we.sectionsWizard)?T(we.sectionsWizard):we.sectionsWizard&&T([we.sectionsWizard])})})}T(S),W.value=R}return o.watch(()=>r.value,b=>{_(b)},{deep:!0}),_(r.value),{normalizedData:B,getNormalizedData:j,evaluateLogic:E,resolveActiveRule:k,resolveValueIdentifier:N,getFilteredItems:se,isFieldVisible:$,isFieldRequired:I,isFieldDisabled:O,isFieldReadonly:q,isFieldHidden:X,resolveSectionLabels:oe,isSectionVisible:ue,isSectionHidden:te,resolveFieldLabels:re,resolveFieldLength:ge,resolveDefaultValue:ce,getWizardTabs:z,applyCalculations:G,isSubmitDisabled:F,resolveSectionGridClass:b=>{const R={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},S={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},D=(Z=>{const J=String(Z||"FULL").toUpperCase(),fe=Number.parseInt(J);if(!Number.isNaN(fe)&&fe>0)return Math.min(12,fe);switch(J){case"FULL":case"ONE":return 1;case"HALF":case"TWO":return 2;case"THIRD":case"THREE":return 3;case"TWO-THIRD":case"TWO-THIRDS":return 3;case"QUARTER":case"QUARTED":case"FOUR":return 4;case"THREE-QUARTER":case"THREE-QUARTERS":return 4;default:return 1}})(b);return`${R[D]||"grid-cols-1"} ${S[D]||"md:grid-cols-1"}`},resolveFieldColumnClass:(b,R="FULL")=>{var pe;const S={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},D=(ke=>{const be=String(ke||"FULL").toUpperCase(),Se=parseInt(be);if(!isNaN(Se)&&Se>0)return Math.min(12,Se);switch(be){case"FULL":case"ONE":return 1;case"HALF":case"TWO":return 2;case"THIRD":case"THREE":return 3;case"TWO-THIRD":case"TWO-THIRDS":return 3;case"QUARTER":case"QUARTED":case"FOUR":return 4;case"THREE-QUARTER":case"THREE-QUARTERS":return 4;default:return 1}})(R),Z=b.column||((pe=b.props)==null?void 0:pe.colSpan)||"FULL";let J=1;const fe=String(Z).toUpperCase(),ae=parseInt(fe);if(!isNaN(ae)&&ae>0)J=ae;else switch(fe){case"FULL":case"ONE":J=1;break;case"HALF":case"TWO":J=2;break;case"THIRD":case"THREE":J=3;break;case"QUARTER":case"QUARTED":case"FOUR":J=4;break;case"TWO-THIRD":case"TWO-THIRDS":J=2;break;case"THREE-QUARTER":case"THREE-QUARTERS":J=3;break;default:J=1}const we=Math.min(D,J);return D===1?"col-span-1":`col-span-1 ${S[we]||"md:col-span-1"}`}}}function fS({formData:e,locale:t,errors:n,fieldMap:i,activeSchema:r,isSectionVisible:s,isSectionHidden:a,isFieldVisible:l,isFieldRequired:c,resolveFieldLength:d}){const f=(m,g,v)=>{var C,M,B,N,j,W;const y=m.props||m.propsFieldCustom||m.propsFieldGlobal||{};let A="";if(g!=null)if(typeof g=="object")if(Array.isArray(g))A=g.length>0?"non-empty":"";else{const P=g.id??g.code??g.value??g.name??g.title??"";A=P==null?"":String(P).trim()}else A=String(g).trim();if(c(m,v)&&(!A||A===""))return t.value==="kr"||t.value==="ko"?`${((C=m.propsFieldGlobal)==null?void 0:C.labelKR)||((M=m.propsFieldCustom)==null?void 0:M.labelKR)||y.labelKR||m.labelKR||m.model||"필드"}은(는) 필수입니다.`:t.value==="id"?`${((B=m.propsFieldGlobal)==null?void 0:B.labelID)||((N=m.propsFieldCustom)==null?void 0:N.labelID)||y.labelID||m.labelID||m.model||"Field"} wajib diisi.`:`${((j=m.propsFieldGlobal)==null?void 0:j.labelEN)||((W=m.propsFieldCustom)==null?void 0:W.labelEN)||y.labelEN||m.labelEN||m.model||"Field"} is required.`;if(A&&A!==""){const P=d(m,v);if(P){const{minLength:E,maxLength:k}=P;if(E!=null&&A.length<E)return t.value==="kr"||t.value==="ko"?`최소 ${E}자를 입력해야 합니다.`:t.value==="id"?`Minimal ${E} karakter.`:`Minimum ${E} characters required.`;if(k!=null&&A.length>k)return t.value==="kr"||t.value==="ko"?`최대 ${k}자까지 입력할 수 있습니다.`:t.value==="id"?`Maksimal ${k} karakter.`:`Maximum ${k} characters allowed.`}}if(y.regex)try{if(!new RegExp(y.regex).test(A))return y.regexMessage||(t.value==="kr"||t.value==="ko"?"올바르지 않은 형식입니다":t.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${m.model}:`,y.regex)}return null};return{validateField:f,validateAll:()=>{var v,y;let m=!0;const g=(A,C)=>{var j;if(!s(A)||a&&a(A))return;const M=Pt(A)||C;((A.propsForm||A.propsFormStep||A.propsTable||A.propsTableStep||A.props||{}).fields||A.fields||[]).forEach(W=>{if(W.model&&l(W)){let P=W.model;const E=i.value.models.get(W.model);E&&E.length>0?P=(M&&E.find(q=>q.path.startsWith(`${M}.`))||E[0]).path:M&&(P=`${M}.${W.model}`);const k=i.value.paths.get(P),$=k?Ye(e,k.path):Ye(e,W.model)??e[W.model],I=f(W,$);I?(n[P]=I,m=!1):delete n[P]}}),(A.type==="WIZARD"||A.isWizard)&&(((j=A.propsWizard)==null?void 0:j.propsSteps)||[]).forEach(P=>{const E=P.key||P.id;P.sectionsWizard&&(Array.isArray(P.sectionsWizard)?P.sectionsWizard:[P.sectionsWizard]).forEach($=>g($,E))})};return(y=(v=r.value)==null?void 0:v.sections)==null||y.forEach(A=>g(A)),m}}}function Tq({formData:e,activeSchema:t,isSectionVisible:n,isFieldVisible:i,isFieldHidden:r,getWizardTabs:s,fieldMap:a,rawItemsCache:l}){const c=()=>{var y;const g=[],v=A=>{A==null||A.forEach(C=>{if(C.type==="TABLE"||C.propsTable||C.propsTableStep||C.propsDataTableWizard){const N=C.propsTable||C.propsTableStep||C.propsDataTableWizard||C,j=N.modelKey||N.modelDatatable||Pt(C);j&&g.push({key:j,subFields:(N.headers||[]).map(W=>W.key)})}((C.propsForm||C.propsFormStep||C.propsTable||C.propsTableStep||C.propsDataTableWizard||C.props||{}).fields||C.fields||[]).forEach(N=>{var W,P;const j=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(N.component);if(N.model&&((W=N.props)!=null&&W.multiple||((P=N.props)==null?void 0:P.valueType)==="array"||j)){const E=N.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];g.push({key:N.model,subFields:E})}}),C.type==="WIZARD"&&s(C).forEach(N=>v(N.sections))})};return v((y=t.value)==null?void 0:y.sections),g};return{getCleanPayload:()=>{var y;if(!((y=t.value)!=null&&y.sections))return{...e};const g={},v=new Set;return t.value.sections.forEach(A=>{const C=n(A),M=Pt(A),B=(E,k)=>{if(!E.model)return;const $=k?`${k}.${E.model}`:E.model,I=C&&(i(E,void 0,k)||r(E,void 0,k));let O=null;if(I&&(O=Ye(e,$)??e[E.model]??bo(e,E.model),["DCodeAutoComplete","DCodeSelect","DCodeRadio","DCodeRadioCustom"].includes(E.component)&&O!==null&&O!==void 0&&typeof O!="object")){const X=l[E.key];if(Array.isArray(X)){const oe=X.find(ue=>String(ue.code)===String(O)||String(ue.id)===String(O)||String(ue.name)===String(O));if(oe){const te=(E.props||E.propsFieldCustom||E.propsFieldGlobal||{}).itemValue||"id";O=oe[te]??oe.id??oe.code??O}}}Xt(g,$,yo(O)??null),v.add(E.model)},N=A.propsForm||A.propsFormStep||A.propsTable||A.propsTableStep||A.propsDataTableWizard||A.props||{},j=A.type==="WIZARD";(N.fields||A.fields||[]).forEach(E=>B(E,j?M||N.key:void 0)),A.type==="WIZARD"&&s(A).forEach(E=>E.sections.forEach(k=>{const $=Pt(k),I=$?`${E.key}.${$}`:E.key;if(k.type==="TABLE"||k.propsTable||k.propsTableStep||k.propsDataTableWizard){const q=k.propsTable||k.propsTableStep||k.propsDataTableWizard||k,X=q.modelKey||q.modelDatatable||$;if(X){const oe=`${E.key}.${X}`,ue=Ye(e,oe)||Ye(e,X)||[];if(Array.isArray(ue)){const te=q.headers||[],re=ue.filter(ge=>kd(ge)?!1:te.length>0?te.some(ce=>{if(ce.key==="no"||ce.key==="action")return!1;let se=Ye(ge,ce.key);if(se!=null&&se!=="")return!0;const z=ce.key.includes(".")?ce.key.split(".").pop():null;return!!(z&&(se=Ye(ge,z),se!=null&&se!==""))}):!0);Xt(g,oe,yo(re)),console.log(`[SUBMIT][WIZARD-TABLE][${oe}] Payload before sanitize:`,ue.length,"after:",re.length)}else Xt(g,oe,[]);v.add(oe)}}else((k.propsForm||k.propsFormStep||k.propsTable||k.propsTableStep||k.propsDataTableWizard||k.props||{}).fields||k.fields||[]).forEach(oe=>B(oe,I))}));const W=A.propsTable||A.propsTableStep||A.propsDataTableWizard,P=(W==null?void 0:W.modelKey)||(W==null?void 0:W.modelDatatable)||M;if(P&&(A.type==="TABLE"||A.propsTable||A.propsTableStep||A.propsDataTableWizard)){if(C){const E=Ye(e,P)||[];if(Array.isArray(E)){const k=(W==null?void 0:W.headers)||[],$=E.filter(I=>kd(I)?!1:k.length>0?k.some(O=>{if(O.key==="no"||O.key==="action")return!1;let q=Ye(I,O.key);if(q!=null&&q!=="")return!0;const X=O.key.includes(".")?O.key.split(".").pop():null;return!!(X&&(q=Ye(I,X),q!=null&&q!==""))}):!0);g[P]=yo($),console.log(`[SUBMIT][${P}] Payload before sanitize:`,E.length,"after:",$.length)}else g[P]=[]}else{const E=Ye(e,P);E!==void 0&&(g[P]=yo(E))}v.add(P)}}),["id","_id"].forEach(A=>{e[A]!==void 0&&!v.has(A)&&(g[A]=yo(e[A]))}),g},applyFieldMapping:(g,v)=>{const y={},A=(B,N)=>{var j,W;if(B==null)return B;if(typeof B=="object")return B._isLogicValue?B.id:B.id??B.code??B.value??B;if(N&&l&&(a!=null&&a.value)){const P=(W=(j=a.value.models)==null?void 0:j.get(N))==null?void 0:W[0],E=P==null?void 0:P.field;if(E){const k=l[E.key];if(Array.isArray(k)){const $=k.find(I=>String(I.code)===String(B)||String(I.id)===String(B));if($&&$.id!==void 0)return $.id}}}return Array.isArray(B)&&B.length===1?A(B[0],N):B},C=(B,N)=>{if(!B||typeof B!="object")return;if(B[N]!==void 0)return B[N];const j=N.toLowerCase(),W=Object.keys(B).find(P=>P.toLowerCase()===j);return W!==void 0?B[W]:void 0};Object.entries(v).forEach(([B,N])=>{if(typeof N=="string"){const j=Ye(g,B)??C(g,B)??Ye(e,B)??C(e,B)??bo(g,B)??bo(e,B);j!==void 0&&(y[N]=A(j,B))}else if(Array.isArray(N)&&N.length>0){const j=N[0];let W=Ye(g,B)??C(g,B)??Ye(e,B)??C(e,B)??bo(g,B)??bo(e,B);if(!Array.isArray(W)||W.length===0){const P=typeof j=="string"?[j]:Object.keys(j),E=c(),k=E.find($=>$.key.toLowerCase()===B.toLowerCase());if(k){const $=Ye(g,k.key)??C(g,k.key)??Ye(e,k.key)??C(e,k.key)??bo(g,k.key)??bo(e,k.key);Array.isArray($)&&$.length>0&&(W=$)}if(!Array.isArray(W)||W.length===0){const $=E.find(I=>P.some(O=>I.subFields.includes(O)));if($){const I=Ye(g,$.key)??C(g,$.key)??Ye(e,$.key)??C(e,$.key)??bo(g,$.key)??bo(e,$.key);Array.isArray(I)&&I.length>0&&(W=I)}}}if(Array.isArray(W)){if(typeof j=="string")y[B]=W.map(P=>{const k=yo(P)[j]??P[j]??null;return A(k,j)}).filter(P=>P!=null);else if(typeof j=="object"&&j!==null){const P=Object.entries(j);if(P.length===1&&typeof P[0][1]=="string"){const[k,$]=P[0];y[$]=W.map(I=>{const O=yo(I);let q=O[k]??I[k]??void 0;if(q==null&&(q=Ye(O,k)??Ye(I,k)??void 0),q==null&&k.includes(".")){const X=k.split(".");for(let oe=1;oe<X.length;oe++){const ue=X.slice(oe).join("."),te=O[ue]??Ye(O,ue)??I[ue]??Ye(I,ue)??void 0;if(te!=null){q=te;break}}}return A(q??null,k)}).filter(I=>I!=null)}else y[B]=W.map(k=>{const $={},I=yo(k);return P.forEach(([O,q])=>{if(Array.isArray(q)&&q.length>0&&typeof q[0]=="object"){const oe=q[0];let ue=I[O]??k[O]??void 0;ue==null&&(ue=Ye(I,O)??Ye(k,O)??void 0),Array.isArray(ue)?$[O]=ue.map(te=>{const re={},ge=yo(te);return Object.entries(oe).forEach(([ce,se])=>{let z=ge[ce]??te[ce]??void 0;if(z==null&&(z=Ye(ge,ce)??Ye(te,ce)??void 0),z==null&&ce.includes(".")){const G=ce.split(".");for(let ee=1;ee<G.length;ee++){const K=G.slice(ee).join("."),Y=ge[K]??Ye(ge,K)??te[K]??Ye(te,K)??void 0;if(Y!=null){z=Y;break}}}re[se]=A(z??null,ce)}),re}).filter(te=>!kd(te)):$[O]=[];return}let X=I[O]??k[O]??I[q]??k[q]??void 0;if(X==null&&(X=Ye(I,O)??Ye(k,O)??void 0),X==null&&O.includes(".")){const oe=O.split(".");for(let ue=1;ue<oe.length;ue++){const te=oe.slice(ue).join("."),re=I[te]??Ye(I,te)??k[te]??Ye(k,te)??void 0;if(re!=null){X=re;break}}}$[q]=A(X??null,O)}),$}).filter(k=>!kd(k))}}}});const M=Object.keys(y).filter(B=>B.includes("."));if(M.length>0)for(const B of M){const N=B.indexOf("."),j=B.substring(0,N),W=B.substring(N+1),P=y[j],E=y[B];if(Array.isArray(P)&&Array.isArray(E))for(const k of P)k&&typeof k=="object"&&(k[W]=E);delete y[B]}return y},handleResponseMapping:(g,v,y)=>{if(!g||!v)return;const A=g,C=(g==null?void 0:g.data)!==void 0?g.data:g,M=Array.isArray(C)?C[0]:C;Object.entries(v).forEach(([B,N])=>{if(typeof B!="string"||typeof N!="string")return;const j=(P,E)=>{if(!(!E||!P||typeof E!="string")){if(E in P)return P[E];try{return E.split(".").reduce((k,$)=>k&&k[$],P)}catch{return}}},W=j(A,B)??j(A,N)??(C&&typeof C=="object"?j(C,B)??j(C,N):void 0)??(M&&typeof M=="object"?j(M,B)??j(M,N):void 0);if(W!==void 0){const P=y&&!N.includes(".")?`${y}.${N}`:N;Xt(e,P,W)}})},handleClearMapping:(g,v)=>{g&&Object.values(g).forEach(y=>{if(typeof y!="string")return;const A=v&&!y.includes(".")?`${v}.${y}`:y;Xt(e,A,null)})},getFormArrayModels:c}}const Nf={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},xd={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},Gi={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Pq={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},Bq={dangerouslyHTMLString:!1,multiple:!0,position:Nf.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},Nq={rtl:!1,newestOnTop:!1,toastClassName:""},hS={...Bq,...Nq};Gi.DEFAULT;var ln=(e=>(e[e.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",e[e.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",e.CSS_NAMESPACE="Toastify",e))(ln||{}),Gv=(e=>(e.ENTRANCE_ANIMATION_END="d",e))(Gv||{});const Dq={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},Mq={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},Rq={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},Iq={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},mS="Toastify--animate Toastify__none-enter";function pS(e,t=!1){var n;let i=Dq;if(!e||typeof e=="string")switch(e){case"flip":i=Iq;break;case"zoom":i=Rq;break;case"slide":i=Mq;break}else i=e;if(t)i.enter=mS;else if(i.enter===mS){const r=(n=i.exit.split("__")[1])==null?void 0:n.split("-")[0];i.enter=`Toastify--animate Toastify__${r}-enter`}return i}function Oq(e){return e.containerId||String(e.position)}const ag="will-unmount";function Lq(e=Nf.TOP_RIGHT){return!!document.querySelector(`.${ln.CSS_NAMESPACE}__toast-container--${e}`)}function Fq(e=Nf.TOP_RIGHT){return`${ln.CSS_NAMESPACE}__toast-container--${e}`}function $q(e,t,n=!1){const i=[`${ln.CSS_NAMESPACE}__toast-container`,`${ln.CSS_NAMESPACE}__toast-container--${e}`,n?`${ln.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Cd(t)?t({position:e,rtl:n,defaultClassName:i}):`${i} ${t||""}`}function zq(e){var t;const{position:n,containerClassName:i,rtl:r=!1,style:s={}}=e,a=ln.CSS_NAMESPACE,l=Fq(n),c=document.querySelector(`.${a}`),d=document.querySelector(`.${l}`),f=!!d&&!((t=d.className)!=null&&t.includes(ag)),h=c||document.createElement("div"),m=document.createElement("div");m.className=$q(n,i,r),m.dataset.testid=`${ln.CSS_NAMESPACE}__toast-container--${n}`,m.id=Oq(e);for(const g in s)if(Object.prototype.hasOwnProperty.call(s,g)){const v=s[g];m.style[g]=v}return c||(h.className=ln.CSS_NAMESPACE,document.body.appendChild(h)),f||h.appendChild(m),m}function Yv(e){var t,n,i;const r=typeof e=="string"?e:((t=e.currentTarget)==null?void 0:t.id)||((n=e.target)==null?void 0:n.id),s=document.getElementById(r);s&&s.removeEventListener("animationend",Yv,!1);try{Df[r].unmount(),(i=document.getElementById(r))==null||i.remove(),delete Df[r],delete vi[r]}catch{}}const Df=o.reactive({});function jq(e,t){const n=document.getElementById(String(t));n&&(Df[n.id]=e)}function Zv(e,t=!0){const n=String(e);if(!Df[n])return;const i=document.getElementById(n);i&&i.classList.add(ag),t?(Wq(e),i&&i.addEventListener("animationend",Yv,!1)):Yv(n),Kr.items=Kr.items.filter(r=>r.containerId!==e)}function Uq(e){for(const t in Df)Zv(t,e);Kr.items=[]}function gS(e,t){const n=document.getElementById(e.toastId);if(n){let i=e;i={...i,...pS(i.transition)};const r=i.appendPosition?`${i.exit}--${i.position}`:i.exit;n.className+=` ${r}`,t&&t(n)}}function Wq(e){for(const t in vi)if(t===e)for(const n of vi[t]||[])gS(n)}function Hq(e){const t=Ed().find(n=>n.toastId===e);return t==null?void 0:t.containerId}function Xv(e){return document.getElementById(e)}function qq(e){const t=Xv(e.containerId);return t&&t.classList.contains(ag)}function yS(e){var t;const n=o.isVNode(e.content)?o.toRaw(e.content.props):null;return n??o.toRaw((t=e.data)!=null?t:{})}function Kq(e){return e?Kr.items.filter(t=>t.containerId===e).length>0:Kr.items.length>0}function Gq(){if(Kr.items.length>0){const e=Kr.items.shift();lg(e==null?void 0:e.toastContent,e==null?void 0:e.toastProps)}}const vi=o.reactive({}),Kr=o.reactive({items:[]});function Ed(){const e=o.toRaw(vi);return Object.values(e).reduce((t,n)=>[...t,...n],[])}function Yq(e){return Ed().find(t=>t.toastId===e)}function lg(e,t={}){if(qq(t)){const n=Xv(t.containerId);n&&n.addEventListener("animationend",Jv.bind(null,e,t),!1)}else Jv(e,t)}function Jv(e,t={}){const n=Xv(t.containerId);n&&n.removeEventListener("animationend",Jv.bind(null,e,t),!1);const i=vi[t.containerId]||[],r=i.length>0;if(!r&&!Lq(t.position)){const s=zq(t),a=o.createApp(bK,t);t.useHandler&&t.useHandler(a),a.mount(s),jq(a,s.id)}r&&!t.updateId&&(t.position=i[0].position),o.nextTick(()=>{t.updateId?Er.update(t):Er.add(e,t)})}const Er={add(e,t){const{containerId:n=""}=t;n&&(vi[n]=vi[n]||[],vi[n].find(i=>i.toastId===t.toastId)||setTimeout(()=>{var i,r;t.newestOnTop?(i=vi[n])==null||i.unshift(t):(r=vi[n])==null||r.push(t),t.onOpen&&t.onOpen(yS(t))},t.delay||0))},remove(e){if(e){const t=Hq(e);if(t){const n=vi[t];let i=n.find(r=>r.toastId===e);vi[t]=n.filter(r=>r.toastId!==e),!vi[t].length&&!Kq(t)&&Zv(t,!1),Gq(),o.nextTick(()=>{i!=null&&i.onClose&&(i.onClose(yS(i)),i=void 0)})}}},update(e={}){const{containerId:t=""}=e;if(t&&e.updateId){vi[t]=vi[t]||[];const n=vi[t].find(s=>s.toastId===e.toastId),i=(n==null?void 0:n.position)!==e.position||(n==null?void 0:n.transition)!==e.transition,r={...e,disabledEnterTransition:!i,updateId:void 0};Er.dismissForce(e==null?void 0:e.toastId),setTimeout(()=>{xt(r.content,r)},e.delay||0)}},clear(e,t=!0){e?Zv(e,t):Uq(t)},dismissCallback(e){var t;const n=(t=e.currentTarget)==null?void 0:t.id,i=document.getElementById(n);i&&(i.removeEventListener("animationend",Er.dismissCallback,!1),setTimeout(()=>{Er.remove(n)}))},dismiss(e){if(e){const t=Ed();for(const n of t)if(n.toastId===e){gS(n,i=>{i.addEventListener("animationend",Er.dismissCallback,!1)});break}}},dismissForce(e){if(e){const t=Ed();for(const n of t)if(n.toastId===e){const i=document.getElementById(e);i&&(i.remove(),i.removeEventListener("animationend",Er.dismissCallback,!1),Er.remove(e));break}}}},Zq=o.reactive({useHandler:void 0}),bS=o.reactive({}),cg=o.reactive({});function vS(){return Math.random().toString(36).substring(2,9)}function Xq(e){return typeof e=="number"&&!isNaN(e)}function Qv(e){return typeof e=="string"}function Cd(e){return typeof e=="function"}function dg(...e){return o.mergeProps(...e)}function ug(e){return typeof e=="object"&&(!!(e!=null&&e.render)||!!(e!=null&&e.setup)||typeof(e==null?void 0:e.type)=="object")}function Jq(e={}){bS[`${ln.CSS_NAMESPACE}-default-options`]=e}function wS(){return bS[`${ln.CSS_NAMESPACE}-default-options`]||hS}function Qq(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||e?"dark":"light"}var fg=(e=>(e[e.Enter=0]="Enter",e[e.Exit=1]="Exit",e))(fg||{});const _S={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:Nf.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:xd.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:Gi.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},Vq={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:Gi.DEFAULT},theme:{type:String,required:!1,default:xd.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},eK=o.defineComponent({name:"ProgressBar",props:Vq,setup(e,{attrs:t}){const n=o.ref(),i=o.computed(()=>e.hide?"true":"false"),r=o.computed(()=>({...t.style||{},animationDuration:`${e.autoClose===!0?5e3:e.autoClose}ms`,animationPlayState:e.isRunning?"running":"paused",opacity:e.hide||e.autoClose===!1?0:1,transform:e.controlledProgress?`scaleX(${e.progress})`:"none"})),s=o.computed(()=>[`${ln.CSS_NAMESPACE}__progress-bar`,e.controlledProgress?`${ln.CSS_NAMESPACE}__progress-bar--controlled`:`${ln.CSS_NAMESPACE}__progress-bar--animated`,`${ln.CSS_NAMESPACE}__progress-bar-theme--${e.theme}`,`${ln.CSS_NAMESPACE}__progress-bar--${e.type}`,e.rtl?`${ln.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),a=o.computed(()=>`${s.value} ${(t==null?void 0:t.class)||""}`),l=()=>{n.value&&(n.value.onanimationend=null,n.value.ontransitionend=null)},c=()=>{e.isIn&&e.closeToast&&e.autoClose!==!1&&(e.closeToast(),l())},d=o.computed(()=>e.controlledProgress?null:c),f=o.computed(()=>e.controlledProgress?c:null);return o.watchEffect(()=>{n.value&&(l(),n.value.onanimationend=d.value,n.value.ontransitionend=f.value)}),()=>o.createVNode("div",{ref:n,role:"progressbar","aria-hidden":i.value,"aria-label":"notification timer",class:a.value,style:r.value},null)}}),tK=o.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:xd.AUTO},type:{type:String,required:!1,default:xd.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(e){return()=>o.createVNode("button",{class:`${ln.CSS_NAMESPACE}__close-button ${ln.CSS_NAMESPACE}__close-button--${e.theme}`,type:"button",onClick:t=>{t.stopPropagation(),e.closeToast&&e.closeToast(t)},"aria-label":e.ariaLabel},[o.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[o.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),hg=({theme:e,type:t,path:n,...i})=>o.createVNode("svg",o.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`}},i),[o.createVNode("path",{d:n},null)]);function nK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function iK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function rK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function oK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function sK(){return o.createVNode("div",{class:`${ln.CSS_NAMESPACE}__spinner`},null)}const mg={info:iK,warning:nK,success:rK,error:oK,spinner:sK},aK=e=>e in mg;function lK({theme:e,type:t,isLoading:n,icon:i}){let r;const s=!!n||t==="loading",a={theme:e,type:t};if(s&&(i===void 0||typeof i=="boolean"))return mg.spinner();if(i!==!1){if(ug(i))r=o.toRaw(i);else if(Cd(i)){const l=i;a.type=s?"loading":t,r=l(a),r=!r&&s?mg.spinner():r}else o.isVNode(i)?r=o.cloneVNode(i,a):Qv(i)||Xq(i)?r=i:aK(t)&&(r=mg[t](a));return r}}const cK=()=>{};function dK(e,t,n=ln.COLLAPSE_DURATION){const{scrollHeight:i,style:r}=e,s=n;requestAnimationFrame(()=>{r.minHeight="initial",r.height=i+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,s)})})}function uK(e){const t=o.ref(!1),n=o.ref(!1),i=o.ref(!1),r=o.ref(fg.Enter),s=o.reactive({...e,appendPosition:e.appendPosition||!1,collapse:typeof e.collapse>"u"?!0:e.collapse,collapseDuration:e.collapseDuration||ln.COLLAPSE_DURATION}),a=s.done||cK,l=o.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=o.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=o.computed(()=>e.pauseOnHover?{onMouseenter:A,onMouseleave:y}:{});function f(){const M=l.value.split(" ");m().addEventListener(Gv.ENTRANCE_ANIMATION_END,y,{once:!0});const B=j=>{const W=m();j.target===W&&(W.dispatchEvent(new Event(Gv.ENTRANCE_ANIMATION_END)),W.removeEventListener("animationend",B),W.removeEventListener("animationcancel",B),r.value===fg.Enter&&j.type!=="animationcancel"&&W.classList.remove(...M))},N=()=>{const j=m();j.classList.add(...M),j.addEventListener("animationend",B),j.addEventListener("animationcancel",B)};e.pauseOnFocusLoss&&g(),N()}function h(){if(!m())return;const M=()=>{const N=m();N.removeEventListener("animationend",M),s.collapse?dK(N,a,s.collapseDuration):a()},B=()=>{const N=m();r.value=fg.Exit,N&&(N.className+=` ${c.value}`,N.addEventListener("animationend",M))};n.value||(i.value?M():setTimeout(B))}function m(){return e.toastRef.value}function g(){document.hasFocus()||A(),window.addEventListener("focus",y),window.addEventListener("blur",A)}function v(){window.removeEventListener("focus",y),window.removeEventListener("blur",A)}function y(){(!e.loading.value||e.isLoading===void 0)&&(t.value=!0)}function A(){t.value=!1}function C(M){M&&(M.stopPropagation(),M.preventDefault()),n.value=!1}return o.watchEffect(h),o.watchEffect(()=>{const M=Ed();n.value=M.findIndex(B=>B.toastId===s.toastId)>-1}),o.watchEffect(()=>{e.isLoading!==void 0&&(e.loading.value?A():y())}),o.onMounted(f),o.onUnmounted(()=>{e.pauseOnFocusLoss&&v()}),{isIn:n,isRunning:t,hideToast:C,eventHandlers:d}}function fK(e){if(!e||typeof e!="object"||Array.isArray(e)||e.__v_isVNode)return!1;const t=e;return["title","content"].some(n=>n in t)}const hK=o.defineComponent({name:"ToastItem",inheritAttrs:!1,props:_S,setup(e){const t=o.ref(),n=o.computed(()=>!!e.isLoading),i=o.computed(()=>e.progress!==void 0&&e.progress!==null),r=o.computed(()=>lK(e)),s=o.computed(()=>[`${ln.CSS_NAMESPACE}__toast`,`${ln.CSS_NAMESPACE}__toast-theme--${e.theme}`,`${ln.CSS_NAMESPACE}__toast--${e.type}`,e.rtl?`${ln.CSS_NAMESPACE}__toast--rtl`:void 0,e.toastClassName||""].filter(Boolean).join(" ")),{isRunning:a,isIn:l,hideToast:c,eventHandlers:d}=uK({toastRef:t,loading:n,done:()=>{Er.remove(e.toastId)},...pS(e.transition,e.disabledEnterTransition),...e});function f(){const h=e.content;if(fK(h)){const m=[];return h.title!==void 0&&m.push(o.createVNode("div",{"data-testid":"toast-text-title",class:`${ln.CSS_NAMESPACE}__toast-text-title`},[h.title])),h.content!==void 0&&m.push(o.createVNode("div",{"data-testid":"toast-text-content",class:`${ln.CSS_NAMESPACE}__toast-text-content`},[h.content])),o.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${ln.CSS_NAMESPACE}__toast-text`},[m])}return ug(h)?o.h(o.toRaw(h),{toastProps:o.toRaw(e),closeToast:c,data:e.data,...e.expandCustomProps?e.contentProps:{contentProps:e.contentProps||{}}}):Cd(h)?h({toastProps:o.toRaw(e),closeToast:c,data:e.data}):e.dangerouslyHTMLString?o.h("div",{innerHTML:h}):h}return()=>o.createVNode("div",o.mergeProps({id:e.toastId,class:s.value,style:e.toastStyle||{},ref:t,"data-testid":`toast-item-${e.toastId}`,onClick:h=>{e.closeOnClick&&c(),e.onClick&&e.onClick(h)}},d.value),[o.createVNode("div",{role:e.role,"data-testid":"toast-body",class:`${ln.CSS_NAMESPACE}__toast-body ${e.bodyClassName||""}`},[r.value!=null&&o.createVNode("div",{"data-testid":`toast-icon-${e.type}`,class:[`${ln.CSS_NAMESPACE}__toast-icon`,e.isLoading?"":`${ln.CSS_NAMESPACE}--animate-icon ${ln.CSS_NAMESPACE}__zoom-enter`].join(" ")},[ug(r.value)?o.h(o.toRaw(r.value),{theme:e.theme,type:e.type}):Cd(r.value)?r.value({theme:e.theme,type:e.type}):r.value]),o.createVNode("div",{"data-testid":"toast-content"},[f()])]),(e.closeButton===void 0||e.closeButton===!0)&&o.createVNode(tK,{theme:e.theme,closeToast:h=>{h.stopPropagation(),h.preventDefault(),c()}},null),ug(e.closeButton)?o.h(o.toRaw(e.closeButton),{closeToast:c,type:e.type,theme:e.theme}):Cd(e.closeButton)?e.closeButton({closeToast:c,type:e.type,theme:e.theme}):null,o.createVNode(eK,{className:e.progressClassName,style:e.progressStyle,rtl:e.rtl,theme:e.theme,isIn:l.value,type:e.type,hide:e.hideProgressBar,isRunning:a.value,autoClose:e.autoClose,controlledProgress:i.value,progress:e.progress,closeToast:e.isLoading?void 0:c},null)])}}),pg="vue3-toastify:url-change";let gg=0,Mf;function mK(){if(!(typeof window>"u")&&cg.lastUrl!==window.location.href){cg.lastUrl=window.location.href;const e=n=>typeof n.clearOnUrlChange=="boolean"?n.clearOnUrlChange:wS().clearOnUrlChange!==!1,t=Object.values(vi).reduce((n,i)=>(Array.isArray(i)&&n.push(...i),n),[]);for(const n of t)n.toastId&&e(n)&&Er.dismiss(n.toastId);Kr.items=Kr.items.filter(n=>!e(n.toastProps))}}function pK(){const{history:e}=window,t=e.pushState,n=e.replaceState;return e.pushState=function(...i){const r=t.apply(this,i);return window.dispatchEvent(new Event(pg)),r},e.replaceState=function(...i){const r=n.apply(this,i);return window.dispatchEvent(new Event(pg)),r},()=>{e.pushState=t,e.replaceState=n}}function gK(){if(typeof window>"u"||Mf)return;const e=pK(),t=()=>mK();window.addEventListener(pg,t),window.addEventListener("popstate",t),window.addEventListener("hashchange",t),Mf=()=>{e(),window.removeEventListener(pg,t),window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),Mf=void 0}}function yK(){Mf&&(Mf(),cg.lastUrl="")}const bK=o.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:_S,setup(e){const t=o.computed(()=>e.containerId),n=o.computed(()=>vi[t.value]||[]),i=o.computed(()=>n.value.filter(r=>r.position===e.position));return o.onMounted(()=>{typeof window<"u"&&(gg+=1,gK())}),o.onUnmounted(()=>{typeof window<"u"&&gg>0&&(gg-=1,gg===0&&yK())}),()=>o.createVNode(o.Fragment,null,[i.value.map(r=>{const{toastId:s=""}=r;return o.createVNode(hK,o.mergeProps({key:s},r),null)})])}});let Vv=!1;const kS={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function xS(){const e=[];return Ed().forEach(t=>{const n=document.getElementById(t.containerId);n&&!n.classList.contains(ag)&&e.push(t)}),e}function vK(e){const t=xS().length,n=e??0;return n>0&&t+Kr.items.length>=n}function wK(e){vK(e.limit)&&!e.updateId&&Kr.items.push({toastId:e.toastId,containerId:e.containerId,toastContent:e.content,toastProps:e})}function Ba(e,t,n={}){if(Vv)return;n=dg(wS(),{type:t},o.toRaw(n)),(!n.toastId||typeof n.toastId!="string"&&typeof n.toastId!="number")&&(n.toastId=vS()),n={...n,...n.type==="loading"?kS:{},content:e,containerId:n.containerId||String(n.position)};const i=Number(n==null?void 0:n.progress);return!isNaN(i)&&i<0&&(n.progress=0),i>1&&(n.progress=1),n.theme==="auto"&&(n.theme=Qq()),wK(n),cg.lastUrl=window.location.href,n.multiple?Kr.items.length?n.updateId&&lg(e,n):lg(e,n):(Vv=!0,xt.clearAll(void 0,!1),setTimeout(()=>{lg(e,n)},0),setTimeout(()=>{Vv=!1},390)),n.toastId}const xt=(e,t)=>Ba(e,Gi.DEFAULT,t);xt.info=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.INFO}),xt.error=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.ERROR}),xt.warning=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.WARNING}),xt.warn=xt.warning,xt.success=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.SUCCESS}),xt.loading=(e,t)=>Ba(e,Gi.DEFAULT,dg(t,kS)),xt.dark=(e,t)=>Ba(e,Gi.DEFAULT,dg(t,{theme:xd.DARK})),xt.remove=e=>{e?Er.dismiss(e):Er.clear()},xt.clearAll=(e,t)=>{o.nextTick(()=>{Er.clear(e,t)})},xt.isActive=e=>{let t=!1;return t=xS().findIndex(n=>n.toastId===e)>-1,t},xt.update=(e,t={})=>{setTimeout(()=>{const n=Yq(e);if(n){const i=o.toRaw(n),{content:r}=i,s={...i,...t,toastId:t.toastId||e,updateId:vS()},a=s.render||r;delete s.render,Ba(a,s.type,s)}},0)},xt.done=e=>{xt.update(e,{isLoading:!1,progress:1})},xt.promise=_K;function _K(e,{pending:t,error:n,success:i},r){var s,a,l;let c;const d={...r||{},autoClose:!1};t&&(c=Qv(t)?xt.loading(t,d):xt.loading(t.render,{...d,...t}));const f={autoClose:(s=r==null?void 0:r.autoClose)!=null?s:!0,closeOnClick:(a=r==null?void 0:r.closeOnClick)!=null?a:!0,closeButton:(l=r==null?void 0:r.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},h=(g,v,y)=>{if(v==null){xt.remove(c);return}const A={type:g,...f,...r,data:y},C=Qv(v)?{render:v}:v;return c?xt.update(c,{...A,...C,isLoading:!1}):xt(C.render,{...A,...C,isLoading:!1}),y},m=Cd(e)?e():e;return m.then(g=>{h("success",i,g)}).catch(g=>{h("error",n,g)}),m}xt.POSITION=Nf,xt.THEME=xd,xt.TYPE=Gi,xt.TRANSITIONS=Pq;const kK={install(e,t={}){Zq.useHandler=t.useHandler||(()=>{}),xK(t)}};typeof window<"u"&&(window.Vue3Toastify=kK);function xK(e={}){const t=dg(hS,e);Jq(t)}function EK({state:e,props:t,emit:n,apiUrl:i,router:r,locale:s,mapping:a,validation:l,fieldMap:c,activeSchema:d,resolvedBaseUrl:f,resolveKeyParams:h,navigation:m,logic:g}){const v=k=>{if(t.dummyMode)return!0;if(k.permission&&t.checkPermission){let $=t.checkPermission(k.permission);if(!$&&k.permission!==k.permission.toLowerCase()&&($=t.checkPermission(k.permission.toLowerCase())),!$)return!1}return k.permission==="CREATE"?!t.isEditMode:k.permission==="UPDATE"?t.isEditMode:!0},y=k=>{if(!k)return null;const $=k.match(/filename\*=(?:UTF-8'')?([^;\n]+)/i);if($){const O=$[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(O)}catch{return O}}const I=k.match(/filename=(?:"?)([^";]+)(?:"?)/i);if(I){const O=I[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(O)}catch{return O}}return null},A=(k,$)=>{if(!k||!k.headers)return null;const I=k.headers;if(typeof I.get=="function")return I.get($);const O=Object.keys(I).find(q=>q.toLowerCase()===$.toLowerCase());return O?I[O]:null},C=k=>{const $=A(k,"content-disposition")||A(k,"Content-Disposition"),I=y($);return k instanceof Blob?{blob:k,filename:I}:(k==null?void 0:k.data)instanceof Blob?{blob:k.data,filename:I}:{blob:k,filename:I}},M=(k,$)=>{if(console.log("🚀 handleNavigation called with:",k),!k||!k.targetSection){console.warn("⚠️ Invalid navigation config - missing targetSection");return}if(!m){console.error("❌ Navigation object not available");return}if(typeof m.navigateTo!="function"){console.error("❌ navigation.navigateTo method not available");return}console.log("📍 Calling navigation.navigateTo"),m.navigateTo(k,$),console.log("✅ Navigation handling complete")},B=k=>{var $,I,O,q,X,oe;if(k.triggerNavigation){M(k.triggerNavigation);return}k.requireConfirm?(e.confirmDialog.title=s.value==="kr"||s.value==="ko"?(($=k.propCustomMessage)==null?void 0:$.titleKR)||"확인":s.value==="id"?((I=k.propCustomMessage)==null?void 0:I.titleID)||"Konfirmasi":((O=k.propCustomMessage)==null?void 0:O.titleEN)||"Confirm",e.confirmDialog.message=s.value==="kr"||s.value==="ko"?((q=k.propCustomMessage)==null?void 0:q.messageKR)||"계속하시겠습니까?":s.value==="id"?((X=k.propCustomMessage)==null?void 0:X.messageID)||"Lanjutkan?":((oe=k.propCustomMessage)==null?void 0:oe.messageEN)||"Continue?",e.confirmDialog.action=k,e.confirmDialog.visible=!0):j(k)},N=()=>{const k=e.confirmDialog.redirectUrl;if(e.confirmDialog.visible=!1,e.confirmDialog.action&&(typeof e.confirmDialog.action=="function"?e.confirmDialog.action():typeof e.confirmDialog.action.callback=="function"?e.confirmDialog.action.callback():j(e.confirmDialog.action)),k&&r){const $=k.startsWith("/")?k:"/"+k;r.push($)}e.confirmDialog.redirectUrl="",e.confirmDialog.isBlocking=!1},j=async k=>{var oe,ue,te,re,ge,ce,se;const $=k.propsActionGlobal||k.props||{},I=a.getCleanPayload(),O=$.fieldMapping||k.fieldMapping||{},q=a.applyFieldMapping(I,O);if(n("action",k,q),k.triggerNavigation&&m&&g){const z=e.tableRowFormData||q||{};k.triggerNavigation.condition?g.evaluateLogic(k.triggerNavigation.condition,z,"NAVIGATION")&&m.navigateTo(k.triggerNavigation,z):m.navigateTo(k.triggerNavigation,z)}const X=$.endpointDialogActionSave||k.endpointDialogActionSave||$.endpointDialogAction||k.endpointDialogAction||$.endpointAction||k.endpointAction||$.endpointPropAction||k.endpointPropAction||$.endpoint||k.endpoint;if(console.log("[SUBMIT][DIAGNOSTIC] action type:",$.type,"| endpoint apiUrl:",(X==null?void 0:X.apiUrl)||"MISSING","| action key:",k.key||((oe=k.propsActionGlobal)==null?void 0:oe.key)),($.type==="SUBMIT"||$.type==="ACTION")&&(X!=null&&X.apiUrl)){if(t.dummyMode){xt.info(s.value==="kr"||s.value==="ko"?"제출 작업 시뮬레이션 (더미 모드)":s.value==="id"?"Simulasi aksi Submit (Dummy Mode)":"Action Submit simulated (Dummy Mode)",{autoClose:2e3}),n("success",{dummy:!0});return}const z=xt.loading(s.value==="kr"||s.value==="ko"?"처리 중...":s.value==="id"?"Memproses...":"Processing..."),G=vo(X.apiUrl,f.value);try{let ee={...q};if(h&&Array.isArray(X.keyParam)){const R=h(X.keyParam);console.log("[SUBMIT] Resolved keyParams for action:",R),Object.assign(ee,R)}const K=X.responseType==="blob"||X.responseType==="arraybuffer"||X.accept&&!X.accept.includes("json")||X.apiUrl&&(X.apiUrl.includes("/export")||X.apiUrl.includes("/download"))||G&&(G.includes("/export")||G.includes("/download")||G.includes("format="))||k.actionType==="EXPORT"||k.permission==="EXPORT"||$.type==="EXPORT"||$.permission==="EXPORT",Y=X.config?{...X.config}:{};X.accept&&(Y.headers||(Y.headers={}),Y.headers.Accept=X.accept,Y.headers.accept=X.accept),K&&(Y.responseType=X.responseType||"blob"),console.log("[SUBMIT] Starting API call to:",G,"with payload/params:",ee,"and config:",Y);const F=await i(G,X.apiMethod||"POST",ee,Y);if(console.log("[SUBMIT] API response received:",F),K&&(F instanceof Blob||((ue=F==null?void 0:F.constructor)==null?void 0:ue.name)==="Blob"||(F==null?void 0:F.size)!==void 0||(F==null?void 0:F.data)instanceof Blob||((re=(te=F==null?void 0:F.data)==null?void 0:te.constructor)==null?void 0:re.name)==="Blob"||((ge=F==null?void 0:F.data)==null?void 0:ge.size)!==void 0||(F==null?void 0:F.data)instanceof ArrayBuffer)){const{blob:R,filename:S}=C(F),T=R instanceof Blob?R:new Blob([R],{type:X.accept||"application/octet-stream"});if(T.type==="application/json"){const ve=new FileReader;ve.onload=()=>{try{const Ee=JSON.parse(ve.result).message||(s.value==="id"?"Gagal mengunduh file":"Failed to download file");xt.update(z,{render:Ee,type:"error",isLoading:!1,autoClose:5e3})}catch{const Ee=window.URL.createObjectURL(T),Oe=document.createElement("a");Oe.href=Ee;const Ae=k.label||$.labelID||$.labelEN||"Export",Re=S||`${Ae}_${new Date().toISOString().slice(0,10)}.pdf`;Oe.setAttribute("download",Re),document.body.appendChild(Oe),Oe.click(),Oe.remove(),setTimeout(()=>window.URL.revokeObjectURL(Ee),1e3),xt.update(z,{render:s.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3})}},ve.readAsText(T),e.isSubmitting.value=!1;return}const D=window.URL.createObjectURL(T),Z=document.createElement("a");Z.href=D;let J="bin";const fe=(X.accept||"").toLowerCase(),ae=(X.apiUrl||"").toLowerCase(),we=(T.type||"").toLowerCase(),pe=((ee==null?void 0:ee.format)||"").toLowerCase(),ke=G.toLowerCase();fe.includes("pdf")||we.includes("pdf")||pe==="pdf"||ke.includes("format=pdf")||ke.includes("pdf")?J="pdf":fe.includes("excel")||fe.includes("sheet")||fe.includes("spreadsheet")||fe.includes("xlsx")||we.includes("excel")||we.includes("spreadsheet")||pe==="xlsx"||pe==="excel"||ke.includes("format=excel")?J="xlsx":fe.includes("csv")||we.includes("csv")||pe==="csv"||ke.includes("format=csv")?J="csv":fe.includes("zip")||we.includes("zip")||pe==="zip"||ke.includes("format=zip")?J="zip":fe.includes("txt")||we.includes("txt")||pe==="txt"||ke.includes("format=txt")||ke.includes("txt")?J="txt":ae.includes("pdf")?J="pdf":ae.includes("excel")||ae.includes("xlsx")?J="xlsx":ae.includes("csv")?J="csv":ae.includes("zip")?J="zip":ae.includes("txt")&&(J="txt");const be=k.label||$.labelID||$.labelEN||"Export";let Se=S||`${be}_${new Date().toISOString().slice(0,10)}.${J}`;J==="txt"&&Se.toLowerCase().endsWith(".bin")&&(Se=Se.replace(/\.bin$/i,".txt")),Z.setAttribute("download",Se),document.body.appendChild(Z),Z.click(),Z.remove(),setTimeout(()=>window.URL.revokeObjectURL(D),1e3),xt.update(z,{render:s.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3}),e.isSubmitting.value=!1,n("success",F);return}const _=(F==null?void 0:F.status)===!0;console.log("[SUBMIT] response.status:",F==null?void 0:F.status),console.log("[SUBMIT] isSuccess evaluated as:",_);const b=(F==null?void 0:F.message)||(_?s.value==="kr"||s.value==="ko"?"성공":s.value==="id"?"Sukses":"Success":s.value==="kr"||s.value==="ko"?"실패":s.value==="id"?"Gagal":"Failed");if(xt.update(z,{render:b,type:_?"success":"error",isLoading:!1,autoClose:_?2e3:5e3}),_){if(console.log("[SUBMIT] Success condition passed"),($.fieldMapping||k.fieldMapping)&&(console.log("[SUBMIT] Applying field mapping for response"),a.handleResponseMapping(F,$.fieldMapping||k.fieldMapping)),n("success",F),r){const R=$.routeBack;console.log("[SUBMIT] routeBack value:",R);const S=T=>{if(!T){console.log("[SUBMIT] No path provided for navigation");return}const D=T.startsWith("/")?T:"/"+T;console.log("[SUBMIT] Triggering router.push to:",D),setTimeout(()=>{r.push(D).then(()=>{console.log("[SUBMIT] Router push success")}).catch(Z=>{console.error("[SUBMIT] Router push failed:",Z)})},150)};if(R)S(R);else{console.log("[SUBMIT] routeBack missing, attempting directory-up fallback");const Z=((((ce=r.currentRoute)==null?void 0:ce.value)||r.currentRoute||{}).path||"/").split("/").filter(Boolean);Z.length>1?(Z.pop(),S("/"+Z.join("/"))):S("/")}}try{let R=(F==null?void 0:F.data)||(F==null?void 0:F.payload)||F;if(Array.isArray(R)&&R.length>0&&(R=R[0]),R&&typeof R=="object"&&r){const T={...(((se=r.currentRoute)==null?void 0:se.value)||r.currentRoute||{}).query||{}};let D=!1;const Z=Bf(R),J=["status","success","code","message","error","errorCode","errorMessage"];if(Object.entries(Z).forEach(([fe,ae])=>{!J.includes(fe)&&ae!==null&&ae!==void 0&&(typeof ae=="string"||typeof ae=="number"||typeof ae=="boolean")&&T[fe]!==String(ae)&&(T[fe]=String(ae),D=!0)}),D&&typeof window<"u"&&window.history){const fe=new URL(window.location.href);Object.entries(T).forEach(([ae,we])=>{we!=null&&fe.searchParams.set(ae,String(we))}),window.history.replaceState(window.history.state,"",fe.toString())}}}catch(R){console.warn("[SUBMIT] Failed to update query params:",R)}}else console.log("[SUBMIT] Success condition failed (status is not true). Navigation aborted."),n("error",F)}catch(ee){console.error("[SUBMIT] Critical error during action execution. Navigation aborted.",ee),xt.error(ee.message||"Action failed"),n("error",ee)}finally{e.isSubmitting.value=!1}return}else if($.type==="SUBMIT"){if(t.dummyMode){xt.info(s.value==="kr"||s.value==="ko"?"제출 작업 시뮬레이션 (더미 모드)":s.value==="id"?"Simulasi aksi Submit (Dummy Mode)":"Action Submit simulated (Dummy Mode)",{autoClose:2e3});return}n("submit",q)}$.keyRedirect&&$.route&&r&&(console.log("[SUBMIT] Triggering synchronous keyRedirect navigation to:",$.route),r.push($.route))};return{isActionVisible:v,handleGlobalButtonClick:B,confirmAction:N,performAction:j,handleSubmit:async()=>{var k,$;if(t.dummyMode){xt.info(s.value==="kr"||s.value==="ko"?"제출 작업 시뮬레이션 (더미 모드)":s.value==="id"?"Simulasi aksi Submit (Dummy Mode)":"Action Submit simulated (Dummy Mode)",{autoClose:2e3});return}if(e.isSubmitted.value=!0,!!l.validateAll()){e.isSubmitting.value=!0;try{const I=a.getCleanPayload(),O=(((k=d.value)==null?void 0:k.actions)||[]).find(X=>{var oe;return X.type==="SUBMIT"||X.key==="SUBMIT"||((oe=X.propsActionGlobal)==null?void 0:oe.type)==="SUBMIT"}),q=(O==null?void 0:O.fieldMapping)||(($=O==null?void 0:O.propsActionGlobal)==null?void 0:$.fieldMapping);n("submit",q?a.applyFieldMapping(I,q):I)}finally{e.isSubmitting.value=!1}}},handleCancel:()=>n("cancel"),handleFieldUpdate:(k,$,I)=>{var te;let O=k;const q=c.value.models.get(k);q&&q.length>0&&(O=(I&&q.find(ge=>ge.path.startsWith(`${I}.`))||q[0]).path);const X=Ye(e.formData,O),oe=re=>re==null||re===""||Array.isArray(re)&&re.length===0?null:re;JSON.stringify(oe($))!==JSON.stringify(oe(X))&&(e.touched[O]=!0),I?Xt(e.formData,O,$):e.formData[k]=$;const ue=(te=c.value.paths.get(O))==null?void 0:te.field;if(ue){const re=l.validateField(ue,$);re?e.errors[O]=re:delete e.errors[O]}}}}function CK(e){const{formData:t,emit:n,mapping:i,validation:r,locale:s,logic:a,state:l,activeSchema:c,prefetchFieldItems:d,triggerFetchRule:f,navigation:h}=e,m=o.ref(!1),g=o.ref(""),v=o.ref("Plus"),y=o.ref([]),A=o.ref("md"),C=(l==null?void 0:l.tableRowFormData)||o.reactive({});console.log("[useFormTable][DEBUG] Init. State passed:",!!l,"Identity Match:",C===(l==null?void 0:l.tableRowFormData)),console.log("[useFormTable][DEBUG] tableRowFormData keys:",Object.keys(C));const M=o.reactive({}),B=o.ref(""),N=o.ref(null),j=o.ref(!1),W=o.ref(null),P=o.ref(!1),E=new Map,k=()=>{!a||!y.value.length||y.value.forEach(z=>{var S,T,D,Z;const G=z.model;if(!G)return;const ee=z.key||G,K=G,Y={visibleRule:(S=z.logic)==null?void 0:S.visibleRule,disabledRule:(T=z.logic)==null?void 0:T.disabledRule,optionsFilterRule:(D=z.logic)==null?void 0:D.optionsFilterRule,lengthRule:(Z=z.logic)==null?void 0:Z.lengthRule},F={},_=z.props||z.propsFieldCustom||z.propsFieldGlobal||{},b=_.endpoint||_.endpointReference||_.endpointComponent||_.endpointPropAction;if(Object.entries(Y).forEach(([J,fe])=>{if(!fe)return;let ae;J==="visibleRule"?ae=a.isFieldVisible(z,C):J==="disabledRule"?ae=a.isFieldDisabled(z,C):J==="optionsFilterRule"?ae=a.getFilteredItems(z,C):J==="lengthRule"&&(ae=a.resolveFieldLength(z,C));const we=JSON.stringify(ae);F[J]=we;const pe=E.get(ee);(pe==null?void 0:pe[J])!==void 0&&pe[J]!==we&&(J==="visibleRule"&&ae===!1||J==="disabledRule"&&ae===!0||J==="optionsFilterRule"||J==="lengthRule")&&(C[K]=null)}),Array.isArray(b==null?void 0:b.keyParam)&&b.keyParam.forEach(J=>{var ke;let fe,ae;if(typeof J=="string")fe=C[J],ae=`kp-${J}`;else if(typeof J=="object"&&J!==null)fe=Object.values(J).map(Se=>C[Se]),ae=`kp-${JSON.stringify(J)}`;else return;const we=JSON.stringify(fe);F[ae]=we;const pe=E.get(ee);if(pe==null||pe[ae],we!==(pe==null?void 0:pe[ae])){d&&d(z,!0,K,C),f&&((ke=z.props)!=null&&ke.fetchRule)&&f(z,z.props.fetchRule,K,C);const be=(pe==null?void 0:pe[ae])==="null"||(pe==null?void 0:pe[ae])==="undefined"||!pe,Se=we==="null"||we==="undefined",ve=typeof J=="string"&&(J===z.key||J===z.model);(!be||Se)&&!ve&&(C[K]=null)}}),E.set(ee,F),!a.isFieldVisible(z,C)){const J=C[K];J!=null&&J!==""&&(C[K]=null)}})},$=()=>{!a||!y.value.length||(k(),y.value.forEach(z=>{var F,_,b;const G=z.model;if(!G)return;const ee=a.resolveDefaultValue(z,C);if(ee!=null){const R=C[G],T=(z.props||z.propsFieldCustom||z.propsFieldGlobal||{}).returnObject||((F=z.logic)==null?void 0:F.returnObject);(R==null||R===""||T&&(typeof R=="string"||typeof R=="number")&&(typeof ee=="object"&&ee!==null))&&(C[G]=ee)}const K=z.props||z.propsFieldCustom||z.propsFieldGlobal||{},Y=((_=z.logic)==null?void 0:_.autoSelect)||K.autoSelect||"single";if(Y!=="none"&&(l!=null&&l.rawItemsCache)){const R=l.rawItemsCache[z.key]||[];if(R.length>0){const S=C[G];if(S==null||S===""){const T=K.returnObject||((b=z.logic)==null?void 0:b.returnObject),D=R[0];if(Y==="single"&&R.length===1){const Z=T?D:D.id??D.value??D.code;C[G]=Z}else if(Y==="first"){const Z=T?D:D.id??D.value??D.code;C[G]=Z}}}}z.logic&&typeof z.logic=="object"&&Object.keys(z.logic).filter(S=>S.toLowerCase().includes("calculaterule")&&z.logic[S]&&typeof z.logic[S]=="object").forEach(S=>{const T=z.logic[S],D=Object.keys(T)[0];if(!D)return;const Z=a.evaluateLogic(T[D],C,`CALC-${D}`,D),J=C[D];Z!==void 0&&(Number.isNaN(Z)?!Number.isNaN(J):JSON.stringify(J)!==JSON.stringify(Z))&&(C[D]=Z)})}))};o.watch(()=>({...l==null?void 0:l.rawItemsCache}),()=>{m.value&&$()},{deep:!0});const I=z=>{var G;return!(z!=null&&z.apiUrl)&&!((G=z==null?void 0:z.endpointTable)!=null&&G.apiUrl)},O=z=>{if(!z)return!1;const G=(z.key||"").toLowerCase(),ee=(z.permission||"").toUpperCase();return G==="detail"||G.includes("view")||ee==="VIEW"},q=z=>{var F,_,b,R;const G=z.modelKey||z.modelDatatable,ee=z.key||z.id,K=(_=(F=h==null?void 0:h.navigationState)==null?void 0:F.value)==null?void 0:_.parentRowContext;if(K){const S=`${K.parentArrayKey}.${K.rowIndex}.${K.childArrayKey}`,T=z.modelKey||z.modelDatatable,D=`${K.parentArrayKey}.${K.childArrayKey}`;if(!T||T===D||T.startsWith(D+"."))return console.log(`[resolveTableDataKey][PARENT-CTX] Scoped path: "${S}"`),S;console.log(`[resolveTableDataKey][PARENT-CTX-MISMATCH] modelKey "${T}" does not match "${D}" — ignoring parentRowContext`)}const Y=(c==null?void 0:c.value)||((b=l==null?void 0:l.internalSchema)==null?void 0:b.value)||((R=a==null?void 0:a.activeSchema)==null?void 0:R.value);if(Y!=null&&Y.sections&&ee){const S=(D,Z)=>{var J;for(const fe of D)if(fe.type==="WIZARD"&&((J=fe.propsWizard)!=null&&J.propsSteps))for(const ae of fe.propsWizard.propsSteps){const we=Array.isArray(ae.sectionsWizard)?ae.sectionsWizard:ae.sectionsWizard?[ae.sectionsWizard]:[];if(we.some(be=>{var ve,Be,Ee,Oe;return(be.key||be.id||((ve=be.propsTable)==null?void 0:ve.key)||((Be=be.propsTableStep)==null?void 0:Be.key)||((Ee=be.propsForm)==null?void 0:Ee.key)||((Oe=be.propsFormStep)==null?void 0:Oe.key))===Z}))return ae.modelKey||ae.key||null;const ke=S(we,Z);if(ke)return ke}return null},T=S(Y.sections,ee);if(T){const D=`${T}.${G||ee}`;return console.log(`[resolveTableDataKey][WIZARD-MATCH] Resolved nested path: "${D}" for section: "${ee}"`),D}}return G&&Ye(t,G)!==void 0?G:ee&&Ye(t,ee)!==void 0?ee:Ye(t,"data")!==void 0?"data":G||ee},X=z=>{if(!z)return[];const G=q(z),ee=Ye(t,G);if(!Array.isArray(ee))return[];const K=z.headers||[],Y=ee.filter(F=>kd(F)?!1:K.length===0?!0:K.some(b=>{var D,Z,J;if(b.key==="no"||b.key==="action")return!1;let R=Ye(F,b.key);if(R!=null&&R!=="")return!0;const S=b.key.includes(".")?b.key.split(".").pop():null;if(S&&(R=Ye(F,S),R!=null&&R!==""))return!0;const T=(J=(Z=(D=b.custom)==null?void 0:D.propsCustom)==null?void 0:Z[0])==null?void 0:J.value;return!!(T&&T!==b.key&&T!==S&&(R=Ye(F,T),R!=null&&R!==""))}));return ee.length>0&&(console.log(`[TABLE][${G}] Raw rows:`,ee.length,"Filtered rows:",Y.length),ee.length!==Y.length&&console.log(`[TABLE][${G}] Filtered out ${ee.length-Y.length} rows (empty or mismatch).`)),Y},oe=z=>{var ee,K;if((ee=z.fields)!=null&&ee.length)return z.fields;const G=(z.actionTableGlobal||[]).find(Y=>Y.permission==="CREATE"||(Y.key||"").toLowerCase().includes("add"));return(K=G==null?void 0:G.fieldActionGlobal)!=null&&K.length?G.fieldActionGlobal:(z.headers||[]).filter(Y=>Y.key&&Y.key!=="no").map(Y=>({key:Y.key,model:Y.key,component:"DCodeTextField"}))},ue=(z,G)=>{W.value={propsTable:z,row:G},P.value=!0},te=()=>{if(!W.value)return;const{propsTable:z,row:G}=W.value;P.value=!1;const ee=q(z),K=Ye(t,ee);if(Array.isArray(K)){const Y=K.indexOf(G);if(Y!==-1)K.splice(Y,1);else{const F=JSON.stringify(G,(b,R)=>["no","_index"].includes(b)?void 0:R),_=K.findIndex(b=>JSON.stringify(b,(R,S)=>["no","_index"].includes(R)?void 0:S)===F);_!==-1&&K.splice(_,1)}Xt(t,ee,[...K]),n("update:model",i.getCleanPayload())}},re=(z,G)=>{console.log(`[useFormTable][DEBUG] Updating ${z} with:`,G,"Target Object Keys:",Object.keys(C)),C[z]=G,$();const ee=y.value.find(K=>K.model===z);if(ee){const K=r.validateField(ee,G,C);K?M[z]=K:delete M[z]}},ge=(z,G,ee)=>{var _,b;const K="[FORM-TABLE-TRACER]";console.log(`${K} Starting openTableRowDialog`,{sectionKey:z.modelKey||z.key||z.id,action:G.key||G.permission,hasRowData:!!ee}),l!=null&&l.activeTableAction&&(l.activeTableAction.value=G),ee&&console.log(`${K} Raw Row Data Received:`,JSON.parse(JSON.stringify(ee))),B.value=q(z),console.log(`${K} Resolved activeTableKey: "${B.value}"`),j.value=O(G),N.value=null,g.value=s.value==="id"?G.labelID||"Tambah Data":G.labelEN||"Add Data",v.value=G.icon||"Plus";const Y=(((_=G.dialogConfig)==null?void 0:_.layoutSize)||"md").toLowerCase();A.value=Y,console.log(`[useFormTable][DEBUG] Opening Dialog with size: "${Y}" (from ${(b=G.dialogConfig)==null?void 0:b.layoutSize})`);const F=G.fieldActionCustom||G.fieldActionGlobal||oe(z);y.value=F,console.log(`${K} Dialog Fields Count:`,F.length),Object.keys(C).forEach(R=>{C[R]=null}),Object.keys(M).forEach(R=>delete M[R]),E.clear(),F.forEach((R,S)=>{const T=R.model||R.key;if(!T){console.warn(`${K} Field at index ${S} is missing a model/key!`);return}let D=ee?Ye(ee,T):null,Z="DEEP_MATCH";if(ee&&D==null){const J=T.includes(".")?T.split(".").pop():null;J&&(D=Ye(ee,J),D!=null&&(Z=`LEAF_MATCH("${J}")`))}ee&&console.log(`${K} Field "${T}" [${Z}] -> Resolved Value:`,D),C[T]=D??null}),console.log(`${K} Final tableRowFormData prepared:`,JSON.parse(JSON.stringify(C))),m.value=!0,setTimeout(()=>{console.log(`${K} Triggering initial scanDialogLogic...`),$()},10)};return{tableDialogOpen:m,tableDialogTitle:g,tableDialogIcon:v,tableDialogFields:y,tableRowFormData:C,tableRowErrors:M,activeTableKey:B,editingRowIndex:N,tableDialogViewOnly:j,confirmDeletePending:W,confirmDeleteOpen:P,tableDialogSize:A,isTemporaryTable:I,isActionViewOnly:O,tableRows:X,resolveTableFields:oe,confirmTableDelete:ue,executeTableDelete:te,handleTableRowUpdate:re,openTableRowDialog:ge,handleDataTableAction:(z,G)=>{var R,S,T,D,Z,J,fe,ae,we;const{action:ee,row:K}=G,Y=ee.toLowerCase();if(G.isLocalSave||G.actionType==="CREATE"||G.actionType==="UPDATE"){const pe=G.modelDatatable||q(z);if(pe&&K&&typeof K=="object"){const ke=Ye(t,pe)||[],be=Array.isArray(ke)?[...ke]:[];if(G.actionType==="UPDATE"){let Se=G.originalRow?be.indexOf(G.originalRow):-1;if(Se===-1&&G.originalRow){const ve=G.originalRow["detail.id"]||G.originalRow.id||G.originalRow["documents.id"]||G.originalRow["documents.document.id"];ve!=null&&(Se=be.findIndex(Be=>(Be["detail.id"]||Be.id||Be["documents.id"]||Be["documents.document.id"])===ve))}if(Se===-1){const ve=JSON.stringify(G.originalRow||{},(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee);Se=be.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===ve)}Se===-1&&(Se=G.rowIndex!==void 0&&G.rowIndex!==null?G.rowIndex:-1),Se!==-1?be[Se]={...K}:be.push({...K})}else be.push({...K});Xt(t,pe,[...be]),l!=null&&l.formData&&Xt(l.formData,pe,[...be]),n("update:modelValue",{...t}),n("update:model",{...t})}return}if(/delete|trash/i.test(ee)){const pe=q(z),ke=Ye(t,pe);if(Array.isArray(ke)){const be=ke.indexOf(K);if(be!==-1)ke.splice(be,1);else{const Se=JSON.stringify(K,(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee),ve=ke.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===Se);ve!==-1&&ke.splice(ve,1)}n("update:model",i.getCleanPayload())}return}let F=null;const _=pe=>Array.isArray(pe)?pe.find(ke=>{var ve,Be,Ee,Oe;const be=(ke.key||((ve=ke.propsActionGlobal)==null?void 0:ve.key)||((Be=ke.propsActionCustom)==null?void 0:Be.key)||"").toLowerCase(),Se=(ke.actionType||((Ee=ke.propsActionGlobal)==null?void 0:Ee.actionType)||((Oe=ke.propsActionCustom)==null?void 0:Oe.actionType)||"").toLowerCase();return be===Y||Se===Y}):null;F=_(z.actionTableGlobal)||_(z.actionTableLine),!F&&Array.isArray(z.headers)&&z.headers.forEach(pe=>{var ke;if(((ke=pe.custom)==null?void 0:ke.type)==="ACTION"){const be=_(pe.custom.actionCustom);be&&(F=be)}});const b=((F==null?void 0:F.actionType)||((R=F==null?void 0:F.propsActionGlobal)==null?void 0:R.actionType)||((S=F==null?void 0:F.propsActionCustom)==null?void 0:S.actionType)||(F==null?void 0:F.permission)||"").toLowerCase();if(b==="delete"||b==="destroy"){const pe=(F==null?void 0:F.endpoint)||((T=F==null?void 0:F.propsActionGlobal)==null?void 0:T.endpointPropAction)||((D=F==null?void 0:F.propsActionCustom)==null?void 0:D.endpointPropAction);if(!(pe!=null&&pe.apiUrl)){const ke=q(z),be=Ye(t,ke);if(Array.isArray(be)){let Se=-1;if(K&&(Se=be.indexOf(K),Se===-1)){const ve=JSON.stringify(K,(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee);Se=be.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===ve)}Se!==-1&&(be.splice(Se,1),Xt(t,ke,[...be]),n("update:model",i.getCleanPayload()))}return}}if(b==="view"||b==="detail"||/detail|view/i.test(ee)){ge(z,F||{key:"detail",permission:"VIEW"},K);return}if((b==="update"||b==="create"||b==="edit"||b==="add"||/edit|add|create|update/i.test(ee))&&(F==null?void 0:F.openDialog)!==!1){if(b==="create"||b==="add"||/add|create/i.test(ee))ge(z,F||{key:"create",permission:"CREATE"});else{const ke=q(z),be=Ye(t,ke);let Se=Array.isArray(be)?be.indexOf(K):-1;if(Se===-1&&Array.isArray(be)){const ve=JSON.stringify(K,(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee);Se=be.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===ve)}N.value=Se!==-1?Se:null,ge(z,F||{key:"edit",permission:"UPDATE"},K)}return}if(K&&typeof K=="object"&&!((Z=F==null?void 0:F.endpoint)!=null&&Z.apiUrl)&&!((fe=(J=F==null?void 0:F.propsActionGlobal)==null?void 0:J.endpointPropAction)!=null&&fe.apiUrl)){const pe=z.modelDatatable,ke=Ye(t,pe)||[],be=Array.isArray(ke)?[...ke]:[],Se=(ae=z.headers)==null?void 0:ae.find(Oe=>{var Ae;return((Ae=Oe.custom)==null?void 0:Ae.type)==="CHECKBOX"||Oe.keyCheckbox}),ve=(Se==null?void 0:Se.keyCheckbox)||((we=Se==null?void 0:Se.custom)==null?void 0:we.keyCheckbox)||"id";let Be=-1;K[ve]&&(Be=be.findIndex(Oe=>Oe[ve]===K[ve])),Be===-1?be.push({...K}):be.splice(Be,1,{...K}),Xt(t,pe,be),n("update:model",i.getCleanPayload())}},saveTableRow:()=>{const z="[SAVE-TRACER]";console.log(`${z} Starting saveTableRow`,{activeTableKey:B.value,editingIndex:N.value});let G=!0;if(Object.keys(M).forEach(F=>delete M[F]),y.value.forEach(F=>{if(a&&!a.isFieldVisible(F,C))return;const _=C[F.model],b=r.validateField(F,_,C);b&&(M[F.model]=b,G=!1)}),!G){console.warn(`${z} Validation failed for table row dialog:`,JSON.parse(JSON.stringify(M)));return}const ee=B.value;if(!ee)return;const K=Ye(t,ee)||[],Y=Array.isArray(K)?[...K]:[];N.value!==null?Y.splice(N.value,1,{...C}):Y.push({...C}),Xt(t,ee,Y),m.value=!1,n("update:model",i.getCleanPayload())}}}function SK(e){const{state:t,props:n,emit:i,logic:r,mapping:s,activeSchema:a,fieldMap:l,prefetchFieldItems:c,triggerFetchRule:d,fetchSectionData:f,router:h}=e;let m="",g="",v=!1,y=!0;const A=new Map,C=new Map,M=new Map;o.watch(()=>a.value,(E,k)=>{E!==k&&(C.clear(),A.clear(),M.clear(),y=!0,g="",m="")});const B=async(E,k)=>{var ge;const $=(ge=a.value)==null?void 0:ge.sections;if(!$)return;r.applyCalculations();const I=r.getNormalizedData(E),O=new Set,q=new Map,X=(ce,se=!0,z)=>{var G,ee;if(ce)for(const K of ce){const F=r.isSectionVisible(K,E)&&se,_=Pt(K),b=z&&_?`${z}.${_}`:z,R=K.modelKey||K.key||K.id,T=(K.propsForm||K.propsFormStep||K.propsTable||K.propsTableStep||K.propsDataTableWizard||K.props||{}).fields||K.fields||[];for(const D of T){if(!D.model)continue;const Z=b?`${b}.${D.model}`:D.model;r.isFieldVisible(D,E,Z)&&F&&O.add(Z)}if(((G=K.type)==null?void 0:G.toUpperCase())==="WIZARD"){const D=((ee=K.propsWizard)==null?void 0:ee.propsSteps)||[],Z=Pt(K),J=t.wizardState[Z]??0;for(let fe=0;fe<D.length;fe++){const ae=D[fe],ke=r.isSectionVisible(ae,E)&&F&&fe===J,be=ae.sectionsWizard||ae.sections||[],Se=Array.isArray(be)?be:[be];X(Se,ke,R)}}}};X($,!0);const oe=(ce,se,z,G)=>{const ee=r.isFieldVisible(ce,G,se)&&z,K=q.get(ce.model)||!1;return q.set(ce.model,K||ee),ee},ue=(ce,se,z,G,ee)=>{var ke,be,Se;const K=ce.model,Y=ce.logic,F=ce.props||ce.propsFieldCustom||ce.propsFieldGlobal||{},_=F.endpoint||F.endpointReference||F.endpointComponent||F.endpointPropAction,b=Array.isArray(_==null?void 0:_.keyParam);if(!Y&&!b)return;const R={};if(["lengthRule","optionsFilterRule","visibleRule","disabledRule"].forEach(ve=>{const Be=Y==null?void 0:Y[ve];if(!Be)return;let Ee;if(ve==="visibleRule")Ee=r.isFieldVisible(ce,G,se);else if(ve==="disabledRule")Ee=r.isFieldDisabled(ce,G,se);else if(ve==="requiredRule")Ee=r.isFieldRequired(ce,G,se);else if(ve==="lengthRule")Ee=r.resolveFieldLength(ce,G);else if(ve==="optionsFilterRule")Ee=r.resolveActiveRule(Be,G,`${ve}-${K}`,se);else{const Re=r.resolveActiveRule(Be,G,`${ve}-${K}`,se);Ee=Re?r.evaluateLogic(Re,G,`${ve}-${K}`,se):null}const Oe=JSON.stringify(Ee);R[ve]=Oe;const Ae=M.get(ce.key);(Ae==null?void 0:Ae[ve])!==void 0&&Ae[ve]!==Oe&&ee&&(ve==="visibleRule"&&Ee===!1||ve==="disabledRule"&&Ee===!0||ve==="optionsFilterRule"||ve==="lengthRule")&&(O.has(se)||Xt(t.formData,se,null))}),ee&&!z&&!O.has(se)){const ve=Ye(t.formData,se);ve!=null&&ve!==""&&Xt(t.formData,se,null)}Array.isArray(_==null?void 0:_.keyParam)&&_.keyParam.forEach(ve=>{var Ie;let Be,Ee;const Oe=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,Ae=r.getNormalizedData(E,Oe);if(typeof ve=="string")Be=((Ie=Ae._resolveLogicVar)==null?void 0:Ie.call(Ae,ve))??Ae[ve],Ee=`kp-${ve}`;else if(typeof ve=="object"&&ve!==null)Be=Object.values(ve).map(ne=>{var ye;return((ye=Ae._resolveLogicVar)==null?void 0:ye.call(Ae,ne))??Ae[ne]}),Ee=`kp-${JSON.stringify(ve)}`;else return;const Re=JSON.stringify(Be);R[Ee]=Re;const De=M.get(ce.key);if((De==null?void 0:De[Ee])!==void 0&&De[Ee]!==Re){z&&c(ce,!0,se);const Ce=De[Ee]==="null"||De[Ee]==="undefined",ne=Re==="null"||Re==="undefined",ye=typeof ve=="string"&&(ve===ce.key||ve===ce.model);ee&&(!Ce||ne)&&!ye&&Xt(t.formData,se,null)}});const T=ve=>{if(!ve)return!0;if(typeof ve=="object"){const Be=Object.keys(ve);if(Be.length===1&&(Be[0]==="=="||Be[0]==="===")){const Ee=ve[Be[0]];if(Array.isArray(Ee)){if(Ee.length===1&&(Ee[0]===""||Ee[0]===null))return!0;if(Ee.length===2){const Oe=Ee[0],Ae=Ee[1];if(typeof Oe=="object"&&Oe!==null&&Oe.var===""&&(Ae===""||Ae===null))return!0}}}}return!1},D=ve=>{var Be;return ve==null?JSON.stringify(ve):ve instanceof File||ve instanceof Blob||((Be=ve.constructor)==null?void 0:Be.name)==="File"?`File:${ve.name}:${ve.size}:${ve.type}:${ve.lastModified||0}`:Array.isArray(ve)?`[${ve.map(D).join(",")}]`:JSON.stringify(ve)};(Array.isArray(Y==null?void 0:Y.fetchRule)?Y.fetchRule:[Y==null?void 0:Y.fetchRule].filter(Boolean)).forEach((ve,Be)=>{var Ce;const Ee=`fetch-${Be}`,Oe=r.evaluateLogic(ve.condition,G,`FETCH-${K}`,se),Ae=JSON.stringify(Oe);G[K],R[Ee]=Ae;const Re=M.get(ce.key),De=(Re==null?void 0:Re[Ee])==="true";let Ie=!1;if(Oe&&!De&&(Ie=!0),Oe&&Array.isArray((Ce=ve.endpoint)==null?void 0:Ce.keyParam)&&ve.endpoint.keyParam.forEach(ne=>{let ye,Me;if(typeof ne=="string")ye=G[ne],ye===void 0&&ce&&ce.key===ne&&(ye=G[ce.model]),Me=`kp-${ne}`;else if(typeof ne=="object"&&ne!==null)ye=Object.values(ne).map(He=>G[He]),Me=`kp-${JSON.stringify(ne)}`;else return;const Ke=D(ye);(Re==null?void 0:Re[Me])!==void 0&&Re[Me]!==Ke&&(Ie=!0),R[Me]=Ke}),Ie&&z&&d(ce,ve,se),!Oe&&De){t.formData[`_fetchStatus_${ce.model}`]=!1;const ne=Me=>{var He,rt;if(!Me)return;((Me.propsForm||Me.propsFormStep||Me.propsTable||Me.propsTableStep||Me.propsDataTableWizard||Me.props||{}).fields||Me.fields||[]).forEach(Ve=>{if(Ve.model){const Fe=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,Ue=Fe?`${Fe}.${Ve.model}`:Ve.model;Xt(t.formData,Ue,null)}}),((He=Me.type)==null?void 0:He.toUpperCase())==="WIZARD"&&((rt=Me.propsWizard)!=null&&rt.propsSteps)&&Me.propsWizard.propsSteps.forEach(Ve=>{(Array.isArray(Ve.sectionsWizard)?Ve.sectionsWizard:[Ve.sectionsWizard].filter(Boolean)).forEach(ne)})},ye=(Me,Ke)=>{var $e,He;for(const rt of Me){if(Pt(rt)===Ke){ne(rt);return}(($e=rt.type)==null?void 0:$e.toUpperCase())==="WIZARD"&&((He=rt.propsWizard)!=null&&He.propsSteps)&&rt.propsWizard.propsSteps.forEach(Fe=>{const Ue=Array.isArray(Fe.sectionsWizard)?Fe.sectionsWizard:[Fe.sectionsWizard].filter(Boolean);ye(Ue,Ke)})}};Array.isArray(ve.revealSections)&&ve.revealSections.forEach(Me=>{var Ke;t.revealedSectionIds[Me]=!1,(Ke=a.value)!=null&&Ke.sections&&ye(a.value.sections,Me)}),Array.isArray(ve.revealFields)&&ve.revealFields.forEach(Me=>{t.revealedFieldModels[Me]=!1;const Ke=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,$e=Ke?`${Ke}.${Me}`:Me;Xt(t.formData,$e,null)}),s!=null&&s.handleClearMapping&&s.handleClearMapping(ve.mapping||{},se)}}),(Array.isArray(Y==null?void 0:Y.autoFetchRule)?Y.autoFetchRule:[Y==null?void 0:Y.autoFetchRule].filter(Boolean)).forEach((ve,Be)=>{const Ee=`autofetch-${Be}`,Ae=ve.condition&&!T(ve.condition)?r.evaluateLogic(ve.condition,G,`AUTOFETCH-${K}`,se):!0,Re=JSON.stringify(Ae);R[Ee]=Re;const De=M.get(ce.key),Ie=(De==null?void 0:De[Ee])==="true";let Ce=!1;Ae&&!Ie&&De!==void 0&&(Ce=!0),Ae&&Array.isArray(ve.triggers)&&ve.triggers.forEach((ne,ye)=>{var Fe;const Me=ne.fieldKey;if(!Me)return;const Ke=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,$e=r.getNormalizedData(E,Ke),He=((Fe=$e._resolveLogicVar)==null?void 0:Fe.call($e,Me))??$e[Me],rt=D(He),Ve=`afr-trig-${Me}-${ye}`;if((De==null?void 0:De[Ve])!==void 0&&De[Ve]!==rt)if(ne.event==="debounced"){const Ue=ne.debounceMs||300,at=`afr-debounced-${ce.key}-${Be}-${ye}`;t[at]||(t[at]=I3((nt,Tt,fi)=>{z&&d(nt,Tt,fi)},Ue)),t[at](ce,ve,se)}else Ce=!0;R[Ve]=rt}),Ce&&z&&d(ce,ve,se),!Ae&&Ie&&(t.formData[`_fetchStatus_${ce.model}`]=!1,s!=null&&s.handleClearMapping&&s.handleClearMapping(ve.mapping||{},se),Array.isArray(ve.revealSections)&&ve.revealSections.forEach(ne=>{t.revealedSectionIds[ne]=!1}),Array.isArray(ve.revealFields)&&ve.revealFields.forEach(ne=>{t.revealedFieldModels[ne]=!1;const ye=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,Me=ye?`${ye}.${ne}`:ne;Xt(t.formData,Me,null)}))}),(Array.isArray(Y==null?void 0:Y.copyRule)?Y.copyRule:[Y==null?void 0:Y.copyRule].filter(Boolean)).forEach((ve,Be)=>{const Ee=`copy-${Be}`,Oe=ve.condition?r.evaluateLogic(ve.condition,G,`COPY-COND-${K}`,se):!0;let Ae;typeof ve.source=="string"?Ae=G[ve.source]:ve.source&&typeof ve.source=="object"&&(Ae=r.evaluateLogic(ve.source,G,`COPY-SRC-${K}`,se));const Re=JSON.stringify({conditionMet:Oe,sourceVal:Ae}),De=M.get(ce.key);if((De==null?void 0:De[Ee])!==Re&&Oe){const Ce=Ye(t.formData,se);JSON.stringify(Ce)!==JSON.stringify(Ae)&&Xt(t.formData,se,Ae)}R[Ee]=Re});const ae=r.resolveDefaultValue(ce,G,se);if(ae!=null){const ve=Ye(t.formData,se),Ee=(ce.props||ce.propsFieldCustom||ce.propsFieldGlobal||{}).returnObject||((ke=ce.logic)==null?void 0:ke.returnObject);(ve==null||ve===""||Ee&&(typeof ve=="string"||typeof ve=="number")&&(typeof ae=="object"&&ae!==null))&&Xt(t.formData,se,ae)}const we=ce.props||ce.propsFieldCustom||ce.propsFieldGlobal||{},pe=((be=ce.logic)==null?void 0:be.autoSelect)||we.autoSelect||"none";if(pe!=="none"){const ve=t.rawItemsCache[ce.key]||[];if(ve.length>0){const Be=Ye(t.formData,se);if(Be==null||Be===""){const Ee=we.returnObject||((Se=ce.logic)==null?void 0:Se.returnObject),Oe=ve[0];if(pe==="single"&&ve.length===1){const Ae=Ee?Oe:Oe.id??Oe.value??Oe.code;Xt(t.formData,se,Ae)}else if(pe==="first"){const Ae=Ee?Oe:Oe.id??Oe.value??Oe.code;Xt(t.formData,se,Ae)}}}}M.set(ce.key,R)},te=async(ce,se,z)=>{var Y,F;if(((Y=ce.type)==null?void 0:Y.toUpperCase())!=="WIZARD")return;const G=((F=ce.propsWizard)==null?void 0:F.propsSteps)||[],ee=Pt(ce),K=t.wizardState[ee]??0;for(let _=0;_<G.length;_++){const b=G[_],T=r.isSectionVisible(b,z)&&se&&_===K,D=b.modelKey||b.key||b.id;Array.isArray(b.sectionsWizard)?await re(b.sectionsWizard,T,D):b.sectionsWizard&&await re([b.sectionsWizard],T,D)}},re=async(ce,se=!0,z)=>{var G;if(ce)for(const ee of ce){const Y=r.isSectionVisible(ee,E)&&se,F=Pt(ee),_=z?F?`${z}.${F}`:z:F||"ROOT",b=z&&F?`${z}.${F}`:z,R=ee.propsForm||ee.propsFormStep||ee.propsTable||ee.propsTableStep||ee.propsDataTableWizard||ee.props||{};if(k&&!Y){const Z=R.modelDatatable||R.modelKey||(((G=ee.type)==null?void 0:G.toUpperCase())==="TABLE"?ee.key||ee.id:null);if(Z){const J=Ye(t.formData,Z);if(Array.isArray(J)?J.length>0:J!=null&&J!==""){const ae=t.originalData?Ye(t.originalData,Z):void 0;(Array.isArray(ae)?ae.length>0:ae!=null&&ae!=="")||Xt(t.formData,Z,Array.isArray(J)?[]:null)}}}const S=C.get(_);(Y||y)&&(S===!1||S===void 0)?(C.set(_,!0),(R.endpointSection||R.endpointForm||R.endpointTable)&&(console.log(`[useFormWatcher][TRIGGER] Auto-fetching section: ${_}`),await f(_,ee,b))):C.set(_,Y);const D=R.fields||ee.fields||[];for(const Z of D){if(!Z.model)continue;const J=b?`${b}.${Z.model}`:Z.model,fe=oe(Z,J,Y,E);ue(Z,J,fe,I,k)}await te(ee,Y,E)}};await re($,!0);for(const[ce,se]of q.entries())A.set(ce,se)};async function N(E,k=!1){if(!(E!=null&&E.sections))return;const $=O=>{if(!O)return;const q=["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule","fetchRule","copyRule","defaultValueRule"];for(const X of q){const oe=O[X],ue=Array.isArray(oe)?oe:[oe].filter(Boolean);for(const te of ue)te.condition&&sg(te.condition),X==="copyRule"&&te.source&&typeof te.source=="object"&&sg(te.source)}};function I(O,q){var te,re,ge,ce,se,z,G,ee,K,Y,F,_,b,R,S;const X=Pt(O)||q,oe=O.propsForm||O.propsFormStep||O.propsTable||O.propsTableStep||O.propsDataTableWizard||O.props||{};$(O.logic||oe.logic);const ue=oe.fields||O.fields||[];for(const T of ue){$(T.logic);const D=T.props||T.propsFieldCustom||T.propsFieldGlobal||{},Z=D.endpointReference||D.endpoint||D.endpointComponent,J=!!(Z!=null&&Z.apiUrl);if((te=T.logic)!=null&&te.optionsFilterRule||J){if(Array.isArray(Z==null?void 0:Z.keyParam)&&Z.keyParam.length>0){console.log(`[initSection][SKIP] Field "${T.model}" has keyParam dependencies — deferring fetch until parent is selected.`);continue}const ae=X?`${X}.${T.model}`:T.model;c(T,!1,ae)}}if((O.type==="TABLE"||O.isDataTable)&&((re=O.propsTable)!=null&&re.modelKey||(ge=O.propsTable)!=null&&ge.modelDatatable||(ce=O.propsTableStep)!=null&&ce.modelKey||(se=O.propsTableStep)!=null&&se.modelDatatable||(z=O.propsTable)!=null&&z.key||O.key)){const T=((G=O.propsTable)==null?void 0:G.modelKey)||((ee=O.propsTable)==null?void 0:ee.modelDatatable)||((K=O.propsTableStep)==null?void 0:K.modelKey)||((Y=O.propsTableStep)==null?void 0:Y.modelDatatable)||((F=O.propsTable)==null?void 0:F.key)||O.key;T&&(t.formData[T]=t.formData[T]||[])}if(O.type==="WIZARD"){const T=Pt(O),D=(R=(b=(_=h==null?void 0:h.currentRoute)==null?void 0:_.value)==null?void 0:b.query)==null?void 0:R[`step_${T}`];D!==void 0&&!isNaN(Number(D))?t.wizardState[T]=Number(D):t.wizardState[T]===void 0&&(t.wizardState[T]=0);for(const Z of((S=O.propsWizard)==null?void 0:S.propsSteps)||[]){const J=Z.modelKey||Z.key||Z.id;$(Z.logic),Z.sectionsWizard&&(Array.isArray(Z.sectionsWizard)?Z.sectionsWizard:[Z.sectionsWizard]).forEach(ae=>I(ae,J))}}}for(const O of E.sections)I(O);k||(await B(t.formData,!1),y&&(console.log("[useFormWatcher] Schema initialization complete. Exiting initialization mode."),y=!1))}async function j(E,k=!1){var $,I;if(E&&Object.keys(E).length>0){const O=JSON.stringify(E);if(O===m)return;if(O!==g){g=O,v=!0;const q=m?JSON.parse(m):null;for(const[X,oe]of Object.entries(E)){if(!y&&oe!==null&&oe!==void 0&&q&&q[X]===null)continue;if(!y&&oe!==null&&oe!==void 0){let te=l.value.paths.get(X)||(($=l.value.models.get(X))==null?void 0:$[0]);if(te&&r.isFieldDisabled(te.field,t.formData,te.path))continue}if(Array.isArray(oe)&&oe.length>0){const te=t.formData[X];if(Array.isArray(te)&&te.length>0&&Array.isArray(oe)&&oe.length===0)continue}if(!k&&A.get(X)===!0){const te=t.formData[X];if(te!=null)continue}const ue=t.formData[X];if(JSON.stringify(ue)!==JSON.stringify(oe)){hasChanges=!0;let te=l.value.paths.get(X)||((I=l.value.models.get(X))==null?void 0:I[0]);const re=(te==null?void 0:te.path)||X;Xt(t.formData,re,oe)}}(y||hasChanges)&&Object.assign(t.originalData,JSON.parse(JSON.stringify(t.formData))),y&&(k||(y=!1,await B(t.formData,!1)))}}}let W=null;o.watch(()=>a.value,async E=>{n.dummyMode?(W&&clearTimeout(W),W=setTimeout(async()=>{await N(E)},1e3)):await N(E)},{deep:!0,immediate:!0});let P=null;return o.watch(t.formData,async E=>{t.revision.value++,P&&clearTimeout(P),P=setTimeout(async()=>{const k=!y&&!v;v=!1,await B(E,k);const $=s.getCleanPayload()||{},I=JSON.stringify($);I!==m&&(m=I,i("update:model",$))},50)},{deep:!0}),o.watch(()=>n.model,async E=>{await j(E)},{deep:!0}),o.watch(()=>({...t.revealedSectionIds}),async()=>{await B(t.formData,!1)},{deep:!0}),o.watch(()=>({...t.wizardState}),async()=>{console.log("[useFormWatcher] wizardState changed, triggering scan..."),await B(t.formData,!1)},{deep:!0}),o.watch(()=>({...t.rawItemsCache}),async()=>{await B(t.formData,!1)},{deep:!0}),{lastEmittedPayload:()=>m}}function AK(e={},t,n){const{initialHiddenStates:i={},maxHistoryDepth:r=20,debug:s=!1}=e,a=o.ref({currentContext:null,history:[],hiddenStates:{...i},navigationEnabled:new Set,maxHistoryDepth:r,parentRowContext:null}),l=(P,E)=>{s&&console.log(`[Navigation] ${P}`,E||"")},c=(P,E)=>{if(P.rules&&P.rules.length>0){l("Multi-rule mode: evaluating rules",P.rules);let k=null;for(const $ of P.rules){if(!$.condition){k=$;continue}if(t){const I=t($.condition,E);if(l(`Rule "${$.id}" condition`,{condition:$.condition,result:I}),I)return l(`Rule "${$.id}" matched`,$),{targetSection:$.targetSection,hiddenRules:$.hiddenRules,parentRowContext:$.parentRowContext}}}return k?(l("Using default rule",k),{targetSection:k.targetSection,hiddenRules:k.hiddenRules,parentRowContext:k.parentRowContext}):(l("No rule matched and no default, aborting"),null)}return{targetSection:P.targetSection,hiddenRules:P.hiddenRules,parentRowContext:P.parentRowContext}},d=(P,E)=>{var I,O;const k=c(P,E);if(!k||!k.targetSection)return;const $={sectionKey:a.value.currentContext||"root",hiddenStates:{...a.value.hiddenStates},timestamp:Date.now(),sourceAction:k.targetSection,context:E,backButtonConfig:P.backButtonConfig};if(a.value.history.push($),a.value.history.length>a.value.maxHistoryDepth&&(a.value.history.shift(),l("History trimmed to max depth",a.value.maxHistoryDepth)),l("Added to history",$),h(k.hiddenRules,E),a.value.currentContext=k.targetSection,k.parentRowContext&&(E==null?void 0:E._rowIndex)!==void 0){const q=n==null?void 0:n(k.targetSection),X=(I=q==null?void 0:q.propsTable)==null?void 0:I.modelKey,oe=`${k.parentRowContext.parentArrayKey}.${k.parentRowContext.childArrayKey}`;!X||X===oe||X.startsWith(oe+".")?(a.value.parentRowContext={parentArrayKey:k.parentRowContext.parentArrayKey,rowIndex:E._rowIndex,childArrayKey:k.parentRowContext.childArrayKey},l("Parent row context set",a.value.parentRowContext)):l("Parent row context skipped (modelKey mismatch)",{targetModelKey:X,nestedModelKey:oe})}else if(!k.parentRowContext&&(E==null?void 0:E._rowIndex)!==void 0&&n){const q=n(k.targetSection),X=(O=q==null?void 0:q.propsTable)==null?void 0:O.modelKey;if(X){for(const oe of Object.keys(E))if(!oe.startsWith("_")&&X.startsWith(oe+".")){const ue=X.slice(oe.length+1);a.value.parentRowContext={parentArrayKey:oe,rowIndex:E._rowIndex,childArrayKey:ue},l("Auto-detected parent row context",a.value.parentRowContext);break}}}l("Navigation complete",{currentContext:a.value.currentContext,hiddenStates:a.value.hiddenStates})},f=()=>{if(a.value.history.length===0){l("No history available, cannot navigate back");return}const P=a.value.history.pop();if(!P){l("Failed to pop history item");return}l("Navigating back to",P),a.value.hiddenStates={...P.hiddenStates},a.value.parentRowContext=null,a.value.currentContext=P.sectionKey==="root"?null:P.sectionKey,l("Back navigation complete",{currentContext:a.value.currentContext,hiddenStates:a.value.hiddenStates,remainingHistory:a.value.history.length})},h=(P,E)=>{for(const[k,$]of Object.entries(P)){let I;typeof $=="boolean"?I=$:t&&typeof $=="object"?I=!!t($,E):I=!1,a.value.hiddenStates[k]=I}},m=()=>{if(a.value.history.length===0)return null;const P=a.value.history[a.value.history.length-1];return(P==null?void 0:P.backButtonConfig)||null},g=P=>a.value.hiddenStates[P]||!1,v=o.computed(()=>a.value.history.length>0),y=o.computed(()=>a.value.currentContext),A=o.computed(()=>a.value.history),C=o.computed(()=>({...a.value.hiddenStates})),M=o.computed(()=>a.value.parentRowContext);return{navigationState:a,hasHistory:v,currentContext:y,history:A,hiddenStates:C,parentRowContext:M,navigateTo:d,navigateBack:f,applyHiddenRules:h,getCurrentBackButton:m,isSectionHidden:g,setSectionHidden:(P,E)=>{l(`Setting ${P} hidden state to ${E}`),a.value.hiddenStates[P]=E},clearHistory:()=>{l("Clearing navigation history"),a.value.history=[],a.value.currentContext=null},reset:()=>{l("Resetting navigation state"),a.value.currentContext=null,a.value.history=[],a.value.hiddenStates={...i},a.value.parentRowContext=null},registerNavigationSection:P=>{a.value.navigationEnabled.add(P),l(`Registered navigation section: ${P}`)}}}Hv();const ew=e=>{var t,n;return!e||typeof e!="object"?!1:e instanceof File||e instanceof Blob||((t=e.constructor)==null?void 0:t.name)==="File"||((n=e.constructor)==null?void 0:n.name)==="Blob"||(typeof e.name=="string"||typeof e.fileName=="string")&&(e.size!==void 0||e.fileSize!==void 0)},ES=e=>{const t=o.toRaw(e);return t&&typeof t=="object"&&t._isLogicValue===!0&&t.value!==void 0?t.value:t};function CS(e,t){var ge,ce;console.log("[useDynamicForm] Initializing with props:",{hasSchema:!!e.schema,baseUrl:e.baseUrl,idTokenCore:(ge=e.schema)==null?void 0:ge.idTokenCore,tokenCoresCount:((ce=e.tokenCores)==null?void 0:ce.length)||0,isEditMode:e.isEditMode});const{t:n,locale:i}=Yn.useI18n(),r=o.computed(()=>i.value),{apiUrl:s}=o.inject("externalApi"),a=e.router||bs.useRouter();let l=null;try{l=bs.useRoute()}catch{console.warn("useRoute not available inside composition")}const c=xq(),d=o.computed(()=>e.schema||c.internalSchema.value),f=o.computed(()=>{var se,z,G;if(typeof((se=e.selectedTokenCore)==null?void 0:se.address)=="string")return e.selectedTokenCore.address;if(typeof e.baseUrl=="string"&&e.baseUrl!=="")return e.baseUrl;if((z=d.value)!=null&&z.idTokenCore&&Array.isArray(e.tokenCores)){const ee=String(d.value.idTokenCore);e.tokenCores.length>0&&console.log("[resolvedBaseUrl] Token List Check:",e.tokenCores.map(Y=>({id:Y.id,address:Y.address})));const K=e.tokenCores.find(Y=>String(Y.id)===ee);if(console.log(`[resolvedBaseUrl] Matching idTokenCore: "${ee}" against list of ${e.tokenCores.length} tokens.`),console.log("[resolvedBaseUrl] Found token:",K?{id:K.id,address:K.address}:"NOT FOUND"),K!=null&&K.address)return K.address}console.log("[resolvedBaseUrl] Final result: undefined. Prop baseUrl:",e.baseUrl,"SelectedToken:",(G=e.selectedTokenCore)==null?void 0:G.address)}),h=o.computed(()=>{var se;return e.permissionBase?e.permissionBase:((se=d.value)==null?void 0:se.code)||""}),m=(se,z,G)=>{if(z.model){const ee=G?`${G}.${z.model}`:z.model,K={field:z,path:ee};se.paths.set(ee,K);const Y=se.models.get(z.model)||[];Y.push(K),se.models.set(z.model,Y)}},g=(se,z,G)=>{const ee=Pt(z);if(ee){const K=G?`${G}.${ee}`:ee,Y={field:z,path:K},F=se.models.get(ee)||[];F.push(Y),se.models.set(ee,F)}},v=(se,z)=>{var K,Y;const G=z.modelKey||z.key||z.id,ee=Array.isArray(z.sectionsWizard)?z.sectionsWizard:[z.sectionsWizard].filter(Boolean);for(const F of ee){const _=Pt(F),b=_?`${G}.${_}`:G;g(se,F,G);const R=F.fields||((K=F.propsForm)==null?void 0:K.fields)||((Y=F.propsFormStep)==null?void 0:Y.fields)||[];for(const S of R)m(se,S,b)}},y=o.computed(()=>{var G,ee,K;const se={paths:new Map,models:new Map},z=(G=d.value)==null?void 0:G.sections;if(!z)return se;for(const Y of z){if(!Y)continue;const F=Y.propsForm||Y.propsTable||Y.props||{},_=F.fields||Y.fields||[],b=Pt(Y);if(g(se,Y),F.modelKey&&F.modelKey!==b){const S=se.models.get(F.modelKey)||[];S.push({field:Y,path:F.modelKey}),se.models.set(F.modelKey,S)}for(const S of _)m(se,S);const R=S=>{if(!S)return;const T=[...S.fieldActionGlobal||[],...S.fieldActionCustom||[]];for(const D of T)m(se,D)};if(F.propsAction&&R(F.propsAction),Array.isArray(F.propsActions))for(const S of F.propsActions)R(S);if(R(F),R(Y),((ee=Y.type)==null?void 0:ee.toUpperCase())==="WIZARD"&&((K=Y.propsWizard)!=null&&K.propsSteps))for(const S of Y.propsWizard.propsSteps)v(se,S)}return se}),A=Kv({formData:c.formData,errors:c.errors,fieldMap:y,rawItemsCache:c.rawItemsCache,revealedSectionIds:c.revealedSectionIds,activeSchema:d,locale:r,tableRowFormData:c.tableRowFormData,activeTableAction:c.activeTableAction}),C=(se,z)=>{if(!z||!(se!=null&&se.sections))return z;const G={...z};return se.sections.forEach(ee=>{var Y;if(ee.type==="WIZARD"&&((Y=ee.propsWizard)!=null&&Y.key)){const F=ee.propsWizard.key,_=z[F];Array.isArray(_)&&_.forEach(b=>{if(!(!b||typeof b!="object"))for(const R in b){const S=b[R];if(G[R]||(G[R]={}),Array.isArray(S))S.forEach(T=>{T&&typeof T=="object"&&Object.assign(G[R],T)});else if(S&&typeof S=="object")for(const T in S){const D=S[T];D&&typeof D=="object"&&(G[R][T]||(G[R][T]={}),Object.assign(G[R][T],D))}}})}const K=Pt(ee);K&&z[K]&&typeof z[K]=="object"&&Object.assign(G,z[K])}),G};let M="";o.watch(()=>d.value,se=>{var K,Y;if(!se)return;const z=se.id||se.code||((Y=(K=se.sections)==null?void 0:K[0])!=null&&Y.key?`sec-${se.sections[0].key}`:"default");if(!(z!==M)||(M!==""&&(Object.keys(c.formData).forEach(F=>delete c.formData[F]),Object.keys(c.tableRowFormData).forEach(F=>delete c.tableRowFormData[F]),Object.keys(c.errors).forEach(F=>delete c.errors[F]),Object.keys(c.touched).forEach(F=>delete c.touched[F]),c.isSubmitted.value=!1,Object.keys(c.fieldErrors).forEach(F=>delete c.fieldErrors[F]),Object.keys(c.wizardState).forEach(F=>delete c.wizardState[F]),Object.keys(c.inlineState).forEach(F=>delete c.inlineState[F]),c.isSubmitting.value=!1,Object.keys(c.rawItemsCache).forEach(F=>delete c.rawItemsCache[F]),Object.keys(c.revealedSectionIds).forEach(F=>delete c.revealedSectionIds[F]),Object.keys(c.revealedFieldModels).forEach(F=>delete c.revealedFieldModels[F]),Object.keys(c.wizardResponses).forEach(F=>delete c.wizardResponses[F]),Object.keys(c.sectionLoading).forEach(F=>delete c.sectionLoading[F]),Object.keys(c.fieldLoading).forEach(F=>delete c.fieldLoading[F])),M=z,!se.payload))return;const ee=C(se,se.payload);Object.entries(ee).forEach(([F,_])=>{const b=c.formData[F];let R=_;Array.isArray(_)&&(R=_.filter(S=>!kd(S)),_.length!==R.length&&console.log(`[SCHEMA-INIT][${F}] Filtered out ${_.length-R.length} empty objects from initial payload.`)),b==null?c.formData[F]=R:R!=null&&typeof R=="object"&&!Array.isArray(R)&&qv(c.formData[F],R)}),Object.assign(c.originalData,JSON.parse(JSON.stringify(c.formData))),q()},{immediate:!0,deep:!0});const B=fS({formData:c.formData,locale:r,errors:c.errors,fieldMap:y,activeSchema:d,isSectionVisible:A.isSectionVisible,isSectionHidden:A.isSectionHidden,isFieldVisible:A.isFieldVisible,isFieldRequired:A.isFieldRequired,resolveFieldLength:A.resolveFieldLength});o.watch(c.formData,se=>{Object.keys(c.errors).forEach(z=>{var ee;const G=y.value.paths.get(z);if(G){const K=Ye(se,G.path);B.validateField(G.field,K)||delete c.errors[z]}else{const K=Ye(se,z),Y=y.value.models.get(z),F=(ee=Y==null?void 0:Y[0])==null?void 0:ee.field;F?B.validateField(F,K)||delete c.errors[z]:K!=null&&K!==""&&delete c.errors[z]}})},{deep:!0});const j=AK({initialHiddenStates:(()=>{const se={},z=d.value;return z!=null&&z.sections&&z.sections.forEach(G=>{var K;const ee=Pt(G);ee&&((K=G.logic)==null?void 0:K.visibleRule)===!1&&(se[ee]=!0)}),se})()},A.evaluateLogic,se=>{var z;return $(((z=d.value)==null?void 0:z.sections)||[],se)}),W=se=>{var ee,K;const z=Pt(se),G=(K=(ee=j==null?void 0:j.navigationState)==null?void 0:ee.value)==null?void 0:K.hiddenStates;return G&&z&&typeof G[z]=="boolean"?!G[z]:A.isSectionVisible(se)},P=Tq({formData:c.formData,activeSchema:d,isSectionVisible:W,isFieldVisible:A.isFieldVisible,isFieldHidden:A.isFieldHidden,getWizardTabs:A.getWizardTabs,fieldMap:y,rawItemsCache:c.rawItemsCache}),E=EK({state:c,props:e,emit:t,apiUrl:s,router:a,locale:r,mapping:P,validation:B,fieldMap:y,activeSchema:d,resolvedBaseUrl:f,resolveKeyParams:I,navigation:j,logic:A}),k=(se,z,G)=>{const ee={},K=z.propsForm||z.propsFormStep||z.propsTable||z.propsTableStep||z.props||{};(K.fields||z.fields||[]).forEach(_=>{var R,S;const b=_.model||((R=_.props)==null?void 0:R.model)||_.key;if(b){let T=Ye(se,b)??se[b];if(T!==void 0){const D=_.props||_.propsFieldCustom||_.propsFieldGlobal||{},Z=D.returnObject||((S=_.logic)==null?void 0:S.returnObject),J=D.itemValue;!Z&&J&&T!==null&&typeof T=="object"&&!Array.isArray(T)&&(T=T[J]??T),Xt(ee,b,T)}}});const F=Pt(z);if(F&&se[F]!==void 0&&ee[F]===void 0&&Xt(ee,F,se[F]),z.type==="TABLE"||z.propsTable){const _=K.modelKey||K.modelDatatable;if(_&&se[_]!==void 0&&ee[_]===void 0)ee[_]=se[_];else if(_&&_.includes(".")&&ee[_]===void 0){const b=_.indexOf("."),R=_.substring(0,b),S=_.substring(b+1),T=se[R];if(Array.isArray(T)){const D=[];for(const Z of T){const J=S.includes(".")?Ye(Z,S):Z==null?void 0:Z[S];Array.isArray(J)&&D.push(...J)}D.length>0&&(ee[_]=D)}}}if(G){const _={};return Xt(_,G,ee),_}return ee},$=(se,z)=>{var G;if(!se)return null;for(const ee of se){const K=Pt(ee);if(K===z||z.endsWith(`.${K}`))return ee;if(ee.type==="WIZARD"&&((G=ee.propsWizard)!=null&&G.propsSteps)){for(const Y of ee.propsWizard.propsSteps)if(Y.sectionsWizard){const F=Array.isArray(Y.sectionsWizard)?Y.sectionsWizard:[Y.sectionsWizard],_=$(F,z);if(_)return _}}}return null};function I(se,z,G,ee){const K={};return!Array.isArray(se)||se.length===0||(se.forEach(Y=>{const F=R=>typeof R=="string"&&R.trim()!==""&&!isNaN(Number(R))?R.length>1&&R.startsWith("0")&&!R.startsWith("0.")||R.length>15&&/^\d+$/.test(R)?R:Number(R):R,_=R=>{var S,T,D,Z;if(R.startsWith("$value(")){const J=R.match(/\$value\(([^)]+)\)/);let fe=J?J[1]:R.replace("$value(","").replace(")","");return(fe.startsWith("'")&&fe.endsWith("'")||fe.startsWith('"')&&fe.endsWith('"'))&&(fe=fe.slice(1,-1)),fe}if(R.startsWith("$route.")){const J=R.replace("$route.","");if(e.apiParams&&e.apiParams[J]!==void 0&&e.apiParams[J]!==null)return e.apiParams[J];const fe=((S=a==null?void 0:a.currentRoute)==null?void 0:S.value)||l;return fe?(T=fe.params)==null?void 0:T[J]:void 0}if(R.startsWith("$query.")){const J=R.replace("$query.","");if(e.apiParams&&e.apiParams[J]!==void 0&&e.apiParams[J]!==null)return e.apiParams[J];if(typeof window<"u"){const ae=new URLSearchParams(window.location.search);if(ae.has(J))return ae.get(J)}const fe=((D=a==null?void 0:a.currentRoute)==null?void 0:D.value)||l;return(Z=fe==null?void 0:fe.query)==null?void 0:Z[J]}if(R.startsWith("$value.")){const J=R.replace("$value.","");return Ye(ee,J)}},b=R=>{var D,Z,J,fe,ae,we,pe;if(R.startsWith("$"))return _(R);const S=R.replace(/^formData\./,"");let T=ee?Ye(ee,S):void 0;if(T===void 0&&c.tableRowFormData){const ke=Object.keys(c.tableRowFormData);T=Ye(c.tableRowFormData,S),T!==void 0?console.log(`[resolveKeyParams] Found in state.tableRowFormData '${S}':`,T):console.log(`[resolveKeyParams] NOT found in state.tableRowFormData '${S}'. Available keys:`,ke)}if(T===void 0){const ke=A.getNormalizedData(c.formData,z);T=(D=ke._resolveLogicVar)==null?void 0:D.call(ke,S),console.log(`[resolveKeyParams] Smart Resolved '${S}':`,T)}else console.log(`[resolveKeyParams] Resolved '${S}':`,T);if(T==null&&G&&G.key===R&&(T=Ye(ee||c.formData,G.model)),T===void 0){const ke=((Z=a==null?void 0:a.currentRoute)==null?void 0:Z.value)||l,be=(J=ke==null?void 0:ke.query)==null?void 0:J[S];be!=null&&be!==""&&(T=be,console.log(`[resolveKeyParams] Query Fallback Resolved '${S}':`,T))}if(T===void 0){const ke=((fe=a==null?void 0:a.currentRoute)==null?void 0:fe.value)||l,be=(ae=ke==null?void 0:ke.params)==null?void 0:ae[S];be!=null&&be!==""&&(T=be,console.log(`[resolveKeyParams] Route Param Fallback Resolved '${S}':`,T))}if(T===void 0&&S.toLowerCase()==="id"){const ke=((we=a==null?void 0:a.currentRoute)==null?void 0:we.value)||l,be=(pe=ke==null?void 0:ke.params)==null?void 0:pe.id;be&&(T=be,console.log(`[resolveKeyParams] Route ID Fallback Resolved '${S}':`,T))}return T};if(typeof Y=="string"){let R=b(Y);if(R!=null&&R!==""){R=ES(R),typeof R=="object"&&!Array.isArray(R)&&!(R instanceof Date)&&!ew(R)&&(R=R.id??R.value??R.code??R);const S=Y.startsWith("$")&&Y.split(".").pop()||Y;K[S]=F(R)}}else typeof Y=="object"&&Y!==null&&Object.entries(Y).forEach(([R,S])=>{var Z,J,fe,ae,we;let D=b(S);if((D==null||D==="")&&(e.apiParams&&e.apiParams[R]!==void 0&&e.apiParams[R]!==null&&(D=e.apiParams[R],console.log(`[resolveKeyParams] Fallback resolved '${R}' from apiParams:`,D)),D==null||D==="")){if(typeof window<"u"){const pe=new URLSearchParams(window.location.search);pe.has(R)&&(D=pe.get(R))}if(D===void 0){const pe=((Z=a==null?void 0:a.currentRoute)==null?void 0:Z.value)||l;D=((J=pe==null?void 0:pe.query)==null?void 0:J[R])||((fe=pe==null?void 0:pe.params)==null?void 0:fe[R])}D!=null&&D!==""&&console.log(`[resolveKeyParams] Fallback resolved '${R}' from URL query/route matching apiKey:`,D)}if((D==null||D==="")&&R.toLowerCase()==="id"){const pe=((ae=a==null?void 0:a.currentRoute)==null?void 0:ae.value)||l,ke=(we=pe==null?void 0:pe.params)==null?void 0:we.id;ke&&(D=ke,console.log(`[resolveKeyParams] Fallback resolved '${R}' from route ID:`,D))}D!=null&&D!==""&&(D=ES(D),typeof D=="object"&&!Array.isArray(D)&&!(D instanceof Date)&&!ew(D)&&(D=D.id??D.value??D.code??D),K[R]=F(D))})}),Object.keys(K).length>0&&console.log(`[resolveKeyParams][DEBUG] Resolved params for ${z||"root"}:`,K)),K}const O=async(se,z=!1,G,ee)=>{const K=se.props||{},Y=K.endpointReference||K.endpoint||K.endpointComponent;if(!(Y!=null&&Y.apiUrl))return;const F=se.component||"";if(!["DCodeWorkflowDiagram","DCodeStaticImage","DCodeTimelineWithIcons"].includes(F)&&!(!z&&c.rawItemsCache[se.key]))try{const b=vo(Y.apiUrl,f.value);console.log(`[prefetchFieldItems][DEBUG] Field: ${se.model}, BaseURL: ${f.value}, Final URL: ${b}`);let R={page:1,perPage:100};if(Array.isArray(Y.keyParam)&&Object.assign(R,I(Y.keyParam,G,se,ee)),Array.isArray(Y.keyParam)&&Y.keyParam.length>0){const J=I(Y.keyParam,G,se,ee);if(Object.keys(J).length===0){console.log(`[prefetchFieldItems][SKIPPED] Field "${se.model}" has unresolved dependencies (keyParam). Skipping fetch until parent is selected.`);return}}console.log(`[prefetchFieldItems] Executing request for ${se.key} with params:`,R);const S={...Y.config||{}};Y.accept&&(S.headers||(S.headers={}),S.headers.Accept=Y.accept,S.headers.accept=Y.accept);const T=await s(b,Y.apiMethod||"GET",R,S),D=(T==null?void 0:T.data)!==void 0?T.data:T;let Z=[];Array.isArray(D)?Z=D:D&&(Z=[D]),c.rawItemsCache[se.key]=Z}catch(b){console.error(`[prefetchFieldItems] Error fetching items for ${se.key}:`,b),c.rawItemsCache[se.key]=[]}};function q(){var se;if(e.isEditMode&&((se=d.value)!=null&&se.sections)){const z=[],G=ee=>{ee.forEach(K=>{var Y,F;K&&(z.push(K),((Y=K.type)==null?void 0:Y.toUpperCase())==="WIZARD"&&((F=K.propsWizard)!=null&&F.propsSteps)&&K.propsWizard.propsSteps.forEach(_=>{const b=Array.isArray(_.sectionsWizard)?_.sectionsWizard:[_.sectionsWizard].filter(Boolean);G(b)}))})};G(d.value.sections),z.forEach(ee=>{var R;const K=Pt(ee);if(!K)return;const Y=ee.propsForm||ee.propsFormStep||ee.propsTable||ee.propsTableStep||ee.props||{},F=(R=ee.logic||Y.logic)==null?void 0:R.visibleRule;if(F!=null)return;(Y.fields||ee.fields||[]).some(S=>{var J;if(!S.model)return!1;const T=(J=y.value.models.get(S.model))==null?void 0:J[0],D=(T==null?void 0:T.path)||S.model,Z=Ye(c.formData,D);return Z!=null&&Z!==""})&&(c.revealedSectionIds[K]=!0)})}}const X=async(se=!1)=>{var G,ee,K,Y,F,_,b,R,S,T,D;const z=((G=d.value)==null?void 0:G.endpointAction)||((ee=d.value)==null?void 0:ee.endpointPropAction);if(z!=null&&z.apiUrl&&!(!e.isEditMode&&!se)){console.log(`[fetchFormData][GLOBAL] Triggered for schema: ${(K=d.value)==null?void 0:K.code}`),c.isSubmitting.value=!0;try{const Z=vo(z.apiUrl,f.value),J=I(z.keyParam||[]);if(e.isEditMode&&(z.apiMethod||"GET").toUpperCase()==="GET"&&!Object.keys(J).some(ke=>ke.toLowerCase()==="id"||ke.toLowerCase().endsWith("id"))){const ke=((_=(F=(Y=a==null?void 0:a.currentRoute)==null?void 0:Y.value)==null?void 0:F.params)==null?void 0:_.id)||((b=l==null?void 0:l.params)==null?void 0:b.id);ke&&(J.id=ke)}console.log("[fetchFormData][GLOBAL] Executing request with params:",J);const fe={...z.config||{}};z.accept&&(fe.headers||(fe.headers={}),fe.headers.Accept=z.accept,fe.headers.accept=z.accept);const ae=await s(Z,z.apiMethod||"GET",J,fe);if((ae==null?void 0:ae.status)===!0||(ae==null?void 0:ae.success)===!0||(ae==null?void 0:ae.code)===200||(ae==null?void 0:ae.code)==="00"||(ae==null?void 0:ae.status)==="SUCCESS"){const pe=(ae==null?void 0:ae.data)!==void 0?ae.data:ae;if(Array.isArray(pe)){const ke=(S=(R=d.value)==null?void 0:R.sections)==null?void 0:S.find(Se=>Se.type==="TABLE"||!!Se.propsTable||!!Se.isDataTable),be=ke?Pt(ke):null;be?Xt(c.formData,be,pe):Object.assign(c.formData,pe[0]||{})}else pe&&typeof pe=="object"&&(Object.assign(c.formData,pe),(D=(T=d.value)==null?void 0:T.sections)==null||D.forEach(ke=>{const be=Pt(ke);be&&pe[be]!==void 0&&Xt(c.formData,be,pe[be])}));Object.assign(c.originalData,JSON.parse(JSON.stringify(c.formData))),q()}}catch(Z){console.error("[fetchFormData] Error fetching initial data:",Z)}finally{c.isSubmitting.value=!1}}},oe=async(se,z,G,ee)=>{var Y,F;const K=z.endpoint;if(K!=null&&K.apiUrl){if(c.fieldLoading[se.model]){console.log(`[triggerFetchRule][SKIPPED] Rule for ${se.model} is already in progress.`);return}if(e.dummyMode){xt.info(`Simulasi Fetch Rule (${se.model})`,{autoClose:2e3}),c.formData[`_fetchStatus_${se.model}`]=!0,Array.isArray(z.revealSections)&&z.revealSections.forEach(_=>{c.revealedSectionIds[_]=!0}),Array.isArray(z.revealFields)&&z.revealFields.forEach(_=>{c.revealedFieldModels[_]=!0});return}try{c.fieldLoading[se.model]=!0;const _=vo(K.apiUrl,f.value),b=I(K.keyParam||[],G,se,ee);if(K.keyParam&&K.keyParam.length>0&&Object.keys(b).length===0){console.warn(`[triggerFetchRule][CANCELLED] Missing required dependencies for ${se.model}. Params resolved:`,b),P.handleClearMapping(z.mapping||{},G),c.formData[`_fetchStatus_${se.model}`]=!1,Array.isArray(z.revealSections)&&z.revealSections.forEach(J=>{c.revealedSectionIds[J]=!1}),Array.isArray(z.revealFields)&&z.revealFields.forEach(J=>{c.revealedFieldModels[J]=!1});return}const R={...K.config,disableGlobalLoading:!0};K.accept&&(R.headers||(R.headers={}),R.headers.Accept=K.accept,R.headers.accept=K.accept),_.includes("/api/auto-layout")&&(R.isAutoLayout=!0);const S=Object.values(b).some(J=>ew(J));let T=b;if(S&&(K.apiMethod||"POST").toUpperCase()!=="GET"){const J=new FormData;Object.entries(b).forEach(([fe,ae])=>{ae!=null&&(Array.isArray(ae)?ae.forEach(we=>J.append(fe,we)):J.append(fe,ae))}),T=J,R.headers&&(delete R.headers["Content-Type"],delete R.headers["content-type"])}console.log(`[triggerFetchRule] Executing request for ${se.key}. Method: ${K.apiMethod||"GET"}, Has File: ${S}`,b,"Config:",R);const D=await s(_,K.apiMethod||"GET",T,R);if((D==null?void 0:D.status)===!0||(D==null?void 0:D.success)===!0||(D==null?void 0:D.code)===200||(D==null?void 0:D.code)==="00"||(D==null?void 0:D.status)==="SUCCESS"){const J=G!=null&&G.includes(".")?G.split(".").slice(0,-1).join("."):void 0;P.handleResponseMapping(D,z.mapping||{},J),c.formData[`_fetchStatus_${se.model}`]=!0;const fe=(D==null?void 0:D.data)!==void 0?D.data:D;fe&&typeof fe=="object"&&Array.isArray(fe)===!1&&((F=(Y=d.value)==null?void 0:Y.sections)==null||F.forEach(ae=>{const we=Pt(ae);we&&fe[we]!==void 0&&Xt(c.formData,we,fe[we])})),Array.isArray(z.revealSections)&&z.revealSections.forEach(ae=>{c.revealedSectionIds[ae]=!0}),Array.isArray(z.revealFields)&&z.revealFields.forEach(ae=>{c.revealedFieldModels[ae]=!0})}else{const J=z.dialog||{},fe=J.type==="ALERT";c.confirmDialog.title=r.value==="id"?J.titleID||"Perhatian":J.titleEN||"Attention",c.confirmDialog.message=(D==null?void 0:D.message)||(r.value==="id"?"Data sudah ada atau sedang diproses.":"Data already exists or is being processed."),c.confirmDialog.showCancel=!fe&&J.showCancel!==!1,c.confirmDialog.isBlocking=J.isBlocking===!0,c.confirmDialog.redirectUrl=J.redirectUrl||"",c.confirmDialog.okText=r.value==="id"?J.okTextID||J.okText:J.okTextEN||J.okText,c.confirmDialog.cancelText=r.value==="id"?J.cancelTextID||J.cancelText:J.cancelTextEN||J.cancelText,c.confirmDialog.action={callback:()=>{}},c.confirmDialog.visible=!0}}catch(_){console.error(`[triggerFetchRule] Error for ${se.model}:`,_)}finally{c.fieldLoading[se.model]=!1}}},ue=async(se,z,G)=>{var _,b,R,S,T,D,Z,J,fe,ae,we;const ee=z||$(((_=d.value)==null?void 0:_.sections)||[],se);if(!ee){console.warn(`[fetchSectionData] Section not found for key: ${se}`);return}const K=ee.propsForm||ee.propsFormStep||ee.propsTable||ee.propsTableStep||ee.props||{},Y=K.endpointSection||K.endpointForm||K.endpointTable||K.endpoint;if(!(Y!=null&&Y.apiUrl))return;if(console.log(`[fetchSectionData][CHECK] Request for "${se}". Loading state:`,c.sectionLoading[se]),c.sectionLoading[se]){console.warn(`[fetchSectionData][CANCELLED] Request for "${se}" blocked because it is already loading.`);return}if(e.dummyMode)return;const F=G;c.sectionLoading[se]=!0,ee.key&&(c.sectionLoading[ee.key]=!0);try{const pe=Y.keyParam||[],ke=Y.byPassMode===!0||Array.isArray(pe)&&pe.includes("$bypassMode"),be=ee.type==="FORM"||!!ee.propsForm,Se=(Y.apiMethod||"GET").toUpperCase()==="GET";if(be&&!e.isEditMode&&Se&&!ke){c.sectionLoading[se]=!1;return}const ve=vo(Y.apiUrl,f.value),Be=ee.type==="TABLE"||!!ee.propsTable,Ee=I(pe,F);if((Y.apiMethod||"GET").toUpperCase()==="GET"&&!Object.keys(Ee).some(ne=>ne.toLowerCase()==="id"||ne.toLowerCase().endsWith("id"))){const ne=((S=(R=(b=a==null?void 0:a.currentRoute)==null?void 0:b.value)==null?void 0:R.params)==null?void 0:S.id)||((T=l==null?void 0:l.params)==null?void 0:T.id)||((J=(Z=(D=a==null?void 0:a.currentRoute)==null?void 0:D.value)==null?void 0:Z.query)==null?void 0:J.id)||((fe=l==null?void 0:l.query)==null?void 0:fe.id)||(typeof window<"u"?new URLSearchParams(window.location.search).get("id"):null);ne&&(Ee.id=ne)}if(Be){if(!c.sectionPagination[se]){const Ce=ee.propsTable||ee.propsTableStep||{};c.sectionPagination[se]={page:1,perPage:Ce.perPage||10,totalData:0,maxPage:1}}Ee.page=c.sectionPagination[se].page,Ee.perPage=c.sectionPagination[se].perPage}const Oe=ke?pe.filter(Ce=>!(typeof Ce=="string"&&Ce==="$bypassMode")):pe;if(!(Array.isArray(Oe)&&Oe.length===0)&&Y.keyParam&&Y.keyParam.length>0&&Object.keys(Ee).length===0){console.warn(`[fetchSectionData][CANCELLED] Missing required dependencies for section ${se}. Skipping fetch.`);return}const Re={...Y.config};Y.accept&&(Re.headers||(Re.headers={}),Re.headers.Accept=Y.accept,Re.headers.accept=Y.accept),ve.includes("/api/auto-layout")&&(Re.isAutoLayout=!0),console.log(`[fetchSectionData] Executing request for ${se} with params:`,Ee);const De=await s(ve,Y.apiMethod||"GET",Ee,Re);if((De==null?void 0:De.status)===!0||(De==null?void 0:De.success)===!0||(De==null?void 0:De.code)===200||(De==null?void 0:De.code)==="00"||(De==null?void 0:De.status)==="SUCCESS"){if(Be&&(c.sectionPagination[se]||(c.sectionPagination[se]={page:1,perPage:10}),c.sectionPagination[se].totalData=(De==null?void 0:De.totalData)??(De==null?void 0:De.total)??(De==null?void 0:De.count)??0,c.sectionPagination[se].maxPage=(De==null?void 0:De.maxPage)??1,c.sectionPagination[se].perPage=(De==null?void 0:De.perPage)??c.sectionPagination[se].perPage),Y.mapping&&Object.keys(Y.mapping).length>0)P.handleResponseMapping(De,Y.mapping,F);else{const Ce=(De==null?void 0:De.data)||(De==null?void 0:De.payload)||De,ne=Array.isArray(Ce)&&!Be?Ce[0]:Ce;if(ne&&(typeof ne=="object"||Array.isArray(ne))){const ye=k(ne,ee,F);if(Be&&Array.isArray(ne)){const Ve=ee.propsTable||ee.propsTableStep||{},Fe=Ve.modelKey||Ve.modelDatatable||Pt(ee);if(Fe){const Ue=Ye(c.formData,Fe);(Array.isArray(Ue)?Ue.length>0:Ue!=null&&Ue!=="")||(ye[Fe]=ne)}}const Me=(Ve,Fe)=>{var at;if(!Ve)return{siblings:[],stepKey:null};const Ue=Pt(Fe);for(const nt of Ve)if(nt.type==="WIZARD"&&((at=nt.propsWizard)!=null&&at.propsSteps))for(const Tt of nt.propsWizard.propsSteps){const fi=Array.isArray(Tt.sectionsWizard)?Tt.sectionsWizard:Tt.sectionsWizard?[Tt.sectionsWizard]:[];if(fi.some(cn=>Pt(cn)===Ue))return{siblings:fi,stepKey:Tt.modelKey||Tt.key||Tt.id||null};const Jt=Me(fi,Fe);if(Jt.siblings.length>0)return Jt}return{siblings:[],stepKey:null}},Ke=Me(((ae=d.value)==null?void 0:ae.sections)||[],ee),$e=Ke.siblings,He=Ke.stepKey;($e.length>0?$e:((we=d.value)==null?void 0:we.sections)||[]).forEach(Ve=>{var fi,hn,Jt,cn;if(Pt(Ve)===Pt(ee))return;const Fe=Ve.propsForm||Ve.propsFormStep||Ve.propsTable||Ve.propsTableStep||Ve.props||{},Ue=!!((fi=Fe.endpointSection)!=null&&fi.apiUrl||(hn=Fe.endpointForm)!=null&&hn.apiUrl||(Jt=Fe.endpointTable)!=null&&Jt.apiUrl||(cn=Fe.endpoint)!=null&&cn.apiUrl),at=Pt(Ve);let nt="";if(He)nt=He;else if(F){const vn=F.lastIndexOf(".");nt=vn!==-1?F.substring(0,vn):""}if(at&&ne[at]!==void 0){const vn=nt?`${nt}.${at}`:at;Ye(ye,vn)===void 0&&(console.log(`[fetchSectionData][CASCADE] SUCCESS: Direct key match for section "${at}" -> path "${vn}". Value:`,ne[at]),Xt(ye,vn,ne[at]))}const Tt=Fe.modelKey||Fe.modelDatatable;if(Tt&&(Ve.type==="TABLE"||Ve.propsTable)){const vn=nt?`${nt}.${Tt}`:Tt;if(!Tt.includes("."))ne[Tt]!==void 0&&Ye(ye,vn)===void 0&&(console.log(`[fetchSectionData][CASCADE] SUCCESS: modelKey match for section "${at}" -> "${Tt}".`),Xt(ye,vn,ne[Tt]));else{const gr=Tt.indexOf("."),Do=Tt.substring(0,gr),Bi=Tt.substring(gr+1),Ic=ne[Do];if(Array.isArray(Ic)&&Ye(ye,vn)===void 0){const ki=[];for(const pt of Ic){const yr=Bi.includes(".")?Ye(pt,Bi):pt==null?void 0:pt[Bi];Array.isArray(yr)&&ki.push(...yr)}ki.length>0&&(console.log(`[fetchSectionData][CASCADE] SUCCESS: dotted modelKey match for section "${at}" -> "${Tt}" (${ki.length} rows).`),Xt(ye,vn,ki))}}}if(!Ue){const vn=k(ne,Ve);Object.keys(vn).forEach(gr=>{const Do=nt?at?`${nt}.${at}`:nt:void 0,Bi=Do?`${Do}.${gr}`:gr;Ye(ye,Bi)===void 0&&(console.log(`[fetchSectionData][CASCADE] Field "${gr}" cascaded from section "${Pt(ee)}" → "${at||Ve.type}" under context "${nt||"root"}"`),Xt(ye,Bi,vn[gr]))})}}),qv(c.formData,ye)}}Object.assign(c.originalData,JSON.parse(JSON.stringify(c.formData))),q()}}catch(pe){console.error(`[fetchSectionData] Error for section ${se}:`,pe)}finally{c.sectionLoading[se]=!1,ee.key&&(c.sectionLoading[ee.key]=!1)}},te=CK({formData:c.formData,emit:t,mapping:P,validation:B,locale:r,logic:A,state:c,activeSchema:d,prefetchFieldItems:O,triggerFetchRule:oe,navigation:j});SK({state:c,props:e,emit:t,logic:A,mapping:P,fieldMap:y,activeSchema:d,prefetchFieldItems:O,triggerFetchRule:oe,fetchSectionData:ue,router:a}),o.watch(()=>({...c.wizardState}),(se,z)=>{Object.entries(se).forEach(([G,ee])=>{var K,Y,F,_;if((z==null?void 0:z[G])!==ee){const b=(Y=(K=d.value)==null?void 0:K.sections)==null?void 0:Y.find(R=>Pt(R)===G);if(b){const R=(_=(F=b.propsWizard)==null?void 0:F.propsSteps)==null?void 0:_[ee];if(R){const S=R.key||R.id;t("step-change",S)}}}})},{deep:!0,immediate:!0});const re=o.computed(()=>{const se={},z=d.value;return z!=null&&z.sections&&z.sections.forEach(G=>{var K,Y,F;(((K=G.propsForm)==null?void 0:K.fields)||((Y=G.propsTable)==null?void 0:Y.fields)||((F=G.props)==null?void 0:F.fields)||[]).forEach(_=>{var b,R,S,T,D,Z,J,fe,ae,we,pe;if(_.component==="DCodeRadioCustom"){const ke=((b=_.props)==null?void 0:b.name)||"default-group";se[ke]||(se[ke]=[]);let be=((S=(R=_.props)==null?void 0:R.endpoint)==null?void 0:S.apiUrl)||((T=_.props)==null?void 0:T.apiUrl);be=vo(be,f.value),se[ke].push({key:_.key,value:(D=_.props)==null?void 0:D.value,label:((Z=_.props)==null?void 0:Z.labelID)||((J=_.props)==null?void 0:J.labelEN)||_.key,model:_.model||_.key,apiUrl:be,apiMethod:((ae=(fe=_.props)==null?void 0:fe.endpoint)==null?void 0:ae.apiMethod)||((we=_.props)==null?void 0:we.apiMethod),icon:(pe=_.props)==null?void 0:pe.icon,name:ke})}})}),se});return o.onMounted(()=>{var z;const se=Object.keys(c.formData).some(G=>{const ee=c.formData[G];return Array.isArray(ee)||ee&&typeof ee=="object"?!1:ee!=null&&ee!==""});e.isEditMode&&!se&&(console.log(`[useDynamicForm][onMounted] Edit Mode and empty formData. Fetching root-level form data for schema: ${(z=d.value)==null?void 0:z.code}`),X())}),{t:n,locale:r,i18nLocale:i,apiUrl:s,router:a,isSubmitting:c.isSubmitting,internalSchema:c.internalSchema,activeSchema:d,resolvedBaseUrl:f,permissionBase:h,checkPermission:e.checkPermission,userPermissions:e.userPermissions,selectedTokenCore:e.selectedTokenCore,radioGroups:re,confirmDialog:c.confirmDialog,fieldMap:y,rawItemsCache:c.rawItemsCache,revision:c.revision,formData:c.formData,originalData:c.originalData,errors:c.errors,touched:c.touched,isSubmitted:c.isSubmitted,fieldErrors:c.fieldErrors,inlineState:c.inlineState,wizardState:c.wizardState,wizardResponses:c.wizardResponses,sectionLoading:c.sectionLoading,fieldLoading:c.fieldLoading,sectionPagination:c.sectionPagination,validation:B,getSectionKey:Pt,sortedFields:Aq,prefetchFieldItems:O,fetchFormData:X,fetchSectionData:ue,getDeepValue:Ye,setDeepValue:Xt,...A,...P,...E,...te,resolveKeyParams:I,navigation:j}}const tw=o.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)(o.unref(TK)({variant:e.variant}),t.class))},[o.renderSlot(n.$slots,"default")],2))}}),TK=Vm("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),Rf=o.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),If=o.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("p-6 pt-0",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),Of=o.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("flex flex-col gap-y-1.5 p-6",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),Lf=o.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("h3",{class:o.normalizeClass(o.unref(nn)("font-medium leading-none tracking-tight",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),PK={key:0,class:"mb-4 space-y-2"},BK={class:"flex items-center justify-between"},NK={class:"p-4 rounded-lg border border-slate-200 dark:border-neutral-700 bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-950/20 dark:to-indigo-950/20 space-y-3"},DK={class:"flex items-start gap-3"},MK={class:"p-2 rounded-lg bg-white dark:bg-neutral-800 shadow-sm"},RK={class:"flex-1"},IK={class:"text-sm font-semibold text-slate-800 dark:text-neutral-200"},OK={class:"text-xs text-slate-600 dark:text-neutral-400 mt-1"},LK={class:"flex items-center gap-2"},FK={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},$K={class:"flex flex-wrap items-center justify-center gap-2"},zK=["accept","multiple"],yg=Mn(o.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null},template:{default:null}},emits:["picked","picked:multiple","error"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.ref(!1),a=o.ref(null),l=o.ref(null),c=o.ref(null);o.computed(()=>n.accept||"file/*");const d=o.computed(()=>n.error??a.value);function f(){var I;n.disabled||(I=r.value)==null||I.click()}function h(I){const O=I/1024,q=O/1024;return q>=1?`${q.toFixed(2)} MB`:O>=1?`${O.toFixed(1)} KB`:`${I} B`}function m(I){var q;if(!I)return"File tidak valid";if((q=n.accept)!=null&&q.includes("image/")&&!I.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const O=(n.maxSizeMb??2)*1024*1024;return I.size>O?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:null}function g(I){l.value=I.name,c.value=I.size}function v(I){if(a.value=null,!I.length)return;if(n.mode==="single"){const q=I[0],X=m(q);if(X){a.value=X,i("error",X);return}n.showSelected&&g(q),i("picked",q);return}const O=[];for(const q of I){const X=m(q);if(X){a.value=X,i("error",X);return}O.push(q)}O.length&&(n.showSelected&&g(O[0]),i("picked:multiple",O))}function y(I){const O=I.target,q=Array.from(O.files??[]);v(q),O.value=""}function A(){n.disabled||(s.value=!0)}function C(){n.disabled||(s.value=!0)}function M(){s.value=!1}function B(I){var X,oe;if(n.disabled)return;s.value=!1;const O=Array.from(((X=I.dataTransfer)==null?void 0:X.files)??[]),q=(oe=n.accept)!=null&&oe.includes("image/")?O.filter(ue=>ue.type.startsWith("image/")):O;v(q)}const N=o.computed(()=>(n.accept||"file/*").split(",").map(I=>I.trim()).filter(Boolean).map(I=>I==="image/*"?"IMAGE":I.replace(/^image\//,"").replace(/^\./,"")).join(", "));o.computed(()=>`${n.maxSizeMb??0}MB`);const j=o.ref(!1),W=o.computed(()=>{if(n.disabled||!j.value)return{};const I=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:I?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:I?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}}),{locale:P}=Yn.useI18n(),{apiUrl:E}=o.inject("externalApi")||{},k=o.computed(()=>n.template?cS({template:n.template,locale:P,apiUrl:E}):null),$=o.computed(()=>{if(!k.value)return null;const I=k.value.resolvedIcon;return tn[I]||tn.Download});return(I,O)=>(o.openBlock(),o.createBlock(o.unref(Rf),{class:o.normalizeClass([e.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:o.withCtx(()=>[o.createVNode(o.unref(Of),{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Lf),{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1})]),_:1}),o.createVNode(o.unref(If),{class:"pt-2"},{default:o.withCtx(()=>[k.value&&k.value.hasTemplate?(o.openBlock(),o.createElementBlock("div",PK,[o.createElementVNode("div",BK,[o.createElementVNode("button",{type:"button",onClick:O[0]||(O[0]=q=>k.value.toggleExpanded()),class:"text-xs font-medium text-slate-600 dark:text-slate-400 hover:text-primary-600 dark:hover:text-primary-400 transition-colors flex items-center gap-1"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(k.value.isExpanded?tn.ChevronDown:tn.ChevronRight),{class:"w-3 h-3"})),o.createTextVNode(" "+o.toDisplayString(k.value.toggleButtonText),1)])]),o.withDirectives(o.createElementVNode("div",NK,[o.createElementVNode("div",DK,[o.createElementVNode("div",MK,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent($.value),{class:"w-5 h-5 text-primary-600 dark:text-primary-400"}))]),o.createElementVNode("div",RK,[o.createElementVNode("h4",IK,o.toDisplayString(k.value.resolvedTitle),1),o.createElementVNode("p",OK,o.toDisplayString(k.value.resolvedDescription),1)])]),o.createElementVNode("div",LK,[k.value.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:1,type:"button",size:"sm",variant:"destructive",disabled:k.value.isDownloading||e.disabled,onClick:O[2]||(O[2]=q=>k.value.downloadTemplate()),class:"text-xs"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.RotateCw),{class:"w-3.5 h-3.5 mr-1.5"})),o.createTextVNode(" "+o.toDisplayString(k.value.retryButtonText),1)]),_:1},8,["disabled"])):(o.openBlock(),o.createBlock(o.unref(Fr),{key:0,type:"button",size:"sm",disabled:k.value.isDownloading||e.disabled,onClick:O[1]||(O[1]=q=>k.value.downloadTemplate()),class:"text-xs"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(k.value.isDownloading?tn.Loader2:tn.Download),{class:o.normalizeClass(["w-3.5 h-3.5 mr-1.5",k.value.isDownloading?"animate-spin":""])},null,8,["class"])),o.createTextVNode(" "+o.toDisplayString(k.value.resolvedLabel),1)]),_:1},8,["disabled"])),k.value.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:2,type:"button",size:"sm",variant:"ghost",onClick:O[3]||(O[3]=q=>k.value.clearError()),class:"text-xs"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.X),{class:"w-3.5 h-3.5"}))]),_:1})):o.createCommentVNode("",!0)]),k.value.downloadError?(o.openBlock(),o.createBlock(o.unref(jv),{key:0,variant:"destructive",class:"text-xs py-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uv),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value.downloadError),1)]),_:1})]),_:1})):o.createCommentVNode("",!0)],512),[[o.vShow,k.value.isExpanded]])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",e.disabled?"is-disabled":""]]),style:o.normalizeStyle([{minHeight:"190px"},W.value]),onClick:f,onDragenter:o.withModifiers(A,["prevent"]),onDragover:o.withModifiers(C,["prevent"]),onDragleave:o.withModifiers(M,["prevent"]),onDrop:o.withModifiers(B,["prevent"]),onMouseenter:O[4]||(O[4]=q=>j.value=!0),onMouseleave:O[5]||(O[5]=q=>j.value=!1)},[o.createElementVNode("div",FK,[O[6]||(O[6]=o.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),O[7]||(O[7]=o.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),o.createElementVNode("div",$K,[o.createVNode(o.unref(tw),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:o.withCtx(()=>[o.createTextVNode(" Allowed: "+o.toDisplayString(N.value),1)]),_:1}),o.createVNode(o.unref(tw),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:o.withCtx(()=>[o.createTextVNode(" Max: "+o.toDisplayString(n.maxSizeMb)+"MB ",1)]),_:1})]),e.showSelected&&l.value?(o.openBlock(),o.createBlock(o.unref(tw),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.value)+" • "+o.toDisplayString(c.value?h(c.value):""),1)]),_:1})):o.createCommentVNode("",!0)]),o.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:e.accept,multiple:e.mode==="multiple",onChange:y},null,40,zK)],38),d.value?(o.openBlock(),o.createBlock(o.unref(jv),{key:1,variant:"destructive",class:"mt-3"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uv),{class:"text-sm"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value),1)]),_:1})]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-2cc0ac42"]]),jK={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},UK={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},WK={class:"relative overflow-auto p-0"},nw=o.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(e,{emit:t}){const n=e,i=t,r=o.computed({get:()=>n.modelValue,set:B=>i("update:modelValue",B)}),s=o.ref(null),a=o.ref(null);let l=null,c=!1,d=0,f=null;function h(){if(l){try{l.close()}catch{}l=null,f&&(f.disconnect(),f=null),s.value&&(s.value.innerHTML=""),a.value=null}}async function m(B,N,j,W,P){const E=await new Promise((I,O)=>{const q=URL.createObjectURL(B),X=new Image;X.onload=()=>{URL.revokeObjectURL(q),I(X)},X.onerror=oe=>{URL.revokeObjectURL(q),O(oe)},X.src=q}),k=document.createElement("canvas");k.width=N,k.height=j;const $=k.getContext("2d");return $?($.drawImage(E,0,0,N,j),await new Promise(I=>{k.toBlob(O=>I(O||B),W,P)})):B}function g(){if(!l||!a.value)return;const B=l.getPlugin("Dashboard"),N=l.getFile(a.value);!B||!N||requestAnimationFrame(()=>{try{B.openFileEditor(N)}catch{try{B.openFileEditor(a.value)}catch{}}})}async function v(B){if(l){l.cancelAll(),a.value=null;try{const N=l.addFile({name:B.name,type:B.type,data:B,source:"Local",isRemote:!1});a.value=String(N)}catch{}}}function y(){if(!s.value)return;l&&h(),l=new tI({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const B=document.documentElement.classList.contains("dark");l.use(X1,{target:s.value,inline:!0,height:480,theme:B?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),f=new MutationObserver(()=>{if(!l)return;const N=document.documentElement.classList.contains("dark"),j=l.getPlugin("Dashboard");j&&j.setOptions({theme:N?"dark":"light"})}),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(nI,{target:X1,quality:n.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:n.aspectRatio==null?Number.NaN:n.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",N=>{a.value=(N==null?void 0:N.id)??null,n.autoOpenEditor&&setTimeout(()=>g(),80)}),l.on("file-editor:complete",async N=>{const j=++d;try{const W=N.data,P=W.type||N.type||"image/jpeg";let E=W;if(n.outputWidth&&n.outputHeight&&(E=await m(W,n.outputWidth,n.outputHeight,P,n.quality)),c||j!==d)return;const k=N.name||"edited-image.jpg",$=new File([E],k,{type:P});await A($,"UPPY_EDITOR_COMPLETE"),i("done",$),r.value=!1}catch{}})}async function A(B,N="CROP_RESULT"){const j=URL.createObjectURL(B);try{const W=await new Promise((P,E)=>{const k=new Image;k.onload=()=>P(k),k.onerror=E,k.src=j});console.group(N),console.table({name:B.name,type:B.type,sizeBytes:B.size,sizeMB:+(B.size/1024/1024).toFixed(3),width:W.naturalWidth,height:W.naturalHeight,ratio:+(W.naturalWidth/W.naturalHeight).toFixed(4)}),console.groupEnd()}finally{URL.revokeObjectURL(j)}}o.watch(r,async B=>{c=!B,d++,B?(await o.nextTick(),y(),n.file&&await v(n.file)):h()},{flush:"post"}),o.watch(()=>n.file,async B=>{r.value&&B&&(await o.nextTick(),await v(B))}),o.onBeforeUnmount(()=>{c=!0,d++,h()});const C=B=>{B.key==="Escape"&&r.value&&(r.value=!1)};o.watch(r,B=>{B?globalThis.addEventListener("keydown",C):globalThis.removeEventListener("keydown",C)},{immediate:!0});const M=o.ref(!1);return(B,N)=>r.value?(o.openBlock(),o.createElementBlock("div",jK,[o.createVNode(o.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:o.withCtx(()=>[r.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:N[0]||(N[0]=j=>r.value=!1)})):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:o.withCtx(()=>[r.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-700/50 bg-background dark:bg-neutral-800 shadow-2xl transition-all",onClick:N[4]||(N[4]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("div",UK,[N[6]||(N[6]=o.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),o.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:o.normalizeStyle({opacity:M.value?1:.7}),onClick:N[1]||(N[1]=j=>r.value=!1),onMouseenter:N[2]||(N[2]=j=>M.value=!0),onMouseleave:N[3]||(N[3]=j=>M.value=!1)},[o.createVNode(o.unref(Ne.X),{class:"h-4 w-4"}),N[5]||(N[5]=o.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),o.createElementVNode("div",WK,[o.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):o.createCommentVNode("",!0)]),_:1})])):o.createCommentVNode("",!0)}}),HK={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},qK=["src"],KK=["disabled"],GK=["disabled"],YK={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},ZK={class:"flex gap-2"},XK={class:"font-medium truncate"},JK={class:"flex gap-2"},QK={class:"font-medium"},VK={class:"flex gap-2"},eG={class:"font-medium truncate"},iw=Mn(o.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null);o.watch(()=>n.file,m=>{r.value&&URL.revokeObjectURL(r.value),r.value=m?URL.createObjectURL(m):null},{immediate:!0}),o.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),d&&d.disconnect()});function s(m){const g=m/1024,v=g/1024;return v>=1?`${v.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const a=o.computed(()=>n.file?{name:n.file.name,size:s(n.file.size),type:n.file.type||"unknown"}:null),l=o.ref(!1),c=o.ref(!1);let d=null;const f=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};o.onMounted(()=>{f(),typeof document<"u"&&(d=new MutationObserver(f),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const h=o.computed(()=>n.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,g)=>e.file?(o.openBlock(),o.createBlock(Rf,{key:0,class:o.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:o.withCtx(()=>[o.createVNode(Of,{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(Lf,{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1}),e.description?(o.openBlock(),o.createElementBlock("div",HK,o.toDisplayString(e.description),1)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(If,{class:"pt-2"},{default:o.withCtx(()=>{var v,y,A;return[o.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:o.normalizeStyle([{height:`${e.previewHeight}px`},h.value]),onMouseenter:g[2]||(g[2]=C=>l.value=!0),onMouseleave:g[3]||(g[3]=C=>l.value=!1)},[r.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,qK)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"d-action-buttons",style:o.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[e.showEdit?(o.openBlock(),o.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:o.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:g[0]||(g[0]=C=>i("edit"))},[o.createVNode(o.unref(Ne.Pencil),{style:{width:"16px",height:"16px"}})],12,KK)):o.createCommentVNode("",!0),e.showRemove?(o.openBlock(),o.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:o.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:g[1]||(g[1]=C=>i("remove"))},[o.createVNode(o.unref(Ne.Trash2),{style:{width:"16px",height:"16px"}})],12,GK)):o.createCommentVNode("",!0)],4),o.createElementVNode("div",{class:"d-metadata-overlay",style:o.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[o.createElementVNode("div",YK,[o.createElementVNode("div",ZK,[g[4]||(g[4]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),o.createElementVNode("span",XK,o.toDisplayString((v=a.value)==null?void 0:v.name),1)]),o.createElementVNode("div",JK,[g[5]||(g[5]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),o.createElementVNode("span",QK,o.toDisplayString((y=a.value)==null?void 0:y.size),1)]),o.createElementVNode("div",VK,[g[6]||(g[6]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),o.createElementVNode("span",eG,o.toDisplayString((A=a.value)==null?void 0:A.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),tG={class:"space-y-3"},nG={class:"flex flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-primary-300 dark:border-primary-700 bg-primary-50/50 dark:bg-primary-900/10",style:{"min-height":"190px"}},bg=o.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1},template:{default:null}},emits:["update:modelValue","error","uploaded"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.ref(!1),a=o.ref(null),l=o.ref(null);o.watch(()=>n.modelValue,te=>{te instanceof File?r.value=te:te||(r.value=null)},{immediate:!0});const c=o.ref(null);function d(te){c.value=te,i("error",te)}function f(){c.value=null}const h=o.computed(()=>{const te=(n.allowedTypes??"").trim();return te?te.split(/[,\s;]+/g).map(ge=>ge.trim().toLowerCase()).filter(Boolean).map(ge=>ge.includes("/")||ge.startsWith(".")?ge:`.${ge}`):[]});function m(te){const re=te.lastIndexOf(".");return re>=0?te.slice(re).toLowerCase():""}const g=o.computed(()=>{if(h.value.length){const te=h.value.filter(ge=>ge.startsWith("."));return[...h.value.filter(ge=>ge.includes("/")),...te].join(",")}return n.accept||"image/*"}),v=o.computed(()=>h.value.length?h.value.join(", "):n.accept||"image/*");function y(te){if(h.value.length){const ge=(te.type||"").toLowerCase(),ce=m(te.name);return h.value.some(se=>se.includes("/")?ge===se:se.startsWith(".")?ce===se:ce===`.${se}`)}return(n.accept||"image/*").toLowerCase().includes("image/")?(te.type||"").toLowerCase().startsWith("image/"):!0}function A(te){return te*1024*1024}async function C(te){var re;return(re=te.type)!=null&&re.startsWith("image/")?await new Promise(ge=>{const ce=URL.createObjectURL(te),se=new Image;se.onload=()=>{URL.revokeObjectURL(ce),ge({w:se.naturalWidth,h:se.naturalHeight})},se.onerror=()=>{URL.revokeObjectURL(ce),ge(null)},se.src=ce}):null}async function M(te){if(!(n.minWidth!=null||n.minHeight!=null||n.maxWidth!=null||n.maxHeight!=null))return null;const ge=await C(te);return ge?n.minWidth!=null&&ge.w<n.minWidth?`Lebar gambar minimal ${n.minWidth}px`:n.minHeight!=null&&ge.h<n.minHeight?`Tinggi gambar minimal ${n.minHeight}px`:n.maxWidth!=null&&ge.w>n.maxWidth?`Lebar gambar maksimal ${n.maxWidth}px`:n.maxHeight!=null&&ge.h>n.maxHeight?`Tinggi gambar maksimal ${n.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function B(te){return te?y(te)?n.minSizeMb!=null&&te.size<A(n.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${n.minSizeMb}MB`:n.maxSizeMb!=null&&te.size>A(n.maxSizeMb)?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:await M(te):`only Allowed: ${v.value}`:"File tidak valid"}function N(te){n.disabled||(a.value=te,s.value=!0)}async function j(te){if(n.disabled)return;f();const re=await B(te);if(re){d(re);return}l.value=te,N(te)}const{apiUrl:W}=o.inject("externalApi")||{},P=ig(),E=o.ref(!1),k=o.ref(null);function $(te,re){return!te||!re?null:te.replace(/\/+$/,"")+"/"+re.replace(/^\/+/,"")}function I(te){var se;const re=(te==null?void 0:te.data)??te,ge=(se=re==null?void 0:re.data)==null?void 0:se[0];if(!ge)return null;const ce=$(ge.server,ge.url);return{...ge,fullUrl:ce?encodeURI(ce):null}}async function O(te){var re;if(n.uploadFn){try{E.value=!0;const ge=await n.uploadFn(te);r.value=te,i("update:modelValue",ge),i("uploaded",ge)}catch(ge){console.error("Upload Error",ge),P.error("Upload Failed",(ge==null?void 0:ge.message)||"Unknown error"),d((ge==null?void 0:ge.message)||"Upload Failed")}finally{E.value=!1}return}if(!((re=n.endpoint)!=null&&re.apiUrl)){r.value=te,i("update:modelValue",te);return}try{E.value=!0;const ge=new FormData;ge.append("doc",te);const ce=(n.endpoint.apiMethod||"POST").toUpperCase(),se=n.endpoint.apiUrl,z=await W(se,ce,ge),G=Array.isArray(z==null?void 0:z.data)?z.data[0]:(z==null?void 0:z.data)||z,ee=I(z);ee&&(k.value=ee),r.value=te,i("update:modelValue",G??ee??z),i("uploaded",z)}catch(ge){console.error("Upload Error",ge),P.error("Upload Failed",(ge==null?void 0:ge.message)||"Unknown error"),d((ge==null?void 0:ge.message)||"Upload Failed")}finally{E.value=!1}}async function q(te){f(),await O(te),s.value=!1,a.value=null}function X(){s.value=!1,a.value=null}async function oe(){if(!r.value)return;f();const te=n.editUseOriginal?l.value??r.value:r.value,re=await B(te);if(re){d(re);return}N(te)}function ue(){f(),r.value=null,k.value=null,a.value=null,s.value=!1,l.value=null,i("update:modelValue",null)}return o.watch(()=>n.modelValue,te=>{te instanceof File&&!l.value&&(l.value=te),te||(l.value=null)},{immediate:!0}),(te,re)=>(o.openBlock(),o.createElementBlock("div",tG,[E.value?(o.openBlock(),o.createBlock(o.unref(Rf),{key:0,class:"dark:bg-neutral-800 dark:border-neutral-700/50"},{default:o.withCtx(()=>[o.createVNode(o.unref(Of),{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Lf),{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1})]),_:1}),o.createVNode(o.unref(If),{class:"pt-2"},{default:o.withCtx(()=>[o.createElementVNode("div",nG,[o.createVNode(o.unref(Ne.Loader2),{class:"w-8 h-8 animate-spin text-primary-500"}),re[2]||(re[2]=o.createElementVNode("span",{class:"text-sm font-medium text-primary-600 dark:text-primary-400"},"Uploading...",-1))])]),_:1})]),_:1})):r.value?(o.openBlock(),o.createBlock(iw,{key:2,file:r.value,title:e.label,description:e.description,"preview-width":e.previewWidth,disabled:e.disabled||E.value,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:oe,onRemove:ue,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(o.openBlock(),o.createBlock(yg,{key:1,label:e.label,hint:e.hint,accept:g.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||E.value,template:e.template,onPicked:j,error:c.value,onError:re[0]||(re[0]=ge=>d(ge))},null,8,["label","hint","accept","maxSizeMb","disabled","template","error"])),o.createVNode(nw,{modelValue:s.value,"onUpdate:modelValue":re[1]||(re[1]=ge=>s.value=ge),file:a.value,title:e.title,description:e.description,"auto-open-editor":e.autoOpenEditor,"aspect-ratio":e.aspectRatio,"output-width":e.outputWidth,"output-height":e.outputHeight,quality:e.quality,onDone:q,onCancel:X},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),iG={class:"space-y-4"},rG={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},oG={class:"flex items-center gap-2 flex-nowrap"},sG={key:0,class:"flex flex-col gap-0.5"},aG=["for"],lG={key:0,class:"ml-1 text-destructive"},cG=["for"],dG={class:"text-[11px] text-gray-500 dark:text-gray-400"},uG={class:"flex items-center gap-2 flex-nowrap"},fG=["id","value","disabled","readonly","onKeydown","onInput","onPaste"],hG={key:1,class:"text-xs text-destructive mt-1"},vg=o.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{minLength:{default:6},default:{default:""},endpoint:{},submitFn:{},modelValue:{default:""},label:{default:""},placeholder:{},clearable:{type:Boolean},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(e,{emit:t}){const n=o.useAttrs(),i=Math.random().toString(36).slice(2,7),r=o.computed(()=>`app-otp-${(n.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${i}`),s=e,a=t,l=o.computed(()=>!!s.error),c=o.ref([]),d=o.ref([]),f=o.ref(!1),{DCodeApi:h}=o.inject("externalApi")||{},m=ig(),g=o.computed(()=>{const P=Number(s.minLength);return P&&P>0?P:6}),v=()=>{const P=s.modelValue||s.default||"";d.value=Array.from({length:g.value},(E,k)=>P[k]??""),a("updateOtp",d.value.join(""))};v(),o.watch(()=>[s.minLength,s.default],()=>v()),o.watch(()=>s.modelValue,P=>{const E=P||"";E!==d.value.join("")&&(d.value=Array.from({length:g.value},(k,$)=>E[$]??""))});const y=P=>{P<0||P>=g.value||o.nextTick(()=>{var E;return(E=c.value[P])==null?void 0:E.focus()})},A=P=>P.match(/[a-zA-Z0-9]/)?P.match(/[a-zA-Z0-9]/)[0]:"";async function C(P){var E;if(a("complete",P),s.submitFn){try{f.value=!0,a("loading",!0);const k=await s.submitFn(P);a("success",k)}catch(k){console.error("OTP Submit Error",k),m.error("Submit Failed",(k==null?void 0:k.message)||"Unknown error"),a("error",(k==null?void 0:k.message)||"Submit Failed")}finally{f.value=!1,a("loading",!1)}return}if((E=s.endpoint)!=null&&E.apiUrl){if(typeof h!="function"){a("error","useApi() must expose DCodeApi()");return}try{f.value=!0,a("loading",!0);const k=(s.endpoint.apiMethod||"POST").toUpperCase(),$=s.endpoint.apiUrl,I=await h("","",{otp:P},{_url:$,_method:k,withCredentials:!0}),O=(I==null?void 0:I.data)??I;a("success",O)}catch(k){console.error("OTP Submit Error",k),m.error("Submit Failed",(k==null?void 0:k.message)||"Unknown error"),a("error",(k==null?void 0:k.message)||"Submit Failed")}finally{f.value=!1,a("loading",!1)}}}const M=(P,E)=>{d.value[P]=A(E);const k=d.value.join("");a("updateOtp",k),a("update:modelValue",k),k.length===g.value&&C(k)},B=(P,E)=>{const k=P.key,$=/^\d$/.test(k),I=/^[a-zA-Z]$/.test(k);if(k==="Backspace"){if(P.preventDefault(),d.value[E]){M(E,"");return}E>0&&(M(E-1,""),y(E-1));return}if(k==="ArrowLeft"){P.preventDefault(),y(E-1);return}if(k==="ArrowRight"){P.preventDefault(),y(E+1);return}if($||I){P.preventDefault(),M(E,k),E<g.value-1&&y(E+1);return}k.length===1&&P.preventDefault()},N=(P,E)=>{const k=P.target,$=k.value??"",I=A($);k.value=I,M(E,I),I&&E<g.value-1&&y(E+1)},j=(P,E)=>{var q;P.preventDefault();const $=(((q=P.clipboardData)==null?void 0:q.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!$)return;let I=E;for(const X of $){if(I>=g.value)break;d.value[I]=X,I++}const O=d.value.join("");a("updateOtp",O),a("update:modelValue",O),O.length===g.value&&C(O),y(Math.min(I,g.value-1))},W=P=>E=>{c.value[P]=(E==null?void 0:E.$el)??E};return(P,E)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",iG,[s.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.label?(o.openBlock(),o.createElementBlock("div",rG)):o.createCommentVNode("",!0),o.createElementVNode("div",oG,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,k=>(o.openBlock(),o.createElementBlock("div",{key:k,class:"w-12 h-12 rounded-xl bg-gray-200 dark:bg-gray-700 animate-pulse"}))),128))])],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.label||g.value?(o.openBlock(),o.createElementBlock("div",sG,[s.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:r.value,class:"text-sm font-medium text-foreground"},[o.createTextVNode(o.toDisplayString(s.label)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",lG,"*")):o.createCommentVNode("",!0)],8,aG)):(o.openBlock(),o.createElementBlock("label",{key:1,for:r.value,class:"text-sm font-medium text-foreground"}," Enter security code ",8,cG)),o.createElementVNode("p",dG," Type your "+o.toDisplayString(g.value)+"-digit verification code ",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",uG,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,k=>(o.openBlock(),o.createElementBlock("input",{key:k,id:k===1?r.value:void 0,ref_for:!0,ref:W(k-1),value:d.value[k-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:s.disabled||f.value,readonly:s.readonly,class:o.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",d.value[k-1]?"border-blue-500 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300":"border-gray-300 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",l.value?"border-destructive focus:ring-destructive":""]),onKeydown:$=>B($,k-1),onInput:$=>N($,k-1),onPaste:$=>j($,k-1)},null,42,fG))),128))]),l.value?(o.openBlock(),o.createElementBlock("p",hG,o.toDisplayString(s.error),1)):o.createCommentVNode("",!0)],64))],512)),[[o.vShow,e.visible]])}}),mG={key:0,class:"ml-1 text-destructive"},pG={key:1,class:"flex items-center gap-3"},gG={key:0,class:"h-4 w-24 bg-neutral-200 dark:bg-neutral-700 rounded animate-pulse"},yG={key:2,class:"inline-flex items-center gap-3"},bG=["id","name","aria-checked","aria-label","disabled"],vG={key:0,class:"absolute inset-0 flex items-center justify-center"},wG={class:"relative z-10 flex items-center gap-2"},_G=["id","name","aria-checked","aria-label","disabled"],kG={key:0,class:"absolute inset-0 flex items-center justify-center"},xG={key:3,class:"text-xs text-destructive mt-1"},EG={name:"DCodeSwitch"},wg=o.defineComponent({...EG,props:{title:{default:""},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"},modelValue:{type:Boolean,default:!1},label:{default:""},placeholder:{},clearable:{type:Boolean},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,i=t,r=o.computed({get:()=>n.modelValue,set:h=>{!n.disabled&&!n.loading&&(i("update:modelValue",h),i("change",h))}});o.watch(()=>n.modelValue,h=>{h==null&&i("update:modelValue",!1)},{immediate:!0});const s=o.computed(()=>{switch(n.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),a=o.computed(()=>{switch(n.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=o.computed(()=>{switch(n.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=o.computed(()=>{if(n.disabled)return"bg-gray-300";if(n.readonly)return r.value?"bg-blue-400 opacity-80":"bg-gray-200 opacity-80";if(!r.value)return"bg-gray-200";switch(n.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{n.disabled||n.readonly||n.loading||(r.value=!r.value)},f=o.computed(()=>r.value?n.tooltipActiveText:n.tooltipInactiveText);return(h,m)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["grid gap-3",n.disabled?"cursor-not-allowed":""])},[e.title?(o.openBlock(),o.createBlock(gd,{key:0,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",mG,"*")):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),n.skeleton?(o.openBlock(),o.createElementBlock("div",pG,[o.createElementVNode("div",{class:o.normalizeClass([s.value,"bg-neutral-200 dark:bg-neutral-700 rounded-full animate-pulse"])},null,2),e.label?(o.openBlock(),o.createElementBlock("div",gG)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",yG,[o.createVNode(o.unref(td),null,{default:o.withCtx(()=>[e.showTooltip?(o.openBlock(),o.createBlock(o.unref(Vc),{key:0,"delay-duration":200},{default:o.withCtx(()=>[o.createVNode(o.unref(nd),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-default opacity-80":e.readonly&&!e.loading,"cursor-pointer":!e.disabled&&!e.loading&&!e.readonly}]),onClick:d},[o.createElementVNode("span",{class:o.normalizeClass([a.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(o.openBlock(),o.createElementBlock("span",vG,[...m[0]||(m[0]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.X),{key:1,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):o.createCommentVNode("",!0)]),_:1})],2)],10,bG)]),_:1}),o.createVNode(o.unref(ed),{side:"top","side-offset":8,class:o.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:o.withCtx(()=>[o.createElementVNode("span",wG,[o.createElementVNode("span",{class:o.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),o.createTextVNode(" "+o.toDisplayString(f.value),1)])]),_:1},8,["class"])]),_:1})):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-default opacity-80":e.readonly&&!e.loading,"cursor-pointer":!e.disabled&&!e.loading&&!e.readonly}]),onClick:d},[o.createElementVNode("span",{class:o.normalizeClass([a.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(o.openBlock(),o.createElementBlock("span",kG,[...m[1]||(m[1]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.X),{key:1,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):o.createCommentVNode("",!0)]),_:1})],2)],10,_G))]),_:1})])),n.error?(o.openBlock(),o.createElementBlock("p",xG,o.toDisplayString(n.error),1)):o.createCommentVNode("",!0)],2)),[[o.vShow,e.visible]])}}),CG={key:0,class:"ml-1 text-destructive"},SG={key:1,class:"flex gap-2"},AG=["aria-selected","aria-disabled","disabled","onClick"],TG={key:1,class:"truncate"},PG={key:0,class:"truncate"},BG={key:1,class:"truncate"},NG={key:0,class:"truncate"},DG={key:1,class:"rounded-xl border border-dashed border-slate-300 bg-white p-3 text-sm text-slate-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400"},_g=Mn(o.defineComponent({__name:"DCodeSegment",props:{modelValue:{default:""},label:{default:""},title:{default:"Segment"},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},options:{default:()=>[]},id:{default:""},skeleton:{type:Boolean,default:!1},layout:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.ref({width:"0px",transform:"translateX(0px)"}),a=o.computed({get:()=>n.modelValue,set:C=>{n.disabled||n.readonly||(i("update:modelValue",C),i("change",C))}}),l=o.computed(()=>{switch(n.size){case"small":return"px-2.5 py-1 text-xs";case"large":return"px-4 py-2 text-sm";default:return"px-3 py-2 text-sm"}}),c=o.computed(()=>{const C=String(n.color||"primary").trim();return["primary","secondary","accent","destructive","muted","foreground","border","input","ring"].includes(C.toLowerCase())?`hsl(var(--${C.toLowerCase()}))`:C}),d=o.computed(()=>n.disabled?"text-slate-700 dark:text-slate-300":"text-white"),f=o.computed(()=>n.disabled?"text-slate-400 cursor-not-allowed":"text-slate-700 dark:text-slate-200"),h=o.computed(()=>["relative flex w-full overflow-visible rounded-full border border-slate-300 bg-slate-100 shadow-sm dark:border-slate-700 dark:bg-slate-800",n.disabled?"opacity-70 cursor-not-allowed":"",n.readonly&&!n.disabled?"opacity-80":""]),m=o.computed(()=>["flex-1 min-w-0 inline-flex items-center justify-center rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 relative z-10",n.layout==="icon-bottom"&&"flex-col",n.layout==="icon-start"&&"flex-row-reverse",n.layout==="icon-end"&&"flex-row",n.layout==="default"&&"flex-row gap-2",l.value]),g=o.computed(()=>tn),v=o.computed(()=>{switch(n.size){case"small":return"w-3.5 h-3.5";case"large":return"w-5 h-5";default:return"w-4 h-4"}}),y=()=>{if(!r.value)return;const C=r.value.querySelectorAll("button[role='tab']"),M=Array.from(C).find(B=>B.getAttribute("aria-selected")==="true");if(M){const B=M.getBoundingClientRect(),N=r.value.getBoundingClientRect(),j=B.left-N.left,W=B.width;s.value={width:`${W}px`,transform:`translateX(${j}px)`}}};o.watch(()=>a.value,()=>{setTimeout(y,0)}),o.watch(()=>n.options,()=>{setTimeout(y,0)},{deep:!0}),o.onMounted(()=>{setTimeout(y,0),window.addEventListener("resize",y)}),o.onBeforeUnmount(()=>{window.removeEventListener("resize",y)});const A=C=>{n.disabled||n.readonly||C.disabled||(a.value=C.value)};return(C,M)=>{var B;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["grid gap-3",n.disabled?"cursor-not-allowed":""])},[e.title?(o.openBlock(),o.createBlock(gd,{key:0,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",CG,"*")):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),n.skeleton?(o.openBlock(),o.createElementBlock("div",SG,[...M[0]||(M[0]=[o.createElementVNode("div",{class:"h-8 w-20 rounded-full bg-neutral-200 dark:bg-neutral-700 animate-pulse"},null,-1),o.createElementVNode("div",{class:"h-8 w-20 rounded-full bg-neutral-200 dark:bg-neutral-700 animate-pulse"},null,-1)])])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[(B=n.options)!=null&&B.length?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"containerRef",ref:r,class:o.normalizeClass(h.value)},[o.createElementVNode("div",{class:"absolute top-0 left-0 h-full rounded-full transition-all duration-300 ease-out pointer-events-none",style:o.normalizeStyle({width:s.value.width,transform:s.value.transform,backgroundColor:c.value,zIndex:0})},null,4),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.options,N=>(o.openBlock(),o.createElementBlock("button",{key:N.value,type:"button",role:"tab","aria-selected":a.value===N.value?"true":"false","aria-disabled":n.disabled||N.disabled?"true":"false",disabled:n.disabled||N.disabled,class:o.normalizeClass([m.value,N.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer",a.value===N.value?d.value:f.value]),onClick:j=>A(N)},[n.layout==="icon-only"&&N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:0,class:o.normalizeClass(v.value)},null,8,["class"])):n.layout==="default"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:0,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0),N.label?(o.openBlock(),o.createElementBlock("span",TG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0)],64)):n.layout==="icon-bottom"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[N.label?(o.openBlock(),o.createElementBlock("span",PG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0),N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:1,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0)],64)):n.layout==="icon-start"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:0,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0),N.label?(o.openBlock(),o.createElementBlock("span",BG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0)],64)):n.layout==="icon-end"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:4},[N.label?(o.openBlock(),o.createElementBlock("span",NG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0),N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:1,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],10,AG))),128))],2)):(o.openBlock(),o.createElementBlock("div",DG," Tidak ada opsi segment. "))],64))],2)}}}),[["__scopeId","data-v-6dedf537"]]),MG=["aria-busy"],RG={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},IG=["for"],OG={key:0,class:"ml-1 text-destructive"},LG={class:"relative w-full group"},FG=["id","value","placeholder"],$G={key:0,class:"absolute top-1 right-2"},zG={key:1,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},jG={key:1,class:"text-xs text-destructive"},Sd=o.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},label:{},placeholder:{},clearable:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=t,r=e,s=o.computed(()=>n.label??r.label),a=o.computed(()=>n.placeholder??r.placeholder??""),l=o.computed(()=>r.visible??!0),c=Math.random().toString(36).slice(2,7),d=o.computed(()=>`app-textarea-${n.id||s.value||"field"}-${c}`),f=o.computed(()=>{const T=n.required,D=n["aria-required"];return T===""||T===!0||T==="true"||(D==="true"||D===!0)||r.required}),h=o.computed(()=>{const{label:T,class:D,id:Z,required:J,"aria-required":fe,...ae}=n,we={...ae};return r.disabled&&(we.disabled=!0),r.readonly&&(we.readonly=!0),we}),m=o.computed(()=>{const T=n.maxlength;let D=Number.NaN;return typeof T=="number"?D=T:typeof T=="string"&&(D=Number.parseInt(T,10)),Number.isFinite(D)&&D>0?D:-1}),g=T=>m.value>0?T.slice(0,m.value):T,v=o.computed(()=>{const T=r.modelValue;return T==null||String(T).length===0}),y=o.computed(()=>r.clearable?r.hideClearWhenEmpty?!v.value:!0:!1),A=o.ref(String(r.modelValue??""));o.watch(()=>r.modelValue,T=>{const D=String(T??"");D!==A.value&&(A.value=D)});const C=o.ref(!1),M=o.ref(!1),B=T=>T.split(/(\s+)/).map(D=>{if(D.trim()==="")return D;const Z=D.toLowerCase();return Z.charAt(0).toUpperCase()+Z.slice(1)}).join(""),N=T=>{const D=T.toLowerCase(),Z=D.search(new RegExp("\\p{L}","u"));return Z<0?D:D.slice(0,Z)+D.charAt(Z).toUpperCase()+D.slice(Z+1)},j=T=>{const D=T.toLowerCase(),Z=D.search(new RegExp("\\p{L}","u"));return Z<0?D:D.slice(0,Z)+D.charAt(Z).toUpperCase()+D.slice(Z+1)},W=T=>{var D;switch((D=r.textCase)==null?void 0:D.toLowerCase()){case"uppercase":return T.toUpperCase();case"lowercase":return T.toLowerCase();case"titlecase":return B(T);case"capitalize":return j(T);case"sentencecase":return N(T);case"none":default:return T}},P=o.computed(()=>{var T;switch((T=r.textCase)==null?void 0:T.toLowerCase()){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),E=T=>{if(!T)return null;const D=Array.isArray(T)?T.join(""):T;return D?new Set(D):null},k=o.computed(()=>E(r.allowChars)),$=(T,D)=>(T.lastIndex=0,T.test(D)),I=T=>{if(T===`
127
+ `.trim();let r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r)),r.textContent=i}function Pf(e,t=oS){o.watch(e,n=>lW(n,t),{immediate:!0})}const cW=["for"],dW={key:0,class:"ml-1 text-destructive"},uW=["disabled"],fW={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},hW=["id","value","placeholder","disabled","readonly"],mW={key:0,class:"border-r border-gray-200 dark:border-neutral-700 p-2 flex flex-col gap-2 w-32 bg-gray-50/50 dark:bg-neutral-900/50 rounded-l-lg"},pW=["onClick"],gW={class:"px-3 py-3 text-center border-b border-gray-100 dark:border-neutral-800 text-sm text-gray-600 dark:text-gray-400"},yW={key:0},bW={key:1},vW={key:0},wW={key:1},_W={key:2},kW={class:"flex items-center justify-between px-3 pt-3 pb-2 text-primary"},xW={class:"text-center font-bold text-gray-800 dark:text-gray-100 pb-3"},EW={class:"px-2 pb-2"},CW={class:"grid grid-cols-7 mb-2 text-center"},SW=["onClick","onMouseenter"],AW={key:0,class:"text-xs text-destructive mt-1"},eg=o.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},label:{default:""},placeholder:{default:"Pilih tanggal"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},labelPosition:{default:"top"},labelWidth:{default:"150px"}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-datepicker-${n.id||i.label||"date-picker"}-${s}`),l=o.computed(()=>{const Ce=n.required,ne=n["aria-required"];return Ce===""||Ce===!0||Ce==="true"||ne==="true"||ne===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:Ce=>{r("update:modelValue",Ce),r("change",Ce)}}),f=o.computed(()=>i.locale==="en"?Af:zv),h=o.computed(()=>{if(i.disablePast)return on(new Date)}),m=o.computed(()=>{if(i.maxDaysAhead&&i.maxDaysAhead>0)return Aa(xr(new Date,i.maxDaysAhead))}),g=o.ref(!1);let v=null;o.onMounted(()=>{const Ce=document.documentElement,ne=()=>g.value=Ce.classList.contains("dark");ne(),v=new MutationObserver(ne),v.observe(Ce,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{v==null||v.disconnect(),v=null}),Pf(o.toRef(i,"tone"));const y=o.ref(!1),A=o.ref(null),C=o.ref(null),M=o.ref(null),B=o.ref(null),N=o.ref(!1),j=o.ref(""),{floatingStyles:W,isPositioned:P}=Ju(M,C,{strategy:"fixed",placement:o.computed(()=>i.placement||"bottom-start"),whileElementsMounted:Ku,transform:!1,middleware:[Gu(4),Zu({padding:8}),Yu({padding:8})]}),E=o.computed(()=>({...W.value,zIndex:99999,pointerEvents:"auto",visibility:P.value?"visible":"hidden"}));Gn.onClickOutside(A,()=>{y.value&&I()},{ignore:[C]});const k=()=>{i.disabled||i.readonly||(y.value=!0,F())},$=()=>{i.disabled||i.readonly||(y.value?I():k())},I=()=>{y.value=!1},O=Ce=>{if(!Ce)return null;const ne=Os(Ce,i.modelType,new Date);return Hr(ne)?on(ne):null},q=(Ce,ne=i.modelType)=>qo(Ce,ne,{locale:f.value}),X=o.computed(()=>{if(!d.value)return[];if(i.range&&Array.isArray(d.value)){const Ce=O(d.value[0]),ne=O(d.value[1]),ye=[];return Ce&&ye.push(Ce),ne&&ye.push(ne),ye}else if(!i.range&&typeof d.value=="string"){const Ce=O(d.value);return Ce?[Ce]:[]}return[]}),oe=o.computed(()=>i.range?X.value.length===2?`${q(X.value[0],i.displayFormat)} - ${q(X.value[1],i.displayFormat)}`:"":X.value.length===1?q(X.value[0],i.displayFormat):"");o.watch(oe,Ce=>{N.value||(j.value=Ce||"")},{immediate:!0});const ue=Ce=>{if(!Ce||!Ce.trim())return null;const ne=Ce.trim();if(/^\d{8}$/.test(ne)){if(ne.startsWith("19")||ne.startsWith("20"))try{const $e=Os(ne,"yyyyMMdd",new Date);if(Hr($e))return on($e)}catch{}try{const $e=Os(ne,"ddMMyyyy",new Date);if(Hr($e))return on($e)}catch{}}const ye=[i.displayFormat,i.modelType,"dd/MM/yyyy","dd-MM-yyyy","yyyy-MM-dd","yyyy/MM/dd","d/M/yyyy","d-M-yyyy","dd MMMM yyyy","d MMMM yyyy","MMMM dd, yyyy","MMM dd, yyyy"].filter(Boolean),Me=Array.from(new Set(ye));for(const $e of Me)try{const He=Os(ne,$e,new Date,{locale:f.value});if(Hr(He)){const rt=He.getFullYear();if(rt>=1900&&rt<=2100)return on(He)}}catch{}const Ke=new Date(ne);if(Hr(Ke)){const $e=Ke.getFullYear();if($e>=1900&&$e<=2100)return on(Ke)}return null},te=Ce=>{const ne=Ce.split(/\s+-\s+|\s+to\s+|\s*,\s*/);if(ne.length===2){const ye=ue(ne[0]),Me=ue(ne[1]);if(ye&&Me)return qr(ye,Me)?[Me,ye]:[ye,Me]}return null},re=(Ce,ne=!1)=>{const ye=Ce.trim();if(!ye){ne&&(i.clearable?Ie():j.value=oe.value);return}if(i.range){const Me=te(ye);if(Me){const[Ke,$e]=Me;if(K.value=Li(Ke),ne){if(be(Ke)||be($e)){j.value=oe.value;return}let He=$e;if(i.autoRangeDays&&i.autoRangeDays>0){const rt=Aa(xr(Ke,i.autoRangeDays-1));qr(He,rt)&&(He=on(rt))}d.value=[q(Ke),q(He)],we.value=null,j.value=oe.value}}else ne&&(j.value=oe.value)}else{const Me=ue(ye);if(Me){if(K.value=Li(Me),ne){if(be(Me)){j.value=oe.value;return}d.value=q(Me),j.value=oe.value}}else ne&&(j.value=oe.value)}},ge=Ce=>{var ye;if(i.disabled||i.readonly)return;const ne=Ce.target;ne.tagName==="INPUT"||ne.closest("button")||((ye=B.value)==null||ye.focus(),y.value||k())},ce=()=>{i.disabled||i.readonly||(N.value=!0,y.value||k())},se=()=>{i.disabled||i.readonly||y.value||k()},z=()=>{N.value=!1,re(j.value,!0)},G=Ce=>{const ne=Ce.target;j.value=ne.value,re(ne.value,!1)},ee=Ce=>{Ce.key==="Enter"?(Ce.preventDefault(),re(j.value,!0),I()):Ce.key==="Escape"&&(Ce.preventDefault(),j.value=oe.value,I())},K=o.ref(Li(new Date)),Y=o.ref(null),F=()=>{if(X.value.length>0)K.value=Li(X.value[0]);else if(j.value){const Ce=ue(j.value);if(Ce){K.value=Li(Ce);return}K.value=Li(new Date)}else K.value=Li(new Date)},_=()=>{K.value=Vp(K.value,10)},b=()=>{K.value=Vp(K.value,1)},R=()=>{K.value=Qp(K.value)},S=()=>{K.value=Li(new Date)},T=()=>{K.value=yd(K.value,1)},D=()=>{K.value=Sf(K.value,1)},Z=()=>{K.value=Sf(K.value,10)},J=o.computed(()=>qo(K.value,"MMMM yyyy",{locale:f.value})),fe=o.computed(()=>{const Ce=Be(new Date);return Array.from({length:7}).map((ne,ye)=>{const Me=xr(Ce,ye);return{name:qo(Me,"E",{locale:f.value}),isWeekend:Gp(Me)}})}),ae=o.computed(()=>{const Ce=Li(K.value),ne=X2(Ce),ye=Zp(K.value),Me=[],Ke=Qp(K.value),$e=Zp(Ke);for(let Ve=ne-1;Ve>=0;Ve--)Me.push({date:on(new Date(Ke.getFullYear(),Ke.getMonth(),$e-Ve)),isCurrentMonth:!1});for(let Ve=1;Ve<=ye;Ve++)Me.push({date:on(new Date(K.value.getFullYear(),K.value.getMonth(),Ve)),isCurrentMonth:!0});const He=42-Me.length,rt=yd(K.value,1);for(let Ve=1;Ve<=He;Ve++)Me.push({date:on(new Date(rt.getFullYear(),rt.getMonth(),Ve)),isCurrentMonth:!1});return Me}),we=o.ref(null),pe=Ce=>{if(!be(Ce))if(i.range)if(!we.value)we.value=Ce,d.value=null;else{const ne=we.value,ye=Ce;let Me=ne,Ke=ye;if(qr(ne,ye)&&(Me=ye,Ke=ne),i.autoRangeDays&&i.autoRangeDays>0){const $e=Aa(xr(Me,i.autoRangeDays-1));qr(Ke,$e)&&(Ke=on($e))}d.value=[q(Me),q(Ke)],we.value=null,I()}else d.value=q(Ce),I()},ke=Ce=>{Y.value=Ce},be=Ce=>{if(h.value&&Pa(on(Ce),on(h.value))||m.value&&qr(on(Ce),on(m.value)))return!0;if(i.range&&we.value&&i.autoRangeDays&&i.autoRangeDays>0){const ne=on(xr(we.value,i.autoRangeDays-1)),ye=on(tS(we.value,i.autoRangeDays-1));if(qr(on(Ce),ne)||Pa(on(Ce),ye))return!0}return!1},Se=Ce=>{if(i.range){if(X.value.length===2)return Wr(Ce,X.value[0])||Wr(Ce,X.value[1]);if(we.value)return Wr(Ce,we.value)}else if(X.value.length===1)return Wr(Ce,X.value[0]);return!1},ve=Ce=>{if(!i.range)return!1;if(X.value.length===2)return qr(Ce,X.value[0])&&Pa(Ce,X.value[1])||Wr(Ce,X.value[0])||Wr(Ce,X.value[1]);if(we.value&&Y.value){const ne=we.value;let ye=Y.value;if(i.autoRangeDays&&i.autoRangeDays>0){const $e=xr(ne,i.autoRangeDays-1),He=tS(ne,i.autoRangeDays-1);qr(ye,$e)&&(ye=$e),Pa(ye,He)&&(ye=He)}let Me=ne,Ke=ye;return qr(Me,Ke)&&(Me=ye,Ke=ne),qr(Ce,Me)&&Pa(Ce,Ke)||Wr(Ce,Me)||Wr(Ce,Ke)}return!1},Be=Ce=>{const ne=new Date(Ce),ye=ne.getDay(),Me=ne.getDate()-ye;return on(new Date(ne.setDate(Me)))},Ee=Ce=>{const ne=Be(Ce);return Aa(xr(ne,6))},Oe=Ce=>on(Li(Ce)),Ae=Ce=>Aa(new Date(Ce.getFullYear(),Ce.getMonth()+1,0)),Re=o.computed(()=>{if(!i.range)return[];const Ce=new Date,ne=on(Ce),ye=(Me,Ke)=>{let $e=Me;i.disablePast&&Pa($e,ne)&&($e=ne);let He=Ke;if(i.autoRangeDays&&i.autoRangeDays>0){const rt=Aa(xr($e,i.autoRangeDays-1));qr(He,rt)&&(He=rt)}return Pa(He,$e)&&(He=Aa($e)),[$e,He]};return[{label:i.locale==="id"?"Minggu Ini":"This Week",range:ye(Be(Ce),Ee(Ce))},{label:i.locale==="id"?"Bulan Ini":"This Month",range:ye(Oe(Ce),Ae(Ce))}]}),De=Ce=>{Ce.length<2||(d.value=[q(Ce[0]),q(Ce[1])],we.value=null,K.value=Li(Ce[0]),I())},Ie=()=>{d.value=null,we.value=null,j.value="",r("clear")};return(Ce,ne)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full relative",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]]),ref_key:"wrapperRef",ref:A},[e.skeleton?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:"h-4 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{width:"8rem"})},null,4)):o.createCommentVNode("",!0),ne[1]||(ne[1]=o.createElementVNode("div",{class:"h-10 w-full flex-1 rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],2)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",{class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{})},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",dW,"*")):o.createCommentVNode("",!0)],12,cW)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"relative w-full flex-1",ref_key:"inputContainerRef",ref:M},[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",y.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:ge},[o.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.disabled||e.readonly,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer disabled:cursor-not-allowed",onClick:o.withModifiers($,["stop"])},[o.createVNode(o.unref(Ne.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,uW),ne[3]||(ne[3]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",fW,o.toDisplayString(e.prependInner),1),ne[2]||(ne[2]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{ref_key:"inputRef",ref:B,id:a.value,type:"text",value:j.value,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,autocomplete:"off",class:"flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none cursor-text disabled:cursor-not-allowed",onFocus:ce,onBlur:z,onInput:G,onKeydown:ee,onClick:se},null,40,hW),e.clearable&&(d.value||j.value)&&!e.disabled&&!e.readonly?(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",onClick:o.withModifiers(Ie,["stop"]),class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer"},[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"})])):o.createCommentVNode("",!0)],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[y.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:C,"data-dcode-datepicker-popover":"true",style:o.normalizeStyle(E.value),class:"dcode-datepicker-popover pointer-events-auto font-sans bg-white dark:bg-neutral-900 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-xl flex min-w-max max-h-[calc(100vh-24px)] overflow-y-auto"},[e.range&&Re.value.length?(o.openBlock(),o.createElementBlock("div",mW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Re.value,ye=>(o.openBlock(),o.createElementBlock("button",{key:ye.label,type:"button",class:"w-full text-left text-sm px-3 py-2 rounded-md hover:bg-gray-100 dark:hover:bg-neutral-800 transition-colors",onClick:Me=>De(ye.range)},o.toDisplayString(ye.label),9,pW))),128))])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["p-0 flex flex-col w-[300px] select-none bg-white dark:bg-neutral-900",[e.range&&Re.value.length?"rounded-r-lg":"rounded-lg"]])},[o.createElementVNode("div",gW,[X.value.length===0&&!we.value?(o.openBlock(),o.createElementBlock("span",yW,"No date selected")):i.range?(o.openBlock(),o.createElementBlock("span",bW,[we.value?(o.openBlock(),o.createElementBlock("span",vW,o.toDisplayString(q(we.value,"MMM dd, yyyy"))+" - ...",1)):(o.openBlock(),o.createElementBlock("span",wW,o.toDisplayString(q(X.value[0],"MMM dd"))+" - "+o.toDisplayString(q(X.value[1],"MMM dd, yyyy")),1))])):(o.openBlock(),o.createElementBlock("span",_W,o.toDisplayString(q(X.value[0],"MMMM dd, yyyy")),1))]),o.createElementVNode("div",kW,[o.createElementVNode("button",{type:"button",onClick:_,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronFirst),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:b,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronsLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:R,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:S,class:"w-7 h-7 flex items-center justify-center rounded bg-primary/10 dark:bg-primary/20 text-primary hover:bg-primary/20 dark:hover:bg-primary/30 transition-colors focus:outline-none",title:"Hari Ini"},[...ne[4]||(ne[4]=[o.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-current"},null,-1)])]),o.createElementVNode("button",{type:"button",onClick:T,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Berikutnya"},[o.createVNode(o.unref(Ne.ChevronRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:D,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Berikutnya"},[o.createVNode(o.unref(Ne.ChevronsRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:Z,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Berikutnya"},[o.createVNode(o.unref(Ne.ChevronLast),{class:"w-4 h-4"})])]),o.createElementVNode("div",xW,o.toDisplayString(J.value),1),o.createElementVNode("div",EW,[o.createElementVNode("div",CW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(fe.value,ye=>(o.openBlock(),o.createElementBlock("div",{key:ye.name,class:o.normalizeClass(["text-xs font-semibold",ye.isWeekend?"text-red-600 dark:text-red-400":"text-gray-700 dark:text-gray-300"])},o.toDisplayString(ye.name),3))),128))]),o.createElementVNode("div",{class:"grid grid-cols-7 text-center gap-y-0.5",onMouseleave:ne[0]||(ne[0]=ye=>Y.value=null)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ae.value,(ye,Me)=>(o.openBlock(),o.createElementBlock("div",{key:Me,class:o.normalizeClass(["relative w-full h-8 flex items-center justify-center text-sm",[ve(ye.date)?"bg-gray-100 dark:bg-neutral-800":"",be(ye.date)?"opacity-30 cursor-not-allowed":"cursor-pointer"]]),onClick:Ke=>pe(ye.date),onMouseenter:Ke=>ke(ye.date)},[o.createElementVNode("div",{class:o.normalizeClass(["w-7 h-7 flex items-center justify-center rounded-full transition-colors",[Se(ye.date)?"bg-gray-100 text-gray-900 font-bold border border-gray-300 dark:bg-neutral-700 dark:text-white dark:border-neutral-500":ve(ye.date)?"bg-gray-50 dark:bg-neutral-800":o.unref(Wr)(ye.date,new Date)?"font-bold text-blue-600 dark:text-blue-400":"hover:bg-gray-200 dark:hover:bg-neutral-700",ye.isCurrentMonth?Se(ye.date)?"":o.unref(Gp)(ye.date)?"text-red-600 dark:text-red-400 font-medium":"text-gray-700 dark:text-gray-200":"text-gray-400 dark:text-gray-500"]])},o.toDisplayString(o.unref(qo)(ye.date,"d")),3)],42,SW))),128))],32)]),ne[5]||(ne[5]=o.createElementVNode("div",{class:"border-t border-gray-100 dark:border-neutral-800 px-3 py-2 text-xs text-center text-gray-600 dark:text-gray-400 bg-gray-50/50 dark:bg-neutral-900/50 rounded-b-lg"}," Use cursor keys to navigate calendar dates ",-1))],2)],4)):o.createCommentVNode("",!0)]))],512)],2),c.value?(o.openBlock(),o.createElementBlock("p",AW,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),TW={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer"},PW=["for"],BW={key:0,class:"ml-1 text-destructive"},NW={type:"button",tabindex:"-1",class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none pointer-events-none"},DW={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},MW=["id","value","placeholder","disabled","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],RW={class:"flex items-center justify-end gap-2 w-full p-2"},IW=["disabled","onClick"],OW={key:1,class:"text-xs text-destructive"},tg=o.defineComponent({name:"DCodeTimePicker",inheritAttrs:!1,__name:"DCodeTimePicker",props:{modelValue:{},label:{default:""},placeholder:{default:"Pilih waktu"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},displayFormat:{default:"HH:mm"},modelType:{default:"HH:mm"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},is24:{type:Boolean,default:!0},enableSeconds:{type:Boolean,default:!1},minutesIncrement:{default:1}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-timepicker-${n.id||i.label||"time-picker"}-${s}`),l=o.computed(()=>{const B=n.required,N=n["aria-required"];return B===""||B===!0||B==="true"||N==="true"||N===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:B=>{r("update:modelValue",B),r("change",B)}}),f=o.computed(()=>i.displayFormat!=="HH:mm"?i.displayFormat:i.enableSeconds?"HH:mm:ss":"HH:mm"),h=o.computed(()=>i.modelType!=="HH:mm"?i.modelType:i.enableSeconds?"HH:mm:ss":"HH:mm"),m=o.ref(null),g=o.ref(!1),v=()=>{!i.disabled&&m.value&&m.value.toggleMenu()},y=()=>{g.value=!0},A=()=>{g.value=!1},C=o.ref(!1);let M=null;return o.onMounted(()=>{const B=document.documentElement,N=()=>C.value=B.classList.contains("dark");N(),M=new MutationObserver(N),M.observe(B,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{M==null||M.disconnect(),M=null}),Pf(o.toRef(i,"tone")),(B,N)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]])},[e.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.label?(o.openBlock(),o.createElementBlock("div",TW)):o.createCommentVNode("",!0),N[2]||(N[2]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",BW,"*")):o.createCommentVNode("",!0)],8,PW)):o.createCommentVNode("",!0),o.createVNode(o.unref(Z1.VueDatePicker),{ref_key:"dpRef",ref:m,modelValue:d.value,"onUpdate:modelValue":N[1]||(N[1]=j=>d.value=j),dark:C.value,disabled:e.disabled,clearable:!1,"time-picker":"","is-24":e.is24,"enable-seconds":e.enableSeconds,"minutes-increment":e.minutesIncrement,"auto-apply":!0,"model-type":h.value,format:f.value,floating:{placement:e.placement,offset:4,arrow:!1,flip:!0,shift:!0},teleport:!0,"menu-class-name":"dcode-timepicker-menu",onOpen:y,onClose:A},{"dp-input":o.withCtx(({value:j,onInput:W,onEnter:P,onTab:E,onBlur:k,onFocus:$,onKeypress:I,onPaste:O})=>[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600 cursor-pointer",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",g.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:o.withModifiers(v,["stop"])},[o.createElementVNode("button",NW,[o.createVNode(o.unref(Ne.Clock),{class:"w-4 h-4 pointer-events-none"})]),N[4]||(N[4]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",DW,o.toDisplayString(e.prependInner),1),N[3]||(N[3]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:a.value,value:j,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:o.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",e.disabled?"cursor-not-allowed":e.readonly?"cursor-default":"cursor-pointer"]),onFocus:q=>$(),onBlur:q=>k(),onInput:q=>W(q),onKeydown:[o.withKeys(q=>P(q),["enter"]),o.withKeys(q=>E(q),["tab"])],onKeypress:q=>I(q),onPaste:q=>O()},null,42,MW)],2)]),"action-buttons":o.withCtx(({selectDate:j,selectionDisabled:W})=>[o.createElementVNode("div",RW,[o.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:N[0]||(N[0]=P=>{var E;return(E=m.value)==null?void 0:E.closeMenu()})},o.toDisplayString(e.cancelLabel),1),o.createElementVNode("button",{type:"button",disabled:W,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:P=>j()},o.toDisplayString(e.selectLabel),9,IW)])]),_:1},8,["modelValue","dark","disabled","is-24","enable-seconds","minutes-increment","model-type","format","floating"]),c.value?(o.openBlock(),o.createElementBlock("p",OW,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),LW=["for"],FW={key:0,class:"ml-1 text-destructive"},$W=["disabled"],zW={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},jW=["id","value","placeholder","disabled","readonly"],UW={class:"px-3 py-3 text-center border-b border-gray-100 dark:border-neutral-800 text-sm font-medium text-gray-700 dark:text-gray-200 bg-gray-50/50 dark:bg-neutral-900/50 rounded-t-lg"},WW={class:"p-0 flex flex-col select-none"},HW={class:"flex items-center justify-between px-3 pt-3 pb-2 text-primary"},qW={class:"text-center font-bold text-gray-800 dark:text-gray-100 pb-3"},KW={class:"px-2 pb-2 border-b border-gray-100 dark:border-neutral-800"},GW={class:"grid grid-cols-7 mb-2 text-center"},YW={class:"grid grid-cols-7 text-center gap-y-0.5"},ZW=["onClick"],XW={class:"px-4 py-3 flex items-center justify-center gap-2 bg-gray-50/30 dark:bg-neutral-900/30"},JW={class:"flex items-center gap-1 border border-gray-300 dark:border-neutral-700 rounded bg-white dark:bg-neutral-800 focus-within:ring-1 focus-within:ring-primary pl-2 pr-1 py-1"},QW=["value"],VW={class:"flex flex-col"},eH={class:"flex items-center gap-1 border border-gray-300 dark:border-neutral-700 rounded bg-white dark:bg-neutral-800 focus-within:ring-1 focus-within:ring-primary pl-2 pr-1 py-1"},tH=["value"],nH={class:"flex flex-col"},iH={class:"flex items-center gap-1 border border-gray-300 dark:border-neutral-700 rounded bg-white dark:bg-neutral-800 focus-within:ring-1 focus-within:ring-primary pl-2 pr-1 py-1"},rH=["value"],oH={class:"flex flex-col"},sH={class:"px-3 py-2 flex justify-end gap-2 border-t border-gray-100 dark:border-neutral-800 bg-white dark:bg-neutral-900"},aH={key:0,class:"text-xs text-destructive mt-1"},ng=o.defineComponent({name:"DCodeDateTimePicker",inheritAttrs:!1,__name:"DCodeDateTimePicker",props:{modelValue:{},label:{default:""},placeholder:{default:"Pilih tanggal & waktu"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},displayFormat:{default:"dd/MM/yyyy HH:mm"},modelType:{default:"yyyy-MM-dd HH:mm"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},is24:{type:Boolean,default:!0},enableSeconds:{type:Boolean,default:!1},minutesIncrement:{default:1},labelPosition:{default:"top"},labelWidth:{default:"150px"}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-datetimepicker-${n.id||i.label||"datetime-picker"}-${s}`),l=o.computed(()=>{const Fe=n.required,Ue=n["aria-required"];return Fe===""||Fe===!0||Fe==="true"||Ue==="true"||Ue===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:Fe=>{r("update:modelValue",Fe),r("change",Fe)}}),f=o.computed(()=>i.locale==="en"?Af:zv),h=o.computed(()=>{if(i.disablePast)return on(new Date)}),m=o.computed(()=>{if(i.maxDaysAhead&&i.maxDaysAhead>0)return Aa(xr(new Date,i.maxDaysAhead))}),g=o.computed(()=>i.displayFormat!=="dd/MM/yyyy HH:mm"?i.displayFormat:i.enableSeconds?"dd/MM/yyyy HH:mm:ss":"dd/MM/yyyy HH:mm"),v=o.computed(()=>i.modelType!=="yyyy-MM-dd HH:mm"?i.modelType:i.enableSeconds?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd HH:mm"),y=o.ref(!1);let A=null;o.onMounted(()=>{const Fe=document.documentElement,Ue=()=>y.value=Fe.classList.contains("dark");Ue(),A=new MutationObserver(Ue),A.observe(Fe,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{A==null||A.disconnect(),A=null}),Pf(o.toRef(i,"tone"));const C=o.ref(!1),M=o.ref(null),B=o.ref(null),N=o.ref(null),j=o.ref(null),W=o.ref(!1),P=o.ref(""),{floatingStyles:E,isPositioned:k}=Ju(N,B,{strategy:"fixed",placement:o.computed(()=>i.placement||"bottom-start"),whileElementsMounted:Ku,transform:!1,middleware:[Gu(4),Zu({padding:8}),Yu({padding:8})]}),$=o.computed(()=>({...E.value,zIndex:99999,pointerEvents:"auto",visibility:k.value?"visible":"hidden"}));Gn.onClickOutside(M,()=>{C.value&&q()},{ignore:[B]});const I=()=>{i.disabled||i.readonly||(C.value=!0,T())},O=()=>{i.disabled||i.readonly||(C.value?q():I())},q=()=>{C.value=!1},X=Fe=>{if(!Fe)return null;const Ue=Os(Fe,v.value,new Date);return Hr(Ue)?Ue:null},oe=(Fe,Ue=v.value)=>qo(Fe,Ue,{locale:f.value}),ue=o.computed(()=>X(d.value)),te=o.computed(()=>ue.value?oe(ue.value,g.value):"");o.watch(te,Fe=>{W.value||(P.value=Fe||"")},{immediate:!0});const re=Fe=>{if(!Fe||!Fe.trim())return null;const Ue=Fe.trim();if(/^\d{8}$/.test(Ue)){let hn=null;if(Ue.startsWith("19")||Ue.startsWith("20"))try{const Jt=Os(Ue,"yyyyMMdd",new Date);Hr(Jt)&&(hn=Jt)}catch{}if(!hn)try{const Jt=Os(Ue,"ddMMyyyy",new Date);Hr(Jt)&&(hn=Jt)}catch{}if(hn){const Jt=Y.value?Y.value.getHours():0,cn=Y.value?Y.value.getMinutes():0,vn=Y.value?Y.value.getSeconds():0;return new Date(hn.getFullYear(),hn.getMonth(),hn.getDate(),Jt,cn,vn)}}const at=[g.value,v.value,"dd/MM/yyyy HH:mm:ss","dd/MM/yyyy HH:mm","dd-MM-yyyy HH:mm:ss","dd-MM-yyyy HH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd'T'HH:mm:ss","yyyy-MM-dd'T'HH:mm","yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","dd/MM/yyyy hh:mm a","dd/MM/yyyy h:mm a","dd-MM-yyyy hh:mm a","dd-MM-yyyy h:mm a"].filter(Boolean),nt=Array.from(new Set(at));for(const hn of nt)try{const Jt=Os(Ue,hn,new Date,{locale:f.value});if(Hr(Jt)){const cn=Jt.getFullYear();if(cn>=1900&&cn<=2100)return Jt}}catch{}const Tt=["dd/MM/yyyy","dd-MM-yyyy","yyyy-MM-dd","yyyy/MM/dd","d/M/yyyy","d-M-yyyy","dd MMMM yyyy","d MMMM yyyy","MMMM dd, yyyy","MMM dd, yyyy"];for(const hn of Tt)try{const Jt=Os(Ue,hn,new Date,{locale:f.value});if(Hr(Jt)){const cn=Jt.getFullYear();if(cn>=1900&&cn<=2100){const vn=Y.value?Y.value.getHours():0,gr=Y.value?Y.value.getMinutes():0,Do=Y.value?Y.value.getSeconds():0;return new Date(Jt.getFullYear(),Jt.getMonth(),Jt.getDate(),vn,gr,Do)}}}catch{}const fi=new Date(Ue);if(Hr(fi)){const hn=fi.getFullYear();if(hn>=1900&&hn<=2100)return fi}return null},ge=(Fe,Ue=!1)=>{const at=Fe.trim();if(!at){Ue&&(i.clearable?Ae():P.value=te.value);return}const nt=re(at);if(nt){if(Y.value=new Date(nt),F.value=nt.getHours()>=12?"PM":"AM",S.value=Li(nt),Ue){if(Ee(nt)){P.value=te.value;return}d.value=oe(nt),P.value=te.value}}else Ue&&(P.value=te.value)},ce=Fe=>{var at;if(i.disabled||i.readonly)return;const Ue=Fe.target;Ue.tagName==="INPUT"||Ue.closest("button")||((at=j.value)==null||at.focus(),C.value||I())},se=()=>{i.disabled||i.readonly||(W.value=!0,C.value||I())},z=()=>{i.disabled||i.readonly||C.value||I()},G=()=>{W.value=!1,ge(P.value,!0)},ee=Fe=>{const Ue=Fe.target;P.value=Ue.value,ge(Ue.value,!1)},K=Fe=>{Fe.key==="Enter"?(Fe.preventDefault(),ge(P.value,!0),q()):Fe.key==="Escape"&&(Fe.preventDefault(),P.value=te.value,q())},Y=o.ref(new Date),F=o.ref("AM"),_=o.computed({get:()=>{let Fe=Y.value.getHours();return i.is24||(Fe===0?Fe=12:Fe>12&&(Fe-=12)),Fe},set:Fe=>{let Ue=Fe;i.is24||(F.value==="PM"&&Ue<12&&(Ue+=12),F.value==="AM"&&Ue===12&&(Ue=0)),Y.value=$v(Y.value,Ue)}}),b=o.computed({get:()=>Y.value.getMinutes(),set:Fe=>{Y.value=DU(Y.value,Fe)}}),R=o.computed({get:()=>Y.value.getSeconds(),set:Fe=>{Y.value=MU(Y.value,Fe)}});o.watch(F,Fe=>{let Ue=Y.value.getHours();Fe==="PM"&&Ue<12?Y.value=$v(Y.value,Ue+12):Fe==="AM"&&Ue>=12&&(Y.value=$v(Y.value,Ue-12))});const S=o.ref(Li(new Date)),T=()=>{const Fe=ue.value||(P.value?re(P.value):null)||new Date;Y.value=new Date(Fe),F.value=Y.value.getHours()>=12?"PM":"AM",S.value=Li(Y.value)},D=()=>{S.value=Vp(S.value,10)},Z=()=>{S.value=Vp(S.value,1)},J=()=>{S.value=Qp(S.value)},fe=()=>{S.value=Li(new Date)},ae=()=>{S.value=yd(S.value,1)},we=()=>{S.value=Sf(S.value,1)},pe=()=>{S.value=Sf(S.value,10)},ke=o.computed(()=>qo(S.value,"MMMM yyyy",{locale:f.value})),be=o.computed(()=>{const Fe=Oe(new Date);return Array.from({length:7}).map((Ue,at)=>{const nt=xr(Fe,at);return{name:qo(nt,"E",{locale:f.value}),isWeekend:Gp(nt)}})}),Se=o.computed(()=>{const Fe=Li(S.value),Ue=X2(Fe),at=Zp(S.value),nt=[],Tt=Qp(S.value),fi=Zp(Tt);for(let cn=Ue-1;cn>=0;cn--)nt.push({date:on(new Date(Tt.getFullYear(),Tt.getMonth(),fi-cn)),isCurrentMonth:!1});for(let cn=1;cn<=at;cn++)nt.push({date:on(new Date(S.value.getFullYear(),S.value.getMonth(),cn)),isCurrentMonth:!0});const hn=42-nt.length,Jt=yd(S.value,1);for(let cn=1;cn<=hn;cn++)nt.push({date:on(new Date(Jt.getFullYear(),Jt.getMonth(),cn)),isCurrentMonth:!1});return nt}),ve=Fe=>{Ee(Fe)||(Y.value=new Date(Fe.getFullYear(),Fe.getMonth(),Fe.getDate(),Y.value.getHours(),Y.value.getMinutes(),Y.value.getSeconds()))},Be=()=>{d.value=oe(Y.value),P.value=te.value,q()},Ee=Fe=>!!(h.value&&Pa(on(Fe),on(h.value))||m.value&&qr(on(Fe),on(m.value))),Oe=Fe=>{const Ue=new Date(Fe),at=Ue.getDay(),nt=Ue.getDate()-at;return on(new Date(Ue.setDate(nt)))},Ae=()=>{d.value=null,P.value="",r("clear")},Re=()=>{let Fe=_.value;const Ue=i.is24?23:12,at=i.is24?0:1;Fe=Fe>=Ue?at:Fe+1,_.value=Fe},De=()=>{let Fe=_.value;const Ue=i.is24?23:12,at=i.is24?0:1;Fe=Fe<=at?Ue:Fe-1,_.value=Fe},Ie=Fe=>{const Ue=parseInt(Fe.target.value,10);if(!isNaN(Ue)){const at=i.is24?23:12,nt=i.is24?0:1;_.value=Math.max(nt,Math.min(at,Ue))}},Ce=()=>{let Fe=b.value;const Ue=i.minutesIncrement||1;Fe=Fe+Ue>=60?0:Fe+Ue,b.value=Fe},ne=()=>{let Fe=b.value;const Ue=i.minutesIncrement||1;Fe=Fe-Ue<0?60-Ue:Fe-Ue,b.value=Fe},ye=Fe=>{const Ue=parseInt(Fe.target.value,10);isNaN(Ue)||(b.value=Math.max(0,Math.min(59,Ue)))},Me=()=>{let Fe=R.value;Fe=Fe>=59?0:Fe+1,R.value=Fe},Ke=()=>{let Fe=R.value;Fe=Fe<=0?59:Fe-1,R.value=Fe},$e=Fe=>{const Ue=parseInt(Fe.target.value,10);isNaN(Ue)||(R.value=Math.max(0,Math.min(59,Ue)))},He=o.computed(()=>_.value.toString().padStart(2,"0")),rt=o.computed(()=>b.value.toString().padStart(2,"0")),Ve=o.computed(()=>R.value.toString().padStart(2,"0"));return(Fe,Ue)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full relative",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]]),ref_key:"wrapperRef",ref:M},[e.skeleton?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("div",{key:0,class:"h-4 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{width:"8rem"})},null,4)):o.createCommentVNode("",!0),Ue[1]||(Ue[1]=o.createElementVNode("div",{class:"h-10 w-full flex-1 rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],2)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",{class:o.normalizeClass(["flex flex-1 w-full",[i.labelPosition==="left"?"flex-row items-center gap-3":"",i.labelPosition==="right"?"flex-row-reverse items-center gap-3":"",i.labelPosition==="top"?"flex-col gap-1":"",i.labelPosition==="bottom"?"flex-col-reverse gap-1":""]])},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium shrink-0",style:o.normalizeStyle(i.labelPosition==="left"||i.labelPosition==="right"?{width:i.labelWidth}:{})},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",FW,"*")):o.createCommentVNode("",!0)],12,LW)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"relative w-full flex-1",ref_key:"inputContainerRef",ref:N},[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",C.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:ce},[o.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.disabled||e.readonly,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer disabled:cursor-not-allowed",onClick:o.withModifiers(O,["stop"])},[o.createVNode(o.unref(Ne.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,$W),Ue[3]||(Ue[3]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",zW,o.toDisplayString(e.prependInner),1),Ue[2]||(Ue[2]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{ref_key:"inputRef",ref:j,id:a.value,type:"text",value:P.value,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,autocomplete:"off",class:"flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none cursor-text disabled:cursor-not-allowed",onFocus:se,onBlur:G,onInput:ee,onKeydown:K,onClick:z},null,40,jW),e.clearable&&(d.value||P.value)&&!e.disabled&&!e.readonly?(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",onClick:o.withModifiers(Ae,["stop"]),class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none cursor-pointer"},[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"})])):o.createCommentVNode("",!0)],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[C.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:B,"data-dcode-datepicker-popover":"true",style:o.normalizeStyle($.value),class:"dcode-datetimepicker-popover pointer-events-auto font-sans bg-white dark:bg-neutral-900 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-xl flex flex-col min-w-[300px] max-h-[calc(100vh-24px)] overflow-y-auto"},[o.createElementVNode("div",UW,[o.createElementVNode("span",null,o.toDisplayString(oe(Y.value,g.value)),1)]),o.createElementVNode("div",WW,[o.createElementVNode("div",HW,[o.createElementVNode("button",{type:"button",onClick:D,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronFirst),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:Z,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronsLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:J,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Sebelumnya"},[o.createVNode(o.unref(Ne.ChevronLeft),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:fe,class:"w-7 h-7 flex items-center justify-center rounded bg-primary/10 dark:bg-primary/20 text-primary hover:bg-primary/20 dark:hover:bg-primary/30 transition-colors focus:outline-none",title:"Hari Ini"},[...Ue[4]||(Ue[4]=[o.createElementVNode("div",{class:"w-2 h-2 rounded-full bg-current"},null,-1)])]),o.createElementVNode("button",{type:"button",onClick:ae,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Bulan Berikutnya"},[o.createVNode(o.unref(Ne.ChevronRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:we,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Tahun Berikutnya"},[o.createVNode(o.unref(Ne.ChevronsRight),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",onClick:pe,class:"p-1 rounded text-primary/70 hover:text-primary hover:bg-primary/10 dark:hover:bg-primary/20 transition-colors focus:outline-none",title:"Dekade Berikutnya"},[o.createVNode(o.unref(Ne.ChevronLast),{class:"w-4 h-4"})])]),o.createElementVNode("div",qW,o.toDisplayString(ke.value),1),o.createElementVNode("div",KW,[o.createElementVNode("div",GW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(be.value,at=>(o.openBlock(),o.createElementBlock("div",{key:at.name,class:o.normalizeClass(["text-xs font-semibold",at.isWeekend?"text-red-600 dark:text-red-400":"text-gray-700 dark:text-gray-300"])},o.toDisplayString(at.name),3))),128))]),o.createElementVNode("div",YW,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Se.value,(at,nt)=>(o.openBlock(),o.createElementBlock("div",{key:nt,class:o.normalizeClass(["relative w-full h-8 flex items-center justify-center text-sm",[Ee(at.date)?"opacity-30 cursor-not-allowed":"cursor-pointer"]]),onClick:Tt=>ve(at.date)},[o.createElementVNode("div",{class:o.normalizeClass(["w-7 h-7 flex items-center justify-center rounded-full transition-colors",[o.unref(Wr)(at.date,Y.value)?"bg-gray-100 text-gray-900 font-bold border border-gray-300 dark:bg-neutral-700 dark:text-white dark:border-neutral-500":o.unref(Wr)(at.date,new Date)?"font-bold text-blue-600 dark:text-blue-400":"hover:bg-gray-200 dark:hover:bg-neutral-700",at.isCurrentMonth?o.unref(Wr)(at.date,Y.value)?"":o.unref(Gp)(at.date)?"text-red-600 dark:text-red-400 font-medium":"text-gray-700 dark:text-gray-200":"text-gray-400 dark:text-gray-500"]])},o.toDisplayString(o.unref(qo)(at.date,"d")),3)],10,ZW))),128))])]),o.createElementVNode("div",XW,[o.createVNode(o.unref(Ne.Clock),{class:"w-4 h-4 text-gray-500 mr-2"}),o.createElementVNode("div",JW,[o.createElementVNode("input",{value:He.value,onChange:Ie,type:"text",class:"w-6 text-center bg-transparent text-sm outline-none text-gray-800 dark:text-gray-200",maxlength:"2"},null,40,QW),o.createElementVNode("div",VW,[o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Re,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronUp),{class:"w-3 h-3"})]),o.createElementVNode("button",{type:"button",onClick:o.withModifiers(De,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"w-3 h-3"})])])]),Ue[6]||(Ue[6]=o.createElementVNode("span",{class:"font-bold text-gray-500 dark:text-gray-400"},":",-1)),o.createElementVNode("div",eH,[o.createElementVNode("input",{value:rt.value,onChange:ye,type:"text",class:"w-6 text-center bg-transparent text-sm outline-none text-gray-800 dark:text-gray-200",maxlength:"2"},null,40,tH),o.createElementVNode("div",nH,[o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Ce,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronUp),{class:"w-3 h-3"})]),o.createElementVNode("button",{type:"button",onClick:o.withModifiers(ne,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"w-3 h-3"})])])]),e.enableSeconds?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[Ue[5]||(Ue[5]=o.createElementVNode("span",{class:"font-bold text-gray-500 dark:text-gray-400"},":",-1)),o.createElementVNode("div",iH,[o.createElementVNode("input",{value:Ve.value,onChange:$e,type:"text",class:"w-6 text-center bg-transparent text-sm outline-none text-gray-800 dark:text-gray-200",maxlength:"2"},null,40,rH),o.createElementVNode("div",oH,[o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Me,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronUp),{class:"w-3 h-3"})]),o.createElementVNode("button",{type:"button",onClick:o.withModifiers(Ke,["stop"]),class:"text-gray-400 hover:text-primary focus:outline-none leading-none flex items-center justify-center h-3"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"w-3 h-3"})])])])],64)):o.createCommentVNode("",!0),e.is24?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",onClick:Ue[0]||(Ue[0]=o.withModifiers(at=>F.value=F.value==="AM"?"PM":"AM",["stop"])),class:"bg-white dark:bg-neutral-800 border border-gray-300 dark:border-neutral-700 rounded text-sm px-2 py-1 outline-none hover:border-primary hover:text-primary focus:ring-1 focus:ring-primary text-gray-800 dark:text-gray-200 font-medium transition-colors ml-1"},o.toDisplayString(F.value),1))]),o.createElementVNode("div",sH,[o.createElementVNode("button",{type:"button",onClick:q,class:"px-3 py-1.5 text-sm font-medium rounded-md hover:bg-gray-100 dark:hover:bg-neutral-800 text-gray-700 dark:text-gray-300 transition-colors"},o.toDisplayString(e.cancelLabel),1),o.createElementVNode("button",{type:"button",onClick:Be,class:"px-3 py-1.5 text-sm font-medium rounded-md bg-primary text-white hover:bg-primary/90 transition-colors"},o.toDisplayString(e.selectLabel),1)]),Ue[7]||(Ue[7]=o.createElementVNode("div",{class:"border-t border-gray-100 dark:border-neutral-800 px-3 py-1.5 text-xs text-center text-gray-600 dark:text-gray-400 bg-gray-50/50 dark:bg-neutral-900/50 rounded-b-lg"}," Use cursor keys to navigate calendar dates ",-1))])],4)):o.createCommentVNode("",!0)]))],512)],2),c.value?(o.openBlock(),o.createElementBlock("p",aH,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),lH={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},cH=["for"],dH={key:0,class:"ml-1 text-destructive"},uH={class:"relative w-full"},fH={type:"button",tabindex:"-1",class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none pointer-events-none"},hH={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},mH=["id","value","placeholder","disabled"],pH={key:1,class:"text-xs text-destructive mt-1"},sS=o.defineComponent({name:"DCodeMonthPicker",inheritAttrs:!1,__name:"DCodeMonthPicker",props:{modelValue:{},label:{},placeholder:{default:"Pilih bulan"},clearable:{type:Boolean,default:!0},required:{type:Boolean},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!0},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},displayFormat:{default:"MM/yyyy"},modelType:{default:"yyyy-MM"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"}},emits:["update:modelValue","change","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-monthpicker-${n.id||i.label||"month-picker"}-${s}`),l=o.computed(()=>{if(i.required)return!0;const M=n.required,B=n["aria-required"];return M===""||M===!0||M==="true"||B==="true"||B===!0}),c=o.computed(()=>!!i.error),d=o.computed({get:()=>i.modelValue,set:M=>{r("update:modelValue",M),r("change",M)}}),f=o.ref(!1),h=o.ref(!1);let m=null;o.onMounted(()=>{const M=document.documentElement,B=()=>f.value=M.classList.contains("dark");B(),m=new MutationObserver(B),m.observe(M,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{m==null||m.disconnect(),m=null});const g=o.computed(()=>i.locale==="id"?zv:Af);Pf(o.toRef(i,"tone"));const v=o.ref(null),y=o.ref(null),A=()=>{!i.disabled&&v.value&&v.value.toggleMenu()},C=M=>{y.value&&!y.value.contains(M.target)&&(h.value=!1)};return o.onMounted(()=>{window.addEventListener("click",C)}),o.onBeforeUnmount(()=>{window.removeEventListener("click",C)}),o.watch(d,()=>{h.value=!1}),(M,B)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"componentRef",ref:y,class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]])},[e.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.label?(o.openBlock(),o.createElementBlock("div",lH)):o.createCommentVNode("",!0),B[3]||(B[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",dH,"*")):o.createCommentVNode("",!0)],8,cH)):o.createCommentVNode("",!0),o.createElementVNode("div",uH,[o.createVNode(o.unref(Z1.VueDatePicker),{ref_key:"dpRef",ref:v,modelValue:d.value,"onUpdate:modelValue":B[0]||(B[0]=N=>d.value=N),dark:f.value,"month-picker":"",disabled:e.disabled,clearable:!1,"auto-apply":!0,locale:g.value,"model-type":e.modelType,formats:{input:e.displayFormat},floating:{placement:e.placement,offset:4,arrow:!1,flip:!0,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onOpen:B[1]||(B[1]=N=>h.value=!0),onClose:B[2]||(B[2]=N=>h.value=!1)},{"dp-input":o.withCtx(({value:N})=>[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-primary dark:focus-within:ring-primary-600 focus-within:border-primary dark:focus-within:border-primary-600 cursor-pointer",[c.value?"border-destructive":"",e.disabled?"opacity-50 cursor-not-allowed":"",e.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":"",h.value?"border-neutral-400 ring-1 ring-primary dark:border-primary-600 dark:ring-neutral-600":""]]),onClick:o.withModifiers(A,["stop"])},[o.createElementVNode("button",fH,[o.createVNode(o.unref(Ne.Calendar),{class:"w-4 h-4"})]),B[5]||(B[5]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",hH,o.toDisplayString(e.prependInner),1),B[4]||(B[4]=o.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:a.value,value:N,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:o.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none cursor-pointer pointer-events-none",e.disabled?"cursor-not-allowed":e.readonly?"cursor-default":"cursor-pointer"])},null,10,mH)],2)]),_:1},8,["modelValue","dark","disabled","locale","model-type","formats","floating"])]),c.value?(o.openBlock(),o.createElementBlock("p",pH,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2)),[[o.vShow,e.visible]])}}),gH={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer"},yH=["for"],bH={key:0,class:"ml-1 text-destructive"},vH={class:"w-full"},wH={class:"flex flex-col gap-2"},_H={class:"flex gap-3 items-center flex-wrap"},kH=["title","onClick"],xH=["disabled","title","aria-label"],EH={class:"mb-4"},CH={class:"mb-4"},SH={class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"},AH={class:"mb-4"},TH={class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"},PH={class:"mb-4"},BH={class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"},NH={key:0,class:"mb-4 pb-4 border-b border-gray-200 dark:border-neutral-700"},DH={class:"flex gap-2 flex-wrap"},MH=["title","onClick"],RH={class:"flex items-center gap-2"},IH=["value"],OH={key:1,class:"text-xs text-destructive"},aS=Mn(o.defineComponent({name:"DCodeColorPicker",inheritAttrs:!1,__name:"DCodeColorPicker",props:{modelValue:{},placeholder:{default:"Select a color"},label:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},error:{default:null},tone:{default:"primary"},skeleton:{type:Boolean,default:!1},required:{type:Boolean,default:!1},showPicker:{type:Boolean,default:!0},hidePicker:{type:Boolean,default:!1},fetchOptions:{},options:{},valueKey:{default:"color"},labelKey:{default:"name"},colorKey:{default:"color"},useClassForColor:{type:Boolean,default:!1},classPrefix:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,s=Math.random().toString(36).slice(2,7),a=o.computed(()=>`dcode-colorpicker-${n.id||i.label||"color-picker"}-${s}`),l=o.computed(()=>{const S=n.required,T=n["aria-required"];return S===""||S===!0||S==="true"||T==="true"||T===!0||i.required}),c=o.computed(()=>!!i.error),d=o.computed(()=>i.showPicker&&!i.hidePicker),f=o.computed({get:()=>i.modelValue||"",set:S=>{r("update:modelValue",S||null),r("change",S||null)}}),h=[{name:"primary",color:"#2563EB"},{name:"emerald",color:"#16A34A"},{name:"amber",color:"#D97706"},{name:"violet",color:"#7C3AED"},{name:"destructive",color:"#DC2626"}],m=o.ref([]),g=o.ref(!1),v=o.computed(()=>i.options&&i.options.length>0?i.options:m.value&&m.value.length>0?m.value:h),y=o.computed(()=>v.value.map(S=>({original:S,_value:S[i.valueKey]!==void 0?S[i.valueKey]:S.color,_label:S[i.labelKey]!==void 0?S[i.labelKey]:S.name,_color:S[i.colorKey]!==void 0?S[i.colorKey]:S.color}))),A=o.computed(()=>y.value.find(S=>S._value===f.value)),C=o.ref(!1),M=o.ref(!1),B=o.ref(null),N=o.ref(null),j=o.ref(null),W=o.ref(null),P=o.ref(0),E=o.ref(100),k=o.ref(50);let $=null,I=null,O=null;const q=o.ref(!1);let X=(S,T)=>T||S;try{const S=Yn.useI18n&&Yn.useI18n();S&&S.t&&(X=S.t)}catch(S){console.error(S)}const oe=()=>{if(!W.value||!j.value)return;const S=W.value.getBoundingClientRect(),T=j.value.getBoundingClientRect(),D={width:window.innerWidth,height:window.innerHeight},Z=12,J=8;let fe=S.bottom+Z,ae=S.left;if(!(fe+T.height+J<=D.height)){const ke=S.top-T.height-Z;ke>=J?fe=ke:fe=D.height-T.height-J}ae+T.width+J>D.width&&(ae=S.right-T.width,ae-J<0&&(ae=J)),j.value.style.left=Math.max(J,ae)+"px",j.value.style.top=fe+"px"};o.onMounted(async()=>{const S=document.documentElement,T=()=>M.value=S.classList.contains("dark");if(T(),$=new MutationObserver(T),$.observe(S,{attributes:!0,attributeFilter:["class"]}),i.fetchOptions){g.value=!0;try{const D=await i.fetchOptions();D&&typeof D=="object"&&!Array.isArray(D)&&Array.isArray(D.data)?m.value=D.data:Array.isArray(D)?m.value=D:m.value=[]}catch(D){console.error(D),m.value=[]}finally{g.value=!1}}}),o.onBeforeUnmount(()=>{$==null||$.disconnect(),$=null,I&&(document.removeEventListener("click",I),I=null),O&&(window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),O=null)}),Pf(o.toRef(i,"tone"));const ue=S=>{const T=S.replace("#",""),D=parseInt(T.slice(0,2),16)/255,Z=parseInt(T.slice(2,4),16)/255,J=parseInt(T.slice(4,6),16)/255,fe=Math.max(D,Z,J),ae=Math.min(D,Z,J);let we=0,pe=0;const ke=(fe+ae)/2;if(fe!==ae){const be=fe-ae;pe=ke>.5?be/(2-fe-ae):be/(fe+ae),fe===D?we=((Z-J)/be+(Z<J?6:0))/6:fe===Z?we=((J-D)/be+2)/6:we=((D-Z)/be+4)/6}return{h:Math.round(we*360),s:Math.round(pe*100),l:Math.round(ke*100)}},te=(S,T,D)=>{const Z=(1-Math.abs(2*D/100-1))*T/100,J=Z*(1-Math.abs(S/60%2-1)),fe=D/100-Z/2;let ae=0,we=0,pe=0;S>=0&&S<60?(ae=Z,we=J):S>=60&&S<120?(ae=J,we=Z):S>=120&&S<180?(we=Z,pe=J):S>=180&&S<240?(we=J,pe=Z):S>=240&&S<300?(ae=J,pe=Z):S>=300&&S<360&&(ae=Z,pe=J);const ke=be=>{const Se=Math.round((be+fe)*255).toString(16);return Se.length===1?"0"+Se:Se};return`#${ke(ae)}${ke(we)}${ke(pe)}`.toUpperCase()},re=()=>{if(!B.value)return;const S=B.value,T=S.getContext("2d");if(!T)return;const D=S.width,Z=S.height;for(let J=0;J<D;J++){const fe=J/D*100;for(let ae=0;ae<Z;ae++){const we=100-ae/Z*100,pe=`hsl(${P.value}, ${fe}%, ${we}%)`;T.fillStyle=pe,T.fillRect(J,ae,1,1)}}try{const J=Math.round(E.value/100*D),fe=Math.round((1-k.value/100)*Z);T.beginPath(),T.strokeStyle="#ffffff",T.lineWidth=3,T.arc(J,fe,7,0,Math.PI*2),T.stroke(),T.beginPath(),T.strokeStyle="#000000",T.lineWidth=1,T.arc(J,fe,7,0,Math.PI*2),T.stroke()}catch(J){console.error("drawSpectrum error",J)}};let ge=!1;const ce=S=>{const T=B.value;if(!T)return null;const D=T.getBoundingClientRect(),Z=S.clientX??S.clientX,J=S.clientY??S.clientY,fe=Math.max(0,Math.min(D.width,Z-D.left)),ae=Math.max(0,Math.min(D.height,J-D.top)),we=Math.round(fe/D.width*T.width),pe=Math.round(ae/D.height*T.height);return{x:we,y:pe,width:T.width,height:T.height}},se=S=>{ge=!0;const T=S.touches?S.touches[0]:S,D=ce(T);D&&(E.value=Math.max(0,Math.min(100,Math.round(D.x/D.width*100))),k.value=Math.max(0,Math.min(100,Math.round((1-D.y/D.height)*100))),f.value=te(P.value,E.value,k.value),re())},z=S=>{if(!ge)return;const T=S.touches?S.touches[0]:S,D=ce(T);D&&(E.value=Math.max(0,Math.min(100,Math.round(D.x/D.width*100))),k.value=Math.max(0,Math.min(100,Math.round((1-D.y/D.height)*100))),f.value=te(P.value,E.value,k.value),re())},G=()=>{ge=!1},ee=async()=>{if(!i.disabled&&d.value)if(C.value=!C.value,C.value){if(f.value){const S=ue(f.value);P.value=S.h,E.value=S.s,k.value=S.l}await o.nextTick(),re(),await new Promise(S=>setTimeout(S,0)),oe(),I=S=>{const T=S.target;j.value&&W.value&&!j.value.contains(T)&&!W.value.contains(T)&&(C.value=!1,I&&document.removeEventListener("click",I))},O=()=>oe(),document.addEventListener("click",I),window.addEventListener("scroll",O,!0),window.addEventListener("resize",O)}else I&&(document.removeEventListener("click",I),I=null),O&&(window.removeEventListener("scroll",O,!0),window.removeEventListener("resize",O),O=null)},K=async(S,T)=>{f.value=S;const D=T||S;if(D&&D.toString().startsWith("#")){const Z=ue(D);P.value=Z.h,E.value=Z.s,k.value=Z.l}d.value&&C.value&&(await o.nextTick(),re())},Y=()=>{const S=te(P.value,E.value,k.value);f.value=S,re()},F=()=>{const S=te(P.value,E.value,k.value);f.value=S},_=()=>{const S=te(P.value,E.value,k.value);f.value=S},b=S=>{let D=S.target.value.toUpperCase();if(D.startsWith("#")||(D="#"+D),/^#[0-9A-F]{6}$/.test(D)){f.value=D;const Z=ue(D);P.value=Z.h,E.value=Z.s,k.value=Z.l}},R=o.computed(()=>f.value?f.value:M.value?"#1f2937":"#f3f4f6");return(S,T)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,i.disabled?"cursor-not-allowed":""]])},[e.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[e.label?(o.openBlock(),o.createElementBlock("div",gH)):o.createCommentVNode("",!0),T[4]||(T[4]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(e.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",bH,"*")):o.createCommentVNode("",!0)],8,yH)):o.createCommentVNode("",!0),o.createElementVNode("div",vH,[o.createElementVNode("div",wH,[o.createElementVNode("div",_H,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(y.value,D=>(o.openBlock(),o.createElementBlock("button",{key:D._value,type:"button",class:o.normalizeClass(["w-12 h-12 shrink-0 rounded-lg border-2 flex items-center justify-center transition-all duration-200 focus:outline-none",[f.value===D._value?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-900 ring-primary border-primary scale-110 shadow-lg z-10":"border-gray-300 dark:border-gray-600 hover:scale-105 opacity-90 hover:opacity-100",i.useClassForColor&&D._color?`${i.classPrefix}${D._color.toLowerCase()}`:""]]),style:o.normalizeStyle(i.useClassForColor?{}:{backgroundColor:D._color}),title:D._label,onClick:Z=>K(D._value,D._color)},[f.value===D._value?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:"w-6 h-6 stroke-[3] text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"})):o.createCommentVNode("",!0)],14,kH))),128)),d.value?(o.openBlock(),o.createElementBlock("button",{key:0,ref_key:"buttonRef",ref:W,type:"button",class:o.normalizeClass(["w-12 h-12 shrink-0 rounded-lg border-2 flex items-center justify-center transition-all duration-200",[i.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer hover:scale-105",!A.value&&f.value?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-900 ring-primary border-primary scale-110 shadow-lg z-10":"border-gray-300 dark:border-gray-600 opacity-90 hover:opacity-100",i.useClassForColor&&A.value&&A.value._color?`${i.classPrefix}${A.value._color.toLowerCase()}`:""]]),style:o.normalizeStyle(!i.useClassForColor||!A.value?{backgroundColor:R.value}:{}),disabled:i.disabled,onClick:ee,title:o.unref(X)("pickColor","Pick color"),"aria-label":o.unref(X)("pickColor","Pick color")},[!A.value&&f.value?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:"w-6 h-6 stroke-[3] text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"})):(o.openBlock(),o.createBlock(o.unref(Ne.Edit),{key:1,class:"w-5 h-5 text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"}))],14,xH)):o.createCommentVNode("",!0)])]),o.createVNode(o.Transition,{"enter-active-class":"transition ease-out duration-150","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"transition ease-in duration-100","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:o.withCtx(()=>[d.value&&C.value&&!i.disabled?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"panelRef",ref:j,class:"fixed w-80 p-4 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700 rounded-lg shadow-2xl",style:{"z-index":"99999"},onClick:T[3]||(T[3]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("div",EH,[T[5]||(T[5]=o.createElementVNode("label",{class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"}," Color Spectrum ",-1)),o.createElementVNode("canvas",{ref_key:"spectrumCanvasRef",ref:B,class:"w-full h-40 rounded border border-gray-300 dark:border-neutral-600 cursor-crosshair",width:"300",height:"160",onMousedown:o.withModifiers(se,["prevent"]),onMousemove:o.withModifiers(z,["prevent"]),onMouseup:o.withModifiers(G,["prevent"]),onMouseleave:o.withModifiers(G,["prevent"]),onTouchstartPassive:o.withModifiers(se,["prevent"]),onTouchmovePassive:o.withModifiers(z,["prevent"]),onTouchend:o.withModifiers(G,["prevent"])},null,544)]),o.createElementVNode("div",CH,[o.createElementVNode("label",SH," Hue: "+o.toDisplayString(P.value)+"° ",1),o.withDirectives(o.createElementVNode("input",{ref_key:"hueRef",ref:N,"onUpdate:modelValue":T[0]||(T[0]=D=>P.value=D),type:"range",min:"0",max:"360",class:"w-full h-2 rounded-lg appearance-none cursor-pointer hue-slider",onInput:Y},null,544),[[o.vModelText,P.value]])]),o.createElementVNode("div",AH,[o.createElementVNode("label",TH," Saturation: "+o.toDisplayString(E.value)+"% ",1),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":T[1]||(T[1]=D=>E.value=D),type:"range",min:"0",max:"100",class:"w-full h-2 rounded-lg appearance-none cursor-pointer",style:o.normalizeStyle(`background: linear-gradient(to right, hsl(${P.value}, 0%, ${k.value}%), hsl(${P.value}, 100%, ${k.value}%))`),onInput:F},null,36),[[o.vModelText,E.value]])]),o.createElementVNode("div",PH,[o.createElementVNode("label",BH," Lightness: "+o.toDisplayString(k.value)+"% ",1),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":T[2]||(T[2]=D=>k.value=D),type:"range",min:"0",max:"100",class:"w-full h-2 bg-gradient-to-r from-black via-gray-500 to-white rounded-lg appearance-none cursor-pointer",onInput:_},null,544),[[o.vModelText,k.value]])]),q.value?(o.openBlock(),o.createElementBlock("div",NH,[T[6]||(T[6]=o.createElementVNode("p",{class:"text-xs font-semibold text-gray-600 dark:text-gray-400 mb-2 uppercase"}," General Colors ",-1)),o.createElementVNode("div",DH,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(y.value,D=>(o.openBlock(),o.createElementBlock("button",{key:D._value,type:"button",class:o.normalizeClass(["w-12 h-12 rounded-lg border-2 flex items-center justify-center transition-all duration-200 focus:outline-none",[f.value===D._value?"ring-2 ring-offset-2 ring-offset-white dark:ring-offset-neutral-800 ring-primary border-primary scale-110 shadow-lg z-10":"border-gray-300 dark:border-gray-600 hover:scale-105 opacity-90 hover:opacity-100",i.useClassForColor&&D._color?`${i.classPrefix}${D._color.toLowerCase()}`:""]]),style:o.normalizeStyle(i.useClassForColor?{}:{backgroundColor:D._color}),title:D._label,onClick:Z=>K(D._value,D._color)},[f.value===D._value?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:"w-6 h-6 stroke-[3] text-white drop-shadow-[0_1px_2px_rgba(0,0,0,0.8)]"})):o.createCommentVNode("",!0)],14,MH))),128))])])):o.createCommentVNode("",!0),o.createElementVNode("div",null,[T[8]||(T[8]=o.createElementVNode("label",{class:"text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase mb-2 block"}," Hex Value ",-1)),o.createElementVNode("div",RH,[T[7]||(T[7]=o.createElementVNode("span",{class:"text-gray-500 dark:text-gray-400 font-semibold"},"#",-1)),o.createElementVNode("input",{value:f.value.replace("#","").toUpperCase(),type:"text",maxlength:"6",placeholder:"000000",class:"flex-1 px-2 py-1 border border-gray-300 dark:border-neutral-600 rounded bg-white dark:bg-neutral-700 text-sm focus:outline-none focus:ring-1 focus:ring-primary font-mono",onInput:b},null,40,IH)])])],512)):o.createCommentVNode("",!0)]),_:1})]),c.value?(o.openBlock(),o.createElementBlock("p",OH,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],2))}}),[["__scopeId","data-v-02c0b86d"]]),LH=o.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean},unmountOnHide:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const n=e,i=t,r=kt.useForwardPropsEmits(n,i);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),FH=o.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const n=e,i=t,r=Gn.reactiveOmit(n,"class"),s=kt.useForwardPropsEmits(r,i);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(kt.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),o.createVNode(o.unref(kt.DialogContent),o.mergeProps({...o.unref(s),...a.$attrs},{class:o.unref(nn)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default"),o.createVNode(o.unref(kt.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"}),l[0]||(l[0]=o.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),lS=o.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogDescription),o.mergeProps(o.unref(i),{class:o.unref(nn)("text-sm text-muted-foreground",t.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),$H=o.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.DialogTitle),o.mergeProps(o.unref(i),{class:o.unref(nn)("text-lg font-medium leading-none tracking-tight",t.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),zH={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-gray-300 dark:border-neutral-600 bg-gray-200 dark:bg-neutral-700/60 sticky top-0 z-20"},jH={class:"flex items-center gap-3"},UH={class:"flex flex-col"},WH={key:0,class:"flex items-center"},HH={key:1,class:"px-6 py-4 border-t border-neutral-200/60 dark:border-neutral-700/50 bg-neutral-50/50 dark:bg-neutral-900/30 sticky bottom-0 z-20"},qH={class:"flex justify-end gap-3 flex-wrap"},Yo=Mn(o.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:void 0},size:{default:"sm"},persistent:{type:Boolean,default:!0},description:{default:""},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r=o.useAttrs(),s=o.computed(()=>{const{style:d,...f}=r;return f}),a=o.computed(()=>{const d={xs:"400px",sm:"500px",md:"700px",lg:"900px",xl:"1100px","2xl":"1300px",full:"95vw"};let f=n.maxWidth||d[n.size||"sm"]||"500px";return typeof f=="number"?f=`${f}px`:typeof f=="string"&&/^\d+$/.test(f)&&(f=`${f}px`),{width:f,maxWidth:"95vw",margin:"0 auto"}}),l=o.computed(()=>n.icon?tn[n.icon]??null:null),c=d=>{i("update:modelValue",d)};return(d,f)=>(o.openBlock(),o.createBlock(o.unref(LH),{open:e.modelValue,"onUpdate:open":c},{default:o.withCtx(()=>[o.createVNode(o.unref(FH),o.mergeProps(s.value,{style:a.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0 max-w-none",onInteractOutside:f[0]||(f[0]=h=>e.persistent?h.preventDefault():null),onEscapeKeyDown:f[1]||(f[1]=h=>e.persistent?h.preventDefault():null)}),{default:o.withCtx(()=>[e.title||d.$slots["header-append"]?(o.openBlock(),o.createElementBlock("div",zH,[o.createElementVNode("div",jH,[l.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["p-2 rounded-lg",e.iconClass||"bg-primary/10 text-primary"])},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):o.createCommentVNode("",!0),o.createElementVNode("div",UH,[o.createVNode(o.unref($H),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1}),e.description?(o.openBlock(),o.createBlock(o.unref(lS),{key:0,class:"text-sm text-neutral-500 dark:text-neutral-400 mt-0.5"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.description),1)]),_:1})):(o.openBlock(),o.createBlock(o.unref(lS),{key:1,class:"hidden"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title||"Dialog Content"),1)]),_:1}))])]),d.$slots["header-append"]?(o.openBlock(),o.createElementBlock("div",WH,[o.renderSlot(d.$slots,"header-append",{},void 0,!0)])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",e.contentClass]),style:o.normalizeStyle(e.contentStyle)},[o.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(o.openBlock(),o.createElementBlock("div",HH,[o.createElementVNode("div",qH,[o.renderSlot(d.$slots,"actions",{},void 0,!0)])])):o.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-556446ca"]]),jl=o.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(e){const t=o.useAttrs(),n=e,i=o.computed(()=>Es(n.icon,tn)),r=o.computed(()=>n.textSize?`text-${n.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},a=o.computed(()=>s[n.textSize??"xs"]??"w-3 h-3"),l=o.computed(()=>n.textType==="BOLD"?"font-bold":n.textType==="ITALIC"?"italic font-normal":"font-normal"),c=o.computed(()=>{const f=`${r.value} ${l.value} text-zinc-700 dark:text-zinc-400 ml-1 inline-flex items-center gap-1`,h=t.class??"";return[f,h].filter(Boolean).join(" ")}),d=o.computed(()=>{const{class:f,...h}=t;return h});return(f,h)=>(o.openBlock(),o.createElementBlock("span",o.mergeProps({class:c.value},d.value),[i.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.value),{key:0,class:o.normalizeClass(["shrink-0",a.value,e.iconClass])},null,8,["class"])):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.label||e.text),1)],16))}}),jv=o.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)(o.unref(KH)({variant:e.variant}),t.class)),role:"alert"},[o.renderSlot(n.$slots,"default")],2))}}),Uv=o.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("text-sm [&_p]:leading-relaxed",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),KH=Vm("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}});function ig(){const e=s=>{var c;const a={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:a,bubbles:!0,composed:!0})),(a.type==="error"?console.error:a.type==="warning"?console.warn:console.log)(`[Toast][${(c=a.type)==null?void 0:c.toUpperCase()}]`,a.title||"",a.message)};return{show:e,success:(s,a)=>e({type:"success",message:s,title:a}),error:(s,a)=>e({type:"error",message:s,title:a}),warning:(s,a)=>e({type:"warning",message:s,title:a}),info:(s,a)=>e({type:"info",message:s,title:a})}}const Wv={xlsx:"FileSpreadsheet",xls:"FileSpreadsheet",csv:"FileSpreadsheet",pdf:"FileText",doc:"FileText",docx:"FileText",txt:"FileText",json:"FileJson",xml:"FileCode",html:"FileCode",zip:"FileArchive",rar:"FileArchive",jpg:"FileImage",jpeg:"FileImage",png:"FileImage",gif:"FileImage",default:"Download"},Zo={label:{ID:"Unduh Template",EN:"Download Template",KR:"템플릿 다운로드"},title:{ID:"File Template",EN:"Template File",KR:"템플릿 파일"},description:{ID:"Unduh template ini sebagai panduan format upload",EN:"Download this template as upload format guide",KR:"이 템플릿을 업로드 형식 가이드로 다운로드하세요"},downloading:{ID:"Mengunduh template...",EN:"Downloading template...",KR:"템플릿 다운로드 중..."},success:{ID:"Template berhasil diunduh",EN:"Template downloaded successfully",KR:"템플릿이 성공적으로 다운로드되었습니다"},error:{ID:"Gagal mengunduh template",EN:"Failed to download template",KR:"템플릿 다운로드 실패"},retrying:{ID:"Mencoba mengunduh ulang...",EN:"Retrying download...",KR:"다시 다운로드 중..."},retry:{ID:"Coba Lagi",EN:"Retry",KR:"다시 시도"},show:{ID:"Tampilkan Template",EN:"Show Template",KR:"템플릿 표시"},hide:{ID:"Sembunyikan Template",EN:"Hide Template",KR:"템플릿 숨기기"}};function cS(e){const{template:t,locale:n,apiUrl:i}=e,r=ig(),s=o.ref(!1),a=o.ref(!0),l=o.ref(null),c=o.computed(()=>{var W;return!!((W=t==null?void 0:t.endpoint)!=null&&W.apiUrl)}),d=o.computed(()=>{if(t!=null&&t.icon)return t.icon;if(t!=null&&t.fileType){const W=t.fileType.toLowerCase();return Wv[W]||Wv.default}return Wv.default}),f=o.computed(()=>y(t==null?void 0:t.labelID,t==null?void 0:t.labelEN,t==null?void 0:t.labelKR,Zo.label)),h=o.computed(()=>y(t==null?void 0:t.titleID,t==null?void 0:t.titleEN,t==null?void 0:t.titleKR,Zo.title)),m=o.computed(()=>y(t==null?void 0:t.descriptionID,t==null?void 0:t.descriptionEN,t==null?void 0:t.descriptionKR,Zo.description)),g=o.computed(()=>{const W=a.value?Zo.hide:Zo.show;return y(W.ID,W.EN,W.KR,W)}),v=o.computed(()=>y(Zo.retry.ID,Zo.retry.EN,Zo.retry.KR,Zo.retry));function y(W,P,E,k){const $=n.value.toLowerCase();return $==="kr"||$==="ko"?E||P||W||(k==null?void 0:k.KR)||(k==null?void 0:k.EN)||(k==null?void 0:k.ID)||"":$==="id"?W||P||(k==null?void 0:k.ID)||(k==null?void 0:k.EN)||"":P||W||(k==null?void 0:k.EN)||(k==null?void 0:k.ID)||""}function A(W){const P=Zo[W];return y(P.ID,P.EN,P.KR,P)}function C(W,P){const E=URL.createObjectURL(W),k=document.createElement("a");k.href=E,k.download=P,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(E)}function M(W,P){var E,k;return W!=null&&W.filename?W.filename:W!=null&&W.name?W.name:(E=W==null?void 0:W.data)!=null&&E.filename?W.data.filename:(k=W==null?void 0:W.data)!=null&&k.name?W.data.name:P||(t==null?void 0:t.filename)||`template_${Date.now()}.${(t==null?void 0:t.fileType)||"file"}`}async function B(){var W;if(!c.value||!((W=t==null?void 0:t.endpoint)!=null&&W.apiUrl)){console.warn("No template endpoint configured");return}if(!s.value){s.value=!0,l.value=null,r.info(A("downloading"));try{const P=t.endpoint,E=await i(P.apiUrl,P.apiMethod||"GET",P.params||{});let k;E instanceof Blob?k=E:(E==null?void 0:E.data)instanceof Blob?k=E.data:typeof E=="string"&&E.startsWith("http")?k=await(await fetch(E)).blob():E!=null&&E.url&&typeof E.url=="string"?k=await(await fetch(E.url)).blob():k=new Blob([JSON.stringify(E)],{type:"application/octet-stream"});const $=M(E,t.filename);C(k,$),r.success(A("success"))}catch(P){console.error("Template download error:",P),l.value=(P==null?void 0:P.message)||A("error"),r.error(A("error"),P==null?void 0:P.message)}finally{s.value=!1}}}function N(){a.value=!a.value}function j(){l.value=null}return{isDownloading:s,isExpanded:a,downloadError:l,hasTemplate:c,resolvedIcon:d,resolvedLabel:f,resolvedTitle:h,resolvedDescription:m,toggleButtonText:g,retryButtonText:v,downloadTemplate:B,toggleExpanded:N,clearError:j}}const GH={class:"flex flex-col gap-3 w-full"},YH={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-dashed border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70 pointer-events-none animate-pulse"},ZH={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-neutral-700/50 bg-slate-50 dark:bg-neutral-900/30 text-slate-400"},XH={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},JH={class:"text-sm font-medium text-slate-500"},QH={class:"flex items-center justify-between gap-2"},VH=["onClick"],eq={key:0,class:"space-y-2"},tq={class:"flex items-center justify-between"},nq=["onClick"],iq={class:"p-3 rounded-lg border border-slate-200 dark:border-neutral-700 bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-950/20 dark:to-indigo-950/20 space-y-2"},rq={class:"flex items-start gap-2"},oq={class:"p-1.5 rounded-lg bg-white dark:bg-neutral-800 shadow-sm"},sq={class:"flex-1"},aq={class:"text-xs font-semibold text-slate-800 dark:text-neutral-200"},lq={class:"text-xs text-slate-600 dark:text-neutral-400 mt-0.5"},cq={class:"flex items-center gap-2"},dq={key:1,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},uq={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},fq=["onClick"],hq=["for","onDrop"],mq={class:"text-xs text-slate-500 dark:text-slate-400"},pq={key:2,class:"text-xs text-slate-400"},gq=["id","disabled","accept","onChange"],yq={class:"flex flex-col items-center justify-center min-h-[300px]"},bq=["src","alt"],vq=["src"],wq={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},_q={class:"text-sm font-medium"},kq=["href"],rg=o.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},labelKR:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0},template:{type:Object,default:null},dummyMode:{type:Boolean,default:!1}},emits:["update:modelValue","uploaded","success"],setup(e,{emit:t}){const n=e,i=t,{t:r,locale:s}=Yn.useI18n(),{apiUrl:a}=o.inject("externalApi")||{},l=o.computed(()=>{const I=n.endpoint;if(!(I!=null&&I.apiUrl))return null;let O=I.apiUrl;if(!O.startsWith("http")&&n.baseUrl){const q=n.baseUrl.replace(/\/$/,""),X=O.startsWith("/")?O:`/${O}`;O=`${q}${X}`}return O}),c=o.computed(()=>{const I=d.value.length;return I<=1?"grid-cols-1":I===2?"grid-cols-1 md:grid-cols-2":I===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":I===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),d=o.ref([]),f=o.ref([]),h=o.ref(new Set),m=o.ref(!0),g=o.ref(!1),v=o.ref(""),y=o.ref(""),A=o.ref(""),C=o.computed(()=>{if(!n.template)return new Map;const I=new Map;return d.value.forEach(O=>{const q=String(O[n.itemValue]||O.id||O.typeDocument||"");q&&I.set(q,cS({template:n.template,locale:o.computed(()=>s.value),apiUrl:a}))}),I}),M=I=>{const O=String(I[n.itemValue]||I.id||I.typeDocument||"");return C.value.get(O)||null},B=I=>{const O=M(I);if(!O)return null;const q=O.resolvedIcon;return tn[q]||tn.Download},N=async()=>{var I;if(m.value=!0,n.items!==void 0){d.value=n.items,m.value=!1;return}if(!((I=n.endpointReference)!=null&&I.apiUrl)||n.dummyMode){m.value=!1;return}try{const O=await a(n.endpointReference.apiUrl,n.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(n.items!==void 0){m.value=!1;return}let q=(O==null?void 0:O.data)||O;Array.isArray(q)||(q=[q]),d.value=q}catch(O){console.error("Failed to fetch dynamic document list",O)}finally{m.value=!1}};o.onMounted(()=>{Array.isArray(n.modelValue)&&n.modelValue.length>0&&(f.value=JSON.parse(JSON.stringify(n.modelValue))),N()}),o.onBeforeUnmount(()=>{f.value.forEach(I=>{I._localPreviewUrl&&URL.revokeObjectURL(I._localPreviewUrl)})}),o.watch(()=>n.modelValue,I=>{if(Array.isArray(I)&&JSON.stringify(I)!==JSON.stringify(f.value)){const O=JSON.parse(JSON.stringify(I));O.forEach(q=>{const X=f.value.find(oe=>{var re,ge,ce,se,z,G,ee,K;const ue=[(re=q.typeDocument)==null?void 0:re.id,(ge=q.typeDocument)==null?void 0:ge.code,q.typeDocument,(ce=q.idDocumentType)==null?void 0:ce.id,(se=q.idDocumentType)==null?void 0:se.code,q.idDocumentType].map(Y=>String(Y)).filter(Y=>Y!=="undefined"&&Y!=="null"&&Y!==""),te=[(z=oe.typeDocument)==null?void 0:z.id,(G=oe.typeDocument)==null?void 0:G.code,oe.typeDocument,(ee=oe.idDocumentType)==null?void 0:ee.id,(K=oe.idDocumentType)==null?void 0:K.code,oe.idDocumentType].map(Y=>String(Y)).filter(Y=>Y!=="undefined"&&Y!=="null"&&Y!=="");return ue.some(Y=>te.includes(Y))});X!=null&&X._localPreviewUrl&&(q._localPreviewUrl=X._localPreviewUrl)}),f.value=O}},{deep:!0}),o.watch(()=>{var I;return(I=n.endpointReference)==null?void 0:I.apiUrl},(I,O)=>{I!==O&&N()}),o.watch(()=>{var I;return(I=n.endpointReference)==null?void 0:I.apiMethod},(I,O)=>{I!==O&&N()}),o.watch(()=>n.items,I=>{d.value=I??[],m.value=!1},{deep:!0,immediate:!0});const j=(I,O)=>{if(!O||!I)return!1;const q=[O[n.itemValue],O.id,O.code,O.value,O.typeDocument].map(ue=>String(ue)).filter(ue=>ue!=="undefined"&&ue!=="null"&&ue!==""),X=[];I.typeDocument&&(typeof I.typeDocument=="object"?X.push(I.typeDocument.id,I.typeDocument.code,I.typeDocument.value):X.push(I.typeDocument)),I.idDocumentType&&(typeof I.idDocumentType=="object"?X.push(I.idDocumentType.id,I.idDocumentType.code,I.idDocumentType.value):X.push(I.idDocumentType)),n.itemValue&&I[n.itemValue]&&(typeof I[n.itemValue]=="object"?X.push(I[n.itemValue].id,I[n.itemValue].code,I[n.itemValue].value):X.push(I[n.itemValue])),I.document&&typeof I.document=="object"?X.push(I.document.id,I.document.code,I.document.value):I.document&&typeof I.document!="string"&&X.push(I.document);const oe=X.map(ue=>String(ue)).filter(ue=>ue!=="undefined"&&ue!=="null"&&ue!=="");return q.some(ue=>oe.includes(ue))},W=I=>f.value.find(O=>j(O,I))||null,P=async(I,O,q)=>{var re,ge,ce,se,z;const X=q.target,oe=(re=X.files)==null?void 0:re[0];if(!oe)return;if(n.dummyMode){const G=I[n.itemValue]||I.id||I.typeDocument,ee=URL.createObjectURL(oe),K=[...f.value],Y=K.findIndex(_=>j(_,I));(ge=K[Y])!=null&&ge._localPreviewUrl&&URL.revokeObjectURL(K[Y]._localPreviewUrl);const F={id:null,idDocument:null,idDocumentType:G,filename:oe.name,document:G,documentUrl:oe.name,typeDocument:G,_localPreviewUrl:ee,_fileType:oe.type};Y>-1?K[Y]={...K[Y],...F}:K.push(F),f.value=K,i("update:modelValue",K),X.value="";return}const ue=I[n.itemValue]||I.id||I.typeDocument,te=URL.createObjectURL(oe);if(!l.value){const G=[...f.value],ee=G.findIndex(Y=>j(Y,I));(ce=G[ee])!=null&&ce._localPreviewUrl&&URL.revokeObjectURL(G[ee]._localPreviewUrl);const K={id:null,idDocument:null,idDocumentType:ue,filename:oe.name,document:ue,documentUrl:oe.name,typeDocument:ue,_localPreviewUrl:te,_fileType:oe.type};ee>-1?G[ee]={...G[ee],...K}:G.push(K),f.value=G,i("update:modelValue",G);return}h.value.add(O);try{const G=new FormData;G.append("doc",oe),G.append("typeDocument",String(ue));const ee=await a(l.value,((se=n.endpoint)==null?void 0:se.apiMethod)||"POST",G),K=Array.isArray(ee==null?void 0:ee.data)?ee.data[0]:(ee==null?void 0:ee.data)||ee,Y=(K==null?void 0:K.url)||(K==null?void 0:K.document)||oe.name,F=(K==null?void 0:K.id)||null,_=(K==null?void 0:K.filename)||(K==null?void 0:K.name)||oe.name,b=[...f.value],R=b.findIndex(T=>j(T,I));(z=b[R])!=null&&z._localPreviewUrl&&URL.revokeObjectURL(b[R]._localPreviewUrl);const S={...K,id:F||(K==null?void 0:K.idDocument)||(K==null?void 0:K.id_document)||null,idDocument:(K==null?void 0:K.idDocument)||F||(K==null?void 0:K.id_document)||null,idDocumentType:ue,filename:_,document:ue,documentUrl:Y,typeDocument:ue,_localPreviewUrl:te,_fileType:oe.type};R>-1?b[R]={...b[R],...S}:b.push(S),f.value=b,i("update:modelValue",b),i("uploaded",K),i("success",K)}catch(G){console.error("Upload failed",G)}finally{h.value.delete(O),X.value=""}},E=I=>{const O=f.value.find(X=>j(X,I));O!=null&&O._localPreviewUrl&&URL.revokeObjectURL(O._localPreviewUrl);const q=f.value.filter(X=>!j(X,I));f.value=q,i("update:modelValue",q)},k=I=>{const O=W(I);if(!O)return;let q=O._localPreviewUrl;if(!q){const ue=O.document&&typeof O.document=="object"?O.document:null,te=O.server||(ue==null?void 0:ue.server),re=O.url||(ue==null?void 0:ue.url);if(te&&re){const ge=String(te).replace(/\/+$/,""),ce=String(re).replace(/^\/+/,"");q=`${ge}/${ce}`}else O.filename&&String(O.filename).startsWith("http")?q=O.filename:q=(typeof O.document=="string"?O.document:null)||O.url||(ue==null?void 0:ue.url)}if(!q)return;const X=O.mime||(O.document&&typeof O.document=="object"?O.document.mime:null)||O._fileType||"",oe=X==="application/pdf"||q.toLowerCase().endsWith(".pdf");oe&&!q.includes("#")&&(q+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),v.value=q,y.value=I[n.itemTitle]||I.name||O.filename||"Preview Document",A.value=X||(oe?"application/pdf":"image/jpeg"),g.value=!0},$=(I,O,q)=>{var ue,te;q.preventDefault();const X=(te=(ue=q.dataTransfer)==null?void 0:ue.files)==null?void 0:te[0];if(!X)return;P(I,O,{target:{files:[X],value:""}})};return(I,O)=>(o.openBlock(),o.createElementBlock("div",GH,[e.label||e.labelID||e.labelEN||e.labelKR?(o.openBlock(),o.createBlock(jl,{key:0,text:e.label||(o.unref(s).toLowerCase().startsWith("kr")||o.unref(s).toLowerCase().startsWith("ko")?e.labelKR:o.unref(s).toLowerCase().startsWith("en")?e.labelEN:e.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:e.required},null,8,["text","required"])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["w-full grid gap-4",c.value])},[d.value.length===0&&m.value?(o.openBlock(),o.createElementBlock("div",YH,[o.createVNode(jl,{text:o.unref(r)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),o.createElementVNode("div",ZH,[o.createVNode(o.unref(Ne.Loader2),{class:"w-6 h-6 animate-spin"})])])):d.value.length===0&&!m.value?(o.openBlock(),o.createElementBlock("div",XH,[o.createVNode(o.unref(Ne.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),o.createElementVNode("span",JH,o.toDisplayString(o.unref(r)("dynamicUploadList.noDocsRequired")),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,(q,X)=>{var oe,ue,te,re,ge,ce,se,z,G,ee,K,Y;return o.openBlock(),o.createElementBlock("div",{key:X,class:"flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg shadow-sm"},[o.createElementVNode("div",QH,[o.createVNode(jl,{text:q[e.itemTitle]||q.name||q.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),W(q)?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"p-1 hover:bg-slate-100 dark:hover:bg-zinc-700 rounded transition-colors text-slate-400 hover:text-primary-500",onClick:F=>k(q)},[o.createVNode(o.unref(Ne.Eye),{class:"w-4 h-4"})],8,VH)):o.createCommentVNode("",!0)]),M(q)&&((oe=M(q))!=null&&oe.hasTemplate)?(o.openBlock(),o.createElementBlock("div",eq,[o.createElementVNode("div",tq,[o.createElementVNode("button",{type:"button",onClick:F=>{var _;return(_=M(q))==null?void 0:_.toggleExpanded()},class:"text-xs font-medium text-slate-600 dark:text-slate-400 hover:text-primary-600 dark:hover:text-primary-400 transition-colors flex items-center gap-1"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent((ue=M(q))!=null&&ue.isExpanded?tn.ChevronDown:tn.ChevronRight),{class:"w-3 h-3"})),o.createTextVNode(" "+o.toDisplayString((te=M(q))==null?void 0:te.toggleButtonText),1)],8,nq)]),o.withDirectives(o.createElementVNode("div",iq,[o.createElementVNode("div",rq,[o.createElementVNode("div",oq,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(B(q)),{class:"w-4 h-4 text-primary-600 dark:text-primary-400"}))]),o.createElementVNode("div",sq,[o.createElementVNode("h4",aq,o.toDisplayString((re=M(q))==null?void 0:re.resolvedTitle),1),o.createElementVNode("p",lq,o.toDisplayString((ge=M(q))==null?void 0:ge.resolvedDescription),1)])]),o.createElementVNode("div",cq,[(ce=M(q))!=null&&ce.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:1,type:"button",size:"sm",variant:"destructive",disabled:((z=M(q))==null?void 0:z.isDownloading)||e.disabled,onClick:F=>{var _;return(_=M(q))==null?void 0:_.downloadTemplate()},class:"text-xs h-7"},{default:o.withCtx(()=>{var F;return[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.RotateCw),{class:"w-3 h-3 mr-1"})),o.createTextVNode(" "+o.toDisplayString((F=M(q))==null?void 0:F.retryButtonText),1)]}),_:2},1032,["disabled","onClick"])):(o.openBlock(),o.createBlock(o.unref(Fr),{key:0,type:"button",size:"sm",disabled:((se=M(q))==null?void 0:se.isDownloading)||e.disabled,onClick:F=>{var _;return(_=M(q))==null?void 0:_.downloadTemplate()},class:"text-xs h-7"},{default:o.withCtx(()=>{var F,_,b;return[(o.openBlock(),o.createBlock(o.resolveDynamicComponent((F=M(q))!=null&&F.isDownloading?tn.Loader2:tn.Download),{class:o.normalizeClass(["w-3 h-3 mr-1",(_=M(q))!=null&&_.isDownloading?"animate-spin":""])},null,8,["class"])),o.createTextVNode(" "+o.toDisplayString((b=M(q))==null?void 0:b.resolvedLabel),1)]}),_:2},1032,["disabled","onClick"])),(G=M(q))!=null&&G.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:2,type:"button",size:"sm",variant:"ghost",onClick:F=>{var _;return(_=M(q))==null?void 0:_.clearError()},class:"text-xs h-7"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.X),{class:"w-3 h-3"}))]),_:1},8,["onClick"])):o.createCommentVNode("",!0)]),(ee=M(q))!=null&&ee.downloadError?(o.openBlock(),o.createBlock(o.unref(jv),{key:0,variant:"destructive",class:"text-xs py-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uv),null,{default:o.withCtx(()=>{var F;return[o.createTextVNode(o.toDisplayString((F=M(q))==null?void 0:F.downloadError),1)]}),_:2},1024)]),_:2},1024)):o.createCommentVNode("",!0)],512),[[o.vShow,(K=M(q))==null?void 0:K.isExpanded]])])):o.createCommentVNode("",!0),W(q)?(o.openBlock(),o.createElementBlock("div",dq,[o.createVNode(o.unref(Ne.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),o.createElementVNode("span",uq,o.toDisplayString(((Y=W(q))==null?void 0:Y.filename)||o.unref(r)("dynamicUploadList.fileUploaded")),1),e.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:F=>E(q)},[o.createVNode(o.unref(Ne.X),{class:"w-4 h-4"})],8,fq))])):(o.openBlock(),o.createElementBlock("label",{key:2,for:`dyn-upload-input-${X}`,class:o.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[e.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",h.value.has(X)?"pointer-events-none opacity-70":""]]),onDragover:O[0]||(O[0]=o.withModifiers(()=>{},["prevent"])),onDrop:F=>!e.disabled&&!h.value.has(X)&&$(q,X,F)},[h.value.has(X)?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(o.openBlock(),o.createBlock(o.unref(Ne.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),o.createElementVNode("span",mq,o.toDisplayString(h.value.has(X)?o.unref(r)("dynamicUploadList.uploading"):o.unref(r)("dynamicUploadList.clickOrDrag")),1),e.typeFile?(o.openBlock(),o.createElementBlock("span",pq,o.toDisplayString(e.typeFile),1)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:`dyn-upload-input-${X}`,type:"file",class:"sr-only",disabled:e.disabled||h.value.has(X),accept:e.typeFile,onChange:F=>P(q,X,F)},null,40,gq)],42,hq))])}),128))],2),o.createVNode(Yo,{modelValue:g.value,"onUpdate:modelValue":O[2]||(O[2]=q=>g.value=q),title:y.value,"max-width":A.value==="application/pdf"?720:500,"content-class":A.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:O[1]||(O[1]=q=>g.value=!1)},o.toDisplayString(o.unref(r)("common.close")||"Close"),1)]),default:o.withCtx(()=>[o.createElementVNode("div",yq,[A.value.startsWith("image/")?(o.openBlock(),o.createElementBlock("img",{key:0,src:v.value,alt:y.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,bq)):A.value==="application/pdf"?(o.openBlock(),o.createElementBlock("iframe",{key:1,src:`${v.value}${v.value.includes("#")?"":"#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"}`,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,vq)):(o.openBlock(),o.createElementBlock("div",wq,[o.createVNode(o.unref(Ne.FileText),{class:"w-16 h-16 stroke-1"}),o.createElementVNode("span",_q,o.toDisplayString(o.unref(r)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),o.createElementVNode("a",{href:v.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},o.toDisplayString(o.unref(r)("dynamicUploadList.viewOriginal")||"View Original"),9,kq)]))])]),_:1},8,["modelValue","title","max-width","content-class"])]))}});function dS(){return{setPageTitle:n=>{typeof document<"u"&&(document.title=n||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:n},bubbles:!0,composed:!0}))},setBreadcrumb:n=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:n},bubbles:!0,composed:!0}))}}}function xq(){const e=o.ref(0),t=o.reactive({}),n=o.reactive({}),i=o.reactive({}),r=o.reactive({}),s=o.reactive({}),a=o.ref(!1),l=o.reactive({}),c=o.reactive({}),d=o.reactive({}),f=o.ref(!1),h=o.ref(null),m=o.reactive({}),g=o.reactive({}),v=o.reactive({}),y=o.reactive({}),A=o.reactive({}),C=o.reactive({}),M=o.reactive({}),B=o.ref(null),N=o.reactive({visible:!1,title:"",message:"",action:null,showCancel:!0,okText:"",cancelText:"",isBlocking:!1,redirectUrl:""});return{revision:e,formData:t,originalData:n,tableRowFormData:i,errors:r,touched:s,isSubmitted:a,fieldErrors:l,wizardState:c,inlineState:d,isSubmitting:f,internalSchema:h,rawItemsCache:m,revealedSectionIds:g,revealedFieldModels:v,wizardResponses:y,sectionLoading:A,fieldLoading:C,confirmDialog:N,sectionPagination:M,activeTableAction:B}}var og={exports:{}},Eq=og.exports,uS;function Cq(){return uS||(uS=1,(function(e,t){(function(n,i){e.exports=i()})(Eq,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function n(s){for(var a=[],l=0,c=s.length;l<c;l++)a.indexOf(s[l])===-1&&a.push(s[l]);return a}var i={},r={"==":function(s,a){return s==a},"===":function(s,a){return s===a},"!=":function(s,a){return s!=a},"!==":function(s,a){return s!==a},">":function(s,a){return s>a},">=":function(s,a){return s>=a},"<":function(s,a,l){return l===void 0?s<a:s<a&&a<l},"<=":function(s,a,l){return l===void 0?s<=a:s<=a&&a<=l},"!!":function(s){return i.truthy(s)},"!":function(s){return!i.truthy(s)},"%":function(s,a){return s%a},log:function(s){return console.log(s),s},in:function(s,a){return!a||typeof a.indexOf>"u"?!1:a.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,a,l){if(l<0){var c=String(s).substr(a);return c.substr(0,c.length+l)}return String(s).substr(a,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,a){return parseFloat(s,10)+parseFloat(a,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,a){return parseFloat(s,10)*parseFloat(a,10)})},"-":function(s,a){return a===void 0?-s:s-a},"/":function(s,a){return s/a},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,a){return s.concat(a)},[])},var:function(s,a){var l=a===void 0?null:a,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),f=0;f<d.length;f++)if(c==null||(c=c[d[f]],c===void 0))return l;return c},missing:function(){for(var s=[],a=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<a.length;l++){var c=a[l],d=i.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,a){var l=i.apply({missing:a},this);return a.length-l.length>=s?[]:l}};return i.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},i.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},i.get_operator=function(s){return Object.keys(s)[0]},i.get_values=function(s){return s[i.get_operator(s)]},i.apply=function(s,a){if(Array.isArray(s))return s.map(function(A){return i.apply(A,a)});if(!i.is_logic(s))return s;var l=i.get_operator(s),c=s[l],d,f,h,m,g;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(i.truthy(i.apply(c[d],a)))return i.apply(c[d+1],a);return c.length===d+1?i.apply(c[d],a):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(f=i.apply(c[d],a),!i.truthy(f))return f;return f}else if(l==="or"){for(d=0;d<c.length;d+=1)if(f=i.apply(c[d],a),i.truthy(f))return f;return f}else{if(l==="filter")return m=i.apply(c[0],a),h=c[1],Array.isArray(m)?m.filter(function(A){return i.truthy(i.apply(h,A))}):[];if(l==="map")return m=i.apply(c[0],a),h=c[1],Array.isArray(m)?m.map(function(A){return i.apply(h,A)}):[];if(l==="reduce")return m=i.apply(c[0],a),h=c[1],g=typeof c[2]<"u"?i.apply(c[2],a):null,Array.isArray(m)?m.reduce(function(A,C){return i.apply(h,{current:C,accumulator:A})},g):g;if(l==="all"){if(m=i.apply(c[0],a),h=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!i.truthy(i.apply(h,m[d])))return!1;return!0}else if(l==="none"){if(m=i.apply(c[0],a),h=c[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(i.truthy(i.apply(h,m[d])))return!1;return!0}else if(l==="some"){if(m=i.apply(c[0],a),h=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(i.truthy(i.apply(h,m[d])))return!0;return!1}}if(c=c.map(function(A){return i.apply(A,a)}),r.hasOwnProperty(l)&&typeof r[l]=="function")return r[l].apply(a,c);if(l.indexOf(".")>0){var v=String(l).split("."),y=r;for(d=0;d<v.length;d++){if(!y.hasOwnProperty(v[d]))throw new Error("Unrecognized operation "+l+" (failed at "+v.slice(0,d+1).join(".")+")");y=y[v[d]]}return y.apply(a,c)}throw new Error("Unrecognized operation "+l)},i.uses_data=function(s){var a=[];if(i.is_logic(s)){var l=i.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?a.push(c[0]):c.forEach(function(d){a.push.apply(a,i.uses_data(d))})}return n(a)},i.add_operation=function(s,a){r[s]=a},i.rm_operation=function(s){delete r[s]},i.rule_like=function(s,a){if(a===s||a==="@")return!0;if(a==="number")return typeof s=="number";if(a==="string")return typeof s=="string";if(a==="array")return Array.isArray(s)&&!i.is_logic(s);if(i.is_logic(a)){if(i.is_logic(s)){var l=i.get_operator(a),c=i.get_operator(s);if(l==="@"||l===c)return i.rule_like(i.get_values(s,!1),i.get_values(a,!1))}return!1}if(Array.isArray(a))if(Array.isArray(s)){if(a.length!==s.length)return!1;for(var d=0;d<a.length;d+=1)if(!i.rule_like(s[d],a[d]))return!1;return!0}else return!1;return!1},i})})(og)),og.exports}var Sq=Cq();const go=Xm(Sq);function Hv(){const e=n=>n&&typeof n=="object"&&n._isLogicValue;go.add_operation("var",function(n,i){const r=i===void 0?null:i,s=this;if(n===void 0||n===""||n===null)return s;if(s&&typeof s=="object"&&s._resolveLogicVar){const c=s._resolveLogicVar(String(n));if(c!==void 0)return c}const a=String(n).split(".");let l=s;for(let c=0;c<a.length;c++){if(l==null)return r;const d=a[c];let f=l[d];if(f===void 0&&l&&typeof l=="object"){const h=Object.keys(l).find(m=>m===d||m.endsWith("."+d));h!==void 0&&(f=l[h])}if(f===void 0)return r;l=f}return l}),go.add_operation("length",n=>n==null?0:e(n)?String(n.code??n.id??n.value??n.name??"").length:typeof n=="string"?n.length:typeof n=="number"?String(n).length:Array.isArray(n)?n.length:typeof n=="object"?n.code!==void 0&&n.code!==null?String(n.code).length:n.id!==void 0&&n.id!==null?String(n.id).length:n.value!==void 0&&n.value!==null?String(n.value).length:n.name!==void 0&&n.name!==null?String(n.name).length:Object.keys(n).length:0),["+","-","*","/",">","<",">=","<="].forEach(n=>{go.add_operation(n,(...i)=>{const r=l=>e(l)?Number(l.id??l.code??l.value)||0:typeof l=="string"&&l.trim()!==""&&!isNaN(Number(l))?Number(l):l;if(n==="+"||n==="*"||n==="-"||n==="/")return i.reduce((l,c,d)=>{const f=r(c)||0;if(d===0)return f;switch(n){case"+":return l+f;case"-":return l-f;case"*":return l*f;case"/":return f!==0?l/f:0;default:return l}},n==="*"||n==="/"?1:0);const s=r(i[0]),a=r(i[1]);switch(n){case">":return s>a;case"<":return s<a;case">=":return s>=a;case"<=":return s<=a;default:return 0}})}),go.add_operation("==",(n,i)=>{if(n==null)return i==null;if(i==null)return n==null;const r=l=>e(l)?[String(l.code),String(l.id),String(l.value),String(l.name)]:typeof l=="object"?[String(l.code??l.id??l.value??l.name??"")]:[String(l)],[s,a]=[r(n),r(i)];return s.some(l=>a.some(c=>l===c))}),go.add_operation("!=",(n,i)=>n==null&&i==null?!1:n==null||i===null||i===void 0?!0:e(n)&&e(i)?!(String(n.id)===String(i.id)||String(n.code)===String(i.code)):e(n)?!(String(n.code)===String(i)||String(n.id)===String(i)):e(i)?!(String(i.code)===String(n)||String(i.id)===String(n)):String(n)!==String(i)),go.add_operation("calculate_age",(n,i,r="years")=>{if(!n)return null;const s=new Date(n),a=i&&i!==null&&i!=="null"?new Date(i):new Date;if(isNaN(s.getTime())||isNaN(a.getTime()))return null;const l=s<=a,[c,d]=l?[s,a]:[a,s];let f=d.getFullYear()-c.getFullYear(),h=d.getMonth()-c.getMonth(),m=d.getDate()-c.getDate();if(m<0){h--;const y=new Date(d.getFullYear(),d.getMonth(),0);m+=y.getDate()}h<0&&(f--,h+=12);const g=h,v=l?1:-1;if(r==="years")return f*v;if(r==="months")return g*v;if(r==="days"){const y=d.getTime()-c.getTime();return Math.floor(y/(1e3*60*60*24))*v}return f*v})}function Pt(e){if(!e)return"";const t=e.propsForm||e.propsFormStep||e.propsTable||e.propsTableStep||e.propsDataTableWizard||e.propsWizard||e.props||{};return e.key||t.key||e.id||e.modelKey||t.modelKey||t.modelDatatable||""}const Ye=(e,t)=>{if(t&&!(!e||typeof e!="object")){if(t.includes(".")){const n=t.split(".");if(!Array.isArray(e[n[0]])){const i=n.reduce((r,s)=>r==null?void 0:r[s],e);if(i!=null)return i}}return e[t]!==void 0&&e[t]!==null?e[t]:t.split(".").reduce((n,i)=>n==null?void 0:n[i],e)}},Xt=(e,t,n)=>{if(!t)return;const i=t.split(".");if(i.length>1&&Array.isArray(e[i[0]])){e[t]=n;return}i.length>1&&t in e&&t!==i[0]&&(e[t]=n);let r=e;for(let s=0;s<i.length-1;s++){const a=i[s];(r[a]===void 0||r[a]===null||typeof r[a]!="object")&&(r[a]={}),r=r[a]}r[i[i.length-1]]=n},yo=e=>{const t=o.toRaw(e);if(t==null)return t;if(Array.isArray(t))return t.map(n=>yo(n));if(typeof t=="object"){if(t instanceof Date||t instanceof File||t instanceof Blob)return t;if(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null){const n={};return Object.keys(t).forEach(i=>n[i]=yo(t[i])),n}}return t},sg=e=>{if(!e||typeof e!="object")return[];if("var"in e)return[e.var];let t=[];return Object.values(e).forEach(n=>{Array.isArray(n)?n.forEach(i=>{t=t.concat(sg(i))}):typeof n=="object"&&(t=t.concat(sg(n)))}),t},Aq=e=>e?[...e].sort((t,n)=>(t.seq||0)-(n.seq||0)):[],Bf=(e,t={},n="")=>(!e||typeof e!="object"||Object.keys(e).forEach(i=>{const r=e[i],s=n?`${n}.${i}`:i;t[s]=r,r&&typeof r=="object"&&!Array.isArray(r)&&!r._isLogicValue&&Bf(r,t,s)}),t),bo=(e,t)=>{if(!(!e||typeof e!="object")){if(e[t]!==void 0)return e[t];if(Array.isArray(e))for(const n of e){const i=bo(n,t);if(i!==void 0)return i}else for(const n of Object.keys(e))if(typeof e[n]=="object"){const i=bo(e[n],t);if(i!==void 0)return i}}},qv=(e,t)=>{Object.keys(t).forEach(n=>{t[n]&&typeof t[n]=="object"&&!Array.isArray(t[n])?(e[n]||(e[n]={}),qv(e[n],t[n])):e[n]=t[n]})},vo=(e,t)=>{if(!e||typeof e!="string"||e.startsWith("http")||!t||typeof t!="string")return e;const n=t.replace(/\/$/,""),i=e.startsWith("/")?e:`/${e}`;return`${n}${i}`},kd=e=>{if(!e||typeof e!="object")return!0;const t=["no","action","_index","_isLogicValue"];return!Object.entries(e).some(([n,i])=>t.includes(n)?!1:i!=null&&i!==""?Array.isArray(i)?i.length>0:typeof i=="object"&&!(i instanceof Date)?Object.values(i).some(r=>r!=null&&r!==""):!0:!1)};function Kv({formData:e,errors:t,fieldMap:n,rawItemsCache:i,activeSchema:r,locale:s,tableRowFormData:a,revealedSectionIds:l,revealedFieldModels:c,parentFormData:d,rootFormData:f,activeTableAction:h,activeTableRow:m,tableRows:g}){const v=o.inject("parentFormData",null),y=o.inject("rootFormData",null);o.provide("parentFormData",e),y||o.provide("rootFormData",e);const A=d||v||y||e,C=f||y||e;console.log("[useFormLogic][INIT] Resolved contexts:",{hasParentOption:!!d,hasParentInjected:!!v,parentKeys:Object.keys(A),hasRootOption:!!f,hasRootInjected:!!y,rootKeys:Object.keys(C)});const M=(b,R)=>!b||["DCodeDatePicker","DCodeTextField","DCodeTextArea","DCodeButton","DCodeCheckbox"].includes(b)?!1:["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeSelect","DCodeRadio","DCodeRadioCustom","DCodeMultiSelect"].includes(b)||!!(R.endpoint||R.endpointReference||R.items),B=o.computed(()=>{var b;for(const R in i)(b=i[R])==null||b.length;return j(e)}),N=(b,R,S,T)=>{var pe,ke,be,Se;if(R==null||typeof R=="object"&&R._isLogicValue)return R;let D=S;if(!D){const ve=(ke=(pe=n.value)==null?void 0:pe.paths)==null?void 0:ke.get(b),Be=(Se=(be=n.value)==null?void 0:be.models)==null?void 0:Se.get(b),Ee=ve||(Array.isArray(Be)?Be[0]:null);D=Ee==null?void 0:Ee.field}if(!D)return R;const Z=D.props||D.propsFieldCustom||D.propsFieldGlobal||{},J=i[D.key]||Z.items||Z.options;if(!J||!Array.isArray(J))return M(D.component,Z)?{id:(T==null?void 0:T.id)??R,code:(T==null?void 0:T.code)??R,value:(T==null?void 0:T.value)??R,_isLogicValue:!0,_isFallback:!0}:R;const fe=Z.itemValue||"code",ae=J.find(ve=>String(ve[fe])===String(R)||String(ve.code)===String(R)||String(ve.id)===String(R)||String(ve.name)===String(R)||String(ve.title)===String(R)||Z.itemTitle&&String(ve[Z.itemTitle])===String(R)||typeof R=="string"&&(String(ve[fe]).toUpperCase()===R.toUpperCase()||String(ve.code).toUpperCase()===R.toUpperCase()||String(ve.name).toUpperCase()===R.toUpperCase()||String(ve.title).toUpperCase()===R.toUpperCase())),we=M(D.component,Z);return ae?{...ae,id:ae.id??ae[fe]??R,code:ae.code??ae[fe]??R,name:ae.name??ae[Z.itemTitle||"name"]??ae.title??R,title:ae.title??ae[Z.itemTitle||"title"]??ae.name??R,value:ae.value??ae[fe]??ae.id??R,_isLogicValue:!0}:we?{id:(T==null?void 0:T.id)??R,code:(T==null?void 0:T.code)??R,value:(T==null?void 0:T.value)??R,name:(T==null?void 0:T.name)??(T==null?void 0:T.title)??R,title:(T==null?void 0:T.title)??(T==null?void 0:T.name)??R,_isLogicValue:!0,_isFallback:!0}:R},j=(b,R,S="LOGIC")=>{const T=(D,Z)=>{var fe,ae,we,pe,ke,be,Se,ve,Be;if(D==null||typeof D=="object"&&D._isLogicValue||typeof D=="boolean"||(Ee=>{var Oe;return!Ee||typeof Ee!="object"?!1:Ee instanceof File||Ee instanceof Blob||((Oe=Ee.constructor)==null?void 0:Oe.name)==="File"||Ee.size!==void 0&&typeof Ee.name=="string"})(D))return D;if(typeof D=="number"||typeof D=="string")return Z&&(((ae=(fe=n.value)==null?void 0:fe.paths)==null?void 0:ae.has(Z))||((pe=(we=n.value)==null?void 0:we.models)==null?void 0:pe.has(Z)))?N(Z,D):D;if(typeof D=="object"&&!Array.isArray(D)){const Ee=Z?((be=(ke=n.value)==null?void 0:ke.paths)==null?void 0:be.get(Z))||((Be=(ve=(Se=n.value)==null?void 0:Se.models)==null?void 0:ve.get(Z))==null?void 0:Be[0]):null,Oe=Ee==null?void 0:Ee.field;if(Oe&&M(Oe.component,Oe.props||Oe.propsFieldCustom||Oe.propsFieldGlobal||{})){const Re=(D==null?void 0:D.id)??(D==null?void 0:D.code)??(D==null?void 0:D.value)??(D==null?void 0:D.key)??(D==null?void 0:D.name)??(D==null?void 0:D.title)??D,De=typeof Re=="string"||typeof Re=="number"?N(Z,Re,Oe,D):Re;if(De&&typeof De=="object")return{...D,...De,_isLogicValue:!0}}return D}return D};return R!=null&&R.includes(".")&&R.split(".").slice(0,-1).join("."),new Proxy(b,{get(D,Z){var pe,ke,be,Se,ve,Be;if(Z==="_isNormalizedProxy")return!0;if(typeof Z!="string")return D[Z];if(Z==="parent"){const Ee=A||C;return Ee?Ee._isNormalizedProxy?Ee:j(Ee,void 0,S):void 0}if(Z==="root"){const Ee=C;return Ee?Ee._isNormalizedProxy?Ee:j(Ee,void 0,S):void 0}if(Z.startsWith("parent.")){const Ee=Z.replace(/^parent\./,""),Oe=A||C,Ae=Ye(Oe,Ee)??Oe[Ee];if(Ae!=null)return T(Ae,Ee)}if(Z.startsWith("root.")){const Ee=Z.replace(/^root\./,""),Oe=C,Ae=Ye(Oe,Ee)??Oe[Ee];if(Ae!=null)return T(Ae,Ee)}if(Z==="_resolveLogicVar")return Ee=>{var Ie,Ce,ne,ye;if(!Ee)return;const Oe=Ee.replace(/^formData\./,""),Ae=(Ce=(Ie=n.value)==null?void 0:Ie.paths)==null?void 0:Ce.get(Oe);if(Ae){const Me=Ye(b,Ae.path)??b[Ae.path]??Ye(b,Oe)??b[Oe]??Ye(e,Ae.path);if(Me!==void 0)return T(Me,Oe)}const Re=Oe.split(".");for(let Me=Re.length;Me>0;Me--){const Ke=Re.slice(0,Me).join("."),$e=[];for(const[He,rt]of((ye=(ne=n.value)==null?void 0:ne.paths)==null?void 0:ye.entries())||[])if(He===Ke||He.endsWith("."+Ke)){let Ve=0;if(R){const Fe=He.split("."),Ue=R.split(".");let at=0;for(let nt=0;nt<Math.min(Fe.length,Ue.length)&&Fe[nt]===Ue[nt];nt++)at++;Ve=at}$e.push({ent:rt,key:He,score:Ve})}if($e.length>0){$e.sort((Ue,at)=>at.score!==Ue.score?at.score-Ue.score:Ue.key.length-at.key.length);const He=$e[0],rt=Ye(b,He.ent.path)??b[He.ent.path]??Ye(b,He.key)??b[He.key]??Ye(e,He.ent.path);let Ve=T(rt,He.key);const Fe=Re.slice(Me);for(const Ue of Fe){if(Ve==null){Ve=void 0;break}Ve=Ve[Ue]}if(Ve!==void 0)return Ve}}if(Oe.includes(".")){const Me=Oe.split(".");let Ke=b;for(const $e of Me){if(Ke==null)return;Ke=Ke[$e]}if(Ke!==void 0)return Ke}const De=b[Oe];if(De!==void 0)return De};const J=R?`${R}.${Z}`:Z;S!=="VISIBILITY-SILENT"&&!Z.startsWith("__v_")&&Z!=="_isNormalizedProxy"&&console.log(`[Proxy][GET] ${J} (Target: ${R||"ROOT"}, Debug: ${S})`);const fe=(ke=(pe=n.value)==null?void 0:pe.paths)==null?void 0:ke.get(J);if(fe){const Ee=Ye(D,fe.path)??D[fe.path]??(R?D[`${R}.${Z}`]:void 0)??Ye(e,fe.path);if(Ee&&typeof Ee=="object"&&!Array.isArray(Ee)&&!Ee._isLogicValue&&!Ee._isNormalizedProxy)return j(Ee,J,S);if(Ee!==void 0)return T(Ee,J)}const ae=(Se=(be=n.value)==null?void 0:be.models)==null?void 0:Se.get(Z);if(Array.isArray(ae)&&ae.length>0){const Ee=R!=null&&R.includes(".")?R.split(".").slice(0,-1).join("."):R;if(Ee){const Re=ae.find(De=>{var Ie;return(Ie=De==null?void 0:De.path)==null?void 0:Ie.startsWith(`${Ee}.`)});if(Re){const De=Ye(D,Re.path)??D[Re.path]??Ye(e,Re.path);if(De&&typeof De=="object"&&!Array.isArray(De)&&!De._isLogicValue&&!De._isNormalizedProxy)return j(De,J,S);if(De!==void 0)return T(De,Z)}}const Oe=ae[0];if((ve=Oe.field)!=null&&ve.type&&!((Be=Oe.field)!=null&&Be.model))return j(e,void 0,S);const Ae=Ye(D,Oe.path)??D[Oe.path]??Ye(e,Oe.path);if(Ae&&typeof Ae=="object"&&!Array.isArray(Ae)&&!Ae._isLogicValue&&!Ae._isNormalizedProxy)return j(Ae,J,S);if(Ae!==void 0)return T(Ae,Z)}let we=D[Z];if(we===void 0&&R&&D[`${R}.${Z}`]!==void 0&&(we=D[`${R}.${Z}`]),we===void 0&&a&&typeof Z=="string"&&(we=a[Z]??a[J],we===void 0&&Z.includes(".")&&(we=Ye(a,Z)),we===void 0)){const Ee=Object.keys(a).find(Oe=>Oe.endsWith(`.${Z}`));Ee&&(we=a[Ee])}if(we===void 0&&typeof Z=="string"){const Ee=Object.keys(D).find(Oe=>Oe.endsWith(`.${Z}`));Ee&&(we=D[Ee])}if(we===void 0&&typeof Z=="string"){const Ee=Object.keys(D).some(Oe=>Oe.startsWith(`${Z}.`));if(!Ee&&a&&Object.keys(a).some(Ae=>Ae.startsWith(`${Z}.`)))return j(a,J,S);if(Ee)return j(D,J,S)}if(we===void 0&&typeof Z=="string"){if(A&&A!==D){const Ee=Ye(A,Z)??A[Z];Ee!=null&&(we=Ee)}if(we===void 0&&C&&C!==D&&C!==A){const Ee=Ye(C,Z)??C[Z];Ee!=null&&(we=Ee)}}if((Z==="id"||Z==="code")&&we===void 0){const Oe=D[Z==="id"?"code":"id"];Oe!==void 0&&(we=Oe)}return we&&typeof we=="object"&&!Array.isArray(we)&&!we._isLogicValue&&!we._isNormalizedProxy?j(we,J,S):T(we,J)},has(D,Z){var we,pe,ke,be;if(typeof Z!="string")return Z in D;if(Z==="parent"||Z==="root")return!0;let J=Z;if(Z.startsWith("parent.")?J=Z.replace(/^parent\./,""):Z.startsWith("root.")&&(J=Z.replace(/^root\./,"")),((pe=(we=n.value)==null?void 0:we.paths)==null?void 0:pe.has(J))||((be=(ke=n.value)==null?void 0:ke.models)==null?void 0:be.has(J))||J in D||Object.keys(D).some(Se=>Se.startsWith(`${J}.`)))return!0;const ae=A||C;return!!(ae&&ae!==D&&(J in ae||Ye(ae,J)!==void 0)||C&&C!==D&&C!==ae&&(J in C||Ye(C,J)!==void 0))},ownKeys(D){var fe,ae;const Z=new Set([...Object.keys(D),...(fe=n.value)!=null&&fe.paths?Array.from(n.value.paths.keys()):[],...(ae=n.value)!=null&&ae.models?Array.from(n.value.models.keys()):[]]),J=A||C;return J&&J!==D&&Object.keys(J).forEach(we=>Z.add(we)),C&&C!==D&&C!==J&&Object.keys(C).forEach(we=>Z.add(we)),Array.from(Z)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}})},W=o.ref(new Set);function P(){Hv()}function E(b,R,S="LOGIC",T){const D=R?R._isNormalizedProxy?R:j(R,T,S):T?j(e,T,S):B.value;if(b==null||typeof b=="object"&&Object.keys(b).length===0)return!0;if(typeof b=="boolean")return b;if(typeof b=="string")try{return!!new Function("formData",`return ${b};`)(D)}catch{return!1}const Z=fe=>{var ke,be;if(!fe||typeof fe!="object")return fe;if(Array.isArray(fe))return fe.map(Z);const ae=Object.keys(fe)[0],we=fe[ae];if(["==","!=","in","!==","==="].includes(ae)&&Array.isArray(we)&&we.length===2){let Se=we[0],ve=we[1];if((ke=Se==null?void 0:Se.var)!=null&&ke.endsWith(".id")&&typeof ve=="string"&&isNaN(Number(ve))){const Be=Se.var.replace(/\.id$/,".code");return{[ae]:[{var:Be},ve]}}if((be=ve==null?void 0:ve.var)!=null&&be.endsWith(".id")&&typeof Se=="string"&&isNaN(Number(Se))){const Be=ve.var.replace(/\.id$/,".code");return{[ae]:[Se,{var:Be}]}}}const pe={};for(const Se in fe)pe[Se]=Z(fe[Se]);return pe},J=Z(b);JSON.stringify(J)!==JSON.stringify(b)&&S!=="VISIBILITY-SILENT"&&console.log("[evaluateLogic][AUTO-HEAL] Migrated rule from .id to .code for consistency:",JSON.stringify(J));try{P();const fe=go.apply(J,D);let ae=fe;return typeof fe=="number"&&isNaN(fe)&&(ae=void 0),S!=="VISIBILITY-SILENT"&&console.log(`[evaluateLogic][${S}] Rule:`,JSON.stringify(b),"Result:",ae),ae}catch(fe){console.error(`[DynamicForm][ERROR][${S}] Logic evaluation failed:`,fe,{rule:b,contextPath:T});return}}function k(b,R,S,T){return b==null?null:Array.isArray(b)?b.find(D=>!D.condition||E(D.condition,R,S,T))||null:typeof b=="object"&&b!==null&&b.condition&&!b._isLogicValue?E(b.condition,R,S,T)?b:null:b}function $(b,R,S){var J;if(b.isHidden||c&&c[b.model])return!0;const T=R?j(R,S):S?j(e,S):B.value,D=(J=b.logic)==null?void 0:J.visibleRule;if(D==null)return!0;const Z=k(D,T,`VISIBLE-${b.model}`,S);return Z===null?!0:typeof Z=="object"?!!E(Z,T,`VISIBLE-${b.model}`,S):!!Z}function I(b,R,S){var ae;const T=b.props||b.propsFieldCustom||b.propsFieldGlobal||{},D=!!(b.required||T.required),Z=R?j(R,S):S?j(e,S):B.value,J=(ae=b.logic)==null?void 0:ae.requiredRule;if(J==null)return D;const fe=k(J,Z,`REQUIRED-${b.model}`,S);return fe===null?D:typeof fe=="object"?"required"in fe?!!fe.required:!!E(fe,Z,`REQUIRED-${b.model}`,S):!!fe}function O(b,R,S){var ae;const T=b.props||b.propsFieldCustom||b.propsFieldGlobal||{},D=!!(b.disabled||T.disabled),Z=R?j(R,S):S?j(e,S):B.value,J=(ae=b.logic)==null?void 0:ae.disabledRule;if(J==null)return D;const fe=k(J,Z,`DISABLED-${b.model}`,S);return fe===null?D:typeof fe=="object"?"disabled"in fe?!!fe.disabled:!!E(fe,Z,`DISABLED-${b.model}`,S):!!fe}function q(b,R,S){var ae;const T=b.props||b.propsFieldCustom||b.propsFieldGlobal||{},D=!!(b.readonly||T.readonly),Z=R?j(R,S):S?j(e,S):B.value,J=(ae=b.logic)==null?void 0:ae.readonlyRule;if(J==null)return D;const fe=k(J,Z,`READONLY-${b.model}`,S);return fe===null?D:typeof fe=="object"?!!E(fe,Z,`READONLY-${b.model}`,S):!!fe}function X(b,R,S){var J,fe;if(b.isHidden||((J=b.logic)==null?void 0:J.hiddenRule)===!0)return!0;const T=(fe=b.logic)==null?void 0:fe.hiddenRule;if(T==null)return!1;const D=R?j(R,S):S?j(e,S):B.value,Z=k(T,D,`HIDDEN-${b.model}`,S);return Z===null?!1:typeof Z=="object"?!!E(Z,D,`HIDDEN-${b.model}`,S):!!Z}function oe(b){var Z;const R=b.propsForm||b.propsFormStep||b.propsTable||b.propsTableStep||b.propsDataTableWizard||b.propsWizard||b.props||{};let S=s.value==="kr"||s.value==="ko"?R.titleKR||b.titleKR||R.titleEN||b.titleEN||b.labelEN||R.titleID||b.titleID||b.labelID:s.value==="id"?R.titleID||b.titleID||b.labelID:R.titleEN||b.titleEN||b.labelEN,T=s.value==="kr"||s.value==="ko"?R.descriptionKR||b.descriptionKR||R.descriptionEN||b.descriptionEN||R.descriptionID||b.descriptionID:s.value==="id"?R.descriptionID||b.descriptionID:R.descriptionEN||b.descriptionEN;const D=k((Z=b.logic||R.logic)==null?void 0:Z.labelingRule,B.value,"LABEL-SEC");return D&&(S=s.value==="kr"||s.value==="ko"?D.labelKR||D.titleKR||D.labelEN||D.titleEN||D.title||D.labelID||D.titleID:s.value==="id"?D.labelID||D.titleID||D.title:D.labelEN||D.titleEN||D.title,T=s.value==="kr"||s.value==="ko"?D.descriptionKR||D.descriptionEN||D.descriptionID:s.value==="id"?D.descriptionID:D.descriptionEN),{title:S,description:T}}function ue(b,R){var fe;if(!b)return!0;const S=b.propsForm||b.propsFormStep||b.propsTable||b.propsTableStep||b.propsDataTableWizard||b.propsWizard||b.props||{},T=(fe=b.logic||S.logic)==null?void 0:fe.visibleRule,D=R?j(R):B.value;if(T!=null){const ae=k(T,D,"VISIBLE-SEC");let we=!0;return ae===null?we=!0:typeof ae=="object"?we=!!E(ae,D,"VISIBLE-SEC"):we=!!ae,we}const Z=Pt(b);if(Z&&W.value.has(Z))return!!(l&&l[Z]);const J=S.fields||b.fields||[];return J.length===0||J.some(ae=>$(ae,R))}function te(b,R){var J;if(!b)return!1;if(b.isHidden)return!0;const S=b.propsForm||b.propsFormStep||b.propsTable||b.propsTableStep||b.propsDataTableWizard||b.propsWizard||b.props||{},T=(J=b.logic||S.logic)==null?void 0:J.hiddenRule;if(T==null)return!1;if(T===!0)return!0;const D=R?j(R):B.value,Z=k(T,D,"HIDDEN-SEC");return Z===null?!1:typeof Z=="object"?!!E(Z,D,"HIDDEN-SEC"):!!Z}function re(b,R){var D;const S=R?j(R):B.value;return k((D=b.logic)==null?void 0:D.labelingRule,S,`LABEL-${b.model}`)||null}function ge(b,R){var Z;const S=R?j(R):B.value,T=(Z=b.logic)==null?void 0:Z.lengthRule;if(!T){const J=b.props||b.propsFieldCustom||b.propsFieldGlobal||{};return J.minLength!==void 0||J.maxLength!==void 0?{minLength:J.minLength,maxLength:J.maxLength}:null}const D=k(T,S,`LENGTH-${b.model}`);if(!D){const J=b.props||b.propsFieldCustom||b.propsFieldGlobal||{};return{minLength:J.minLength,maxLength:J.maxLength}}return typeof D=="object"&&D!==null&&!D._isLogicValue?"maxLength"in D||"minLength"in D?D:E(D,S,`LENGTH-${b.model}`):D}function ce(b,R,S){var pe,ke;const T=R?j(R,S):S?j(e,S):B.value,D=(pe=b.logic)==null?void 0:pe.defaultValueRule;if(D==null)return;const Z=k(D,T,`DEFAULT-VAL-${b.model}`,S);if(Z===null)return;let J=Z;typeof Z=="object"&&Z!==null&&"value"in Z&&!Z._isLogicValue&&(J=Z.value);let fe;return typeof J=="object"&&J!==null&&!J._isLogicValue?fe=E(J,T,`DEFAULT-VAL-${b.model}`,S):fe=J,((b.props||b.propsFieldCustom||b.propsFieldGlobal||{}).returnObject||((ke=b.logic)==null?void 0:ke.returnObject))&&(typeof fe=="string"||typeof fe=="number")?N(b.model,fe,b):fe}function se(b,R,S){var ae,we,pe;const T=b.props||{};let Z=[...i[b.key]||T.items||T.options||[]];if((ae=b.logic)!=null&&ae.optionsFilterRule){const ke=R?j(R,S,`FILTER-${b.model}`):S?j(e,S,`FILTER-${b.model}`):B.value,be=k(b.logic.optionsFilterRule,ke,`FILTER-${b.model}`,S);if(be){const Se=be.options||be.items;if(Se&&Array.isArray(Se))Z=[...Se];else if(be.values){const ve=be.values||[],Be=new Set(ve.map(String)),Ee=new Set(ve.map(Re=>String(Re).toUpperCase())),Oe=T.itemValue||"id",Ae=T.itemTitle||"name";Z=Z.filter(Re=>{if(Re==null)return!1;if(typeof Re!="object"){const De=String(Re);return Be.has(De)||Ee.has(De.toUpperCase())}return[Oe,Ae,"code","id","value","key","name","title"].some(De=>{const Ie=Re[De];if(Ie==null)return!1;const Ce=String(Ie);return Be.has(Ce)||Ee.has(Ce.toUpperCase())})})}}}const J=h==null?void 0:h.value;if(T.excludeSelectedInTable||(J==null?void 0:J.excludeSelectedInTable)||((we=J==null?void 0:J.propsActionGlobal)==null?void 0:we.excludeSelectedInTable)||((pe=J==null?void 0:J.propsActionCustom)==null?void 0:pe.excludeSelectedInTable)){let ke=[];const be=b.model||b.key,Se=T.itemValue||"id",ve=(ne,ye)=>{if(!ne||typeof ne!="object")return;if(ne[ye]!==void 0&&ne[ye]!==null)return ne[ye];if(ye&&ye.includes(".")){const Ke=ye.split(".").reduce(($e,He)=>$e&&$e[He],ne);if(Ke!=null)return Ke}const Me=ye?ye.split(".").pop():"";if(Me&&ne[Me]!==void 0&&ne[Me]!==null)return ne[Me];for(const[Ke,$e]of Object.entries(ne))if($e!=null&&(ye&&Ke.endsWith(`.${ye}`)||Me&&Ke.endsWith(`.${Me}`)))return $e},Be=ne=>{if(ne==null||ne==="")return null;if(typeof ne=="object"){const ye=ne[Se]??ne.id??ne.code??ne.value??ne.key;return ye!=null?String(ye):null}return String(ne)},Ee=[],Oe=g&&typeof g=="object"&&"value"in g?g.value:g;if(Array.isArray(Oe)&&Oe.length>0)Ee.push(...Oe);else{const ne=A||C||{};for(const ye of Object.values(ne))Array.isArray(ye)&&ye.some(Ke=>ve(Ke,be)!==void 0)&&Ee.push(...ye)}const Ae=m==null?void 0:m.value,Re=Ae?ve(Ae,be):void 0,De=Be(Re);Ee.forEach(ne=>{if(!ne||typeof ne!="object"||Ae&&ne===Ae)return;const ye=ve(ne,be),Me=Be(ye);Me&&(!De||Me!==De)&&ke.push(Me)});const Ie=R?R[be]:Ye(e,be),Ce=Be(Ie);if(Ce&&(ke=ke.filter(ne=>ne!==Ce)),ke.length>0){const ne=new Set(ke);Z=Z.filter(ye=>ye==null?!1:typeof ye!="object"?!ne.has(String(ye)):![Se,"id","code","value","key"].some($e=>{const He=ye[$e];return He!=null&&ne.has(String(He))}))}}return Z}function z(b){var S;return(((S=b.propsWizard)==null?void 0:S.propsSteps)||[]).filter(T=>ue(T)).map((T,D)=>{var we,pe,ke,be,Se,ve,Be;const Z=T.sectionsWizard||T.sections||[],fe=(Array.isArray(Z)?Z:[Z]).map(Ee=>{var Ae;let Oe=(Ae=Ee.type)==null?void 0:Ae.toUpperCase();return Oe||(Ee.propsForm||Ee.propsFormStep||Ee.fields?Oe="FORM":Ee.propsTable||Ee.propsTableStep||Ee.propsDataTableWizard||Ee.isDataTable?Oe="TABLE":Ee.propsButton||Ee.propsButtonStep?Oe="BUTTON":Oe="UNKNOWN"),{...Ee,type:Oe}}),ae=oe(T);return{key:T.modelKey||T.key||`step-${D}`,title:ae.title,description:ae.description,icon:T.icon||void 0,sections:fe,actions:((we=T.propsComponent)==null?void 0:we.actionComponent)||T.actionComponent||[],isSubmit:T.isSubmit||((pe=T.propsStep)==null?void 0:pe.isSubmit)||!1,endpointActionStepNext:((ke=T.propsStep)==null?void 0:ke.endpointActionStepNext)||T.endpointActionStepNext||((be=T.propsStep)==null?void 0:be.endpointSave)||T.endpointSave,endpointActionStepPrev:((Se=T.propsStep)==null?void 0:Se.endpointActionStepPrev)||T.endpointActionStepPrev,fieldMapping:((ve=T.propsStep)==null?void 0:ve.fieldMapping)||T.fieldMapping||{},responseMapping:((Be=T.propsStep)==null?void 0:Be.responseMapping)||T.responseMapping||{}}})}function G(){var b;if((b=r.value)!=null&&b.sections)for(let R=0;R<3;R++){let S=!1;if(r.value.sections.forEach(T=>{const D=(Z,J)=>{var pe,ke;const fe=J,we=(Z.propsForm||Z.propsFormStep||Z.propsTable||Z.propsTableStep||Z.propsDataTableWizard||Z.props||{}).fields||Z.fields||[];Z.component==="DynamicTableSection"||Z.type==="TABLE"||Z.type==="DATATABLE"||(we.forEach(be=>{if(!be.logic||typeof be.logic!="object")return;Object.keys(be.logic).filter(ve=>ve.toLowerCase().includes("calculaterule")&&be.logic[ve]&&typeof be.logic[ve]=="object").forEach(ve=>{const Be=be.logic[ve],Ee=Object.keys(Be)[0];if(!Ee)return;const Oe=fe?`${fe}.${Ee}`:Ee;let Ae=Be[Ee];if(Ae&&typeof Ae=="object"&&!Array.isArray(Ae)&&"formula"in Ae){if(Ae.condition&&!E(Ae.condition,e,`CALC-COND-${Ee}`,Oe))return;Ae=Ae.formula}const Re=E(Ae,e,`CALC-${Ee}`,Oe),De=Ye(e,Oe);Re!==void 0&&(Number.isNaN(Re)?!Number.isNaN(De):JSON.stringify(De)!==JSON.stringify(Re))&&(Xt(e,Oe,Re),S=!0)}),be.logic.copyRule&&(Array.isArray(be.logic.copyRule)?be.logic.copyRule:[be.logic.copyRule]).forEach(Be=>{const Ee=fe?`${fe}.${be.model}`:be.model,Oe=Be.condition?E(Be.condition,e,`COPY-COND-${be.model}`,Ee):!0;if(console.log(`[useFormLogic][COPY-RULE] Evaluating for field: ${be.model}, path: ${Ee}`,{conditionMet:Oe,source:Be.source}),Oe){let Ae;if(typeof Be.source=="string"?(Ae=B.value[Be.source],console.log(`[useFormLogic][COPY-RULE] Resolved source "${Be.source}" from normalizedData:`,Ae)):Be.source&&typeof Be.source=="object"&&(Ae=E(Be.source,e,`COPY-SRC-${be.model}`,Ee),console.log("[useFormLogic][COPY-RULE] Resolved object source:",Ae)),Ae!==void 0){const Re=Ye(e,Ee);console.log(`[useFormLogic][COPY-RULE] Comparing values for ${be.model}:`,{currentVal:Re,sourceVal:Ae,isDiff:JSON.stringify(Re)!==JSON.stringify(Ae)});let De=Ae;Ae&&typeof Ae=="object"&&Ae._isLogicValue&&(M(be.component,be.props||be.propsFieldCustom||be.propsFieldGlobal||{})||(De=Ae.code??Ae.id??Ae.value??Ae,console.log(`[useFormLogic][COPY-RULE] Unwrapping LogicValue for non-select target ${be.model}:`,De))),JSON.stringify(Re)!==JSON.stringify(De)&&(Xt(e,Ee,De),S=!0,console.log(`[useFormLogic][COPY-RULE] SUCCESS! Copied value to ${be.model}:`,De))}else console.log("[useFormLogic][COPY-RULE] Source value is undefined for source:",Be.source)}})}),((pe=Z.type)==null?void 0:pe.toUpperCase())==="WIZARD"&&(((ke=Z.propsWizard)==null?void 0:ke.propsSteps)||[]).forEach(Se=>{const ve=Se.key||Se.id,Be=Se.sectionsWizard||Se.sections||[];(Array.isArray(Be)?Be:[Be]).forEach(Oe=>D(Oe,ve))}))};D(T)}),!S)break}}function ee(b,R){if(!$(b)||!I(b))return!1;const S=R?`${R}.${b.model}`:b.model,T=n.value.paths.get(S),D=T?Ye(e,T.path):e[b.model];return Array.isArray(D)?D.length===0:D==null||D===""}function K(b){return b.sections.flatMap(S=>(S.propsForm||S.propsTable||S.props||{}).fields||S.fields||[]).some(S=>ee(S,b.key))}function Y(b){var T;if(!ue(b))return!1;const R=Pt(b);return(((T=b.propsForm)==null?void 0:T.fields)||b.fields||[]).some(D=>ee(D,R))?!0:b.type==="WIZARD"?z(b).some(K):!1}const F=o.computed(()=>{var b;return(b=r.value)!=null&&b.sections?Object.keys(t).length>0?!0:r.value.sections.some(Y):!1});function _(b){const R=new Set,S=(b==null?void 0:b.sections)||[];function T(D){D.forEach(Z=>{var ae;((Z.propsForm||Z.propsFormStep||Z.propsTable||Z.propsTableStep||Z.props||{}).fields||Z.fields||[]).forEach(we=>{var be,Se,ve,Be;(Array.isArray((be=we.logic)==null?void 0:be.fetchRule)?we.logic.fetchRule:[(Se=we.logic)==null?void 0:Se.fetchRule].filter(Boolean)).forEach(Ee=>{Array.isArray(Ee.revealSections)&&Ee.revealSections.forEach(Oe=>R.add(Oe))}),(Array.isArray((ve=we.logic)==null?void 0:ve.autoFetchRule)?we.logic.autoFetchRule:[(Be=we.logic)==null?void 0:Be.autoFetchRule].filter(Boolean)).forEach(Ee=>{Array.isArray(Ee.revealSections)&&Ee.revealSections.forEach(Oe=>R.add(Oe))})}),Z.type==="WIZARD"&&((ae=Z.propsWizard)!=null&&ae.propsSteps)&&Z.propsWizard.propsSteps.forEach(we=>{Array.isArray(we.sectionsWizard)?T(we.sectionsWizard):we.sectionsWizard&&T([we.sectionsWizard])})})}T(S),W.value=R}return o.watch(()=>r.value,b=>{_(b)},{deep:!0}),_(r.value),{normalizedData:B,getNormalizedData:j,evaluateLogic:E,resolveActiveRule:k,resolveValueIdentifier:N,getFilteredItems:se,isFieldVisible:$,isFieldRequired:I,isFieldDisabled:O,isFieldReadonly:q,isFieldHidden:X,resolveSectionLabels:oe,isSectionVisible:ue,isSectionHidden:te,resolveFieldLabels:re,resolveFieldLength:ge,resolveDefaultValue:ce,getWizardTabs:z,applyCalculations:G,isSubmitDisabled:F,resolveSectionGridClass:b=>{const R={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},S={1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},D=(Z=>{const J=String(Z||"FULL").toUpperCase(),fe=Number.parseInt(J);if(!Number.isNaN(fe)&&fe>0)return Math.min(12,fe);switch(J){case"FULL":case"ONE":return 1;case"HALF":case"TWO":return 2;case"THIRD":case"THREE":return 3;case"TWO-THIRD":case"TWO-THIRDS":return 3;case"QUARTER":case"QUARTED":case"FOUR":return 4;case"THREE-QUARTER":case"THREE-QUARTERS":return 4;default:return 1}})(b);return`${R[D]||"grid-cols-1"} ${S[D]||"md:grid-cols-1"}`},resolveFieldColumnClass:(b,R="FULL")=>{var pe;const S={1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},D=(ke=>{const be=String(ke||"FULL").toUpperCase(),Se=parseInt(be);if(!isNaN(Se)&&Se>0)return Math.min(12,Se);switch(be){case"FULL":case"ONE":return 1;case"HALF":case"TWO":return 2;case"THIRD":case"THREE":return 3;case"TWO-THIRD":case"TWO-THIRDS":return 3;case"QUARTER":case"QUARTED":case"FOUR":return 4;case"THREE-QUARTER":case"THREE-QUARTERS":return 4;default:return 1}})(R),Z=b.column||((pe=b.props)==null?void 0:pe.colSpan)||"FULL";let J=1;const fe=String(Z).toUpperCase(),ae=parseInt(fe);if(!isNaN(ae)&&ae>0)J=ae;else switch(fe){case"FULL":case"ONE":J=1;break;case"HALF":case"TWO":J=2;break;case"THIRD":case"THREE":J=3;break;case"QUARTER":case"QUARTED":case"FOUR":J=4;break;case"TWO-THIRD":case"TWO-THIRDS":J=2;break;case"THREE-QUARTER":case"THREE-QUARTERS":J=3;break;default:J=1}const we=Math.min(D,J);return D===1?"col-span-1":`col-span-1 ${S[we]||"md:col-span-1"}`}}}function fS({formData:e,locale:t,errors:n,fieldMap:i,activeSchema:r,isSectionVisible:s,isSectionHidden:a,isFieldVisible:l,isFieldRequired:c,resolveFieldLength:d}){const f=(m,g,v)=>{var C,M,B,N,j,W;const y=m.props||m.propsFieldCustom||m.propsFieldGlobal||{};let A="";if(g!=null)if(typeof g=="object")if(Array.isArray(g))A=g.length>0?"non-empty":"";else{const P=g.id??g.code??g.value??g.name??g.title??"";A=P==null?"":String(P).trim()}else A=String(g).trim();if(c(m,v)&&(!A||A===""))return t.value==="kr"||t.value==="ko"?`${((C=m.propsFieldGlobal)==null?void 0:C.labelKR)||((M=m.propsFieldCustom)==null?void 0:M.labelKR)||y.labelKR||m.labelKR||m.model||"필드"}은(는) 필수입니다.`:t.value==="id"?`${((B=m.propsFieldGlobal)==null?void 0:B.labelID)||((N=m.propsFieldCustom)==null?void 0:N.labelID)||y.labelID||m.labelID||m.model||"Field"} wajib diisi.`:`${((j=m.propsFieldGlobal)==null?void 0:j.labelEN)||((W=m.propsFieldCustom)==null?void 0:W.labelEN)||y.labelEN||m.labelEN||m.model||"Field"} is required.`;if(A&&A!==""){const P=d(m,v);if(P){const{minLength:E,maxLength:k}=P;if(E!=null&&A.length<E)return t.value==="kr"||t.value==="ko"?`최소 ${E}자를 입력해야 합니다.`:t.value==="id"?`Minimal ${E} karakter.`:`Minimum ${E} characters required.`;if(k!=null&&A.length>k)return t.value==="kr"||t.value==="ko"?`최대 ${k}자까지 입력할 수 있습니다.`:t.value==="id"?`Maksimal ${k} karakter.`:`Maximum ${k} characters allowed.`}}if(y.regex)try{if(!new RegExp(y.regex).test(A))return y.regexMessage||(t.value==="kr"||t.value==="ko"?"올바르지 않은 형식입니다":t.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${m.model}:`,y.regex)}return null};return{validateField:f,validateAll:()=>{var v,y;let m=!0;const g=(A,C)=>{var j;if(!s(A)||a&&a(A))return;const M=Pt(A)||C;((A.propsForm||A.propsFormStep||A.propsTable||A.propsTableStep||A.props||{}).fields||A.fields||[]).forEach(W=>{if(W.model&&l(W)){let P=W.model;const E=i.value.models.get(W.model);E&&E.length>0?P=(M&&E.find(q=>q.path.startsWith(`${M}.`))||E[0]).path:M&&(P=`${M}.${W.model}`);const k=i.value.paths.get(P),$=k?Ye(e,k.path):Ye(e,W.model)??e[W.model],I=f(W,$);I?(n[P]=I,m=!1):delete n[P]}}),(A.type==="WIZARD"||A.isWizard)&&(((j=A.propsWizard)==null?void 0:j.propsSteps)||[]).forEach(P=>{const E=P.key||P.id;P.sectionsWizard&&(Array.isArray(P.sectionsWizard)?P.sectionsWizard:[P.sectionsWizard]).forEach($=>g($,E))})};return(y=(v=r.value)==null?void 0:v.sections)==null||y.forEach(A=>g(A)),m}}}function Tq({formData:e,activeSchema:t,isSectionVisible:n,isFieldVisible:i,isFieldHidden:r,getWizardTabs:s,fieldMap:a,rawItemsCache:l}){const c=()=>{var y;const g=[],v=A=>{A==null||A.forEach(C=>{if(C.type==="TABLE"||C.propsTable||C.propsTableStep||C.propsDataTableWizard){const N=C.propsTable||C.propsTableStep||C.propsDataTableWizard||C,j=N.modelKey||N.modelDatatable||Pt(C);j&&g.push({key:j,subFields:(N.headers||[]).map(W=>W.key)})}((C.propsForm||C.propsFormStep||C.propsTable||C.propsTableStep||C.propsDataTableWizard||C.props||{}).fields||C.fields||[]).forEach(N=>{var W,P;const j=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(N.component);if(N.model&&((W=N.props)!=null&&W.multiple||((P=N.props)==null?void 0:P.valueType)==="array"||j)){const E=N.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];g.push({key:N.model,subFields:E})}}),C.type==="WIZARD"&&s(C).forEach(N=>v(N.sections))})};return v((y=t.value)==null?void 0:y.sections),g};return{getCleanPayload:()=>{var y;if(!((y=t.value)!=null&&y.sections))return{...e};const g={},v=new Set;return t.value.sections.forEach(A=>{const C=n(A),M=Pt(A),B=(E,k)=>{if(!E.model)return;const $=k?`${k}.${E.model}`:E.model,I=C&&(i(E,void 0,k)||r(E,void 0,k));let O=null;if(I&&(O=Ye(e,$)??e[E.model]??bo(e,E.model),["DCodeAutoComplete","DCodeSelect","DCodeRadio","DCodeRadioCustom"].includes(E.component)&&O!==null&&O!==void 0&&typeof O!="object")){const X=l[E.key];if(Array.isArray(X)){const oe=X.find(ue=>String(ue.code)===String(O)||String(ue.id)===String(O)||String(ue.name)===String(O));if(oe){const te=(E.props||E.propsFieldCustom||E.propsFieldGlobal||{}).itemValue||"id";O=oe[te]??oe.id??oe.code??O}}}Xt(g,$,yo(O)??null),v.add(E.model)},N=A.propsForm||A.propsFormStep||A.propsTable||A.propsTableStep||A.propsDataTableWizard||A.props||{},j=A.type==="WIZARD";(N.fields||A.fields||[]).forEach(E=>B(E,j?M||N.key:void 0)),A.type==="WIZARD"&&s(A).forEach(E=>E.sections.forEach(k=>{const $=Pt(k),I=$?`${E.key}.${$}`:E.key;if(k.type==="TABLE"||k.propsTable||k.propsTableStep||k.propsDataTableWizard){const q=k.propsTable||k.propsTableStep||k.propsDataTableWizard||k,X=q.modelKey||q.modelDatatable||$;if(X){const oe=`${E.key}.${X}`,ue=Ye(e,oe)||Ye(e,X)||[];if(Array.isArray(ue)){const te=q.headers||[],re=ue.filter(ge=>kd(ge)?!1:te.length>0?te.some(ce=>{if(ce.key==="no"||ce.key==="action")return!1;let se=Ye(ge,ce.key);if(se!=null&&se!=="")return!0;const z=ce.key.includes(".")?ce.key.split(".").pop():null;return!!(z&&(se=Ye(ge,z),se!=null&&se!==""))}):!0);Xt(g,oe,yo(re)),console.log(`[SUBMIT][WIZARD-TABLE][${oe}] Payload before sanitize:`,ue.length,"after:",re.length)}else Xt(g,oe,[]);v.add(oe)}}else((k.propsForm||k.propsFormStep||k.propsTable||k.propsTableStep||k.propsDataTableWizard||k.props||{}).fields||k.fields||[]).forEach(oe=>B(oe,I))}));const W=A.propsTable||A.propsTableStep||A.propsDataTableWizard,P=(W==null?void 0:W.modelKey)||(W==null?void 0:W.modelDatatable)||M;if(P&&(A.type==="TABLE"||A.propsTable||A.propsTableStep||A.propsDataTableWizard)){if(C){const E=Ye(e,P)||[];if(Array.isArray(E)){const k=(W==null?void 0:W.headers)||[],$=E.filter(I=>kd(I)?!1:k.length>0?k.some(O=>{if(O.key==="no"||O.key==="action")return!1;let q=Ye(I,O.key);if(q!=null&&q!=="")return!0;const X=O.key.includes(".")?O.key.split(".").pop():null;return!!(X&&(q=Ye(I,X),q!=null&&q!==""))}):!0);g[P]=yo($),console.log(`[SUBMIT][${P}] Payload before sanitize:`,E.length,"after:",$.length)}else g[P]=[]}else{const E=Ye(e,P);E!==void 0&&(g[P]=yo(E))}v.add(P)}}),["id","_id"].forEach(A=>{e[A]!==void 0&&!v.has(A)&&(g[A]=yo(e[A]))}),g},applyFieldMapping:(g,v)=>{const y={},A=(B,N)=>{var j,W;if(B==null)return B;if(typeof B=="object")return B._isLogicValue?B.id:B.id??B.code??B.value??B;if(N&&l&&(a!=null&&a.value)){const P=(W=(j=a.value.models)==null?void 0:j.get(N))==null?void 0:W[0],E=P==null?void 0:P.field;if(E){const k=l[E.key];if(Array.isArray(k)){const $=k.find(I=>String(I.code)===String(B)||String(I.id)===String(B));if($&&$.id!==void 0)return $.id}}}return Array.isArray(B)&&B.length===1?A(B[0],N):B},C=(B,N)=>{if(!B||typeof B!="object")return;if(B[N]!==void 0)return B[N];const j=N.toLowerCase(),W=Object.keys(B).find(P=>P.toLowerCase()===j);return W!==void 0?B[W]:void 0};Object.entries(v).forEach(([B,N])=>{if(typeof N=="string"){const j=Ye(g,B)??C(g,B)??Ye(e,B)??C(e,B)??bo(g,B)??bo(e,B);j!==void 0&&(y[N]=A(j,B))}else if(Array.isArray(N)&&N.length>0){const j=N[0];let W=Ye(g,B)??C(g,B)??Ye(e,B)??C(e,B)??bo(g,B)??bo(e,B);if(!Array.isArray(W)||W.length===0){const P=typeof j=="string"?[j]:Object.keys(j),E=c(),k=E.find($=>$.key.toLowerCase()===B.toLowerCase());if(k){const $=Ye(g,k.key)??C(g,k.key)??Ye(e,k.key)??C(e,k.key)??bo(g,k.key)??bo(e,k.key);Array.isArray($)&&$.length>0&&(W=$)}if(!Array.isArray(W)||W.length===0){const $=E.find(I=>P.some(O=>I.subFields.includes(O)));if($){const I=Ye(g,$.key)??C(g,$.key)??Ye(e,$.key)??C(e,$.key)??bo(g,$.key)??bo(e,$.key);Array.isArray(I)&&I.length>0&&(W=I)}}}if(Array.isArray(W)){if(typeof j=="string")y[B]=W.map(P=>{const k=yo(P)[j]??P[j]??null;return A(k,j)}).filter(P=>P!=null);else if(typeof j=="object"&&j!==null){const P=Object.entries(j);if(P.length===1&&typeof P[0][1]=="string"){const[k,$]=P[0];y[$]=W.map(I=>{const O=yo(I);let q=O[k]??I[k]??void 0;if(q==null&&(q=Ye(O,k)??Ye(I,k)??void 0),q==null&&k.includes(".")){const X=k.split(".");for(let oe=1;oe<X.length;oe++){const ue=X.slice(oe).join("."),te=O[ue]??Ye(O,ue)??I[ue]??Ye(I,ue)??void 0;if(te!=null){q=te;break}}}return A(q??null,k)}).filter(I=>I!=null)}else y[B]=W.map(k=>{const $={},I=yo(k);return P.forEach(([O,q])=>{if(Array.isArray(q)&&q.length>0&&typeof q[0]=="object"){const oe=q[0];let ue=I[O]??k[O]??void 0;ue==null&&(ue=Ye(I,O)??Ye(k,O)??void 0),Array.isArray(ue)?$[O]=ue.map(te=>{const re={},ge=yo(te);return Object.entries(oe).forEach(([ce,se])=>{let z=ge[ce]??te[ce]??void 0;if(z==null&&(z=Ye(ge,ce)??Ye(te,ce)??void 0),z==null&&ce.includes(".")){const G=ce.split(".");for(let ee=1;ee<G.length;ee++){const K=G.slice(ee).join("."),Y=ge[K]??Ye(ge,K)??te[K]??Ye(te,K)??void 0;if(Y!=null){z=Y;break}}}re[se]=A(z??null,ce)}),re}).filter(te=>!kd(te)):$[O]=[];return}let X=I[O]??k[O]??I[q]??k[q]??void 0;if(X==null&&(X=Ye(I,O)??Ye(k,O)??void 0),X==null&&O.includes(".")){const oe=O.split(".");for(let ue=1;ue<oe.length;ue++){const te=oe.slice(ue).join("."),re=I[te]??Ye(I,te)??k[te]??Ye(k,te)??void 0;if(re!=null){X=re;break}}}$[q]=A(X??null,O)}),$}).filter(k=>!kd(k))}}}});const M=Object.keys(y).filter(B=>B.includes("."));if(M.length>0)for(const B of M){const N=B.indexOf("."),j=B.substring(0,N),W=B.substring(N+1),P=y[j],E=y[B];if(Array.isArray(P)&&Array.isArray(E))for(const k of P)k&&typeof k=="object"&&(k[W]=E);delete y[B]}return y},handleResponseMapping:(g,v,y)=>{if(!g||!v)return;const A=g,C=(g==null?void 0:g.data)!==void 0?g.data:g,M=Array.isArray(C)?C[0]:C;Object.entries(v).forEach(([B,N])=>{if(typeof B!="string"||typeof N!="string")return;const j=(P,E)=>{if(!(!E||!P||typeof E!="string")){if(E in P)return P[E];try{return E.split(".").reduce((k,$)=>k&&k[$],P)}catch{return}}},W=j(A,B)??j(A,N)??(C&&typeof C=="object"?j(C,B)??j(C,N):void 0)??(M&&typeof M=="object"?j(M,B)??j(M,N):void 0);if(W!==void 0){const P=y&&!N.includes(".")?`${y}.${N}`:N;Xt(e,P,W)}})},handleClearMapping:(g,v)=>{g&&Object.values(g).forEach(y=>{if(typeof y!="string")return;const A=v&&!y.includes(".")?`${v}.${y}`:y;Xt(e,A,null)})},getFormArrayModels:c}}const Nf={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},xd={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},Gi={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},Pq={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},Bq={dangerouslyHTMLString:!1,multiple:!0,position:Nf.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},Nq={rtl:!1,newestOnTop:!1,toastClassName:""},hS={...Bq,...Nq};Gi.DEFAULT;var ln=(e=>(e[e.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",e[e.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",e.CSS_NAMESPACE="Toastify",e))(ln||{}),Gv=(e=>(e.ENTRANCE_ANIMATION_END="d",e))(Gv||{});const Dq={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},Mq={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},Rq={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},Iq={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},mS="Toastify--animate Toastify__none-enter";function pS(e,t=!1){var n;let i=Dq;if(!e||typeof e=="string")switch(e){case"flip":i=Iq;break;case"zoom":i=Rq;break;case"slide":i=Mq;break}else i=e;if(t)i.enter=mS;else if(i.enter===mS){const r=(n=i.exit.split("__")[1])==null?void 0:n.split("-")[0];i.enter=`Toastify--animate Toastify__${r}-enter`}return i}function Oq(e){return e.containerId||String(e.position)}const ag="will-unmount";function Lq(e=Nf.TOP_RIGHT){return!!document.querySelector(`.${ln.CSS_NAMESPACE}__toast-container--${e}`)}function Fq(e=Nf.TOP_RIGHT){return`${ln.CSS_NAMESPACE}__toast-container--${e}`}function $q(e,t,n=!1){const i=[`${ln.CSS_NAMESPACE}__toast-container`,`${ln.CSS_NAMESPACE}__toast-container--${e}`,n?`${ln.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Cd(t)?t({position:e,rtl:n,defaultClassName:i}):`${i} ${t||""}`}function zq(e){var t;const{position:n,containerClassName:i,rtl:r=!1,style:s={}}=e,a=ln.CSS_NAMESPACE,l=Fq(n),c=document.querySelector(`.${a}`),d=document.querySelector(`.${l}`),f=!!d&&!((t=d.className)!=null&&t.includes(ag)),h=c||document.createElement("div"),m=document.createElement("div");m.className=$q(n,i,r),m.dataset.testid=`${ln.CSS_NAMESPACE}__toast-container--${n}`,m.id=Oq(e);for(const g in s)if(Object.prototype.hasOwnProperty.call(s,g)){const v=s[g];m.style[g]=v}return c||(h.className=ln.CSS_NAMESPACE,document.body.appendChild(h)),f||h.appendChild(m),m}function Yv(e){var t,n,i;const r=typeof e=="string"?e:((t=e.currentTarget)==null?void 0:t.id)||((n=e.target)==null?void 0:n.id),s=document.getElementById(r);s&&s.removeEventListener("animationend",Yv,!1);try{Df[r].unmount(),(i=document.getElementById(r))==null||i.remove(),delete Df[r],delete vi[r]}catch{}}const Df=o.reactive({});function jq(e,t){const n=document.getElementById(String(t));n&&(Df[n.id]=e)}function Zv(e,t=!0){const n=String(e);if(!Df[n])return;const i=document.getElementById(n);i&&i.classList.add(ag),t?(Wq(e),i&&i.addEventListener("animationend",Yv,!1)):Yv(n),Kr.items=Kr.items.filter(r=>r.containerId!==e)}function Uq(e){for(const t in Df)Zv(t,e);Kr.items=[]}function gS(e,t){const n=document.getElementById(e.toastId);if(n){let i=e;i={...i,...pS(i.transition)};const r=i.appendPosition?`${i.exit}--${i.position}`:i.exit;n.className+=` ${r}`,t&&t(n)}}function Wq(e){for(const t in vi)if(t===e)for(const n of vi[t]||[])gS(n)}function Hq(e){const t=Ed().find(n=>n.toastId===e);return t==null?void 0:t.containerId}function Xv(e){return document.getElementById(e)}function qq(e){const t=Xv(e.containerId);return t&&t.classList.contains(ag)}function yS(e){var t;const n=o.isVNode(e.content)?o.toRaw(e.content.props):null;return n??o.toRaw((t=e.data)!=null?t:{})}function Kq(e){return e?Kr.items.filter(t=>t.containerId===e).length>0:Kr.items.length>0}function Gq(){if(Kr.items.length>0){const e=Kr.items.shift();lg(e==null?void 0:e.toastContent,e==null?void 0:e.toastProps)}}const vi=o.reactive({}),Kr=o.reactive({items:[]});function Ed(){const e=o.toRaw(vi);return Object.values(e).reduce((t,n)=>[...t,...n],[])}function Yq(e){return Ed().find(t=>t.toastId===e)}function lg(e,t={}){if(qq(t)){const n=Xv(t.containerId);n&&n.addEventListener("animationend",Jv.bind(null,e,t),!1)}else Jv(e,t)}function Jv(e,t={}){const n=Xv(t.containerId);n&&n.removeEventListener("animationend",Jv.bind(null,e,t),!1);const i=vi[t.containerId]||[],r=i.length>0;if(!r&&!Lq(t.position)){const s=zq(t),a=o.createApp(bK,t);t.useHandler&&t.useHandler(a),a.mount(s),jq(a,s.id)}r&&!t.updateId&&(t.position=i[0].position),o.nextTick(()=>{t.updateId?Er.update(t):Er.add(e,t)})}const Er={add(e,t){const{containerId:n=""}=t;n&&(vi[n]=vi[n]||[],vi[n].find(i=>i.toastId===t.toastId)||setTimeout(()=>{var i,r;t.newestOnTop?(i=vi[n])==null||i.unshift(t):(r=vi[n])==null||r.push(t),t.onOpen&&t.onOpen(yS(t))},t.delay||0))},remove(e){if(e){const t=Hq(e);if(t){const n=vi[t];let i=n.find(r=>r.toastId===e);vi[t]=n.filter(r=>r.toastId!==e),!vi[t].length&&!Kq(t)&&Zv(t,!1),Gq(),o.nextTick(()=>{i!=null&&i.onClose&&(i.onClose(yS(i)),i=void 0)})}}},update(e={}){const{containerId:t=""}=e;if(t&&e.updateId){vi[t]=vi[t]||[];const n=vi[t].find(s=>s.toastId===e.toastId),i=(n==null?void 0:n.position)!==e.position||(n==null?void 0:n.transition)!==e.transition,r={...e,disabledEnterTransition:!i,updateId:void 0};Er.dismissForce(e==null?void 0:e.toastId),setTimeout(()=>{xt(r.content,r)},e.delay||0)}},clear(e,t=!0){e?Zv(e,t):Uq(t)},dismissCallback(e){var t;const n=(t=e.currentTarget)==null?void 0:t.id,i=document.getElementById(n);i&&(i.removeEventListener("animationend",Er.dismissCallback,!1),setTimeout(()=>{Er.remove(n)}))},dismiss(e){if(e){const t=Ed();for(const n of t)if(n.toastId===e){gS(n,i=>{i.addEventListener("animationend",Er.dismissCallback,!1)});break}}},dismissForce(e){if(e){const t=Ed();for(const n of t)if(n.toastId===e){const i=document.getElementById(e);i&&(i.remove(),i.removeEventListener("animationend",Er.dismissCallback,!1),Er.remove(e));break}}}},Zq=o.reactive({useHandler:void 0}),bS=o.reactive({}),cg=o.reactive({});function vS(){return Math.random().toString(36).substring(2,9)}function Xq(e){return typeof e=="number"&&!isNaN(e)}function Qv(e){return typeof e=="string"}function Cd(e){return typeof e=="function"}function dg(...e){return o.mergeProps(...e)}function ug(e){return typeof e=="object"&&(!!(e!=null&&e.render)||!!(e!=null&&e.setup)||typeof(e==null?void 0:e.type)=="object")}function Jq(e={}){bS[`${ln.CSS_NAMESPACE}-default-options`]=e}function wS(){return bS[`${ln.CSS_NAMESPACE}-default-options`]||hS}function Qq(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||e?"dark":"light"}var fg=(e=>(e[e.Enter=0]="Enter",e[e.Exit=1]="Exit",e))(fg||{});const _S={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:Nf.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:xd.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:Gi.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},Vq={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:Gi.DEFAULT},theme:{type:String,required:!1,default:xd.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},eK=o.defineComponent({name:"ProgressBar",props:Vq,setup(e,{attrs:t}){const n=o.ref(),i=o.computed(()=>e.hide?"true":"false"),r=o.computed(()=>({...t.style||{},animationDuration:`${e.autoClose===!0?5e3:e.autoClose}ms`,animationPlayState:e.isRunning?"running":"paused",opacity:e.hide||e.autoClose===!1?0:1,transform:e.controlledProgress?`scaleX(${e.progress})`:"none"})),s=o.computed(()=>[`${ln.CSS_NAMESPACE}__progress-bar`,e.controlledProgress?`${ln.CSS_NAMESPACE}__progress-bar--controlled`:`${ln.CSS_NAMESPACE}__progress-bar--animated`,`${ln.CSS_NAMESPACE}__progress-bar-theme--${e.theme}`,`${ln.CSS_NAMESPACE}__progress-bar--${e.type}`,e.rtl?`${ln.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),a=o.computed(()=>`${s.value} ${(t==null?void 0:t.class)||""}`),l=()=>{n.value&&(n.value.onanimationend=null,n.value.ontransitionend=null)},c=()=>{e.isIn&&e.closeToast&&e.autoClose!==!1&&(e.closeToast(),l())},d=o.computed(()=>e.controlledProgress?null:c),f=o.computed(()=>e.controlledProgress?c:null);return o.watchEffect(()=>{n.value&&(l(),n.value.onanimationend=d.value,n.value.ontransitionend=f.value)}),()=>o.createVNode("div",{ref:n,role:"progressbar","aria-hidden":i.value,"aria-label":"notification timer",class:a.value,style:r.value},null)}}),tK=o.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:xd.AUTO},type:{type:String,required:!1,default:xd.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(e){return()=>o.createVNode("button",{class:`${ln.CSS_NAMESPACE}__close-button ${ln.CSS_NAMESPACE}__close-button--${e.theme}`,type:"button",onClick:t=>{t.stopPropagation(),e.closeToast&&e.closeToast(t)},"aria-label":e.ariaLabel},[o.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[o.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),hg=({theme:e,type:t,path:n,...i})=>o.createVNode("svg",o.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`}},i),[o.createVNode("path",{d:n},null)]);function nK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function iK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function rK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function oK(e){return o.createVNode(hg,o.mergeProps(e,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function sK(){return o.createVNode("div",{class:`${ln.CSS_NAMESPACE}__spinner`},null)}const mg={info:iK,warning:nK,success:rK,error:oK,spinner:sK},aK=e=>e in mg;function lK({theme:e,type:t,isLoading:n,icon:i}){let r;const s=!!n||t==="loading",a={theme:e,type:t};if(s&&(i===void 0||typeof i=="boolean"))return mg.spinner();if(i!==!1){if(ug(i))r=o.toRaw(i);else if(Cd(i)){const l=i;a.type=s?"loading":t,r=l(a),r=!r&&s?mg.spinner():r}else o.isVNode(i)?r=o.cloneVNode(i,a):Qv(i)||Xq(i)?r=i:aK(t)&&(r=mg[t](a));return r}}const cK=()=>{};function dK(e,t,n=ln.COLLAPSE_DURATION){const{scrollHeight:i,style:r}=e,s=n;requestAnimationFrame(()=>{r.minHeight="initial",r.height=i+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,s)})})}function uK(e){const t=o.ref(!1),n=o.ref(!1),i=o.ref(!1),r=o.ref(fg.Enter),s=o.reactive({...e,appendPosition:e.appendPosition||!1,collapse:typeof e.collapse>"u"?!0:e.collapse,collapseDuration:e.collapseDuration||ln.COLLAPSE_DURATION}),a=s.done||cK,l=o.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=o.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=o.computed(()=>e.pauseOnHover?{onMouseenter:A,onMouseleave:y}:{});function f(){const M=l.value.split(" ");m().addEventListener(Gv.ENTRANCE_ANIMATION_END,y,{once:!0});const B=j=>{const W=m();j.target===W&&(W.dispatchEvent(new Event(Gv.ENTRANCE_ANIMATION_END)),W.removeEventListener("animationend",B),W.removeEventListener("animationcancel",B),r.value===fg.Enter&&j.type!=="animationcancel"&&W.classList.remove(...M))},N=()=>{const j=m();j.classList.add(...M),j.addEventListener("animationend",B),j.addEventListener("animationcancel",B)};e.pauseOnFocusLoss&&g(),N()}function h(){if(!m())return;const M=()=>{const N=m();N.removeEventListener("animationend",M),s.collapse?dK(N,a,s.collapseDuration):a()},B=()=>{const N=m();r.value=fg.Exit,N&&(N.className+=` ${c.value}`,N.addEventListener("animationend",M))};n.value||(i.value?M():setTimeout(B))}function m(){return e.toastRef.value}function g(){document.hasFocus()||A(),window.addEventListener("focus",y),window.addEventListener("blur",A)}function v(){window.removeEventListener("focus",y),window.removeEventListener("blur",A)}function y(){(!e.loading.value||e.isLoading===void 0)&&(t.value=!0)}function A(){t.value=!1}function C(M){M&&(M.stopPropagation(),M.preventDefault()),n.value=!1}return o.watchEffect(h),o.watchEffect(()=>{const M=Ed();n.value=M.findIndex(B=>B.toastId===s.toastId)>-1}),o.watchEffect(()=>{e.isLoading!==void 0&&(e.loading.value?A():y())}),o.onMounted(f),o.onUnmounted(()=>{e.pauseOnFocusLoss&&v()}),{isIn:n,isRunning:t,hideToast:C,eventHandlers:d}}function fK(e){if(!e||typeof e!="object"||Array.isArray(e)||e.__v_isVNode)return!1;const t=e;return["title","content"].some(n=>n in t)}const hK=o.defineComponent({name:"ToastItem",inheritAttrs:!1,props:_S,setup(e){const t=o.ref(),n=o.computed(()=>!!e.isLoading),i=o.computed(()=>e.progress!==void 0&&e.progress!==null),r=o.computed(()=>lK(e)),s=o.computed(()=>[`${ln.CSS_NAMESPACE}__toast`,`${ln.CSS_NAMESPACE}__toast-theme--${e.theme}`,`${ln.CSS_NAMESPACE}__toast--${e.type}`,e.rtl?`${ln.CSS_NAMESPACE}__toast--rtl`:void 0,e.toastClassName||""].filter(Boolean).join(" ")),{isRunning:a,isIn:l,hideToast:c,eventHandlers:d}=uK({toastRef:t,loading:n,done:()=>{Er.remove(e.toastId)},...pS(e.transition,e.disabledEnterTransition),...e});function f(){const h=e.content;if(fK(h)){const m=[];return h.title!==void 0&&m.push(o.createVNode("div",{"data-testid":"toast-text-title",class:`${ln.CSS_NAMESPACE}__toast-text-title`},[h.title])),h.content!==void 0&&m.push(o.createVNode("div",{"data-testid":"toast-text-content",class:`${ln.CSS_NAMESPACE}__toast-text-content`},[h.content])),o.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${ln.CSS_NAMESPACE}__toast-text`},[m])}return ug(h)?o.h(o.toRaw(h),{toastProps:o.toRaw(e),closeToast:c,data:e.data,...e.expandCustomProps?e.contentProps:{contentProps:e.contentProps||{}}}):Cd(h)?h({toastProps:o.toRaw(e),closeToast:c,data:e.data}):e.dangerouslyHTMLString?o.h("div",{innerHTML:h}):h}return()=>o.createVNode("div",o.mergeProps({id:e.toastId,class:s.value,style:e.toastStyle||{},ref:t,"data-testid":`toast-item-${e.toastId}`,onClick:h=>{e.closeOnClick&&c(),e.onClick&&e.onClick(h)}},d.value),[o.createVNode("div",{role:e.role,"data-testid":"toast-body",class:`${ln.CSS_NAMESPACE}__toast-body ${e.bodyClassName||""}`},[r.value!=null&&o.createVNode("div",{"data-testid":`toast-icon-${e.type}`,class:[`${ln.CSS_NAMESPACE}__toast-icon`,e.isLoading?"":`${ln.CSS_NAMESPACE}--animate-icon ${ln.CSS_NAMESPACE}__zoom-enter`].join(" ")},[ug(r.value)?o.h(o.toRaw(r.value),{theme:e.theme,type:e.type}):Cd(r.value)?r.value({theme:e.theme,type:e.type}):r.value]),o.createVNode("div",{"data-testid":"toast-content"},[f()])]),(e.closeButton===void 0||e.closeButton===!0)&&o.createVNode(tK,{theme:e.theme,closeToast:h=>{h.stopPropagation(),h.preventDefault(),c()}},null),ug(e.closeButton)?o.h(o.toRaw(e.closeButton),{closeToast:c,type:e.type,theme:e.theme}):Cd(e.closeButton)?e.closeButton({closeToast:c,type:e.type,theme:e.theme}):null,o.createVNode(eK,{className:e.progressClassName,style:e.progressStyle,rtl:e.rtl,theme:e.theme,isIn:l.value,type:e.type,hide:e.hideProgressBar,isRunning:a.value,autoClose:e.autoClose,controlledProgress:i.value,progress:e.progress,closeToast:e.isLoading?void 0:c},null)])}}),pg="vue3-toastify:url-change";let gg=0,Mf;function mK(){if(!(typeof window>"u")&&cg.lastUrl!==window.location.href){cg.lastUrl=window.location.href;const e=n=>typeof n.clearOnUrlChange=="boolean"?n.clearOnUrlChange:wS().clearOnUrlChange!==!1,t=Object.values(vi).reduce((n,i)=>(Array.isArray(i)&&n.push(...i),n),[]);for(const n of t)n.toastId&&e(n)&&Er.dismiss(n.toastId);Kr.items=Kr.items.filter(n=>!e(n.toastProps))}}function pK(){const{history:e}=window,t=e.pushState,n=e.replaceState;return e.pushState=function(...i){const r=t.apply(this,i);return window.dispatchEvent(new Event(pg)),r},e.replaceState=function(...i){const r=n.apply(this,i);return window.dispatchEvent(new Event(pg)),r},()=>{e.pushState=t,e.replaceState=n}}function gK(){if(typeof window>"u"||Mf)return;const e=pK(),t=()=>mK();window.addEventListener(pg,t),window.addEventListener("popstate",t),window.addEventListener("hashchange",t),Mf=()=>{e(),window.removeEventListener(pg,t),window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),Mf=void 0}}function yK(){Mf&&(Mf(),cg.lastUrl="")}const bK=o.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:_S,setup(e){const t=o.computed(()=>e.containerId),n=o.computed(()=>vi[t.value]||[]),i=o.computed(()=>n.value.filter(r=>r.position===e.position));return o.onMounted(()=>{typeof window<"u"&&(gg+=1,gK())}),o.onUnmounted(()=>{typeof window<"u"&&gg>0&&(gg-=1,gg===0&&yK())}),()=>o.createVNode(o.Fragment,null,[i.value.map(r=>{const{toastId:s=""}=r;return o.createVNode(hK,o.mergeProps({key:s},r),null)})])}});let Vv=!1;const kS={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function xS(){const e=[];return Ed().forEach(t=>{const n=document.getElementById(t.containerId);n&&!n.classList.contains(ag)&&e.push(t)}),e}function vK(e){const t=xS().length,n=e??0;return n>0&&t+Kr.items.length>=n}function wK(e){vK(e.limit)&&!e.updateId&&Kr.items.push({toastId:e.toastId,containerId:e.containerId,toastContent:e.content,toastProps:e})}function Ba(e,t,n={}){if(Vv)return;n=dg(wS(),{type:t},o.toRaw(n)),(!n.toastId||typeof n.toastId!="string"&&typeof n.toastId!="number")&&(n.toastId=vS()),n={...n,...n.type==="loading"?kS:{},content:e,containerId:n.containerId||String(n.position)};const i=Number(n==null?void 0:n.progress);return!isNaN(i)&&i<0&&(n.progress=0),i>1&&(n.progress=1),n.theme==="auto"&&(n.theme=Qq()),wK(n),cg.lastUrl=window.location.href,n.multiple?Kr.items.length?n.updateId&&lg(e,n):lg(e,n):(Vv=!0,xt.clearAll(void 0,!1),setTimeout(()=>{lg(e,n)},0),setTimeout(()=>{Vv=!1},390)),n.toastId}const xt=(e,t)=>Ba(e,Gi.DEFAULT,t);xt.info=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.INFO}),xt.error=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.ERROR}),xt.warning=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.WARNING}),xt.warn=xt.warning,xt.success=(e,t)=>Ba(e,Gi.DEFAULT,{...t,type:Gi.SUCCESS}),xt.loading=(e,t)=>Ba(e,Gi.DEFAULT,dg(t,kS)),xt.dark=(e,t)=>Ba(e,Gi.DEFAULT,dg(t,{theme:xd.DARK})),xt.remove=e=>{e?Er.dismiss(e):Er.clear()},xt.clearAll=(e,t)=>{o.nextTick(()=>{Er.clear(e,t)})},xt.isActive=e=>{let t=!1;return t=xS().findIndex(n=>n.toastId===e)>-1,t},xt.update=(e,t={})=>{setTimeout(()=>{const n=Yq(e);if(n){const i=o.toRaw(n),{content:r}=i,s={...i,...t,toastId:t.toastId||e,updateId:vS()},a=s.render||r;delete s.render,Ba(a,s.type,s)}},0)},xt.done=e=>{xt.update(e,{isLoading:!1,progress:1})},xt.promise=_K;function _K(e,{pending:t,error:n,success:i},r){var s,a,l;let c;const d={...r||{},autoClose:!1};t&&(c=Qv(t)?xt.loading(t,d):xt.loading(t.render,{...d,...t}));const f={autoClose:(s=r==null?void 0:r.autoClose)!=null?s:!0,closeOnClick:(a=r==null?void 0:r.closeOnClick)!=null?a:!0,closeButton:(l=r==null?void 0:r.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},h=(g,v,y)=>{if(v==null){xt.remove(c);return}const A={type:g,...f,...r,data:y},C=Qv(v)?{render:v}:v;return c?xt.update(c,{...A,...C,isLoading:!1}):xt(C.render,{...A,...C,isLoading:!1}),y},m=Cd(e)?e():e;return m.then(g=>{h("success",i,g)}).catch(g=>{h("error",n,g)}),m}xt.POSITION=Nf,xt.THEME=xd,xt.TYPE=Gi,xt.TRANSITIONS=Pq;const kK={install(e,t={}){Zq.useHandler=t.useHandler||(()=>{}),xK(t)}};typeof window<"u"&&(window.Vue3Toastify=kK);function xK(e={}){const t=dg(hS,e);Jq(t)}function EK({state:e,props:t,emit:n,apiUrl:i,router:r,locale:s,mapping:a,validation:l,fieldMap:c,activeSchema:d,resolvedBaseUrl:f,resolveKeyParams:h,navigation:m,logic:g}){const v=k=>{if(t.dummyMode)return!0;if(k.permission&&t.checkPermission){let $=t.checkPermission(k.permission);if(!$&&k.permission!==k.permission.toLowerCase()&&($=t.checkPermission(k.permission.toLowerCase())),!$)return!1}return k.permission==="CREATE"?!t.isEditMode:k.permission==="UPDATE"?t.isEditMode:!0},y=k=>{if(!k)return null;const $=k.match(/filename\*=(?:UTF-8'')?([^;\n]+)/i);if($){const O=$[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(O)}catch{return O}}const I=k.match(/filename=(?:"?)([^";]+)(?:"?)/i);if(I){const O=I[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(O)}catch{return O}}return null},A=(k,$)=>{if(!k||!k.headers)return null;const I=k.headers;if(typeof I.get=="function")return I.get($);const O=Object.keys(I).find(q=>q.toLowerCase()===$.toLowerCase());return O?I[O]:null},C=k=>{const $=A(k,"content-disposition")||A(k,"Content-Disposition"),I=y($);return k instanceof Blob?{blob:k,filename:I}:(k==null?void 0:k.data)instanceof Blob?{blob:k.data,filename:I}:{blob:k,filename:I}},M=(k,$)=>{if(console.log("🚀 handleNavigation called with:",k),!k||!k.targetSection){console.warn("⚠️ Invalid navigation config - missing targetSection");return}if(!m){console.error("❌ Navigation object not available");return}if(typeof m.navigateTo!="function"){console.error("❌ navigation.navigateTo method not available");return}console.log("📍 Calling navigation.navigateTo"),m.navigateTo(k,$),console.log("✅ Navigation handling complete")},B=k=>{var $,I,O,q,X,oe;if(k.triggerNavigation){M(k.triggerNavigation);return}k.requireConfirm?(e.confirmDialog.title=s.value==="kr"||s.value==="ko"?(($=k.propCustomMessage)==null?void 0:$.titleKR)||"확인":s.value==="id"?((I=k.propCustomMessage)==null?void 0:I.titleID)||"Konfirmasi":((O=k.propCustomMessage)==null?void 0:O.titleEN)||"Confirm",e.confirmDialog.message=s.value==="kr"||s.value==="ko"?((q=k.propCustomMessage)==null?void 0:q.messageKR)||"계속하시겠습니까?":s.value==="id"?((X=k.propCustomMessage)==null?void 0:X.messageID)||"Lanjutkan?":((oe=k.propCustomMessage)==null?void 0:oe.messageEN)||"Continue?",e.confirmDialog.action=k,e.confirmDialog.visible=!0):j(k)},N=()=>{const k=e.confirmDialog.redirectUrl;if(e.confirmDialog.visible=!1,e.confirmDialog.action&&(typeof e.confirmDialog.action=="function"?e.confirmDialog.action():typeof e.confirmDialog.action.callback=="function"?e.confirmDialog.action.callback():j(e.confirmDialog.action)),k&&r){const $=k.startsWith("/")?k:"/"+k;r.push($)}e.confirmDialog.redirectUrl="",e.confirmDialog.isBlocking=!1},j=async k=>{var oe,ue,te,re,ge,ce,se;const $=k.propsActionGlobal||k.props||{},I=a.getCleanPayload(),O=$.fieldMapping||k.fieldMapping||{},q=a.applyFieldMapping(I,O);if(n("action",k,q),k.triggerNavigation&&m&&g){const z=e.tableRowFormData||q||{};k.triggerNavigation.condition?g.evaluateLogic(k.triggerNavigation.condition,z,"NAVIGATION")&&m.navigateTo(k.triggerNavigation,z):m.navigateTo(k.triggerNavigation,z)}const X=$.endpointDialogActionSave||k.endpointDialogActionSave||$.endpointDialogAction||k.endpointDialogAction||$.endpointAction||k.endpointAction||$.endpointPropAction||k.endpointPropAction||$.endpoint||k.endpoint;if(console.log("[SUBMIT][DIAGNOSTIC] action type:",$.type,"| endpoint apiUrl:",(X==null?void 0:X.apiUrl)||"MISSING","| action key:",k.key||((oe=k.propsActionGlobal)==null?void 0:oe.key)),($.type==="SUBMIT"||$.type==="ACTION")&&(X!=null&&X.apiUrl)){if(t.dummyMode){xt.info(s.value==="kr"||s.value==="ko"?"제출 작업 시뮬레이션 (더미 모드)":s.value==="id"?"Simulasi aksi Submit (Dummy Mode)":"Action Submit simulated (Dummy Mode)",{autoClose:2e3}),n("success",{dummy:!0});return}const z=xt.loading(s.value==="kr"||s.value==="ko"?"처리 중...":s.value==="id"?"Memproses...":"Processing..."),G=vo(X.apiUrl,f.value);try{let ee={...q};if(h&&Array.isArray(X.keyParam)){const R=h(X.keyParam);console.log("[SUBMIT] Resolved keyParams for action:",R),Object.assign(ee,R)}const K=X.responseType==="blob"||X.responseType==="arraybuffer"||X.accept&&!X.accept.includes("json")||X.apiUrl&&(X.apiUrl.includes("/export")||X.apiUrl.includes("/download"))||G&&(G.includes("/export")||G.includes("/download")||G.includes("format="))||k.actionType==="EXPORT"||k.permission==="EXPORT"||$.type==="EXPORT"||$.permission==="EXPORT",Y=X.config?{...X.config}:{};X.accept&&(Y.headers||(Y.headers={}),Y.headers.Accept=X.accept,Y.headers.accept=X.accept),K&&(Y.responseType=X.responseType||"blob"),console.log("[SUBMIT] Starting API call to:",G,"with payload/params:",ee,"and config:",Y);const F=await i(G,X.apiMethod||"POST",ee,Y);if(console.log("[SUBMIT] API response received:",F),K&&(F instanceof Blob||((ue=F==null?void 0:F.constructor)==null?void 0:ue.name)==="Blob"||(F==null?void 0:F.size)!==void 0||(F==null?void 0:F.data)instanceof Blob||((re=(te=F==null?void 0:F.data)==null?void 0:te.constructor)==null?void 0:re.name)==="Blob"||((ge=F==null?void 0:F.data)==null?void 0:ge.size)!==void 0||(F==null?void 0:F.data)instanceof ArrayBuffer)){const{blob:R,filename:S}=C(F),T=R instanceof Blob?R:new Blob([R],{type:X.accept||"application/octet-stream"});if(T.type==="application/json"){const ve=new FileReader;ve.onload=()=>{try{const Ee=JSON.parse(ve.result).message||(s.value==="id"?"Gagal mengunduh file":"Failed to download file");xt.update(z,{render:Ee,type:"error",isLoading:!1,autoClose:5e3})}catch{const Ee=window.URL.createObjectURL(T),Oe=document.createElement("a");Oe.href=Ee;const Ae=k.label||$.labelID||$.labelEN||"Export",Re=S||`${Ae}_${new Date().toISOString().slice(0,10)}.pdf`;Oe.setAttribute("download",Re),document.body.appendChild(Oe),Oe.click(),Oe.remove(),setTimeout(()=>window.URL.revokeObjectURL(Ee),1e3),xt.update(z,{render:s.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3})}},ve.readAsText(T),e.isSubmitting.value=!1;return}const D=window.URL.createObjectURL(T),Z=document.createElement("a");Z.href=D;let J="bin";const fe=(X.accept||"").toLowerCase(),ae=(X.apiUrl||"").toLowerCase(),we=(T.type||"").toLowerCase(),pe=((ee==null?void 0:ee.format)||"").toLowerCase(),ke=G.toLowerCase();fe.includes("pdf")||we.includes("pdf")||pe==="pdf"||ke.includes("format=pdf")||ke.includes("pdf")?J="pdf":fe.includes("excel")||fe.includes("sheet")||fe.includes("spreadsheet")||fe.includes("xlsx")||we.includes("excel")||we.includes("spreadsheet")||pe==="xlsx"||pe==="excel"||ke.includes("format=excel")?J="xlsx":fe.includes("csv")||we.includes("csv")||pe==="csv"||ke.includes("format=csv")?J="csv":fe.includes("zip")||we.includes("zip")||pe==="zip"||ke.includes("format=zip")?J="zip":fe.includes("txt")||we.includes("txt")||pe==="txt"||ke.includes("format=txt")||ke.includes("txt")?J="txt":ae.includes("pdf")?J="pdf":ae.includes("excel")||ae.includes("xlsx")?J="xlsx":ae.includes("csv")?J="csv":ae.includes("zip")?J="zip":ae.includes("txt")&&(J="txt");const be=k.label||$.labelID||$.labelEN||"Export";let Se=S||`${be}_${new Date().toISOString().slice(0,10)}.${J}`;J==="txt"&&Se.toLowerCase().endsWith(".bin")&&(Se=Se.replace(/\.bin$/i,".txt")),Z.setAttribute("download",Se),document.body.appendChild(Z),Z.click(),Z.remove(),setTimeout(()=>window.URL.revokeObjectURL(D),1e3),xt.update(z,{render:s.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3}),e.isSubmitting.value=!1,n("success",F);return}const _=(F==null?void 0:F.status)===!0;console.log("[SUBMIT] response.status:",F==null?void 0:F.status),console.log("[SUBMIT] isSuccess evaluated as:",_);const b=(F==null?void 0:F.message)||(_?s.value==="kr"||s.value==="ko"?"성공":s.value==="id"?"Sukses":"Success":s.value==="kr"||s.value==="ko"?"실패":s.value==="id"?"Gagal":"Failed");if(xt.update(z,{render:b,type:_?"success":"error",isLoading:!1,autoClose:_?2e3:5e3}),_){if(console.log("[SUBMIT] Success condition passed"),($.fieldMapping||k.fieldMapping)&&(console.log("[SUBMIT] Applying field mapping for response"),a.handleResponseMapping(F,$.fieldMapping||k.fieldMapping)),n("success",F),r){const R=$.routeBack;console.log("[SUBMIT] routeBack value:",R);const S=T=>{if(!T){console.log("[SUBMIT] No path provided for navigation");return}const D=T.startsWith("/")?T:"/"+T;console.log("[SUBMIT] Triggering router.push to:",D),setTimeout(()=>{r.push(D).then(()=>{console.log("[SUBMIT] Router push success")}).catch(Z=>{console.error("[SUBMIT] Router push failed:",Z)})},150)};if(R)S(R);else{console.log("[SUBMIT] routeBack missing, attempting directory-up fallback");const Z=((((ce=r.currentRoute)==null?void 0:ce.value)||r.currentRoute||{}).path||"/").split("/").filter(Boolean);Z.length>1?(Z.pop(),S("/"+Z.join("/"))):S("/")}}try{let R=(F==null?void 0:F.data)||(F==null?void 0:F.payload)||F;if(Array.isArray(R)&&R.length>0&&(R=R[0]),R&&typeof R=="object"&&r){const T={...(((se=r.currentRoute)==null?void 0:se.value)||r.currentRoute||{}).query||{}};let D=!1;const Z=Bf(R),J=["status","success","code","message","error","errorCode","errorMessage"];if(Object.entries(Z).forEach(([fe,ae])=>{!J.includes(fe)&&ae!==null&&ae!==void 0&&(typeof ae=="string"||typeof ae=="number"||typeof ae=="boolean")&&T[fe]!==String(ae)&&(T[fe]=String(ae),D=!0)}),D&&typeof window<"u"&&window.history){const fe=new URL(window.location.href);Object.entries(T).forEach(([ae,we])=>{we!=null&&fe.searchParams.set(ae,String(we))}),window.history.replaceState(window.history.state,"",fe.toString())}}}catch(R){console.warn("[SUBMIT] Failed to update query params:",R)}}else console.log("[SUBMIT] Success condition failed (status is not true). Navigation aborted."),n("error",F)}catch(ee){console.error("[SUBMIT] Critical error during action execution. Navigation aborted.",ee),xt.error(ee.message||"Action failed"),n("error",ee)}finally{e.isSubmitting.value=!1}return}else if($.type==="SUBMIT"){if(t.dummyMode){xt.info(s.value==="kr"||s.value==="ko"?"제출 작업 시뮬레이션 (더미 모드)":s.value==="id"?"Simulasi aksi Submit (Dummy Mode)":"Action Submit simulated (Dummy Mode)",{autoClose:2e3});return}n("submit",q)}$.keyRedirect&&$.route&&r&&(console.log("[SUBMIT] Triggering synchronous keyRedirect navigation to:",$.route),r.push($.route))};return{isActionVisible:v,handleGlobalButtonClick:B,confirmAction:N,performAction:j,handleSubmit:async()=>{var k,$;if(t.dummyMode){xt.info(s.value==="kr"||s.value==="ko"?"제출 작업 시뮬레이션 (더미 모드)":s.value==="id"?"Simulasi aksi Submit (Dummy Mode)":"Action Submit simulated (Dummy Mode)",{autoClose:2e3});return}if(e.isSubmitted.value=!0,!!l.validateAll()){e.isSubmitting.value=!0;try{const I=a.getCleanPayload(),O=(((k=d.value)==null?void 0:k.actions)||[]).find(X=>{var oe;return X.type==="SUBMIT"||X.key==="SUBMIT"||((oe=X.propsActionGlobal)==null?void 0:oe.type)==="SUBMIT"}),q=(O==null?void 0:O.fieldMapping)||(($=O==null?void 0:O.propsActionGlobal)==null?void 0:$.fieldMapping);n("submit",q?a.applyFieldMapping(I,q):I)}finally{e.isSubmitting.value=!1}}},handleCancel:()=>n("cancel"),handleFieldUpdate:(k,$,I)=>{var te;let O=k;const q=c.value.models.get(k);q&&q.length>0&&(O=(I&&q.find(ge=>ge.path.startsWith(`${I}.`))||q[0]).path);const X=Ye(e.formData,O),oe=re=>re==null||re===""||Array.isArray(re)&&re.length===0?null:re;JSON.stringify(oe($))!==JSON.stringify(oe(X))&&(e.touched[O]=!0),I?Xt(e.formData,O,$):e.formData[k]=$;const ue=(te=c.value.paths.get(O))==null?void 0:te.field;if(ue){const re=l.validateField(ue,$);re?e.errors[O]=re:delete e.errors[O]}}}}function CK(e){const{formData:t,emit:n,mapping:i,validation:r,locale:s,logic:a,state:l,activeSchema:c,prefetchFieldItems:d,triggerFetchRule:f,navigation:h}=e,m=o.ref(!1),g=o.ref(""),v=o.ref("Plus"),y=o.ref([]),A=o.ref("md"),C=(l==null?void 0:l.tableRowFormData)||o.reactive({});console.log("[useFormTable][DEBUG] Init. State passed:",!!l,"Identity Match:",C===(l==null?void 0:l.tableRowFormData)),console.log("[useFormTable][DEBUG] tableRowFormData keys:",Object.keys(C));const M=o.reactive({}),B=o.ref(""),N=o.ref(null),j=o.ref(!1),W=o.ref(null),P=o.ref(!1),E=new Map,k=()=>{!a||!y.value.length||y.value.forEach(z=>{var S,T,D,Z;const G=z.model;if(!G)return;const ee=z.key||G,K=G,Y={visibleRule:(S=z.logic)==null?void 0:S.visibleRule,disabledRule:(T=z.logic)==null?void 0:T.disabledRule,optionsFilterRule:(D=z.logic)==null?void 0:D.optionsFilterRule,lengthRule:(Z=z.logic)==null?void 0:Z.lengthRule},F={},_=z.props||z.propsFieldCustom||z.propsFieldGlobal||{},b=_.endpoint||_.endpointReference||_.endpointComponent||_.endpointPropAction;if(Object.entries(Y).forEach(([J,fe])=>{if(!fe)return;let ae;J==="visibleRule"?ae=a.isFieldVisible(z,C):J==="disabledRule"?ae=a.isFieldDisabled(z,C):J==="optionsFilterRule"?ae=a.getFilteredItems(z,C):J==="lengthRule"&&(ae=a.resolveFieldLength(z,C));const we=JSON.stringify(ae);F[J]=we;const pe=E.get(ee);(pe==null?void 0:pe[J])!==void 0&&pe[J]!==we&&(J==="visibleRule"&&ae===!1||J==="disabledRule"&&ae===!0||J==="optionsFilterRule"||J==="lengthRule")&&(C[K]=null)}),Array.isArray(b==null?void 0:b.keyParam)&&b.keyParam.forEach(J=>{var ke;let fe,ae;if(typeof J=="string")fe=C[J],ae=`kp-${J}`;else if(typeof J=="object"&&J!==null)fe=Object.values(J).map(Se=>C[Se]),ae=`kp-${JSON.stringify(J)}`;else return;const we=JSON.stringify(fe);F[ae]=we;const pe=E.get(ee);if(pe==null||pe[ae],we!==(pe==null?void 0:pe[ae])){d&&d(z,!0,K,C),f&&((ke=z.props)!=null&&ke.fetchRule)&&f(z,z.props.fetchRule,K,C);const be=(pe==null?void 0:pe[ae])==="null"||(pe==null?void 0:pe[ae])==="undefined"||!pe,Se=we==="null"||we==="undefined",ve=typeof J=="string"&&(J===z.key||J===z.model);(!be||Se)&&!ve&&(C[K]=null)}}),E.set(ee,F),!a.isFieldVisible(z,C)){const J=C[K];J!=null&&J!==""&&(C[K]=null)}})},$=()=>{!a||!y.value.length||(k(),y.value.forEach(z=>{var F,_,b;const G=z.model;if(!G)return;const ee=a.resolveDefaultValue(z,C);if(ee!=null){const R=C[G],T=(z.props||z.propsFieldCustom||z.propsFieldGlobal||{}).returnObject||((F=z.logic)==null?void 0:F.returnObject);(R==null||R===""||T&&(typeof R=="string"||typeof R=="number")&&(typeof ee=="object"&&ee!==null))&&(C[G]=ee)}const K=z.props||z.propsFieldCustom||z.propsFieldGlobal||{},Y=((_=z.logic)==null?void 0:_.autoSelect)||K.autoSelect||"single";if(Y!=="none"&&(l!=null&&l.rawItemsCache)){const R=l.rawItemsCache[z.key]||[];if(R.length>0){const S=C[G];if(S==null||S===""){const T=K.returnObject||((b=z.logic)==null?void 0:b.returnObject),D=R[0];if(Y==="single"&&R.length===1){const Z=T?D:D.id??D.value??D.code;C[G]=Z}else if(Y==="first"){const Z=T?D:D.id??D.value??D.code;C[G]=Z}}}}z.logic&&typeof z.logic=="object"&&Object.keys(z.logic).filter(S=>S.toLowerCase().includes("calculaterule")&&z.logic[S]&&typeof z.logic[S]=="object").forEach(S=>{const T=z.logic[S],D=Object.keys(T)[0];if(!D)return;const Z=a.evaluateLogic(T[D],C,`CALC-${D}`,D),J=C[D];Z!==void 0&&(Number.isNaN(Z)?!Number.isNaN(J):JSON.stringify(J)!==JSON.stringify(Z))&&(C[D]=Z)})}))};o.watch(()=>({...l==null?void 0:l.rawItemsCache}),()=>{m.value&&$()},{deep:!0});const I=z=>{var G;return!(z!=null&&z.apiUrl)&&!((G=z==null?void 0:z.endpointTable)!=null&&G.apiUrl)},O=z=>{if(!z)return!1;const G=(z.key||"").toLowerCase(),ee=(z.permission||"").toUpperCase();return G==="detail"||G.includes("view")||ee==="VIEW"},q=z=>{var F,_,b,R;const G=z.modelKey||z.modelDatatable,ee=z.key||z.id,K=(_=(F=h==null?void 0:h.navigationState)==null?void 0:F.value)==null?void 0:_.parentRowContext;if(K){const S=`${K.parentArrayKey}.${K.rowIndex}.${K.childArrayKey}`,T=z.modelKey||z.modelDatatable,D=`${K.parentArrayKey}.${K.childArrayKey}`;if(!T||T===D||T.startsWith(D+"."))return console.log(`[resolveTableDataKey][PARENT-CTX] Scoped path: "${S}"`),S;console.log(`[resolveTableDataKey][PARENT-CTX-MISMATCH] modelKey "${T}" does not match "${D}" — ignoring parentRowContext`)}const Y=(c==null?void 0:c.value)||((b=l==null?void 0:l.internalSchema)==null?void 0:b.value)||((R=a==null?void 0:a.activeSchema)==null?void 0:R.value);if(Y!=null&&Y.sections&&ee){const S=(D,Z)=>{var J;for(const fe of D)if(fe.type==="WIZARD"&&((J=fe.propsWizard)!=null&&J.propsSteps))for(const ae of fe.propsWizard.propsSteps){const we=Array.isArray(ae.sectionsWizard)?ae.sectionsWizard:ae.sectionsWizard?[ae.sectionsWizard]:[];if(we.some(be=>{var ve,Be,Ee,Oe;return(be.key||be.id||((ve=be.propsTable)==null?void 0:ve.key)||((Be=be.propsTableStep)==null?void 0:Be.key)||((Ee=be.propsForm)==null?void 0:Ee.key)||((Oe=be.propsFormStep)==null?void 0:Oe.key))===Z}))return ae.modelKey||ae.key||null;const ke=S(we,Z);if(ke)return ke}return null},T=S(Y.sections,ee);if(T){const D=`${T}.${G||ee}`;return console.log(`[resolveTableDataKey][WIZARD-MATCH] Resolved nested path: "${D}" for section: "${ee}"`),D}}return G&&Ye(t,G)!==void 0?G:ee&&Ye(t,ee)!==void 0?ee:Ye(t,"data")!==void 0?"data":G||ee},X=z=>{if(!z)return[];const G=q(z),ee=Ye(t,G);if(!Array.isArray(ee))return[];const K=z.headers||[],Y=ee.filter(F=>kd(F)?!1:K.length===0?!0:K.some(b=>{var D,Z,J;if(b.key==="no"||b.key==="action")return!1;let R=Ye(F,b.key);if(R!=null&&R!=="")return!0;const S=b.key.includes(".")?b.key.split(".").pop():null;if(S&&(R=Ye(F,S),R!=null&&R!==""))return!0;const T=(J=(Z=(D=b.custom)==null?void 0:D.propsCustom)==null?void 0:Z[0])==null?void 0:J.value;return!!(T&&T!==b.key&&T!==S&&(R=Ye(F,T),R!=null&&R!==""))}));return ee.length>0&&(console.log(`[TABLE][${G}] Raw rows:`,ee.length,"Filtered rows:",Y.length),ee.length!==Y.length&&console.log(`[TABLE][${G}] Filtered out ${ee.length-Y.length} rows (empty or mismatch).`)),Y},oe=z=>{var ee,K;if((ee=z.fields)!=null&&ee.length)return z.fields;const G=(z.actionTableGlobal||[]).find(Y=>Y.permission==="CREATE"||(Y.key||"").toLowerCase().includes("add"));return(K=G==null?void 0:G.fieldActionGlobal)!=null&&K.length?G.fieldActionGlobal:(z.headers||[]).filter(Y=>Y.key&&Y.key!=="no").map(Y=>({key:Y.key,model:Y.key,component:"DCodeTextField"}))},ue=(z,G)=>{W.value={propsTable:z,row:G},P.value=!0},te=()=>{if(!W.value)return;const{propsTable:z,row:G}=W.value;P.value=!1;const ee=q(z),K=Ye(t,ee);if(Array.isArray(K)){const Y=K.indexOf(G);if(Y!==-1)K.splice(Y,1);else{const F=JSON.stringify(G,(b,R)=>["no","_index"].includes(b)?void 0:R),_=K.findIndex(b=>JSON.stringify(b,(R,S)=>["no","_index"].includes(R)?void 0:S)===F);_!==-1&&K.splice(_,1)}Xt(t,ee,[...K]),n("update:model",i.getCleanPayload())}},re=(z,G)=>{console.log(`[useFormTable][DEBUG] Updating ${z} with:`,G,"Target Object Keys:",Object.keys(C)),C[z]=G,$();const ee=y.value.find(K=>K.model===z);if(ee){const K=r.validateField(ee,G,C);K?M[z]=K:delete M[z]}},ge=(z,G,ee)=>{var _,b;const K="[FORM-TABLE-TRACER]";console.log(`${K} Starting openTableRowDialog`,{sectionKey:z.modelKey||z.key||z.id,action:G.key||G.permission,hasRowData:!!ee}),l!=null&&l.activeTableAction&&(l.activeTableAction.value=G),ee&&console.log(`${K} Raw Row Data Received:`,JSON.parse(JSON.stringify(ee))),B.value=q(z),console.log(`${K} Resolved activeTableKey: "${B.value}"`),j.value=O(G),N.value=null,g.value=s.value==="id"?G.labelID||"Tambah Data":G.labelEN||"Add Data",v.value=G.icon||"Plus";const Y=(((_=G.dialogConfig)==null?void 0:_.layoutSize)||"md").toLowerCase();A.value=Y,console.log(`[useFormTable][DEBUG] Opening Dialog with size: "${Y}" (from ${(b=G.dialogConfig)==null?void 0:b.layoutSize})`);const F=G.fieldActionCustom||G.fieldActionGlobal||oe(z);y.value=F,console.log(`${K} Dialog Fields Count:`,F.length),Object.keys(C).forEach(R=>{C[R]=null}),Object.keys(M).forEach(R=>delete M[R]),E.clear(),F.forEach((R,S)=>{const T=R.model||R.key;if(!T){console.warn(`${K} Field at index ${S} is missing a model/key!`);return}let D=ee?Ye(ee,T):null,Z="DEEP_MATCH";if(ee&&D==null){const J=T.includes(".")?T.split(".").pop():null;J&&(D=Ye(ee,J),D!=null&&(Z=`LEAF_MATCH("${J}")`))}ee&&console.log(`${K} Field "${T}" [${Z}] -> Resolved Value:`,D),C[T]=D??null}),console.log(`${K} Final tableRowFormData prepared:`,JSON.parse(JSON.stringify(C))),m.value=!0,setTimeout(()=>{console.log(`${K} Triggering initial scanDialogLogic...`),$()},10)};return{tableDialogOpen:m,tableDialogTitle:g,tableDialogIcon:v,tableDialogFields:y,tableRowFormData:C,tableRowErrors:M,activeTableKey:B,editingRowIndex:N,tableDialogViewOnly:j,confirmDeletePending:W,confirmDeleteOpen:P,tableDialogSize:A,isTemporaryTable:I,isActionViewOnly:O,tableRows:X,resolveTableFields:oe,confirmTableDelete:ue,executeTableDelete:te,handleTableRowUpdate:re,openTableRowDialog:ge,handleDataTableAction:(z,G)=>{var R,S,T,D,Z,J,fe,ae,we;const{action:ee,row:K}=G,Y=ee.toLowerCase();if(G.isLocalSave||G.actionType==="CREATE"||G.actionType==="UPDATE"){const pe=G.modelDatatable||q(z);if(pe&&K&&typeof K=="object"){const ke=Ye(t,pe)||[],be=Array.isArray(ke)?[...ke]:[];if(G.actionType==="UPDATE"){let Se=G.originalRow?be.indexOf(G.originalRow):-1;if(Se===-1&&G.originalRow){const ve=G.originalRow["detail.id"]||G.originalRow.id||G.originalRow["documents.id"]||G.originalRow["documents.document.id"];ve!=null&&(Se=be.findIndex(Be=>(Be["detail.id"]||Be.id||Be["documents.id"]||Be["documents.document.id"])===ve))}if(Se===-1){const ve=JSON.stringify(G.originalRow||{},(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee);Se=be.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===ve)}Se===-1&&(Se=G.rowIndex!==void 0&&G.rowIndex!==null?G.rowIndex:-1),Se!==-1?be[Se]={...K}:be.push({...K})}else be.push({...K});Xt(t,pe,[...be]),l!=null&&l.formData&&Xt(l.formData,pe,[...be]),n("update:modelValue",{...t}),n("update:model",{...t})}return}if(/delete|trash/i.test(ee)){const pe=q(z),ke=Ye(t,pe);if(Array.isArray(ke)){const be=ke.indexOf(K);if(be!==-1)ke.splice(be,1);else{const Se=JSON.stringify(K,(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee),ve=ke.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===Se);ve!==-1&&ke.splice(ve,1)}n("update:model",i.getCleanPayload())}return}let F=null;const _=pe=>Array.isArray(pe)?pe.find(ke=>{var ve,Be,Ee,Oe;const be=(ke.key||((ve=ke.propsActionGlobal)==null?void 0:ve.key)||((Be=ke.propsActionCustom)==null?void 0:Be.key)||"").toLowerCase(),Se=(ke.actionType||((Ee=ke.propsActionGlobal)==null?void 0:Ee.actionType)||((Oe=ke.propsActionCustom)==null?void 0:Oe.actionType)||"").toLowerCase();return be===Y||Se===Y}):null;F=_(z.actionTableGlobal)||_(z.actionTableLine),!F&&Array.isArray(z.headers)&&z.headers.forEach(pe=>{var ke;if(((ke=pe.custom)==null?void 0:ke.type)==="ACTION"){const be=_(pe.custom.actionCustom);be&&(F=be)}});const b=((F==null?void 0:F.actionType)||((R=F==null?void 0:F.propsActionGlobal)==null?void 0:R.actionType)||((S=F==null?void 0:F.propsActionCustom)==null?void 0:S.actionType)||(F==null?void 0:F.permission)||"").toLowerCase();if(b==="delete"||b==="destroy"){const pe=(F==null?void 0:F.endpoint)||((T=F==null?void 0:F.propsActionGlobal)==null?void 0:T.endpointPropAction)||((D=F==null?void 0:F.propsActionCustom)==null?void 0:D.endpointPropAction);if(!(pe!=null&&pe.apiUrl)){const ke=q(z),be=Ye(t,ke);if(Array.isArray(be)){let Se=-1;if(K&&(Se=be.indexOf(K),Se===-1)){const ve=JSON.stringify(K,(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee);Se=be.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===ve)}Se!==-1&&(be.splice(Se,1),Xt(t,ke,[...be]),n("update:model",i.getCleanPayload()))}return}}if(b==="view"||b==="detail"||/detail|view/i.test(ee)){ge(z,F||{key:"detail",permission:"VIEW"},K);return}if((b==="update"||b==="create"||b==="edit"||b==="add"||/edit|add|create|update/i.test(ee))&&(F==null?void 0:F.openDialog)!==!1){if(b==="create"||b==="add"||/add|create/i.test(ee))ge(z,F||{key:"create",permission:"CREATE"});else{const ke=q(z),be=Ye(t,ke);let Se=Array.isArray(be)?be.indexOf(K):-1;if(Se===-1&&Array.isArray(be)){const ve=JSON.stringify(K,(Be,Ee)=>["no","_index"].includes(Be)?void 0:Ee);Se=be.findIndex(Be=>JSON.stringify(Be,(Ee,Oe)=>["no","_index"].includes(Ee)?void 0:Oe)===ve)}N.value=Se!==-1?Se:null,ge(z,F||{key:"edit",permission:"UPDATE"},K)}return}if(K&&typeof K=="object"&&!((Z=F==null?void 0:F.endpoint)!=null&&Z.apiUrl)&&!((fe=(J=F==null?void 0:F.propsActionGlobal)==null?void 0:J.endpointPropAction)!=null&&fe.apiUrl)){const pe=z.modelDatatable,ke=Ye(t,pe)||[],be=Array.isArray(ke)?[...ke]:[],Se=(ae=z.headers)==null?void 0:ae.find(Oe=>{var Ae;return((Ae=Oe.custom)==null?void 0:Ae.type)==="CHECKBOX"||Oe.keyCheckbox}),ve=(Se==null?void 0:Se.keyCheckbox)||((we=Se==null?void 0:Se.custom)==null?void 0:we.keyCheckbox)||"id";let Be=-1;K[ve]&&(Be=be.findIndex(Oe=>Oe[ve]===K[ve])),Be===-1?be.push({...K}):be.splice(Be,1,{...K}),Xt(t,pe,be),n("update:model",i.getCleanPayload())}},saveTableRow:()=>{const z="[SAVE-TRACER]";console.log(`${z} Starting saveTableRow`,{activeTableKey:B.value,editingIndex:N.value});let G=!0;if(Object.keys(M).forEach(F=>delete M[F]),y.value.forEach(F=>{if(a&&!a.isFieldVisible(F,C))return;const _=C[F.model],b=r.validateField(F,_,C);b&&(M[F.model]=b,G=!1)}),!G){console.warn(`${z} Validation failed for table row dialog:`,JSON.parse(JSON.stringify(M)));return}const ee=B.value;if(!ee)return;const K=Ye(t,ee)||[],Y=Array.isArray(K)?[...K]:[];N.value!==null?Y.splice(N.value,1,{...C}):Y.push({...C}),Xt(t,ee,Y),m.value=!1,n("update:model",i.getCleanPayload())}}}function SK(e){const{state:t,props:n,emit:i,logic:r,mapping:s,activeSchema:a,fieldMap:l,prefetchFieldItems:c,triggerFetchRule:d,fetchSectionData:f,router:h}=e;let m="",g="",v=!1,y=!0;const A=new Map,C=new Map,M=new Map;o.watch(()=>a.value,(E,k)=>{E!==k&&(C.clear(),A.clear(),M.clear(),y=!0,g="",m="")});const B=async(E,k)=>{var ge;const $=(ge=a.value)==null?void 0:ge.sections;if(!$)return;r.applyCalculations();const I=r.getNormalizedData(E),O=new Set,q=new Map,X=(ce,se=!0,z)=>{var G,ee;if(ce)for(const K of ce){const F=r.isSectionVisible(K,E)&&se,_=Pt(K),b=z&&_?`${z}.${_}`:z,R=K.modelKey||K.key||K.id,T=(K.propsForm||K.propsFormStep||K.propsTable||K.propsTableStep||K.propsDataTableWizard||K.props||{}).fields||K.fields||[];for(const D of T){if(!D.model)continue;const Z=b?`${b}.${D.model}`:D.model;r.isFieldVisible(D,E,Z)&&F&&O.add(Z)}if(((G=K.type)==null?void 0:G.toUpperCase())==="WIZARD"){const D=((ee=K.propsWizard)==null?void 0:ee.propsSteps)||[],Z=Pt(K),J=t.wizardState[Z]??0;for(let fe=0;fe<D.length;fe++){const ae=D[fe],ke=r.isSectionVisible(ae,E)&&F&&fe===J,be=ae.sectionsWizard||ae.sections||[],Se=Array.isArray(be)?be:[be];X(Se,ke,R)}}}};X($,!0);const oe=(ce,se,z,G)=>{const ee=r.isFieldVisible(ce,G,se)&&z,K=q.get(ce.model)||!1;return q.set(ce.model,K||ee),ee},ue=(ce,se,z,G,ee)=>{var ke,be,Se;const K=ce.model,Y=ce.logic,F=ce.props||ce.propsFieldCustom||ce.propsFieldGlobal||{},_=F.endpoint||F.endpointReference||F.endpointComponent||F.endpointPropAction,b=Array.isArray(_==null?void 0:_.keyParam);if(!Y&&!b)return;const R={};if(["lengthRule","optionsFilterRule","visibleRule","disabledRule"].forEach(ve=>{const Be=Y==null?void 0:Y[ve];if(!Be)return;let Ee;if(ve==="visibleRule")Ee=r.isFieldVisible(ce,G,se);else if(ve==="disabledRule")Ee=r.isFieldDisabled(ce,G,se);else if(ve==="requiredRule")Ee=r.isFieldRequired(ce,G,se);else if(ve==="lengthRule")Ee=r.resolveFieldLength(ce,G);else if(ve==="optionsFilterRule")Ee=r.resolveActiveRule(Be,G,`${ve}-${K}`,se);else{const Re=r.resolveActiveRule(Be,G,`${ve}-${K}`,se);Ee=Re?r.evaluateLogic(Re,G,`${ve}-${K}`,se):null}const Oe=JSON.stringify(Ee);R[ve]=Oe;const Ae=M.get(ce.key);(Ae==null?void 0:Ae[ve])!==void 0&&Ae[ve]!==Oe&&ee&&(ve==="visibleRule"&&Ee===!1||ve==="disabledRule"&&Ee===!0||ve==="optionsFilterRule"||ve==="lengthRule")&&(O.has(se)||Xt(t.formData,se,null))}),ee&&!z&&!O.has(se)){const ve=Ye(t.formData,se);ve!=null&&ve!==""&&Xt(t.formData,se,null)}Array.isArray(_==null?void 0:_.keyParam)&&_.keyParam.forEach(ve=>{var Ie;let Be,Ee;const Oe=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,Ae=r.getNormalizedData(E,Oe);if(typeof ve=="string")Be=((Ie=Ae._resolveLogicVar)==null?void 0:Ie.call(Ae,ve))??Ae[ve],Ee=`kp-${ve}`;else if(typeof ve=="object"&&ve!==null)Be=Object.values(ve).map(ne=>{var ye;return((ye=Ae._resolveLogicVar)==null?void 0:ye.call(Ae,ne))??Ae[ne]}),Ee=`kp-${JSON.stringify(ve)}`;else return;const Re=JSON.stringify(Be);R[Ee]=Re;const De=M.get(ce.key);if((De==null?void 0:De[Ee])!==void 0&&De[Ee]!==Re){z&&c(ce,!0,se);const Ce=De[Ee]==="null"||De[Ee]==="undefined",ne=Re==="null"||Re==="undefined",ye=typeof ve=="string"&&(ve===ce.key||ve===ce.model);ee&&(!Ce||ne)&&!ye&&Xt(t.formData,se,null)}});const T=ve=>{if(!ve)return!0;if(typeof ve=="object"){const Be=Object.keys(ve);if(Be.length===1&&(Be[0]==="=="||Be[0]==="===")){const Ee=ve[Be[0]];if(Array.isArray(Ee)){if(Ee.length===1&&(Ee[0]===""||Ee[0]===null))return!0;if(Ee.length===2){const Oe=Ee[0],Ae=Ee[1];if(typeof Oe=="object"&&Oe!==null&&Oe.var===""&&(Ae===""||Ae===null))return!0}}}}return!1},D=ve=>{var Be;return ve==null?JSON.stringify(ve):ve instanceof File||ve instanceof Blob||((Be=ve.constructor)==null?void 0:Be.name)==="File"?`File:${ve.name}:${ve.size}:${ve.type}:${ve.lastModified||0}`:Array.isArray(ve)?`[${ve.map(D).join(",")}]`:JSON.stringify(ve)};(Array.isArray(Y==null?void 0:Y.fetchRule)?Y.fetchRule:[Y==null?void 0:Y.fetchRule].filter(Boolean)).forEach((ve,Be)=>{var Ce;const Ee=`fetch-${Be}`,Oe=r.evaluateLogic(ve.condition,G,`FETCH-${K}`,se),Ae=JSON.stringify(Oe);G[K],R[Ee]=Ae;const Re=M.get(ce.key),De=(Re==null?void 0:Re[Ee])==="true";let Ie=!1;if(Oe&&!De&&(Ie=!0),Oe&&Array.isArray((Ce=ve.endpoint)==null?void 0:Ce.keyParam)&&ve.endpoint.keyParam.forEach(ne=>{let ye,Me;if(typeof ne=="string")ye=G[ne],ye===void 0&&ce&&ce.key===ne&&(ye=G[ce.model]),Me=`kp-${ne}`;else if(typeof ne=="object"&&ne!==null)ye=Object.values(ne).map(He=>G[He]),Me=`kp-${JSON.stringify(ne)}`;else return;const Ke=D(ye);(Re==null?void 0:Re[Me])!==void 0&&Re[Me]!==Ke&&(Ie=!0),R[Me]=Ke}),Ie&&z&&d(ce,ve,se),!Oe&&De){t.formData[`_fetchStatus_${ce.model}`]=!1;const ne=Me=>{var He,rt;if(!Me)return;((Me.propsForm||Me.propsFormStep||Me.propsTable||Me.propsTableStep||Me.propsDataTableWizard||Me.props||{}).fields||Me.fields||[]).forEach(Ve=>{if(Ve.model){const Fe=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,Ue=Fe?`${Fe}.${Ve.model}`:Ve.model;Xt(t.formData,Ue,null)}}),((He=Me.type)==null?void 0:He.toUpperCase())==="WIZARD"&&((rt=Me.propsWizard)!=null&&rt.propsSteps)&&Me.propsWizard.propsSteps.forEach(Ve=>{(Array.isArray(Ve.sectionsWizard)?Ve.sectionsWizard:[Ve.sectionsWizard].filter(Boolean)).forEach(ne)})},ye=(Me,Ke)=>{var $e,He;for(const rt of Me){if(Pt(rt)===Ke){ne(rt);return}(($e=rt.type)==null?void 0:$e.toUpperCase())==="WIZARD"&&((He=rt.propsWizard)!=null&&He.propsSteps)&&rt.propsWizard.propsSteps.forEach(Fe=>{const Ue=Array.isArray(Fe.sectionsWizard)?Fe.sectionsWizard:[Fe.sectionsWizard].filter(Boolean);ye(Ue,Ke)})}};Array.isArray(ve.revealSections)&&ve.revealSections.forEach(Me=>{var Ke;t.revealedSectionIds[Me]=!1,(Ke=a.value)!=null&&Ke.sections&&ye(a.value.sections,Me)}),Array.isArray(ve.revealFields)&&ve.revealFields.forEach(Me=>{t.revealedFieldModels[Me]=!1;const Ke=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,$e=Ke?`${Ke}.${Me}`:Me;Xt(t.formData,$e,null)}),s!=null&&s.handleClearMapping&&s.handleClearMapping(ve.mapping||{},se)}}),(Array.isArray(Y==null?void 0:Y.autoFetchRule)?Y.autoFetchRule:[Y==null?void 0:Y.autoFetchRule].filter(Boolean)).forEach((ve,Be)=>{const Ee=`autofetch-${Be}`,Ae=ve.condition&&!T(ve.condition)?r.evaluateLogic(ve.condition,G,`AUTOFETCH-${K}`,se):!0,Re=JSON.stringify(Ae);R[Ee]=Re;const De=M.get(ce.key),Ie=(De==null?void 0:De[Ee])==="true";let Ce=!1;Ae&&!Ie&&De!==void 0&&(Ce=!0),Ae&&Array.isArray(ve.triggers)&&ve.triggers.forEach((ne,ye)=>{var Fe;const Me=ne.fieldKey;if(!Me)return;const Ke=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,$e=r.getNormalizedData(E,Ke),He=((Fe=$e._resolveLogicVar)==null?void 0:Fe.call($e,Me))??$e[Me],rt=D(He),Ve=`afr-trig-${Me}-${ye}`;if((De==null?void 0:De[Ve])!==void 0&&De[Ve]!==rt)if(ne.event==="debounced"){const Ue=ne.debounceMs||300,at=`afr-debounced-${ce.key}-${Be}-${ye}`;t[at]||(t[at]=I3((nt,Tt,fi)=>{z&&d(nt,Tt,fi)},Ue)),t[at](ce,ve,se)}else Ce=!0;R[Ve]=rt}),Ce&&z&&d(ce,ve,se),!Ae&&Ie&&(t.formData[`_fetchStatus_${ce.model}`]=!1,s!=null&&s.handleClearMapping&&s.handleClearMapping(ve.mapping||{},se),Array.isArray(ve.revealSections)&&ve.revealSections.forEach(ne=>{t.revealedSectionIds[ne]=!1}),Array.isArray(ve.revealFields)&&ve.revealFields.forEach(ne=>{t.revealedFieldModels[ne]=!1;const ye=se.includes(".")?se.split(".").slice(0,-1).join("."):void 0,Me=ye?`${ye}.${ne}`:ne;Xt(t.formData,Me,null)}))}),(Array.isArray(Y==null?void 0:Y.copyRule)?Y.copyRule:[Y==null?void 0:Y.copyRule].filter(Boolean)).forEach((ve,Be)=>{const Ee=`copy-${Be}`,Oe=ve.condition?r.evaluateLogic(ve.condition,G,`COPY-COND-${K}`,se):!0;let Ae;typeof ve.source=="string"?Ae=G[ve.source]:ve.source&&typeof ve.source=="object"&&(Ae=r.evaluateLogic(ve.source,G,`COPY-SRC-${K}`,se));const Re=JSON.stringify({conditionMet:Oe,sourceVal:Ae}),De=M.get(ce.key);if((De==null?void 0:De[Ee])!==Re&&Oe){const Ce=Ye(t.formData,se);JSON.stringify(Ce)!==JSON.stringify(Ae)&&Xt(t.formData,se,Ae)}R[Ee]=Re});const ae=r.resolveDefaultValue(ce,G,se);if(ae!=null){const ve=Ye(t.formData,se),Ee=(ce.props||ce.propsFieldCustom||ce.propsFieldGlobal||{}).returnObject||((ke=ce.logic)==null?void 0:ke.returnObject);(ve==null||ve===""||Ee&&(typeof ve=="string"||typeof ve=="number")&&(typeof ae=="object"&&ae!==null))&&Xt(t.formData,se,ae)}const we=ce.props||ce.propsFieldCustom||ce.propsFieldGlobal||{},pe=((be=ce.logic)==null?void 0:be.autoSelect)||we.autoSelect||"none";if(pe!=="none"){const ve=t.rawItemsCache[ce.key]||[];if(ve.length>0){const Be=Ye(t.formData,se);if(Be==null||Be===""){const Ee=we.returnObject||((Se=ce.logic)==null?void 0:Se.returnObject),Oe=ve[0];if(pe==="single"&&ve.length===1){const Ae=Ee?Oe:Oe.id??Oe.value??Oe.code;Xt(t.formData,se,Ae)}else if(pe==="first"){const Ae=Ee?Oe:Oe.id??Oe.value??Oe.code;Xt(t.formData,se,Ae)}}}}M.set(ce.key,R)},te=async(ce,se,z)=>{var Y,F;if(((Y=ce.type)==null?void 0:Y.toUpperCase())!=="WIZARD")return;const G=((F=ce.propsWizard)==null?void 0:F.propsSteps)||[],ee=Pt(ce),K=t.wizardState[ee]??0;for(let _=0;_<G.length;_++){const b=G[_],T=r.isSectionVisible(b,z)&&se&&_===K,D=b.modelKey||b.key||b.id;Array.isArray(b.sectionsWizard)?await re(b.sectionsWizard,T,D):b.sectionsWizard&&await re([b.sectionsWizard],T,D)}},re=async(ce,se=!0,z)=>{var G;if(ce)for(const ee of ce){const Y=r.isSectionVisible(ee,E)&&se,F=Pt(ee),_=z?F?`${z}.${F}`:z:F||"ROOT",b=z&&F?`${z}.${F}`:z,R=ee.propsForm||ee.propsFormStep||ee.propsTable||ee.propsTableStep||ee.propsDataTableWizard||ee.props||{};if(k&&!Y){const Z=R.modelDatatable||R.modelKey||(((G=ee.type)==null?void 0:G.toUpperCase())==="TABLE"?ee.key||ee.id:null);if(Z){const J=Ye(t.formData,Z);if(Array.isArray(J)?J.length>0:J!=null&&J!==""){const ae=t.originalData?Ye(t.originalData,Z):void 0;(Array.isArray(ae)?ae.length>0:ae!=null&&ae!=="")||Xt(t.formData,Z,Array.isArray(J)?[]:null)}}}const S=C.get(_);(Y||y)&&(S===!1||S===void 0)?(C.set(_,!0),(R.endpointSection||R.endpointForm||R.endpointTable)&&(console.log(`[useFormWatcher][TRIGGER] Auto-fetching section: ${_}`),await f(_,ee,b))):C.set(_,Y);const D=R.fields||ee.fields||[];for(const Z of D){if(!Z.model)continue;const J=b?`${b}.${Z.model}`:Z.model,fe=oe(Z,J,Y,E);ue(Z,J,fe,I,k)}await te(ee,Y,E)}};await re($,!0);for(const[ce,se]of q.entries())A.set(ce,se)};async function N(E,k=!1){if(!(E!=null&&E.sections))return;const $=O=>{if(!O)return;const q=["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule","fetchRule","copyRule","defaultValueRule"];for(const X of q){const oe=O[X],ue=Array.isArray(oe)?oe:[oe].filter(Boolean);for(const te of ue)te.condition&&sg(te.condition),X==="copyRule"&&te.source&&typeof te.source=="object"&&sg(te.source)}};function I(O,q){var te,re,ge,ce,se,z,G,ee,K,Y,F,_,b,R,S;const X=Pt(O)||q,oe=O.propsForm||O.propsFormStep||O.propsTable||O.propsTableStep||O.propsDataTableWizard||O.props||{};$(O.logic||oe.logic);const ue=oe.fields||O.fields||[];for(const T of ue){$(T.logic);const D=T.props||T.propsFieldCustom||T.propsFieldGlobal||{},Z=D.endpointReference||D.endpoint||D.endpointComponent,J=!!(Z!=null&&Z.apiUrl);if((te=T.logic)!=null&&te.optionsFilterRule||J){if(Array.isArray(Z==null?void 0:Z.keyParam)&&Z.keyParam.length>0){console.log(`[initSection][SKIP] Field "${T.model}" has keyParam dependencies — deferring fetch until parent is selected.`);continue}const ae=X?`${X}.${T.model}`:T.model;c(T,!1,ae)}}if((O.type==="TABLE"||O.isDataTable)&&((re=O.propsTable)!=null&&re.modelKey||(ge=O.propsTable)!=null&&ge.modelDatatable||(ce=O.propsTableStep)!=null&&ce.modelKey||(se=O.propsTableStep)!=null&&se.modelDatatable||(z=O.propsTable)!=null&&z.key||O.key)){const T=((G=O.propsTable)==null?void 0:G.modelKey)||((ee=O.propsTable)==null?void 0:ee.modelDatatable)||((K=O.propsTableStep)==null?void 0:K.modelKey)||((Y=O.propsTableStep)==null?void 0:Y.modelDatatable)||((F=O.propsTable)==null?void 0:F.key)||O.key;T&&(t.formData[T]=t.formData[T]||[])}if(O.type==="WIZARD"){const T=Pt(O),D=(R=(b=(_=h==null?void 0:h.currentRoute)==null?void 0:_.value)==null?void 0:b.query)==null?void 0:R[`step_${T}`];D!==void 0&&!isNaN(Number(D))?t.wizardState[T]=Number(D):t.wizardState[T]===void 0&&(t.wizardState[T]=0);for(const Z of((S=O.propsWizard)==null?void 0:S.propsSteps)||[]){const J=Z.modelKey||Z.key||Z.id;$(Z.logic),Z.sectionsWizard&&(Array.isArray(Z.sectionsWizard)?Z.sectionsWizard:[Z.sectionsWizard]).forEach(ae=>I(ae,J))}}}for(const O of E.sections)I(O);k||(await B(t.formData,!1),y&&(console.log("[useFormWatcher] Schema initialization complete. Exiting initialization mode."),y=!1))}async function j(E,k=!1){var $,I;if(E&&Object.keys(E).length>0){const O=JSON.stringify(E);if(O===m)return;if(O!==g){g=O,v=!0;const q=m?JSON.parse(m):null;for(const[X,oe]of Object.entries(E)){if(!y&&oe!==null&&oe!==void 0&&q&&q[X]===null)continue;if(!y&&oe!==null&&oe!==void 0){let te=l.value.paths.get(X)||(($=l.value.models.get(X))==null?void 0:$[0]);if(te&&r.isFieldDisabled(te.field,t.formData,te.path))continue}if(Array.isArray(oe)&&oe.length>0){const te=t.formData[X];if(Array.isArray(te)&&te.length>0&&Array.isArray(oe)&&oe.length===0)continue}if(!k&&A.get(X)===!0){const te=t.formData[X];if(te!=null)continue}const ue=t.formData[X];if(JSON.stringify(ue)!==JSON.stringify(oe)){hasChanges=!0;let te=l.value.paths.get(X)||((I=l.value.models.get(X))==null?void 0:I[0]);const re=(te==null?void 0:te.path)||X;Xt(t.formData,re,oe)}}(y||hasChanges)&&Object.assign(t.originalData,JSON.parse(JSON.stringify(t.formData))),y&&(k||(y=!1,await B(t.formData,!1)))}}}let W=null;o.watch(()=>a.value,async E=>{n.dummyMode?(W&&clearTimeout(W),W=setTimeout(async()=>{await N(E)},1e3)):await N(E)},{deep:!0,immediate:!0});let P=null;return o.watch(t.formData,async E=>{t.revision.value++,P&&clearTimeout(P),P=setTimeout(async()=>{const k=!y&&!v;v=!1,await B(E,k);const $=s.getCleanPayload()||{},I=JSON.stringify($);I!==m&&(m=I,i("update:model",$))},50)},{deep:!0}),o.watch(()=>n.model,async E=>{await j(E)},{deep:!0}),o.watch(()=>({...t.revealedSectionIds}),async()=>{await B(t.formData,!1)},{deep:!0}),o.watch(()=>({...t.wizardState}),async()=>{console.log("[useFormWatcher] wizardState changed, triggering scan..."),await B(t.formData,!1)},{deep:!0}),o.watch(()=>({...t.rawItemsCache}),async()=>{await B(t.formData,!1)},{deep:!0}),{lastEmittedPayload:()=>m}}function AK(e={},t,n){const{initialHiddenStates:i={},maxHistoryDepth:r=20,debug:s=!1}=e,a=o.ref({currentContext:null,history:[],hiddenStates:{...i},navigationEnabled:new Set,maxHistoryDepth:r,parentRowContext:null}),l=(P,E)=>{s&&console.log(`[Navigation] ${P}`,E||"")},c=(P,E)=>{if(P.rules&&P.rules.length>0){l("Multi-rule mode: evaluating rules",P.rules);let k=null;for(const $ of P.rules){if(!$.condition){k=$;continue}if(t){const I=t($.condition,E);if(l(`Rule "${$.id}" condition`,{condition:$.condition,result:I}),I)return l(`Rule "${$.id}" matched`,$),{targetSection:$.targetSection,hiddenRules:$.hiddenRules,parentRowContext:$.parentRowContext}}}return k?(l("Using default rule",k),{targetSection:k.targetSection,hiddenRules:k.hiddenRules,parentRowContext:k.parentRowContext}):(l("No rule matched and no default, aborting"),null)}return{targetSection:P.targetSection,hiddenRules:P.hiddenRules,parentRowContext:P.parentRowContext}},d=(P,E)=>{var I,O;const k=c(P,E);if(!k||!k.targetSection)return;const $={sectionKey:a.value.currentContext||"root",hiddenStates:{...a.value.hiddenStates},timestamp:Date.now(),sourceAction:k.targetSection,context:E,backButtonConfig:P.backButtonConfig};if(a.value.history.push($),a.value.history.length>a.value.maxHistoryDepth&&(a.value.history.shift(),l("History trimmed to max depth",a.value.maxHistoryDepth)),l("Added to history",$),h(k.hiddenRules,E),a.value.currentContext=k.targetSection,k.parentRowContext&&(E==null?void 0:E._rowIndex)!==void 0){const q=n==null?void 0:n(k.targetSection),X=(I=q==null?void 0:q.propsTable)==null?void 0:I.modelKey,oe=`${k.parentRowContext.parentArrayKey}.${k.parentRowContext.childArrayKey}`;!X||X===oe||X.startsWith(oe+".")?(a.value.parentRowContext={parentArrayKey:k.parentRowContext.parentArrayKey,rowIndex:E._rowIndex,childArrayKey:k.parentRowContext.childArrayKey},l("Parent row context set",a.value.parentRowContext)):l("Parent row context skipped (modelKey mismatch)",{targetModelKey:X,nestedModelKey:oe})}else if(!k.parentRowContext&&(E==null?void 0:E._rowIndex)!==void 0&&n){const q=n(k.targetSection),X=(O=q==null?void 0:q.propsTable)==null?void 0:O.modelKey;if(X){for(const oe of Object.keys(E))if(!oe.startsWith("_")&&X.startsWith(oe+".")){const ue=X.slice(oe.length+1);a.value.parentRowContext={parentArrayKey:oe,rowIndex:E._rowIndex,childArrayKey:ue},l("Auto-detected parent row context",a.value.parentRowContext);break}}}l("Navigation complete",{currentContext:a.value.currentContext,hiddenStates:a.value.hiddenStates})},f=()=>{if(a.value.history.length===0){l("No history available, cannot navigate back");return}const P=a.value.history.pop();if(!P){l("Failed to pop history item");return}l("Navigating back to",P),a.value.hiddenStates={...P.hiddenStates},a.value.parentRowContext=null,a.value.currentContext=P.sectionKey==="root"?null:P.sectionKey,l("Back navigation complete",{currentContext:a.value.currentContext,hiddenStates:a.value.hiddenStates,remainingHistory:a.value.history.length})},h=(P,E)=>{for(const[k,$]of Object.entries(P)){let I;typeof $=="boolean"?I=$:t&&typeof $=="object"?I=!!t($,E):I=!1,a.value.hiddenStates[k]=I}},m=()=>{if(a.value.history.length===0)return null;const P=a.value.history[a.value.history.length-1];return(P==null?void 0:P.backButtonConfig)||null},g=P=>a.value.hiddenStates[P]||!1,v=o.computed(()=>a.value.history.length>0),y=o.computed(()=>a.value.currentContext),A=o.computed(()=>a.value.history),C=o.computed(()=>({...a.value.hiddenStates})),M=o.computed(()=>a.value.parentRowContext);return{navigationState:a,hasHistory:v,currentContext:y,history:A,hiddenStates:C,parentRowContext:M,navigateTo:d,navigateBack:f,applyHiddenRules:h,getCurrentBackButton:m,isSectionHidden:g,setSectionHidden:(P,E)=>{l(`Setting ${P} hidden state to ${E}`),a.value.hiddenStates[P]=E},clearHistory:()=>{l("Clearing navigation history"),a.value.history=[],a.value.currentContext=null},reset:()=>{l("Resetting navigation state"),a.value.currentContext=null,a.value.history=[],a.value.hiddenStates={...i},a.value.parentRowContext=null},registerNavigationSection:P=>{a.value.navigationEnabled.add(P),l(`Registered navigation section: ${P}`)}}}Hv();const ew=e=>{var t,n;return!e||typeof e!="object"?!1:e instanceof File||e instanceof Blob||((t=e.constructor)==null?void 0:t.name)==="File"||((n=e.constructor)==null?void 0:n.name)==="Blob"||(typeof e.name=="string"||typeof e.fileName=="string")&&(e.size!==void 0||e.fileSize!==void 0)},ES=e=>{const t=o.toRaw(e);return t&&typeof t=="object"&&t._isLogicValue===!0&&t.value!==void 0?t.value:t};function CS(e,t){var ge,ce;console.log("[useDynamicForm] Initializing with props:",{hasSchema:!!e.schema,baseUrl:e.baseUrl,idTokenCore:(ge=e.schema)==null?void 0:ge.idTokenCore,tokenCoresCount:((ce=e.tokenCores)==null?void 0:ce.length)||0,isEditMode:e.isEditMode});const{t:n,locale:i}=Yn.useI18n(),r=o.computed(()=>i.value),{apiUrl:s}=o.inject("externalApi"),a=e.router||bs.useRouter();let l=null;try{l=bs.useRoute()}catch{console.warn("useRoute not available inside composition")}const c=xq(),d=o.computed(()=>e.schema||c.internalSchema.value),f=o.computed(()=>{var se,z,G;if(typeof((se=e.selectedTokenCore)==null?void 0:se.address)=="string")return e.selectedTokenCore.address;if(typeof e.baseUrl=="string"&&e.baseUrl!=="")return e.baseUrl;if((z=d.value)!=null&&z.idTokenCore&&Array.isArray(e.tokenCores)){const ee=String(d.value.idTokenCore);e.tokenCores.length>0&&console.log("[resolvedBaseUrl] Token List Check:",e.tokenCores.map(Y=>({id:Y.id,address:Y.address})));const K=e.tokenCores.find(Y=>String(Y.id)===ee);if(console.log(`[resolvedBaseUrl] Matching idTokenCore: "${ee}" against list of ${e.tokenCores.length} tokens.`),console.log("[resolvedBaseUrl] Found token:",K?{id:K.id,address:K.address}:"NOT FOUND"),K!=null&&K.address)return K.address}console.log("[resolvedBaseUrl] Final result: undefined. Prop baseUrl:",e.baseUrl,"SelectedToken:",(G=e.selectedTokenCore)==null?void 0:G.address)}),h=o.computed(()=>{var se;return e.permissionBase?e.permissionBase:((se=d.value)==null?void 0:se.code)||""}),m=(se,z,G)=>{if(z.model){const ee=G?`${G}.${z.model}`:z.model,K={field:z,path:ee};se.paths.set(ee,K);const Y=se.models.get(z.model)||[];Y.push(K),se.models.set(z.model,Y)}},g=(se,z,G)=>{const ee=Pt(z);if(ee){const K=G?`${G}.${ee}`:ee,Y={field:z,path:K},F=se.models.get(ee)||[];F.push(Y),se.models.set(ee,F)}},v=(se,z)=>{var K,Y;const G=z.modelKey||z.key||z.id,ee=Array.isArray(z.sectionsWizard)?z.sectionsWizard:[z.sectionsWizard].filter(Boolean);for(const F of ee){const _=Pt(F),b=_?`${G}.${_}`:G;g(se,F,G);const R=F.fields||((K=F.propsForm)==null?void 0:K.fields)||((Y=F.propsFormStep)==null?void 0:Y.fields)||[];for(const S of R)m(se,S,b)}},y=o.computed(()=>{var G,ee,K;const se={paths:new Map,models:new Map},z=(G=d.value)==null?void 0:G.sections;if(!z)return se;for(const Y of z){if(!Y)continue;const F=Y.propsForm||Y.propsTable||Y.props||{},_=F.fields||Y.fields||[],b=Pt(Y);if(g(se,Y),F.modelKey&&F.modelKey!==b){const S=se.models.get(F.modelKey)||[];S.push({field:Y,path:F.modelKey}),se.models.set(F.modelKey,S)}for(const S of _)m(se,S);const R=S=>{if(!S)return;const T=[...S.fieldActionGlobal||[],...S.fieldActionCustom||[]];for(const D of T)m(se,D)};if(F.propsAction&&R(F.propsAction),Array.isArray(F.propsActions))for(const S of F.propsActions)R(S);if(R(F),R(Y),((ee=Y.type)==null?void 0:ee.toUpperCase())==="WIZARD"&&((K=Y.propsWizard)!=null&&K.propsSteps))for(const S of Y.propsWizard.propsSteps)v(se,S)}return se}),A=Kv({formData:c.formData,errors:c.errors,fieldMap:y,rawItemsCache:c.rawItemsCache,revealedSectionIds:c.revealedSectionIds,activeSchema:d,locale:r,tableRowFormData:c.tableRowFormData,activeTableAction:c.activeTableAction}),C=(se,z)=>{if(!z||!(se!=null&&se.sections))return z;const G={...z};return se.sections.forEach(ee=>{var Y;if(ee.type==="WIZARD"&&((Y=ee.propsWizard)!=null&&Y.key)){const F=ee.propsWizard.key,_=z[F];Array.isArray(_)&&_.forEach(b=>{if(!(!b||typeof b!="object"))for(const R in b){const S=b[R];if(G[R]||(G[R]={}),Array.isArray(S))S.forEach(T=>{T&&typeof T=="object"&&Object.assign(G[R],T)});else if(S&&typeof S=="object")for(const T in S){const D=S[T];D&&typeof D=="object"&&(G[R][T]||(G[R][T]={}),Object.assign(G[R][T],D))}}})}const K=Pt(ee);K&&z[K]&&typeof z[K]=="object"&&Object.assign(G,z[K])}),G};let M="";o.watch(()=>d.value,se=>{var K,Y;if(!se)return;const z=se.id||se.code||((Y=(K=se.sections)==null?void 0:K[0])!=null&&Y.key?`sec-${se.sections[0].key}`:"default");if(!(z!==M)||(M!==""&&(Object.keys(c.formData).forEach(F=>delete c.formData[F]),Object.keys(c.tableRowFormData).forEach(F=>delete c.tableRowFormData[F]),Object.keys(c.errors).forEach(F=>delete c.errors[F]),Object.keys(c.touched).forEach(F=>delete c.touched[F]),c.isSubmitted.value=!1,Object.keys(c.fieldErrors).forEach(F=>delete c.fieldErrors[F]),Object.keys(c.wizardState).forEach(F=>delete c.wizardState[F]),Object.keys(c.inlineState).forEach(F=>delete c.inlineState[F]),c.isSubmitting.value=!1,Object.keys(c.rawItemsCache).forEach(F=>delete c.rawItemsCache[F]),Object.keys(c.revealedSectionIds).forEach(F=>delete c.revealedSectionIds[F]),Object.keys(c.revealedFieldModels).forEach(F=>delete c.revealedFieldModels[F]),Object.keys(c.wizardResponses).forEach(F=>delete c.wizardResponses[F]),Object.keys(c.sectionLoading).forEach(F=>delete c.sectionLoading[F]),Object.keys(c.fieldLoading).forEach(F=>delete c.fieldLoading[F])),M=z,!se.payload))return;const ee=C(se,se.payload);Object.entries(ee).forEach(([F,_])=>{const b=c.formData[F];let R=_;Array.isArray(_)&&(R=_.filter(S=>!kd(S)),_.length!==R.length&&console.log(`[SCHEMA-INIT][${F}] Filtered out ${_.length-R.length} empty objects from initial payload.`)),b==null?c.formData[F]=R:R!=null&&typeof R=="object"&&!Array.isArray(R)&&qv(c.formData[F],R)}),Object.assign(c.originalData,JSON.parse(JSON.stringify(c.formData))),q()},{immediate:!0,deep:!0});const B=fS({formData:c.formData,locale:r,errors:c.errors,fieldMap:y,activeSchema:d,isSectionVisible:A.isSectionVisible,isSectionHidden:A.isSectionHidden,isFieldVisible:A.isFieldVisible,isFieldRequired:A.isFieldRequired,resolveFieldLength:A.resolveFieldLength});o.watch(c.formData,se=>{Object.keys(c.errors).forEach(z=>{var ee;const G=y.value.paths.get(z);if(G){const K=Ye(se,G.path);B.validateField(G.field,K)||delete c.errors[z]}else{const K=Ye(se,z),Y=y.value.models.get(z),F=(ee=Y==null?void 0:Y[0])==null?void 0:ee.field;F?B.validateField(F,K)||delete c.errors[z]:K!=null&&K!==""&&delete c.errors[z]}})},{deep:!0});const j=AK({initialHiddenStates:(()=>{const se={},z=d.value;return z!=null&&z.sections&&z.sections.forEach(G=>{var K;const ee=Pt(G);ee&&((K=G.logic)==null?void 0:K.visibleRule)===!1&&(se[ee]=!0)}),se})()},A.evaluateLogic,se=>{var z;return $(((z=d.value)==null?void 0:z.sections)||[],se)}),W=se=>{var ee,K;const z=Pt(se),G=(K=(ee=j==null?void 0:j.navigationState)==null?void 0:ee.value)==null?void 0:K.hiddenStates;return G&&z&&typeof G[z]=="boolean"?!G[z]:A.isSectionVisible(se)},P=Tq({formData:c.formData,activeSchema:d,isSectionVisible:W,isFieldVisible:A.isFieldVisible,isFieldHidden:A.isFieldHidden,getWizardTabs:A.getWizardTabs,fieldMap:y,rawItemsCache:c.rawItemsCache}),E=EK({state:c,props:e,emit:t,apiUrl:s,router:a,locale:r,mapping:P,validation:B,fieldMap:y,activeSchema:d,resolvedBaseUrl:f,resolveKeyParams:I,navigation:j,logic:A}),k=(se,z,G)=>{const ee={},K=z.propsForm||z.propsFormStep||z.propsTable||z.propsTableStep||z.props||{};(K.fields||z.fields||[]).forEach(_=>{var R,S;const b=_.model||((R=_.props)==null?void 0:R.model)||_.key;if(b){let T=Ye(se,b)??se[b];if(T!==void 0){const D=_.props||_.propsFieldCustom||_.propsFieldGlobal||{},Z=D.returnObject||((S=_.logic)==null?void 0:S.returnObject),J=D.itemValue;!Z&&J&&T!==null&&typeof T=="object"&&!Array.isArray(T)&&(T=T[J]??T),Xt(ee,b,T)}}});const F=Pt(z);if(F&&se[F]!==void 0&&ee[F]===void 0&&Xt(ee,F,se[F]),z.type==="TABLE"||z.propsTable){const _=K.modelKey||K.modelDatatable;if(_&&se[_]!==void 0&&ee[_]===void 0)ee[_]=se[_];else if(_&&_.includes(".")&&ee[_]===void 0){const b=_.indexOf("."),R=_.substring(0,b),S=_.substring(b+1),T=se[R];if(Array.isArray(T)){const D=[];for(const Z of T){const J=S.includes(".")?Ye(Z,S):Z==null?void 0:Z[S];Array.isArray(J)&&D.push(...J)}D.length>0&&(ee[_]=D)}}}if(G){const _={};return Xt(_,G,ee),_}return ee},$=(se,z)=>{var G;if(!se)return null;for(const ee of se){const K=Pt(ee);if(K===z||z.endsWith(`.${K}`))return ee;if(ee.type==="WIZARD"&&((G=ee.propsWizard)!=null&&G.propsSteps)){for(const Y of ee.propsWizard.propsSteps)if(Y.sectionsWizard){const F=Array.isArray(Y.sectionsWizard)?Y.sectionsWizard:[Y.sectionsWizard],_=$(F,z);if(_)return _}}}return null};function I(se,z,G,ee){const K={};return!Array.isArray(se)||se.length===0||(se.forEach(Y=>{const F=R=>typeof R=="string"&&R.trim()!==""&&!isNaN(Number(R))?R.length>1&&R.startsWith("0")&&!R.startsWith("0.")||R.length>15&&/^\d+$/.test(R)?R:Number(R):R,_=R=>{var S,T,D,Z;if(R.startsWith("$value(")){const J=R.match(/\$value\(([^)]+)\)/);let fe=J?J[1]:R.replace("$value(","").replace(")","");return(fe.startsWith("'")&&fe.endsWith("'")||fe.startsWith('"')&&fe.endsWith('"'))&&(fe=fe.slice(1,-1)),fe}if(R.startsWith("$route.")){const J=R.replace("$route.","");if(e.apiParams&&e.apiParams[J]!==void 0&&e.apiParams[J]!==null)return e.apiParams[J];const fe=((S=a==null?void 0:a.currentRoute)==null?void 0:S.value)||l;return fe?(T=fe.params)==null?void 0:T[J]:void 0}if(R.startsWith("$query.")){const J=R.replace("$query.","");if(e.apiParams&&e.apiParams[J]!==void 0&&e.apiParams[J]!==null)return e.apiParams[J];if(typeof window<"u"){const ae=new URLSearchParams(window.location.search);if(ae.has(J))return ae.get(J)}const fe=((D=a==null?void 0:a.currentRoute)==null?void 0:D.value)||l;return(Z=fe==null?void 0:fe.query)==null?void 0:Z[J]}if(R.startsWith("$value.")){const J=R.replace("$value.","");return Ye(ee,J)}},b=R=>{var D,Z,J,fe,ae,we,pe;if(R.startsWith("$"))return _(R);const S=R.replace(/^formData\./,"");let T=ee?Ye(ee,S):void 0;if(T===void 0&&c.tableRowFormData){const ke=Object.keys(c.tableRowFormData);T=Ye(c.tableRowFormData,S),T!==void 0?console.log(`[resolveKeyParams] Found in state.tableRowFormData '${S}':`,T):console.log(`[resolveKeyParams] NOT found in state.tableRowFormData '${S}'. Available keys:`,ke)}if(T===void 0){const ke=A.getNormalizedData(c.formData,z);T=(D=ke._resolveLogicVar)==null?void 0:D.call(ke,S),console.log(`[resolveKeyParams] Smart Resolved '${S}':`,T)}else console.log(`[resolveKeyParams] Resolved '${S}':`,T);if(T==null&&G&&G.key===R&&(T=Ye(ee||c.formData,G.model)),T===void 0){const ke=((Z=a==null?void 0:a.currentRoute)==null?void 0:Z.value)||l,be=(J=ke==null?void 0:ke.query)==null?void 0:J[S];be!=null&&be!==""&&(T=be,console.log(`[resolveKeyParams] Query Fallback Resolved '${S}':`,T))}if(T===void 0){const ke=((fe=a==null?void 0:a.currentRoute)==null?void 0:fe.value)||l,be=(ae=ke==null?void 0:ke.params)==null?void 0:ae[S];be!=null&&be!==""&&(T=be,console.log(`[resolveKeyParams] Route Param Fallback Resolved '${S}':`,T))}if(T===void 0&&S.toLowerCase()==="id"){const ke=((we=a==null?void 0:a.currentRoute)==null?void 0:we.value)||l,be=(pe=ke==null?void 0:ke.params)==null?void 0:pe.id;be&&(T=be,console.log(`[resolveKeyParams] Route ID Fallback Resolved '${S}':`,T))}return T};if(typeof Y=="string"){let R=b(Y);if(R!=null&&R!==""){R=ES(R),typeof R=="object"&&!Array.isArray(R)&&!(R instanceof Date)&&!ew(R)&&(R=R.id??R.value??R.code??R);const S=Y.startsWith("$")&&Y.split(".").pop()||Y;K[S]=F(R)}}else typeof Y=="object"&&Y!==null&&Object.entries(Y).forEach(([R,S])=>{var Z,J,fe,ae,we;let D=b(S);if((D==null||D==="")&&(e.apiParams&&e.apiParams[R]!==void 0&&e.apiParams[R]!==null&&(D=e.apiParams[R],console.log(`[resolveKeyParams] Fallback resolved '${R}' from apiParams:`,D)),D==null||D==="")){if(typeof window<"u"){const pe=new URLSearchParams(window.location.search);pe.has(R)&&(D=pe.get(R))}if(D===void 0){const pe=((Z=a==null?void 0:a.currentRoute)==null?void 0:Z.value)||l;D=((J=pe==null?void 0:pe.query)==null?void 0:J[R])||((fe=pe==null?void 0:pe.params)==null?void 0:fe[R])}D!=null&&D!==""&&console.log(`[resolveKeyParams] Fallback resolved '${R}' from URL query/route matching apiKey:`,D)}if((D==null||D==="")&&R.toLowerCase()==="id"){const pe=((ae=a==null?void 0:a.currentRoute)==null?void 0:ae.value)||l,ke=(we=pe==null?void 0:pe.params)==null?void 0:we.id;ke&&(D=ke,console.log(`[resolveKeyParams] Fallback resolved '${R}' from route ID:`,D))}D!=null&&D!==""&&(D=ES(D),typeof D=="object"&&!Array.isArray(D)&&!(D instanceof Date)&&!ew(D)&&(D=D.id??D.value??D.code??D),K[R]=F(D))})}),Object.keys(K).length>0&&console.log(`[resolveKeyParams][DEBUG] Resolved params for ${z||"root"}:`,K)),K}const O=async(se,z=!1,G,ee)=>{const K=se.props||{},Y=K.endpointReference||K.endpoint||K.endpointComponent;if(!(Y!=null&&Y.apiUrl))return;const F=se.component||"";if(!["DCodeWorkflowDiagram","DCodeStaticImage","DCodeTimelineWithIcons"].includes(F)&&!(!z&&c.rawItemsCache[se.key]))try{const b=vo(Y.apiUrl,f.value);console.log(`[prefetchFieldItems][DEBUG] Field: ${se.model}, BaseURL: ${f.value}, Final URL: ${b}`);let R={page:1,perPage:100};if(Array.isArray(Y.keyParam)&&Object.assign(R,I(Y.keyParam,G,se,ee)),Array.isArray(Y.keyParam)&&Y.keyParam.length>0){const J=I(Y.keyParam,G,se,ee);if(Object.keys(J).length===0){console.log(`[prefetchFieldItems][SKIPPED] Field "${se.model}" has unresolved dependencies (keyParam). Skipping fetch until parent is selected.`);return}}console.log(`[prefetchFieldItems] Executing request for ${se.key} with params:`,R);const S={...Y.config||{}};Y.accept&&(S.headers||(S.headers={}),S.headers.Accept=Y.accept,S.headers.accept=Y.accept);const T=await s(b,Y.apiMethod||"GET",R,S),D=(T==null?void 0:T.data)!==void 0?T.data:T;let Z=[];Array.isArray(D)?Z=D:D&&(Z=[D]),c.rawItemsCache[se.key]=Z}catch(b){console.error(`[prefetchFieldItems] Error fetching items for ${se.key}:`,b),c.rawItemsCache[se.key]=[]}};function q(){var se;if(e.isEditMode&&((se=d.value)!=null&&se.sections)){const z=[],G=ee=>{ee.forEach(K=>{var Y,F;K&&(z.push(K),((Y=K.type)==null?void 0:Y.toUpperCase())==="WIZARD"&&((F=K.propsWizard)!=null&&F.propsSteps)&&K.propsWizard.propsSteps.forEach(_=>{const b=Array.isArray(_.sectionsWizard)?_.sectionsWizard:[_.sectionsWizard].filter(Boolean);G(b)}))})};G(d.value.sections),z.forEach(ee=>{var R;const K=Pt(ee);if(!K)return;const Y=ee.propsForm||ee.propsFormStep||ee.propsTable||ee.propsTableStep||ee.props||{},F=(R=ee.logic||Y.logic)==null?void 0:R.visibleRule;if(F!=null)return;(Y.fields||ee.fields||[]).some(S=>{var J;if(!S.model)return!1;const T=(J=y.value.models.get(S.model))==null?void 0:J[0],D=(T==null?void 0:T.path)||S.model,Z=Ye(c.formData,D);return Z!=null&&Z!==""})&&(c.revealedSectionIds[K]=!0)})}}const X=async(se=!1)=>{var G,ee,K,Y,F,_,b,R,S,T,D;const z=((G=d.value)==null?void 0:G.endpointAction)||((ee=d.value)==null?void 0:ee.endpointPropAction);if(z!=null&&z.apiUrl&&!(!e.isEditMode&&!se)){console.log(`[fetchFormData][GLOBAL] Triggered for schema: ${(K=d.value)==null?void 0:K.code}`),c.isSubmitting.value=!0;try{const Z=vo(z.apiUrl,f.value),J=I(z.keyParam||[]);if(e.isEditMode&&(z.apiMethod||"GET").toUpperCase()==="GET"&&!Object.keys(J).some(ke=>ke.toLowerCase()==="id"||ke.toLowerCase().endsWith("id"))){const ke=((_=(F=(Y=a==null?void 0:a.currentRoute)==null?void 0:Y.value)==null?void 0:F.params)==null?void 0:_.id)||((b=l==null?void 0:l.params)==null?void 0:b.id);ke&&(J.id=ke)}console.log("[fetchFormData][GLOBAL] Executing request with params:",J);const fe={...z.config||{}};z.accept&&(fe.headers||(fe.headers={}),fe.headers.Accept=z.accept,fe.headers.accept=z.accept);const ae=await s(Z,z.apiMethod||"GET",J,fe);if((ae==null?void 0:ae.status)===!0||(ae==null?void 0:ae.success)===!0||(ae==null?void 0:ae.code)===200||(ae==null?void 0:ae.code)==="00"||(ae==null?void 0:ae.status)==="SUCCESS"){const pe=(ae==null?void 0:ae.data)!==void 0?ae.data:ae;if(Array.isArray(pe)){const ke=(S=(R=d.value)==null?void 0:R.sections)==null?void 0:S.find(Se=>Se.type==="TABLE"||!!Se.propsTable||!!Se.isDataTable),be=ke?Pt(ke):null;be?Xt(c.formData,be,pe):Object.assign(c.formData,pe[0]||{})}else pe&&typeof pe=="object"&&(Object.assign(c.formData,pe),(D=(T=d.value)==null?void 0:T.sections)==null||D.forEach(ke=>{const be=Pt(ke);be&&pe[be]!==void 0&&Xt(c.formData,be,pe[be])}));Object.assign(c.originalData,JSON.parse(JSON.stringify(c.formData))),q()}}catch(Z){console.error("[fetchFormData] Error fetching initial data:",Z)}finally{c.isSubmitting.value=!1}}},oe=async(se,z,G,ee)=>{var Y,F;const K=z.endpoint;if(K!=null&&K.apiUrl){if(c.fieldLoading[se.model]){console.log(`[triggerFetchRule][SKIPPED] Rule for ${se.model} is already in progress.`);return}if(e.dummyMode){xt.info(`Simulasi Fetch Rule (${se.model})`,{autoClose:2e3}),c.formData[`_fetchStatus_${se.model}`]=!0,Array.isArray(z.revealSections)&&z.revealSections.forEach(_=>{c.revealedSectionIds[_]=!0}),Array.isArray(z.revealFields)&&z.revealFields.forEach(_=>{c.revealedFieldModels[_]=!0});return}try{c.fieldLoading[se.model]=!0;const _=vo(K.apiUrl,f.value),b=I(K.keyParam||[],G,se,ee);if(K.keyParam&&K.keyParam.length>0&&Object.keys(b).length===0){console.warn(`[triggerFetchRule][CANCELLED] Missing required dependencies for ${se.model}. Params resolved:`,b),P.handleClearMapping(z.mapping||{},G),c.formData[`_fetchStatus_${se.model}`]=!1,Array.isArray(z.revealSections)&&z.revealSections.forEach(J=>{c.revealedSectionIds[J]=!1}),Array.isArray(z.revealFields)&&z.revealFields.forEach(J=>{c.revealedFieldModels[J]=!1});return}const R={...K.config,disableGlobalLoading:!0};K.accept&&(R.headers||(R.headers={}),R.headers.Accept=K.accept,R.headers.accept=K.accept),_.includes("/api/auto-layout")&&(R.isAutoLayout=!0);const S=Object.values(b).some(J=>ew(J));let T=b;if(S&&(K.apiMethod||"POST").toUpperCase()!=="GET"){const J=new FormData;Object.entries(b).forEach(([fe,ae])=>{ae!=null&&(Array.isArray(ae)?ae.forEach(we=>J.append(fe,we)):J.append(fe,ae))}),T=J,R.headers&&(delete R.headers["Content-Type"],delete R.headers["content-type"])}console.log(`[triggerFetchRule] Executing request for ${se.key}. Method: ${K.apiMethod||"GET"}, Has File: ${S}`,b,"Config:",R);const D=await s(_,K.apiMethod||"GET",T,R);if((D==null?void 0:D.status)===!0||(D==null?void 0:D.success)===!0||(D==null?void 0:D.code)===200||(D==null?void 0:D.code)==="00"||(D==null?void 0:D.status)==="SUCCESS"){const J=G!=null&&G.includes(".")?G.split(".").slice(0,-1).join("."):void 0;P.handleResponseMapping(D,z.mapping||{},J),c.formData[`_fetchStatus_${se.model}`]=!0;const fe=(D==null?void 0:D.data)!==void 0?D.data:D;fe&&typeof fe=="object"&&Array.isArray(fe)===!1&&((F=(Y=d.value)==null?void 0:Y.sections)==null||F.forEach(ae=>{const we=Pt(ae);we&&fe[we]!==void 0&&Xt(c.formData,we,fe[we])})),Array.isArray(z.revealSections)&&z.revealSections.forEach(ae=>{c.revealedSectionIds[ae]=!0}),Array.isArray(z.revealFields)&&z.revealFields.forEach(ae=>{c.revealedFieldModels[ae]=!0})}else{const J=z.dialog||{},fe=J.type==="ALERT";c.confirmDialog.title=r.value==="id"?J.titleID||"Perhatian":J.titleEN||"Attention",c.confirmDialog.message=(D==null?void 0:D.message)||(r.value==="id"?"Data sudah ada atau sedang diproses.":"Data already exists or is being processed."),c.confirmDialog.showCancel=!fe&&J.showCancel!==!1,c.confirmDialog.isBlocking=J.isBlocking===!0,c.confirmDialog.redirectUrl=J.redirectUrl||"",c.confirmDialog.okText=r.value==="id"?J.okTextID||J.okText:J.okTextEN||J.okText,c.confirmDialog.cancelText=r.value==="id"?J.cancelTextID||J.cancelText:J.cancelTextEN||J.cancelText,c.confirmDialog.action={callback:()=>{}},c.confirmDialog.visible=!0}}catch(_){console.error(`[triggerFetchRule] Error for ${se.model}:`,_)}finally{c.fieldLoading[se.model]=!1}}},ue=async(se,z,G)=>{var _,b,R,S,T,D,Z,J,fe,ae,we;const ee=z||$(((_=d.value)==null?void 0:_.sections)||[],se);if(!ee){console.warn(`[fetchSectionData] Section not found for key: ${se}`);return}const K=ee.propsForm||ee.propsFormStep||ee.propsTable||ee.propsTableStep||ee.props||{},Y=K.endpointSection||K.endpointForm||K.endpointTable||K.endpoint;if(!(Y!=null&&Y.apiUrl))return;if(console.log(`[fetchSectionData][CHECK] Request for "${se}". Loading state:`,c.sectionLoading[se]),c.sectionLoading[se]){console.warn(`[fetchSectionData][CANCELLED] Request for "${se}" blocked because it is already loading.`);return}if(e.dummyMode)return;const F=G;c.sectionLoading[se]=!0,ee.key&&(c.sectionLoading[ee.key]=!0);try{const pe=Y.keyParam||[],ke=Y.byPassMode===!0||Array.isArray(pe)&&pe.includes("$bypassMode"),be=ee.type==="FORM"||!!ee.propsForm,Se=(Y.apiMethod||"GET").toUpperCase()==="GET";if(be&&!e.isEditMode&&Se&&!ke){c.sectionLoading[se]=!1;return}const ve=vo(Y.apiUrl,f.value),Be=ee.type==="TABLE"||!!ee.propsTable,Ee=I(pe,F);if((Y.apiMethod||"GET").toUpperCase()==="GET"&&!Object.keys(Ee).some(ne=>ne.toLowerCase()==="id"||ne.toLowerCase().endsWith("id"))){const ne=((S=(R=(b=a==null?void 0:a.currentRoute)==null?void 0:b.value)==null?void 0:R.params)==null?void 0:S.id)||((T=l==null?void 0:l.params)==null?void 0:T.id)||((J=(Z=(D=a==null?void 0:a.currentRoute)==null?void 0:D.value)==null?void 0:Z.query)==null?void 0:J.id)||((fe=l==null?void 0:l.query)==null?void 0:fe.id)||(typeof window<"u"?new URLSearchParams(window.location.search).get("id"):null);ne&&(Ee.id=ne)}if(Be){if(!c.sectionPagination[se]){const Ce=ee.propsTable||ee.propsTableStep||{};c.sectionPagination[se]={page:1,perPage:Ce.perPage||10,totalData:0,maxPage:1}}Ee.page=c.sectionPagination[se].page,Ee.perPage=c.sectionPagination[se].perPage}const Oe=ke?pe.filter(Ce=>!(typeof Ce=="string"&&Ce==="$bypassMode")):pe;if(!(Array.isArray(Oe)&&Oe.length===0)&&Y.keyParam&&Y.keyParam.length>0&&Object.keys(Ee).length===0){console.warn(`[fetchSectionData][CANCELLED] Missing required dependencies for section ${se}. Skipping fetch.`);return}const Re={...Y.config};Y.accept&&(Re.headers||(Re.headers={}),Re.headers.Accept=Y.accept,Re.headers.accept=Y.accept),ve.includes("/api/auto-layout")&&(Re.isAutoLayout=!0),console.log(`[fetchSectionData] Executing request for ${se} with params:`,Ee);const De=await s(ve,Y.apiMethod||"GET",Ee,Re);if((De==null?void 0:De.status)===!0||(De==null?void 0:De.success)===!0||(De==null?void 0:De.code)===200||(De==null?void 0:De.code)==="00"||(De==null?void 0:De.status)==="SUCCESS"){if(Be&&(c.sectionPagination[se]||(c.sectionPagination[se]={page:1,perPage:10}),c.sectionPagination[se].totalData=(De==null?void 0:De.totalData)??(De==null?void 0:De.total)??(De==null?void 0:De.count)??0,c.sectionPagination[se].maxPage=(De==null?void 0:De.maxPage)??1,c.sectionPagination[se].perPage=(De==null?void 0:De.perPage)??c.sectionPagination[se].perPage),Y.mapping&&Object.keys(Y.mapping).length>0)P.handleResponseMapping(De,Y.mapping,F);else{const Ce=(De==null?void 0:De.data)||(De==null?void 0:De.payload)||De,ne=Array.isArray(Ce)&&!Be?Ce[0]:Ce;if(ne&&(typeof ne=="object"||Array.isArray(ne))){const ye=k(ne,ee,F);if(Be&&Array.isArray(ne)){const Ve=ee.propsTable||ee.propsTableStep||{},Fe=Ve.modelKey||Ve.modelDatatable||Pt(ee);Fe&&(ye[Fe]=ne)}const Me=(Ve,Fe)=>{var at;if(!Ve)return{siblings:[],stepKey:null};const Ue=Pt(Fe);for(const nt of Ve)if(nt.type==="WIZARD"&&((at=nt.propsWizard)!=null&&at.propsSteps))for(const Tt of nt.propsWizard.propsSteps){const fi=Array.isArray(Tt.sectionsWizard)?Tt.sectionsWizard:Tt.sectionsWizard?[Tt.sectionsWizard]:[];if(fi.some(cn=>Pt(cn)===Ue))return{siblings:fi,stepKey:Tt.modelKey||Tt.key||Tt.id||null};const Jt=Me(fi,Fe);if(Jt.siblings.length>0)return Jt}return{siblings:[],stepKey:null}},Ke=Me(((ae=d.value)==null?void 0:ae.sections)||[],ee),$e=Ke.siblings,He=Ke.stepKey;($e.length>0?$e:((we=d.value)==null?void 0:we.sections)||[]).forEach(Ve=>{var fi,hn,Jt,cn;if(Pt(Ve)===Pt(ee))return;const Fe=Ve.propsForm||Ve.propsFormStep||Ve.propsTable||Ve.propsTableStep||Ve.props||{},Ue=!!((fi=Fe.endpointSection)!=null&&fi.apiUrl||(hn=Fe.endpointForm)!=null&&hn.apiUrl||(Jt=Fe.endpointTable)!=null&&Jt.apiUrl||(cn=Fe.endpoint)!=null&&cn.apiUrl),at=Pt(Ve);let nt="";if(He)nt=He;else if(F){const vn=F.lastIndexOf(".");nt=vn!==-1?F.substring(0,vn):""}if(at&&ne[at]!==void 0){const vn=nt?`${nt}.${at}`:at;Ye(ye,vn)===void 0&&(console.log(`[fetchSectionData][CASCADE] SUCCESS: Direct key match for section "${at}" -> path "${vn}". Value:`,ne[at]),Xt(ye,vn,ne[at]))}const Tt=Fe.modelKey||Fe.modelDatatable;if(Tt&&(Ve.type==="TABLE"||Ve.propsTable)){const vn=nt?`${nt}.${Tt}`:Tt;if(!Tt.includes("."))ne[Tt]!==void 0&&Ye(ye,vn)===void 0&&(console.log(`[fetchSectionData][CASCADE] SUCCESS: modelKey match for section "${at}" -> "${Tt}".`),Xt(ye,vn,ne[Tt]));else{const gr=Tt.indexOf("."),Do=Tt.substring(0,gr),Bi=Tt.substring(gr+1),Ic=ne[Do];if(Array.isArray(Ic)&&Ye(ye,vn)===void 0){const ki=[];for(const pt of Ic){const yr=Bi.includes(".")?Ye(pt,Bi):pt==null?void 0:pt[Bi];Array.isArray(yr)&&ki.push(...yr)}ki.length>0&&(console.log(`[fetchSectionData][CASCADE] SUCCESS: dotted modelKey match for section "${at}" -> "${Tt}" (${ki.length} rows).`),Xt(ye,vn,ki))}}}if(!Ue){const vn=k(ne,Ve);Object.keys(vn).forEach(gr=>{const Do=nt?at?`${nt}.${at}`:nt:void 0,Bi=Do?`${Do}.${gr}`:gr;Ye(ye,Bi)===void 0&&(console.log(`[fetchSectionData][CASCADE] Field "${gr}" cascaded from section "${Pt(ee)}" → "${at||Ve.type}" under context "${nt||"root"}"`),Xt(ye,Bi,vn[gr]))})}}),qv(c.formData,ye)}}Object.assign(c.originalData,JSON.parse(JSON.stringify(c.formData))),q()}}catch(pe){console.error(`[fetchSectionData] Error for section ${se}:`,pe)}finally{c.sectionLoading[se]=!1,ee.key&&(c.sectionLoading[ee.key]=!1)}},te=CK({formData:c.formData,emit:t,mapping:P,validation:B,locale:r,logic:A,state:c,activeSchema:d,prefetchFieldItems:O,triggerFetchRule:oe,navigation:j});SK({state:c,props:e,emit:t,logic:A,mapping:P,fieldMap:y,activeSchema:d,prefetchFieldItems:O,triggerFetchRule:oe,fetchSectionData:ue,router:a}),o.watch(()=>({...c.wizardState}),(se,z)=>{Object.entries(se).forEach(([G,ee])=>{var K,Y,F,_;if((z==null?void 0:z[G])!==ee){const b=(Y=(K=d.value)==null?void 0:K.sections)==null?void 0:Y.find(R=>Pt(R)===G);if(b){const R=(_=(F=b.propsWizard)==null?void 0:F.propsSteps)==null?void 0:_[ee];if(R){const S=R.key||R.id;t("step-change",S)}}}})},{deep:!0,immediate:!0});const re=o.computed(()=>{const se={},z=d.value;return z!=null&&z.sections&&z.sections.forEach(G=>{var K,Y,F;(((K=G.propsForm)==null?void 0:K.fields)||((Y=G.propsTable)==null?void 0:Y.fields)||((F=G.props)==null?void 0:F.fields)||[]).forEach(_=>{var b,R,S,T,D,Z,J,fe,ae,we,pe;if(_.component==="DCodeRadioCustom"){const ke=((b=_.props)==null?void 0:b.name)||"default-group";se[ke]||(se[ke]=[]);let be=((S=(R=_.props)==null?void 0:R.endpoint)==null?void 0:S.apiUrl)||((T=_.props)==null?void 0:T.apiUrl);be=vo(be,f.value),se[ke].push({key:_.key,value:(D=_.props)==null?void 0:D.value,label:((Z=_.props)==null?void 0:Z.labelID)||((J=_.props)==null?void 0:J.labelEN)||_.key,model:_.model||_.key,apiUrl:be,apiMethod:((ae=(fe=_.props)==null?void 0:fe.endpoint)==null?void 0:ae.apiMethod)||((we=_.props)==null?void 0:we.apiMethod),icon:(pe=_.props)==null?void 0:pe.icon,name:ke})}})}),se});return o.onMounted(()=>{var z;const se=Object.keys(c.formData).some(G=>{const ee=c.formData[G];return Array.isArray(ee)||ee&&typeof ee=="object"?!1:ee!=null&&ee!==""});e.isEditMode&&!se&&(console.log(`[useDynamicForm][onMounted] Edit Mode and empty formData. Fetching root-level form data for schema: ${(z=d.value)==null?void 0:z.code}`),X())}),{t:n,locale:r,i18nLocale:i,apiUrl:s,router:a,isSubmitting:c.isSubmitting,internalSchema:c.internalSchema,activeSchema:d,resolvedBaseUrl:f,permissionBase:h,checkPermission:e.checkPermission,userPermissions:e.userPermissions,selectedTokenCore:e.selectedTokenCore,radioGroups:re,confirmDialog:c.confirmDialog,fieldMap:y,rawItemsCache:c.rawItemsCache,revision:c.revision,formData:c.formData,originalData:c.originalData,errors:c.errors,touched:c.touched,isSubmitted:c.isSubmitted,fieldErrors:c.fieldErrors,inlineState:c.inlineState,wizardState:c.wizardState,wizardResponses:c.wizardResponses,sectionLoading:c.sectionLoading,fieldLoading:c.fieldLoading,sectionPagination:c.sectionPagination,validation:B,getSectionKey:Pt,sortedFields:Aq,prefetchFieldItems:O,fetchFormData:X,fetchSectionData:ue,getDeepValue:Ye,setDeepValue:Xt,...A,...P,...E,...te,resolveKeyParams:I,navigation:j}}const tw=o.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)(o.unref(TK)({variant:e.variant}),t.class))},[o.renderSlot(n.$slots,"default")],2))}}),TK=Vm("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),Rf=o.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),If=o.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("p-6 pt-0",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),Of=o.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(nn)("flex flex-col gap-y-1.5 p-6",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),Lf=o.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createElementBlock("h3",{class:o.normalizeClass(o.unref(nn)("font-medium leading-none tracking-tight",t.class))},[o.renderSlot(n.$slots,"default")],2))}}),PK={key:0,class:"mb-4 space-y-2"},BK={class:"flex items-center justify-between"},NK={class:"p-4 rounded-lg border border-slate-200 dark:border-neutral-700 bg-gradient-to-br from-blue-50 to-indigo-50 dark:from-blue-950/20 dark:to-indigo-950/20 space-y-3"},DK={class:"flex items-start gap-3"},MK={class:"p-2 rounded-lg bg-white dark:bg-neutral-800 shadow-sm"},RK={class:"flex-1"},IK={class:"text-sm font-semibold text-slate-800 dark:text-neutral-200"},OK={class:"text-xs text-slate-600 dark:text-neutral-400 mt-1"},LK={class:"flex items-center gap-2"},FK={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},$K={class:"flex flex-wrap items-center justify-center gap-2"},zK=["accept","multiple"],yg=Mn(o.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null},template:{default:null}},emits:["picked","picked:multiple","error"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.ref(!1),a=o.ref(null),l=o.ref(null),c=o.ref(null);o.computed(()=>n.accept||"file/*");const d=o.computed(()=>n.error??a.value);function f(){var I;n.disabled||(I=r.value)==null||I.click()}function h(I){const O=I/1024,q=O/1024;return q>=1?`${q.toFixed(2)} MB`:O>=1?`${O.toFixed(1)} KB`:`${I} B`}function m(I){var q;if(!I)return"File tidak valid";if((q=n.accept)!=null&&q.includes("image/")&&!I.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const O=(n.maxSizeMb??2)*1024*1024;return I.size>O?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:null}function g(I){l.value=I.name,c.value=I.size}function v(I){if(a.value=null,!I.length)return;if(n.mode==="single"){const q=I[0],X=m(q);if(X){a.value=X,i("error",X);return}n.showSelected&&g(q),i("picked",q);return}const O=[];for(const q of I){const X=m(q);if(X){a.value=X,i("error",X);return}O.push(q)}O.length&&(n.showSelected&&g(O[0]),i("picked:multiple",O))}function y(I){const O=I.target,q=Array.from(O.files??[]);v(q),O.value=""}function A(){n.disabled||(s.value=!0)}function C(){n.disabled||(s.value=!0)}function M(){s.value=!1}function B(I){var X,oe;if(n.disabled)return;s.value=!1;const O=Array.from(((X=I.dataTransfer)==null?void 0:X.files)??[]),q=(oe=n.accept)!=null&&oe.includes("image/")?O.filter(ue=>ue.type.startsWith("image/")):O;v(q)}const N=o.computed(()=>(n.accept||"file/*").split(",").map(I=>I.trim()).filter(Boolean).map(I=>I==="image/*"?"IMAGE":I.replace(/^image\//,"").replace(/^\./,"")).join(", "));o.computed(()=>`${n.maxSizeMb??0}MB`);const j=o.ref(!1),W=o.computed(()=>{if(n.disabled||!j.value)return{};const I=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:I?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:I?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}}),{locale:P}=Yn.useI18n(),{apiUrl:E}=o.inject("externalApi")||{},k=o.computed(()=>n.template?cS({template:n.template,locale:P,apiUrl:E}):null),$=o.computed(()=>{if(!k.value)return null;const I=k.value.resolvedIcon;return tn[I]||tn.Download});return(I,O)=>(o.openBlock(),o.createBlock(o.unref(Rf),{class:o.normalizeClass([e.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:o.withCtx(()=>[o.createVNode(o.unref(Of),{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Lf),{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1})]),_:1}),o.createVNode(o.unref(If),{class:"pt-2"},{default:o.withCtx(()=>[k.value&&k.value.hasTemplate?(o.openBlock(),o.createElementBlock("div",PK,[o.createElementVNode("div",BK,[o.createElementVNode("button",{type:"button",onClick:O[0]||(O[0]=q=>k.value.toggleExpanded()),class:"text-xs font-medium text-slate-600 dark:text-slate-400 hover:text-primary-600 dark:hover:text-primary-400 transition-colors flex items-center gap-1"},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(k.value.isExpanded?tn.ChevronDown:tn.ChevronRight),{class:"w-3 h-3"})),o.createTextVNode(" "+o.toDisplayString(k.value.toggleButtonText),1)])]),o.withDirectives(o.createElementVNode("div",NK,[o.createElementVNode("div",DK,[o.createElementVNode("div",MK,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent($.value),{class:"w-5 h-5 text-primary-600 dark:text-primary-400"}))]),o.createElementVNode("div",RK,[o.createElementVNode("h4",IK,o.toDisplayString(k.value.resolvedTitle),1),o.createElementVNode("p",OK,o.toDisplayString(k.value.resolvedDescription),1)])]),o.createElementVNode("div",LK,[k.value.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:1,type:"button",size:"sm",variant:"destructive",disabled:k.value.isDownloading||e.disabled,onClick:O[2]||(O[2]=q=>k.value.downloadTemplate()),class:"text-xs"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.RotateCw),{class:"w-3.5 h-3.5 mr-1.5"})),o.createTextVNode(" "+o.toDisplayString(k.value.retryButtonText),1)]),_:1},8,["disabled"])):(o.openBlock(),o.createBlock(o.unref(Fr),{key:0,type:"button",size:"sm",disabled:k.value.isDownloading||e.disabled,onClick:O[1]||(O[1]=q=>k.value.downloadTemplate()),class:"text-xs"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(k.value.isDownloading?tn.Loader2:tn.Download),{class:o.normalizeClass(["w-3.5 h-3.5 mr-1.5",k.value.isDownloading?"animate-spin":""])},null,8,["class"])),o.createTextVNode(" "+o.toDisplayString(k.value.resolvedLabel),1)]),_:1},8,["disabled"])),k.value.downloadError?(o.openBlock(),o.createBlock(o.unref(Fr),{key:2,type:"button",size:"sm",variant:"ghost",onClick:O[3]||(O[3]=q=>k.value.clearError()),class:"text-xs"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(tn.X),{class:"w-3.5 h-3.5"}))]),_:1})):o.createCommentVNode("",!0)]),k.value.downloadError?(o.openBlock(),o.createBlock(o.unref(jv),{key:0,variant:"destructive",class:"text-xs py-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uv),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(k.value.downloadError),1)]),_:1})]),_:1})):o.createCommentVNode("",!0)],512),[[o.vShow,k.value.isExpanded]])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",e.disabled?"is-disabled":""]]),style:o.normalizeStyle([{minHeight:"190px"},W.value]),onClick:f,onDragenter:o.withModifiers(A,["prevent"]),onDragover:o.withModifiers(C,["prevent"]),onDragleave:o.withModifiers(M,["prevent"]),onDrop:o.withModifiers(B,["prevent"]),onMouseenter:O[4]||(O[4]=q=>j.value=!0),onMouseleave:O[5]||(O[5]=q=>j.value=!1)},[o.createElementVNode("div",FK,[O[6]||(O[6]=o.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),O[7]||(O[7]=o.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),o.createElementVNode("div",$K,[o.createVNode(o.unref(tw),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:o.withCtx(()=>[o.createTextVNode(" Allowed: "+o.toDisplayString(N.value),1)]),_:1}),o.createVNode(o.unref(tw),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:o.withCtx(()=>[o.createTextVNode(" Max: "+o.toDisplayString(n.maxSizeMb)+"MB ",1)]),_:1})]),e.showSelected&&l.value?(o.openBlock(),o.createBlock(o.unref(tw),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.value)+" • "+o.toDisplayString(c.value?h(c.value):""),1)]),_:1})):o.createCommentVNode("",!0)]),o.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:e.accept,multiple:e.mode==="multiple",onChange:y},null,40,zK)],38),d.value?(o.openBlock(),o.createBlock(o.unref(jv),{key:1,variant:"destructive",class:"mt-3"},{default:o.withCtx(()=>[o.createVNode(o.unref(Uv),{class:"text-sm"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value),1)]),_:1})]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-2cc0ac42"]]),jK={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},UK={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},WK={class:"relative overflow-auto p-0"},nw=o.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(e,{emit:t}){const n=e,i=t,r=o.computed({get:()=>n.modelValue,set:B=>i("update:modelValue",B)}),s=o.ref(null),a=o.ref(null);let l=null,c=!1,d=0,f=null;function h(){if(l){try{l.close()}catch{}l=null,f&&(f.disconnect(),f=null),s.value&&(s.value.innerHTML=""),a.value=null}}async function m(B,N,j,W,P){const E=await new Promise((I,O)=>{const q=URL.createObjectURL(B),X=new Image;X.onload=()=>{URL.revokeObjectURL(q),I(X)},X.onerror=oe=>{URL.revokeObjectURL(q),O(oe)},X.src=q}),k=document.createElement("canvas");k.width=N,k.height=j;const $=k.getContext("2d");return $?($.drawImage(E,0,0,N,j),await new Promise(I=>{k.toBlob(O=>I(O||B),W,P)})):B}function g(){if(!l||!a.value)return;const B=l.getPlugin("Dashboard"),N=l.getFile(a.value);!B||!N||requestAnimationFrame(()=>{try{B.openFileEditor(N)}catch{try{B.openFileEditor(a.value)}catch{}}})}async function v(B){if(l){l.cancelAll(),a.value=null;try{const N=l.addFile({name:B.name,type:B.type,data:B,source:"Local",isRemote:!1});a.value=String(N)}catch{}}}function y(){if(!s.value)return;l&&h(),l=new tI({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const B=document.documentElement.classList.contains("dark");l.use(X1,{target:s.value,inline:!0,height:480,theme:B?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),f=new MutationObserver(()=>{if(!l)return;const N=document.documentElement.classList.contains("dark"),j=l.getPlugin("Dashboard");j&&j.setOptions({theme:N?"dark":"light"})}),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(nI,{target:X1,quality:n.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:n.aspectRatio==null?Number.NaN:n.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",N=>{a.value=(N==null?void 0:N.id)??null,n.autoOpenEditor&&setTimeout(()=>g(),80)}),l.on("file-editor:complete",async N=>{const j=++d;try{const W=N.data,P=W.type||N.type||"image/jpeg";let E=W;if(n.outputWidth&&n.outputHeight&&(E=await m(W,n.outputWidth,n.outputHeight,P,n.quality)),c||j!==d)return;const k=N.name||"edited-image.jpg",$=new File([E],k,{type:P});await A($,"UPPY_EDITOR_COMPLETE"),i("done",$),r.value=!1}catch{}})}async function A(B,N="CROP_RESULT"){const j=URL.createObjectURL(B);try{const W=await new Promise((P,E)=>{const k=new Image;k.onload=()=>P(k),k.onerror=E,k.src=j});console.group(N),console.table({name:B.name,type:B.type,sizeBytes:B.size,sizeMB:+(B.size/1024/1024).toFixed(3),width:W.naturalWidth,height:W.naturalHeight,ratio:+(W.naturalWidth/W.naturalHeight).toFixed(4)}),console.groupEnd()}finally{URL.revokeObjectURL(j)}}o.watch(r,async B=>{c=!B,d++,B?(await o.nextTick(),y(),n.file&&await v(n.file)):h()},{flush:"post"}),o.watch(()=>n.file,async B=>{r.value&&B&&(await o.nextTick(),await v(B))}),o.onBeforeUnmount(()=>{c=!0,d++,h()});const C=B=>{B.key==="Escape"&&r.value&&(r.value=!1)};o.watch(r,B=>{B?globalThis.addEventListener("keydown",C):globalThis.removeEventListener("keydown",C)},{immediate:!0});const M=o.ref(!1);return(B,N)=>r.value?(o.openBlock(),o.createElementBlock("div",jK,[o.createVNode(o.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:o.withCtx(()=>[r.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:N[0]||(N[0]=j=>r.value=!1)})):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:o.withCtx(()=>[r.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-700/50 bg-background dark:bg-neutral-800 shadow-2xl transition-all",onClick:N[4]||(N[4]=o.withModifiers(()=>{},["stop"]))},[o.createElementVNode("div",UK,[N[6]||(N[6]=o.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),o.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:o.normalizeStyle({opacity:M.value?1:.7}),onClick:N[1]||(N[1]=j=>r.value=!1),onMouseenter:N[2]||(N[2]=j=>M.value=!0),onMouseleave:N[3]||(N[3]=j=>M.value=!1)},[o.createVNode(o.unref(Ne.X),{class:"h-4 w-4"}),N[5]||(N[5]=o.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),o.createElementVNode("div",WK,[o.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):o.createCommentVNode("",!0)]),_:1})])):o.createCommentVNode("",!0)}}),HK={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},qK=["src"],KK=["disabled"],GK=["disabled"],YK={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},ZK={class:"flex gap-2"},XK={class:"font-medium truncate"},JK={class:"flex gap-2"},QK={class:"font-medium"},VK={class:"flex gap-2"},eG={class:"font-medium truncate"},iw=Mn(o.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null);o.watch(()=>n.file,m=>{r.value&&URL.revokeObjectURL(r.value),r.value=m?URL.createObjectURL(m):null},{immediate:!0}),o.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),d&&d.disconnect()});function s(m){const g=m/1024,v=g/1024;return v>=1?`${v.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const a=o.computed(()=>n.file?{name:n.file.name,size:s(n.file.size),type:n.file.type||"unknown"}:null),l=o.ref(!1),c=o.ref(!1);let d=null;const f=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};o.onMounted(()=>{f(),typeof document<"u"&&(d=new MutationObserver(f),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const h=o.computed(()=>n.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,g)=>e.file?(o.openBlock(),o.createBlock(Rf,{key:0,class:o.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:o.withCtx(()=>[o.createVNode(Of,{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(Lf,{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1}),e.description?(o.openBlock(),o.createElementBlock("div",HK,o.toDisplayString(e.description),1)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(If,{class:"pt-2"},{default:o.withCtx(()=>{var v,y,A;return[o.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:o.normalizeStyle([{height:`${e.previewHeight}px`},h.value]),onMouseenter:g[2]||(g[2]=C=>l.value=!0),onMouseleave:g[3]||(g[3]=C=>l.value=!1)},[r.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,qK)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"d-action-buttons",style:o.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[e.showEdit?(o.openBlock(),o.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:o.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:g[0]||(g[0]=C=>i("edit"))},[o.createVNode(o.unref(Ne.Pencil),{style:{width:"16px",height:"16px"}})],12,KK)):o.createCommentVNode("",!0),e.showRemove?(o.openBlock(),o.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:o.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:g[1]||(g[1]=C=>i("remove"))},[o.createVNode(o.unref(Ne.Trash2),{style:{width:"16px",height:"16px"}})],12,GK)):o.createCommentVNode("",!0)],4),o.createElementVNode("div",{class:"d-metadata-overlay",style:o.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[o.createElementVNode("div",YK,[o.createElementVNode("div",ZK,[g[4]||(g[4]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),o.createElementVNode("span",XK,o.toDisplayString((v=a.value)==null?void 0:v.name),1)]),o.createElementVNode("div",JK,[g[5]||(g[5]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),o.createElementVNode("span",QK,o.toDisplayString((y=a.value)==null?void 0:y.size),1)]),o.createElementVNode("div",VK,[g[6]||(g[6]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),o.createElementVNode("span",eG,o.toDisplayString((A=a.value)==null?void 0:A.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),tG={class:"space-y-3"},nG={class:"flex flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-primary-300 dark:border-primary-700 bg-primary-50/50 dark:bg-primary-900/10",style:{"min-height":"190px"}},bg=o.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1},template:{default:null}},emits:["update:modelValue","error","uploaded"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.ref(!1),a=o.ref(null),l=o.ref(null);o.watch(()=>n.modelValue,te=>{te instanceof File?r.value=te:te||(r.value=null)},{immediate:!0});const c=o.ref(null);function d(te){c.value=te,i("error",te)}function f(){c.value=null}const h=o.computed(()=>{const te=(n.allowedTypes??"").trim();return te?te.split(/[,\s;]+/g).map(ge=>ge.trim().toLowerCase()).filter(Boolean).map(ge=>ge.includes("/")||ge.startsWith(".")?ge:`.${ge}`):[]});function m(te){const re=te.lastIndexOf(".");return re>=0?te.slice(re).toLowerCase():""}const g=o.computed(()=>{if(h.value.length){const te=h.value.filter(ge=>ge.startsWith("."));return[...h.value.filter(ge=>ge.includes("/")),...te].join(",")}return n.accept||"image/*"}),v=o.computed(()=>h.value.length?h.value.join(", "):n.accept||"image/*");function y(te){if(h.value.length){const ge=(te.type||"").toLowerCase(),ce=m(te.name);return h.value.some(se=>se.includes("/")?ge===se:se.startsWith(".")?ce===se:ce===`.${se}`)}return(n.accept||"image/*").toLowerCase().includes("image/")?(te.type||"").toLowerCase().startsWith("image/"):!0}function A(te){return te*1024*1024}async function C(te){var re;return(re=te.type)!=null&&re.startsWith("image/")?await new Promise(ge=>{const ce=URL.createObjectURL(te),se=new Image;se.onload=()=>{URL.revokeObjectURL(ce),ge({w:se.naturalWidth,h:se.naturalHeight})},se.onerror=()=>{URL.revokeObjectURL(ce),ge(null)},se.src=ce}):null}async function M(te){if(!(n.minWidth!=null||n.minHeight!=null||n.maxWidth!=null||n.maxHeight!=null))return null;const ge=await C(te);return ge?n.minWidth!=null&&ge.w<n.minWidth?`Lebar gambar minimal ${n.minWidth}px`:n.minHeight!=null&&ge.h<n.minHeight?`Tinggi gambar minimal ${n.minHeight}px`:n.maxWidth!=null&&ge.w>n.maxWidth?`Lebar gambar maksimal ${n.maxWidth}px`:n.maxHeight!=null&&ge.h>n.maxHeight?`Tinggi gambar maksimal ${n.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function B(te){return te?y(te)?n.minSizeMb!=null&&te.size<A(n.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${n.minSizeMb}MB`:n.maxSizeMb!=null&&te.size>A(n.maxSizeMb)?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:await M(te):`only Allowed: ${v.value}`:"File tidak valid"}function N(te){n.disabled||(a.value=te,s.value=!0)}async function j(te){if(n.disabled)return;f();const re=await B(te);if(re){d(re);return}l.value=te,N(te)}const{apiUrl:W}=o.inject("externalApi")||{},P=ig(),E=o.ref(!1),k=o.ref(null);function $(te,re){return!te||!re?null:te.replace(/\/+$/,"")+"/"+re.replace(/^\/+/,"")}function I(te){var se;const re=(te==null?void 0:te.data)??te,ge=(se=re==null?void 0:re.data)==null?void 0:se[0];if(!ge)return null;const ce=$(ge.server,ge.url);return{...ge,fullUrl:ce?encodeURI(ce):null}}async function O(te){var re;if(n.uploadFn){try{E.value=!0;const ge=await n.uploadFn(te);r.value=te,i("update:modelValue",ge),i("uploaded",ge)}catch(ge){console.error("Upload Error",ge),P.error("Upload Failed",(ge==null?void 0:ge.message)||"Unknown error"),d((ge==null?void 0:ge.message)||"Upload Failed")}finally{E.value=!1}return}if(!((re=n.endpoint)!=null&&re.apiUrl)){r.value=te,i("update:modelValue",te);return}try{E.value=!0;const ge=new FormData;ge.append("doc",te);const ce=(n.endpoint.apiMethod||"POST").toUpperCase(),se=n.endpoint.apiUrl,z=await W(se,ce,ge),G=Array.isArray(z==null?void 0:z.data)?z.data[0]:(z==null?void 0:z.data)||z,ee=I(z);ee&&(k.value=ee),r.value=te,i("update:modelValue",G??ee??z),i("uploaded",z)}catch(ge){console.error("Upload Error",ge),P.error("Upload Failed",(ge==null?void 0:ge.message)||"Unknown error"),d((ge==null?void 0:ge.message)||"Upload Failed")}finally{E.value=!1}}async function q(te){f(),await O(te),s.value=!1,a.value=null}function X(){s.value=!1,a.value=null}async function oe(){if(!r.value)return;f();const te=n.editUseOriginal?l.value??r.value:r.value,re=await B(te);if(re){d(re);return}N(te)}function ue(){f(),r.value=null,k.value=null,a.value=null,s.value=!1,l.value=null,i("update:modelValue",null)}return o.watch(()=>n.modelValue,te=>{te instanceof File&&!l.value&&(l.value=te),te||(l.value=null)},{immediate:!0}),(te,re)=>(o.openBlock(),o.createElementBlock("div",tG,[E.value?(o.openBlock(),o.createBlock(o.unref(Rf),{key:0,class:"dark:bg-neutral-800 dark:border-neutral-700/50"},{default:o.withCtx(()=>[o.createVNode(o.unref(Of),{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Lf),{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1})]),_:1}),o.createVNode(o.unref(If),{class:"pt-2"},{default:o.withCtx(()=>[o.createElementVNode("div",nG,[o.createVNode(o.unref(Ne.Loader2),{class:"w-8 h-8 animate-spin text-primary-500"}),re[2]||(re[2]=o.createElementVNode("span",{class:"text-sm font-medium text-primary-600 dark:text-primary-400"},"Uploading...",-1))])]),_:1})]),_:1})):r.value?(o.openBlock(),o.createBlock(iw,{key:2,file:r.value,title:e.label,description:e.description,"preview-width":e.previewWidth,disabled:e.disabled||E.value,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:oe,onRemove:ue,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(o.openBlock(),o.createBlock(yg,{key:1,label:e.label,hint:e.hint,accept:g.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||E.value,template:e.template,onPicked:j,error:c.value,onError:re[0]||(re[0]=ge=>d(ge))},null,8,["label","hint","accept","maxSizeMb","disabled","template","error"])),o.createVNode(nw,{modelValue:s.value,"onUpdate:modelValue":re[1]||(re[1]=ge=>s.value=ge),file:a.value,title:e.title,description:e.description,"auto-open-editor":e.autoOpenEditor,"aspect-ratio":e.aspectRatio,"output-width":e.outputWidth,"output-height":e.outputHeight,quality:e.quality,onDone:q,onCancel:X},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),iG={class:"space-y-4"},rG={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},oG={class:"flex items-center gap-2 flex-nowrap"},sG={key:0,class:"flex flex-col gap-0.5"},aG=["for"],lG={key:0,class:"ml-1 text-destructive"},cG=["for"],dG={class:"text-[11px] text-gray-500 dark:text-gray-400"},uG={class:"flex items-center gap-2 flex-nowrap"},fG=["id","value","disabled","readonly","onKeydown","onInput","onPaste"],hG={key:1,class:"text-xs text-destructive mt-1"},vg=o.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{minLength:{default:6},default:{default:""},endpoint:{},submitFn:{},modelValue:{default:""},label:{default:""},placeholder:{},clearable:{type:Boolean},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(e,{emit:t}){const n=o.useAttrs(),i=Math.random().toString(36).slice(2,7),r=o.computed(()=>`app-otp-${(n.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${i}`),s=e,a=t,l=o.computed(()=>!!s.error),c=o.ref([]),d=o.ref([]),f=o.ref(!1),{DCodeApi:h}=o.inject("externalApi")||{},m=ig(),g=o.computed(()=>{const P=Number(s.minLength);return P&&P>0?P:6}),v=()=>{const P=s.modelValue||s.default||"";d.value=Array.from({length:g.value},(E,k)=>P[k]??""),a("updateOtp",d.value.join(""))};v(),o.watch(()=>[s.minLength,s.default],()=>v()),o.watch(()=>s.modelValue,P=>{const E=P||"";E!==d.value.join("")&&(d.value=Array.from({length:g.value},(k,$)=>E[$]??""))});const y=P=>{P<0||P>=g.value||o.nextTick(()=>{var E;return(E=c.value[P])==null?void 0:E.focus()})},A=P=>P.match(/[a-zA-Z0-9]/)?P.match(/[a-zA-Z0-9]/)[0]:"";async function C(P){var E;if(a("complete",P),s.submitFn){try{f.value=!0,a("loading",!0);const k=await s.submitFn(P);a("success",k)}catch(k){console.error("OTP Submit Error",k),m.error("Submit Failed",(k==null?void 0:k.message)||"Unknown error"),a("error",(k==null?void 0:k.message)||"Submit Failed")}finally{f.value=!1,a("loading",!1)}return}if((E=s.endpoint)!=null&&E.apiUrl){if(typeof h!="function"){a("error","useApi() must expose DCodeApi()");return}try{f.value=!0,a("loading",!0);const k=(s.endpoint.apiMethod||"POST").toUpperCase(),$=s.endpoint.apiUrl,I=await h("","",{otp:P},{_url:$,_method:k,withCredentials:!0}),O=(I==null?void 0:I.data)??I;a("success",O)}catch(k){console.error("OTP Submit Error",k),m.error("Submit Failed",(k==null?void 0:k.message)||"Unknown error"),a("error",(k==null?void 0:k.message)||"Submit Failed")}finally{f.value=!1,a("loading",!1)}}}const M=(P,E)=>{d.value[P]=A(E);const k=d.value.join("");a("updateOtp",k),a("update:modelValue",k),k.length===g.value&&C(k)},B=(P,E)=>{const k=P.key,$=/^\d$/.test(k),I=/^[a-zA-Z]$/.test(k);if(k==="Backspace"){if(P.preventDefault(),d.value[E]){M(E,"");return}E>0&&(M(E-1,""),y(E-1));return}if(k==="ArrowLeft"){P.preventDefault(),y(E-1);return}if(k==="ArrowRight"){P.preventDefault(),y(E+1);return}if($||I){P.preventDefault(),M(E,k),E<g.value-1&&y(E+1);return}k.length===1&&P.preventDefault()},N=(P,E)=>{const k=P.target,$=k.value??"",I=A($);k.value=I,M(E,I),I&&E<g.value-1&&y(E+1)},j=(P,E)=>{var q;P.preventDefault();const $=(((q=P.clipboardData)==null?void 0:q.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!$)return;let I=E;for(const X of $){if(I>=g.value)break;d.value[I]=X,I++}const O=d.value.join("");a("updateOtp",O),a("update:modelValue",O),O.length===g.value&&C(O),y(Math.min(I,g.value-1))},W=P=>E=>{c.value[P]=(E==null?void 0:E.$el)??E};return(P,E)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",iG,[s.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.label?(o.openBlock(),o.createElementBlock("div",rG)):o.createCommentVNode("",!0),o.createElementVNode("div",oG,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,k=>(o.openBlock(),o.createElementBlock("div",{key:k,class:"w-12 h-12 rounded-xl bg-gray-200 dark:bg-gray-700 animate-pulse"}))),128))])],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.label||g.value?(o.openBlock(),o.createElementBlock("div",sG,[s.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:r.value,class:"text-sm font-medium text-foreground"},[o.createTextVNode(o.toDisplayString(s.label)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",lG,"*")):o.createCommentVNode("",!0)],8,aG)):(o.openBlock(),o.createElementBlock("label",{key:1,for:r.value,class:"text-sm font-medium text-foreground"}," Enter security code ",8,cG)),o.createElementVNode("p",dG," Type your "+o.toDisplayString(g.value)+"-digit verification code ",1)])):o.createCommentVNode("",!0),o.createElementVNode("div",uG,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(g.value,k=>(o.openBlock(),o.createElementBlock("input",{key:k,id:k===1?r.value:void 0,ref_for:!0,ref:W(k-1),value:d.value[k-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:s.disabled||f.value,readonly:s.readonly,class:o.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",d.value[k-1]?"border-blue-500 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300":"border-gray-300 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",l.value?"border-destructive focus:ring-destructive":""]),onKeydown:$=>B($,k-1),onInput:$=>N($,k-1),onPaste:$=>j($,k-1)},null,42,fG))),128))]),l.value?(o.openBlock(),o.createElementBlock("p",hG,o.toDisplayString(s.error),1)):o.createCommentVNode("",!0)],64))],512)),[[o.vShow,e.visible]])}}),mG={key:0,class:"ml-1 text-destructive"},pG={key:1,class:"flex items-center gap-3"},gG={key:0,class:"h-4 w-24 bg-neutral-200 dark:bg-neutral-700 rounded animate-pulse"},yG={key:2,class:"inline-flex items-center gap-3"},bG=["id","name","aria-checked","aria-label","disabled"],vG={key:0,class:"absolute inset-0 flex items-center justify-center"},wG={class:"relative z-10 flex items-center gap-2"},_G=["id","name","aria-checked","aria-label","disabled"],kG={key:0,class:"absolute inset-0 flex items-center justify-center"},xG={key:3,class:"text-xs text-destructive mt-1"},EG={name:"DCodeSwitch"},wg=o.defineComponent({...EG,props:{title:{default:""},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"},modelValue:{type:Boolean,default:!1},label:{default:""},placeholder:{},clearable:{type:Boolean},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,i=t,r=o.computed({get:()=>n.modelValue,set:h=>{!n.disabled&&!n.loading&&(i("update:modelValue",h),i("change",h))}});o.watch(()=>n.modelValue,h=>{h==null&&i("update:modelValue",!1)},{immediate:!0});const s=o.computed(()=>{switch(n.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),a=o.computed(()=>{switch(n.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=o.computed(()=>{switch(n.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=o.computed(()=>{if(n.disabled)return"bg-gray-300";if(n.readonly)return r.value?"bg-blue-400 opacity-80":"bg-gray-200 opacity-80";if(!r.value)return"bg-gray-200";switch(n.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{n.disabled||n.readonly||n.loading||(r.value=!r.value)},f=o.computed(()=>r.value?n.tooltipActiveText:n.tooltipInactiveText);return(h,m)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["grid gap-3",n.disabled?"cursor-not-allowed":""])},[e.title?(o.openBlock(),o.createBlock(gd,{key:0,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",mG,"*")):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),n.skeleton?(o.openBlock(),o.createElementBlock("div",pG,[o.createElementVNode("div",{class:o.normalizeClass([s.value,"bg-neutral-200 dark:bg-neutral-700 rounded-full animate-pulse"])},null,2),e.label?(o.openBlock(),o.createElementBlock("div",gG)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",yG,[o.createVNode(o.unref(td),null,{default:o.withCtx(()=>[e.showTooltip?(o.openBlock(),o.createBlock(o.unref(Vc),{key:0,"delay-duration":200},{default:o.withCtx(()=>[o.createVNode(o.unref(nd),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-default opacity-80":e.readonly&&!e.loading,"cursor-pointer":!e.disabled&&!e.loading&&!e.readonly}]),onClick:d},[o.createElementVNode("span",{class:o.normalizeClass([a.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(o.openBlock(),o.createElementBlock("span",vG,[...m[0]||(m[0]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.X),{key:1,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):o.createCommentVNode("",!0)]),_:1})],2)],10,bG)]),_:1}),o.createVNode(o.unref(ed),{side:"top","side-offset":8,class:o.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:o.withCtx(()=>[o.createElementVNode("span",wG,[o.createElementVNode("span",{class:o.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),o.createTextVNode(" "+o.toDisplayString(f.value),1)])]),_:1},8,["class"])]),_:1})):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-default opacity-80":e.readonly&&!e.loading,"cursor-pointer":!e.disabled&&!e.loading&&!e.readonly}]),onClick:d},[o.createElementVNode("span",{class:o.normalizeClass([a.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(o.openBlock(),o.createElementBlock("span",kG,[...m[1]||(m[1]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.Check),{key:0,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.X),{key:1,class:o.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):o.createCommentVNode("",!0)]),_:1})],2)],10,_G))]),_:1})])),n.error?(o.openBlock(),o.createElementBlock("p",xG,o.toDisplayString(n.error),1)):o.createCommentVNode("",!0)],2)),[[o.vShow,e.visible]])}}),CG={key:0,class:"ml-1 text-destructive"},SG={key:1,class:"flex gap-2"},AG=["aria-selected","aria-disabled","disabled","onClick"],TG={key:1,class:"truncate"},PG={key:0,class:"truncate"},BG={key:1,class:"truncate"},NG={key:0,class:"truncate"},DG={key:1,class:"rounded-xl border border-dashed border-slate-300 bg-white p-3 text-sm text-slate-500 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-400"},_g=Mn(o.defineComponent({__name:"DCodeSegment",props:{modelValue:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},options:{default:()=>[]},id:{default:""},skeleton:{type:Boolean,default:!1},layout:{default:"default"}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.ref({width:"0px",transform:"translateX(0px)"}),a=o.computed({get:()=>n.modelValue,set:C=>{n.disabled||n.readonly||(i("update:modelValue",C),i("change",C))}}),l=o.computed(()=>{switch(n.size){case"small":return"px-2.5 py-1 text-xs";case"large":return"px-4 py-2 text-sm";default:return"px-3 py-2 text-sm"}}),c=o.computed(()=>{const C=String(n.color||"primary").trim();return["primary","secondary","accent","destructive","muted","foreground","border","input","ring"].includes(C.toLowerCase())?`hsl(var(--${C.toLowerCase()}))`:C}),d=o.computed(()=>n.disabled?"text-slate-700 dark:text-slate-300":"text-white"),f=o.computed(()=>n.disabled?"text-slate-400 cursor-not-allowed":"text-slate-700 dark:text-slate-200"),h=o.computed(()=>["relative flex w-full overflow-visible rounded-full border border-slate-300 bg-slate-100 shadow-sm dark:border-slate-700 dark:bg-slate-800",n.disabled?"opacity-70 cursor-not-allowed":"",n.readonly&&!n.disabled?"opacity-80":""]),m=o.computed(()=>["flex-1 min-w-0 inline-flex items-center justify-center rounded-full transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 relative z-10",n.layout==="icon-bottom"&&"flex-col",n.layout==="icon-start"&&"flex-row-reverse",n.layout==="icon-end"&&"flex-row",n.layout==="default"&&"flex-row gap-2",l.value]),g=o.computed(()=>tn),v=o.computed(()=>{switch(n.size){case"small":return"w-3.5 h-3.5";case"large":return"w-5 h-5";default:return"w-4 h-4"}}),y=()=>{if(!r.value)return;const C=r.value.querySelectorAll("button[role='tab']"),M=Array.from(C).find(B=>B.getAttribute("aria-selected")==="true");if(M){const B=M.getBoundingClientRect(),N=r.value.getBoundingClientRect(),j=B.left-N.left,W=B.width;s.value={width:`${W}px`,transform:`translateX(${j}px)`}}};o.watch(()=>a.value,()=>{setTimeout(y,0)}),o.watch(()=>n.options,()=>{setTimeout(y,0)},{deep:!0}),o.onMounted(()=>{setTimeout(y,0),window.addEventListener("resize",y)}),o.onBeforeUnmount(()=>{window.removeEventListener("resize",y)});const A=C=>{n.disabled||n.readonly||C.disabled||(a.value=C.value)};return(C,M)=>{var B;return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["grid gap-3",n.disabled?"cursor-not-allowed":""])},[e.title?(o.openBlock(),o.createBlock(gd,{key:0,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",CG,"*")):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),n.skeleton?(o.openBlock(),o.createElementBlock("div",SG,[...M[0]||(M[0]=[o.createElementVNode("div",{class:"h-8 w-20 rounded-full bg-neutral-200 dark:bg-neutral-700 animate-pulse"},null,-1),o.createElementVNode("div",{class:"h-8 w-20 rounded-full bg-neutral-200 dark:bg-neutral-700 animate-pulse"},null,-1)])])):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[(B=n.options)!=null&&B.length?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"containerRef",ref:r,class:o.normalizeClass(h.value)},[o.createElementVNode("div",{class:"absolute top-0 left-0 h-full rounded-full transition-all duration-300 ease-out pointer-events-none",style:o.normalizeStyle({width:s.value.width,transform:s.value.transform,backgroundColor:c.value,zIndex:0})},null,4),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(n.options,N=>(o.openBlock(),o.createElementBlock("button",{key:N.value,type:"button",role:"tab","aria-selected":a.value===N.value?"true":"false","aria-disabled":n.disabled||N.disabled?"true":"false",disabled:n.disabled||N.disabled,class:o.normalizeClass([m.value,N.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer",a.value===N.value?d.value:f.value]),onClick:j=>A(N)},[n.layout==="icon-only"&&N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:0,class:o.normalizeClass(v.value)},null,8,["class"])):n.layout==="default"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:0,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0),N.label?(o.openBlock(),o.createElementBlock("span",TG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0)],64)):n.layout==="icon-bottom"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[N.label?(o.openBlock(),o.createElementBlock("span",PG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0),N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:1,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0)],64)):n.layout==="icon-start"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:0,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0),N.label?(o.openBlock(),o.createElementBlock("span",BG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0)],64)):n.layout==="icon-end"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:4},[N.label?(o.openBlock(),o.createElementBlock("span",NG,o.toDisplayString(N.label),1)):o.createCommentVNode("",!0),N.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(g.value[N.icon]),{key:1,class:o.normalizeClass(v.value)},null,8,["class"])):o.createCommentVNode("",!0)],64)):o.createCommentVNode("",!0)],10,AG))),128))],2)):(o.openBlock(),o.createElementBlock("div",DG," Tidak ada opsi segment. "))],64))],2)}}}),[["__scopeId","data-v-83f4af28"]]),MG=["aria-busy"],RG={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},IG=["for"],OG={key:0,class:"ml-1 text-destructive"},LG={class:"relative w-full group"},FG=["id","value","placeholder"],$G={key:0,class:"absolute top-1 right-2"},zG={key:1,class:"absolute top-full right-0 z-10 text-[11px] text-gray-500 dark:text-gray-400 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100"},jG={key:1,class:"text-xs text-destructive"},Sd=o.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},label:{},placeholder:{},clearable:{type:Boolean},required:{type:Boolean},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const n=o.useAttrs(),i=t,r=e,s=o.computed(()=>n.label??r.label),a=o.computed(()=>n.placeholder??r.placeholder??""),l=o.computed(()=>r.visible??!0),c=Math.random().toString(36).slice(2,7),d=o.computed(()=>`app-textarea-${n.id||s.value||"field"}-${c}`),f=o.computed(()=>{const T=n.required,D=n["aria-required"];return T===""||T===!0||T==="true"||(D==="true"||D===!0)||r.required}),h=o.computed(()=>{const{label:T,class:D,id:Z,required:J,"aria-required":fe,...ae}=n,we={...ae};return r.disabled&&(we.disabled=!0),r.readonly&&(we.readonly=!0),we}),m=o.computed(()=>{const T=n.maxlength;let D=Number.NaN;return typeof T=="number"?D=T:typeof T=="string"&&(D=Number.parseInt(T,10)),Number.isFinite(D)&&D>0?D:-1}),g=T=>m.value>0?T.slice(0,m.value):T,v=o.computed(()=>{const T=r.modelValue;return T==null||String(T).length===0}),y=o.computed(()=>r.clearable?r.hideClearWhenEmpty?!v.value:!0:!1),A=o.ref(String(r.modelValue??""));o.watch(()=>r.modelValue,T=>{const D=String(T??"");D!==A.value&&(A.value=D)});const C=o.ref(!1),M=o.ref(!1),B=T=>T.split(/(\s+)/).map(D=>{if(D.trim()==="")return D;const Z=D.toLowerCase();return Z.charAt(0).toUpperCase()+Z.slice(1)}).join(""),N=T=>{const D=T.toLowerCase(),Z=D.search(new RegExp("\\p{L}","u"));return Z<0?D:D.slice(0,Z)+D.charAt(Z).toUpperCase()+D.slice(Z+1)},j=T=>{const D=T.toLowerCase(),Z=D.search(new RegExp("\\p{L}","u"));return Z<0?D:D.slice(0,Z)+D.charAt(Z).toUpperCase()+D.slice(Z+1)},W=T=>{var D;switch((D=r.textCase)==null?void 0:D.toLowerCase()){case"uppercase":return T.toUpperCase();case"lowercase":return T.toLowerCase();case"titlecase":return B(T);case"capitalize":return j(T);case"sentencecase":return N(T);case"none":default:return T}},P=o.computed(()=>{var T;switch((T=r.textCase)==null?void 0:T.toLowerCase()){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),E=T=>{if(!T)return null;const D=Array.isArray(T)?T.join(""):T;return D?new Set(D):null},k=o.computed(()=>E(r.allowChars)),$=(T,D)=>(T.lastIndex=0,T.test(D)),I=T=>{if(T===`
128
128
  `)return r.valueType!=="number";if(r.valueType==="free")return!0;const D=T===" ",Z=/\d/.test(T),J=new RegExp("\\p{L}","u").test(T),fe=new RegExp("\\p{N}","u").test(T),ae=/[\/\-_.,:]/.test(T);return r.valueType==="number"?Z:r.valueType==="letter"?J||ae||r.allowSpaces&&D:r.valueType==="letternumber"?J||fe||ae||r.allowSpaces&&D:!0},O=T=>{let D="";for(const Z of T){const J=!!k.value&&k.value.has(Z);r.pattern&&!J&&!$(r.pattern,Z)||!J&&!I(Z)||(D+=Z)}return D},q=T=>{const D=O(T),Z=r.applyTextCaseToValue?W(D):D;return g(Z)},X=o.ref(null),oe=T=>{if(T==="")return null;if(r.valueType==="number"&&r.returnNumber){const D=T.replaceAll(`
129
129
  `,""),Z=Number(D);return Number.isFinite(Z)?Z:null}return T},ue=T=>{A.value=T,i("update:modelValue",oe(T))},te=(T,D)=>{const Z=g(D);M.value=!0,T.value=Z,ue(Z),queueMicrotask(()=>M.value=!1)},re=(T,D)=>{const Z=T.selectionStart??T.value.length,J=T.selectionEnd??T.value.length;if(m.value>0){const fe=T.value.length-(J-Z),ae=m.value-fe;if(ae<=0)return;D=D.slice(0,ae)}T.setRangeText(D,Z,J,"end"),te(T,q(T.value))},ge=T=>{var fe;const D=X.value;if(!D||C.value||M.value||!((fe=T.inputType)!=null&&fe.startsWith("insert")))return;const Z=T.data;if(Z==null)return;const J=q(Z);J!==Z&&(T.preventDefault(),J.length>0&&re(D,J))},ce=T=>{var fe;const D=X.value;if(!D||C.value||M.value)return;const Z=((fe=T.clipboardData)==null?void 0:fe.getData("text"))??"",J=q(Z);J!==Z&&(T.preventDefault(),J.length>0&&re(D,J))},se=async T=>{const D=X.value;if(!D||C.value||M.value)return;const Z=D.value??"",J=q(Z);if(J===Z){const fe=D.selectionStart??J.length,ae=D.selectionEnd??J.length;te(D,J),await o.nextTick();try{D.setSelectionRange(fe,ae)}catch{}ue(J)}else{const fe=D.selectionStart??J.length,ae=D.selectionEnd??J.length;te(D,J),await o.nextTick();try{D.setSelectionRange(fe,ae)}catch{}}},z=()=>C.value=!0,G=()=>{C.value=!1;const T=X.value;if(!T)return;const D=T.value??"",Z=q(D);Z===D?ue(Z):te(T,Z)};o.onMounted(()=>{const T=X.value;if(!T)return;const D=T.value??"",Z=q(D);Z===D?ue(Z):te(T,Z)}),o.onBeforeUnmount(()=>{});const ee=()=>{A.value="",X.value&&(X.value.value=""),i("update:modelValue",null),i("clear")},K=o.computed(()=>A.value.length),Y=o.computed(()=>r.showCharCount?m.value>0:!1),F=o.computed(()=>Y.value&&K.value>0),_=o.computed(()=>`${K.value} / ${m.value}`),b=o.computed(()=>!!r.error),R=o.computed(()=>{const T=n.rows,D=typeof T=="number"?T:Number.parseInt(String(T??""),10);return Number.isFinite(D)&&D>0?D:3}),S=o.computed(()=>({height:`${R.value*24+16}px`}));return(T,D)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,r.disabled?"cursor-not-allowed":""]]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",RG)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:o.normalizeStyle(S.value)},null,4)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createElementBlock("label",{key:0,for:d.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(s.value)+" ",1),f.value?(o.openBlock(),o.createElementBlock("span",OG,"*")):o.createCommentVNode("",!0)],8,IG)):o.createCommentVNode("",!0),o.createElementVNode("div",LG,[o.createElementVNode("textarea",o.mergeProps({id:d.value,ref_key:"textareaRef",ref:X,value:A.value,placeholder:a.value},h.value,{onInput:se,onBeforeinput:ge,onPaste:ce,onCompositionstart:z,onCompositionend:G,style:`text-transform: ${P.value}; padding-right: ${y.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50 readonly:bg-neutral-50/50 dark:readonly:bg-neutral-900/30",b.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,FG),y.value?(o.openBlock(),o.createElementBlock("div",$G,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ee}," ✕ ")])):o.createCommentVNode("",!0),F.value&&!b.value?(o.openBlock(),o.createElementBlock("p",zG,o.toDisplayString(_.value),1)):o.createCommentVNode("",!0)]),b.value?(o.openBlock(),o.createElementBlock("p",jG,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,MG)),[[o.vShow,l.value]])}});var Ff={exports:{}};/* @preserve
130
130
  * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
131
131
  * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
132
- */var UG=Ff.exports,SS;function WG(){return SS||(SS=1,(function(e,t){(function(n,i){i(t)})(UG,(function(n){var i="1.9.4";function r(u){var p,w,U,Q;for(w=1,U=arguments.length;w<U;w++){Q=arguments[w];for(p in Q)u[p]=Q[p]}return u}var s=Object.create||(function(){function u(){}return function(p){return u.prototype=p,new u}})();function a(u,p){var w=Array.prototype.slice;if(u.bind)return u.bind.apply(u,w.call(arguments,1));var U=w.call(arguments,2);return function(){return u.apply(p,U.length?U.concat(w.call(arguments)):arguments)}}var l=0;function c(u){return"_leaflet_id"in u||(u._leaflet_id=++l),u._leaflet_id}function d(u,p,w){var U,Q,de,Pe;return Pe=function(){U=!1,Q&&(de.apply(w,Q),Q=!1)},de=function(){U?Q=arguments:(u.apply(w,arguments),setTimeout(Pe,p),U=!0)},de}function f(u,p,w){var U=p[1],Q=p[0],de=U-Q;return u===U&&w?u:((u-Q)%de+de)%de+Q}function h(){return!1}function m(u,p){if(p===!1)return u;var w=Math.pow(10,p===void 0?6:p);return Math.round(u*w)/w}function g(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function v(u){return g(u).split(/\s+/)}function y(u,p){Object.prototype.hasOwnProperty.call(u,"options")||(u.options=u.options?s(u.options):{});for(var w in p)u.options[w]=p[w];return u.options}function A(u,p,w){var U=[];for(var Q in u)U.push(encodeURIComponent(w?Q.toUpperCase():Q)+"="+encodeURIComponent(u[Q]));return(!p||p.indexOf("?")===-1?"?":"&")+U.join("&")}var C=/\{ *([\w_ -]+) *\}/g;function M(u,p){return u.replace(C,function(w,U){var Q=p[U];if(Q===void 0)throw new Error("No value provided for variable "+w);return typeof Q=="function"&&(Q=Q(p)),Q})}var B=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"};function N(u,p){for(var w=0;w<u.length;w++)if(u[w]===p)return w;return-1}var j="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function W(u){return window["webkit"+u]||window["moz"+u]||window["ms"+u]}var P=0;function E(u){var p=+new Date,w=Math.max(0,16-(p-P));return P=p+w,window.setTimeout(u,w)}var k=window.requestAnimationFrame||W("RequestAnimationFrame")||E,$=window.cancelAnimationFrame||W("CancelAnimationFrame")||W("CancelRequestAnimationFrame")||function(u){window.clearTimeout(u)};function I(u,p,w){if(w&&k===E)u.call(p);else return k.call(window,a(u,p))}function O(u){u&&$.call(window,u)}var q={__proto__:null,extend:r,create:s,bind:a,get lastId(){return l},stamp:c,throttle:d,wrapNum:f,falseFn:h,formatNum:m,trim:g,splitWords:v,setOptions:y,getParamString:A,template:M,isArray:B,indexOf:N,emptyImageUrl:j,requestFn:k,cancelFn:$,requestAnimFrame:I,cancelAnimFrame:O};function X(){}X.extend=function(u){var p=function(){y(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},w=p.__super__=this.prototype,U=s(w);U.constructor=p,p.prototype=U;for(var Q in this)Object.prototype.hasOwnProperty.call(this,Q)&&Q!=="prototype"&&Q!=="__super__"&&(p[Q]=this[Q]);return u.statics&&r(p,u.statics),u.includes&&(oe(u.includes),r.apply(null,[U].concat(u.includes))),r(U,u),delete U.statics,delete U.includes,U.options&&(U.options=w.options?s(w.options):{},r(U.options,u.options)),U._initHooks=[],U.callInitHooks=function(){if(!this._initHooksCalled){w.callInitHooks&&w.callInitHooks.call(this),this._initHooksCalled=!0;for(var de=0,Pe=U._initHooks.length;de<Pe;de++)U._initHooks[de].call(this)}},p},X.include=function(u){var p=this.prototype.options;return r(this.prototype,u),u.options&&(this.prototype.options=p,this.mergeOptions(u.options)),this},X.mergeOptions=function(u){return r(this.prototype.options,u),this},X.addInitHook=function(u){var p=Array.prototype.slice.call(arguments,1),w=typeof u=="function"?u:function(){this[u].apply(this,p)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(w),this};function oe(u){if(!(typeof L>"u"||!L||!L.Mixin)){u=B(u)?u:[u];for(var p=0;p<u.length;p++)u[p]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var ue={on:function(u,p,w){if(typeof u=="object")for(var U in u)this._on(U,u[U],p);else{u=v(u);for(var Q=0,de=u.length;Q<de;Q++)this._on(u[Q],p,w)}return this},off:function(u,p,w){if(!arguments.length)delete this._events;else if(typeof u=="object")for(var U in u)this._off(U,u[U],p);else{u=v(u);for(var Q=arguments.length===1,de=0,Pe=u.length;de<Pe;de++)Q?this._off(u[de]):this._off(u[de],p,w)}return this},_on:function(u,p,w,U){if(typeof p!="function"){console.warn("wrong listener type: "+typeof p);return}if(this._listens(u,p,w)===!1){w===this&&(w=void 0);var Q={fn:p,ctx:w};U&&(Q.once=!0),this._events=this._events||{},this._events[u]=this._events[u]||[],this._events[u].push(Q)}},_off:function(u,p,w){var U,Q,de;if(this._events&&(U=this._events[u],!!U)){if(arguments.length===1){if(this._firingCount)for(Q=0,de=U.length;Q<de;Q++)U[Q].fn=h;delete this._events[u];return}if(typeof p!="function"){console.warn("wrong listener type: "+typeof p);return}var Pe=this._listens(u,p,w);if(Pe!==!1){var Le=U[Pe];this._firingCount&&(Le.fn=h,this._events[u]=U=U.slice()),U.splice(Pe,1)}}},fire:function(u,p,w){if(!this.listens(u,w))return this;var U=r({},p,{type:u,target:this,sourceTarget:p&&p.sourceTarget||this});if(this._events){var Q=this._events[u];if(Q){this._firingCount=this._firingCount+1||1;for(var de=0,Pe=Q.length;de<Pe;de++){var Le=Q[de],je=Le.fn;Le.once&&this.off(u,je,Le.ctx),je.call(Le.ctx||this,U)}this._firingCount--}}return w&&this._propagateEvent(U),this},listens:function(u,p,w,U){typeof u!="string"&&console.warn('"string" type argument expected');var Q=p;typeof p!="function"&&(U=!!p,Q=void 0,w=void 0);var de=this._events&&this._events[u];if(de&&de.length&&this._listens(u,Q,w)!==!1)return!0;if(U){for(var Pe in this._eventParents)if(this._eventParents[Pe].listens(u,p,w,U))return!0}return!1},_listens:function(u,p,w){if(!this._events)return!1;var U=this._events[u]||[];if(!p)return!!U.length;w===this&&(w=void 0);for(var Q=0,de=U.length;Q<de;Q++)if(U[Q].fn===p&&U[Q].ctx===w)return Q;return!1},once:function(u,p,w){if(typeof u=="object")for(var U in u)this._on(U,u[U],p,!0);else{u=v(u);for(var Q=0,de=u.length;Q<de;Q++)this._on(u[Q],p,w,!0)}return this},addEventParent:function(u){return this._eventParents=this._eventParents||{},this._eventParents[c(u)]=u,this},removeEventParent:function(u){return this._eventParents&&delete this._eventParents[c(u)],this},_propagateEvent:function(u){for(var p in this._eventParents)this._eventParents[p].fire(u.type,r({layer:u.target,propagatedFrom:u.target},u),!0)}};ue.addEventListener=ue.on,ue.removeEventListener=ue.clearAllEventListeners=ue.off,ue.addOneTimeEventListener=ue.once,ue.fireEvent=ue.fire,ue.hasEventListeners=ue.listens;var te=X.extend(ue);function re(u,p,w){this.x=w?Math.round(u):u,this.y=w?Math.round(p):p}var ge=Math.trunc||function(u){return u>0?Math.floor(u):Math.ceil(u)};re.prototype={clone:function(){return new re(this.x,this.y)},add:function(u){return this.clone()._add(ce(u))},_add:function(u){return this.x+=u.x,this.y+=u.y,this},subtract:function(u){return this.clone()._subtract(ce(u))},_subtract:function(u){return this.x-=u.x,this.y-=u.y,this},divideBy:function(u){return this.clone()._divideBy(u)},_divideBy:function(u){return this.x/=u,this.y/=u,this},multiplyBy:function(u){return this.clone()._multiplyBy(u)},_multiplyBy:function(u){return this.x*=u,this.y*=u,this},scaleBy:function(u){return new re(this.x*u.x,this.y*u.y)},unscaleBy:function(u){return new re(this.x/u.x,this.y/u.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ge(this.x),this.y=ge(this.y),this},distanceTo:function(u){u=ce(u);var p=u.x-this.x,w=u.y-this.y;return Math.sqrt(p*p+w*w)},equals:function(u){return u=ce(u),u.x===this.x&&u.y===this.y},contains:function(u){return u=ce(u),Math.abs(u.x)<=Math.abs(this.x)&&Math.abs(u.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function ce(u,p,w){return u instanceof re?u:B(u)?new re(u[0],u[1]):u==null?u:typeof u=="object"&&"x"in u&&"y"in u?new re(u.x,u.y):new re(u,p,w)}function se(u,p){if(u)for(var w=p?[u,p]:u,U=0,Q=w.length;U<Q;U++)this.extend(w[U])}se.prototype={extend:function(u){var p,w;if(!u)return this;if(u instanceof re||typeof u[0]=="number"||"x"in u)p=w=ce(u);else if(u=z(u),p=u.min,w=u.max,!p||!w)return this;return!this.min&&!this.max?(this.min=p.clone(),this.max=w.clone()):(this.min.x=Math.min(p.x,this.min.x),this.max.x=Math.max(w.x,this.max.x),this.min.y=Math.min(p.y,this.min.y),this.max.y=Math.max(w.y,this.max.y)),this},getCenter:function(u){return ce((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,u)},getBottomLeft:function(){return ce(this.min.x,this.max.y)},getTopRight:function(){return ce(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(u){var p,w;return typeof u[0]=="number"||u instanceof re?u=ce(u):u=z(u),u instanceof se?(p=u.min,w=u.max):p=w=u,p.x>=this.min.x&&w.x<=this.max.x&&p.y>=this.min.y&&w.y<=this.max.y},intersects:function(u){u=z(u);var p=this.min,w=this.max,U=u.min,Q=u.max,de=Q.x>=p.x&&U.x<=w.x,Pe=Q.y>=p.y&&U.y<=w.y;return de&&Pe},overlaps:function(u){u=z(u);var p=this.min,w=this.max,U=u.min,Q=u.max,de=Q.x>p.x&&U.x<w.x,Pe=Q.y>p.y&&U.y<w.y;return de&&Pe},isValid:function(){return!!(this.min&&this.max)},pad:function(u){var p=this.min,w=this.max,U=Math.abs(p.x-w.x)*u,Q=Math.abs(p.y-w.y)*u;return z(ce(p.x-U,p.y-Q),ce(w.x+U,w.y+Q))},equals:function(u){return u?(u=z(u),this.min.equals(u.getTopLeft())&&this.max.equals(u.getBottomRight())):!1}};function z(u,p){return!u||u instanceof se?u:new se(u,p)}function G(u,p){if(u)for(var w=p?[u,p]:u,U=0,Q=w.length;U<Q;U++)this.extend(w[U])}G.prototype={extend:function(u){var p=this._southWest,w=this._northEast,U,Q;if(u instanceof K)U=u,Q=u;else if(u instanceof G){if(U=u._southWest,Q=u._northEast,!U||!Q)return this}else return u?this.extend(Y(u)||ee(u)):this;return!p&&!w?(this._southWest=new K(U.lat,U.lng),this._northEast=new K(Q.lat,Q.lng)):(p.lat=Math.min(U.lat,p.lat),p.lng=Math.min(U.lng,p.lng),w.lat=Math.max(Q.lat,w.lat),w.lng=Math.max(Q.lng,w.lng)),this},pad:function(u){var p=this._southWest,w=this._northEast,U=Math.abs(p.lat-w.lat)*u,Q=Math.abs(p.lng-w.lng)*u;return new G(new K(p.lat-U,p.lng-Q),new K(w.lat+U,w.lng+Q))},getCenter:function(){return new K((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new K(this.getNorth(),this.getWest())},getSouthEast:function(){return new K(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(u){typeof u[0]=="number"||u instanceof K||"lat"in u?u=Y(u):u=ee(u);var p=this._southWest,w=this._northEast,U,Q;return u instanceof G?(U=u.getSouthWest(),Q=u.getNorthEast()):U=Q=u,U.lat>=p.lat&&Q.lat<=w.lat&&U.lng>=p.lng&&Q.lng<=w.lng},intersects:function(u){u=ee(u);var p=this._southWest,w=this._northEast,U=u.getSouthWest(),Q=u.getNorthEast(),de=Q.lat>=p.lat&&U.lat<=w.lat,Pe=Q.lng>=p.lng&&U.lng<=w.lng;return de&&Pe},overlaps:function(u){u=ee(u);var p=this._southWest,w=this._northEast,U=u.getSouthWest(),Q=u.getNorthEast(),de=Q.lat>p.lat&&U.lat<w.lat,Pe=Q.lng>p.lng&&U.lng<w.lng;return de&&Pe},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(u,p){return u?(u=ee(u),this._southWest.equals(u.getSouthWest(),p)&&this._northEast.equals(u.getNorthEast(),p)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ee(u,p){return u instanceof G?u:new G(u,p)}function K(u,p,w){if(isNaN(u)||isNaN(p))throw new Error("Invalid LatLng object: ("+u+", "+p+")");this.lat=+u,this.lng=+p,w!==void 0&&(this.alt=+w)}K.prototype={equals:function(u,p){if(!u)return!1;u=Y(u);var w=Math.max(Math.abs(this.lat-u.lat),Math.abs(this.lng-u.lng));return w<=(p===void 0?1e-9:p)},toString:function(u){return"LatLng("+m(this.lat,u)+", "+m(this.lng,u)+")"},distanceTo:function(u){return _.distance(this,Y(u))},wrap:function(){return _.wrapLatLng(this)},toBounds:function(u){var p=180*u/40075017,w=p/Math.cos(Math.PI/180*this.lat);return ee([this.lat-p,this.lng-w],[this.lat+p,this.lng+w])},clone:function(){return new K(this.lat,this.lng,this.alt)}};function Y(u,p,w){return u instanceof K?u:B(u)&&typeof u[0]!="object"?u.length===3?new K(u[0],u[1],u[2]):u.length===2?new K(u[0],u[1]):null:u==null?u:typeof u=="object"&&"lat"in u?new K(u.lat,"lng"in u?u.lng:u.lon,u.alt):p===void 0?null:new K(u,p,w)}var F={latLngToPoint:function(u,p){var w=this.projection.project(u),U=this.scale(p);return this.transformation._transform(w,U)},pointToLatLng:function(u,p){var w=this.scale(p),U=this.transformation.untransform(u,w);return this.projection.unproject(U)},project:function(u){return this.projection.project(u)},unproject:function(u){return this.projection.unproject(u)},scale:function(u){return 256*Math.pow(2,u)},zoom:function(u){return Math.log(u/256)/Math.LN2},getProjectedBounds:function(u){if(this.infinite)return null;var p=this.projection.bounds,w=this.scale(u),U=this.transformation.transform(p.min,w),Q=this.transformation.transform(p.max,w);return new se(U,Q)},infinite:!1,wrapLatLng:function(u){var p=this.wrapLng?f(u.lng,this.wrapLng,!0):u.lng,w=this.wrapLat?f(u.lat,this.wrapLat,!0):u.lat,U=u.alt;return new K(w,p,U)},wrapLatLngBounds:function(u){var p=u.getCenter(),w=this.wrapLatLng(p),U=p.lat-w.lat,Q=p.lng-w.lng;if(U===0&&Q===0)return u;var de=u.getSouthWest(),Pe=u.getNorthEast(),Le=new K(de.lat-U,de.lng-Q),je=new K(Pe.lat-U,Pe.lng-Q);return new G(Le,je)}},_=r({},F,{wrapLng:[-180,180],R:6371e3,distance:function(u,p){var w=Math.PI/180,U=u.lat*w,Q=p.lat*w,de=Math.sin((p.lat-u.lat)*w/2),Pe=Math.sin((p.lng-u.lng)*w/2),Le=de*de+Math.cos(U)*Math.cos(Q)*Pe*Pe,je=2*Math.atan2(Math.sqrt(Le),Math.sqrt(1-Le));return this.R*je}}),b=6378137,R={R:b,MAX_LATITUDE:85.0511287798,project:function(u){var p=Math.PI/180,w=this.MAX_LATITUDE,U=Math.max(Math.min(w,u.lat),-w),Q=Math.sin(U*p);return new re(this.R*u.lng*p,this.R*Math.log((1+Q)/(1-Q))/2)},unproject:function(u){var p=180/Math.PI;return new K((2*Math.atan(Math.exp(u.y/this.R))-Math.PI/2)*p,u.x*p/this.R)},bounds:(function(){var u=b*Math.PI;return new se([-u,-u],[u,u])})()};function S(u,p,w,U){if(B(u)){this._a=u[0],this._b=u[1],this._c=u[2],this._d=u[3];return}this._a=u,this._b=p,this._c=w,this._d=U}S.prototype={transform:function(u,p){return this._transform(u.clone(),p)},_transform:function(u,p){return p=p||1,u.x=p*(this._a*u.x+this._b),u.y=p*(this._c*u.y+this._d),u},untransform:function(u,p){return p=p||1,new re((u.x/p-this._b)/this._a,(u.y/p-this._d)/this._c)}};function T(u,p,w,U){return new S(u,p,w,U)}var D=r({},_,{code:"EPSG:3857",projection:R,transformation:(function(){var u=.5/(Math.PI*R.R);return T(u,.5,-u,.5)})()}),Z=r({},D,{code:"EPSG:900913"});function J(u){return document.createElementNS("http://www.w3.org/2000/svg",u)}function fe(u,p){var w="",U,Q,de,Pe,Le,je;for(U=0,de=u.length;U<de;U++){for(Le=u[U],Q=0,Pe=Le.length;Q<Pe;Q++)je=Le[Q],w+=(Q?"L":"M")+je.x+" "+je.y;w+=p?pt.svg?"z":"x":""}return w||"M0 0"}var ae=document.documentElement.style,we="ActiveXObject"in window,pe=we&&!document.addEventListener,ke="msLaunchUri"in navigator&&!("documentMode"in document),be=ki("webkit"),Se=ki("android"),ve=ki("android 2")||ki("android 3"),Be=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ee=Se&&ki("Google")&&Be<537&&!("AudioNode"in window),Oe=!!window.opera,Ae=!ke&&ki("chrome"),Re=ki("gecko")&&!be&&!Oe&&!we,De=!Ae&&ki("safari"),Ie=ki("phantom"),Ce="OTransition"in ae,ne=navigator.platform.indexOf("Win")===0,ye=we&&"transition"in ae,Me="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ve,Ke="MozPerspective"in ae,$e=!window.L_DISABLE_3D&&(ye||Me||Ke)&&!Ce&&!Ie,He=typeof orientation<"u"||ki("mobile"),rt=He&&be,Ve=He&&Me,Fe=!window.PointerEvent&&window.MSPointerEvent,Ue=!!(window.PointerEvent||Fe),at="ontouchstart"in window||!!window.TouchEvent,nt=!window.L_NO_TOUCH&&(at||Ue),Tt=He&&Oe,fi=He&&Re,hn=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Jt=(function(){var u=!1;try{var p=Object.defineProperty({},"passive",{get:function(){u=!0}});window.addEventListener("testPassiveEventSupport",h,p),window.removeEventListener("testPassiveEventSupport",h,p)}catch{}return u})(),cn=(function(){return!!document.createElement("canvas").getContext})(),vn=!!(document.createElementNS&&J("svg").createSVGRect),gr=!!vn&&(function(){var u=document.createElement("div");return u.innerHTML="<svg/>",(u.firstChild&&u.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Do=!vn&&(function(){try{var u=document.createElement("div");u.innerHTML='<v:shape adj="1"/>';var p=u.firstChild;return p.style.behavior="url(#default#VML)",p&&typeof p.adj=="object"}catch{return!1}})(),Bi=navigator.platform.indexOf("Mac")===0,Ic=navigator.platform.indexOf("Linux")===0;function ki(u){return navigator.userAgent.toLowerCase().indexOf(u)>=0}var pt={ie:we,ielt9:pe,edge:ke,webkit:be,android:Se,android23:ve,androidStock:Ee,opera:Oe,chrome:Ae,gecko:Re,safari:De,phantom:Ie,opera12:Ce,win:ne,ie3d:ye,webkit3d:Me,gecko3d:Ke,any3d:$e,mobile:He,mobileWebkit:rt,mobileWebkit3d:Ve,msPointer:Fe,pointer:Ue,touch:nt,touchNative:at,mobileOpera:Tt,mobileGecko:fi,retina:hn,passiveEvents:Jt,canvas:cn,svg:vn,vml:Do,inlineSvg:gr,mac:Bi,linux:Ic},yr=pt.msPointer?"MSPointerDown":"pointerdown",Tu=pt.msPointer?"MSPointerMove":"pointermove",ai=pt.msPointer?"MSPointerUp":"pointerup",cl=pt.msPointer?"MSPointerCancel":"pointercancel",ym={touchstart:yr,touchmove:Tu,touchend:ai,touchcancel:cl},Mo={touchstart:Oc,touchmove:Nu,touchend:Nu,touchcancel:Nu},sa={},Pu=!1;function Bu(u,p,w){return p==="touchstart"&&B1(),Mo[p]?(w=Mo[p].bind(this,w),u.addEventListener(ym[p],w,!1),w):(console.warn("wrong event specified:",p),h)}function Fy(u,p,w){if(!ym[p]){console.warn("wrong event specified:",p);return}u.removeEventListener(ym[p],w,!1)}function T1(u){sa[u.pointerId]=u}function P1(u){sa[u.pointerId]&&(sa[u.pointerId]=u)}function $y(u){delete sa[u.pointerId]}function B1(){Pu||(document.addEventListener(yr,T1,!0),document.addEventListener(Tu,P1,!0),document.addEventListener(ai,$y,!0),document.addEventListener(cl,$y,!0),Pu=!0)}function Nu(u,p){if(p.pointerType!==(p.MSPOINTER_TYPE_MOUSE||"mouse")){p.touches=[];for(var w in sa)p.touches.push(sa[w]);p.changedTouches=[p],u(p)}}function Oc(u,p){p.MSPOINTER_TYPE_TOUCH&&p.pointerType===p.MSPOINTER_TYPE_TOUCH&&hi(p),Nu(u,p)}function On(u){var p={},w,U;for(U in u)w=u[U],p[U]=w&&w.bind?w.bind(u):w;return u=p,p.type="dblclick",p.detail=2,p.isTrusted=!1,p._simulated=!0,p}var Du=200;function N1(u,p){u.addEventListener("dblclick",p);var w=0,U;function Q(de){if(de.detail!==1){U=de.detail;return}if(!(de.pointerType==="mouse"||de.sourceCapabilities&&!de.sourceCapabilities.firesTouchEvents)){var Pe=km(de);if(!(Pe.some(function(je){return je instanceof HTMLLabelElement&&je.attributes.for})&&!Pe.some(function(je){return je instanceof HTMLInputElement||je instanceof HTMLSelectElement}))){var Le=Date.now();Le-w<=Du?(U++,U===2&&p(On(de))):U=1,w=Le}}}return u.addEventListener("click",Q),{dblclick:p,simDblclick:Q}}function D1(u,p){u.removeEventListener("dblclick",p.dblclick),u.removeEventListener("click",p.simDblclick)}var dl=$c(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),aa=$c(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),lo=aa==="webkitTransition"||aa==="OTransition"?aa+"End":"transitionend";function Lc(u){return typeof u=="string"?document.getElementById(u):u}function ul(u,p){var w=u.style[p]||u.currentStyle&&u.currentStyle[p];if((!w||w==="auto")&&document.defaultView){var U=document.defaultView.getComputedStyle(u,null);w=U?U[p]:null}return w==="auto"?null:w}function an(u,p,w){var U=document.createElement(u);return U.className=p||"",w&&w.appendChild(U),U}function Cn(u){var p=u.parentNode;p&&p.removeChild(u)}function Ni(u){for(;u.firstChild;)u.removeChild(u.firstChild)}function co(u){var p=u.parentNode;p&&p.lastChild!==u&&p.appendChild(u)}function Di(u){var p=u.parentNode;p&&p.firstChild!==u&&p.insertBefore(u,p.firstChild)}function Dn(u,p){if(u.classList!==void 0)return u.classList.contains(p);var w=Mu(u);return w.length>0&&new RegExp("(^|\\s)"+p+"(\\s|$)").test(w)}function Lt(u,p){if(u.classList!==void 0)for(var w=v(p),U=0,Q=w.length;U<Q;U++)u.classList.add(w[U]);else if(!Dn(u,p)){var de=Mu(u);Fc(u,(de?de+" ":"")+p)}}function Wn(u,p){u.classList!==void 0?u.classList.remove(p):Fc(u,g((" "+Mu(u)+" ").replace(" "+p+" "," ")))}function Fc(u,p){u.className.baseVal===void 0?u.className=p:u.className.baseVal=p}function Mu(u){return u.correspondingElement&&(u=u.correspondingElement),u.className.baseVal===void 0?u.className:u.className.baseVal}function br(u,p){"opacity"in u.style?u.style.opacity=p:"filter"in u.style&&zy(u,p)}function zy(u,p){var w=!1,U="DXImageTransform.Microsoft.Alpha";try{w=u.filters.item(U)}catch{if(p===1)return}p=Math.round(p*100),w?(w.Enabled=p!==100,w.Opacity=p):u.style.filter+=" progid:"+U+"(opacity="+p+")"}function $c(u){for(var p=document.documentElement.style,w=0;w<u.length;w++)if(u[w]in p)return u[w];return!1}function fs(u,p,w){var U=p||new re(0,0);u.style[dl]=(pt.ie3d?"translate("+U.x+"px,"+U.y+"px)":"translate3d("+U.x+"px,"+U.y+"px,0)")+(w?" scale("+w+")":"")}function Hn(u,p){u._leaflet_pos=p,pt.any3d?fs(u,p):(u.style.left=p.x+"px",u.style.top=p.y+"px")}function Ro(u){return u._leaflet_pos||new re(0,0)}var la,zc,bm;if("onselectstart"in document)la=function(){Dt(window,"selectstart",hi)},zc=function(){_n(window,"selectstart",hi)};else{var jc=$c(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);la=function(){if(jc){var u=document.documentElement.style;bm=u[jc],u[jc]="none"}},zc=function(){jc&&(document.documentElement.style[jc]=bm,bm=void 0)}}function vr(){Dt(window,"dragstart",hi)}function fl(){_n(window,"dragstart",hi)}var Ru,vm;function Qt(u){for(;u.tabIndex===-1;)u=u.parentNode;u.style&&(Iu(),Ru=u,vm=u.style.outlineStyle,u.style.outlineStyle="none",Dt(window,"keydown",Iu))}function Iu(){Ru&&(Ru.style.outlineStyle=vm,Ru=void 0,vm=void 0,_n(window,"keydown",Iu))}function Uc(u){do u=u.parentNode;while((!u.offsetWidth||!u.offsetHeight)&&u!==document.body);return u}function Ou(u){var p=u.getBoundingClientRect();return{x:p.width/u.offsetWidth||1,y:p.height/u.offsetHeight||1,boundingClientRect:p}}var M1={__proto__:null,TRANSFORM:dl,TRANSITION:aa,TRANSITION_END:lo,get:Lc,getStyle:ul,create:an,remove:Cn,empty:Ni,toFront:co,toBack:Di,hasClass:Dn,addClass:Lt,removeClass:Wn,setClass:Fc,getClass:Mu,setOpacity:br,testProp:$c,setTransform:fs,setPosition:Hn,getPosition:Ro,get disableTextSelection(){return la},get enableTextSelection(){return zc},disableImageDrag:vr,enableImageDrag:fl,preventOutline:Qt,restoreOutline:Iu,getSizedParentNode:Uc,getScale:Ou};function Dt(u,p,w,U){if(p&&typeof p=="object")for(var Q in p)_m(u,Q,p[Q],w);else{p=v(p);for(var de=0,Pe=p.length;de<Pe;de++)_m(u,p[de],w,U)}return this}var Ir="_leaflet_events";function _n(u,p,w,U){if(arguments.length===1)wm(u),delete u[Ir];else if(p&&typeof p=="object")for(var Q in p)Hc(u,Q,p[Q],w);else if(p=v(p),arguments.length===2)wm(u,function(Le){return N(p,Le)!==-1});else for(var de=0,Pe=p.length;de<Pe;de++)Hc(u,p[de],w,U);return this}function wm(u,p){for(var w in u[Ir]){var U=w.split(/\d/)[0];(!p||p(U))&&Hc(u,U,null,null,w)}}var Wc={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function _m(u,p,w,U){var Q=p+c(w)+(U?"_"+c(U):"");if(u[Ir]&&u[Ir][Q])return this;var de=function(Le){return w.call(U||u,Le||window.event)},Pe=de;!pt.touchNative&&pt.pointer&&p.indexOf("touch")===0?de=Bu(u,p,de):pt.touch&&p==="dblclick"?de=N1(u,de):"addEventListener"in u?p==="touchstart"||p==="touchmove"||p==="wheel"||p==="mousewheel"?u.addEventListener(Wc[p]||p,de,pt.passiveEvents?{passive:!1}:!1):p==="mouseenter"||p==="mouseleave"?(de=function(Le){Le=Le||window.event,Cm(u,Le)&&Pe(Le)},u.addEventListener(Wc[p],de,!1)):u.addEventListener(p,Pe,!1):u.attachEvent("on"+p,de),u[Ir]=u[Ir]||{},u[Ir][Q]=de}function Hc(u,p,w,U,Q){Q=Q||p+c(w)+(U?"_"+c(U):"");var de=u[Ir]&&u[Ir][Q];if(!de)return this;!pt.touchNative&&pt.pointer&&p.indexOf("touch")===0?Fy(u,p,de):pt.touch&&p==="dblclick"?D1(u,de):"removeEventListener"in u?u.removeEventListener(Wc[p]||p,de,!1):u.detachEvent("on"+p,de),u[Ir][Q]=null}function hs(u){return u.stopPropagation?u.stopPropagation():u.originalEvent?u.originalEvent._stopped=!0:u.cancelBubble=!0,this}function ei(u){return _m(u,"wheel",hs),this}function qc(u){return Dt(u,"mousedown touchstart dblclick contextmenu",hs),u._leaflet_disable_click=!0,this}function hi(u){return u.preventDefault?u.preventDefault():u.returnValue=!1,this}function ms(u){return hi(u),hs(u),this}function km(u){if(u.composedPath)return u.composedPath();for(var p=[],w=u.target;w;)p.push(w),w=w.parentNode;return p}function xm(u,p){if(!p)return new re(u.clientX,u.clientY);var w=Ou(p),U=w.boundingClientRect;return new re((u.clientX-U.left)/w.x-p.clientLeft,(u.clientY-U.top)/w.y-p.clientTop)}var Em=pt.linux&&pt.chrome?window.devicePixelRatio:pt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function jy(u){return pt.edge?u.wheelDeltaY/2:u.deltaY&&u.deltaMode===0?-u.deltaY/Em:u.deltaY&&u.deltaMode===1?-u.deltaY*20:u.deltaY&&u.deltaMode===2?-u.deltaY*60:u.deltaX||u.deltaZ?0:u.wheelDelta?(u.wheelDeltaY||u.wheelDelta)/2:u.detail&&Math.abs(u.detail)<32765?-u.detail*20:u.detail?u.detail/-32765*60:0}function Cm(u,p){var w=p.relatedTarget;if(!w)return!0;try{for(;w&&w!==u;)w=w.parentNode}catch{return!1}return w!==u}var R1={__proto__:null,on:Dt,off:_n,stopPropagation:hs,disableScrollPropagation:ei,disableClickPropagation:qc,preventDefault:hi,stop:ms,getPropagationPath:km,getMousePosition:xm,getWheelDelta:jy,isExternalTarget:Cm,addListener:Dt,removeListener:_n},Kc=te.extend({run:function(u,p,w,U){this.stop(),this._el=u,this._inProgress=!0,this._duration=w||.25,this._easeOutPower=1/Math.max(U||.5,.2),this._startPos=Ro(u),this._offset=p.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=I(this._animate,this),this._step()},_step:function(u){var p=+new Date-this._startTime,w=this._duration*1e3;p<w?this._runFrame(this._easeOut(p/w),u):(this._runFrame(1),this._complete())},_runFrame:function(u,p){var w=this._startPos.add(this._offset.multiplyBy(u));p&&w._round(),Hn(this._el,w),this.fire("step")},_complete:function(){O(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(u){return 1-Math.pow(1-u,this._easeOutPower)}}),Rt=te.extend({options:{crs:D,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(u,p){p=y(this,p),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(u),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),p.maxBounds&&this.setMaxBounds(p.maxBounds),p.zoom!==void 0&&(this._zoom=this._limitZoom(p.zoom)),p.center&&p.zoom!==void 0&&this.setView(Y(p.center),p.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=aa&&pt.any3d&&!pt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Dt(this._proxy,lo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(u,p,w){if(p=p===void 0?this._zoom:this._limitZoom(p),u=this._limitCenter(Y(u),p,this.options.maxBounds),w=w||{},this._stop(),this._loaded&&!w.reset&&w!==!0){w.animate!==void 0&&(w.zoom=r({animate:w.animate},w.zoom),w.pan=r({animate:w.animate,duration:w.duration},w.pan));var U=this._zoom!==p?this._tryAnimatedZoom&&this._tryAnimatedZoom(u,p,w.zoom):this._tryAnimatedPan(u,w.pan);if(U)return clearTimeout(this._sizeTimer),this}return this._resetView(u,p,w.pan&&w.pan.noMoveStart),this},setZoom:function(u,p){return this._loaded?this.setView(this.getCenter(),u,{zoom:p}):(this._zoom=u,this)},zoomIn:function(u,p){return u=u||(pt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+u,p)},zoomOut:function(u,p){return u=u||(pt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-u,p)},setZoomAround:function(u,p,w){var U=this.getZoomScale(p),Q=this.getSize().divideBy(2),de=u instanceof re?u:this.latLngToContainerPoint(u),Pe=de.subtract(Q).multiplyBy(1-1/U),Le=this.containerPointToLatLng(Q.add(Pe));return this.setView(Le,p,{zoom:w})},_getBoundsCenterZoom:function(u,p){p=p||{},u=u.getBounds?u.getBounds():ee(u);var w=ce(p.paddingTopLeft||p.padding||[0,0]),U=ce(p.paddingBottomRight||p.padding||[0,0]),Q=this.getBoundsZoom(u,!1,w.add(U));if(Q=typeof p.maxZoom=="number"?Math.min(p.maxZoom,Q):Q,Q===1/0)return{center:u.getCenter(),zoom:Q};var de=U.subtract(w).divideBy(2),Pe=this.project(u.getSouthWest(),Q),Le=this.project(u.getNorthEast(),Q),je=this.unproject(Pe.add(Le).divideBy(2).add(de),Q);return{center:je,zoom:Q}},fitBounds:function(u,p){if(u=ee(u),!u.isValid())throw new Error("Bounds are not valid.");var w=this._getBoundsCenterZoom(u,p);return this.setView(w.center,w.zoom,p)},fitWorld:function(u){return this.fitBounds([[-90,-180],[90,180]],u)},panTo:function(u,p){return this.setView(u,this._zoom,{pan:p})},panBy:function(u,p){if(u=ce(u).round(),p=p||{},!u.x&&!u.y)return this.fire("moveend");if(p.animate!==!0&&!this.getSize().contains(u))return this._resetView(this.unproject(this.project(this.getCenter()).add(u)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Kc,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),p.noMoveStart||this.fire("movestart"),p.animate!==!1){Lt(this._mapPane,"leaflet-pan-anim");var w=this._getMapPanePos().subtract(u).round();this._panAnim.run(this._mapPane,w,p.duration||.25,p.easeLinearity)}else this._rawPanBy(u),this.fire("move").fire("moveend");return this},flyTo:function(u,p,w){if(w=w||{},w.animate===!1||!pt.any3d)return this.setView(u,p,w);this._stop();var U=this.project(this.getCenter()),Q=this.project(u),de=this.getSize(),Pe=this._zoom;u=Y(u),p=p===void 0?Pe:p;var Le=Math.max(de.x,de.y),je=Le*this.getZoomScale(Pe,p),Ze=Q.distanceTo(U)||1,dt=1.42,At=dt*dt;function Yt(mi){var cb=mi?-1:1,sSe=mi?je:Le,aSe=je*je-Le*Le+cb*At*At*Ze*Ze,lSe=2*sSe*At*Ze,U1=aSe/lSe,qR=Math.sqrt(U1*U1+1)-U1,cSe=qR<1e-9?-18:Math.log(qR);return cSe}function tr(mi){return(Math.exp(mi)-Math.exp(-mi))/2}function xi(mi){return(Math.exp(mi)+Math.exp(-mi))/2}function ho(mi){return tr(mi)/xi(mi)}var _r=Yt(0);function ju(mi){return Le*(xi(_r)/xi(_r+dt*mi))}function nSe(mi){return Le*(xi(_r)*ho(_r+dt*mi)-tr(_r))/At}function iSe(mi){return 1-Math.pow(1-mi,1.5)}var rSe=Date.now(),WR=(Yt(1)-_r)/dt,oSe=w.duration?1e3*w.duration:1e3*WR*.8;function HR(){var mi=(Date.now()-rSe)/oSe,cb=iSe(mi)*WR;mi<=1?(this._flyToFrame=I(HR,this),this._move(this.unproject(U.add(Q.subtract(U).multiplyBy(nSe(cb)/Ze)),Pe),this.getScaleZoom(Le/ju(cb),Pe),{flyTo:!0})):this._move(u,p)._moveEnd(!0)}return this._moveStart(!0,w.noMoveStart),HR.call(this),this},flyToBounds:function(u,p){var w=this._getBoundsCenterZoom(u,p);return this.flyTo(w.center,w.zoom,p)},setMaxBounds:function(u){return u=ee(u),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),u.isValid()?(this.options.maxBounds=u,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(u){var p=this.options.minZoom;return this.options.minZoom=u,this._loaded&&p!==u&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(u):this},setMaxZoom:function(u){var p=this.options.maxZoom;return this.options.maxZoom=u,this._loaded&&p!==u&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(u):this},panInsideBounds:function(u,p){this._enforcingBounds=!0;var w=this.getCenter(),U=this._limitCenter(w,this._zoom,ee(u));return w.equals(U)||this.panTo(U,p),this._enforcingBounds=!1,this},panInside:function(u,p){p=p||{};var w=ce(p.paddingTopLeft||p.padding||[0,0]),U=ce(p.paddingBottomRight||p.padding||[0,0]),Q=this.project(this.getCenter()),de=this.project(u),Pe=this.getPixelBounds(),Le=z([Pe.min.add(w),Pe.max.subtract(U)]),je=Le.getSize();if(!Le.contains(de)){this._enforcingBounds=!0;var Ze=de.subtract(Le.getCenter()),dt=Le.extend(de).getSize().subtract(je);Q.x+=Ze.x<0?-dt.x:dt.x,Q.y+=Ze.y<0?-dt.y:dt.y,this.panTo(this.unproject(Q),p),this._enforcingBounds=!1}return this},invalidateSize:function(u){if(!this._loaded)return this;u=r({animate:!1,pan:!0},u===!0?{animate:!0}:u);var p=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var w=this.getSize(),U=p.divideBy(2).round(),Q=w.divideBy(2).round(),de=U.subtract(Q);return!de.x&&!de.y?this:(u.animate&&u.pan?this.panBy(de):(u.pan&&this._rawPanBy(de),this.fire("move"),u.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:p,newSize:w}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(u){if(u=this._locateOptions=r({timeout:1e4,watch:!1},u),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var p=a(this._handleGeolocationResponse,this),w=a(this._handleGeolocationError,this);return u.watch?this._locationWatchId=navigator.geolocation.watchPosition(p,w,u):navigator.geolocation.getCurrentPosition(p,w,u),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(u){if(this._container._leaflet_id){var p=u.code,w=u.message||(p===1?"permission denied":p===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:p,message:"Geolocation error: "+w+"."})}},_handleGeolocationResponse:function(u){if(this._container._leaflet_id){var p=u.coords.latitude,w=u.coords.longitude,U=new K(p,w),Q=U.toBounds(u.coords.accuracy*2),de=this._locateOptions;if(de.setView){var Pe=this.getBoundsZoom(Q);this.setView(U,de.maxZoom?Math.min(Pe,de.maxZoom):Pe)}var Le={latlng:U,bounds:Q,timestamp:u.timestamp};for(var je in u.coords)typeof u.coords[je]=="number"&&(Le[je]=u.coords[je]);this.fire("locationfound",Le)}},addHandler:function(u,p){if(!p)return this;var w=this[u]=new p(this);return this._handlers.push(w),this.options[u]&&w.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Cn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(O(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var u;for(u in this._layers)this._layers[u].remove();for(u in this._panes)Cn(this._panes[u]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(u,p){var w="leaflet-pane"+(u?" leaflet-"+u.replace("Pane","")+"-pane":""),U=an("div",w,p||this._mapPane);return u&&(this._panes[u]=U),U},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var u=this.getPixelBounds(),p=this.unproject(u.getBottomLeft()),w=this.unproject(u.getTopRight());return new G(p,w)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(u,p,w){u=ee(u),w=ce(w||[0,0]);var U=this.getZoom()||0,Q=this.getMinZoom(),de=this.getMaxZoom(),Pe=u.getNorthWest(),Le=u.getSouthEast(),je=this.getSize().subtract(w),Ze=z(this.project(Le,U),this.project(Pe,U)).getSize(),dt=pt.any3d?this.options.zoomSnap:1,At=je.x/Ze.x,Yt=je.y/Ze.y,tr=p?Math.max(At,Yt):Math.min(At,Yt);return U=this.getScaleZoom(tr,U),dt&&(U=Math.round(U/(dt/100))*(dt/100),U=p?Math.ceil(U/dt)*dt:Math.floor(U/dt)*dt),Math.max(Q,Math.min(de,U))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new re(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(u,p){var w=this._getTopLeftPoint(u,p);return new se(w,w.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(u){return this.options.crs.getProjectedBounds(u===void 0?this.getZoom():u)},getPane:function(u){return typeof u=="string"?this._panes[u]:u},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(u,p){var w=this.options.crs;return p=p===void 0?this._zoom:p,w.scale(u)/w.scale(p)},getScaleZoom:function(u,p){var w=this.options.crs;p=p===void 0?this._zoom:p;var U=w.zoom(u*w.scale(p));return isNaN(U)?1/0:U},project:function(u,p){return p=p===void 0?this._zoom:p,this.options.crs.latLngToPoint(Y(u),p)},unproject:function(u,p){return p=p===void 0?this._zoom:p,this.options.crs.pointToLatLng(ce(u),p)},layerPointToLatLng:function(u){var p=ce(u).add(this.getPixelOrigin());return this.unproject(p)},latLngToLayerPoint:function(u){var p=this.project(Y(u))._round();return p._subtract(this.getPixelOrigin())},wrapLatLng:function(u){return this.options.crs.wrapLatLng(Y(u))},wrapLatLngBounds:function(u){return this.options.crs.wrapLatLngBounds(ee(u))},distance:function(u,p){return this.options.crs.distance(Y(u),Y(p))},containerPointToLayerPoint:function(u){return ce(u).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(u){return ce(u).add(this._getMapPanePos())},containerPointToLatLng:function(u){var p=this.containerPointToLayerPoint(ce(u));return this.layerPointToLatLng(p)},latLngToContainerPoint:function(u){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Y(u)))},mouseEventToContainerPoint:function(u){return xm(u,this._container)},mouseEventToLayerPoint:function(u){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(u))},mouseEventToLatLng:function(u){return this.layerPointToLatLng(this.mouseEventToLayerPoint(u))},_initContainer:function(u){var p=this._container=Lc(u);if(p){if(p._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Dt(p,"scroll",this._onScroll,this),this._containerId=c(p)},_initLayout:function(){var u=this._container;this._fadeAnimated=this.options.fadeAnimation&&pt.any3d,Lt(u,"leaflet-container"+(pt.touch?" leaflet-touch":"")+(pt.retina?" leaflet-retina":"")+(pt.ielt9?" leaflet-oldie":"")+(pt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var p=ul(u,"position");p!=="absolute"&&p!=="relative"&&p!=="fixed"&&p!=="sticky"&&(u.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var u=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Hn(this._mapPane,new re(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Lt(u.markerPane,"leaflet-zoom-hide"),Lt(u.shadowPane,"leaflet-zoom-hide"))},_resetView:function(u,p,w){Hn(this._mapPane,new re(0,0));var U=!this._loaded;this._loaded=!0,p=this._limitZoom(p),this.fire("viewprereset");var Q=this._zoom!==p;this._moveStart(Q,w)._move(u,p)._moveEnd(Q),this.fire("viewreset"),U&&this.fire("load")},_moveStart:function(u,p){return u&&this.fire("zoomstart"),p||this.fire("movestart"),this},_move:function(u,p,w,U){p===void 0&&(p=this._zoom);var Q=this._zoom!==p;return this._zoom=p,this._lastCenter=u,this._pixelOrigin=this._getNewPixelOrigin(u),U?w&&w.pinch&&this.fire("zoom",w):((Q||w&&w.pinch)&&this.fire("zoom",w),this.fire("move",w)),this},_moveEnd:function(u){return u&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return O(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(u){Hn(this._mapPane,this._getMapPanePos().subtract(u))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(u){this._targets={},this._targets[c(this._container)]=this;var p=u?_n:Dt;p(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&p(window,"resize",this._onResize,this),pt.any3d&&this.options.transform3DLimit&&(u?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){O(this._resizeRequest),this._resizeRequest=I(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var u=this._getMapPanePos();Math.max(Math.abs(u.x),Math.abs(u.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(u,p){for(var w=[],U,Q=p==="mouseout"||p==="mouseover",de=u.target||u.srcElement,Pe=!1;de;){if(U=this._targets[c(de)],U&&(p==="click"||p==="preclick")&&this._draggableMoved(U)){Pe=!0;break}if(U&&U.listens(p,!0)&&(Q&&!Cm(de,u)||(w.push(U),Q))||de===this._container)break;de=de.parentNode}return!w.length&&!Pe&&!Q&&this.listens(p,!0)&&(w=[this]),w},_isClickDisabled:function(u){for(;u&&u!==this._container;){if(u._leaflet_disable_click)return!0;u=u.parentNode}},_handleDOMEvent:function(u){var p=u.target||u.srcElement;if(!(!this._loaded||p._leaflet_disable_events||u.type==="click"&&this._isClickDisabled(p))){var w=u.type;w==="mousedown"&&Qt(p),this._fireDOMEvent(u,w)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(u,p,w){if(u.type==="click"){var U=r({},u);U.type="preclick",this._fireDOMEvent(U,U.type,w)}var Q=this._findEventTargets(u,p);if(w){for(var de=[],Pe=0;Pe<w.length;Pe++)w[Pe].listens(p,!0)&&de.push(w[Pe]);Q=de.concat(Q)}if(Q.length){p==="contextmenu"&&hi(u);var Le=Q[0],je={originalEvent:u};if(u.type!=="keypress"&&u.type!=="keydown"&&u.type!=="keyup"){var Ze=Le.getLatLng&&(!Le._radius||Le._radius<=10);je.containerPoint=Ze?this.latLngToContainerPoint(Le.getLatLng()):this.mouseEventToContainerPoint(u),je.layerPoint=this.containerPointToLayerPoint(je.containerPoint),je.latlng=Ze?Le.getLatLng():this.layerPointToLatLng(je.layerPoint)}for(Pe=0;Pe<Q.length;Pe++)if(Q[Pe].fire(p,je,!0),je.originalEvent._stopped||Q[Pe].options.bubblingMouseEvents===!1&&N(this._mouseEvents,p)!==-1)return}},_draggableMoved:function(u){return u=u.dragging&&u.dragging.enabled()?u:this,u.dragging&&u.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var u=0,p=this._handlers.length;u<p;u++)this._handlers[u].disable()},whenReady:function(u,p){return this._loaded?u.call(p||this,{target:this}):this.on("load",u,p),this},_getMapPanePos:function(){return Ro(this._mapPane)||new re(0,0)},_moved:function(){var u=this._getMapPanePos();return u&&!u.equals([0,0])},_getTopLeftPoint:function(u,p){var w=u&&p!==void 0?this._getNewPixelOrigin(u,p):this.getPixelOrigin();return w.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(u,p){var w=this.getSize()._divideBy(2);return this.project(u,p)._subtract(w)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(u,p,w){var U=this._getNewPixelOrigin(w,p);return this.project(u,p)._subtract(U)},_latLngBoundsToNewLayerBounds:function(u,p,w){var U=this._getNewPixelOrigin(w,p);return z([this.project(u.getSouthWest(),p)._subtract(U),this.project(u.getNorthWest(),p)._subtract(U),this.project(u.getSouthEast(),p)._subtract(U),this.project(u.getNorthEast(),p)._subtract(U)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(u){return this.latLngToLayerPoint(u).subtract(this._getCenterLayerPoint())},_limitCenter:function(u,p,w){if(!w)return u;var U=this.project(u,p),Q=this.getSize().divideBy(2),de=new se(U.subtract(Q),U.add(Q)),Pe=this._getBoundsOffset(de,w,p);return Math.abs(Pe.x)<=1&&Math.abs(Pe.y)<=1?u:this.unproject(U.add(Pe),p)},_limitOffset:function(u,p){if(!p)return u;var w=this.getPixelBounds(),U=new se(w.min.add(u),w.max.add(u));return u.add(this._getBoundsOffset(U,p))},_getBoundsOffset:function(u,p,w){var U=z(this.project(p.getNorthEast(),w),this.project(p.getSouthWest(),w)),Q=U.min.subtract(u.min),de=U.max.subtract(u.max),Pe=this._rebound(Q.x,-de.x),Le=this._rebound(Q.y,-de.y);return new re(Pe,Le)},_rebound:function(u,p){return u+p>0?Math.round(u-p)/2:Math.max(0,Math.ceil(u))-Math.max(0,Math.floor(p))},_limitZoom:function(u){var p=this.getMinZoom(),w=this.getMaxZoom(),U=pt.any3d?this.options.zoomSnap:1;return U&&(u=Math.round(u/U)*U),Math.max(p,Math.min(w,u))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Wn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(u,p){var w=this._getCenterOffset(u)._trunc();return(p&&p.animate)!==!0&&!this.getSize().contains(w)?!1:(this.panBy(w,p),!0)},_createAnimProxy:function(){var u=this._proxy=an("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(u),this.on("zoomanim",function(p){var w=dl,U=this._proxy.style[w];fs(this._proxy,this.project(p.center,p.zoom),this.getZoomScale(p.zoom,1)),U===this._proxy.style[w]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Cn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var u=this.getCenter(),p=this.getZoom();fs(this._proxy,this.project(u,p),this.getZoomScale(p,1))},_catchTransitionEnd:function(u){this._animatingZoom&&u.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(u,p,w){if(this._animatingZoom)return!0;if(w=w||{},!this._zoomAnimated||w.animate===!1||this._nothingToAnimate()||Math.abs(p-this._zoom)>this.options.zoomAnimationThreshold)return!1;var U=this.getZoomScale(p),Q=this._getCenterOffset(u)._divideBy(1-1/U);return w.animate!==!0&&!this.getSize().contains(Q)?!1:(I(function(){this._moveStart(!0,w.noMoveStart||!1)._animateZoom(u,p,!0)},this),!0)},_animateZoom:function(u,p,w,U){this._mapPane&&(w&&(this._animatingZoom=!0,this._animateToCenter=u,this._animateToZoom=p,Lt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:u,zoom:p,noUpdate:U}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Wn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function I1(u,p){return new Rt(u,p)}var Or=X.extend({options:{position:"topright"},initialize:function(u){y(this,u)},getPosition:function(){return this.options.position},setPosition:function(u){var p=this._map;return p&&p.removeControl(this),this.options.position=u,p&&p.addControl(this),this},getContainer:function(){return this._container},addTo:function(u){this.remove(),this._map=u;var p=this._container=this.onAdd(u),w=this.getPosition(),U=u._controlCorners[w];return Lt(p,"leaflet-control"),w.indexOf("bottom")!==-1?U.insertBefore(p,U.firstChild):U.appendChild(p),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Cn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(u){this._map&&u&&u.screenX>0&&u.screenY>0&&this._map.getContainer().focus()}}),hl=function(u){return new Or(u)};Rt.include({addControl:function(u){return u.addTo(this),this},removeControl:function(u){return u.remove(),this},_initControlPos:function(){var u=this._controlCorners={},p="leaflet-",w=this._controlContainer=an("div",p+"control-container",this._container);function U(Q,de){var Pe=p+Q+" "+p+de;u[Q+de]=an("div",Pe,w)}U("top","left"),U("top","right"),U("bottom","left"),U("bottom","right")},_clearControlPos:function(){for(var u in this._controlCorners)Cn(this._controlCorners[u]);Cn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Uy=Or.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(u,p,w,U){return w<U?-1:U<w?1:0}},initialize:function(u,p,w){y(this,w),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var U in u)this._addLayer(u[U],U);for(U in p)this._addLayer(p[U],U,!0)},onAdd:function(u){this._initLayout(),this._update(),this._map=u,u.on("zoomend",this._checkDisabledLayers,this);for(var p=0;p<this._layers.length;p++)this._layers[p].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(u){return Or.prototype.addTo.call(this,u),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(u,p){return this._addLayer(u,p),this._map?this._update():this},addOverlay:function(u,p){return this._addLayer(u,p,!0),this._map?this._update():this},removeLayer:function(u){u.off("add remove",this._onLayerChange,this);var p=this._getLayer(c(u));return p&&this._layers.splice(this._layers.indexOf(p),1),this._map?this._update():this},expand:function(){Lt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var u=this._map.getSize().y-(this._container.offsetTop+50);return u<this._section.clientHeight?(Lt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=u+"px"):Wn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Wn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var u="leaflet-control-layers",p=this._container=an("div",u),w=this.options.collapsed;p.setAttribute("aria-haspopup",!0),qc(p),ei(p);var U=this._section=an("section",u+"-list");w&&(this._map.on("click",this.collapse,this),Dt(p,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var Q=this._layersLink=an("a",u+"-toggle",p);Q.href="#",Q.title="Layers",Q.setAttribute("role","button"),Dt(Q,{keydown:function(de){de.keyCode===13&&this._expandSafely()},click:function(de){hi(de),this._expandSafely()}},this),w||this.expand(),this._baseLayersList=an("div",u+"-base",U),this._separator=an("div",u+"-separator",U),this._overlaysList=an("div",u+"-overlays",U),p.appendChild(U)},_getLayer:function(u){for(var p=0;p<this._layers.length;p++)if(this._layers[p]&&c(this._layers[p].layer)===u)return this._layers[p]},_addLayer:function(u,p,w){this._map&&u.on("add remove",this._onLayerChange,this),this._layers.push({layer:u,name:p,overlay:w}),this.options.sortLayers&&this._layers.sort(a(function(U,Q){return this.options.sortFunction(U.layer,Q.layer,U.name,Q.name)},this)),this.options.autoZIndex&&u.setZIndex&&(this._lastZIndex++,u.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Ni(this._baseLayersList),Ni(this._overlaysList),this._layerControlInputs=[];var u,p,w,U,Q=0;for(w=0;w<this._layers.length;w++)U=this._layers[w],this._addItem(U),p=p||U.overlay,u=u||!U.overlay,Q+=U.overlay?0:1;return this.options.hideSingleBase&&(u=u&&Q>1,this._baseLayersList.style.display=u?"":"none"),this._separator.style.display=p&&u?"":"none",this},_onLayerChange:function(u){this._handlingClick||this._update();var p=this._getLayer(c(u.target)),w=p.overlay?u.type==="add"?"overlayadd":"overlayremove":u.type==="add"?"baselayerchange":null;w&&this._map.fire(w,p)},_createRadioElement:function(u,p){var w='<input type="radio" class="leaflet-control-layers-selector" name="'+u+'"'+(p?' checked="checked"':"")+"/>",U=document.createElement("div");return U.innerHTML=w,U.firstChild},_addItem:function(u){var p=document.createElement("label"),w=this._map.hasLayer(u.layer),U;u.overlay?(U=document.createElement("input"),U.type="checkbox",U.className="leaflet-control-layers-selector",U.defaultChecked=w):U=this._createRadioElement("leaflet-base-layers_"+c(this),w),this._layerControlInputs.push(U),U.layerId=c(u.layer),Dt(U,"click",this._onInputClick,this);var Q=document.createElement("span");Q.innerHTML=" "+u.name;var de=document.createElement("span");p.appendChild(de),de.appendChild(U),de.appendChild(Q);var Pe=u.overlay?this._overlaysList:this._baseLayersList;return Pe.appendChild(p),this._checkDisabledLayers(),p},_onInputClick:function(){if(!this._preventClick){var u=this._layerControlInputs,p,w,U=[],Q=[];this._handlingClick=!0;for(var de=u.length-1;de>=0;de--)p=u[de],w=this._getLayer(p.layerId).layer,p.checked?U.push(w):p.checked||Q.push(w);for(de=0;de<Q.length;de++)this._map.hasLayer(Q[de])&&this._map.removeLayer(Q[de]);for(de=0;de<U.length;de++)this._map.hasLayer(U[de])||this._map.addLayer(U[de]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var u=this._layerControlInputs,p,w,U=this._map.getZoom(),Q=u.length-1;Q>=0;Q--)p=u[Q],w=this._getLayer(p.layerId).layer,p.disabled=w.options.minZoom!==void 0&&U<w.options.minZoom||w.options.maxZoom!==void 0&&U>w.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var u=this._section;this._preventClick=!0,Dt(u,"click",hi),this.expand();var p=this;setTimeout(function(){_n(u,"click",hi),p._preventClick=!1})}}),Wy=function(u,p,w){return new Uy(u,p,w)},Sm=Or.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(u){var p="leaflet-control-zoom",w=an("div",p+" leaflet-bar"),U=this.options;return this._zoomInButton=this._createButton(U.zoomInText,U.zoomInTitle,p+"-in",w,this._zoomIn),this._zoomOutButton=this._createButton(U.zoomOutText,U.zoomOutTitle,p+"-out",w,this._zoomOut),this._updateDisabled(),u.on("zoomend zoomlevelschange",this._updateDisabled,this),w},onRemove:function(u){u.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(u){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(u.shiftKey?3:1))},_zoomOut:function(u){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(u.shiftKey?3:1))},_createButton:function(u,p,w,U,Q){var de=an("a",w,U);return de.innerHTML=u,de.href="#",de.title=p,de.setAttribute("role","button"),de.setAttribute("aria-label",p),qc(de),Dt(de,"click",ms),Dt(de,"click",Q,this),Dt(de,"click",this._refocusOnMap,this),de},_updateDisabled:function(){var u=this._map,p="leaflet-disabled";Wn(this._zoomInButton,p),Wn(this._zoomOutButton,p),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||u._zoom===u.getMinZoom())&&(Lt(this._zoomOutButton,p),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||u._zoom===u.getMaxZoom())&&(Lt(this._zoomInButton,p),this._zoomInButton.setAttribute("aria-disabled","true"))}});Rt.mergeOptions({zoomControl:!0}),Rt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Sm,this.addControl(this.zoomControl))});var ml=function(u){return new Sm(u)},Hy=Or.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(u){var p="leaflet-control-scale",w=an("div",p),U=this.options;return this._addScales(U,p+"-line",w),u.on(U.updateWhenIdle?"moveend":"move",this._update,this),u.whenReady(this._update,this),w},onRemove:function(u){u.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(u,p,w){u.metric&&(this._mScale=an("div",p,w)),u.imperial&&(this._iScale=an("div",p,w))},_update:function(){var u=this._map,p=u.getSize().y/2,w=u.distance(u.containerPointToLatLng([0,p]),u.containerPointToLatLng([this.options.maxWidth,p]));this._updateScales(w)},_updateScales:function(u){this.options.metric&&u&&this._updateMetric(u),this.options.imperial&&u&&this._updateImperial(u)},_updateMetric:function(u){var p=this._getRoundNum(u),w=p<1e3?p+" m":p/1e3+" km";this._updateScale(this._mScale,w,p/u)},_updateImperial:function(u){var p=u*3.2808399,w,U,Q;p>5280?(w=p/5280,U=this._getRoundNum(w),this._updateScale(this._iScale,U+" mi",U/w)):(Q=this._getRoundNum(p),this._updateScale(this._iScale,Q+" ft",Q/p))},_updateScale:function(u,p,w){u.style.width=Math.round(this.options.maxWidth*w)+"px",u.innerHTML=p},_getRoundNum:function(u){var p=Math.pow(10,(Math.floor(u)+"").length-1),w=u/p;return w=w>=10?10:w>=5?5:w>=3?3:w>=2?2:1,p*w}}),Lu=function(u){return new Hy(u)},qy='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Am=Or.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(pt.inlineSvg?qy+" ":"")+"Leaflet</a>"},initialize:function(u){y(this,u),this._attributions={}},onAdd:function(u){u.attributionControl=this,this._container=an("div","leaflet-control-attribution"),qc(this._container);for(var p in u._layers)u._layers[p].getAttribution&&this.addAttribution(u._layers[p].getAttribution());return this._update(),u.on("layeradd",this._addAttribution,this),this._container},onRemove:function(u){u.off("layeradd",this._addAttribution,this)},_addAttribution:function(u){u.layer.getAttribution&&(this.addAttribution(u.layer.getAttribution()),u.layer.once("remove",function(){this.removeAttribution(u.layer.getAttribution())},this))},setPrefix:function(u){return this.options.prefix=u,this._update(),this},addAttribution:function(u){return u?(this._attributions[u]||(this._attributions[u]=0),this._attributions[u]++,this._update(),this):this},removeAttribution:function(u){return u?(this._attributions[u]&&(this._attributions[u]--,this._update()),this):this},_update:function(){if(this._map){var u=[];for(var p in this._attributions)this._attributions[p]&&u.push(p);var w=[];this.options.prefix&&w.push(this.options.prefix),u.length&&w.push(u.join(", ")),this._container.innerHTML=w.join(' <span aria-hidden="true">|</span> ')}}});Rt.mergeOptions({attributionControl:!0}),Rt.addInitHook(function(){this.options.attributionControl&&new Am().addTo(this)});var O1=function(u){return new Am(u)};Or.Layers=Uy,Or.Zoom=Sm,Or.Scale=Hy,Or.Attribution=Am,hl.layers=Wy,hl.zoom=ml,hl.scale=Lu,hl.attribution=O1;var uo=X.extend({initialize:function(u){this._map=u},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});uo.addTo=function(u,p){return u.addHandler(p,this),this};var L1={Events:ue},pl=pt.touch?"touchstart mousedown":"mousedown",ps=te.extend({options:{clickTolerance:3},initialize:function(u,p,w,U){y(this,U),this._element=u,this._dragStartTarget=p||u,this._preventOutline=w},enable:function(){this._enabled||(Dt(this._dragStartTarget,pl,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ps._dragging===this&&this.finishDrag(!0),_n(this._dragStartTarget,pl,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(u){if(this._enabled&&(this._moved=!1,!Dn(this._element,"leaflet-zoom-anim"))){if(u.touches&&u.touches.length!==1){ps._dragging===this&&this.finishDrag();return}if(!(ps._dragging||u.shiftKey||u.which!==1&&u.button!==1&&!u.touches)&&(ps._dragging=this,this._preventOutline&&Qt(this._element),vr(),la(),!this._moving)){this.fire("down");var p=u.touches?u.touches[0]:u,w=Uc(this._element);this._startPoint=new re(p.clientX,p.clientY),this._startPos=Ro(this._element),this._parentScale=Ou(w);var U=u.type==="mousedown";Dt(document,U?"mousemove":"touchmove",this._onMove,this),Dt(document,U?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(u){if(this._enabled){if(u.touches&&u.touches.length>1){this._moved=!0;return}var p=u.touches&&u.touches.length===1?u.touches[0]:u,w=new re(p.clientX,p.clientY)._subtract(this._startPoint);!w.x&&!w.y||Math.abs(w.x)+Math.abs(w.y)<this.options.clickTolerance||(w.x/=this._parentScale.x,w.y/=this._parentScale.y,hi(u),this._moved||(this.fire("dragstart"),this._moved=!0,Lt(document.body,"leaflet-dragging"),this._lastTarget=u.target||u.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Lt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(w),this._moving=!0,this._lastEvent=u,this._updatePosition())}},_updatePosition:function(){var u={originalEvent:this._lastEvent};this.fire("predrag",u),Hn(this._element,this._newPos),this.fire("drag",u)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(u){Wn(document.body,"leaflet-dragging"),this._lastTarget&&(Wn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),_n(document,"mousemove touchmove",this._onMove,this),_n(document,"mouseup touchend touchcancel",this._onUp,this),fl(),zc();var p=this._moved&&this._moving;this._moving=!1,ps._dragging=!1,p&&this.fire("dragend",{noInertia:u,distance:this._newPos.distanceTo(this._startPos)})}});function Ky(u,p,w){var U,Q=[1,4,2,8],de,Pe,Le,je,Ze,dt,At,Yt;for(de=0,dt=u.length;de<dt;de++)u[de]._code=ca(u[de],p);for(Le=0;Le<4;Le++){for(At=Q[Le],U=[],de=0,dt=u.length,Pe=dt-1;de<dt;Pe=de++)je=u[de],Ze=u[Pe],je._code&At?Ze._code&At||(Yt=gl(Ze,je,At,p,w),Yt._code=ca(Yt,p),U.push(Yt)):(Ze._code&At&&(Yt=gl(Ze,je,At,p,w),Yt._code=ca(Yt,p),U.push(Yt)),U.push(je));u=U}return u}function Gy(u,p){var w,U,Q,de,Pe,Le,je,Ze,dt;if(!u||u.length===0)throw new Error("latlngs not passed");er(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var At=Y([0,0]),Yt=ee(u),tr=Yt.getNorthWest().distanceTo(Yt.getSouthWest())*Yt.getNorthEast().distanceTo(Yt.getNorthWest());tr<1700&&(At=Tm(u));var xi=u.length,ho=[];for(w=0;w<xi;w++){var _r=Y(u[w]);ho.push(p.project(Y([_r.lat-At.lat,_r.lng-At.lng])))}for(Le=je=Ze=0,w=0,U=xi-1;w<xi;U=w++)Q=ho[w],de=ho[U],Pe=Q.y*de.x-de.y*Q.x,je+=(Q.x+de.x)*Pe,Ze+=(Q.y+de.y)*Pe,Le+=Pe*3;Le===0?dt=ho[0]:dt=[je/Le,Ze/Le];var ju=p.unproject(ce(dt));return Y([ju.lat+At.lat,ju.lng+At.lng])}function Tm(u){for(var p=0,w=0,U=0,Q=0;Q<u.length;Q++){var de=Y(u[Q]);p+=de.lat,w+=de.lng,U++}return Y([p/U,w/U])}var F1={__proto__:null,clipPolygon:Ky,polygonCenter:Gy,centroid:Tm};function Pm(u,p){if(!p||!u.length)return u.slice();var w=p*p;return u=Zy(u,w),u=$1(u,w),u}function Bm(u,p,w){return Math.sqrt(Gc(u,p,w,!0))}function Yy(u,p,w){return Gc(u,p,w)}function $1(u,p){var w=u.length,U=typeof Uint8Array<"u"?Uint8Array:Array,Q=new U(w);Q[0]=Q[w-1]=1,Nm(u,Q,p,0,w-1);var de,Pe=[];for(de=0;de<w;de++)Q[de]&&Pe.push(u[de]);return Pe}function Nm(u,p,w,U,Q){var de=0,Pe,Le,je;for(Le=U+1;Le<=Q-1;Le++)je=Gc(u[Le],u[U],u[Q],!0),je>de&&(Pe=Le,de=je);de>w&&(p[Pe]=1,Nm(u,p,w,U,Pe),Nm(u,p,w,Pe,Q))}function Zy(u,p){for(var w=[u[0]],U=1,Q=0,de=u.length;U<de;U++)z1(u[U],u[Q])>p&&(w.push(u[U]),Q=U);return Q<de-1&&w.push(u[de-1]),w}var Xy;function Jy(u,p,w,U,Q){var de=U?Xy:ca(u,w),Pe=ca(p,w),Le,je,Ze;for(Xy=Pe;;){if(!(de|Pe))return[u,p];if(de&Pe)return!1;Le=de||Pe,je=gl(u,p,Le,w,Q),Ze=ca(je,w),Le===de?(u=je,de=Ze):(p=je,Pe=Ze)}}function gl(u,p,w,U,Q){var de=p.x-u.x,Pe=p.y-u.y,Le=U.min,je=U.max,Ze,dt;return w&8?(Ze=u.x+de*(je.y-u.y)/Pe,dt=je.y):w&4?(Ze=u.x+de*(Le.y-u.y)/Pe,dt=Le.y):w&2?(Ze=je.x,dt=u.y+Pe*(je.x-u.x)/de):w&1&&(Ze=Le.x,dt=u.y+Pe*(Le.x-u.x)/de),new re(Ze,dt,Q)}function ca(u,p){var w=0;return u.x<p.min.x?w|=1:u.x>p.max.x&&(w|=2),u.y<p.min.y?w|=4:u.y>p.max.y&&(w|=8),w}function z1(u,p){var w=p.x-u.x,U=p.y-u.y;return w*w+U*U}function Gc(u,p,w,U){var Q=p.x,de=p.y,Pe=w.x-Q,Le=w.y-de,je=Pe*Pe+Le*Le,Ze;return je>0&&(Ze=((u.x-Q)*Pe+(u.y-de)*Le)/je,Ze>1?(Q=w.x,de=w.y):Ze>0&&(Q+=Pe*Ze,de+=Le*Ze)),Pe=u.x-Q,Le=u.y-de,U?Pe*Pe+Le*Le:new re(Q,de)}function er(u){return!B(u[0])||typeof u[0][0]!="object"&&typeof u[0][0]<"u"}function Qy(u){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),er(u)}function Vy(u,p){var w,U,Q,de,Pe,Le,je,Ze;if(!u||u.length===0)throw new Error("latlngs not passed");er(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var dt=Y([0,0]),At=ee(u),Yt=At.getNorthWest().distanceTo(At.getSouthWest())*At.getNorthEast().distanceTo(At.getNorthWest());Yt<1700&&(dt=Tm(u));var tr=u.length,xi=[];for(w=0;w<tr;w++){var ho=Y(u[w]);xi.push(p.project(Y([ho.lat-dt.lat,ho.lng-dt.lng])))}for(w=0,U=0;w<tr-1;w++)U+=xi[w].distanceTo(xi[w+1])/2;if(U===0)Ze=xi[0];else for(w=0,de=0;w<tr-1;w++)if(Pe=xi[w],Le=xi[w+1],Q=Pe.distanceTo(Le),de+=Q,de>U){je=(de-U)/Q,Ze=[Le.x-je*(Le.x-Pe.x),Le.y-je*(Le.y-Pe.y)];break}var _r=p.unproject(ce(Ze));return Y([_r.lat+dt.lat,_r.lng+dt.lng])}var da={__proto__:null,simplify:Pm,pointToSegmentDistance:Bm,closestPointOnSegment:Yy,clipSegment:Jy,_getEdgeIntersection:gl,_getBitCode:ca,_sqClosestPointOnSegment:Gc,isFlat:er,_flat:Qy,polylineCenter:Vy},Fu={project:function(u){return new re(u.lng,u.lat)},unproject:function(u){return new K(u.y,u.x)},bounds:new se([-180,-90],[180,90])},$u={R:6378137,R_MINOR:6356752314245179e-9,bounds:new se([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(u){var p=Math.PI/180,w=this.R,U=u.lat*p,Q=this.R_MINOR/w,de=Math.sqrt(1-Q*Q),Pe=de*Math.sin(U),Le=Math.tan(Math.PI/4-U/2)/Math.pow((1-Pe)/(1+Pe),de/2);return U=-w*Math.log(Math.max(Le,1e-10)),new re(u.lng*p*w,U)},unproject:function(u){for(var p=180/Math.PI,w=this.R,U=this.R_MINOR/w,Q=Math.sqrt(1-U*U),de=Math.exp(-u.y/w),Pe=Math.PI/2-2*Math.atan(de),Le=0,je=.1,Ze;Le<15&&Math.abs(je)>1e-7;Le++)Ze=Q*Math.sin(Pe),Ze=Math.pow((1-Ze)/(1+Ze),Q/2),je=Math.PI/2-2*Math.atan(de*Ze)-Pe,Pe+=je;return new K(Pe*p,u.x*p/w)}},eb={__proto__:null,LonLat:Fu,Mercator:$u,SphericalMercator:R},tb=r({},_,{code:"EPSG:3395",projection:$u,transformation:(function(){var u=.5/(Math.PI*$u.R);return T(u,.5,-u,.5)})()}),Dm=r({},_,{code:"EPSG:4326",projection:Fu,transformation:T(1/180,1,-1/180,.5)}),nb=r({},F,{projection:Fu,transformation:T(1,0,-1,0),scale:function(u){return Math.pow(2,u)},zoom:function(u){return Math.log(u)/Math.LN2},distance:function(u,p){var w=p.lng-u.lng,U=p.lat-u.lat;return Math.sqrt(w*w+U*U)},infinite:!0});F.Earth=_,F.EPSG3395=tb,F.EPSG3857=D,F.EPSG900913=Z,F.EPSG4326=Dm,F.Simple=nb;var wr=te.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(u){return u.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(u){return u&&u.removeLayer(this),this},getPane:function(u){return this._map.getPane(u?this.options[u]||u:this.options.pane)},addInteractiveTarget:function(u){return this._map._targets[c(u)]=this,this},removeInteractiveTarget:function(u){return delete this._map._targets[c(u)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(u){var p=u.target;if(p.hasLayer(this)){if(this._map=p,this._zoomAnimated=p._zoomAnimated,this.getEvents){var w=this.getEvents();p.on(w,this),this.once("remove",function(){p.off(w,this)},this)}this.onAdd(p),this.fire("add"),p.fire("layeradd",{layer:this})}}});Rt.include({addLayer:function(u){if(!u._layerAdd)throw new Error("The provided object is not a Layer.");var p=c(u);return this._layers[p]?this:(this._layers[p]=u,u._mapToAdd=this,u.beforeAdd&&u.beforeAdd(this),this.whenReady(u._layerAdd,u),this)},removeLayer:function(u){var p=c(u);return this._layers[p]?(this._loaded&&u.onRemove(this),delete this._layers[p],this._loaded&&(this.fire("layerremove",{layer:u}),u.fire("remove")),u._map=u._mapToAdd=null,this):this},hasLayer:function(u){return c(u)in this._layers},eachLayer:function(u,p){for(var w in this._layers)u.call(p,this._layers[w]);return this},_addLayers:function(u){u=u?B(u)?u:[u]:[];for(var p=0,w=u.length;p<w;p++)this.addLayer(u[p])},_addZoomLimit:function(u){(!isNaN(u.options.maxZoom)||!isNaN(u.options.minZoom))&&(this._zoomBoundLayers[c(u)]=u,this._updateZoomLevels())},_removeZoomLimit:function(u){var p=c(u);this._zoomBoundLayers[p]&&(delete this._zoomBoundLayers[p],this._updateZoomLevels())},_updateZoomLevels:function(){var u=1/0,p=-1/0,w=this._getZoomSpan();for(var U in this._zoomBoundLayers){var Q=this._zoomBoundLayers[U].options;u=Q.minZoom===void 0?u:Math.min(u,Q.minZoom),p=Q.maxZoom===void 0?p:Math.max(p,Q.maxZoom)}this._layersMaxZoom=p===-1/0?void 0:p,this._layersMinZoom=u===1/0?void 0:u,w!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var ua=wr.extend({initialize:function(u,p){y(this,p),this._layers={};var w,U;if(u)for(w=0,U=u.length;w<U;w++)this.addLayer(u[w])},addLayer:function(u){var p=this.getLayerId(u);return this._layers[p]=u,this._map&&this._map.addLayer(u),this},removeLayer:function(u){var p=u in this._layers?u:this.getLayerId(u);return this._map&&this._layers[p]&&this._map.removeLayer(this._layers[p]),delete this._layers[p],this},hasLayer:function(u){var p=typeof u=="number"?u:this.getLayerId(u);return p in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(u){var p=Array.prototype.slice.call(arguments,1),w,U;for(w in this._layers)U=this._layers[w],U[u]&&U[u].apply(U,p);return this},onAdd:function(u){this.eachLayer(u.addLayer,u)},onRemove:function(u){this.eachLayer(u.removeLayer,u)},eachLayer:function(u,p){for(var w in this._layers)u.call(p,this._layers[w]);return this},getLayer:function(u){return this._layers[u]},getLayers:function(){var u=[];return this.eachLayer(u.push,u),u},setZIndex:function(u){return this.invoke("setZIndex",u)},getLayerId:function(u){return c(u)}}),ib=function(u,p){return new ua(u,p)},fo=ua.extend({addLayer:function(u){return this.hasLayer(u)?this:(u.addEventParent(this),ua.prototype.addLayer.call(this,u),this.fire("layeradd",{layer:u}))},removeLayer:function(u){return this.hasLayer(u)?(u in this._layers&&(u=this._layers[u]),u.removeEventParent(this),ua.prototype.removeLayer.call(this,u),this.fire("layerremove",{layer:u})):this},setStyle:function(u){return this.invoke("setStyle",u)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var u=new G;for(var p in this._layers){var w=this._layers[p];u.extend(w.getBounds?w.getBounds():w.getLatLng())}return u}}),rb=function(u,p){return new fo(u,p)},fa=X.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(u){y(this,u)},createIcon:function(u){return this._createIcon("icon",u)},createShadow:function(u){return this._createIcon("shadow",u)},_createIcon:function(u,p){var w=this._getIconUrl(u);if(!w){if(u==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var U=this._createImg(w,p&&p.tagName==="IMG"?p:null);return this._setIconStyles(U,u),(this.options.crossOrigin||this.options.crossOrigin==="")&&(U.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),U},_setIconStyles:function(u,p){var w=this.options,U=w[p+"Size"];typeof U=="number"&&(U=[U,U]);var Q=ce(U),de=ce(p==="shadow"&&w.shadowAnchor||w.iconAnchor||Q&&Q.divideBy(2,!0));u.className="leaflet-marker-"+p+" "+(w.className||""),de&&(u.style.marginLeft=-de.x+"px",u.style.marginTop=-de.y+"px"),Q&&(u.style.width=Q.x+"px",u.style.height=Q.y+"px")},_createImg:function(u,p){return p=p||document.createElement("img"),p.src=u,p},_getIconUrl:function(u){return pt.retina&&this.options[u+"RetinaUrl"]||this.options[u+"Url"]}});function ob(u){return new fa(u)}var yl=fa.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(u){return typeof yl.imagePath!="string"&&(yl.imagePath=this._detectIconPath()),(this.options.imagePath||yl.imagePath)+fa.prototype._getIconUrl.call(this,u)},_stripUrl:function(u){var p=function(w,U,Q){var de=U.exec(w);return de&&de[Q]};return u=p(u,/^url\((['"])?(.+)\1\)$/,2),u&&p(u,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var u=an("div","leaflet-default-icon-path",document.body),p=ul(u,"background-image")||ul(u,"backgroundImage");if(document.body.removeChild(u),p=this._stripUrl(p),p)return p;var w=document.querySelector('link[href$="leaflet.css"]');return w?w.href.substring(0,w.href.length-11-1):""}}),Mm=uo.extend({initialize:function(u){this._marker=u},addHooks:function(){var u=this._marker._icon;this._draggable||(this._draggable=new ps(u,u,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Lt(u,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Wn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(u){var p=this._marker,w=p._map,U=this._marker.options.autoPanSpeed,Q=this._marker.options.autoPanPadding,de=Ro(p._icon),Pe=w.getPixelBounds(),Le=w.getPixelOrigin(),je=z(Pe.min._subtract(Le).add(Q),Pe.max._subtract(Le).subtract(Q));if(!je.contains(de)){var Ze=ce((Math.max(je.max.x,de.x)-je.max.x)/(Pe.max.x-je.max.x)-(Math.min(je.min.x,de.x)-je.min.x)/(Pe.min.x-je.min.x),(Math.max(je.max.y,de.y)-je.max.y)/(Pe.max.y-je.max.y)-(Math.min(je.min.y,de.y)-je.min.y)/(Pe.min.y-je.min.y)).multiplyBy(U);w.panBy(Ze,{animate:!1}),this._draggable._newPos._add(Ze),this._draggable._startPos._add(Ze),Hn(p._icon,this._draggable._newPos),this._onDrag(u),this._panRequest=I(this._adjustPan.bind(this,u))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(u){this._marker.options.autoPan&&(O(this._panRequest),this._panRequest=I(this._adjustPan.bind(this,u)))},_onDrag:function(u){var p=this._marker,w=p._shadow,U=Ro(p._icon),Q=p._map.layerPointToLatLng(U);w&&Hn(w,U),p._latlng=Q,u.latlng=Q,u.oldLatLng=this._oldLatLng,p.fire("move",u).fire("drag",u)},_onDragEnd:function(u){O(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",u)}}),Yc=wr.extend({options:{icon:new yl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(u,p){y(this,p),this._latlng=Y(u)},onAdd:function(u){this._zoomAnimated=this._zoomAnimated&&u.options.markerZoomAnimation,this._zoomAnimated&&u.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(u){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&u.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(u){var p=this._latlng;return this._latlng=Y(u),this.update(),this.fire("move",{oldLatLng:p,latlng:this._latlng})},setZIndexOffset:function(u){return this.options.zIndexOffset=u,this.update()},getIcon:function(){return this.options.icon},setIcon:function(u){return this.options.icon=u,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var u=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(u)}return this},_initIcon:function(){var u=this.options,p="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),w=u.icon.createIcon(this._icon),U=!1;w!==this._icon&&(this._icon&&this._removeIcon(),U=!0,u.title&&(w.title=u.title),w.tagName==="IMG"&&(w.alt=u.alt||"")),Lt(w,p),u.keyboard&&(w.tabIndex="0",w.setAttribute("role","button")),this._icon=w,u.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Dt(w,"focus",this._panOnFocus,this);var Q=u.icon.createShadow(this._shadow),de=!1;Q!==this._shadow&&(this._removeShadow(),de=!0),Q&&(Lt(Q,p),Q.alt=""),this._shadow=Q,u.opacity<1&&this._updateOpacity(),U&&this.getPane().appendChild(this._icon),this._initInteraction(),Q&&de&&this.getPane(u.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&_n(this._icon,"focus",this._panOnFocus,this),Cn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Cn(this._shadow),this._shadow=null},_setPos:function(u){this._icon&&Hn(this._icon,u),this._shadow&&Hn(this._shadow,u),this._zIndex=u.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(u){this._icon&&(this._icon.style.zIndex=this._zIndex+u)},_animateZoom:function(u){var p=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center).round();this._setPos(p)},_initInteraction:function(){if(this.options.interactive&&(Lt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Mm)){var u=this.options.draggable;this.dragging&&(u=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Mm(this),u&&this.dragging.enable()}},setOpacity:function(u){return this.options.opacity=u,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var u=this.options.opacity;this._icon&&br(this._icon,u),this._shadow&&br(this._shadow,u)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var u=this._map;if(u){var p=this.options.icon.options,w=p.iconSize?ce(p.iconSize):ce(0,0),U=p.iconAnchor?ce(p.iconAnchor):ce(0,0);u.panInside(this._latlng,{paddingTopLeft:U,paddingBottomRight:w.subtract(U)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function sb(u,p){return new Yc(u,p)}var H=wr.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(u){this._renderer=u.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(u){return y(this,u),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&u&&Object.prototype.hasOwnProperty.call(u,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),V=H.extend({options:{fill:!0,radius:10},initialize:function(u,p){y(this,p),this._latlng=Y(u),this._radius=this.options.radius},setLatLng:function(u){var p=this._latlng;return this._latlng=Y(u),this.redraw(),this.fire("move",{oldLatLng:p,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(u){return this.options.radius=this._radius=u,this.redraw()},getRadius:function(){return this._radius},setStyle:function(u){var p=u&&u.radius||this._radius;return H.prototype.setStyle.call(this,u),this.setRadius(p),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var u=this._radius,p=this._radiusY||u,w=this._clickTolerance(),U=[u+w,p+w];this._pxBounds=new se(this._point.subtract(U),this._point.add(U))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(u){return u.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function le(u,p){return new V(u,p)}var me=V.extend({initialize:function(u,p,w){if(typeof p=="number"&&(p=r({},w,{radius:p})),y(this,p),this._latlng=Y(u),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(u){return this._mRadius=u,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var u=[this._radius,this._radiusY||this._radius];return new G(this._map.layerPointToLatLng(this._point.subtract(u)),this._map.layerPointToLatLng(this._point.add(u)))},setStyle:H.prototype.setStyle,_project:function(){var u=this._latlng.lng,p=this._latlng.lat,w=this._map,U=w.options.crs;if(U.distance===_.distance){var Q=Math.PI/180,de=this._mRadius/_.R/Q,Pe=w.project([p+de,u]),Le=w.project([p-de,u]),je=Pe.add(Le).divideBy(2),Ze=w.unproject(je).lat,dt=Math.acos((Math.cos(de*Q)-Math.sin(p*Q)*Math.sin(Ze*Q))/(Math.cos(p*Q)*Math.cos(Ze*Q)))/Q;(isNaN(dt)||dt===0)&&(dt=de/Math.cos(Math.PI/180*p)),this._point=je.subtract(w.getPixelOrigin()),this._radius=isNaN(dt)?0:je.x-w.project([Ze,u-dt]).x,this._radiusY=je.y-Pe.y}else{var At=U.unproject(U.project(this._latlng).subtract([this._mRadius,0]));this._point=w.latLngToLayerPoint(this._latlng),this._radius=this._point.x-w.latLngToLayerPoint(At).x}this._updateBounds()}});function xe(u,p,w){return new me(u,p,w)}var ie=H.extend({options:{smoothFactor:1,noClip:!1},initialize:function(u,p){y(this,p),this._setLatLngs(u)},getLatLngs:function(){return this._latlngs},setLatLngs:function(u){return this._setLatLngs(u),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(u){for(var p=1/0,w=null,U=Gc,Q,de,Pe=0,Le=this._parts.length;Pe<Le;Pe++)for(var je=this._parts[Pe],Ze=1,dt=je.length;Ze<dt;Ze++){Q=je[Ze-1],de=je[Ze];var At=U(u,Q,de,!0);At<p&&(p=At,w=U(u,Q,de))}return w&&(w.distance=Math.sqrt(p)),w},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Vy(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(u,p){return p=p||this._defaultShape(),u=Y(u),p.push(u),this._bounds.extend(u),this.redraw()},_setLatLngs:function(u){this._bounds=new G,this._latlngs=this._convertLatLngs(u)},_defaultShape:function(){return er(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(u){for(var p=[],w=er(u),U=0,Q=u.length;U<Q;U++)w?(p[U]=Y(u[U]),this._bounds.extend(p[U])):p[U]=this._convertLatLngs(u[U]);return p},_project:function(){var u=new se;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,u),this._bounds.isValid()&&u.isValid()&&(this._rawPxBounds=u,this._updateBounds())},_updateBounds:function(){var u=this._clickTolerance(),p=new re(u,u);this._rawPxBounds&&(this._pxBounds=new se([this._rawPxBounds.min.subtract(p),this._rawPxBounds.max.add(p)]))},_projectLatlngs:function(u,p,w){var U=u[0]instanceof K,Q=u.length,de,Pe;if(U){for(Pe=[],de=0;de<Q;de++)Pe[de]=this._map.latLngToLayerPoint(u[de]),w.extend(Pe[de]);p.push(Pe)}else for(de=0;de<Q;de++)this._projectLatlngs(u[de],p,w)},_clipPoints:function(){var u=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}var p=this._parts,w,U,Q,de,Pe,Le,je;for(w=0,Q=0,de=this._rings.length;w<de;w++)for(je=this._rings[w],U=0,Pe=je.length;U<Pe-1;U++)Le=Jy(je[U],je[U+1],u,U,!0),Le&&(p[Q]=p[Q]||[],p[Q].push(Le[0]),(Le[1]!==je[U+1]||U===Pe-2)&&(p[Q].push(Le[1]),Q++))}},_simplifyPoints:function(){for(var u=this._parts,p=this.options.smoothFactor,w=0,U=u.length;w<U;w++)u[w]=Pm(u[w],p)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(u,p){var w,U,Q,de,Pe,Le,je=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(w=0,de=this._parts.length;w<de;w++)for(Le=this._parts[w],U=0,Pe=Le.length,Q=Pe-1;U<Pe;Q=U++)if(!(!p&&U===0)&&Bm(u,Le[Q],Le[U])<=je)return!0;return!1}});function he(u,p){return new ie(u,p)}ie._flat=Qy;var _e=ie.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Gy(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(u){var p=ie.prototype._convertLatLngs.call(this,u),w=p.length;return w>=2&&p[0]instanceof K&&p[0].equals(p[w-1])&&p.pop(),p},_setLatLngs:function(u){ie.prototype._setLatLngs.call(this,u),er(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return er(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var u=this._renderer._bounds,p=this.options.weight,w=new re(p,p);if(u=new se(u.min.subtract(w),u.max.add(w)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}for(var U=0,Q=this._rings.length,de;U<Q;U++)de=Ky(this._rings[U],u,!0),de.length&&this._parts.push(de)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(u){var p=!1,w,U,Q,de,Pe,Le,je,Ze;if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(de=0,je=this._parts.length;de<je;de++)for(w=this._parts[de],Pe=0,Ze=w.length,Le=Ze-1;Pe<Ze;Le=Pe++)U=w[Pe],Q=w[Le],U.y>u.y!=Q.y>u.y&&u.x<(Q.x-U.x)*(u.y-U.y)/(Q.y-U.y)+U.x&&(p=!p);return p||ie.prototype._containsPoint.call(this,u,!0)}});function ze(u,p){return new _e(u,p)}var qe=fo.extend({initialize:function(u,p){y(this,p),this._layers={},u&&this.addData(u)},addData:function(u){var p=B(u)?u:u.features,w,U,Q;if(p){for(w=0,U=p.length;w<U;w++)Q=p[w],(Q.geometries||Q.geometry||Q.features||Q.coordinates)&&this.addData(Q);return this}var de=this.options;if(de.filter&&!de.filter(u))return this;var Pe=Qe(u,de);return Pe?(Pe.feature=Ft(u),Pe.defaultOptions=Pe.options,this.resetStyle(Pe),de.onEachFeature&&de.onEachFeature(u,Pe),this.addLayer(Pe)):this},resetStyle:function(u){return u===void 0?this.eachLayer(this.resetStyle,this):(u.options=r({},u.defaultOptions),this._setLayerStyle(u,this.options.style),this)},setStyle:function(u){return this.eachLayer(function(p){this._setLayerStyle(p,u)},this)},_setLayerStyle:function(u,p){u.setStyle&&(typeof p=="function"&&(p=p(u.feature)),u.setStyle(p))}});function Qe(u,p){var w=u.type==="Feature"?u.geometry:u,U=w?w.coordinates:null,Q=[],de=p&&p.pointToLayer,Pe=p&&p.coordsToLatLng||it,Le,je,Ze,dt;if(!U&&!w)return null;switch(w.type){case"Point":return Le=Pe(U),et(de,u,Le,p);case"MultiPoint":for(Ze=0,dt=U.length;Ze<dt;Ze++)Le=Pe(U[Ze]),Q.push(et(de,u,Le,p));return new fo(Q);case"LineString":case"MultiLineString":return je=Et(U,w.type==="LineString"?0:1,Pe),new ie(je,p);case"Polygon":case"MultiPolygon":return je=Et(U,w.type==="Polygon"?1:2,Pe),new _e(je,p);case"GeometryCollection":for(Ze=0,dt=w.geometries.length;Ze<dt;Ze++){var At=Qe({geometry:w.geometries[Ze],type:"Feature",properties:u.properties},p);At&&Q.push(At)}return new fo(Q);case"FeatureCollection":for(Ze=0,dt=w.features.length;Ze<dt;Ze++){var Yt=Qe(w.features[Ze],p);Yt&&Q.push(Yt)}return new fo(Q);default:throw new Error("Invalid GeoJSON object.")}}function et(u,p,w,U){return u?u(p,w):new Yc(w,U&&U.markersInheritOptions&&U)}function it(u){return new K(u[1],u[0],u[2])}function Et(u,p,w){for(var U=[],Q=0,de=u.length,Pe;Q<de;Q++)Pe=p?Et(u[Q],p-1,w):(w||it)(u[Q]),U.push(Pe);return U}function Bt(u,p){return u=Y(u),u.alt!==void 0?[m(u.lng,p),m(u.lat,p),m(u.alt,p)]:[m(u.lng,p),m(u.lat,p)]}function qt(u,p,w,U){for(var Q=[],de=0,Pe=u.length;de<Pe;de++)Q.push(p?qt(u[de],er(u[de])?0:p-1,w,U):Bt(u[de],U));return!p&&w&&Q.length>0&&Q.push(Q[0].slice()),Q}function wt(u,p){return u.feature?r({},u.feature,{geometry:p}):Ft(p)}function Ft(u){return u.type==="Feature"||u.type==="FeatureCollection"?u:{type:"Feature",properties:{},geometry:u}}var St={toGeoJSON:function(u){return wt(this,{type:"Point",coordinates:Bt(this.getLatLng(),u)})}};Yc.include(St),me.include(St),V.include(St),ie.include({toGeoJSON:function(u){var p=!er(this._latlngs),w=qt(this._latlngs,p?1:0,!1,u);return wt(this,{type:(p?"Multi":"")+"LineString",coordinates:w})}}),_e.include({toGeoJSON:function(u){var p=!er(this._latlngs),w=p&&!er(this._latlngs[0]),U=qt(this._latlngs,w?2:p?1:0,!0,u);return p||(U=[U]),wt(this,{type:(w?"Multi":"")+"Polygon",coordinates:U})}}),ua.include({toMultiPoint:function(u){var p=[];return this.eachLayer(function(w){p.push(w.toGeoJSON(u).geometry.coordinates)}),wt(this,{type:"MultiPoint",coordinates:p})},toGeoJSON:function(u){var p=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(p==="MultiPoint")return this.toMultiPoint(u);var w=p==="GeometryCollection",U=[];return this.eachLayer(function(Q){if(Q.toGeoJSON){var de=Q.toGeoJSON(u);if(w)U.push(de.geometry);else{var Pe=Ft(de);Pe.type==="FeatureCollection"?U.push.apply(U,Pe.features):U.push(Pe)}}}),w?wt(this,{geometries:U,type:"GeometryCollection"}):{type:"FeatureCollection",features:U}}});function Mt(u,p){return new qe(u,p)}var Kt=Mt,qn=wr.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(u,p,w){this._url=u,this._bounds=ee(p),y(this,w)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Lt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Cn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(u){return this.options.opacity=u,this._image&&this._updateOpacity(),this},setStyle:function(u){return u.opacity&&this.setOpacity(u.opacity),this},bringToFront:function(){return this._map&&co(this._image),this},bringToBack:function(){return this._map&&Di(this._image),this},setUrl:function(u){return this._url=u,this._image&&(this._image.src=u),this},setBounds:function(u){return this._bounds=ee(u),this._map&&this._reset(),this},getEvents:function(){var u={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var u=this._url.tagName==="IMG",p=this._image=u?this._url:an("img");if(Lt(p,"leaflet-image-layer"),this._zoomAnimated&&Lt(p,"leaflet-zoom-animated"),this.options.className&&Lt(p,this.options.className),p.onselectstart=h,p.onmousemove=h,p.onload=a(this.fire,this,"load"),p.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(p.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),u){this._url=p.src;return}p.src=this._url,p.alt=this.options.alt},_animateZoom:function(u){var p=this._map.getZoomScale(u.zoom),w=this._map._latLngBoundsToNewLayerBounds(this._bounds,u.zoom,u.center).min;fs(this._image,w,p)},_reset:function(){var u=this._image,p=new se(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),w=p.getSize();Hn(u,p.min),u.style.width=w.x+"px",u.style.height=w.y+"px"},_updateOpacity:function(){br(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var u=this.options.errorOverlayUrl;u&&this._url!==u&&(this._url=u,this._image.src=u)},getCenter:function(){return this._bounds.getCenter()}}),Ct=function(u,p,w){return new qn(u,p,w)},ut=qn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var u=this._url.tagName==="VIDEO",p=this._image=u?this._url:an("video");if(Lt(p,"leaflet-image-layer"),this._zoomAnimated&&Lt(p,"leaflet-zoom-animated"),this.options.className&&Lt(p,this.options.className),p.onselectstart=h,p.onmousemove=h,p.onloadeddata=a(this.fire,this,"load"),u){for(var w=p.getElementsByTagName("source"),U=[],Q=0;Q<w.length;Q++)U.push(w[Q].src);this._url=w.length>0?U:[p.src];return}B(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(p.style,"objectFit")&&(p.style.objectFit="fill"),p.autoplay=!!this.options.autoplay,p.loop=!!this.options.loop,p.muted=!!this.options.muted,p.playsInline=!!this.options.playsInline;for(var de=0;de<this._url.length;de++){var Pe=an("source");Pe.src=this._url[de],p.appendChild(Pe)}}});function bi(u,p,w){return new ut(u,p,w)}var li=qn.extend({_initImage:function(){var u=this._image=this._url;Lt(u,"leaflet-image-layer"),this._zoomAnimated&&Lt(u,"leaflet-zoom-animated"),this.options.className&&Lt(u,this.options.className),u.onselectstart=h,u.onmousemove=h}});function Kn(u,p,w){return new li(u,p,w)}var Pn=wr.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(u,p){u&&(u instanceof K||B(u))?(this._latlng=Y(u),y(this,p)):(y(this,u),this._source=p),this.options.content&&(this._content=this.options.content)},openOn:function(u){return u=arguments.length?u:this._source._map,u.hasLayer(this)||u.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(u){return this._map?this.close():(arguments.length?this._source=u:u=this._source,this._prepareOpen(),this.openOn(u._map)),this},onAdd:function(u){this._zoomAnimated=u._zoomAnimated,this._container||this._initLayout(),u._fadeAnimated&&br(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),u._fadeAnimated&&br(this._container,1),this.bringToFront(),this.options.interactive&&(Lt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(u){u._fadeAnimated?(br(this._container,0),this._removeTimeout=setTimeout(a(Cn,void 0,this._container),200)):Cn(this._container),this.options.interactive&&(Wn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(u){return this._latlng=Y(u),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(u){return this._content=u,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var u={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&co(this._container),this},bringToBack:function(){return this._map&&Di(this._container),this},_prepareOpen:function(u){var p=this._source;if(!p._map)return!1;if(p instanceof fo){p=null;var w=this._source._layers;for(var U in w)if(w[U]._map){p=w[U];break}if(!p)return!1;this._source=p}if(!u)if(p.getCenter)u=p.getCenter();else if(p.getLatLng)u=p.getLatLng();else if(p.getBounds)u=p.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(u),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var u=this._contentNode,p=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof p=="string")u.innerHTML=p;else{for(;u.hasChildNodes();)u.removeChild(u.firstChild);u.appendChild(p)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var u=this._map.latLngToLayerPoint(this._latlng),p=ce(this.options.offset),w=this._getAnchor();this._zoomAnimated?Hn(this._container,u.add(w)):p=p.add(u).add(w);var U=this._containerBottom=-p.y,Q=this._containerLeft=-Math.round(this._containerWidth/2)+p.x;this._container.style.bottom=U+"px",this._container.style.left=Q+"px"}},_getAnchor:function(){return[0,0]}});Rt.include({_initOverlay:function(u,p,w,U){var Q=p;return Q instanceof u||(Q=new u(U).setContent(p)),w&&Q.setLatLng(w),Q}}),wr.include({_initOverlay:function(u,p,w,U){var Q=w;return Q instanceof u?(y(Q,U),Q._source=this):(Q=p&&!U?p:new u(U,this),Q.setContent(w)),Q}});var Lr=Pn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(u){return u=arguments.length?u:this._source._map,!u.hasLayer(this)&&u._popup&&u._popup.options.autoClose&&u.removeLayer(u._popup),u._popup=this,Pn.prototype.openOn.call(this,u)},onAdd:function(u){Pn.prototype.onAdd.call(this,u),u.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof H||this._source.on("preclick",hs))},onRemove:function(u){Pn.prototype.onRemove.call(this,u),u.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof H||this._source.off("preclick",hs))},getEvents:function(){var u=Pn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(u.preclick=this.close),this.options.keepInView&&(u.moveend=this._adjustPan),u},_initLayout:function(){var u="leaflet-popup",p=this._container=an("div",u+" "+(this.options.className||"")+" leaflet-zoom-animated"),w=this._wrapper=an("div",u+"-content-wrapper",p);if(this._contentNode=an("div",u+"-content",w),qc(p),ei(this._contentNode),Dt(p,"contextmenu",hs),this._tipContainer=an("div",u+"-tip-container",p),this._tip=an("div",u+"-tip",this._tipContainer),this.options.closeButton){var U=this._closeButton=an("a",u+"-close-button",p);U.setAttribute("role","button"),U.setAttribute("aria-label","Close popup"),U.href="#close",U.innerHTML='<span aria-hidden="true">&#215;</span>',Dt(U,"click",function(Q){hi(Q),this.close()},this)}},_updateLayout:function(){var u=this._contentNode,p=u.style;p.width="",p.whiteSpace="nowrap";var w=u.offsetWidth;w=Math.min(w,this.options.maxWidth),w=Math.max(w,this.options.minWidth),p.width=w+1+"px",p.whiteSpace="",p.height="";var U=u.offsetHeight,Q=this.options.maxHeight,de="leaflet-popup-scrolled";Q&&U>Q?(p.height=Q+"px",Lt(u,de)):Wn(u,de),this._containerWidth=this._container.offsetWidth},_animateZoom:function(u){var p=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center),w=this._getAnchor();Hn(this._container,p.add(w))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var u=this._map,p=parseInt(ul(this._container,"marginBottom"),10)||0,w=this._container.offsetHeight+p,U=this._containerWidth,Q=new re(this._containerLeft,-w-this._containerBottom);Q._add(Ro(this._container));var de=u.layerPointToContainerPoint(Q),Pe=ce(this.options.autoPanPadding),Le=ce(this.options.autoPanPaddingTopLeft||Pe),je=ce(this.options.autoPanPaddingBottomRight||Pe),Ze=u.getSize(),dt=0,At=0;de.x+U+je.x>Ze.x&&(dt=de.x+U-Ze.x+je.x),de.x-dt-Le.x<0&&(dt=de.x-Le.x),de.y+w+je.y>Ze.y&&(At=de.y+w-Ze.y+je.y),de.y-At-Le.y<0&&(At=de.y-Le.y),(dt||At)&&(this.options.keepInView&&(this._autopanning=!0),u.fire("autopanstart").panBy([dt,At]))}},_getAnchor:function(){return ce(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),j1=function(u,p){return new Lr(u,p)};Rt.mergeOptions({closePopupOnClick:!0}),Rt.include({openPopup:function(u,p,w){return this._initOverlay(Lr,u,p,w).openOn(this),this},closePopup:function(u){return u=arguments.length?u:this._popup,u&&u.close(),this}}),wr.include({bindPopup:function(u,p){return this._popup=this._initOverlay(Lr,this._popup,u,p),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(u){return this._popup&&(this instanceof fo||(this._popup._source=this),this._popup._prepareOpen(u||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(u){return this._popup&&this._popup.setContent(u),this},getPopup:function(){return this._popup},_openPopup:function(u){if(!(!this._popup||!this._map)){ms(u);var p=u.layer||u.target;if(this._popup._source===p&&!(p instanceof H)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(u.latlng);return}this._popup._source=p,this.openPopup(u.latlng)}},_movePopup:function(u){this._popup.setLatLng(u.latlng)},_onKeyPress:function(u){u.originalEvent.keyCode===13&&this._openPopup(u)}});var ab=Pn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(u){Pn.prototype.onAdd.call(this,u),this.setOpacity(this.options.opacity),u.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(u){Pn.prototype.onRemove.call(this,u),u.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var u=Pn.prototype.getEvents.call(this);return this.options.permanent||(u.preclick=this.close),u},_initLayout:function(){var u="leaflet-tooltip",p=u+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=an("div",p),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(u){var p,w,U=this._map,Q=this._container,de=U.latLngToContainerPoint(U.getCenter()),Pe=U.layerPointToContainerPoint(u),Le=this.options.direction,je=Q.offsetWidth,Ze=Q.offsetHeight,dt=ce(this.options.offset),At=this._getAnchor();Le==="top"?(p=je/2,w=Ze):Le==="bottom"?(p=je/2,w=0):Le==="center"?(p=je/2,w=Ze/2):Le==="right"?(p=0,w=Ze/2):Le==="left"?(p=je,w=Ze/2):Pe.x<de.x?(Le="right",p=0,w=Ze/2):(Le="left",p=je+(dt.x+At.x)*2,w=Ze/2),u=u.subtract(ce(p,w,!0)).add(dt).add(At),Wn(Q,"leaflet-tooltip-right"),Wn(Q,"leaflet-tooltip-left"),Wn(Q,"leaflet-tooltip-top"),Wn(Q,"leaflet-tooltip-bottom"),Lt(Q,"leaflet-tooltip-"+Le),Hn(Q,u)},_updatePosition:function(){var u=this._map.latLngToLayerPoint(this._latlng);this._setPosition(u)},setOpacity:function(u){this.options.opacity=u,this._container&&br(this._container,u)},_animateZoom:function(u){var p=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center);this._setPosition(p)},_getAnchor:function(){return ce(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Y2e=function(u,p){return new ab(u,p)};Rt.include({openTooltip:function(u,p,w){return this._initOverlay(ab,u,p,w).openOn(this),this},closeTooltip:function(u){return u.close(),this}}),wr.include({bindTooltip:function(u,p){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(ab,this._tooltip,u,p),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(u){if(!(!u&&this._tooltipHandlersAdded)){var p=u?"off":"on",w={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?w.add=this._openTooltip:(w.mouseover=this._openTooltip,w.mouseout=this.closeTooltip,w.click=this._openTooltip,this._map?this._addFocusListeners():w.add=this._addFocusListeners),this._tooltip.options.sticky&&(w.mousemove=this._moveTooltip),this[p](w),this._tooltipHandlersAdded=!u}},openTooltip:function(u){return this._tooltip&&(this instanceof fo||(this._tooltip._source=this),this._tooltip._prepareOpen(u)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(u){return this._tooltip&&this._tooltip.setContent(u),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(u){var p=typeof u.getElement=="function"&&u.getElement();p&&(Dt(p,"focus",function(){this._tooltip._source=u,this.openTooltip()},this),Dt(p,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(u){var p=typeof u.getElement=="function"&&u.getElement();p&&p.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(u){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var p=this;this._map.once("moveend",function(){p._openOnceFlag=!1,p._openTooltip(u)});return}this._tooltip._source=u.layer||u.target,this.openTooltip(this._tooltip.options.sticky?u.latlng:void 0)}},_moveTooltip:function(u){var p=u.latlng,w,U;this._tooltip.options.sticky&&u.originalEvent&&(w=this._map.mouseEventToContainerPoint(u.originalEvent),U=this._map.containerPointToLayerPoint(w),p=this._map.layerPointToLatLng(U)),this._tooltip.setLatLng(p)}});var PR=fa.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(u){var p=u&&u.tagName==="DIV"?u:document.createElement("div"),w=this.options;if(w.html instanceof Element?(Ni(p),p.appendChild(w.html)):p.innerHTML=w.html!==!1?w.html:"",w.bgPos){var U=ce(w.bgPos);p.style.backgroundPosition=-U.x+"px "+-U.y+"px"}return this._setIconStyles(p,"icon"),p},createShadow:function(){return null}});function Z2e(u){return new PR(u)}fa.Default=yl;var Rm=wr.extend({options:{tileSize:256,opacity:1,updateWhenIdle:pt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(u){y(this,u)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(u){u._addZoomLimit(this)},onRemove:function(u){this._removeAllTiles(),Cn(this._container),u._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(co(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Di(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(u){return this.options.opacity=u,this._updateOpacity(),this},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var u=this._clampZoom(this._map.getZoom());u!==this._tileZoom&&(this._tileZoom=u,this._updateLevels()),this._update()}return this},getEvents:function(){var u={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),u.move=this._onMove),this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},createTile:function(){return document.createElement("div")},getTileSize:function(){var u=this.options.tileSize;return u instanceof re?u:new re(u,u)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(u){for(var p=this.getPane().children,w=-u(-1/0,1/0),U=0,Q=p.length,de;U<Q;U++)de=p[U].style.zIndex,p[U]!==this._container&&de&&(w=u(w,+de));isFinite(w)&&(this.options.zIndex=w+u(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!pt.ielt9){br(this._container,this.options.opacity);var u=+new Date,p=!1,w=!1;for(var U in this._tiles){var Q=this._tiles[U];if(!(!Q.current||!Q.loaded)){var de=Math.min(1,(u-Q.loaded)/200);br(Q.el,de),de<1?p=!0:(Q.active?w=!0:this._onOpaqueTile(Q),Q.active=!0)}}w&&!this._noPrune&&this._pruneTiles(),p&&(O(this._fadeFrame),this._fadeFrame=I(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=an("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var u=this._tileZoom,p=this.options.maxZoom;if(u!==void 0){for(var w in this._levels)w=Number(w),this._levels[w].el.children.length||w===u?(this._levels[w].el.style.zIndex=p-Math.abs(u-w),this._onUpdateLevel(w)):(Cn(this._levels[w].el),this._removeTilesAtZoom(w),this._onRemoveLevel(w),delete this._levels[w]);var U=this._levels[u],Q=this._map;return U||(U=this._levels[u]={},U.el=an("div","leaflet-tile-container leaflet-zoom-animated",this._container),U.el.style.zIndex=p,U.origin=Q.project(Q.unproject(Q.getPixelOrigin()),u).round(),U.zoom=u,this._setZoomTransform(U,Q.getCenter(),Q.getZoom()),h(U.el.offsetWidth),this._onCreateLevel(U)),this._level=U,U}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var u,p,w=this._map.getZoom();if(w>this.options.maxZoom||w<this.options.minZoom){this._removeAllTiles();return}for(u in this._tiles)p=this._tiles[u],p.retain=p.current;for(u in this._tiles)if(p=this._tiles[u],p.current&&!p.active){var U=p.coords;this._retainParent(U.x,U.y,U.z,U.z-5)||this._retainChildren(U.x,U.y,U.z,U.z+2)}for(u in this._tiles)this._tiles[u].retain||this._removeTile(u)}},_removeTilesAtZoom:function(u){for(var p in this._tiles)this._tiles[p].coords.z===u&&this._removeTile(p)},_removeAllTiles:function(){for(var u in this._tiles)this._removeTile(u)},_invalidateAll:function(){for(var u in this._levels)Cn(this._levels[u].el),this._onRemoveLevel(Number(u)),delete this._levels[u];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(u,p,w,U){var Q=Math.floor(u/2),de=Math.floor(p/2),Pe=w-1,Le=new re(+Q,+de);Le.z=+Pe;var je=this._tileCoordsToKey(Le),Ze=this._tiles[je];return Ze&&Ze.active?(Ze.retain=!0,!0):(Ze&&Ze.loaded&&(Ze.retain=!0),Pe>U?this._retainParent(Q,de,Pe,U):!1)},_retainChildren:function(u,p,w,U){for(var Q=2*u;Q<2*u+2;Q++)for(var de=2*p;de<2*p+2;de++){var Pe=new re(Q,de);Pe.z=w+1;var Le=this._tileCoordsToKey(Pe),je=this._tiles[Le];if(je&&je.active){je.retain=!0;continue}else je&&je.loaded&&(je.retain=!0);w+1<U&&this._retainChildren(Q,de,w+1,U)}},_resetView:function(u){var p=u&&(u.pinch||u.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),p,p)},_animateZoom:function(u){this._setView(u.center,u.zoom,!0,u.noUpdate)},_clampZoom:function(u){var p=this.options;return p.minNativeZoom!==void 0&&u<p.minNativeZoom?p.minNativeZoom:p.maxNativeZoom!==void 0&&p.maxNativeZoom<u?p.maxNativeZoom:u},_setView:function(u,p,w,U){var Q=Math.round(p);this.options.maxZoom!==void 0&&Q>this.options.maxZoom||this.options.minZoom!==void 0&&Q<this.options.minZoom?Q=void 0:Q=this._clampZoom(Q);var de=this.options.updateWhenZooming&&Q!==this._tileZoom;(!U||de)&&(this._tileZoom=Q,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),Q!==void 0&&this._update(u),w||this._pruneTiles(),this._noPrune=!!w),this._setZoomTransforms(u,p)},_setZoomTransforms:function(u,p){for(var w in this._levels)this._setZoomTransform(this._levels[w],u,p)},_setZoomTransform:function(u,p,w){var U=this._map.getZoomScale(w,u.zoom),Q=u.origin.multiplyBy(U).subtract(this._map._getNewPixelOrigin(p,w)).round();pt.any3d?fs(u.el,Q,U):Hn(u.el,Q)},_resetGrid:function(){var u=this._map,p=u.options.crs,w=this._tileSize=this.getTileSize(),U=this._tileZoom,Q=this._map.getPixelWorldBounds(this._tileZoom);Q&&(this._globalTileRange=this._pxBoundsToTileRange(Q)),this._wrapX=p.wrapLng&&!this.options.noWrap&&[Math.floor(u.project([0,p.wrapLng[0]],U).x/w.x),Math.ceil(u.project([0,p.wrapLng[1]],U).x/w.y)],this._wrapY=p.wrapLat&&!this.options.noWrap&&[Math.floor(u.project([p.wrapLat[0],0],U).y/w.x),Math.ceil(u.project([p.wrapLat[1],0],U).y/w.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(u){var p=this._map,w=p._animatingZoom?Math.max(p._animateToZoom,p.getZoom()):p.getZoom(),U=p.getZoomScale(w,this._tileZoom),Q=p.project(u,this._tileZoom).floor(),de=p.getSize().divideBy(U*2);return new se(Q.subtract(de),Q.add(de))},_update:function(u){var p=this._map;if(p){var w=this._clampZoom(p.getZoom());if(u===void 0&&(u=p.getCenter()),this._tileZoom!==void 0){var U=this._getTiledPixelBounds(u),Q=this._pxBoundsToTileRange(U),de=Q.getCenter(),Pe=[],Le=this.options.keepBuffer,je=new se(Q.getBottomLeft().subtract([Le,-Le]),Q.getTopRight().add([Le,-Le]));if(!(isFinite(Q.min.x)&&isFinite(Q.min.y)&&isFinite(Q.max.x)&&isFinite(Q.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Ze in this._tiles){var dt=this._tiles[Ze].coords;(dt.z!==this._tileZoom||!je.contains(new re(dt.x,dt.y)))&&(this._tiles[Ze].current=!1)}if(Math.abs(w-this._tileZoom)>1){this._setView(u,w);return}for(var At=Q.min.y;At<=Q.max.y;At++)for(var Yt=Q.min.x;Yt<=Q.max.x;Yt++){var tr=new re(Yt,At);if(tr.z=this._tileZoom,!!this._isValidTile(tr)){var xi=this._tiles[this._tileCoordsToKey(tr)];xi?xi.current=!0:Pe.push(tr)}}if(Pe.sort(function(_r,ju){return _r.distanceTo(de)-ju.distanceTo(de)}),Pe.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ho=document.createDocumentFragment();for(Yt=0;Yt<Pe.length;Yt++)this._addTile(Pe[Yt],ho);this._level.el.appendChild(ho)}}}},_isValidTile:function(u){var p=this._map.options.crs;if(!p.infinite){var w=this._globalTileRange;if(!p.wrapLng&&(u.x<w.min.x||u.x>w.max.x)||!p.wrapLat&&(u.y<w.min.y||u.y>w.max.y))return!1}if(!this.options.bounds)return!0;var U=this._tileCoordsToBounds(u);return ee(this.options.bounds).overlaps(U)},_keyToBounds:function(u){return this._tileCoordsToBounds(this._keyToTileCoords(u))},_tileCoordsToNwSe:function(u){var p=this._map,w=this.getTileSize(),U=u.scaleBy(w),Q=U.add(w),de=p.unproject(U,u.z),Pe=p.unproject(Q,u.z);return[de,Pe]},_tileCoordsToBounds:function(u){var p=this._tileCoordsToNwSe(u),w=new G(p[0],p[1]);return this.options.noWrap||(w=this._map.wrapLatLngBounds(w)),w},_tileCoordsToKey:function(u){return u.x+":"+u.y+":"+u.z},_keyToTileCoords:function(u){var p=u.split(":"),w=new re(+p[0],+p[1]);return w.z=+p[2],w},_removeTile:function(u){var p=this._tiles[u];p&&(Cn(p.el),delete this._tiles[u],this.fire("tileunload",{tile:p.el,coords:this._keyToTileCoords(u)}))},_initTile:function(u){Lt(u,"leaflet-tile");var p=this.getTileSize();u.style.width=p.x+"px",u.style.height=p.y+"px",u.onselectstart=h,u.onmousemove=h,pt.ielt9&&this.options.opacity<1&&br(u,this.options.opacity)},_addTile:function(u,p){var w=this._getTilePos(u),U=this._tileCoordsToKey(u),Q=this.createTile(this._wrapCoords(u),a(this._tileReady,this,u));this._initTile(Q),this.createTile.length<2&&I(a(this._tileReady,this,u,null,Q)),Hn(Q,w),this._tiles[U]={el:Q,coords:u,current:!0},p.appendChild(Q),this.fire("tileloadstart",{tile:Q,coords:u})},_tileReady:function(u,p,w){p&&this.fire("tileerror",{error:p,tile:w,coords:u});var U=this._tileCoordsToKey(u);w=this._tiles[U],w&&(w.loaded=+new Date,this._map._fadeAnimated?(br(w.el,0),O(this._fadeFrame),this._fadeFrame=I(this._updateOpacity,this)):(w.active=!0,this._pruneTiles()),p||(Lt(w.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:w.el,coords:u})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),pt.ielt9||!this._map._fadeAnimated?I(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(u){return u.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(u){var p=new re(this._wrapX?f(u.x,this._wrapX):u.x,this._wrapY?f(u.y,this._wrapY):u.y);return p.z=u.z,p},_pxBoundsToTileRange:function(u){var p=this.getTileSize();return new se(u.min.unscaleBy(p).floor(),u.max.unscaleBy(p).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var u in this._tiles)if(!this._tiles[u].loaded)return!1;return!0}});function X2e(u){return new Rm(u)}var zu=Rm.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(u,p){this._url=u,p=y(this,p),p.detectRetina&&pt.retina&&p.maxZoom>0?(p.tileSize=Math.floor(p.tileSize/2),p.zoomReverse?(p.zoomOffset--,p.minZoom=Math.min(p.maxZoom,p.minZoom+1)):(p.zoomOffset++,p.maxZoom=Math.max(p.minZoom,p.maxZoom-1)),p.minZoom=Math.max(0,p.minZoom)):p.zoomReverse?p.minZoom=Math.min(p.maxZoom,p.minZoom):p.maxZoom=Math.max(p.minZoom,p.maxZoom),typeof p.subdomains=="string"&&(p.subdomains=p.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(u,p){return this._url===u&&p===void 0&&(p=!0),this._url=u,p||this.redraw(),this},createTile:function(u,p){var w=document.createElement("img");return Dt(w,"load",a(this._tileOnLoad,this,p,w)),Dt(w,"error",a(this._tileOnError,this,p,w)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(w.referrerPolicy=this.options.referrerPolicy),w.alt="",w.src=this.getTileUrl(u),w},getTileUrl:function(u){var p={r:pt.retina?"@2x":"",s:this._getSubdomain(u),x:u.x,y:u.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var w=this._globalTileRange.max.y-u.y;this.options.tms&&(p.y=w),p["-y"]=w}return M(this._url,r(p,this.options))},_tileOnLoad:function(u,p){pt.ielt9?setTimeout(a(u,this,null,p),0):u(null,p)},_tileOnError:function(u,p,w){var U=this.options.errorTileUrl;U&&p.getAttribute("src")!==U&&(p.src=U),u(w,p)},_onTileRemove:function(u){u.tile.onload=null},_getZoomForUrl:function(){var u=this._tileZoom,p=this.options.maxZoom,w=this.options.zoomReverse,U=this.options.zoomOffset;return w&&(u=p-u),u+U},_getSubdomain:function(u){var p=Math.abs(u.x+u.y)%this.options.subdomains.length;return this.options.subdomains[p]},_abortLoading:function(){var u,p;for(u in this._tiles)if(this._tiles[u].coords.z!==this._tileZoom&&(p=this._tiles[u].el,p.onload=h,p.onerror=h,!p.complete)){p.src=j;var w=this._tiles[u].coords;Cn(p),delete this._tiles[u],this.fire("tileabort",{tile:p,coords:w})}},_removeTile:function(u){var p=this._tiles[u];if(p)return p.el.setAttribute("src",j),Rm.prototype._removeTile.call(this,u)},_tileReady:function(u,p,w){if(!(!this._map||w&&w.getAttribute("src")===j))return Rm.prototype._tileReady.call(this,u,p,w)}});function BR(u,p){return new zu(u,p)}var NR=zu.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(u,p){this._url=u;var w=r({},this.defaultWmsParams);for(var U in p)U in this.options||(w[U]=p[U]);p=y(this,p);var Q=p.detectRetina&&pt.retina?2:1,de=this.getTileSize();w.width=de.x*Q,w.height=de.y*Q,this.wmsParams=w},onAdd:function(u){this._crs=this.options.crs||u.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var p=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[p]=this._crs.code,zu.prototype.onAdd.call(this,u)},getTileUrl:function(u){var p=this._tileCoordsToNwSe(u),w=this._crs,U=z(w.project(p[0]),w.project(p[1])),Q=U.min,de=U.max,Pe=(this._wmsVersion>=1.3&&this._crs===Dm?[Q.y,Q.x,de.y,de.x]:[Q.x,Q.y,de.x,de.y]).join(","),Le=zu.prototype.getTileUrl.call(this,u);return Le+A(this.wmsParams,Le,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+Pe},setParams:function(u,p){return r(this.wmsParams,u),p||this.redraw(),this}});function J2e(u,p){return new NR(u,p)}zu.WMS=NR,BR.wms=J2e;var ha=wr.extend({options:{padding:.1},initialize:function(u){y(this,u),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Lt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var u={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(u.zoomanim=this._onAnimZoom),u},_onAnimZoom:function(u){this._updateTransform(u.center,u.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(u,p){var w=this._map.getZoomScale(p,this._zoom),U=this._map.getSize().multiplyBy(.5+this.options.padding),Q=this._map.project(this._center,p),de=U.multiplyBy(-w).add(Q).subtract(this._map._getNewPixelOrigin(u,p));pt.any3d?fs(this._container,de,w):Hn(this._container,de)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var u in this._layers)this._layers[u]._reset()},_onZoomEnd:function(){for(var u in this._layers)this._layers[u]._project()},_updatePaths:function(){for(var u in this._layers)this._layers[u]._update()},_update:function(){var u=this.options.padding,p=this._map.getSize(),w=this._map.containerPointToLayerPoint(p.multiplyBy(-u)).round();this._bounds=new se(w,w.add(p.multiplyBy(1+u*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),DR=ha.extend({options:{tolerance:0},getEvents:function(){var u=ha.prototype.getEvents.call(this);return u.viewprereset=this._onViewPreReset,u},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ha.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var u=this._container=document.createElement("canvas");Dt(u,"mousemove",this._onMouseMove,this),Dt(u,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Dt(u,"mouseout",this._handleMouseOut,this),u._leaflet_disable_events=!0,this._ctx=u.getContext("2d")},_destroyContainer:function(){O(this._redrawRequest),delete this._ctx,Cn(this._container),_n(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var u;this._redrawBounds=null;for(var p in this._layers)u=this._layers[p],u._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ha.prototype._update.call(this);var u=this._bounds,p=this._container,w=u.getSize(),U=pt.retina?2:1;Hn(p,u.min),p.width=U*w.x,p.height=U*w.y,p.style.width=w.x+"px",p.style.height=w.y+"px",pt.retina&&this._ctx.scale(2,2),this._ctx.translate(-u.min.x,-u.min.y),this.fire("update")}},_reset:function(){ha.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(u){this._updateDashArray(u),this._layers[c(u)]=u;var p=u._order={layer:u,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=p),this._drawLast=p,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(u){this._requestRedraw(u)},_removePath:function(u){var p=u._order,w=p.next,U=p.prev;w?w.prev=U:this._drawLast=U,U?U.next=w:this._drawFirst=w,delete u._order,delete this._layers[c(u)],this._requestRedraw(u)},_updatePath:function(u){this._extendRedrawBounds(u),u._project(),u._update(),this._requestRedraw(u)},_updateStyle:function(u){this._updateDashArray(u),this._requestRedraw(u)},_updateDashArray:function(u){if(typeof u.options.dashArray=="string"){var p=u.options.dashArray.split(/[, ]+/),w=[],U,Q;for(Q=0;Q<p.length;Q++){if(U=Number(p[Q]),isNaN(U))return;w.push(U)}u.options._dashArray=w}else u.options._dashArray=u.options.dashArray},_requestRedraw:function(u){this._map&&(this._extendRedrawBounds(u),this._redrawRequest=this._redrawRequest||I(this._redraw,this))},_extendRedrawBounds:function(u){if(u._pxBounds){var p=(u.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new se,this._redrawBounds.extend(u._pxBounds.min.subtract([p,p])),this._redrawBounds.extend(u._pxBounds.max.add([p,p]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var u=this._redrawBounds;if(u){var p=u.getSize();this._ctx.clearRect(u.min.x,u.min.y,p.x,p.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var u,p=this._redrawBounds;if(this._ctx.save(),p){var w=p.getSize();this._ctx.beginPath(),this._ctx.rect(p.min.x,p.min.y,w.x,w.y),this._ctx.clip()}this._drawing=!0;for(var U=this._drawFirst;U;U=U.next)u=U.layer,(!p||u._pxBounds&&u._pxBounds.intersects(p))&&u._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(u,p){if(this._drawing){var w,U,Q,de,Pe=u._parts,Le=Pe.length,je=this._ctx;if(Le){for(je.beginPath(),w=0;w<Le;w++){for(U=0,Q=Pe[w].length;U<Q;U++)de=Pe[w][U],je[U?"lineTo":"moveTo"](de.x,de.y);p&&je.closePath()}this._fillStroke(je,u)}}},_updateCircle:function(u){if(!(!this._drawing||u._empty())){var p=u._point,w=this._ctx,U=Math.max(Math.round(u._radius),1),Q=(Math.max(Math.round(u._radiusY),1)||U)/U;Q!==1&&(w.save(),w.scale(1,Q)),w.beginPath(),w.arc(p.x,p.y/Q,U,0,Math.PI*2,!1),Q!==1&&w.restore(),this._fillStroke(w,u)}},_fillStroke:function(u,p){var w=p.options;w.fill&&(u.globalAlpha=w.fillOpacity,u.fillStyle=w.fillColor||w.color,u.fill(w.fillRule||"evenodd")),w.stroke&&w.weight!==0&&(u.setLineDash&&u.setLineDash(p.options&&p.options._dashArray||[]),u.globalAlpha=w.opacity,u.lineWidth=w.weight,u.strokeStyle=w.color,u.lineCap=w.lineCap,u.lineJoin=w.lineJoin,u.stroke())},_onClick:function(u){for(var p=this._map.mouseEventToLayerPoint(u),w,U,Q=this._drawFirst;Q;Q=Q.next)w=Q.layer,w.options.interactive&&w._containsPoint(p)&&(!(u.type==="click"||u.type==="preclick")||!this._map._draggableMoved(w))&&(U=w);this._fireEvent(U?[U]:!1,u)},_onMouseMove:function(u){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var p=this._map.mouseEventToLayerPoint(u);this._handleMouseHover(u,p)}},_handleMouseOut:function(u){var p=this._hoveredLayer;p&&(Wn(this._container,"leaflet-interactive"),this._fireEvent([p],u,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(u,p){if(!this._mouseHoverThrottled){for(var w,U,Q=this._drawFirst;Q;Q=Q.next)w=Q.layer,w.options.interactive&&w._containsPoint(p)&&(U=w);U!==this._hoveredLayer&&(this._handleMouseOut(u),U&&(Lt(this._container,"leaflet-interactive"),this._fireEvent([U],u,"mouseover"),this._hoveredLayer=U)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,u),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(u,p,w){this._map._fireDOMEvent(p,w||p.type,u)},_bringToFront:function(u){var p=u._order;if(p){var w=p.next,U=p.prev;if(w)w.prev=U;else return;U?U.next=w:w&&(this._drawFirst=w),p.prev=this._drawLast,this._drawLast.next=p,p.next=null,this._drawLast=p,this._requestRedraw(u)}},_bringToBack:function(u){var p=u._order;if(p){var w=p.next,U=p.prev;if(U)U.next=w;else return;w?w.prev=U:U&&(this._drawLast=U),p.prev=null,p.next=this._drawFirst,this._drawFirst.prev=p,this._drawFirst=p,this._requestRedraw(u)}}});function MR(u){return pt.canvas?new DR(u):null}var Im=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(u){return document.createElement("<lvml:"+u+' class="lvml">')}}catch{}return function(u){return document.createElement("<"+u+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Q2e={_initContainer:function(){this._container=an("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ha.prototype._update.call(this),this.fire("update"))},_initPath:function(u){var p=u._container=Im("shape");Lt(p,"leaflet-vml-shape "+(this.options.className||"")),p.coordsize="1 1",u._path=Im("path"),p.appendChild(u._path),this._updateStyle(u),this._layers[c(u)]=u},_addPath:function(u){var p=u._container;this._container.appendChild(p),u.options.interactive&&u.addInteractiveTarget(p)},_removePath:function(u){var p=u._container;Cn(p),u.removeInteractiveTarget(p),delete this._layers[c(u)]},_updateStyle:function(u){var p=u._stroke,w=u._fill,U=u.options,Q=u._container;Q.stroked=!!U.stroke,Q.filled=!!U.fill,U.stroke?(p||(p=u._stroke=Im("stroke")),Q.appendChild(p),p.weight=U.weight+"px",p.color=U.color,p.opacity=U.opacity,U.dashArray?p.dashStyle=B(U.dashArray)?U.dashArray.join(" "):U.dashArray.replace(/( *, *)/g," "):p.dashStyle="",p.endcap=U.lineCap.replace("butt","flat"),p.joinstyle=U.lineJoin):p&&(Q.removeChild(p),u._stroke=null),U.fill?(w||(w=u._fill=Im("fill")),Q.appendChild(w),w.color=U.fillColor||U.color,w.opacity=U.fillOpacity):w&&(Q.removeChild(w),u._fill=null)},_updateCircle:function(u){var p=u._point.round(),w=Math.round(u._radius),U=Math.round(u._radiusY||w);this._setPath(u,u._empty()?"M0 0":"AL "+p.x+","+p.y+" "+w+","+U+" 0,"+65535*360)},_setPath:function(u,p){u._path.v=p},_bringToFront:function(u){co(u._container)},_bringToBack:function(u){Di(u._container)}},lb=pt.vml?Im:J,Om=ha.extend({_initContainer:function(){this._container=lb("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=lb("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Cn(this._container),_n(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ha.prototype._update.call(this);var u=this._bounds,p=u.getSize(),w=this._container;(!this._svgSize||!this._svgSize.equals(p))&&(this._svgSize=p,w.setAttribute("width",p.x),w.setAttribute("height",p.y)),Hn(w,u.min),w.setAttribute("viewBox",[u.min.x,u.min.y,p.x,p.y].join(" ")),this.fire("update")}},_initPath:function(u){var p=u._path=lb("path");u.options.className&&Lt(p,u.options.className),u.options.interactive&&Lt(p,"leaflet-interactive"),this._updateStyle(u),this._layers[c(u)]=u},_addPath:function(u){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(u._path),u.addInteractiveTarget(u._path)},_removePath:function(u){Cn(u._path),u.removeInteractiveTarget(u._path),delete this._layers[c(u)]},_updatePath:function(u){u._project(),u._update()},_updateStyle:function(u){var p=u._path,w=u.options;p&&(w.stroke?(p.setAttribute("stroke",w.color),p.setAttribute("stroke-opacity",w.opacity),p.setAttribute("stroke-width",w.weight),p.setAttribute("stroke-linecap",w.lineCap),p.setAttribute("stroke-linejoin",w.lineJoin),w.dashArray?p.setAttribute("stroke-dasharray",w.dashArray):p.removeAttribute("stroke-dasharray"),w.dashOffset?p.setAttribute("stroke-dashoffset",w.dashOffset):p.removeAttribute("stroke-dashoffset")):p.setAttribute("stroke","none"),w.fill?(p.setAttribute("fill",w.fillColor||w.color),p.setAttribute("fill-opacity",w.fillOpacity),p.setAttribute("fill-rule",w.fillRule||"evenodd")):p.setAttribute("fill","none"))},_updatePoly:function(u,p){this._setPath(u,fe(u._parts,p))},_updateCircle:function(u){var p=u._point,w=Math.max(Math.round(u._radius),1),U=Math.max(Math.round(u._radiusY),1)||w,Q="a"+w+","+U+" 0 1,0 ",de=u._empty()?"M0 0":"M"+(p.x-w)+","+p.y+Q+w*2+",0 "+Q+-w*2+",0 ";this._setPath(u,de)},_setPath:function(u,p){u._path.setAttribute("d",p)},_bringToFront:function(u){co(u._path)},_bringToBack:function(u){Di(u._path)}});pt.vml&&Om.include(Q2e);function RR(u){return pt.svg||pt.vml?new Om(u):null}Rt.include({getRenderer:function(u){var p=u.options.renderer||this._getPaneRenderer(u.options.pane)||this.options.renderer||this._renderer;return p||(p=this._renderer=this._createRenderer()),this.hasLayer(p)||this.addLayer(p),p},_getPaneRenderer:function(u){if(u==="overlayPane"||u===void 0)return!1;var p=this._paneRenderers[u];return p===void 0&&(p=this._createRenderer({pane:u}),this._paneRenderers[u]=p),p},_createRenderer:function(u){return this.options.preferCanvas&&MR(u)||RR(u)}});var IR=_e.extend({initialize:function(u,p){_e.prototype.initialize.call(this,this._boundsToLatLngs(u),p)},setBounds:function(u){return this.setLatLngs(this._boundsToLatLngs(u))},_boundsToLatLngs:function(u){return u=ee(u),[u.getSouthWest(),u.getNorthWest(),u.getNorthEast(),u.getSouthEast()]}});function V2e(u,p){return new IR(u,p)}Om.create=lb,Om.pointsToPath=fe,qe.geometryToLayer=Qe,qe.coordsToLatLng=it,qe.coordsToLatLngs=Et,qe.latLngToCoords=Bt,qe.latLngsToCoords=qt,qe.getFeature=wt,qe.asFeature=Ft,Rt.mergeOptions({boxZoom:!0});var OR=uo.extend({initialize:function(u){this._map=u,this._container=u._container,this._pane=u._panes.overlayPane,this._resetStateTimeout=0,u.on("unload",this._destroy,this)},addHooks:function(){Dt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){_n(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Cn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(u){if(!u.shiftKey||u.which!==1&&u.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),la(),vr(),this._startPoint=this._map.mouseEventToContainerPoint(u),Dt(document,{contextmenu:ms,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(u){this._moved||(this._moved=!0,this._box=an("div","leaflet-zoom-box",this._container),Lt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(u);var p=new se(this._point,this._startPoint),w=p.getSize();Hn(this._box,p.min),this._box.style.width=w.x+"px",this._box.style.height=w.y+"px"},_finish:function(){this._moved&&(Cn(this._box),Wn(this._container,"leaflet-crosshair")),zc(),fl(),_n(document,{contextmenu:ms,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(u){if(!(u.which!==1&&u.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var p=new G(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(p).fire("boxzoomend",{boxZoomBounds:p})}},_onKeyDown:function(u){u.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Rt.addInitHook("addHandler","boxZoom",OR),Rt.mergeOptions({doubleClickZoom:!0});var LR=uo.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(u){var p=this._map,w=p.getZoom(),U=p.options.zoomDelta,Q=u.originalEvent.shiftKey?w-U:w+U;p.options.doubleClickZoom==="center"?p.setZoom(Q):p.setZoomAround(u.containerPoint,Q)}});Rt.addInitHook("addHandler","doubleClickZoom",LR),Rt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var FR=uo.extend({addHooks:function(){if(!this._draggable){var u=this._map;this._draggable=new ps(u._mapPane,u._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),u.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),u.on("zoomend",this._onZoomEnd,this),u.whenReady(this._onZoomEnd,this))}Lt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Wn(this._map._container,"leaflet-grab"),Wn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var u=this._map;if(u._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var p=ee(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(p.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(p.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;u.fire("movestart").fire("dragstart"),u.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(u){if(this._map.options.inertia){var p=this._lastTime=+new Date,w=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(w),this._times.push(p),this._prunePositions(p)}this._map.fire("move",u).fire("drag",u)},_prunePositions:function(u){for(;this._positions.length>1&&u-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var u=this._map.getSize().divideBy(2),p=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=p.subtract(u).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(u,p){return u-(u-p)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var u=this._draggable._newPos.subtract(this._draggable._startPos),p=this._offsetLimit;u.x<p.min.x&&(u.x=this._viscousLimit(u.x,p.min.x)),u.y<p.min.y&&(u.y=this._viscousLimit(u.y,p.min.y)),u.x>p.max.x&&(u.x=this._viscousLimit(u.x,p.max.x)),u.y>p.max.y&&(u.y=this._viscousLimit(u.y,p.max.y)),this._draggable._newPos=this._draggable._startPos.add(u)}},_onPreDragWrap:function(){var u=this._worldWidth,p=Math.round(u/2),w=this._initialWorldOffset,U=this._draggable._newPos.x,Q=(U-p+w)%u+p-w,de=(U+p+w)%u-p-w,Pe=Math.abs(Q+w)<Math.abs(de+w)?Q:de;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=Pe},_onDragEnd:function(u){var p=this._map,w=p.options,U=!w.inertia||u.noInertia||this._times.length<2;if(p.fire("dragend",u),U)p.fire("moveend");else{this._prunePositions(+new Date);var Q=this._lastPos.subtract(this._positions[0]),de=(this._lastTime-this._times[0])/1e3,Pe=w.easeLinearity,Le=Q.multiplyBy(Pe/de),je=Le.distanceTo([0,0]),Ze=Math.min(w.inertiaMaxSpeed,je),dt=Le.multiplyBy(Ze/je),At=Ze/(w.inertiaDeceleration*Pe),Yt=dt.multiplyBy(-At/2).round();!Yt.x&&!Yt.y?p.fire("moveend"):(Yt=p._limitOffset(Yt,p.options.maxBounds),I(function(){p.panBy(Yt,{duration:At,easeLinearity:Pe,noMoveStart:!0,animate:!0})}))}}});Rt.addInitHook("addHandler","dragging",FR),Rt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $R=uo.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(u){this._map=u,this._setPanDelta(u.options.keyboardPanDelta),this._setZoomDelta(u.options.zoomDelta)},addHooks:function(){var u=this._map._container;u.tabIndex<=0&&(u.tabIndex="0"),Dt(u,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),_n(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var u=document.body,p=document.documentElement,w=u.scrollTop||p.scrollTop,U=u.scrollLeft||p.scrollLeft;this._map._container.focus(),window.scrollTo(U,w)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(u){var p=this._panKeys={},w=this.keyCodes,U,Q;for(U=0,Q=w.left.length;U<Q;U++)p[w.left[U]]=[-1*u,0];for(U=0,Q=w.right.length;U<Q;U++)p[w.right[U]]=[u,0];for(U=0,Q=w.down.length;U<Q;U++)p[w.down[U]]=[0,u];for(U=0,Q=w.up.length;U<Q;U++)p[w.up[U]]=[0,-1*u]},_setZoomDelta:function(u){var p=this._zoomKeys={},w=this.keyCodes,U,Q;for(U=0,Q=w.zoomIn.length;U<Q;U++)p[w.zoomIn[U]]=u;for(U=0,Q=w.zoomOut.length;U<Q;U++)p[w.zoomOut[U]]=-u},_addHooks:function(){Dt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){_n(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(u){if(!(u.altKey||u.ctrlKey||u.metaKey)){var p=u.keyCode,w=this._map,U;if(p in this._panKeys){if(!w._panAnim||!w._panAnim._inProgress)if(U=this._panKeys[p],u.shiftKey&&(U=ce(U).multiplyBy(3)),w.options.maxBounds&&(U=w._limitOffset(ce(U),w.options.maxBounds)),w.options.worldCopyJump){var Q=w.wrapLatLng(w.unproject(w.project(w.getCenter()).add(U)));w.panTo(Q)}else w.panBy(U)}else if(p in this._zoomKeys)w.setZoom(w.getZoom()+(u.shiftKey?3:1)*this._zoomKeys[p]);else if(p===27&&w._popup&&w._popup.options.closeOnEscapeKey)w.closePopup();else return;ms(u)}}});Rt.addInitHook("addHandler","keyboard",$R),Rt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var zR=uo.extend({addHooks:function(){Dt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){_n(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(u){var p=jy(u),w=this._map.options.wheelDebounceTime;this._delta+=p,this._lastMousePos=this._map.mouseEventToContainerPoint(u),this._startTime||(this._startTime=+new Date);var U=Math.max(w-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),U),ms(u)},_performZoom:function(){var u=this._map,p=u.getZoom(),w=this._map.options.zoomSnap||0;u._stop();var U=this._delta/(this._map.options.wheelPxPerZoomLevel*4),Q=4*Math.log(2/(1+Math.exp(-Math.abs(U))))/Math.LN2,de=w?Math.ceil(Q/w)*w:Q,Pe=u._limitZoom(p+(this._delta>0?de:-de))-p;this._delta=0,this._startTime=null,Pe&&(u.options.scrollWheelZoom==="center"?u.setZoom(p+Pe):u.setZoomAround(this._lastMousePos,p+Pe))}});Rt.addInitHook("addHandler","scrollWheelZoom",zR);var eSe=600;Rt.mergeOptions({tapHold:pt.touchNative&&pt.safari&&pt.mobile,tapTolerance:15});var jR=uo.extend({addHooks:function(){Dt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){_n(this._map._container,"touchstart",this._onDown,this)},_onDown:function(u){if(clearTimeout(this._holdTimeout),u.touches.length===1){var p=u.touches[0];this._startPos=this._newPos=new re(p.clientX,p.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(Dt(document,"touchend",hi),Dt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",p))},this),eSe),Dt(document,"touchend touchcancel contextmenu",this._cancel,this),Dt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function u(){_n(document,"touchend",hi),_n(document,"touchend touchcancel",u)},_cancel:function(){clearTimeout(this._holdTimeout),_n(document,"touchend touchcancel contextmenu",this._cancel,this),_n(document,"touchmove",this._onMove,this)},_onMove:function(u){var p=u.touches[0];this._newPos=new re(p.clientX,p.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(u,p){var w=new MouseEvent(u,{bubbles:!0,cancelable:!0,view:window,screenX:p.screenX,screenY:p.screenY,clientX:p.clientX,clientY:p.clientY});w._simulated=!0,p.target.dispatchEvent(w)}});Rt.addInitHook("addHandler","tapHold",jR),Rt.mergeOptions({touchZoom:pt.touch,bounceAtZoomLimits:!0});var UR=uo.extend({addHooks:function(){Lt(this._map._container,"leaflet-touch-zoom"),Dt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Wn(this._map._container,"leaflet-touch-zoom"),_n(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(u){var p=this._map;if(!(!u.touches||u.touches.length!==2||p._animatingZoom||this._zooming)){var w=p.mouseEventToContainerPoint(u.touches[0]),U=p.mouseEventToContainerPoint(u.touches[1]);this._centerPoint=p.getSize()._divideBy(2),this._startLatLng=p.containerPointToLatLng(this._centerPoint),p.options.touchZoom!=="center"&&(this._pinchStartLatLng=p.containerPointToLatLng(w.add(U)._divideBy(2))),this._startDist=w.distanceTo(U),this._startZoom=p.getZoom(),this._moved=!1,this._zooming=!0,p._stop(),Dt(document,"touchmove",this._onTouchMove,this),Dt(document,"touchend touchcancel",this._onTouchEnd,this),hi(u)}},_onTouchMove:function(u){if(!(!u.touches||u.touches.length!==2||!this._zooming)){var p=this._map,w=p.mouseEventToContainerPoint(u.touches[0]),U=p.mouseEventToContainerPoint(u.touches[1]),Q=w.distanceTo(U)/this._startDist;if(this._zoom=p.getScaleZoom(Q,this._startZoom),!p.options.bounceAtZoomLimits&&(this._zoom<p.getMinZoom()&&Q<1||this._zoom>p.getMaxZoom()&&Q>1)&&(this._zoom=p._limitZoom(this._zoom)),p.options.touchZoom==="center"){if(this._center=this._startLatLng,Q===1)return}else{var de=w._add(U)._divideBy(2)._subtract(this._centerPoint);if(Q===1&&de.x===0&&de.y===0)return;this._center=p.unproject(p.project(this._pinchStartLatLng,this._zoom).subtract(de),this._zoom)}this._moved||(p._moveStart(!0,!1),this._moved=!0),O(this._animRequest);var Pe=a(p._move,p,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=I(Pe,this,!0),hi(u)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,O(this._animRequest),_n(document,"touchmove",this._onTouchMove,this),_n(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Rt.addInitHook("addHandler","touchZoom",UR),Rt.BoxZoom=OR,Rt.DoubleClickZoom=LR,Rt.Drag=FR,Rt.Keyboard=$R,Rt.ScrollWheelZoom=zR,Rt.TapHold=jR,Rt.TouchZoom=UR,n.Bounds=se,n.Browser=pt,n.CRS=F,n.Canvas=DR,n.Circle=me,n.CircleMarker=V,n.Class=X,n.Control=Or,n.DivIcon=PR,n.DivOverlay=Pn,n.DomEvent=R1,n.DomUtil=M1,n.Draggable=ps,n.Evented=te,n.FeatureGroup=fo,n.GeoJSON=qe,n.GridLayer=Rm,n.Handler=uo,n.Icon=fa,n.ImageOverlay=qn,n.LatLng=K,n.LatLngBounds=G,n.Layer=wr,n.LayerGroup=ua,n.LineUtil=da,n.Map=Rt,n.Marker=Yc,n.Mixin=L1,n.Path=H,n.Point=re,n.PolyUtil=F1,n.Polygon=_e,n.Polyline=ie,n.Popup=Lr,n.PosAnimation=Kc,n.Projection=eb,n.Rectangle=IR,n.Renderer=ha,n.SVG=Om,n.SVGOverlay=li,n.TileLayer=zu,n.Tooltip=ab,n.Transformation=S,n.Util=q,n.VideoOverlay=ut,n.bind=a,n.bounds=z,n.canvas=MR,n.circle=xe,n.circleMarker=le,n.control=hl,n.divIcon=Z2e,n.extend=r,n.featureGroup=rb,n.geoJSON=Mt,n.geoJson=Kt,n.gridLayer=X2e,n.icon=ob,n.imageOverlay=Ct,n.latLng=Y,n.latLngBounds=ee,n.layerGroup=ib,n.map=I1,n.marker=sb,n.point=ce,n.polygon=ze,n.polyline=he,n.popup=j1,n.rectangle=V2e,n.setOptions=y,n.stamp=c,n.svg=RR,n.svgOverlay=Kn,n.tileLayer=BR,n.tooltip=Y2e,n.transformation=T,n.version=i,n.videoOverlay=bi;var tSe=window.L;n.noConflict=function(){return window.L=tSe,this},window.L=n}))})(Ff,Ff.exports)),Ff.exports}var HG=WG();const rw=Xm(HG),qG={class:"flex flex-col gap-1 w-full relative"},KG={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer mb-1"},GG={class:"flex items-center justify-between mb-0.5"},YG={key:0,class:"text-sm font-medium text-gray-700 dark:text-gray-200"},ZG={key:0,class:"ml-1 text-destructive"},XG={key:0,class:"flex flex-col gap-2 mb-2 w-full relative"},JG={class:"flex flex-col sm:flex-row gap-2 w-full relative"},QG={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 h-10 flex items-center"},VG={key:0},eY={key:1},tY={key:2},nY={key:1,class:"flex-1 grid grid-cols-2 gap-2"},iY=["disabled"],rY=["disabled"],oY={class:"flex gap-2 flex-shrink-0"},sY={key:0,class:"absolute inset-0 z-[1001] bg-transparent cursor-not-allowed pointer-events-auto"},aY={key:1,class:"absolute bottom-2.5 left-2.5 z-[1000] bg-white/95 dark:bg-neutral-900/95 backdrop-blur-sm border border-gray-200 dark:border-neutral-800 rounded-md px-2.5 py-1 text-[11px] font-mono text-gray-700 dark:text-gray-300 shadow-md flex items-center gap-1.5 pointer-events-none select-none"},lY={key:1,class:"text-xs text-destructive mt-1"},kg=o.defineComponent({name:"DCodeMapField",inheritAttrs:!1,__name:"DCodeMapField",props:{modelValue:{},valueFormat:{default:"object-lat-lng"},label:{},placeholder:{default:"Cari alamat atau lokasi..."},disabled:{type:[Boolean,String],default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},height:{default:"320px"},zoom:{default:13},defaultLat:{default:-.9492},defaultLng:{default:100.42},enableSearch:{type:Boolean,default:!0},enableCurrentLocation:{type:Boolean,default:!0},enableManualInput:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,a=`app-map-container-${Math.random().toString(36).slice(2,7)}`,l=o.computed(()=>i.label??n.label),c=o.computed(()=>{const z=n.required,G=n["aria-required"];return z===""||z===!0||z==="true"||G==="true"||G===!0||i.required}),d=o.ref(!1),f=o.ref(!1),h=o.ref([]),m=o.ref(null),g=o.ref(""),v=o.ref(""),y=o.ref(""),A=o.ref(i.enableManualInput?"manual":"search");o.watch(()=>[i.enableSearch,i.enableManualInput],()=>{i.enableManualInput?A.value="manual":A.value="search"},{immediate:!0});let C=null,M=null,B=null,N=null;const j=z=>{if(!z)return null;if(typeof z=="object"){if(Array.isArray(z)){if(z.length>=2){const K=Number(z[0]),Y=Number(z[1]);if(!isNaN(K)&&!isNaN(Y))return i.valueFormat==="array-lng-lat"?{lat:Y,lng:K}:{lat:K,lng:Y}}return null}const G=Number(z.lat!==void 0?z.lat:z.latitude),ee=Number(z.lng!==void 0?z.lng:z.longitude);if(!isNaN(G)&&!isNaN(ee))return{lat:G,lng:ee}}else if(typeof z=="string"){const G=z.split(",").map(ee=>Number(ee.trim()));if(G.length>=2&&!isNaN(G[0])&&!isNaN(G[1]))return{lat:G[0],lng:G[1]}}return null},W=z=>{const G=Number(z.lat.toFixed(6)),ee=Number(z.lng.toFixed(6));switch(i.valueFormat){case"object-latitude-longitude":return{latitude:G,longitude:ee};case"array-lat-lng":return[G,ee];case"array-lng-lat":return[ee,G];case"string":return`${G},${ee}`;case"object-lat-lng":default:return{lat:G,lng:ee}}},P=o.ref(null);o.watch(()=>i.modelValue,z=>{const G=j(z);G?(!P.value||Math.abs(P.value.lat-G.lat)>1e-6||Math.abs(P.value.lng-G.lng)>1e-6)&&(P.value=G,v.value=G.lat.toFixed(6),y.value=G.lng.toFixed(6),X(G.lat,G.lng,!0)):(z==null||z==="")&&(P.value=null,v.value="",y.value="",m.value=null,M&&C&&(C.removeLayer(M),M=null))},{deep:!0,immediate:!0});const E=(z,G)=>{if(!C||!G)return;const ee=z?"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png",K=z?'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors &copy; <a href="https://carto.com/attributions">CARTO</a>':'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> &copy; <a href="https://carto.com/attributions">CARTO</a>';B&&C.removeLayer(B),B=G.tileLayer(ee,{attribution:K,maxZoom:20}).addTo(C)},k=z=>z.divIcon({className:"custom-map-marker-container",html:`
132
+ */var UG=Ff.exports,SS;function WG(){return SS||(SS=1,(function(e,t){(function(n,i){i(t)})(UG,(function(n){var i="1.9.4";function r(u){var p,w,U,Q;for(w=1,U=arguments.length;w<U;w++){Q=arguments[w];for(p in Q)u[p]=Q[p]}return u}var s=Object.create||(function(){function u(){}return function(p){return u.prototype=p,new u}})();function a(u,p){var w=Array.prototype.slice;if(u.bind)return u.bind.apply(u,w.call(arguments,1));var U=w.call(arguments,2);return function(){return u.apply(p,U.length?U.concat(w.call(arguments)):arguments)}}var l=0;function c(u){return"_leaflet_id"in u||(u._leaflet_id=++l),u._leaflet_id}function d(u,p,w){var U,Q,de,Pe;return Pe=function(){U=!1,Q&&(de.apply(w,Q),Q=!1)},de=function(){U?Q=arguments:(u.apply(w,arguments),setTimeout(Pe,p),U=!0)},de}function f(u,p,w){var U=p[1],Q=p[0],de=U-Q;return u===U&&w?u:((u-Q)%de+de)%de+Q}function h(){return!1}function m(u,p){if(p===!1)return u;var w=Math.pow(10,p===void 0?6:p);return Math.round(u*w)/w}function g(u){return u.trim?u.trim():u.replace(/^\s+|\s+$/g,"")}function v(u){return g(u).split(/\s+/)}function y(u,p){Object.prototype.hasOwnProperty.call(u,"options")||(u.options=u.options?s(u.options):{});for(var w in p)u.options[w]=p[w];return u.options}function A(u,p,w){var U=[];for(var Q in u)U.push(encodeURIComponent(w?Q.toUpperCase():Q)+"="+encodeURIComponent(u[Q]));return(!p||p.indexOf("?")===-1?"?":"&")+U.join("&")}var C=/\{ *([\w_ -]+) *\}/g;function M(u,p){return u.replace(C,function(w,U){var Q=p[U];if(Q===void 0)throw new Error("No value provided for variable "+w);return typeof Q=="function"&&(Q=Q(p)),Q})}var B=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"};function N(u,p){for(var w=0;w<u.length;w++)if(u[w]===p)return w;return-1}var j="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function W(u){return window["webkit"+u]||window["moz"+u]||window["ms"+u]}var P=0;function E(u){var p=+new Date,w=Math.max(0,16-(p-P));return P=p+w,window.setTimeout(u,w)}var k=window.requestAnimationFrame||W("RequestAnimationFrame")||E,$=window.cancelAnimationFrame||W("CancelAnimationFrame")||W("CancelRequestAnimationFrame")||function(u){window.clearTimeout(u)};function I(u,p,w){if(w&&k===E)u.call(p);else return k.call(window,a(u,p))}function O(u){u&&$.call(window,u)}var q={__proto__:null,extend:r,create:s,bind:a,get lastId(){return l},stamp:c,throttle:d,wrapNum:f,falseFn:h,formatNum:m,trim:g,splitWords:v,setOptions:y,getParamString:A,template:M,isArray:B,indexOf:N,emptyImageUrl:j,requestFn:k,cancelFn:$,requestAnimFrame:I,cancelAnimFrame:O};function X(){}X.extend=function(u){var p=function(){y(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},w=p.__super__=this.prototype,U=s(w);U.constructor=p,p.prototype=U;for(var Q in this)Object.prototype.hasOwnProperty.call(this,Q)&&Q!=="prototype"&&Q!=="__super__"&&(p[Q]=this[Q]);return u.statics&&r(p,u.statics),u.includes&&(oe(u.includes),r.apply(null,[U].concat(u.includes))),r(U,u),delete U.statics,delete U.includes,U.options&&(U.options=w.options?s(w.options):{},r(U.options,u.options)),U._initHooks=[],U.callInitHooks=function(){if(!this._initHooksCalled){w.callInitHooks&&w.callInitHooks.call(this),this._initHooksCalled=!0;for(var de=0,Pe=U._initHooks.length;de<Pe;de++)U._initHooks[de].call(this)}},p},X.include=function(u){var p=this.prototype.options;return r(this.prototype,u),u.options&&(this.prototype.options=p,this.mergeOptions(u.options)),this},X.mergeOptions=function(u){return r(this.prototype.options,u),this},X.addInitHook=function(u){var p=Array.prototype.slice.call(arguments,1),w=typeof u=="function"?u:function(){this[u].apply(this,p)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(w),this};function oe(u){if(!(typeof L>"u"||!L||!L.Mixin)){u=B(u)?u:[u];for(var p=0;p<u.length;p++)u[p]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var ue={on:function(u,p,w){if(typeof u=="object")for(var U in u)this._on(U,u[U],p);else{u=v(u);for(var Q=0,de=u.length;Q<de;Q++)this._on(u[Q],p,w)}return this},off:function(u,p,w){if(!arguments.length)delete this._events;else if(typeof u=="object")for(var U in u)this._off(U,u[U],p);else{u=v(u);for(var Q=arguments.length===1,de=0,Pe=u.length;de<Pe;de++)Q?this._off(u[de]):this._off(u[de],p,w)}return this},_on:function(u,p,w,U){if(typeof p!="function"){console.warn("wrong listener type: "+typeof p);return}if(this._listens(u,p,w)===!1){w===this&&(w=void 0);var Q={fn:p,ctx:w};U&&(Q.once=!0),this._events=this._events||{},this._events[u]=this._events[u]||[],this._events[u].push(Q)}},_off:function(u,p,w){var U,Q,de;if(this._events&&(U=this._events[u],!!U)){if(arguments.length===1){if(this._firingCount)for(Q=0,de=U.length;Q<de;Q++)U[Q].fn=h;delete this._events[u];return}if(typeof p!="function"){console.warn("wrong listener type: "+typeof p);return}var Pe=this._listens(u,p,w);if(Pe!==!1){var Le=U[Pe];this._firingCount&&(Le.fn=h,this._events[u]=U=U.slice()),U.splice(Pe,1)}}},fire:function(u,p,w){if(!this.listens(u,w))return this;var U=r({},p,{type:u,target:this,sourceTarget:p&&p.sourceTarget||this});if(this._events){var Q=this._events[u];if(Q){this._firingCount=this._firingCount+1||1;for(var de=0,Pe=Q.length;de<Pe;de++){var Le=Q[de],je=Le.fn;Le.once&&this.off(u,je,Le.ctx),je.call(Le.ctx||this,U)}this._firingCount--}}return w&&this._propagateEvent(U),this},listens:function(u,p,w,U){typeof u!="string"&&console.warn('"string" type argument expected');var Q=p;typeof p!="function"&&(U=!!p,Q=void 0,w=void 0);var de=this._events&&this._events[u];if(de&&de.length&&this._listens(u,Q,w)!==!1)return!0;if(U){for(var Pe in this._eventParents)if(this._eventParents[Pe].listens(u,p,w,U))return!0}return!1},_listens:function(u,p,w){if(!this._events)return!1;var U=this._events[u]||[];if(!p)return!!U.length;w===this&&(w=void 0);for(var Q=0,de=U.length;Q<de;Q++)if(U[Q].fn===p&&U[Q].ctx===w)return Q;return!1},once:function(u,p,w){if(typeof u=="object")for(var U in u)this._on(U,u[U],p,!0);else{u=v(u);for(var Q=0,de=u.length;Q<de;Q++)this._on(u[Q],p,w,!0)}return this},addEventParent:function(u){return this._eventParents=this._eventParents||{},this._eventParents[c(u)]=u,this},removeEventParent:function(u){return this._eventParents&&delete this._eventParents[c(u)],this},_propagateEvent:function(u){for(var p in this._eventParents)this._eventParents[p].fire(u.type,r({layer:u.target,propagatedFrom:u.target},u),!0)}};ue.addEventListener=ue.on,ue.removeEventListener=ue.clearAllEventListeners=ue.off,ue.addOneTimeEventListener=ue.once,ue.fireEvent=ue.fire,ue.hasEventListeners=ue.listens;var te=X.extend(ue);function re(u,p,w){this.x=w?Math.round(u):u,this.y=w?Math.round(p):p}var ge=Math.trunc||function(u){return u>0?Math.floor(u):Math.ceil(u)};re.prototype={clone:function(){return new re(this.x,this.y)},add:function(u){return this.clone()._add(ce(u))},_add:function(u){return this.x+=u.x,this.y+=u.y,this},subtract:function(u){return this.clone()._subtract(ce(u))},_subtract:function(u){return this.x-=u.x,this.y-=u.y,this},divideBy:function(u){return this.clone()._divideBy(u)},_divideBy:function(u){return this.x/=u,this.y/=u,this},multiplyBy:function(u){return this.clone()._multiplyBy(u)},_multiplyBy:function(u){return this.x*=u,this.y*=u,this},scaleBy:function(u){return new re(this.x*u.x,this.y*u.y)},unscaleBy:function(u){return new re(this.x/u.x,this.y/u.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ge(this.x),this.y=ge(this.y),this},distanceTo:function(u){u=ce(u);var p=u.x-this.x,w=u.y-this.y;return Math.sqrt(p*p+w*w)},equals:function(u){return u=ce(u),u.x===this.x&&u.y===this.y},contains:function(u){return u=ce(u),Math.abs(u.x)<=Math.abs(this.x)&&Math.abs(u.y)<=Math.abs(this.y)},toString:function(){return"Point("+m(this.x)+", "+m(this.y)+")"}};function ce(u,p,w){return u instanceof re?u:B(u)?new re(u[0],u[1]):u==null?u:typeof u=="object"&&"x"in u&&"y"in u?new re(u.x,u.y):new re(u,p,w)}function se(u,p){if(u)for(var w=p?[u,p]:u,U=0,Q=w.length;U<Q;U++)this.extend(w[U])}se.prototype={extend:function(u){var p,w;if(!u)return this;if(u instanceof re||typeof u[0]=="number"||"x"in u)p=w=ce(u);else if(u=z(u),p=u.min,w=u.max,!p||!w)return this;return!this.min&&!this.max?(this.min=p.clone(),this.max=w.clone()):(this.min.x=Math.min(p.x,this.min.x),this.max.x=Math.max(w.x,this.max.x),this.min.y=Math.min(p.y,this.min.y),this.max.y=Math.max(w.y,this.max.y)),this},getCenter:function(u){return ce((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,u)},getBottomLeft:function(){return ce(this.min.x,this.max.y)},getTopRight:function(){return ce(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(u){var p,w;return typeof u[0]=="number"||u instanceof re?u=ce(u):u=z(u),u instanceof se?(p=u.min,w=u.max):p=w=u,p.x>=this.min.x&&w.x<=this.max.x&&p.y>=this.min.y&&w.y<=this.max.y},intersects:function(u){u=z(u);var p=this.min,w=this.max,U=u.min,Q=u.max,de=Q.x>=p.x&&U.x<=w.x,Pe=Q.y>=p.y&&U.y<=w.y;return de&&Pe},overlaps:function(u){u=z(u);var p=this.min,w=this.max,U=u.min,Q=u.max,de=Q.x>p.x&&U.x<w.x,Pe=Q.y>p.y&&U.y<w.y;return de&&Pe},isValid:function(){return!!(this.min&&this.max)},pad:function(u){var p=this.min,w=this.max,U=Math.abs(p.x-w.x)*u,Q=Math.abs(p.y-w.y)*u;return z(ce(p.x-U,p.y-Q),ce(w.x+U,w.y+Q))},equals:function(u){return u?(u=z(u),this.min.equals(u.getTopLeft())&&this.max.equals(u.getBottomRight())):!1}};function z(u,p){return!u||u instanceof se?u:new se(u,p)}function G(u,p){if(u)for(var w=p?[u,p]:u,U=0,Q=w.length;U<Q;U++)this.extend(w[U])}G.prototype={extend:function(u){var p=this._southWest,w=this._northEast,U,Q;if(u instanceof K)U=u,Q=u;else if(u instanceof G){if(U=u._southWest,Q=u._northEast,!U||!Q)return this}else return u?this.extend(Y(u)||ee(u)):this;return!p&&!w?(this._southWest=new K(U.lat,U.lng),this._northEast=new K(Q.lat,Q.lng)):(p.lat=Math.min(U.lat,p.lat),p.lng=Math.min(U.lng,p.lng),w.lat=Math.max(Q.lat,w.lat),w.lng=Math.max(Q.lng,w.lng)),this},pad:function(u){var p=this._southWest,w=this._northEast,U=Math.abs(p.lat-w.lat)*u,Q=Math.abs(p.lng-w.lng)*u;return new G(new K(p.lat-U,p.lng-Q),new K(w.lat+U,w.lng+Q))},getCenter:function(){return new K((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new K(this.getNorth(),this.getWest())},getSouthEast:function(){return new K(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(u){typeof u[0]=="number"||u instanceof K||"lat"in u?u=Y(u):u=ee(u);var p=this._southWest,w=this._northEast,U,Q;return u instanceof G?(U=u.getSouthWest(),Q=u.getNorthEast()):U=Q=u,U.lat>=p.lat&&Q.lat<=w.lat&&U.lng>=p.lng&&Q.lng<=w.lng},intersects:function(u){u=ee(u);var p=this._southWest,w=this._northEast,U=u.getSouthWest(),Q=u.getNorthEast(),de=Q.lat>=p.lat&&U.lat<=w.lat,Pe=Q.lng>=p.lng&&U.lng<=w.lng;return de&&Pe},overlaps:function(u){u=ee(u);var p=this._southWest,w=this._northEast,U=u.getSouthWest(),Q=u.getNorthEast(),de=Q.lat>p.lat&&U.lat<w.lat,Pe=Q.lng>p.lng&&U.lng<w.lng;return de&&Pe},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(u,p){return u?(u=ee(u),this._southWest.equals(u.getSouthWest(),p)&&this._northEast.equals(u.getNorthEast(),p)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function ee(u,p){return u instanceof G?u:new G(u,p)}function K(u,p,w){if(isNaN(u)||isNaN(p))throw new Error("Invalid LatLng object: ("+u+", "+p+")");this.lat=+u,this.lng=+p,w!==void 0&&(this.alt=+w)}K.prototype={equals:function(u,p){if(!u)return!1;u=Y(u);var w=Math.max(Math.abs(this.lat-u.lat),Math.abs(this.lng-u.lng));return w<=(p===void 0?1e-9:p)},toString:function(u){return"LatLng("+m(this.lat,u)+", "+m(this.lng,u)+")"},distanceTo:function(u){return _.distance(this,Y(u))},wrap:function(){return _.wrapLatLng(this)},toBounds:function(u){var p=180*u/40075017,w=p/Math.cos(Math.PI/180*this.lat);return ee([this.lat-p,this.lng-w],[this.lat+p,this.lng+w])},clone:function(){return new K(this.lat,this.lng,this.alt)}};function Y(u,p,w){return u instanceof K?u:B(u)&&typeof u[0]!="object"?u.length===3?new K(u[0],u[1],u[2]):u.length===2?new K(u[0],u[1]):null:u==null?u:typeof u=="object"&&"lat"in u?new K(u.lat,"lng"in u?u.lng:u.lon,u.alt):p===void 0?null:new K(u,p,w)}var F={latLngToPoint:function(u,p){var w=this.projection.project(u),U=this.scale(p);return this.transformation._transform(w,U)},pointToLatLng:function(u,p){var w=this.scale(p),U=this.transformation.untransform(u,w);return this.projection.unproject(U)},project:function(u){return this.projection.project(u)},unproject:function(u){return this.projection.unproject(u)},scale:function(u){return 256*Math.pow(2,u)},zoom:function(u){return Math.log(u/256)/Math.LN2},getProjectedBounds:function(u){if(this.infinite)return null;var p=this.projection.bounds,w=this.scale(u),U=this.transformation.transform(p.min,w),Q=this.transformation.transform(p.max,w);return new se(U,Q)},infinite:!1,wrapLatLng:function(u){var p=this.wrapLng?f(u.lng,this.wrapLng,!0):u.lng,w=this.wrapLat?f(u.lat,this.wrapLat,!0):u.lat,U=u.alt;return new K(w,p,U)},wrapLatLngBounds:function(u){var p=u.getCenter(),w=this.wrapLatLng(p),U=p.lat-w.lat,Q=p.lng-w.lng;if(U===0&&Q===0)return u;var de=u.getSouthWest(),Pe=u.getNorthEast(),Le=new K(de.lat-U,de.lng-Q),je=new K(Pe.lat-U,Pe.lng-Q);return new G(Le,je)}},_=r({},F,{wrapLng:[-180,180],R:6371e3,distance:function(u,p){var w=Math.PI/180,U=u.lat*w,Q=p.lat*w,de=Math.sin((p.lat-u.lat)*w/2),Pe=Math.sin((p.lng-u.lng)*w/2),Le=de*de+Math.cos(U)*Math.cos(Q)*Pe*Pe,je=2*Math.atan2(Math.sqrt(Le),Math.sqrt(1-Le));return this.R*je}}),b=6378137,R={R:b,MAX_LATITUDE:85.0511287798,project:function(u){var p=Math.PI/180,w=this.MAX_LATITUDE,U=Math.max(Math.min(w,u.lat),-w),Q=Math.sin(U*p);return new re(this.R*u.lng*p,this.R*Math.log((1+Q)/(1-Q))/2)},unproject:function(u){var p=180/Math.PI;return new K((2*Math.atan(Math.exp(u.y/this.R))-Math.PI/2)*p,u.x*p/this.R)},bounds:(function(){var u=b*Math.PI;return new se([-u,-u],[u,u])})()};function S(u,p,w,U){if(B(u)){this._a=u[0],this._b=u[1],this._c=u[2],this._d=u[3];return}this._a=u,this._b=p,this._c=w,this._d=U}S.prototype={transform:function(u,p){return this._transform(u.clone(),p)},_transform:function(u,p){return p=p||1,u.x=p*(this._a*u.x+this._b),u.y=p*(this._c*u.y+this._d),u},untransform:function(u,p){return p=p||1,new re((u.x/p-this._b)/this._a,(u.y/p-this._d)/this._c)}};function T(u,p,w,U){return new S(u,p,w,U)}var D=r({},_,{code:"EPSG:3857",projection:R,transformation:(function(){var u=.5/(Math.PI*R.R);return T(u,.5,-u,.5)})()}),Z=r({},D,{code:"EPSG:900913"});function J(u){return document.createElementNS("http://www.w3.org/2000/svg",u)}function fe(u,p){var w="",U,Q,de,Pe,Le,je;for(U=0,de=u.length;U<de;U++){for(Le=u[U],Q=0,Pe=Le.length;Q<Pe;Q++)je=Le[Q],w+=(Q?"L":"M")+je.x+" "+je.y;w+=p?pt.svg?"z":"x":""}return w||"M0 0"}var ae=document.documentElement.style,we="ActiveXObject"in window,pe=we&&!document.addEventListener,ke="msLaunchUri"in navigator&&!("documentMode"in document),be=ki("webkit"),Se=ki("android"),ve=ki("android 2")||ki("android 3"),Be=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),Ee=Se&&ki("Google")&&Be<537&&!("AudioNode"in window),Oe=!!window.opera,Ae=!ke&&ki("chrome"),Re=ki("gecko")&&!be&&!Oe&&!we,De=!Ae&&ki("safari"),Ie=ki("phantom"),Ce="OTransition"in ae,ne=navigator.platform.indexOf("Win")===0,ye=we&&"transition"in ae,Me="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ve,Ke="MozPerspective"in ae,$e=!window.L_DISABLE_3D&&(ye||Me||Ke)&&!Ce&&!Ie,He=typeof orientation<"u"||ki("mobile"),rt=He&&be,Ve=He&&Me,Fe=!window.PointerEvent&&window.MSPointerEvent,Ue=!!(window.PointerEvent||Fe),at="ontouchstart"in window||!!window.TouchEvent,nt=!window.L_NO_TOUCH&&(at||Ue),Tt=He&&Oe,fi=He&&Re,hn=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Jt=(function(){var u=!1;try{var p=Object.defineProperty({},"passive",{get:function(){u=!0}});window.addEventListener("testPassiveEventSupport",h,p),window.removeEventListener("testPassiveEventSupport",h,p)}catch{}return u})(),cn=(function(){return!!document.createElement("canvas").getContext})(),vn=!!(document.createElementNS&&J("svg").createSVGRect),gr=!!vn&&(function(){var u=document.createElement("div");return u.innerHTML="<svg/>",(u.firstChild&&u.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Do=!vn&&(function(){try{var u=document.createElement("div");u.innerHTML='<v:shape adj="1"/>';var p=u.firstChild;return p.style.behavior="url(#default#VML)",p&&typeof p.adj=="object"}catch{return!1}})(),Bi=navigator.platform.indexOf("Mac")===0,Ic=navigator.platform.indexOf("Linux")===0;function ki(u){return navigator.userAgent.toLowerCase().indexOf(u)>=0}var pt={ie:we,ielt9:pe,edge:ke,webkit:be,android:Se,android23:ve,androidStock:Ee,opera:Oe,chrome:Ae,gecko:Re,safari:De,phantom:Ie,opera12:Ce,win:ne,ie3d:ye,webkit3d:Me,gecko3d:Ke,any3d:$e,mobile:He,mobileWebkit:rt,mobileWebkit3d:Ve,msPointer:Fe,pointer:Ue,touch:nt,touchNative:at,mobileOpera:Tt,mobileGecko:fi,retina:hn,passiveEvents:Jt,canvas:cn,svg:vn,vml:Do,inlineSvg:gr,mac:Bi,linux:Ic},yr=pt.msPointer?"MSPointerDown":"pointerdown",Tu=pt.msPointer?"MSPointerMove":"pointermove",ai=pt.msPointer?"MSPointerUp":"pointerup",cl=pt.msPointer?"MSPointerCancel":"pointercancel",ym={touchstart:yr,touchmove:Tu,touchend:ai,touchcancel:cl},Mo={touchstart:Oc,touchmove:Nu,touchend:Nu,touchcancel:Nu},sa={},Pu=!1;function Bu(u,p,w){return p==="touchstart"&&B1(),Mo[p]?(w=Mo[p].bind(this,w),u.addEventListener(ym[p],w,!1),w):(console.warn("wrong event specified:",p),h)}function Fy(u,p,w){if(!ym[p]){console.warn("wrong event specified:",p);return}u.removeEventListener(ym[p],w,!1)}function T1(u){sa[u.pointerId]=u}function P1(u){sa[u.pointerId]&&(sa[u.pointerId]=u)}function $y(u){delete sa[u.pointerId]}function B1(){Pu||(document.addEventListener(yr,T1,!0),document.addEventListener(Tu,P1,!0),document.addEventListener(ai,$y,!0),document.addEventListener(cl,$y,!0),Pu=!0)}function Nu(u,p){if(p.pointerType!==(p.MSPOINTER_TYPE_MOUSE||"mouse")){p.touches=[];for(var w in sa)p.touches.push(sa[w]);p.changedTouches=[p],u(p)}}function Oc(u,p){p.MSPOINTER_TYPE_TOUCH&&p.pointerType===p.MSPOINTER_TYPE_TOUCH&&hi(p),Nu(u,p)}function On(u){var p={},w,U;for(U in u)w=u[U],p[U]=w&&w.bind?w.bind(u):w;return u=p,p.type="dblclick",p.detail=2,p.isTrusted=!1,p._simulated=!0,p}var Du=200;function N1(u,p){u.addEventListener("dblclick",p);var w=0,U;function Q(de){if(de.detail!==1){U=de.detail;return}if(!(de.pointerType==="mouse"||de.sourceCapabilities&&!de.sourceCapabilities.firesTouchEvents)){var Pe=km(de);if(!(Pe.some(function(je){return je instanceof HTMLLabelElement&&je.attributes.for})&&!Pe.some(function(je){return je instanceof HTMLInputElement||je instanceof HTMLSelectElement}))){var Le=Date.now();Le-w<=Du?(U++,U===2&&p(On(de))):U=1,w=Le}}}return u.addEventListener("click",Q),{dblclick:p,simDblclick:Q}}function D1(u,p){u.removeEventListener("dblclick",p.dblclick),u.removeEventListener("click",p.simDblclick)}var dl=$c(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),aa=$c(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),lo=aa==="webkitTransition"||aa==="OTransition"?aa+"End":"transitionend";function Lc(u){return typeof u=="string"?document.getElementById(u):u}function ul(u,p){var w=u.style[p]||u.currentStyle&&u.currentStyle[p];if((!w||w==="auto")&&document.defaultView){var U=document.defaultView.getComputedStyle(u,null);w=U?U[p]:null}return w==="auto"?null:w}function an(u,p,w){var U=document.createElement(u);return U.className=p||"",w&&w.appendChild(U),U}function Cn(u){var p=u.parentNode;p&&p.removeChild(u)}function Ni(u){for(;u.firstChild;)u.removeChild(u.firstChild)}function co(u){var p=u.parentNode;p&&p.lastChild!==u&&p.appendChild(u)}function Di(u){var p=u.parentNode;p&&p.firstChild!==u&&p.insertBefore(u,p.firstChild)}function Dn(u,p){if(u.classList!==void 0)return u.classList.contains(p);var w=Mu(u);return w.length>0&&new RegExp("(^|\\s)"+p+"(\\s|$)").test(w)}function Lt(u,p){if(u.classList!==void 0)for(var w=v(p),U=0,Q=w.length;U<Q;U++)u.classList.add(w[U]);else if(!Dn(u,p)){var de=Mu(u);Fc(u,(de?de+" ":"")+p)}}function Wn(u,p){u.classList!==void 0?u.classList.remove(p):Fc(u,g((" "+Mu(u)+" ").replace(" "+p+" "," ")))}function Fc(u,p){u.className.baseVal===void 0?u.className=p:u.className.baseVal=p}function Mu(u){return u.correspondingElement&&(u=u.correspondingElement),u.className.baseVal===void 0?u.className:u.className.baseVal}function br(u,p){"opacity"in u.style?u.style.opacity=p:"filter"in u.style&&zy(u,p)}function zy(u,p){var w=!1,U="DXImageTransform.Microsoft.Alpha";try{w=u.filters.item(U)}catch{if(p===1)return}p=Math.round(p*100),w?(w.Enabled=p!==100,w.Opacity=p):u.style.filter+=" progid:"+U+"(opacity="+p+")"}function $c(u){for(var p=document.documentElement.style,w=0;w<u.length;w++)if(u[w]in p)return u[w];return!1}function fs(u,p,w){var U=p||new re(0,0);u.style[dl]=(pt.ie3d?"translate("+U.x+"px,"+U.y+"px)":"translate3d("+U.x+"px,"+U.y+"px,0)")+(w?" scale("+w+")":"")}function Hn(u,p){u._leaflet_pos=p,pt.any3d?fs(u,p):(u.style.left=p.x+"px",u.style.top=p.y+"px")}function Ro(u){return u._leaflet_pos||new re(0,0)}var la,zc,bm;if("onselectstart"in document)la=function(){Dt(window,"selectstart",hi)},zc=function(){_n(window,"selectstart",hi)};else{var jc=$c(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);la=function(){if(jc){var u=document.documentElement.style;bm=u[jc],u[jc]="none"}},zc=function(){jc&&(document.documentElement.style[jc]=bm,bm=void 0)}}function vr(){Dt(window,"dragstart",hi)}function fl(){_n(window,"dragstart",hi)}var Ru,vm;function Qt(u){for(;u.tabIndex===-1;)u=u.parentNode;u.style&&(Iu(),Ru=u,vm=u.style.outlineStyle,u.style.outlineStyle="none",Dt(window,"keydown",Iu))}function Iu(){Ru&&(Ru.style.outlineStyle=vm,Ru=void 0,vm=void 0,_n(window,"keydown",Iu))}function Uc(u){do u=u.parentNode;while((!u.offsetWidth||!u.offsetHeight)&&u!==document.body);return u}function Ou(u){var p=u.getBoundingClientRect();return{x:p.width/u.offsetWidth||1,y:p.height/u.offsetHeight||1,boundingClientRect:p}}var M1={__proto__:null,TRANSFORM:dl,TRANSITION:aa,TRANSITION_END:lo,get:Lc,getStyle:ul,create:an,remove:Cn,empty:Ni,toFront:co,toBack:Di,hasClass:Dn,addClass:Lt,removeClass:Wn,setClass:Fc,getClass:Mu,setOpacity:br,testProp:$c,setTransform:fs,setPosition:Hn,getPosition:Ro,get disableTextSelection(){return la},get enableTextSelection(){return zc},disableImageDrag:vr,enableImageDrag:fl,preventOutline:Qt,restoreOutline:Iu,getSizedParentNode:Uc,getScale:Ou};function Dt(u,p,w,U){if(p&&typeof p=="object")for(var Q in p)_m(u,Q,p[Q],w);else{p=v(p);for(var de=0,Pe=p.length;de<Pe;de++)_m(u,p[de],w,U)}return this}var Ir="_leaflet_events";function _n(u,p,w,U){if(arguments.length===1)wm(u),delete u[Ir];else if(p&&typeof p=="object")for(var Q in p)Hc(u,Q,p[Q],w);else if(p=v(p),arguments.length===2)wm(u,function(Le){return N(p,Le)!==-1});else for(var de=0,Pe=p.length;de<Pe;de++)Hc(u,p[de],w,U);return this}function wm(u,p){for(var w in u[Ir]){var U=w.split(/\d/)[0];(!p||p(U))&&Hc(u,U,null,null,w)}}var Wc={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function _m(u,p,w,U){var Q=p+c(w)+(U?"_"+c(U):"");if(u[Ir]&&u[Ir][Q])return this;var de=function(Le){return w.call(U||u,Le||window.event)},Pe=de;!pt.touchNative&&pt.pointer&&p.indexOf("touch")===0?de=Bu(u,p,de):pt.touch&&p==="dblclick"?de=N1(u,de):"addEventListener"in u?p==="touchstart"||p==="touchmove"||p==="wheel"||p==="mousewheel"?u.addEventListener(Wc[p]||p,de,pt.passiveEvents?{passive:!1}:!1):p==="mouseenter"||p==="mouseleave"?(de=function(Le){Le=Le||window.event,Cm(u,Le)&&Pe(Le)},u.addEventListener(Wc[p],de,!1)):u.addEventListener(p,Pe,!1):u.attachEvent("on"+p,de),u[Ir]=u[Ir]||{},u[Ir][Q]=de}function Hc(u,p,w,U,Q){Q=Q||p+c(w)+(U?"_"+c(U):"");var de=u[Ir]&&u[Ir][Q];if(!de)return this;!pt.touchNative&&pt.pointer&&p.indexOf("touch")===0?Fy(u,p,de):pt.touch&&p==="dblclick"?D1(u,de):"removeEventListener"in u?u.removeEventListener(Wc[p]||p,de,!1):u.detachEvent("on"+p,de),u[Ir][Q]=null}function hs(u){return u.stopPropagation?u.stopPropagation():u.originalEvent?u.originalEvent._stopped=!0:u.cancelBubble=!0,this}function ei(u){return _m(u,"wheel",hs),this}function qc(u){return Dt(u,"mousedown touchstart dblclick contextmenu",hs),u._leaflet_disable_click=!0,this}function hi(u){return u.preventDefault?u.preventDefault():u.returnValue=!1,this}function ms(u){return hi(u),hs(u),this}function km(u){if(u.composedPath)return u.composedPath();for(var p=[],w=u.target;w;)p.push(w),w=w.parentNode;return p}function xm(u,p){if(!p)return new re(u.clientX,u.clientY);var w=Ou(p),U=w.boundingClientRect;return new re((u.clientX-U.left)/w.x-p.clientLeft,(u.clientY-U.top)/w.y-p.clientTop)}var Em=pt.linux&&pt.chrome?window.devicePixelRatio:pt.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function jy(u){return pt.edge?u.wheelDeltaY/2:u.deltaY&&u.deltaMode===0?-u.deltaY/Em:u.deltaY&&u.deltaMode===1?-u.deltaY*20:u.deltaY&&u.deltaMode===2?-u.deltaY*60:u.deltaX||u.deltaZ?0:u.wheelDelta?(u.wheelDeltaY||u.wheelDelta)/2:u.detail&&Math.abs(u.detail)<32765?-u.detail*20:u.detail?u.detail/-32765*60:0}function Cm(u,p){var w=p.relatedTarget;if(!w)return!0;try{for(;w&&w!==u;)w=w.parentNode}catch{return!1}return w!==u}var R1={__proto__:null,on:Dt,off:_n,stopPropagation:hs,disableScrollPropagation:ei,disableClickPropagation:qc,preventDefault:hi,stop:ms,getPropagationPath:km,getMousePosition:xm,getWheelDelta:jy,isExternalTarget:Cm,addListener:Dt,removeListener:_n},Kc=te.extend({run:function(u,p,w,U){this.stop(),this._el=u,this._inProgress=!0,this._duration=w||.25,this._easeOutPower=1/Math.max(U||.5,.2),this._startPos=Ro(u),this._offset=p.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=I(this._animate,this),this._step()},_step:function(u){var p=+new Date-this._startTime,w=this._duration*1e3;p<w?this._runFrame(this._easeOut(p/w),u):(this._runFrame(1),this._complete())},_runFrame:function(u,p){var w=this._startPos.add(this._offset.multiplyBy(u));p&&w._round(),Hn(this._el,w),this.fire("step")},_complete:function(){O(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(u){return 1-Math.pow(1-u,this._easeOutPower)}}),Rt=te.extend({options:{crs:D,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(u,p){p=y(this,p),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(u),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),p.maxBounds&&this.setMaxBounds(p.maxBounds),p.zoom!==void 0&&(this._zoom=this._limitZoom(p.zoom)),p.center&&p.zoom!==void 0&&this.setView(Y(p.center),p.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=aa&&pt.any3d&&!pt.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Dt(this._proxy,lo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(u,p,w){if(p=p===void 0?this._zoom:this._limitZoom(p),u=this._limitCenter(Y(u),p,this.options.maxBounds),w=w||{},this._stop(),this._loaded&&!w.reset&&w!==!0){w.animate!==void 0&&(w.zoom=r({animate:w.animate},w.zoom),w.pan=r({animate:w.animate,duration:w.duration},w.pan));var U=this._zoom!==p?this._tryAnimatedZoom&&this._tryAnimatedZoom(u,p,w.zoom):this._tryAnimatedPan(u,w.pan);if(U)return clearTimeout(this._sizeTimer),this}return this._resetView(u,p,w.pan&&w.pan.noMoveStart),this},setZoom:function(u,p){return this._loaded?this.setView(this.getCenter(),u,{zoom:p}):(this._zoom=u,this)},zoomIn:function(u,p){return u=u||(pt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+u,p)},zoomOut:function(u,p){return u=u||(pt.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-u,p)},setZoomAround:function(u,p,w){var U=this.getZoomScale(p),Q=this.getSize().divideBy(2),de=u instanceof re?u:this.latLngToContainerPoint(u),Pe=de.subtract(Q).multiplyBy(1-1/U),Le=this.containerPointToLatLng(Q.add(Pe));return this.setView(Le,p,{zoom:w})},_getBoundsCenterZoom:function(u,p){p=p||{},u=u.getBounds?u.getBounds():ee(u);var w=ce(p.paddingTopLeft||p.padding||[0,0]),U=ce(p.paddingBottomRight||p.padding||[0,0]),Q=this.getBoundsZoom(u,!1,w.add(U));if(Q=typeof p.maxZoom=="number"?Math.min(p.maxZoom,Q):Q,Q===1/0)return{center:u.getCenter(),zoom:Q};var de=U.subtract(w).divideBy(2),Pe=this.project(u.getSouthWest(),Q),Le=this.project(u.getNorthEast(),Q),je=this.unproject(Pe.add(Le).divideBy(2).add(de),Q);return{center:je,zoom:Q}},fitBounds:function(u,p){if(u=ee(u),!u.isValid())throw new Error("Bounds are not valid.");var w=this._getBoundsCenterZoom(u,p);return this.setView(w.center,w.zoom,p)},fitWorld:function(u){return this.fitBounds([[-90,-180],[90,180]],u)},panTo:function(u,p){return this.setView(u,this._zoom,{pan:p})},panBy:function(u,p){if(u=ce(u).round(),p=p||{},!u.x&&!u.y)return this.fire("moveend");if(p.animate!==!0&&!this.getSize().contains(u))return this._resetView(this.unproject(this.project(this.getCenter()).add(u)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Kc,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),p.noMoveStart||this.fire("movestart"),p.animate!==!1){Lt(this._mapPane,"leaflet-pan-anim");var w=this._getMapPanePos().subtract(u).round();this._panAnim.run(this._mapPane,w,p.duration||.25,p.easeLinearity)}else this._rawPanBy(u),this.fire("move").fire("moveend");return this},flyTo:function(u,p,w){if(w=w||{},w.animate===!1||!pt.any3d)return this.setView(u,p,w);this._stop();var U=this.project(this.getCenter()),Q=this.project(u),de=this.getSize(),Pe=this._zoom;u=Y(u),p=p===void 0?Pe:p;var Le=Math.max(de.x,de.y),je=Le*this.getZoomScale(Pe,p),Ze=Q.distanceTo(U)||1,dt=1.42,At=dt*dt;function Yt(mi){var cb=mi?-1:1,sSe=mi?je:Le,aSe=je*je-Le*Le+cb*At*At*Ze*Ze,lSe=2*sSe*At*Ze,U1=aSe/lSe,qR=Math.sqrt(U1*U1+1)-U1,cSe=qR<1e-9?-18:Math.log(qR);return cSe}function tr(mi){return(Math.exp(mi)-Math.exp(-mi))/2}function xi(mi){return(Math.exp(mi)+Math.exp(-mi))/2}function ho(mi){return tr(mi)/xi(mi)}var _r=Yt(0);function ju(mi){return Le*(xi(_r)/xi(_r+dt*mi))}function nSe(mi){return Le*(xi(_r)*ho(_r+dt*mi)-tr(_r))/At}function iSe(mi){return 1-Math.pow(1-mi,1.5)}var rSe=Date.now(),WR=(Yt(1)-_r)/dt,oSe=w.duration?1e3*w.duration:1e3*WR*.8;function HR(){var mi=(Date.now()-rSe)/oSe,cb=iSe(mi)*WR;mi<=1?(this._flyToFrame=I(HR,this),this._move(this.unproject(U.add(Q.subtract(U).multiplyBy(nSe(cb)/Ze)),Pe),this.getScaleZoom(Le/ju(cb),Pe),{flyTo:!0})):this._move(u,p)._moveEnd(!0)}return this._moveStart(!0,w.noMoveStart),HR.call(this),this},flyToBounds:function(u,p){var w=this._getBoundsCenterZoom(u,p);return this.flyTo(w.center,w.zoom,p)},setMaxBounds:function(u){return u=ee(u),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),u.isValid()?(this.options.maxBounds=u,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(u){var p=this.options.minZoom;return this.options.minZoom=u,this._loaded&&p!==u&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(u):this},setMaxZoom:function(u){var p=this.options.maxZoom;return this.options.maxZoom=u,this._loaded&&p!==u&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(u):this},panInsideBounds:function(u,p){this._enforcingBounds=!0;var w=this.getCenter(),U=this._limitCenter(w,this._zoom,ee(u));return w.equals(U)||this.panTo(U,p),this._enforcingBounds=!1,this},panInside:function(u,p){p=p||{};var w=ce(p.paddingTopLeft||p.padding||[0,0]),U=ce(p.paddingBottomRight||p.padding||[0,0]),Q=this.project(this.getCenter()),de=this.project(u),Pe=this.getPixelBounds(),Le=z([Pe.min.add(w),Pe.max.subtract(U)]),je=Le.getSize();if(!Le.contains(de)){this._enforcingBounds=!0;var Ze=de.subtract(Le.getCenter()),dt=Le.extend(de).getSize().subtract(je);Q.x+=Ze.x<0?-dt.x:dt.x,Q.y+=Ze.y<0?-dt.y:dt.y,this.panTo(this.unproject(Q),p),this._enforcingBounds=!1}return this},invalidateSize:function(u){if(!this._loaded)return this;u=r({animate:!1,pan:!0},u===!0?{animate:!0}:u);var p=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var w=this.getSize(),U=p.divideBy(2).round(),Q=w.divideBy(2).round(),de=U.subtract(Q);return!de.x&&!de.y?this:(u.animate&&u.pan?this.panBy(de):(u.pan&&this._rawPanBy(de),this.fire("move"),u.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:p,newSize:w}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(u){if(u=this._locateOptions=r({timeout:1e4,watch:!1},u),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var p=a(this._handleGeolocationResponse,this),w=a(this._handleGeolocationError,this);return u.watch?this._locationWatchId=navigator.geolocation.watchPosition(p,w,u):navigator.geolocation.getCurrentPosition(p,w,u),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(u){if(this._container._leaflet_id){var p=u.code,w=u.message||(p===1?"permission denied":p===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:p,message:"Geolocation error: "+w+"."})}},_handleGeolocationResponse:function(u){if(this._container._leaflet_id){var p=u.coords.latitude,w=u.coords.longitude,U=new K(p,w),Q=U.toBounds(u.coords.accuracy*2),de=this._locateOptions;if(de.setView){var Pe=this.getBoundsZoom(Q);this.setView(U,de.maxZoom?Math.min(Pe,de.maxZoom):Pe)}var Le={latlng:U,bounds:Q,timestamp:u.timestamp};for(var je in u.coords)typeof u.coords[je]=="number"&&(Le[je]=u.coords[je]);this.fire("locationfound",Le)}},addHandler:function(u,p){if(!p)return this;var w=this[u]=new p(this);return this._handlers.push(w),this.options[u]&&w.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Cn(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(O(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var u;for(u in this._layers)this._layers[u].remove();for(u in this._panes)Cn(this._panes[u]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(u,p){var w="leaflet-pane"+(u?" leaflet-"+u.replace("Pane","")+"-pane":""),U=an("div",w,p||this._mapPane);return u&&(this._panes[u]=U),U},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var u=this.getPixelBounds(),p=this.unproject(u.getBottomLeft()),w=this.unproject(u.getTopRight());return new G(p,w)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(u,p,w){u=ee(u),w=ce(w||[0,0]);var U=this.getZoom()||0,Q=this.getMinZoom(),de=this.getMaxZoom(),Pe=u.getNorthWest(),Le=u.getSouthEast(),je=this.getSize().subtract(w),Ze=z(this.project(Le,U),this.project(Pe,U)).getSize(),dt=pt.any3d?this.options.zoomSnap:1,At=je.x/Ze.x,Yt=je.y/Ze.y,tr=p?Math.max(At,Yt):Math.min(At,Yt);return U=this.getScaleZoom(tr,U),dt&&(U=Math.round(U/(dt/100))*(dt/100),U=p?Math.ceil(U/dt)*dt:Math.floor(U/dt)*dt),Math.max(Q,Math.min(de,U))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new re(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(u,p){var w=this._getTopLeftPoint(u,p);return new se(w,w.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(u){return this.options.crs.getProjectedBounds(u===void 0?this.getZoom():u)},getPane:function(u){return typeof u=="string"?this._panes[u]:u},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(u,p){var w=this.options.crs;return p=p===void 0?this._zoom:p,w.scale(u)/w.scale(p)},getScaleZoom:function(u,p){var w=this.options.crs;p=p===void 0?this._zoom:p;var U=w.zoom(u*w.scale(p));return isNaN(U)?1/0:U},project:function(u,p){return p=p===void 0?this._zoom:p,this.options.crs.latLngToPoint(Y(u),p)},unproject:function(u,p){return p=p===void 0?this._zoom:p,this.options.crs.pointToLatLng(ce(u),p)},layerPointToLatLng:function(u){var p=ce(u).add(this.getPixelOrigin());return this.unproject(p)},latLngToLayerPoint:function(u){var p=this.project(Y(u))._round();return p._subtract(this.getPixelOrigin())},wrapLatLng:function(u){return this.options.crs.wrapLatLng(Y(u))},wrapLatLngBounds:function(u){return this.options.crs.wrapLatLngBounds(ee(u))},distance:function(u,p){return this.options.crs.distance(Y(u),Y(p))},containerPointToLayerPoint:function(u){return ce(u).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(u){return ce(u).add(this._getMapPanePos())},containerPointToLatLng:function(u){var p=this.containerPointToLayerPoint(ce(u));return this.layerPointToLatLng(p)},latLngToContainerPoint:function(u){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Y(u)))},mouseEventToContainerPoint:function(u){return xm(u,this._container)},mouseEventToLayerPoint:function(u){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(u))},mouseEventToLatLng:function(u){return this.layerPointToLatLng(this.mouseEventToLayerPoint(u))},_initContainer:function(u){var p=this._container=Lc(u);if(p){if(p._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Dt(p,"scroll",this._onScroll,this),this._containerId=c(p)},_initLayout:function(){var u=this._container;this._fadeAnimated=this.options.fadeAnimation&&pt.any3d,Lt(u,"leaflet-container"+(pt.touch?" leaflet-touch":"")+(pt.retina?" leaflet-retina":"")+(pt.ielt9?" leaflet-oldie":"")+(pt.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var p=ul(u,"position");p!=="absolute"&&p!=="relative"&&p!=="fixed"&&p!=="sticky"&&(u.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var u=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Hn(this._mapPane,new re(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Lt(u.markerPane,"leaflet-zoom-hide"),Lt(u.shadowPane,"leaflet-zoom-hide"))},_resetView:function(u,p,w){Hn(this._mapPane,new re(0,0));var U=!this._loaded;this._loaded=!0,p=this._limitZoom(p),this.fire("viewprereset");var Q=this._zoom!==p;this._moveStart(Q,w)._move(u,p)._moveEnd(Q),this.fire("viewreset"),U&&this.fire("load")},_moveStart:function(u,p){return u&&this.fire("zoomstart"),p||this.fire("movestart"),this},_move:function(u,p,w,U){p===void 0&&(p=this._zoom);var Q=this._zoom!==p;return this._zoom=p,this._lastCenter=u,this._pixelOrigin=this._getNewPixelOrigin(u),U?w&&w.pinch&&this.fire("zoom",w):((Q||w&&w.pinch)&&this.fire("zoom",w),this.fire("move",w)),this},_moveEnd:function(u){return u&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return O(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(u){Hn(this._mapPane,this._getMapPanePos().subtract(u))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(u){this._targets={},this._targets[c(this._container)]=this;var p=u?_n:Dt;p(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&p(window,"resize",this._onResize,this),pt.any3d&&this.options.transform3DLimit&&(u?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){O(this._resizeRequest),this._resizeRequest=I(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var u=this._getMapPanePos();Math.max(Math.abs(u.x),Math.abs(u.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(u,p){for(var w=[],U,Q=p==="mouseout"||p==="mouseover",de=u.target||u.srcElement,Pe=!1;de;){if(U=this._targets[c(de)],U&&(p==="click"||p==="preclick")&&this._draggableMoved(U)){Pe=!0;break}if(U&&U.listens(p,!0)&&(Q&&!Cm(de,u)||(w.push(U),Q))||de===this._container)break;de=de.parentNode}return!w.length&&!Pe&&!Q&&this.listens(p,!0)&&(w=[this]),w},_isClickDisabled:function(u){for(;u&&u!==this._container;){if(u._leaflet_disable_click)return!0;u=u.parentNode}},_handleDOMEvent:function(u){var p=u.target||u.srcElement;if(!(!this._loaded||p._leaflet_disable_events||u.type==="click"&&this._isClickDisabled(p))){var w=u.type;w==="mousedown"&&Qt(p),this._fireDOMEvent(u,w)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(u,p,w){if(u.type==="click"){var U=r({},u);U.type="preclick",this._fireDOMEvent(U,U.type,w)}var Q=this._findEventTargets(u,p);if(w){for(var de=[],Pe=0;Pe<w.length;Pe++)w[Pe].listens(p,!0)&&de.push(w[Pe]);Q=de.concat(Q)}if(Q.length){p==="contextmenu"&&hi(u);var Le=Q[0],je={originalEvent:u};if(u.type!=="keypress"&&u.type!=="keydown"&&u.type!=="keyup"){var Ze=Le.getLatLng&&(!Le._radius||Le._radius<=10);je.containerPoint=Ze?this.latLngToContainerPoint(Le.getLatLng()):this.mouseEventToContainerPoint(u),je.layerPoint=this.containerPointToLayerPoint(je.containerPoint),je.latlng=Ze?Le.getLatLng():this.layerPointToLatLng(je.layerPoint)}for(Pe=0;Pe<Q.length;Pe++)if(Q[Pe].fire(p,je,!0),je.originalEvent._stopped||Q[Pe].options.bubblingMouseEvents===!1&&N(this._mouseEvents,p)!==-1)return}},_draggableMoved:function(u){return u=u.dragging&&u.dragging.enabled()?u:this,u.dragging&&u.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var u=0,p=this._handlers.length;u<p;u++)this._handlers[u].disable()},whenReady:function(u,p){return this._loaded?u.call(p||this,{target:this}):this.on("load",u,p),this},_getMapPanePos:function(){return Ro(this._mapPane)||new re(0,0)},_moved:function(){var u=this._getMapPanePos();return u&&!u.equals([0,0])},_getTopLeftPoint:function(u,p){var w=u&&p!==void 0?this._getNewPixelOrigin(u,p):this.getPixelOrigin();return w.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(u,p){var w=this.getSize()._divideBy(2);return this.project(u,p)._subtract(w)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(u,p,w){var U=this._getNewPixelOrigin(w,p);return this.project(u,p)._subtract(U)},_latLngBoundsToNewLayerBounds:function(u,p,w){var U=this._getNewPixelOrigin(w,p);return z([this.project(u.getSouthWest(),p)._subtract(U),this.project(u.getNorthWest(),p)._subtract(U),this.project(u.getSouthEast(),p)._subtract(U),this.project(u.getNorthEast(),p)._subtract(U)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(u){return this.latLngToLayerPoint(u).subtract(this._getCenterLayerPoint())},_limitCenter:function(u,p,w){if(!w)return u;var U=this.project(u,p),Q=this.getSize().divideBy(2),de=new se(U.subtract(Q),U.add(Q)),Pe=this._getBoundsOffset(de,w,p);return Math.abs(Pe.x)<=1&&Math.abs(Pe.y)<=1?u:this.unproject(U.add(Pe),p)},_limitOffset:function(u,p){if(!p)return u;var w=this.getPixelBounds(),U=new se(w.min.add(u),w.max.add(u));return u.add(this._getBoundsOffset(U,p))},_getBoundsOffset:function(u,p,w){var U=z(this.project(p.getNorthEast(),w),this.project(p.getSouthWest(),w)),Q=U.min.subtract(u.min),de=U.max.subtract(u.max),Pe=this._rebound(Q.x,-de.x),Le=this._rebound(Q.y,-de.y);return new re(Pe,Le)},_rebound:function(u,p){return u+p>0?Math.round(u-p)/2:Math.max(0,Math.ceil(u))-Math.max(0,Math.floor(p))},_limitZoom:function(u){var p=this.getMinZoom(),w=this.getMaxZoom(),U=pt.any3d?this.options.zoomSnap:1;return U&&(u=Math.round(u/U)*U),Math.max(p,Math.min(w,u))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Wn(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(u,p){var w=this._getCenterOffset(u)._trunc();return(p&&p.animate)!==!0&&!this.getSize().contains(w)?!1:(this.panBy(w,p),!0)},_createAnimProxy:function(){var u=this._proxy=an("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(u),this.on("zoomanim",function(p){var w=dl,U=this._proxy.style[w];fs(this._proxy,this.project(p.center,p.zoom),this.getZoomScale(p.zoom,1)),U===this._proxy.style[w]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Cn(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var u=this.getCenter(),p=this.getZoom();fs(this._proxy,this.project(u,p),this.getZoomScale(p,1))},_catchTransitionEnd:function(u){this._animatingZoom&&u.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(u,p,w){if(this._animatingZoom)return!0;if(w=w||{},!this._zoomAnimated||w.animate===!1||this._nothingToAnimate()||Math.abs(p-this._zoom)>this.options.zoomAnimationThreshold)return!1;var U=this.getZoomScale(p),Q=this._getCenterOffset(u)._divideBy(1-1/U);return w.animate!==!0&&!this.getSize().contains(Q)?!1:(I(function(){this._moveStart(!0,w.noMoveStart||!1)._animateZoom(u,p,!0)},this),!0)},_animateZoom:function(u,p,w,U){this._mapPane&&(w&&(this._animatingZoom=!0,this._animateToCenter=u,this._animateToZoom=p,Lt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:u,zoom:p,noUpdate:U}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&Wn(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function I1(u,p){return new Rt(u,p)}var Or=X.extend({options:{position:"topright"},initialize:function(u){y(this,u)},getPosition:function(){return this.options.position},setPosition:function(u){var p=this._map;return p&&p.removeControl(this),this.options.position=u,p&&p.addControl(this),this},getContainer:function(){return this._container},addTo:function(u){this.remove(),this._map=u;var p=this._container=this.onAdd(u),w=this.getPosition(),U=u._controlCorners[w];return Lt(p,"leaflet-control"),w.indexOf("bottom")!==-1?U.insertBefore(p,U.firstChild):U.appendChild(p),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Cn(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(u){this._map&&u&&u.screenX>0&&u.screenY>0&&this._map.getContainer().focus()}}),hl=function(u){return new Or(u)};Rt.include({addControl:function(u){return u.addTo(this),this},removeControl:function(u){return u.remove(),this},_initControlPos:function(){var u=this._controlCorners={},p="leaflet-",w=this._controlContainer=an("div",p+"control-container",this._container);function U(Q,de){var Pe=p+Q+" "+p+de;u[Q+de]=an("div",Pe,w)}U("top","left"),U("top","right"),U("bottom","left"),U("bottom","right")},_clearControlPos:function(){for(var u in this._controlCorners)Cn(this._controlCorners[u]);Cn(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Uy=Or.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(u,p,w,U){return w<U?-1:U<w?1:0}},initialize:function(u,p,w){y(this,w),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var U in u)this._addLayer(u[U],U);for(U in p)this._addLayer(p[U],U,!0)},onAdd:function(u){this._initLayout(),this._update(),this._map=u,u.on("zoomend",this._checkDisabledLayers,this);for(var p=0;p<this._layers.length;p++)this._layers[p].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(u){return Or.prototype.addTo.call(this,u),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var u=0;u<this._layers.length;u++)this._layers[u].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(u,p){return this._addLayer(u,p),this._map?this._update():this},addOverlay:function(u,p){return this._addLayer(u,p,!0),this._map?this._update():this},removeLayer:function(u){u.off("add remove",this._onLayerChange,this);var p=this._getLayer(c(u));return p&&this._layers.splice(this._layers.indexOf(p),1),this._map?this._update():this},expand:function(){Lt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var u=this._map.getSize().y-(this._container.offsetTop+50);return u<this._section.clientHeight?(Lt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=u+"px"):Wn(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return Wn(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var u="leaflet-control-layers",p=this._container=an("div",u),w=this.options.collapsed;p.setAttribute("aria-haspopup",!0),qc(p),ei(p);var U=this._section=an("section",u+"-list");w&&(this._map.on("click",this.collapse,this),Dt(p,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var Q=this._layersLink=an("a",u+"-toggle",p);Q.href="#",Q.title="Layers",Q.setAttribute("role","button"),Dt(Q,{keydown:function(de){de.keyCode===13&&this._expandSafely()},click:function(de){hi(de),this._expandSafely()}},this),w||this.expand(),this._baseLayersList=an("div",u+"-base",U),this._separator=an("div",u+"-separator",U),this._overlaysList=an("div",u+"-overlays",U),p.appendChild(U)},_getLayer:function(u){for(var p=0;p<this._layers.length;p++)if(this._layers[p]&&c(this._layers[p].layer)===u)return this._layers[p]},_addLayer:function(u,p,w){this._map&&u.on("add remove",this._onLayerChange,this),this._layers.push({layer:u,name:p,overlay:w}),this.options.sortLayers&&this._layers.sort(a(function(U,Q){return this.options.sortFunction(U.layer,Q.layer,U.name,Q.name)},this)),this.options.autoZIndex&&u.setZIndex&&(this._lastZIndex++,u.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Ni(this._baseLayersList),Ni(this._overlaysList),this._layerControlInputs=[];var u,p,w,U,Q=0;for(w=0;w<this._layers.length;w++)U=this._layers[w],this._addItem(U),p=p||U.overlay,u=u||!U.overlay,Q+=U.overlay?0:1;return this.options.hideSingleBase&&(u=u&&Q>1,this._baseLayersList.style.display=u?"":"none"),this._separator.style.display=p&&u?"":"none",this},_onLayerChange:function(u){this._handlingClick||this._update();var p=this._getLayer(c(u.target)),w=p.overlay?u.type==="add"?"overlayadd":"overlayremove":u.type==="add"?"baselayerchange":null;w&&this._map.fire(w,p)},_createRadioElement:function(u,p){var w='<input type="radio" class="leaflet-control-layers-selector" name="'+u+'"'+(p?' checked="checked"':"")+"/>",U=document.createElement("div");return U.innerHTML=w,U.firstChild},_addItem:function(u){var p=document.createElement("label"),w=this._map.hasLayer(u.layer),U;u.overlay?(U=document.createElement("input"),U.type="checkbox",U.className="leaflet-control-layers-selector",U.defaultChecked=w):U=this._createRadioElement("leaflet-base-layers_"+c(this),w),this._layerControlInputs.push(U),U.layerId=c(u.layer),Dt(U,"click",this._onInputClick,this);var Q=document.createElement("span");Q.innerHTML=" "+u.name;var de=document.createElement("span");p.appendChild(de),de.appendChild(U),de.appendChild(Q);var Pe=u.overlay?this._overlaysList:this._baseLayersList;return Pe.appendChild(p),this._checkDisabledLayers(),p},_onInputClick:function(){if(!this._preventClick){var u=this._layerControlInputs,p,w,U=[],Q=[];this._handlingClick=!0;for(var de=u.length-1;de>=0;de--)p=u[de],w=this._getLayer(p.layerId).layer,p.checked?U.push(w):p.checked||Q.push(w);for(de=0;de<Q.length;de++)this._map.hasLayer(Q[de])&&this._map.removeLayer(Q[de]);for(de=0;de<U.length;de++)this._map.hasLayer(U[de])||this._map.addLayer(U[de]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var u=this._layerControlInputs,p,w,U=this._map.getZoom(),Q=u.length-1;Q>=0;Q--)p=u[Q],w=this._getLayer(p.layerId).layer,p.disabled=w.options.minZoom!==void 0&&U<w.options.minZoom||w.options.maxZoom!==void 0&&U>w.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var u=this._section;this._preventClick=!0,Dt(u,"click",hi),this.expand();var p=this;setTimeout(function(){_n(u,"click",hi),p._preventClick=!1})}}),Wy=function(u,p,w){return new Uy(u,p,w)},Sm=Or.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(u){var p="leaflet-control-zoom",w=an("div",p+" leaflet-bar"),U=this.options;return this._zoomInButton=this._createButton(U.zoomInText,U.zoomInTitle,p+"-in",w,this._zoomIn),this._zoomOutButton=this._createButton(U.zoomOutText,U.zoomOutTitle,p+"-out",w,this._zoomOut),this._updateDisabled(),u.on("zoomend zoomlevelschange",this._updateDisabled,this),w},onRemove:function(u){u.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(u){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(u.shiftKey?3:1))},_zoomOut:function(u){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(u.shiftKey?3:1))},_createButton:function(u,p,w,U,Q){var de=an("a",w,U);return de.innerHTML=u,de.href="#",de.title=p,de.setAttribute("role","button"),de.setAttribute("aria-label",p),qc(de),Dt(de,"click",ms),Dt(de,"click",Q,this),Dt(de,"click",this._refocusOnMap,this),de},_updateDisabled:function(){var u=this._map,p="leaflet-disabled";Wn(this._zoomInButton,p),Wn(this._zoomOutButton,p),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||u._zoom===u.getMinZoom())&&(Lt(this._zoomOutButton,p),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||u._zoom===u.getMaxZoom())&&(Lt(this._zoomInButton,p),this._zoomInButton.setAttribute("aria-disabled","true"))}});Rt.mergeOptions({zoomControl:!0}),Rt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Sm,this.addControl(this.zoomControl))});var ml=function(u){return new Sm(u)},Hy=Or.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(u){var p="leaflet-control-scale",w=an("div",p),U=this.options;return this._addScales(U,p+"-line",w),u.on(U.updateWhenIdle?"moveend":"move",this._update,this),u.whenReady(this._update,this),w},onRemove:function(u){u.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(u,p,w){u.metric&&(this._mScale=an("div",p,w)),u.imperial&&(this._iScale=an("div",p,w))},_update:function(){var u=this._map,p=u.getSize().y/2,w=u.distance(u.containerPointToLatLng([0,p]),u.containerPointToLatLng([this.options.maxWidth,p]));this._updateScales(w)},_updateScales:function(u){this.options.metric&&u&&this._updateMetric(u),this.options.imperial&&u&&this._updateImperial(u)},_updateMetric:function(u){var p=this._getRoundNum(u),w=p<1e3?p+" m":p/1e3+" km";this._updateScale(this._mScale,w,p/u)},_updateImperial:function(u){var p=u*3.2808399,w,U,Q;p>5280?(w=p/5280,U=this._getRoundNum(w),this._updateScale(this._iScale,U+" mi",U/w)):(Q=this._getRoundNum(p),this._updateScale(this._iScale,Q+" ft",Q/p))},_updateScale:function(u,p,w){u.style.width=Math.round(this.options.maxWidth*w)+"px",u.innerHTML=p},_getRoundNum:function(u){var p=Math.pow(10,(Math.floor(u)+"").length-1),w=u/p;return w=w>=10?10:w>=5?5:w>=3?3:w>=2?2:1,p*w}}),Lu=function(u){return new Hy(u)},qy='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Am=Or.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(pt.inlineSvg?qy+" ":"")+"Leaflet</a>"},initialize:function(u){y(this,u),this._attributions={}},onAdd:function(u){u.attributionControl=this,this._container=an("div","leaflet-control-attribution"),qc(this._container);for(var p in u._layers)u._layers[p].getAttribution&&this.addAttribution(u._layers[p].getAttribution());return this._update(),u.on("layeradd",this._addAttribution,this),this._container},onRemove:function(u){u.off("layeradd",this._addAttribution,this)},_addAttribution:function(u){u.layer.getAttribution&&(this.addAttribution(u.layer.getAttribution()),u.layer.once("remove",function(){this.removeAttribution(u.layer.getAttribution())},this))},setPrefix:function(u){return this.options.prefix=u,this._update(),this},addAttribution:function(u){return u?(this._attributions[u]||(this._attributions[u]=0),this._attributions[u]++,this._update(),this):this},removeAttribution:function(u){return u?(this._attributions[u]&&(this._attributions[u]--,this._update()),this):this},_update:function(){if(this._map){var u=[];for(var p in this._attributions)this._attributions[p]&&u.push(p);var w=[];this.options.prefix&&w.push(this.options.prefix),u.length&&w.push(u.join(", ")),this._container.innerHTML=w.join(' <span aria-hidden="true">|</span> ')}}});Rt.mergeOptions({attributionControl:!0}),Rt.addInitHook(function(){this.options.attributionControl&&new Am().addTo(this)});var O1=function(u){return new Am(u)};Or.Layers=Uy,Or.Zoom=Sm,Or.Scale=Hy,Or.Attribution=Am,hl.layers=Wy,hl.zoom=ml,hl.scale=Lu,hl.attribution=O1;var uo=X.extend({initialize:function(u){this._map=u},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});uo.addTo=function(u,p){return u.addHandler(p,this),this};var L1={Events:ue},pl=pt.touch?"touchstart mousedown":"mousedown",ps=te.extend({options:{clickTolerance:3},initialize:function(u,p,w,U){y(this,U),this._element=u,this._dragStartTarget=p||u,this._preventOutline=w},enable:function(){this._enabled||(Dt(this._dragStartTarget,pl,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ps._dragging===this&&this.finishDrag(!0),_n(this._dragStartTarget,pl,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(u){if(this._enabled&&(this._moved=!1,!Dn(this._element,"leaflet-zoom-anim"))){if(u.touches&&u.touches.length!==1){ps._dragging===this&&this.finishDrag();return}if(!(ps._dragging||u.shiftKey||u.which!==1&&u.button!==1&&!u.touches)&&(ps._dragging=this,this._preventOutline&&Qt(this._element),vr(),la(),!this._moving)){this.fire("down");var p=u.touches?u.touches[0]:u,w=Uc(this._element);this._startPoint=new re(p.clientX,p.clientY),this._startPos=Ro(this._element),this._parentScale=Ou(w);var U=u.type==="mousedown";Dt(document,U?"mousemove":"touchmove",this._onMove,this),Dt(document,U?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(u){if(this._enabled){if(u.touches&&u.touches.length>1){this._moved=!0;return}var p=u.touches&&u.touches.length===1?u.touches[0]:u,w=new re(p.clientX,p.clientY)._subtract(this._startPoint);!w.x&&!w.y||Math.abs(w.x)+Math.abs(w.y)<this.options.clickTolerance||(w.x/=this._parentScale.x,w.y/=this._parentScale.y,hi(u),this._moved||(this.fire("dragstart"),this._moved=!0,Lt(document.body,"leaflet-dragging"),this._lastTarget=u.target||u.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Lt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(w),this._moving=!0,this._lastEvent=u,this._updatePosition())}},_updatePosition:function(){var u={originalEvent:this._lastEvent};this.fire("predrag",u),Hn(this._element,this._newPos),this.fire("drag",u)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(u){Wn(document.body,"leaflet-dragging"),this._lastTarget&&(Wn(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),_n(document,"mousemove touchmove",this._onMove,this),_n(document,"mouseup touchend touchcancel",this._onUp,this),fl(),zc();var p=this._moved&&this._moving;this._moving=!1,ps._dragging=!1,p&&this.fire("dragend",{noInertia:u,distance:this._newPos.distanceTo(this._startPos)})}});function Ky(u,p,w){var U,Q=[1,4,2,8],de,Pe,Le,je,Ze,dt,At,Yt;for(de=0,dt=u.length;de<dt;de++)u[de]._code=ca(u[de],p);for(Le=0;Le<4;Le++){for(At=Q[Le],U=[],de=0,dt=u.length,Pe=dt-1;de<dt;Pe=de++)je=u[de],Ze=u[Pe],je._code&At?Ze._code&At||(Yt=gl(Ze,je,At,p,w),Yt._code=ca(Yt,p),U.push(Yt)):(Ze._code&At&&(Yt=gl(Ze,je,At,p,w),Yt._code=ca(Yt,p),U.push(Yt)),U.push(je));u=U}return u}function Gy(u,p){var w,U,Q,de,Pe,Le,je,Ze,dt;if(!u||u.length===0)throw new Error("latlngs not passed");er(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var At=Y([0,0]),Yt=ee(u),tr=Yt.getNorthWest().distanceTo(Yt.getSouthWest())*Yt.getNorthEast().distanceTo(Yt.getNorthWest());tr<1700&&(At=Tm(u));var xi=u.length,ho=[];for(w=0;w<xi;w++){var _r=Y(u[w]);ho.push(p.project(Y([_r.lat-At.lat,_r.lng-At.lng])))}for(Le=je=Ze=0,w=0,U=xi-1;w<xi;U=w++)Q=ho[w],de=ho[U],Pe=Q.y*de.x-de.y*Q.x,je+=(Q.x+de.x)*Pe,Ze+=(Q.y+de.y)*Pe,Le+=Pe*3;Le===0?dt=ho[0]:dt=[je/Le,Ze/Le];var ju=p.unproject(ce(dt));return Y([ju.lat+At.lat,ju.lng+At.lng])}function Tm(u){for(var p=0,w=0,U=0,Q=0;Q<u.length;Q++){var de=Y(u[Q]);p+=de.lat,w+=de.lng,U++}return Y([p/U,w/U])}var F1={__proto__:null,clipPolygon:Ky,polygonCenter:Gy,centroid:Tm};function Pm(u,p){if(!p||!u.length)return u.slice();var w=p*p;return u=Zy(u,w),u=$1(u,w),u}function Bm(u,p,w){return Math.sqrt(Gc(u,p,w,!0))}function Yy(u,p,w){return Gc(u,p,w)}function $1(u,p){var w=u.length,U=typeof Uint8Array<"u"?Uint8Array:Array,Q=new U(w);Q[0]=Q[w-1]=1,Nm(u,Q,p,0,w-1);var de,Pe=[];for(de=0;de<w;de++)Q[de]&&Pe.push(u[de]);return Pe}function Nm(u,p,w,U,Q){var de=0,Pe,Le,je;for(Le=U+1;Le<=Q-1;Le++)je=Gc(u[Le],u[U],u[Q],!0),je>de&&(Pe=Le,de=je);de>w&&(p[Pe]=1,Nm(u,p,w,U,Pe),Nm(u,p,w,Pe,Q))}function Zy(u,p){for(var w=[u[0]],U=1,Q=0,de=u.length;U<de;U++)z1(u[U],u[Q])>p&&(w.push(u[U]),Q=U);return Q<de-1&&w.push(u[de-1]),w}var Xy;function Jy(u,p,w,U,Q){var de=U?Xy:ca(u,w),Pe=ca(p,w),Le,je,Ze;for(Xy=Pe;;){if(!(de|Pe))return[u,p];if(de&Pe)return!1;Le=de||Pe,je=gl(u,p,Le,w,Q),Ze=ca(je,w),Le===de?(u=je,de=Ze):(p=je,Pe=Ze)}}function gl(u,p,w,U,Q){var de=p.x-u.x,Pe=p.y-u.y,Le=U.min,je=U.max,Ze,dt;return w&8?(Ze=u.x+de*(je.y-u.y)/Pe,dt=je.y):w&4?(Ze=u.x+de*(Le.y-u.y)/Pe,dt=Le.y):w&2?(Ze=je.x,dt=u.y+Pe*(je.x-u.x)/de):w&1&&(Ze=Le.x,dt=u.y+Pe*(Le.x-u.x)/de),new re(Ze,dt,Q)}function ca(u,p){var w=0;return u.x<p.min.x?w|=1:u.x>p.max.x&&(w|=2),u.y<p.min.y?w|=4:u.y>p.max.y&&(w|=8),w}function z1(u,p){var w=p.x-u.x,U=p.y-u.y;return w*w+U*U}function Gc(u,p,w,U){var Q=p.x,de=p.y,Pe=w.x-Q,Le=w.y-de,je=Pe*Pe+Le*Le,Ze;return je>0&&(Ze=((u.x-Q)*Pe+(u.y-de)*Le)/je,Ze>1?(Q=w.x,de=w.y):Ze>0&&(Q+=Pe*Ze,de+=Le*Ze)),Pe=u.x-Q,Le=u.y-de,U?Pe*Pe+Le*Le:new re(Q,de)}function er(u){return!B(u[0])||typeof u[0][0]!="object"&&typeof u[0][0]<"u"}function Qy(u){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),er(u)}function Vy(u,p){var w,U,Q,de,Pe,Le,je,Ze;if(!u||u.length===0)throw new Error("latlngs not passed");er(u)||(console.warn("latlngs are not flat! Only the first ring will be used"),u=u[0]);var dt=Y([0,0]),At=ee(u),Yt=At.getNorthWest().distanceTo(At.getSouthWest())*At.getNorthEast().distanceTo(At.getNorthWest());Yt<1700&&(dt=Tm(u));var tr=u.length,xi=[];for(w=0;w<tr;w++){var ho=Y(u[w]);xi.push(p.project(Y([ho.lat-dt.lat,ho.lng-dt.lng])))}for(w=0,U=0;w<tr-1;w++)U+=xi[w].distanceTo(xi[w+1])/2;if(U===0)Ze=xi[0];else for(w=0,de=0;w<tr-1;w++)if(Pe=xi[w],Le=xi[w+1],Q=Pe.distanceTo(Le),de+=Q,de>U){je=(de-U)/Q,Ze=[Le.x-je*(Le.x-Pe.x),Le.y-je*(Le.y-Pe.y)];break}var _r=p.unproject(ce(Ze));return Y([_r.lat+dt.lat,_r.lng+dt.lng])}var da={__proto__:null,simplify:Pm,pointToSegmentDistance:Bm,closestPointOnSegment:Yy,clipSegment:Jy,_getEdgeIntersection:gl,_getBitCode:ca,_sqClosestPointOnSegment:Gc,isFlat:er,_flat:Qy,polylineCenter:Vy},Fu={project:function(u){return new re(u.lng,u.lat)},unproject:function(u){return new K(u.y,u.x)},bounds:new se([-180,-90],[180,90])},$u={R:6378137,R_MINOR:6356752314245179e-9,bounds:new se([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(u){var p=Math.PI/180,w=this.R,U=u.lat*p,Q=this.R_MINOR/w,de=Math.sqrt(1-Q*Q),Pe=de*Math.sin(U),Le=Math.tan(Math.PI/4-U/2)/Math.pow((1-Pe)/(1+Pe),de/2);return U=-w*Math.log(Math.max(Le,1e-10)),new re(u.lng*p*w,U)},unproject:function(u){for(var p=180/Math.PI,w=this.R,U=this.R_MINOR/w,Q=Math.sqrt(1-U*U),de=Math.exp(-u.y/w),Pe=Math.PI/2-2*Math.atan(de),Le=0,je=.1,Ze;Le<15&&Math.abs(je)>1e-7;Le++)Ze=Q*Math.sin(Pe),Ze=Math.pow((1-Ze)/(1+Ze),Q/2),je=Math.PI/2-2*Math.atan(de*Ze)-Pe,Pe+=je;return new K(Pe*p,u.x*p/w)}},eb={__proto__:null,LonLat:Fu,Mercator:$u,SphericalMercator:R},tb=r({},_,{code:"EPSG:3395",projection:$u,transformation:(function(){var u=.5/(Math.PI*$u.R);return T(u,.5,-u,.5)})()}),Dm=r({},_,{code:"EPSG:4326",projection:Fu,transformation:T(1/180,1,-1/180,.5)}),nb=r({},F,{projection:Fu,transformation:T(1,0,-1,0),scale:function(u){return Math.pow(2,u)},zoom:function(u){return Math.log(u)/Math.LN2},distance:function(u,p){var w=p.lng-u.lng,U=p.lat-u.lat;return Math.sqrt(w*w+U*U)},infinite:!0});F.Earth=_,F.EPSG3395=tb,F.EPSG3857=D,F.EPSG900913=Z,F.EPSG4326=Dm,F.Simple=nb;var wr=te.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(u){return u.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(u){return u&&u.removeLayer(this),this},getPane:function(u){return this._map.getPane(u?this.options[u]||u:this.options.pane)},addInteractiveTarget:function(u){return this._map._targets[c(u)]=this,this},removeInteractiveTarget:function(u){return delete this._map._targets[c(u)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(u){var p=u.target;if(p.hasLayer(this)){if(this._map=p,this._zoomAnimated=p._zoomAnimated,this.getEvents){var w=this.getEvents();p.on(w,this),this.once("remove",function(){p.off(w,this)},this)}this.onAdd(p),this.fire("add"),p.fire("layeradd",{layer:this})}}});Rt.include({addLayer:function(u){if(!u._layerAdd)throw new Error("The provided object is not a Layer.");var p=c(u);return this._layers[p]?this:(this._layers[p]=u,u._mapToAdd=this,u.beforeAdd&&u.beforeAdd(this),this.whenReady(u._layerAdd,u),this)},removeLayer:function(u){var p=c(u);return this._layers[p]?(this._loaded&&u.onRemove(this),delete this._layers[p],this._loaded&&(this.fire("layerremove",{layer:u}),u.fire("remove")),u._map=u._mapToAdd=null,this):this},hasLayer:function(u){return c(u)in this._layers},eachLayer:function(u,p){for(var w in this._layers)u.call(p,this._layers[w]);return this},_addLayers:function(u){u=u?B(u)?u:[u]:[];for(var p=0,w=u.length;p<w;p++)this.addLayer(u[p])},_addZoomLimit:function(u){(!isNaN(u.options.maxZoom)||!isNaN(u.options.minZoom))&&(this._zoomBoundLayers[c(u)]=u,this._updateZoomLevels())},_removeZoomLimit:function(u){var p=c(u);this._zoomBoundLayers[p]&&(delete this._zoomBoundLayers[p],this._updateZoomLevels())},_updateZoomLevels:function(){var u=1/0,p=-1/0,w=this._getZoomSpan();for(var U in this._zoomBoundLayers){var Q=this._zoomBoundLayers[U].options;u=Q.minZoom===void 0?u:Math.min(u,Q.minZoom),p=Q.maxZoom===void 0?p:Math.max(p,Q.maxZoom)}this._layersMaxZoom=p===-1/0?void 0:p,this._layersMinZoom=u===1/0?void 0:u,w!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var ua=wr.extend({initialize:function(u,p){y(this,p),this._layers={};var w,U;if(u)for(w=0,U=u.length;w<U;w++)this.addLayer(u[w])},addLayer:function(u){var p=this.getLayerId(u);return this._layers[p]=u,this._map&&this._map.addLayer(u),this},removeLayer:function(u){var p=u in this._layers?u:this.getLayerId(u);return this._map&&this._layers[p]&&this._map.removeLayer(this._layers[p]),delete this._layers[p],this},hasLayer:function(u){var p=typeof u=="number"?u:this.getLayerId(u);return p in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(u){var p=Array.prototype.slice.call(arguments,1),w,U;for(w in this._layers)U=this._layers[w],U[u]&&U[u].apply(U,p);return this},onAdd:function(u){this.eachLayer(u.addLayer,u)},onRemove:function(u){this.eachLayer(u.removeLayer,u)},eachLayer:function(u,p){for(var w in this._layers)u.call(p,this._layers[w]);return this},getLayer:function(u){return this._layers[u]},getLayers:function(){var u=[];return this.eachLayer(u.push,u),u},setZIndex:function(u){return this.invoke("setZIndex",u)},getLayerId:function(u){return c(u)}}),ib=function(u,p){return new ua(u,p)},fo=ua.extend({addLayer:function(u){return this.hasLayer(u)?this:(u.addEventParent(this),ua.prototype.addLayer.call(this,u),this.fire("layeradd",{layer:u}))},removeLayer:function(u){return this.hasLayer(u)?(u in this._layers&&(u=this._layers[u]),u.removeEventParent(this),ua.prototype.removeLayer.call(this,u),this.fire("layerremove",{layer:u})):this},setStyle:function(u){return this.invoke("setStyle",u)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var u=new G;for(var p in this._layers){var w=this._layers[p];u.extend(w.getBounds?w.getBounds():w.getLatLng())}return u}}),rb=function(u,p){return new fo(u,p)},fa=X.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(u){y(this,u)},createIcon:function(u){return this._createIcon("icon",u)},createShadow:function(u){return this._createIcon("shadow",u)},_createIcon:function(u,p){var w=this._getIconUrl(u);if(!w){if(u==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var U=this._createImg(w,p&&p.tagName==="IMG"?p:null);return this._setIconStyles(U,u),(this.options.crossOrigin||this.options.crossOrigin==="")&&(U.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),U},_setIconStyles:function(u,p){var w=this.options,U=w[p+"Size"];typeof U=="number"&&(U=[U,U]);var Q=ce(U),de=ce(p==="shadow"&&w.shadowAnchor||w.iconAnchor||Q&&Q.divideBy(2,!0));u.className="leaflet-marker-"+p+" "+(w.className||""),de&&(u.style.marginLeft=-de.x+"px",u.style.marginTop=-de.y+"px"),Q&&(u.style.width=Q.x+"px",u.style.height=Q.y+"px")},_createImg:function(u,p){return p=p||document.createElement("img"),p.src=u,p},_getIconUrl:function(u){return pt.retina&&this.options[u+"RetinaUrl"]||this.options[u+"Url"]}});function ob(u){return new fa(u)}var yl=fa.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(u){return typeof yl.imagePath!="string"&&(yl.imagePath=this._detectIconPath()),(this.options.imagePath||yl.imagePath)+fa.prototype._getIconUrl.call(this,u)},_stripUrl:function(u){var p=function(w,U,Q){var de=U.exec(w);return de&&de[Q]};return u=p(u,/^url\((['"])?(.+)\1\)$/,2),u&&p(u,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var u=an("div","leaflet-default-icon-path",document.body),p=ul(u,"background-image")||ul(u,"backgroundImage");if(document.body.removeChild(u),p=this._stripUrl(p),p)return p;var w=document.querySelector('link[href$="leaflet.css"]');return w?w.href.substring(0,w.href.length-11-1):""}}),Mm=uo.extend({initialize:function(u){this._marker=u},addHooks:function(){var u=this._marker._icon;this._draggable||(this._draggable=new ps(u,u,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Lt(u,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&Wn(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(u){var p=this._marker,w=p._map,U=this._marker.options.autoPanSpeed,Q=this._marker.options.autoPanPadding,de=Ro(p._icon),Pe=w.getPixelBounds(),Le=w.getPixelOrigin(),je=z(Pe.min._subtract(Le).add(Q),Pe.max._subtract(Le).subtract(Q));if(!je.contains(de)){var Ze=ce((Math.max(je.max.x,de.x)-je.max.x)/(Pe.max.x-je.max.x)-(Math.min(je.min.x,de.x)-je.min.x)/(Pe.min.x-je.min.x),(Math.max(je.max.y,de.y)-je.max.y)/(Pe.max.y-je.max.y)-(Math.min(je.min.y,de.y)-je.min.y)/(Pe.min.y-je.min.y)).multiplyBy(U);w.panBy(Ze,{animate:!1}),this._draggable._newPos._add(Ze),this._draggable._startPos._add(Ze),Hn(p._icon,this._draggable._newPos),this._onDrag(u),this._panRequest=I(this._adjustPan.bind(this,u))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(u){this._marker.options.autoPan&&(O(this._panRequest),this._panRequest=I(this._adjustPan.bind(this,u)))},_onDrag:function(u){var p=this._marker,w=p._shadow,U=Ro(p._icon),Q=p._map.layerPointToLatLng(U);w&&Hn(w,U),p._latlng=Q,u.latlng=Q,u.oldLatLng=this._oldLatLng,p.fire("move",u).fire("drag",u)},_onDragEnd:function(u){O(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",u)}}),Yc=wr.extend({options:{icon:new yl,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(u,p){y(this,p),this._latlng=Y(u)},onAdd:function(u){this._zoomAnimated=this._zoomAnimated&&u.options.markerZoomAnimation,this._zoomAnimated&&u.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(u){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&u.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(u){var p=this._latlng;return this._latlng=Y(u),this.update(),this.fire("move",{oldLatLng:p,latlng:this._latlng})},setZIndexOffset:function(u){return this.options.zIndexOffset=u,this.update()},getIcon:function(){return this.options.icon},setIcon:function(u){return this.options.icon=u,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var u=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(u)}return this},_initIcon:function(){var u=this.options,p="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),w=u.icon.createIcon(this._icon),U=!1;w!==this._icon&&(this._icon&&this._removeIcon(),U=!0,u.title&&(w.title=u.title),w.tagName==="IMG"&&(w.alt=u.alt||"")),Lt(w,p),u.keyboard&&(w.tabIndex="0",w.setAttribute("role","button")),this._icon=w,u.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Dt(w,"focus",this._panOnFocus,this);var Q=u.icon.createShadow(this._shadow),de=!1;Q!==this._shadow&&(this._removeShadow(),de=!0),Q&&(Lt(Q,p),Q.alt=""),this._shadow=Q,u.opacity<1&&this._updateOpacity(),U&&this.getPane().appendChild(this._icon),this._initInteraction(),Q&&de&&this.getPane(u.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&_n(this._icon,"focus",this._panOnFocus,this),Cn(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Cn(this._shadow),this._shadow=null},_setPos:function(u){this._icon&&Hn(this._icon,u),this._shadow&&Hn(this._shadow,u),this._zIndex=u.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(u){this._icon&&(this._icon.style.zIndex=this._zIndex+u)},_animateZoom:function(u){var p=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center).round();this._setPos(p)},_initInteraction:function(){if(this.options.interactive&&(Lt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Mm)){var u=this.options.draggable;this.dragging&&(u=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Mm(this),u&&this.dragging.enable()}},setOpacity:function(u){return this.options.opacity=u,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var u=this.options.opacity;this._icon&&br(this._icon,u),this._shadow&&br(this._shadow,u)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var u=this._map;if(u){var p=this.options.icon.options,w=p.iconSize?ce(p.iconSize):ce(0,0),U=p.iconAnchor?ce(p.iconAnchor):ce(0,0);u.panInside(this._latlng,{paddingTopLeft:U,paddingBottomRight:w.subtract(U)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function sb(u,p){return new Yc(u,p)}var H=wr.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(u){this._renderer=u.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(u){return y(this,u),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&u&&Object.prototype.hasOwnProperty.call(u,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),V=H.extend({options:{fill:!0,radius:10},initialize:function(u,p){y(this,p),this._latlng=Y(u),this._radius=this.options.radius},setLatLng:function(u){var p=this._latlng;return this._latlng=Y(u),this.redraw(),this.fire("move",{oldLatLng:p,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(u){return this.options.radius=this._radius=u,this.redraw()},getRadius:function(){return this._radius},setStyle:function(u){var p=u&&u.radius||this._radius;return H.prototype.setStyle.call(this,u),this.setRadius(p),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var u=this._radius,p=this._radiusY||u,w=this._clickTolerance(),U=[u+w,p+w];this._pxBounds=new se(this._point.subtract(U),this._point.add(U))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(u){return u.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function le(u,p){return new V(u,p)}var me=V.extend({initialize:function(u,p,w){if(typeof p=="number"&&(p=r({},w,{radius:p})),y(this,p),this._latlng=Y(u),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(u){return this._mRadius=u,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var u=[this._radius,this._radiusY||this._radius];return new G(this._map.layerPointToLatLng(this._point.subtract(u)),this._map.layerPointToLatLng(this._point.add(u)))},setStyle:H.prototype.setStyle,_project:function(){var u=this._latlng.lng,p=this._latlng.lat,w=this._map,U=w.options.crs;if(U.distance===_.distance){var Q=Math.PI/180,de=this._mRadius/_.R/Q,Pe=w.project([p+de,u]),Le=w.project([p-de,u]),je=Pe.add(Le).divideBy(2),Ze=w.unproject(je).lat,dt=Math.acos((Math.cos(de*Q)-Math.sin(p*Q)*Math.sin(Ze*Q))/(Math.cos(p*Q)*Math.cos(Ze*Q)))/Q;(isNaN(dt)||dt===0)&&(dt=de/Math.cos(Math.PI/180*p)),this._point=je.subtract(w.getPixelOrigin()),this._radius=isNaN(dt)?0:je.x-w.project([Ze,u-dt]).x,this._radiusY=je.y-Pe.y}else{var At=U.unproject(U.project(this._latlng).subtract([this._mRadius,0]));this._point=w.latLngToLayerPoint(this._latlng),this._radius=this._point.x-w.latLngToLayerPoint(At).x}this._updateBounds()}});function xe(u,p,w){return new me(u,p,w)}var ie=H.extend({options:{smoothFactor:1,noClip:!1},initialize:function(u,p){y(this,p),this._setLatLngs(u)},getLatLngs:function(){return this._latlngs},setLatLngs:function(u){return this._setLatLngs(u),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(u){for(var p=1/0,w=null,U=Gc,Q,de,Pe=0,Le=this._parts.length;Pe<Le;Pe++)for(var je=this._parts[Pe],Ze=1,dt=je.length;Ze<dt;Ze++){Q=je[Ze-1],de=je[Ze];var At=U(u,Q,de,!0);At<p&&(p=At,w=U(u,Q,de))}return w&&(w.distance=Math.sqrt(p)),w},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Vy(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(u,p){return p=p||this._defaultShape(),u=Y(u),p.push(u),this._bounds.extend(u),this.redraw()},_setLatLngs:function(u){this._bounds=new G,this._latlngs=this._convertLatLngs(u)},_defaultShape:function(){return er(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(u){for(var p=[],w=er(u),U=0,Q=u.length;U<Q;U++)w?(p[U]=Y(u[U]),this._bounds.extend(p[U])):p[U]=this._convertLatLngs(u[U]);return p},_project:function(){var u=new se;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,u),this._bounds.isValid()&&u.isValid()&&(this._rawPxBounds=u,this._updateBounds())},_updateBounds:function(){var u=this._clickTolerance(),p=new re(u,u);this._rawPxBounds&&(this._pxBounds=new se([this._rawPxBounds.min.subtract(p),this._rawPxBounds.max.add(p)]))},_projectLatlngs:function(u,p,w){var U=u[0]instanceof K,Q=u.length,de,Pe;if(U){for(Pe=[],de=0;de<Q;de++)Pe[de]=this._map.latLngToLayerPoint(u[de]),w.extend(Pe[de]);p.push(Pe)}else for(de=0;de<Q;de++)this._projectLatlngs(u[de],p,w)},_clipPoints:function(){var u=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}var p=this._parts,w,U,Q,de,Pe,Le,je;for(w=0,Q=0,de=this._rings.length;w<de;w++)for(je=this._rings[w],U=0,Pe=je.length;U<Pe-1;U++)Le=Jy(je[U],je[U+1],u,U,!0),Le&&(p[Q]=p[Q]||[],p[Q].push(Le[0]),(Le[1]!==je[U+1]||U===Pe-2)&&(p[Q].push(Le[1]),Q++))}},_simplifyPoints:function(){for(var u=this._parts,p=this.options.smoothFactor,w=0,U=u.length;w<U;w++)u[w]=Pm(u[w],p)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(u,p){var w,U,Q,de,Pe,Le,je=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(w=0,de=this._parts.length;w<de;w++)for(Le=this._parts[w],U=0,Pe=Le.length,Q=Pe-1;U<Pe;Q=U++)if(!(!p&&U===0)&&Bm(u,Le[Q],Le[U])<=je)return!0;return!1}});function he(u,p){return new ie(u,p)}ie._flat=Qy;var _e=ie.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Gy(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(u){var p=ie.prototype._convertLatLngs.call(this,u),w=p.length;return w>=2&&p[0]instanceof K&&p[0].equals(p[w-1])&&p.pop(),p},_setLatLngs:function(u){ie.prototype._setLatLngs.call(this,u),er(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return er(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var u=this._renderer._bounds,p=this.options.weight,w=new re(p,p);if(u=new se(u.min.subtract(w),u.max.add(w)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(u))){if(this.options.noClip){this._parts=this._rings;return}for(var U=0,Q=this._rings.length,de;U<Q;U++)de=Ky(this._rings[U],u,!0),de.length&&this._parts.push(de)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(u){var p=!1,w,U,Q,de,Pe,Le,je,Ze;if(!this._pxBounds||!this._pxBounds.contains(u))return!1;for(de=0,je=this._parts.length;de<je;de++)for(w=this._parts[de],Pe=0,Ze=w.length,Le=Ze-1;Pe<Ze;Le=Pe++)U=w[Pe],Q=w[Le],U.y>u.y!=Q.y>u.y&&u.x<(Q.x-U.x)*(u.y-U.y)/(Q.y-U.y)+U.x&&(p=!p);return p||ie.prototype._containsPoint.call(this,u,!0)}});function ze(u,p){return new _e(u,p)}var qe=fo.extend({initialize:function(u,p){y(this,p),this._layers={},u&&this.addData(u)},addData:function(u){var p=B(u)?u:u.features,w,U,Q;if(p){for(w=0,U=p.length;w<U;w++)Q=p[w],(Q.geometries||Q.geometry||Q.features||Q.coordinates)&&this.addData(Q);return this}var de=this.options;if(de.filter&&!de.filter(u))return this;var Pe=Qe(u,de);return Pe?(Pe.feature=Ft(u),Pe.defaultOptions=Pe.options,this.resetStyle(Pe),de.onEachFeature&&de.onEachFeature(u,Pe),this.addLayer(Pe)):this},resetStyle:function(u){return u===void 0?this.eachLayer(this.resetStyle,this):(u.options=r({},u.defaultOptions),this._setLayerStyle(u,this.options.style),this)},setStyle:function(u){return this.eachLayer(function(p){this._setLayerStyle(p,u)},this)},_setLayerStyle:function(u,p){u.setStyle&&(typeof p=="function"&&(p=p(u.feature)),u.setStyle(p))}});function Qe(u,p){var w=u.type==="Feature"?u.geometry:u,U=w?w.coordinates:null,Q=[],de=p&&p.pointToLayer,Pe=p&&p.coordsToLatLng||it,Le,je,Ze,dt;if(!U&&!w)return null;switch(w.type){case"Point":return Le=Pe(U),et(de,u,Le,p);case"MultiPoint":for(Ze=0,dt=U.length;Ze<dt;Ze++)Le=Pe(U[Ze]),Q.push(et(de,u,Le,p));return new fo(Q);case"LineString":case"MultiLineString":return je=Et(U,w.type==="LineString"?0:1,Pe),new ie(je,p);case"Polygon":case"MultiPolygon":return je=Et(U,w.type==="Polygon"?1:2,Pe),new _e(je,p);case"GeometryCollection":for(Ze=0,dt=w.geometries.length;Ze<dt;Ze++){var At=Qe({geometry:w.geometries[Ze],type:"Feature",properties:u.properties},p);At&&Q.push(At)}return new fo(Q);case"FeatureCollection":for(Ze=0,dt=w.features.length;Ze<dt;Ze++){var Yt=Qe(w.features[Ze],p);Yt&&Q.push(Yt)}return new fo(Q);default:throw new Error("Invalid GeoJSON object.")}}function et(u,p,w,U){return u?u(p,w):new Yc(w,U&&U.markersInheritOptions&&U)}function it(u){return new K(u[1],u[0],u[2])}function Et(u,p,w){for(var U=[],Q=0,de=u.length,Pe;Q<de;Q++)Pe=p?Et(u[Q],p-1,w):(w||it)(u[Q]),U.push(Pe);return U}function Bt(u,p){return u=Y(u),u.alt!==void 0?[m(u.lng,p),m(u.lat,p),m(u.alt,p)]:[m(u.lng,p),m(u.lat,p)]}function qt(u,p,w,U){for(var Q=[],de=0,Pe=u.length;de<Pe;de++)Q.push(p?qt(u[de],er(u[de])?0:p-1,w,U):Bt(u[de],U));return!p&&w&&Q.length>0&&Q.push(Q[0].slice()),Q}function wt(u,p){return u.feature?r({},u.feature,{geometry:p}):Ft(p)}function Ft(u){return u.type==="Feature"||u.type==="FeatureCollection"?u:{type:"Feature",properties:{},geometry:u}}var St={toGeoJSON:function(u){return wt(this,{type:"Point",coordinates:Bt(this.getLatLng(),u)})}};Yc.include(St),me.include(St),V.include(St),ie.include({toGeoJSON:function(u){var p=!er(this._latlngs),w=qt(this._latlngs,p?1:0,!1,u);return wt(this,{type:(p?"Multi":"")+"LineString",coordinates:w})}}),_e.include({toGeoJSON:function(u){var p=!er(this._latlngs),w=p&&!er(this._latlngs[0]),U=qt(this._latlngs,w?2:p?1:0,!0,u);return p||(U=[U]),wt(this,{type:(w?"Multi":"")+"Polygon",coordinates:U})}}),ua.include({toMultiPoint:function(u){var p=[];return this.eachLayer(function(w){p.push(w.toGeoJSON(u).geometry.coordinates)}),wt(this,{type:"MultiPoint",coordinates:p})},toGeoJSON:function(u){var p=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(p==="MultiPoint")return this.toMultiPoint(u);var w=p==="GeometryCollection",U=[];return this.eachLayer(function(Q){if(Q.toGeoJSON){var de=Q.toGeoJSON(u);if(w)U.push(de.geometry);else{var Pe=Ft(de);Pe.type==="FeatureCollection"?U.push.apply(U,Pe.features):U.push(Pe)}}}),w?wt(this,{geometries:U,type:"GeometryCollection"}):{type:"FeatureCollection",features:U}}});function Mt(u,p){return new qe(u,p)}var Kt=Mt,qn=wr.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(u,p,w){this._url=u,this._bounds=ee(p),y(this,w)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Lt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Cn(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(u){return this.options.opacity=u,this._image&&this._updateOpacity(),this},setStyle:function(u){return u.opacity&&this.setOpacity(u.opacity),this},bringToFront:function(){return this._map&&co(this._image),this},bringToBack:function(){return this._map&&Di(this._image),this},setUrl:function(u){return this._url=u,this._image&&(this._image.src=u),this},setBounds:function(u){return this._bounds=ee(u),this._map&&this._reset(),this},getEvents:function(){var u={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var u=this._url.tagName==="IMG",p=this._image=u?this._url:an("img");if(Lt(p,"leaflet-image-layer"),this._zoomAnimated&&Lt(p,"leaflet-zoom-animated"),this.options.className&&Lt(p,this.options.className),p.onselectstart=h,p.onmousemove=h,p.onload=a(this.fire,this,"load"),p.onerror=a(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(p.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),u){this._url=p.src;return}p.src=this._url,p.alt=this.options.alt},_animateZoom:function(u){var p=this._map.getZoomScale(u.zoom),w=this._map._latLngBoundsToNewLayerBounds(this._bounds,u.zoom,u.center).min;fs(this._image,w,p)},_reset:function(){var u=this._image,p=new se(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),w=p.getSize();Hn(u,p.min),u.style.width=w.x+"px",u.style.height=w.y+"px"},_updateOpacity:function(){br(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var u=this.options.errorOverlayUrl;u&&this._url!==u&&(this._url=u,this._image.src=u)},getCenter:function(){return this._bounds.getCenter()}}),Ct=function(u,p,w){return new qn(u,p,w)},ut=qn.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var u=this._url.tagName==="VIDEO",p=this._image=u?this._url:an("video");if(Lt(p,"leaflet-image-layer"),this._zoomAnimated&&Lt(p,"leaflet-zoom-animated"),this.options.className&&Lt(p,this.options.className),p.onselectstart=h,p.onmousemove=h,p.onloadeddata=a(this.fire,this,"load"),u){for(var w=p.getElementsByTagName("source"),U=[],Q=0;Q<w.length;Q++)U.push(w[Q].src);this._url=w.length>0?U:[p.src];return}B(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(p.style,"objectFit")&&(p.style.objectFit="fill"),p.autoplay=!!this.options.autoplay,p.loop=!!this.options.loop,p.muted=!!this.options.muted,p.playsInline=!!this.options.playsInline;for(var de=0;de<this._url.length;de++){var Pe=an("source");Pe.src=this._url[de],p.appendChild(Pe)}}});function bi(u,p,w){return new ut(u,p,w)}var li=qn.extend({_initImage:function(){var u=this._image=this._url;Lt(u,"leaflet-image-layer"),this._zoomAnimated&&Lt(u,"leaflet-zoom-animated"),this.options.className&&Lt(u,this.options.className),u.onselectstart=h,u.onmousemove=h}});function Kn(u,p,w){return new li(u,p,w)}var Pn=wr.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(u,p){u&&(u instanceof K||B(u))?(this._latlng=Y(u),y(this,p)):(y(this,u),this._source=p),this.options.content&&(this._content=this.options.content)},openOn:function(u){return u=arguments.length?u:this._source._map,u.hasLayer(this)||u.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(u){return this._map?this.close():(arguments.length?this._source=u:u=this._source,this._prepareOpen(),this.openOn(u._map)),this},onAdd:function(u){this._zoomAnimated=u._zoomAnimated,this._container||this._initLayout(),u._fadeAnimated&&br(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),u._fadeAnimated&&br(this._container,1),this.bringToFront(),this.options.interactive&&(Lt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(u){u._fadeAnimated?(br(this._container,0),this._removeTimeout=setTimeout(a(Cn,void 0,this._container),200)):Cn(this._container),this.options.interactive&&(Wn(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(u){return this._latlng=Y(u),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(u){return this._content=u,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var u={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&co(this._container),this},bringToBack:function(){return this._map&&Di(this._container),this},_prepareOpen:function(u){var p=this._source;if(!p._map)return!1;if(p instanceof fo){p=null;var w=this._source._layers;for(var U in w)if(w[U]._map){p=w[U];break}if(!p)return!1;this._source=p}if(!u)if(p.getCenter)u=p.getCenter();else if(p.getLatLng)u=p.getLatLng();else if(p.getBounds)u=p.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(u),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var u=this._contentNode,p=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof p=="string")u.innerHTML=p;else{for(;u.hasChildNodes();)u.removeChild(u.firstChild);u.appendChild(p)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var u=this._map.latLngToLayerPoint(this._latlng),p=ce(this.options.offset),w=this._getAnchor();this._zoomAnimated?Hn(this._container,u.add(w)):p=p.add(u).add(w);var U=this._containerBottom=-p.y,Q=this._containerLeft=-Math.round(this._containerWidth/2)+p.x;this._container.style.bottom=U+"px",this._container.style.left=Q+"px"}},_getAnchor:function(){return[0,0]}});Rt.include({_initOverlay:function(u,p,w,U){var Q=p;return Q instanceof u||(Q=new u(U).setContent(p)),w&&Q.setLatLng(w),Q}}),wr.include({_initOverlay:function(u,p,w,U){var Q=w;return Q instanceof u?(y(Q,U),Q._source=this):(Q=p&&!U?p:new u(U,this),Q.setContent(w)),Q}});var Lr=Pn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(u){return u=arguments.length?u:this._source._map,!u.hasLayer(this)&&u._popup&&u._popup.options.autoClose&&u.removeLayer(u._popup),u._popup=this,Pn.prototype.openOn.call(this,u)},onAdd:function(u){Pn.prototype.onAdd.call(this,u),u.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof H||this._source.on("preclick",hs))},onRemove:function(u){Pn.prototype.onRemove.call(this,u),u.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof H||this._source.off("preclick",hs))},getEvents:function(){var u=Pn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(u.preclick=this.close),this.options.keepInView&&(u.moveend=this._adjustPan),u},_initLayout:function(){var u="leaflet-popup",p=this._container=an("div",u+" "+(this.options.className||"")+" leaflet-zoom-animated"),w=this._wrapper=an("div",u+"-content-wrapper",p);if(this._contentNode=an("div",u+"-content",w),qc(p),ei(this._contentNode),Dt(p,"contextmenu",hs),this._tipContainer=an("div",u+"-tip-container",p),this._tip=an("div",u+"-tip",this._tipContainer),this.options.closeButton){var U=this._closeButton=an("a",u+"-close-button",p);U.setAttribute("role","button"),U.setAttribute("aria-label","Close popup"),U.href="#close",U.innerHTML='<span aria-hidden="true">&#215;</span>',Dt(U,"click",function(Q){hi(Q),this.close()},this)}},_updateLayout:function(){var u=this._contentNode,p=u.style;p.width="",p.whiteSpace="nowrap";var w=u.offsetWidth;w=Math.min(w,this.options.maxWidth),w=Math.max(w,this.options.minWidth),p.width=w+1+"px",p.whiteSpace="",p.height="";var U=u.offsetHeight,Q=this.options.maxHeight,de="leaflet-popup-scrolled";Q&&U>Q?(p.height=Q+"px",Lt(u,de)):Wn(u,de),this._containerWidth=this._container.offsetWidth},_animateZoom:function(u){var p=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center),w=this._getAnchor();Hn(this._container,p.add(w))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var u=this._map,p=parseInt(ul(this._container,"marginBottom"),10)||0,w=this._container.offsetHeight+p,U=this._containerWidth,Q=new re(this._containerLeft,-w-this._containerBottom);Q._add(Ro(this._container));var de=u.layerPointToContainerPoint(Q),Pe=ce(this.options.autoPanPadding),Le=ce(this.options.autoPanPaddingTopLeft||Pe),je=ce(this.options.autoPanPaddingBottomRight||Pe),Ze=u.getSize(),dt=0,At=0;de.x+U+je.x>Ze.x&&(dt=de.x+U-Ze.x+je.x),de.x-dt-Le.x<0&&(dt=de.x-Le.x),de.y+w+je.y>Ze.y&&(At=de.y+w-Ze.y+je.y),de.y-At-Le.y<0&&(At=de.y-Le.y),(dt||At)&&(this.options.keepInView&&(this._autopanning=!0),u.fire("autopanstart").panBy([dt,At]))}},_getAnchor:function(){return ce(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),j1=function(u,p){return new Lr(u,p)};Rt.mergeOptions({closePopupOnClick:!0}),Rt.include({openPopup:function(u,p,w){return this._initOverlay(Lr,u,p,w).openOn(this),this},closePopup:function(u){return u=arguments.length?u:this._popup,u&&u.close(),this}}),wr.include({bindPopup:function(u,p){return this._popup=this._initOverlay(Lr,this._popup,u,p),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(u){return this._popup&&(this instanceof fo||(this._popup._source=this),this._popup._prepareOpen(u||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(u){return this._popup&&this._popup.setContent(u),this},getPopup:function(){return this._popup},_openPopup:function(u){if(!(!this._popup||!this._map)){ms(u);var p=u.layer||u.target;if(this._popup._source===p&&!(p instanceof H)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(u.latlng);return}this._popup._source=p,this.openPopup(u.latlng)}},_movePopup:function(u){this._popup.setLatLng(u.latlng)},_onKeyPress:function(u){u.originalEvent.keyCode===13&&this._openPopup(u)}});var ab=Pn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(u){Pn.prototype.onAdd.call(this,u),this.setOpacity(this.options.opacity),u.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(u){Pn.prototype.onRemove.call(this,u),u.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var u=Pn.prototype.getEvents.call(this);return this.options.permanent||(u.preclick=this.close),u},_initLayout:function(){var u="leaflet-tooltip",p=u+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=an("div",p),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+c(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(u){var p,w,U=this._map,Q=this._container,de=U.latLngToContainerPoint(U.getCenter()),Pe=U.layerPointToContainerPoint(u),Le=this.options.direction,je=Q.offsetWidth,Ze=Q.offsetHeight,dt=ce(this.options.offset),At=this._getAnchor();Le==="top"?(p=je/2,w=Ze):Le==="bottom"?(p=je/2,w=0):Le==="center"?(p=je/2,w=Ze/2):Le==="right"?(p=0,w=Ze/2):Le==="left"?(p=je,w=Ze/2):Pe.x<de.x?(Le="right",p=0,w=Ze/2):(Le="left",p=je+(dt.x+At.x)*2,w=Ze/2),u=u.subtract(ce(p,w,!0)).add(dt).add(At),Wn(Q,"leaflet-tooltip-right"),Wn(Q,"leaflet-tooltip-left"),Wn(Q,"leaflet-tooltip-top"),Wn(Q,"leaflet-tooltip-bottom"),Lt(Q,"leaflet-tooltip-"+Le),Hn(Q,u)},_updatePosition:function(){var u=this._map.latLngToLayerPoint(this._latlng);this._setPosition(u)},setOpacity:function(u){this.options.opacity=u,this._container&&br(this._container,u)},_animateZoom:function(u){var p=this._map._latLngToNewLayerPoint(this._latlng,u.zoom,u.center);this._setPosition(p)},_getAnchor:function(){return ce(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Y2e=function(u,p){return new ab(u,p)};Rt.include({openTooltip:function(u,p,w){return this._initOverlay(ab,u,p,w).openOn(this),this},closeTooltip:function(u){return u.close(),this}}),wr.include({bindTooltip:function(u,p){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(ab,this._tooltip,u,p),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(u){if(!(!u&&this._tooltipHandlersAdded)){var p=u?"off":"on",w={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?w.add=this._openTooltip:(w.mouseover=this._openTooltip,w.mouseout=this.closeTooltip,w.click=this._openTooltip,this._map?this._addFocusListeners():w.add=this._addFocusListeners),this._tooltip.options.sticky&&(w.mousemove=this._moveTooltip),this[p](w),this._tooltipHandlersAdded=!u}},openTooltip:function(u){return this._tooltip&&(this instanceof fo||(this._tooltip._source=this),this._tooltip._prepareOpen(u)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(u){return this._tooltip&&this._tooltip.setContent(u),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(u){var p=typeof u.getElement=="function"&&u.getElement();p&&(Dt(p,"focus",function(){this._tooltip._source=u,this.openTooltip()},this),Dt(p,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(u){var p=typeof u.getElement=="function"&&u.getElement();p&&p.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(u){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var p=this;this._map.once("moveend",function(){p._openOnceFlag=!1,p._openTooltip(u)});return}this._tooltip._source=u.layer||u.target,this.openTooltip(this._tooltip.options.sticky?u.latlng:void 0)}},_moveTooltip:function(u){var p=u.latlng,w,U;this._tooltip.options.sticky&&u.originalEvent&&(w=this._map.mouseEventToContainerPoint(u.originalEvent),U=this._map.containerPointToLayerPoint(w),p=this._map.layerPointToLatLng(U)),this._tooltip.setLatLng(p)}});var PR=fa.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(u){var p=u&&u.tagName==="DIV"?u:document.createElement("div"),w=this.options;if(w.html instanceof Element?(Ni(p),p.appendChild(w.html)):p.innerHTML=w.html!==!1?w.html:"",w.bgPos){var U=ce(w.bgPos);p.style.backgroundPosition=-U.x+"px "+-U.y+"px"}return this._setIconStyles(p,"icon"),p},createShadow:function(){return null}});function Z2e(u){return new PR(u)}fa.Default=yl;var Rm=wr.extend({options:{tileSize:256,opacity:1,updateWhenIdle:pt.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(u){y(this,u)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(u){u._addZoomLimit(this)},onRemove:function(u){this._removeAllTiles(),Cn(this._container),u._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(co(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(Di(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(u){return this.options.opacity=u,this._updateOpacity(),this},setZIndex:function(u){return this.options.zIndex=u,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var u=this._clampZoom(this._map.getZoom());u!==this._tileZoom&&(this._tileZoom=u,this._updateLevels()),this._update()}return this},getEvents:function(){var u={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),u.move=this._onMove),this._zoomAnimated&&(u.zoomanim=this._animateZoom),u},createTile:function(){return document.createElement("div")},getTileSize:function(){var u=this.options.tileSize;return u instanceof re?u:new re(u,u)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(u){for(var p=this.getPane().children,w=-u(-1/0,1/0),U=0,Q=p.length,de;U<Q;U++)de=p[U].style.zIndex,p[U]!==this._container&&de&&(w=u(w,+de));isFinite(w)&&(this.options.zIndex=w+u(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!pt.ielt9){br(this._container,this.options.opacity);var u=+new Date,p=!1,w=!1;for(var U in this._tiles){var Q=this._tiles[U];if(!(!Q.current||!Q.loaded)){var de=Math.min(1,(u-Q.loaded)/200);br(Q.el,de),de<1?p=!0:(Q.active?w=!0:this._onOpaqueTile(Q),Q.active=!0)}}w&&!this._noPrune&&this._pruneTiles(),p&&(O(this._fadeFrame),this._fadeFrame=I(this._updateOpacity,this))}},_onOpaqueTile:h,_initContainer:function(){this._container||(this._container=an("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var u=this._tileZoom,p=this.options.maxZoom;if(u!==void 0){for(var w in this._levels)w=Number(w),this._levels[w].el.children.length||w===u?(this._levels[w].el.style.zIndex=p-Math.abs(u-w),this._onUpdateLevel(w)):(Cn(this._levels[w].el),this._removeTilesAtZoom(w),this._onRemoveLevel(w),delete this._levels[w]);var U=this._levels[u],Q=this._map;return U||(U=this._levels[u]={},U.el=an("div","leaflet-tile-container leaflet-zoom-animated",this._container),U.el.style.zIndex=p,U.origin=Q.project(Q.unproject(Q.getPixelOrigin()),u).round(),U.zoom=u,this._setZoomTransform(U,Q.getCenter(),Q.getZoom()),h(U.el.offsetWidth),this._onCreateLevel(U)),this._level=U,U}},_onUpdateLevel:h,_onRemoveLevel:h,_onCreateLevel:h,_pruneTiles:function(){if(this._map){var u,p,w=this._map.getZoom();if(w>this.options.maxZoom||w<this.options.minZoom){this._removeAllTiles();return}for(u in this._tiles)p=this._tiles[u],p.retain=p.current;for(u in this._tiles)if(p=this._tiles[u],p.current&&!p.active){var U=p.coords;this._retainParent(U.x,U.y,U.z,U.z-5)||this._retainChildren(U.x,U.y,U.z,U.z+2)}for(u in this._tiles)this._tiles[u].retain||this._removeTile(u)}},_removeTilesAtZoom:function(u){for(var p in this._tiles)this._tiles[p].coords.z===u&&this._removeTile(p)},_removeAllTiles:function(){for(var u in this._tiles)this._removeTile(u)},_invalidateAll:function(){for(var u in this._levels)Cn(this._levels[u].el),this._onRemoveLevel(Number(u)),delete this._levels[u];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(u,p,w,U){var Q=Math.floor(u/2),de=Math.floor(p/2),Pe=w-1,Le=new re(+Q,+de);Le.z=+Pe;var je=this._tileCoordsToKey(Le),Ze=this._tiles[je];return Ze&&Ze.active?(Ze.retain=!0,!0):(Ze&&Ze.loaded&&(Ze.retain=!0),Pe>U?this._retainParent(Q,de,Pe,U):!1)},_retainChildren:function(u,p,w,U){for(var Q=2*u;Q<2*u+2;Q++)for(var de=2*p;de<2*p+2;de++){var Pe=new re(Q,de);Pe.z=w+1;var Le=this._tileCoordsToKey(Pe),je=this._tiles[Le];if(je&&je.active){je.retain=!0;continue}else je&&je.loaded&&(je.retain=!0);w+1<U&&this._retainChildren(Q,de,w+1,U)}},_resetView:function(u){var p=u&&(u.pinch||u.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),p,p)},_animateZoom:function(u){this._setView(u.center,u.zoom,!0,u.noUpdate)},_clampZoom:function(u){var p=this.options;return p.minNativeZoom!==void 0&&u<p.minNativeZoom?p.minNativeZoom:p.maxNativeZoom!==void 0&&p.maxNativeZoom<u?p.maxNativeZoom:u},_setView:function(u,p,w,U){var Q=Math.round(p);this.options.maxZoom!==void 0&&Q>this.options.maxZoom||this.options.minZoom!==void 0&&Q<this.options.minZoom?Q=void 0:Q=this._clampZoom(Q);var de=this.options.updateWhenZooming&&Q!==this._tileZoom;(!U||de)&&(this._tileZoom=Q,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),Q!==void 0&&this._update(u),w||this._pruneTiles(),this._noPrune=!!w),this._setZoomTransforms(u,p)},_setZoomTransforms:function(u,p){for(var w in this._levels)this._setZoomTransform(this._levels[w],u,p)},_setZoomTransform:function(u,p,w){var U=this._map.getZoomScale(w,u.zoom),Q=u.origin.multiplyBy(U).subtract(this._map._getNewPixelOrigin(p,w)).round();pt.any3d?fs(u.el,Q,U):Hn(u.el,Q)},_resetGrid:function(){var u=this._map,p=u.options.crs,w=this._tileSize=this.getTileSize(),U=this._tileZoom,Q=this._map.getPixelWorldBounds(this._tileZoom);Q&&(this._globalTileRange=this._pxBoundsToTileRange(Q)),this._wrapX=p.wrapLng&&!this.options.noWrap&&[Math.floor(u.project([0,p.wrapLng[0]],U).x/w.x),Math.ceil(u.project([0,p.wrapLng[1]],U).x/w.y)],this._wrapY=p.wrapLat&&!this.options.noWrap&&[Math.floor(u.project([p.wrapLat[0],0],U).y/w.x),Math.ceil(u.project([p.wrapLat[1],0],U).y/w.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(u){var p=this._map,w=p._animatingZoom?Math.max(p._animateToZoom,p.getZoom()):p.getZoom(),U=p.getZoomScale(w,this._tileZoom),Q=p.project(u,this._tileZoom).floor(),de=p.getSize().divideBy(U*2);return new se(Q.subtract(de),Q.add(de))},_update:function(u){var p=this._map;if(p){var w=this._clampZoom(p.getZoom());if(u===void 0&&(u=p.getCenter()),this._tileZoom!==void 0){var U=this._getTiledPixelBounds(u),Q=this._pxBoundsToTileRange(U),de=Q.getCenter(),Pe=[],Le=this.options.keepBuffer,je=new se(Q.getBottomLeft().subtract([Le,-Le]),Q.getTopRight().add([Le,-Le]));if(!(isFinite(Q.min.x)&&isFinite(Q.min.y)&&isFinite(Q.max.x)&&isFinite(Q.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Ze in this._tiles){var dt=this._tiles[Ze].coords;(dt.z!==this._tileZoom||!je.contains(new re(dt.x,dt.y)))&&(this._tiles[Ze].current=!1)}if(Math.abs(w-this._tileZoom)>1){this._setView(u,w);return}for(var At=Q.min.y;At<=Q.max.y;At++)for(var Yt=Q.min.x;Yt<=Q.max.x;Yt++){var tr=new re(Yt,At);if(tr.z=this._tileZoom,!!this._isValidTile(tr)){var xi=this._tiles[this._tileCoordsToKey(tr)];xi?xi.current=!0:Pe.push(tr)}}if(Pe.sort(function(_r,ju){return _r.distanceTo(de)-ju.distanceTo(de)}),Pe.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var ho=document.createDocumentFragment();for(Yt=0;Yt<Pe.length;Yt++)this._addTile(Pe[Yt],ho);this._level.el.appendChild(ho)}}}},_isValidTile:function(u){var p=this._map.options.crs;if(!p.infinite){var w=this._globalTileRange;if(!p.wrapLng&&(u.x<w.min.x||u.x>w.max.x)||!p.wrapLat&&(u.y<w.min.y||u.y>w.max.y))return!1}if(!this.options.bounds)return!0;var U=this._tileCoordsToBounds(u);return ee(this.options.bounds).overlaps(U)},_keyToBounds:function(u){return this._tileCoordsToBounds(this._keyToTileCoords(u))},_tileCoordsToNwSe:function(u){var p=this._map,w=this.getTileSize(),U=u.scaleBy(w),Q=U.add(w),de=p.unproject(U,u.z),Pe=p.unproject(Q,u.z);return[de,Pe]},_tileCoordsToBounds:function(u){var p=this._tileCoordsToNwSe(u),w=new G(p[0],p[1]);return this.options.noWrap||(w=this._map.wrapLatLngBounds(w)),w},_tileCoordsToKey:function(u){return u.x+":"+u.y+":"+u.z},_keyToTileCoords:function(u){var p=u.split(":"),w=new re(+p[0],+p[1]);return w.z=+p[2],w},_removeTile:function(u){var p=this._tiles[u];p&&(Cn(p.el),delete this._tiles[u],this.fire("tileunload",{tile:p.el,coords:this._keyToTileCoords(u)}))},_initTile:function(u){Lt(u,"leaflet-tile");var p=this.getTileSize();u.style.width=p.x+"px",u.style.height=p.y+"px",u.onselectstart=h,u.onmousemove=h,pt.ielt9&&this.options.opacity<1&&br(u,this.options.opacity)},_addTile:function(u,p){var w=this._getTilePos(u),U=this._tileCoordsToKey(u),Q=this.createTile(this._wrapCoords(u),a(this._tileReady,this,u));this._initTile(Q),this.createTile.length<2&&I(a(this._tileReady,this,u,null,Q)),Hn(Q,w),this._tiles[U]={el:Q,coords:u,current:!0},p.appendChild(Q),this.fire("tileloadstart",{tile:Q,coords:u})},_tileReady:function(u,p,w){p&&this.fire("tileerror",{error:p,tile:w,coords:u});var U=this._tileCoordsToKey(u);w=this._tiles[U],w&&(w.loaded=+new Date,this._map._fadeAnimated?(br(w.el,0),O(this._fadeFrame),this._fadeFrame=I(this._updateOpacity,this)):(w.active=!0,this._pruneTiles()),p||(Lt(w.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:w.el,coords:u})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),pt.ielt9||!this._map._fadeAnimated?I(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(u){return u.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(u){var p=new re(this._wrapX?f(u.x,this._wrapX):u.x,this._wrapY?f(u.y,this._wrapY):u.y);return p.z=u.z,p},_pxBoundsToTileRange:function(u){var p=this.getTileSize();return new se(u.min.unscaleBy(p).floor(),u.max.unscaleBy(p).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var u in this._tiles)if(!this._tiles[u].loaded)return!1;return!0}});function X2e(u){return new Rm(u)}var zu=Rm.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(u,p){this._url=u,p=y(this,p),p.detectRetina&&pt.retina&&p.maxZoom>0?(p.tileSize=Math.floor(p.tileSize/2),p.zoomReverse?(p.zoomOffset--,p.minZoom=Math.min(p.maxZoom,p.minZoom+1)):(p.zoomOffset++,p.maxZoom=Math.max(p.minZoom,p.maxZoom-1)),p.minZoom=Math.max(0,p.minZoom)):p.zoomReverse?p.minZoom=Math.min(p.maxZoom,p.minZoom):p.maxZoom=Math.max(p.minZoom,p.maxZoom),typeof p.subdomains=="string"&&(p.subdomains=p.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(u,p){return this._url===u&&p===void 0&&(p=!0),this._url=u,p||this.redraw(),this},createTile:function(u,p){var w=document.createElement("img");return Dt(w,"load",a(this._tileOnLoad,this,p,w)),Dt(w,"error",a(this._tileOnError,this,p,w)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(w.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(w.referrerPolicy=this.options.referrerPolicy),w.alt="",w.src=this.getTileUrl(u),w},getTileUrl:function(u){var p={r:pt.retina?"@2x":"",s:this._getSubdomain(u),x:u.x,y:u.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var w=this._globalTileRange.max.y-u.y;this.options.tms&&(p.y=w),p["-y"]=w}return M(this._url,r(p,this.options))},_tileOnLoad:function(u,p){pt.ielt9?setTimeout(a(u,this,null,p),0):u(null,p)},_tileOnError:function(u,p,w){var U=this.options.errorTileUrl;U&&p.getAttribute("src")!==U&&(p.src=U),u(w,p)},_onTileRemove:function(u){u.tile.onload=null},_getZoomForUrl:function(){var u=this._tileZoom,p=this.options.maxZoom,w=this.options.zoomReverse,U=this.options.zoomOffset;return w&&(u=p-u),u+U},_getSubdomain:function(u){var p=Math.abs(u.x+u.y)%this.options.subdomains.length;return this.options.subdomains[p]},_abortLoading:function(){var u,p;for(u in this._tiles)if(this._tiles[u].coords.z!==this._tileZoom&&(p=this._tiles[u].el,p.onload=h,p.onerror=h,!p.complete)){p.src=j;var w=this._tiles[u].coords;Cn(p),delete this._tiles[u],this.fire("tileabort",{tile:p,coords:w})}},_removeTile:function(u){var p=this._tiles[u];if(p)return p.el.setAttribute("src",j),Rm.prototype._removeTile.call(this,u)},_tileReady:function(u,p,w){if(!(!this._map||w&&w.getAttribute("src")===j))return Rm.prototype._tileReady.call(this,u,p,w)}});function BR(u,p){return new zu(u,p)}var NR=zu.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(u,p){this._url=u;var w=r({},this.defaultWmsParams);for(var U in p)U in this.options||(w[U]=p[U]);p=y(this,p);var Q=p.detectRetina&&pt.retina?2:1,de=this.getTileSize();w.width=de.x*Q,w.height=de.y*Q,this.wmsParams=w},onAdd:function(u){this._crs=this.options.crs||u.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var p=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[p]=this._crs.code,zu.prototype.onAdd.call(this,u)},getTileUrl:function(u){var p=this._tileCoordsToNwSe(u),w=this._crs,U=z(w.project(p[0]),w.project(p[1])),Q=U.min,de=U.max,Pe=(this._wmsVersion>=1.3&&this._crs===Dm?[Q.y,Q.x,de.y,de.x]:[Q.x,Q.y,de.x,de.y]).join(","),Le=zu.prototype.getTileUrl.call(this,u);return Le+A(this.wmsParams,Le,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+Pe},setParams:function(u,p){return r(this.wmsParams,u),p||this.redraw(),this}});function J2e(u,p){return new NR(u,p)}zu.WMS=NR,BR.wms=J2e;var ha=wr.extend({options:{padding:.1},initialize:function(u){y(this,u),c(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Lt(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var u={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(u.zoomanim=this._onAnimZoom),u},_onAnimZoom:function(u){this._updateTransform(u.center,u.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(u,p){var w=this._map.getZoomScale(p,this._zoom),U=this._map.getSize().multiplyBy(.5+this.options.padding),Q=this._map.project(this._center,p),de=U.multiplyBy(-w).add(Q).subtract(this._map._getNewPixelOrigin(u,p));pt.any3d?fs(this._container,de,w):Hn(this._container,de)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var u in this._layers)this._layers[u]._reset()},_onZoomEnd:function(){for(var u in this._layers)this._layers[u]._project()},_updatePaths:function(){for(var u in this._layers)this._layers[u]._update()},_update:function(){var u=this.options.padding,p=this._map.getSize(),w=this._map.containerPointToLayerPoint(p.multiplyBy(-u)).round();this._bounds=new se(w,w.add(p.multiplyBy(1+u*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),DR=ha.extend({options:{tolerance:0},getEvents:function(){var u=ha.prototype.getEvents.call(this);return u.viewprereset=this._onViewPreReset,u},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ha.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var u=this._container=document.createElement("canvas");Dt(u,"mousemove",this._onMouseMove,this),Dt(u,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Dt(u,"mouseout",this._handleMouseOut,this),u._leaflet_disable_events=!0,this._ctx=u.getContext("2d")},_destroyContainer:function(){O(this._redrawRequest),delete this._ctx,Cn(this._container),_n(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var u;this._redrawBounds=null;for(var p in this._layers)u=this._layers[p],u._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ha.prototype._update.call(this);var u=this._bounds,p=this._container,w=u.getSize(),U=pt.retina?2:1;Hn(p,u.min),p.width=U*w.x,p.height=U*w.y,p.style.width=w.x+"px",p.style.height=w.y+"px",pt.retina&&this._ctx.scale(2,2),this._ctx.translate(-u.min.x,-u.min.y),this.fire("update")}},_reset:function(){ha.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(u){this._updateDashArray(u),this._layers[c(u)]=u;var p=u._order={layer:u,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=p),this._drawLast=p,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(u){this._requestRedraw(u)},_removePath:function(u){var p=u._order,w=p.next,U=p.prev;w?w.prev=U:this._drawLast=U,U?U.next=w:this._drawFirst=w,delete u._order,delete this._layers[c(u)],this._requestRedraw(u)},_updatePath:function(u){this._extendRedrawBounds(u),u._project(),u._update(),this._requestRedraw(u)},_updateStyle:function(u){this._updateDashArray(u),this._requestRedraw(u)},_updateDashArray:function(u){if(typeof u.options.dashArray=="string"){var p=u.options.dashArray.split(/[, ]+/),w=[],U,Q;for(Q=0;Q<p.length;Q++){if(U=Number(p[Q]),isNaN(U))return;w.push(U)}u.options._dashArray=w}else u.options._dashArray=u.options.dashArray},_requestRedraw:function(u){this._map&&(this._extendRedrawBounds(u),this._redrawRequest=this._redrawRequest||I(this._redraw,this))},_extendRedrawBounds:function(u){if(u._pxBounds){var p=(u.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new se,this._redrawBounds.extend(u._pxBounds.min.subtract([p,p])),this._redrawBounds.extend(u._pxBounds.max.add([p,p]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var u=this._redrawBounds;if(u){var p=u.getSize();this._ctx.clearRect(u.min.x,u.min.y,p.x,p.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var u,p=this._redrawBounds;if(this._ctx.save(),p){var w=p.getSize();this._ctx.beginPath(),this._ctx.rect(p.min.x,p.min.y,w.x,w.y),this._ctx.clip()}this._drawing=!0;for(var U=this._drawFirst;U;U=U.next)u=U.layer,(!p||u._pxBounds&&u._pxBounds.intersects(p))&&u._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(u,p){if(this._drawing){var w,U,Q,de,Pe=u._parts,Le=Pe.length,je=this._ctx;if(Le){for(je.beginPath(),w=0;w<Le;w++){for(U=0,Q=Pe[w].length;U<Q;U++)de=Pe[w][U],je[U?"lineTo":"moveTo"](de.x,de.y);p&&je.closePath()}this._fillStroke(je,u)}}},_updateCircle:function(u){if(!(!this._drawing||u._empty())){var p=u._point,w=this._ctx,U=Math.max(Math.round(u._radius),1),Q=(Math.max(Math.round(u._radiusY),1)||U)/U;Q!==1&&(w.save(),w.scale(1,Q)),w.beginPath(),w.arc(p.x,p.y/Q,U,0,Math.PI*2,!1),Q!==1&&w.restore(),this._fillStroke(w,u)}},_fillStroke:function(u,p){var w=p.options;w.fill&&(u.globalAlpha=w.fillOpacity,u.fillStyle=w.fillColor||w.color,u.fill(w.fillRule||"evenodd")),w.stroke&&w.weight!==0&&(u.setLineDash&&u.setLineDash(p.options&&p.options._dashArray||[]),u.globalAlpha=w.opacity,u.lineWidth=w.weight,u.strokeStyle=w.color,u.lineCap=w.lineCap,u.lineJoin=w.lineJoin,u.stroke())},_onClick:function(u){for(var p=this._map.mouseEventToLayerPoint(u),w,U,Q=this._drawFirst;Q;Q=Q.next)w=Q.layer,w.options.interactive&&w._containsPoint(p)&&(!(u.type==="click"||u.type==="preclick")||!this._map._draggableMoved(w))&&(U=w);this._fireEvent(U?[U]:!1,u)},_onMouseMove:function(u){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var p=this._map.mouseEventToLayerPoint(u);this._handleMouseHover(u,p)}},_handleMouseOut:function(u){var p=this._hoveredLayer;p&&(Wn(this._container,"leaflet-interactive"),this._fireEvent([p],u,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(u,p){if(!this._mouseHoverThrottled){for(var w,U,Q=this._drawFirst;Q;Q=Q.next)w=Q.layer,w.options.interactive&&w._containsPoint(p)&&(U=w);U!==this._hoveredLayer&&(this._handleMouseOut(u),U&&(Lt(this._container,"leaflet-interactive"),this._fireEvent([U],u,"mouseover"),this._hoveredLayer=U)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,u),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(u,p,w){this._map._fireDOMEvent(p,w||p.type,u)},_bringToFront:function(u){var p=u._order;if(p){var w=p.next,U=p.prev;if(w)w.prev=U;else return;U?U.next=w:w&&(this._drawFirst=w),p.prev=this._drawLast,this._drawLast.next=p,p.next=null,this._drawLast=p,this._requestRedraw(u)}},_bringToBack:function(u){var p=u._order;if(p){var w=p.next,U=p.prev;if(U)U.next=w;else return;w?w.prev=U:U&&(this._drawLast=U),p.prev=null,p.next=this._drawFirst,this._drawFirst.prev=p,this._drawFirst=p,this._requestRedraw(u)}}});function MR(u){return pt.canvas?new DR(u):null}var Im=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(u){return document.createElement("<lvml:"+u+' class="lvml">')}}catch{}return function(u){return document.createElement("<"+u+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Q2e={_initContainer:function(){this._container=an("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ha.prototype._update.call(this),this.fire("update"))},_initPath:function(u){var p=u._container=Im("shape");Lt(p,"leaflet-vml-shape "+(this.options.className||"")),p.coordsize="1 1",u._path=Im("path"),p.appendChild(u._path),this._updateStyle(u),this._layers[c(u)]=u},_addPath:function(u){var p=u._container;this._container.appendChild(p),u.options.interactive&&u.addInteractiveTarget(p)},_removePath:function(u){var p=u._container;Cn(p),u.removeInteractiveTarget(p),delete this._layers[c(u)]},_updateStyle:function(u){var p=u._stroke,w=u._fill,U=u.options,Q=u._container;Q.stroked=!!U.stroke,Q.filled=!!U.fill,U.stroke?(p||(p=u._stroke=Im("stroke")),Q.appendChild(p),p.weight=U.weight+"px",p.color=U.color,p.opacity=U.opacity,U.dashArray?p.dashStyle=B(U.dashArray)?U.dashArray.join(" "):U.dashArray.replace(/( *, *)/g," "):p.dashStyle="",p.endcap=U.lineCap.replace("butt","flat"),p.joinstyle=U.lineJoin):p&&(Q.removeChild(p),u._stroke=null),U.fill?(w||(w=u._fill=Im("fill")),Q.appendChild(w),w.color=U.fillColor||U.color,w.opacity=U.fillOpacity):w&&(Q.removeChild(w),u._fill=null)},_updateCircle:function(u){var p=u._point.round(),w=Math.round(u._radius),U=Math.round(u._radiusY||w);this._setPath(u,u._empty()?"M0 0":"AL "+p.x+","+p.y+" "+w+","+U+" 0,"+65535*360)},_setPath:function(u,p){u._path.v=p},_bringToFront:function(u){co(u._container)},_bringToBack:function(u){Di(u._container)}},lb=pt.vml?Im:J,Om=ha.extend({_initContainer:function(){this._container=lb("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=lb("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Cn(this._container),_n(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ha.prototype._update.call(this);var u=this._bounds,p=u.getSize(),w=this._container;(!this._svgSize||!this._svgSize.equals(p))&&(this._svgSize=p,w.setAttribute("width",p.x),w.setAttribute("height",p.y)),Hn(w,u.min),w.setAttribute("viewBox",[u.min.x,u.min.y,p.x,p.y].join(" ")),this.fire("update")}},_initPath:function(u){var p=u._path=lb("path");u.options.className&&Lt(p,u.options.className),u.options.interactive&&Lt(p,"leaflet-interactive"),this._updateStyle(u),this._layers[c(u)]=u},_addPath:function(u){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(u._path),u.addInteractiveTarget(u._path)},_removePath:function(u){Cn(u._path),u.removeInteractiveTarget(u._path),delete this._layers[c(u)]},_updatePath:function(u){u._project(),u._update()},_updateStyle:function(u){var p=u._path,w=u.options;p&&(w.stroke?(p.setAttribute("stroke",w.color),p.setAttribute("stroke-opacity",w.opacity),p.setAttribute("stroke-width",w.weight),p.setAttribute("stroke-linecap",w.lineCap),p.setAttribute("stroke-linejoin",w.lineJoin),w.dashArray?p.setAttribute("stroke-dasharray",w.dashArray):p.removeAttribute("stroke-dasharray"),w.dashOffset?p.setAttribute("stroke-dashoffset",w.dashOffset):p.removeAttribute("stroke-dashoffset")):p.setAttribute("stroke","none"),w.fill?(p.setAttribute("fill",w.fillColor||w.color),p.setAttribute("fill-opacity",w.fillOpacity),p.setAttribute("fill-rule",w.fillRule||"evenodd")):p.setAttribute("fill","none"))},_updatePoly:function(u,p){this._setPath(u,fe(u._parts,p))},_updateCircle:function(u){var p=u._point,w=Math.max(Math.round(u._radius),1),U=Math.max(Math.round(u._radiusY),1)||w,Q="a"+w+","+U+" 0 1,0 ",de=u._empty()?"M0 0":"M"+(p.x-w)+","+p.y+Q+w*2+",0 "+Q+-w*2+",0 ";this._setPath(u,de)},_setPath:function(u,p){u._path.setAttribute("d",p)},_bringToFront:function(u){co(u._path)},_bringToBack:function(u){Di(u._path)}});pt.vml&&Om.include(Q2e);function RR(u){return pt.svg||pt.vml?new Om(u):null}Rt.include({getRenderer:function(u){var p=u.options.renderer||this._getPaneRenderer(u.options.pane)||this.options.renderer||this._renderer;return p||(p=this._renderer=this._createRenderer()),this.hasLayer(p)||this.addLayer(p),p},_getPaneRenderer:function(u){if(u==="overlayPane"||u===void 0)return!1;var p=this._paneRenderers[u];return p===void 0&&(p=this._createRenderer({pane:u}),this._paneRenderers[u]=p),p},_createRenderer:function(u){return this.options.preferCanvas&&MR(u)||RR(u)}});var IR=_e.extend({initialize:function(u,p){_e.prototype.initialize.call(this,this._boundsToLatLngs(u),p)},setBounds:function(u){return this.setLatLngs(this._boundsToLatLngs(u))},_boundsToLatLngs:function(u){return u=ee(u),[u.getSouthWest(),u.getNorthWest(),u.getNorthEast(),u.getSouthEast()]}});function V2e(u,p){return new IR(u,p)}Om.create=lb,Om.pointsToPath=fe,qe.geometryToLayer=Qe,qe.coordsToLatLng=it,qe.coordsToLatLngs=Et,qe.latLngToCoords=Bt,qe.latLngsToCoords=qt,qe.getFeature=wt,qe.asFeature=Ft,Rt.mergeOptions({boxZoom:!0});var OR=uo.extend({initialize:function(u){this._map=u,this._container=u._container,this._pane=u._panes.overlayPane,this._resetStateTimeout=0,u.on("unload",this._destroy,this)},addHooks:function(){Dt(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){_n(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Cn(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(u){if(!u.shiftKey||u.which!==1&&u.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),la(),vr(),this._startPoint=this._map.mouseEventToContainerPoint(u),Dt(document,{contextmenu:ms,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(u){this._moved||(this._moved=!0,this._box=an("div","leaflet-zoom-box",this._container),Lt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(u);var p=new se(this._point,this._startPoint),w=p.getSize();Hn(this._box,p.min),this._box.style.width=w.x+"px",this._box.style.height=w.y+"px"},_finish:function(){this._moved&&(Cn(this._box),Wn(this._container,"leaflet-crosshair")),zc(),fl(),_n(document,{contextmenu:ms,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(u){if(!(u.which!==1&&u.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0);var p=new G(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(p).fire("boxzoomend",{boxZoomBounds:p})}},_onKeyDown:function(u){u.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Rt.addInitHook("addHandler","boxZoom",OR),Rt.mergeOptions({doubleClickZoom:!0});var LR=uo.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(u){var p=this._map,w=p.getZoom(),U=p.options.zoomDelta,Q=u.originalEvent.shiftKey?w-U:w+U;p.options.doubleClickZoom==="center"?p.setZoom(Q):p.setZoomAround(u.containerPoint,Q)}});Rt.addInitHook("addHandler","doubleClickZoom",LR),Rt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var FR=uo.extend({addHooks:function(){if(!this._draggable){var u=this._map;this._draggable=new ps(u._mapPane,u._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),u.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),u.on("zoomend",this._onZoomEnd,this),u.whenReady(this._onZoomEnd,this))}Lt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Wn(this._map._container,"leaflet-grab"),Wn(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var u=this._map;if(u._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var p=ee(this._map.options.maxBounds);this._offsetLimit=z(this._map.latLngToContainerPoint(p.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(p.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;u.fire("movestart").fire("dragstart"),u.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(u){if(this._map.options.inertia){var p=this._lastTime=+new Date,w=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(w),this._times.push(p),this._prunePositions(p)}this._map.fire("move",u).fire("drag",u)},_prunePositions:function(u){for(;this._positions.length>1&&u-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var u=this._map.getSize().divideBy(2),p=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=p.subtract(u).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(u,p){return u-(u-p)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var u=this._draggable._newPos.subtract(this._draggable._startPos),p=this._offsetLimit;u.x<p.min.x&&(u.x=this._viscousLimit(u.x,p.min.x)),u.y<p.min.y&&(u.y=this._viscousLimit(u.y,p.min.y)),u.x>p.max.x&&(u.x=this._viscousLimit(u.x,p.max.x)),u.y>p.max.y&&(u.y=this._viscousLimit(u.y,p.max.y)),this._draggable._newPos=this._draggable._startPos.add(u)}},_onPreDragWrap:function(){var u=this._worldWidth,p=Math.round(u/2),w=this._initialWorldOffset,U=this._draggable._newPos.x,Q=(U-p+w)%u+p-w,de=(U+p+w)%u-p-w,Pe=Math.abs(Q+w)<Math.abs(de+w)?Q:de;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=Pe},_onDragEnd:function(u){var p=this._map,w=p.options,U=!w.inertia||u.noInertia||this._times.length<2;if(p.fire("dragend",u),U)p.fire("moveend");else{this._prunePositions(+new Date);var Q=this._lastPos.subtract(this._positions[0]),de=(this._lastTime-this._times[0])/1e3,Pe=w.easeLinearity,Le=Q.multiplyBy(Pe/de),je=Le.distanceTo([0,0]),Ze=Math.min(w.inertiaMaxSpeed,je),dt=Le.multiplyBy(Ze/je),At=Ze/(w.inertiaDeceleration*Pe),Yt=dt.multiplyBy(-At/2).round();!Yt.x&&!Yt.y?p.fire("moveend"):(Yt=p._limitOffset(Yt,p.options.maxBounds),I(function(){p.panBy(Yt,{duration:At,easeLinearity:Pe,noMoveStart:!0,animate:!0})}))}}});Rt.addInitHook("addHandler","dragging",FR),Rt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var $R=uo.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(u){this._map=u,this._setPanDelta(u.options.keyboardPanDelta),this._setZoomDelta(u.options.zoomDelta)},addHooks:function(){var u=this._map._container;u.tabIndex<=0&&(u.tabIndex="0"),Dt(u,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),_n(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var u=document.body,p=document.documentElement,w=u.scrollTop||p.scrollTop,U=u.scrollLeft||p.scrollLeft;this._map._container.focus(),window.scrollTo(U,w)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(u){var p=this._panKeys={},w=this.keyCodes,U,Q;for(U=0,Q=w.left.length;U<Q;U++)p[w.left[U]]=[-1*u,0];for(U=0,Q=w.right.length;U<Q;U++)p[w.right[U]]=[u,0];for(U=0,Q=w.down.length;U<Q;U++)p[w.down[U]]=[0,u];for(U=0,Q=w.up.length;U<Q;U++)p[w.up[U]]=[0,-1*u]},_setZoomDelta:function(u){var p=this._zoomKeys={},w=this.keyCodes,U,Q;for(U=0,Q=w.zoomIn.length;U<Q;U++)p[w.zoomIn[U]]=u;for(U=0,Q=w.zoomOut.length;U<Q;U++)p[w.zoomOut[U]]=-u},_addHooks:function(){Dt(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){_n(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(u){if(!(u.altKey||u.ctrlKey||u.metaKey)){var p=u.keyCode,w=this._map,U;if(p in this._panKeys){if(!w._panAnim||!w._panAnim._inProgress)if(U=this._panKeys[p],u.shiftKey&&(U=ce(U).multiplyBy(3)),w.options.maxBounds&&(U=w._limitOffset(ce(U),w.options.maxBounds)),w.options.worldCopyJump){var Q=w.wrapLatLng(w.unproject(w.project(w.getCenter()).add(U)));w.panTo(Q)}else w.panBy(U)}else if(p in this._zoomKeys)w.setZoom(w.getZoom()+(u.shiftKey?3:1)*this._zoomKeys[p]);else if(p===27&&w._popup&&w._popup.options.closeOnEscapeKey)w.closePopup();else return;ms(u)}}});Rt.addInitHook("addHandler","keyboard",$R),Rt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var zR=uo.extend({addHooks:function(){Dt(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){_n(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(u){var p=jy(u),w=this._map.options.wheelDebounceTime;this._delta+=p,this._lastMousePos=this._map.mouseEventToContainerPoint(u),this._startTime||(this._startTime=+new Date);var U=Math.max(w-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),U),ms(u)},_performZoom:function(){var u=this._map,p=u.getZoom(),w=this._map.options.zoomSnap||0;u._stop();var U=this._delta/(this._map.options.wheelPxPerZoomLevel*4),Q=4*Math.log(2/(1+Math.exp(-Math.abs(U))))/Math.LN2,de=w?Math.ceil(Q/w)*w:Q,Pe=u._limitZoom(p+(this._delta>0?de:-de))-p;this._delta=0,this._startTime=null,Pe&&(u.options.scrollWheelZoom==="center"?u.setZoom(p+Pe):u.setZoomAround(this._lastMousePos,p+Pe))}});Rt.addInitHook("addHandler","scrollWheelZoom",zR);var eSe=600;Rt.mergeOptions({tapHold:pt.touchNative&&pt.safari&&pt.mobile,tapTolerance:15});var jR=uo.extend({addHooks:function(){Dt(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){_n(this._map._container,"touchstart",this._onDown,this)},_onDown:function(u){if(clearTimeout(this._holdTimeout),u.touches.length===1){var p=u.touches[0];this._startPos=this._newPos=new re(p.clientX,p.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(Dt(document,"touchend",hi),Dt(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",p))},this),eSe),Dt(document,"touchend touchcancel contextmenu",this._cancel,this),Dt(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function u(){_n(document,"touchend",hi),_n(document,"touchend touchcancel",u)},_cancel:function(){clearTimeout(this._holdTimeout),_n(document,"touchend touchcancel contextmenu",this._cancel,this),_n(document,"touchmove",this._onMove,this)},_onMove:function(u){var p=u.touches[0];this._newPos=new re(p.clientX,p.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(u,p){var w=new MouseEvent(u,{bubbles:!0,cancelable:!0,view:window,screenX:p.screenX,screenY:p.screenY,clientX:p.clientX,clientY:p.clientY});w._simulated=!0,p.target.dispatchEvent(w)}});Rt.addInitHook("addHandler","tapHold",jR),Rt.mergeOptions({touchZoom:pt.touch,bounceAtZoomLimits:!0});var UR=uo.extend({addHooks:function(){Lt(this._map._container,"leaflet-touch-zoom"),Dt(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Wn(this._map._container,"leaflet-touch-zoom"),_n(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(u){var p=this._map;if(!(!u.touches||u.touches.length!==2||p._animatingZoom||this._zooming)){var w=p.mouseEventToContainerPoint(u.touches[0]),U=p.mouseEventToContainerPoint(u.touches[1]);this._centerPoint=p.getSize()._divideBy(2),this._startLatLng=p.containerPointToLatLng(this._centerPoint),p.options.touchZoom!=="center"&&(this._pinchStartLatLng=p.containerPointToLatLng(w.add(U)._divideBy(2))),this._startDist=w.distanceTo(U),this._startZoom=p.getZoom(),this._moved=!1,this._zooming=!0,p._stop(),Dt(document,"touchmove",this._onTouchMove,this),Dt(document,"touchend touchcancel",this._onTouchEnd,this),hi(u)}},_onTouchMove:function(u){if(!(!u.touches||u.touches.length!==2||!this._zooming)){var p=this._map,w=p.mouseEventToContainerPoint(u.touches[0]),U=p.mouseEventToContainerPoint(u.touches[1]),Q=w.distanceTo(U)/this._startDist;if(this._zoom=p.getScaleZoom(Q,this._startZoom),!p.options.bounceAtZoomLimits&&(this._zoom<p.getMinZoom()&&Q<1||this._zoom>p.getMaxZoom()&&Q>1)&&(this._zoom=p._limitZoom(this._zoom)),p.options.touchZoom==="center"){if(this._center=this._startLatLng,Q===1)return}else{var de=w._add(U)._divideBy(2)._subtract(this._centerPoint);if(Q===1&&de.x===0&&de.y===0)return;this._center=p.unproject(p.project(this._pinchStartLatLng,this._zoom).subtract(de),this._zoom)}this._moved||(p._moveStart(!0,!1),this._moved=!0),O(this._animRequest);var Pe=a(p._move,p,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=I(Pe,this,!0),hi(u)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,O(this._animRequest),_n(document,"touchmove",this._onTouchMove,this),_n(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Rt.addInitHook("addHandler","touchZoom",UR),Rt.BoxZoom=OR,Rt.DoubleClickZoom=LR,Rt.Drag=FR,Rt.Keyboard=$R,Rt.ScrollWheelZoom=zR,Rt.TapHold=jR,Rt.TouchZoom=UR,n.Bounds=se,n.Browser=pt,n.CRS=F,n.Canvas=DR,n.Circle=me,n.CircleMarker=V,n.Class=X,n.Control=Or,n.DivIcon=PR,n.DivOverlay=Pn,n.DomEvent=R1,n.DomUtil=M1,n.Draggable=ps,n.Evented=te,n.FeatureGroup=fo,n.GeoJSON=qe,n.GridLayer=Rm,n.Handler=uo,n.Icon=fa,n.ImageOverlay=qn,n.LatLng=K,n.LatLngBounds=G,n.Layer=wr,n.LayerGroup=ua,n.LineUtil=da,n.Map=Rt,n.Marker=Yc,n.Mixin=L1,n.Path=H,n.Point=re,n.PolyUtil=F1,n.Polygon=_e,n.Polyline=ie,n.Popup=Lr,n.PosAnimation=Kc,n.Projection=eb,n.Rectangle=IR,n.Renderer=ha,n.SVG=Om,n.SVGOverlay=li,n.TileLayer=zu,n.Tooltip=ab,n.Transformation=S,n.Util=q,n.VideoOverlay=ut,n.bind=a,n.bounds=z,n.canvas=MR,n.circle=xe,n.circleMarker=le,n.control=hl,n.divIcon=Z2e,n.extend=r,n.featureGroup=rb,n.geoJSON=Mt,n.geoJson=Kt,n.gridLayer=X2e,n.icon=ob,n.imageOverlay=Ct,n.latLng=Y,n.latLngBounds=ee,n.layerGroup=ib,n.map=I1,n.marker=sb,n.point=ce,n.polygon=ze,n.polyline=he,n.popup=j1,n.rectangle=V2e,n.setOptions=y,n.stamp=c,n.svg=RR,n.svgOverlay=Kn,n.tileLayer=BR,n.tooltip=Y2e,n.transformation=T,n.version=i,n.videoOverlay=bi;var tSe=window.L;n.noConflict=function(){return window.L=tSe,this},window.L=n}))})(Ff,Ff.exports)),Ff.exports}var HG=WG();const rw=Xm(HG),qG={class:"flex flex-col gap-1 w-full relative"},KG={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer mb-1"},GG={class:"flex items-center justify-between mb-0.5"},YG={key:0,class:"text-sm font-medium text-gray-700 dark:text-gray-200"},ZG={key:0,class:"ml-1 text-destructive"},XG={key:0,class:"flex flex-col gap-2 mb-2 w-full relative"},JG={class:"flex flex-col sm:flex-row gap-2 w-full relative"},QG={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400 h-10 flex items-center"},VG={key:0},eY={key:1},tY={key:2},nY={key:1,class:"flex-1 grid grid-cols-2 gap-2"},iY=["disabled"],rY=["disabled"],oY={class:"flex gap-2 flex-shrink-0"},sY={key:0,class:"absolute inset-0 z-[1001] bg-transparent cursor-not-allowed pointer-events-auto"},aY={key:1,class:"absolute bottom-2.5 left-2.5 z-[1000] bg-white/95 dark:bg-neutral-900/95 backdrop-blur-sm border border-gray-200 dark:border-neutral-800 rounded-md px-2.5 py-1 text-[11px] font-mono text-gray-700 dark:text-gray-300 shadow-md flex items-center gap-1.5 pointer-events-none select-none"},lY={key:1,class:"text-xs text-destructive mt-1"},kg=o.defineComponent({name:"DCodeMapField",inheritAttrs:!1,__name:"DCodeMapField",props:{modelValue:{},valueFormat:{default:"object-lat-lng"},label:{},placeholder:{default:"Cari alamat atau lokasi..."},disabled:{type:[Boolean,String],default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},height:{default:"320px"},zoom:{default:13},defaultLat:{default:-.9492},defaultLng:{default:100.42},enableSearch:{type:Boolean,default:!0},enableCurrentLocation:{type:Boolean,default:!0},enableManualInput:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=o.useAttrs(),i=e,r=t,a=`app-map-container-${Math.random().toString(36).slice(2,7)}`,l=o.computed(()=>i.label??n.label),c=o.computed(()=>{const z=n.required,G=n["aria-required"];return z===""||z===!0||z==="true"||G==="true"||G===!0||i.required}),d=o.ref(!1),f=o.ref(!1),h=o.ref([]),m=o.ref(null),g=o.ref(""),v=o.ref(""),y=o.ref(""),A=o.ref(i.enableManualInput?"manual":"search");o.watch(()=>[i.enableSearch,i.enableManualInput],()=>{i.enableManualInput?A.value="manual":A.value="search"},{immediate:!0});let C=null,M=null,B=null,N=null;const j=z=>{if(!z)return null;if(typeof z=="object"){if(Array.isArray(z)){if(z.length>=2){const K=Number(z[0]),Y=Number(z[1]);if(!isNaN(K)&&!isNaN(Y))return i.valueFormat==="array-lng-lat"?{lat:Y,lng:K}:{lat:K,lng:Y}}return null}const G=Number(z.lat!==void 0?z.lat:z.latitude),ee=Number(z.lng!==void 0?z.lng:z.longitude);if(!isNaN(G)&&!isNaN(ee))return{lat:G,lng:ee}}else if(typeof z=="string"){const G=z.split(",").map(ee=>Number(ee.trim()));if(G.length>=2&&!isNaN(G[0])&&!isNaN(G[1]))return{lat:G[0],lng:G[1]}}return null},W=z=>{const G=Number(z.lat.toFixed(6)),ee=Number(z.lng.toFixed(6));switch(i.valueFormat){case"object-latitude-longitude":return{latitude:G,longitude:ee};case"array-lat-lng":return[G,ee];case"array-lng-lat":return[ee,G];case"string":return`${G},${ee}`;case"object-lat-lng":default:return{lat:G,lng:ee}}},P=o.ref(null);o.watch(()=>i.modelValue,z=>{const G=j(z);G?(!P.value||Math.abs(P.value.lat-G.lat)>1e-6||Math.abs(P.value.lng-G.lng)>1e-6)&&(P.value=G,v.value=G.lat.toFixed(6),y.value=G.lng.toFixed(6),X(G.lat,G.lng,!0)):(z==null||z==="")&&(P.value=null,v.value="",y.value="",m.value=null,M&&C&&(C.removeLayer(M),M=null))},{deep:!0,immediate:!0});const E=(z,G)=>{if(!C||!G)return;const ee="https://tile.openstreetmap.org/{z}/{x}/{y}.png",K='&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors';B&&C.removeLayer(B),B=G.tileLayer(ee,{attribution:K,maxZoom:19}).addTo(C)},k=z=>z.divIcon({className:"custom-map-marker-container",html:`
133
133
  <div class="relative flex items-center justify-center -top-4">
134
134
  <!-- Ping Ripple -->
135
135
  <span class="absolute inline-flex h-8 w-8 rounded-full bg-blue-500 opacity-40 animate-ping"></span>
@@ -141,7 +141,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),se=te,ce=re),ge===void
141
141
  </svg>
142
142
  </div>
143
143
  </div>
144
- `,iconSize:[32,32],iconAnchor:[16,16]}),$=()=>{if(N&&(N.disconnect(),N=null),C){try{C.off(),C.remove()}catch(z){console.warn("Error removing map instance:",z)}C=null}M=null,B=null},I=z=>{if(C)try{z?(C.dragging&&C.dragging.enable(),C.touchZoom&&C.touchZoom.enable(),C.doubleClickZoom&&C.doubleClickZoom.enable(),C.scrollWheelZoom&&C.scrollWheelZoom.enable(),C.boxZoom&&C.boxZoom.enable(),C.keyboard&&C.keyboard.enable(),M&&M.dragging&&M.dragging.enable()):(C.dragging&&C.dragging.disable(),C.touchZoom&&C.touchZoom.disable(),C.doubleClickZoom&&C.doubleClickZoom.disable(),C.scrollWheelZoom&&C.scrollWheelZoom.disable(),C.boxZoom&&C.boxZoom.disable(),C.keyboard&&C.keyboard.disable(),M&&M.dragging&&M.dragging.disable())}catch(G){console.error("Error toggling map interactivity:",G)}},O=z=>{var Y,F;if(C)return;if(!document.getElementById(a)){console.warn(`Map container #${a} not found in DOM yet.`);return}const ee=Number(((Y=P.value)==null?void 0:Y.lat)??i.defaultLat),K=Number(((F=P.value)==null?void 0:F.lng)??i.defaultLng);try{const b=!(i.disabled===!0||i.disabled==="true");C=z.map(a,{center:[ee,K],zoom:Number(i.zoom),zoomControl:!0,attributionControl:!1});const R=document.documentElement.classList.contains("dark");E(R,z),P.value&&X(P.value.lat,P.value.lng,!1),I(b),C.on("click",S=>{if(i.disabled||i.readonly)return;const{lat:T,lng:D}=S.latlng;q(T,D)}),N=new MutationObserver(()=>{const S=document.documentElement.classList.contains("dark");E(S,z)}),N.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),setTimeout(()=>{C==null||C.invalidateSize()},100)}catch(_){console.error("Failed to initialize Leaflet map:",_)}},q=(z,G,ee=!0,K=null)=>{const Y={lat:z,lng:G};P.value=Y,ee&&(v.value=z.toFixed(6),y.value=G.toFixed(6)),X(z,G,!0),m.value=K;const F=W(Y);r("update:modelValue",F),r("change",F)},X=(z,G,ee=!0)=>{if(!C||!window.L)return;const K=window.L;ee&&C.setView([z,G],C.getZoom()),M?M.setLatLng([z,G]):(M=K.marker([z,G],{icon:k(K),draggable:!i.disabled&&!i.readonly}).addTo(C),M.on("dragend",()=>{const Y=M.getLatLng();q(Y.lat,Y.lng)}))};let oe=null;const ue=z=>{const G=z.target.value;if(g.value=G,oe&&clearTimeout(oe),!G.trim()){h.value=[],d.value=!1;return}d.value=!0,oe=setTimeout(()=>{te(G)},500)},te=async z=>{d.value=!0;try{const G=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(z)}&limit=7`);if(G.ok){const ee=await G.json();h.value=ee}}catch(G){console.error("Nominatim geocoding error:",G)}finally{d.value=!1}},re=z=>{if(!z){se();return}const G=Number(z.lat),ee=Number(z.lon);!isNaN(G)&&!isNaN(ee)&&(g.value=z.display_name,q(G,ee,!0,z))},ge=()=>{if(!(i.disabled||i.readonly)){if(!navigator.geolocation){alert("Perangkat Anda tidak mendukung pelacakan lokasi.");return}f.value=!0,navigator.geolocation.getCurrentPosition(z=>{const{latitude:G,longitude:ee}=z.coords;q(G,ee),f.value=!1},z=>{console.error("Geolocation error:",z),alert(`Gagal mengambil lokasi: ${z.message}`),f.value=!1},{enableHighAccuracy:!1,timeout:5e3})}};o.watch(()=>[i.disabled,i.readonly],([z,G])=>{I(!(z===!0||z==="true")&&!(G===!0||G==="true"))}),o.watch(()=>i.skeleton,z=>{z?$():setTimeout(()=>{O(rw)},50)}),o.watch(()=>i.visible,z=>{z?setTimeout(()=>{O(rw),C==null||C.invalidateSize()},50):$()}),o.onMounted(()=>{!i.skeleton&&i.visible&&setTimeout(()=>{O(rw)},50)}),o.onBeforeUnmount(()=>{$(),oe&&clearTimeout(oe)});const ce=()=>{const z=Number(v.value),G=Number(y.value);!isNaN(z)&&!isNaN(G)&&z>=-90&&z<=90&&G>=-180&&G<=180&&q(z,G,!1)},se=()=>{i.disabled||i.readonly||(P.value=null,v.value="",y.value="",h.value=[],m.value=null,g.value="",M&&C&&(C.removeLayer(M),M=null),r("update:modelValue",null),r("change",null))};return(z,G)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",qG,[i.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[l.value?(o.openBlock(),o.createElementBlock("div",KG)):o.createCommentVNode("",!0),G[3]||(G[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer mb-2"},null,-1)),o.createElementVNode("div",{style:o.normalizeStyle({height:i.height}),class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,4)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",GG,[l.value?(o.openBlock(),o.createElementBlock("label",YG,[o.createTextVNode(o.toDisplayString(l.value)+" ",1),c.value?(o.openBlock(),o.createElementBlock("span",ZG,"*")):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)]),i.enableSearch||i.enableManualInput?(o.openBlock(),o.createElementBlock("div",XG,[o.createElementVNode("div",JG,[i.enableSearch&&A.value==="search"?(o.openBlock(),o.createBlock(Qu,{key:0,modelValue:m.value,"onUpdate:modelValue":[G[0]||(G[0]=ee=>m.value=ee),re],placeholder:i.placeholder,disabled:i.disabled||i.readonly,items:h.value,loading:d.value,icon:o.unref(Ne.Search),"item-title":"display_name","item-value":"place_id","return-object":"",clearable:"",onInput:ue,class:"flex-1"},{"no-data":o.withCtx(()=>[o.createElementVNode("div",QG,[d.value?(o.openBlock(),o.createElementBlock("span",VG,"Mencari lokasi...")):g.value.trim()?(o.openBlock(),o.createElementBlock("span",tY,"Lokasi tidak ditemukan")):(o.openBlock(),o.createElementBlock("span",eY,"Ketik untuk mencari lokasi..."))])]),_:1},8,["modelValue","placeholder","disabled","items","loading","icon"])):o.createCommentVNode("",!0),i.enableManualInput&&A.value==="manual"?(o.openBlock(),o.createElementBlock("div",nY,[o.withDirectives(o.createElementVNode("input",{type:"text","onUpdate:modelValue":G[1]||(G[1]=ee=>v.value=ee),placeholder:"Latitude (e.g. -6.2088)",disabled:i.disabled||i.readonly,onInput:ce,class:"w-full h-10 px-3 text-sm bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border border-gray-300 dark:border-neutral-700/50 rounded-lg focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed font-mono"},null,40,iY),[[o.vModelText,v.value]]),o.withDirectives(o.createElementVNode("input",{type:"text","onUpdate:modelValue":G[2]||(G[2]=ee=>y.value=ee),placeholder:"Longitude (e.g. 106.8456)",disabled:i.disabled||i.readonly,onInput:ce,class:"w-full h-10 px-3 text-sm bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border border-gray-300 dark:border-neutral-700/50 rounded-lg focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed font-mono"},null,40,rY),[[o.vModelText,y.value]])])):o.createCommentVNode("",!0),o.createElementVNode("div",oY,[i.enableCurrentLocation?(o.openBlock(),o.createBlock(Vt,{key:0,onClick:ge,disabled:i.disabled||i.readonly||f.value,variant:"secondary",class:"h-10 px-3 flex items-center justify-center gap-1.5 bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-200 border border-gray-300 dark:border-neutral-700/50 hover:bg-gray-50 dark:hover:bg-neutral-800/80 font-medium rounded-lg text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed shadow-none",title:"Dapatkan lokasi saat ini"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.Compass),{class:o.normalizeClass(["h-4 w-4",{"animate-spin":f.value}])},null,8,["class"]),G[4]||(G[4]=o.createElementVNode("span",{class:"hidden sm:inline"},"Lokasi Saya",-1))]),_:1},8,["disabled"])):o.createCommentVNode("",!0),P.value?(o.openBlock(),o.createBlock(Vt,{key:1,onClick:se,disabled:i.disabled||i.readonly,variant:"secondary",class:"h-10 px-3 flex items-center justify-center bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-200 border border-gray-300 dark:border-neutral-700/50 hover:bg-gray-50 dark:hover:bg-neutral-800/80 rounded-lg text-sm transition disabled:opacity-50 shadow-none",title:"Hapus pilihan"},{default:o.withCtx(()=>[...G[5]||(G[5]=[o.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"])):o.createCommentVNode("",!0)])])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["relative w-full rounded-lg border border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-sm z-10",[i.disabled===!0||i.disabled==="true"||i.readonly===!0||i.readonly==="true"?"map-locked opacity-70":""]])},[o.createElementVNode("div",{id:a,style:o.normalizeStyle({height:i.height}),class:"w-full"},null,4),i.disabled===!0||i.disabled==="true"||i.readonly===!0||i.readonly==="true"?(o.openBlock(),o.createElementBlock("div",sY)):o.createCommentVNode("",!0),P.value?(o.openBlock(),o.createElementBlock("div",aY,[G[6]||(G[6]=o.createElementVNode("span",{class:"w-1.5 h-1.5 bg-blue-500 rounded-full animate-pulse"},null,-1)),o.createElementVNode("span",null,"Lat: "+o.toDisplayString(P.value.lat.toFixed(6)),1),G[7]||(G[7]=o.createElementVNode("span",{class:"text-gray-300 dark:text-gray-700"},"|",-1)),o.createElementVNode("span",null,"Lng: "+o.toDisplayString(P.value.lng.toFixed(6)),1)])):o.createCommentVNode("",!0)],2),i.error?(o.openBlock(),o.createElementBlock("p",lY,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],512)),[[o.vShow,i.visible]])}});new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function ow(e){return!!e&&/^\d+\.\d+\.\d+/.test(e)}function sw(e){if(!ow(e))throw new Error(`Invalid semantic version: ${e||"<blank>"}.`);const[t,n,i]=e.split(".");return{major:Number.parseInt(t,10),minor:Number.parseInt(n,10),patch:Number.parseInt(i,10)}}function cY(e,t){const n=sw(e),i=sw(t);return Math.sign(n.major-i.major||n.minor-i.minor||n.patch-i.patch)}function AS(e){return e?["nightly","alpha","internal","nightly-","staging"].some(t=>e.includes(t)):!1}function TS(e){return!!(e!=null&&e.startsWith("0.0.0-"))}function dY(e){return ow(e)||AS(e)}function uY(e,t){const n=e.extraPlugins||[];return{...e,extraPlugins:[...n,...t.filter(i=>!n.includes(i))]}}function fY(e){if(AS(e))return 3;const{major:t}=sw(e);switch(!0){case t>=44:return 3;case t>=38:return 2;default:return 1}}function PS(){const{CKEDITOR_VERSION:e,CKEDITOR:t}=window;return dY(e)?{source:t?"cdn":"npm",version:e}:null}function hY(){const e=PS();return e?fY(e.version):null}function BS(e,t){switch(t||(t=hY()||void 0),t){case 1:case 2:return e===void 0;case 3:return e==="GPL";default:return!1}}function mY(e,t){return function(i){BS(i.config.get("licenseKey"))||i.on("collectUsageData",(r,{setUsageData:s})=>{s(`integration.${e}`,t)})}}function NS(e){var n;const t=(n=PS())==null?void 0:n.version;return t?TS(e)?-1:!ow(t)||TS(t)?1:cY(t,e):null}function aw(){const e=NS("48.0.0"),t=e!==null&&e>=0;return{rootsConfigEntry:t,elementConfigAttachment:t}}function pY(e,t,n){var r;if(!e.editorName||e.editorName==="ClassicEditor")return{...n,attachTo:t};const i={...n,roots:{...n.roots,main:{...n.root,...(r=n.roots)==null?void 0:r.main,element:t}}};return delete i.root,i}function gY(e){var n,i,r;return aw().rootsConfigEntry&&(((i=(n=e.roots)==null?void 0:n.main)==null?void 0:i.initialData)||((r=e.root)==null?void 0:r.initialData))||e.initialData}function yY(e,t,n){var s;const i=aw(),r=n?null:gY(e);if(i.rootsConfigEntry){const a={...e,roots:{...e.roots,main:{...e.root,...(s=e.roots)==null?void 0:s.main,initialData:r||t||""}}};return t&&r&&console.warn("Editor data should be provided either via the config (`config.root.initialData`) or the component's `data` property, but not both. The configuration value takes precedence."),delete a.root,delete a.initialData,a}return t&&r&&console.warn("Editor data should be provided either via the config (`config.initialData`) or the component's `data` property, but not both. The configuration value takes precedence."),{...e,initialData:r||t||""}}var bY=typeof global=="object"&&global&&global.Object===Object&&global,vY=typeof self=="object"&&self&&self.Object===Object&&self,DS=bY||vY||Function("return this")(),xg=DS.Symbol,MS=Object.prototype,wY=MS.hasOwnProperty,_Y=MS.toString,$f=xg?xg.toStringTag:void 0;function kY(e){var t=wY.call(e,$f),n=e[$f];try{e[$f]=void 0;var i=!0}catch{}var r=_Y.call(e);return i&&(t?e[$f]=n:delete e[$f]),r}var xY=Object.prototype,EY=xY.toString;function CY(e){return EY.call(e)}var SY="[object Null]",AY="[object Undefined]",RS=xg?xg.toStringTag:void 0;function TY(e){return e==null?e===void 0?AY:SY:RS&&RS in Object(e)?kY(e):CY(e)}function PY(e){return e!=null&&typeof e=="object"}var BY="[object Symbol]";function NY(e){return typeof e=="symbol"||PY(e)&&TY(e)==BY}var DY=/\s/;function MY(e){for(var t=e.length;t--&&DY.test(e.charAt(t)););return t}var RY=/^\s+/;function IY(e){return e&&e.slice(0,MY(e)+1).replace(RY,"")}function lw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var IS=NaN,OY=/^[-+]0x[0-9a-f]+$/i,LY=/^0b[01]+$/i,FY=/^0o[0-7]+$/i,$Y=parseInt;function OS(e){if(typeof e=="number")return e;if(NY(e))return IS;if(lw(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=lw(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=IY(e);var n=LY.test(e);return n||FY.test(e)?$Y(e.slice(2),n?2:8):OY.test(e)?IS:+e}var cw=function(){return DS.Date.now()},zY="Expected a function",jY=Math.max,UY=Math.min;function WY(e,t,n){var i,r,s,a,l,c,d=0,f=!1,h=!1,m=!0;if(typeof e!="function")throw new TypeError(zY);t=OS(t)||0,lw(n)&&(f=!0,h="maxWait"in n,s=h?jY(OS(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function g(W){var P=i,E=r;return i=r=void 0,d=W,a=e.apply(E,P),a}function v(W){return d=W,l=setTimeout(C,t),f?g(W):a}function y(W){var P=W-c,E=W-d,k=t-P;return h?UY(k,s-E):k}function A(W){var P=W-c,E=W-d;return c===void 0||P>=t||P<0||h&&E>=s}function C(){var W=cw();if(A(W))return M(W);l=setTimeout(C,y(W))}function M(W){return l=void 0,m&&i?g(W):(i=r=void 0,a)}function B(){l!==void 0&&clearTimeout(l),d=0,i=c=r=l=void 0}function N(){return l===void 0?a:M(cw())}function j(){var W=cw(),P=A(W);if(i=arguments,r=this,c=W,P){if(l===void 0)return v(c);if(h)return clearTimeout(l),l=setTimeout(C,t),g(c)}return l===void 0&&(l=setTimeout(C,t)),a}return j.cancel=B,j.flush=N,j}/**
144
+ `,iconSize:[32,32],iconAnchor:[16,16]}),$=()=>{if(N&&(N.disconnect(),N=null),C){try{C.off(),C.remove()}catch(z){console.warn("Error removing map instance:",z)}C=null}M=null,B=null},I=z=>{if(C)try{z?(C.dragging&&C.dragging.enable(),C.touchZoom&&C.touchZoom.enable(),C.doubleClickZoom&&C.doubleClickZoom.enable(),C.scrollWheelZoom&&C.scrollWheelZoom.enable(),C.boxZoom&&C.boxZoom.enable(),C.keyboard&&C.keyboard.enable(),M&&M.dragging&&M.dragging.enable()):(C.dragging&&C.dragging.disable(),C.touchZoom&&C.touchZoom.disable(),C.doubleClickZoom&&C.doubleClickZoom.disable(),C.scrollWheelZoom&&C.scrollWheelZoom.disable(),C.boxZoom&&C.boxZoom.disable(),C.keyboard&&C.keyboard.disable(),M&&M.dragging&&M.dragging.disable())}catch(G){console.error("Error toggling map interactivity:",G)}},O=z=>{var Y,F;if(C)return;if(!document.getElementById(a)){console.warn(`Map container #${a} not found in DOM yet.`);return}const ee=Number(((Y=P.value)==null?void 0:Y.lat)??i.defaultLat),K=Number(((F=P.value)==null?void 0:F.lng)??i.defaultLng);try{const b=!(i.disabled===!0||i.disabled==="true");C=z.map(a,{center:[ee,K],zoom:Number(i.zoom),zoomControl:!0,attributionControl:!1});const R=document.documentElement.classList.contains("dark");E(R,z),P.value&&X(P.value.lat,P.value.lng,!1),I(b),C.on("click",S=>{if(i.disabled||i.readonly)return;const{lat:T,lng:D}=S.latlng;q(T,D)}),N=new MutationObserver(()=>{const S=document.documentElement.classList.contains("dark");E(S,z)}),N.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),setTimeout(()=>{C==null||C.invalidateSize()},100)}catch(_){console.error("Failed to initialize Leaflet map:",_)}},q=(z,G,ee=!0,K=null)=>{const Y={lat:z,lng:G};P.value=Y,ee&&(v.value=z.toFixed(6),y.value=G.toFixed(6)),X(z,G,!0),m.value=K;const F=W(Y);r("update:modelValue",F),r("change",F)},X=(z,G,ee=!0)=>{if(!C||!window.L)return;const K=window.L;ee&&C.setView([z,G],C.getZoom()),M?M.setLatLng([z,G]):(M=K.marker([z,G],{icon:k(K),draggable:!i.disabled&&!i.readonly}).addTo(C),M.on("dragend",()=>{const Y=M.getLatLng();q(Y.lat,Y.lng)}))};let oe=null;const ue=z=>{const G=z.target.value;if(g.value=G,oe&&clearTimeout(oe),!G.trim()){h.value=[],d.value=!1;return}d.value=!0,oe=setTimeout(()=>{te(G)},500)},te=async z=>{d.value=!0;try{const G=await fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent(z)}&limit=7`);if(G.ok){const ee=await G.json();h.value=ee}}catch(G){console.error("Nominatim geocoding error:",G)}finally{d.value=!1}},re=z=>{if(!z){se();return}const G=Number(z.lat),ee=Number(z.lon);!isNaN(G)&&!isNaN(ee)&&(g.value=z.display_name,q(G,ee,!0,z))},ge=()=>{if(!(i.disabled||i.readonly)){if(!navigator.geolocation){alert("Perangkat Anda tidak mendukung pelacakan lokasi.");return}f.value=!0,navigator.geolocation.getCurrentPosition(z=>{const{latitude:G,longitude:ee}=z.coords;q(G,ee),f.value=!1},z=>{console.error("Geolocation error:",z),alert(`Gagal mengambil lokasi: ${z.message}`),f.value=!1},{enableHighAccuracy:!1,timeout:5e3})}};o.watch(()=>[i.disabled,i.readonly],([z,G])=>{I(!(z===!0||z==="true")&&!(G===!0||G==="true"))}),o.watch(()=>i.skeleton,z=>{z?$():setTimeout(()=>{O(rw)},50)}),o.watch(()=>i.visible,z=>{z?setTimeout(()=>{O(rw),C==null||C.invalidateSize()},50):$()}),o.onMounted(()=>{!i.skeleton&&i.visible&&setTimeout(()=>{O(rw)},50)}),o.onBeforeUnmount(()=>{$(),oe&&clearTimeout(oe)});const ce=()=>{const z=Number(v.value),G=Number(y.value);!isNaN(z)&&!isNaN(G)&&z>=-90&&z<=90&&G>=-180&&G<=180&&q(z,G,!1)},se=()=>{i.disabled||i.readonly||(P.value=null,v.value="",y.value="",h.value=[],m.value=null,g.value="",M&&C&&(C.removeLayer(M),M=null),r("update:modelValue",null),r("change",null))};return(z,G)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",qG,[i.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[l.value?(o.openBlock(),o.createElementBlock("div",KG)):o.createCommentVNode("",!0),G[3]||(G[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer mb-2"},null,-1)),o.createElementVNode("div",{style:o.normalizeStyle({height:i.height}),class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,4)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",GG,[l.value?(o.openBlock(),o.createElementBlock("label",YG,[o.createTextVNode(o.toDisplayString(l.value)+" ",1),c.value?(o.openBlock(),o.createElementBlock("span",ZG,"*")):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)]),i.enableSearch||i.enableManualInput?(o.openBlock(),o.createElementBlock("div",XG,[o.createElementVNode("div",JG,[i.enableSearch&&A.value==="search"?(o.openBlock(),o.createBlock(Qu,{key:0,modelValue:m.value,"onUpdate:modelValue":[G[0]||(G[0]=ee=>m.value=ee),re],placeholder:i.placeholder,disabled:i.disabled||i.readonly,items:h.value,loading:d.value,icon:o.unref(Ne.Search),"item-title":"display_name","item-value":"place_id","return-object":"",clearable:"",onInput:ue,class:"flex-1"},{"no-data":o.withCtx(()=>[o.createElementVNode("div",QG,[d.value?(o.openBlock(),o.createElementBlock("span",VG,"Mencari lokasi...")):g.value.trim()?(o.openBlock(),o.createElementBlock("span",tY,"Lokasi tidak ditemukan")):(o.openBlock(),o.createElementBlock("span",eY,"Ketik untuk mencari lokasi..."))])]),_:1},8,["modelValue","placeholder","disabled","items","loading","icon"])):o.createCommentVNode("",!0),i.enableManualInput&&A.value==="manual"?(o.openBlock(),o.createElementBlock("div",nY,[o.withDirectives(o.createElementVNode("input",{type:"text","onUpdate:modelValue":G[1]||(G[1]=ee=>v.value=ee),placeholder:"Latitude (e.g. -6.2088)",disabled:i.disabled||i.readonly,onInput:ce,class:"w-full h-10 px-3 text-sm bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border border-gray-300 dark:border-neutral-700/50 rounded-lg focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed font-mono"},null,40,iY),[[o.vModelText,v.value]]),o.withDirectives(o.createElementVNode("input",{type:"text","onUpdate:modelValue":G[2]||(G[2]=ee=>y.value=ee),placeholder:"Longitude (e.g. 106.8456)",disabled:i.disabled||i.readonly,onInput:ce,class:"w-full h-10 px-3 text-sm bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border border-gray-300 dark:border-neutral-700/50 rounded-lg focus:outline-none focus:ring-1 focus:ring-primary focus:border-primary transition duration-200 disabled:opacity-50 disabled:cursor-not-allowed font-mono"},null,40,rY),[[o.vModelText,y.value]])])):o.createCommentVNode("",!0),o.createElementVNode("div",oY,[i.enableCurrentLocation?(o.openBlock(),o.createBlock(Vt,{key:0,onClick:ge,disabled:i.disabled||i.readonly||f.value,variant:"secondary",class:"h-10 px-3 flex items-center justify-center gap-1.5 bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-200 border border-gray-300 dark:border-neutral-700/50 hover:bg-gray-50 dark:hover:bg-neutral-800/80 font-medium rounded-lg text-sm transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed shadow-none",title:"Dapatkan lokasi saat ini"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.Compass),{class:o.normalizeClass(["h-4 w-4",{"animate-spin":f.value}])},null,8,["class"]),G[4]||(G[4]=o.createElementVNode("span",{class:"hidden sm:inline"},"Lokasi Saya",-1))]),_:1},8,["disabled"])):o.createCommentVNode("",!0),P.value?(o.openBlock(),o.createBlock(Vt,{key:1,onClick:se,disabled:i.disabled||i.readonly,variant:"secondary",class:"h-10 px-3 flex items-center justify-center bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-200 border border-gray-300 dark:border-neutral-700/50 hover:bg-gray-50 dark:hover:bg-neutral-800/80 rounded-lg text-sm transition disabled:opacity-50 shadow-none",title:"Hapus pilihan"},{default:o.withCtx(()=>[...G[5]||(G[5]=[o.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"])):o.createCommentVNode("",!0)])])])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["relative w-full rounded-lg border border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-sm z-10 dcode-map-container",[i.disabled===!0||i.disabled==="true"||i.readonly===!0||i.readonly==="true"?"map-locked opacity-70":""]])},[o.createElementVNode("div",{id:a,style:o.normalizeStyle({height:i.height}),class:"w-full"},null,4),i.disabled===!0||i.disabled==="true"||i.readonly===!0||i.readonly==="true"?(o.openBlock(),o.createElementBlock("div",sY)):o.createCommentVNode("",!0),P.value?(o.openBlock(),o.createElementBlock("div",aY,[G[6]||(G[6]=o.createElementVNode("span",{class:"w-1.5 h-1.5 bg-blue-500 rounded-full animate-pulse"},null,-1)),o.createElementVNode("span",null,"Lat: "+o.toDisplayString(P.value.lat.toFixed(6)),1),G[7]||(G[7]=o.createElementVNode("span",{class:"text-gray-300 dark:text-gray-700"},"|",-1)),o.createElementVNode("span",null,"Lng: "+o.toDisplayString(P.value.lng.toFixed(6)),1)])):o.createCommentVNode("",!0)],2),i.error?(o.openBlock(),o.createElementBlock("p",lY,o.toDisplayString(i.error),1)):o.createCommentVNode("",!0)],64))],512)),[[o.vShow,i.visible]])}});new Array(256).fill("").map((e,t)=>("0"+t.toString(16)).slice(-2));function ow(e){return!!e&&/^\d+\.\d+\.\d+/.test(e)}function sw(e){if(!ow(e))throw new Error(`Invalid semantic version: ${e||"<blank>"}.`);const[t,n,i]=e.split(".");return{major:Number.parseInt(t,10),minor:Number.parseInt(n,10),patch:Number.parseInt(i,10)}}function cY(e,t){const n=sw(e),i=sw(t);return Math.sign(n.major-i.major||n.minor-i.minor||n.patch-i.patch)}function AS(e){return e?["nightly","alpha","internal","nightly-","staging"].some(t=>e.includes(t)):!1}function TS(e){return!!(e!=null&&e.startsWith("0.0.0-"))}function dY(e){return ow(e)||AS(e)}function uY(e,t){const n=e.extraPlugins||[];return{...e,extraPlugins:[...n,...t.filter(i=>!n.includes(i))]}}function fY(e){if(AS(e))return 3;const{major:t}=sw(e);switch(!0){case t>=44:return 3;case t>=38:return 2;default:return 1}}function PS(){const{CKEDITOR_VERSION:e,CKEDITOR:t}=window;return dY(e)?{source:t?"cdn":"npm",version:e}:null}function hY(){const e=PS();return e?fY(e.version):null}function BS(e,t){switch(t||(t=hY()||void 0),t){case 1:case 2:return e===void 0;case 3:return e==="GPL";default:return!1}}function mY(e,t){return function(i){BS(i.config.get("licenseKey"))||i.on("collectUsageData",(r,{setUsageData:s})=>{s(`integration.${e}`,t)})}}function NS(e){var n;const t=(n=PS())==null?void 0:n.version;return t?TS(e)?-1:!ow(t)||TS(t)?1:cY(t,e):null}function aw(){const e=NS("48.0.0"),t=e!==null&&e>=0;return{rootsConfigEntry:t,elementConfigAttachment:t}}function pY(e,t,n){var r;if(!e.editorName||e.editorName==="ClassicEditor")return{...n,attachTo:t};const i={...n,roots:{...n.roots,main:{...n.root,...(r=n.roots)==null?void 0:r.main,element:t}}};return delete i.root,i}function gY(e){var n,i,r;return aw().rootsConfigEntry&&(((i=(n=e.roots)==null?void 0:n.main)==null?void 0:i.initialData)||((r=e.root)==null?void 0:r.initialData))||e.initialData}function yY(e,t,n){var s;const i=aw(),r=n?null:gY(e);if(i.rootsConfigEntry){const a={...e,roots:{...e.roots,main:{...e.root,...(s=e.roots)==null?void 0:s.main,initialData:r||t||""}}};return t&&r&&console.warn("Editor data should be provided either via the config (`config.root.initialData`) or the component's `data` property, but not both. The configuration value takes precedence."),delete a.root,delete a.initialData,a}return t&&r&&console.warn("Editor data should be provided either via the config (`config.initialData`) or the component's `data` property, but not both. The configuration value takes precedence."),{...e,initialData:r||t||""}}var bY=typeof global=="object"&&global&&global.Object===Object&&global,vY=typeof self=="object"&&self&&self.Object===Object&&self,DS=bY||vY||Function("return this")(),xg=DS.Symbol,MS=Object.prototype,wY=MS.hasOwnProperty,_Y=MS.toString,$f=xg?xg.toStringTag:void 0;function kY(e){var t=wY.call(e,$f),n=e[$f];try{e[$f]=void 0;var i=!0}catch{}var r=_Y.call(e);return i&&(t?e[$f]=n:delete e[$f]),r}var xY=Object.prototype,EY=xY.toString;function CY(e){return EY.call(e)}var SY="[object Null]",AY="[object Undefined]",RS=xg?xg.toStringTag:void 0;function TY(e){return e==null?e===void 0?AY:SY:RS&&RS in Object(e)?kY(e):CY(e)}function PY(e){return e!=null&&typeof e=="object"}var BY="[object Symbol]";function NY(e){return typeof e=="symbol"||PY(e)&&TY(e)==BY}var DY=/\s/;function MY(e){for(var t=e.length;t--&&DY.test(e.charAt(t)););return t}var RY=/^\s+/;function IY(e){return e&&e.slice(0,MY(e)+1).replace(RY,"")}function lw(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var IS=NaN,OY=/^[-+]0x[0-9a-f]+$/i,LY=/^0b[01]+$/i,FY=/^0o[0-7]+$/i,$Y=parseInt;function OS(e){if(typeof e=="number")return e;if(NY(e))return IS;if(lw(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=lw(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=IY(e);var n=LY.test(e);return n||FY.test(e)?$Y(e.slice(2),n?2:8):OY.test(e)?IS:+e}var cw=function(){return DS.Date.now()},zY="Expected a function",jY=Math.max,UY=Math.min;function WY(e,t,n){var i,r,s,a,l,c,d=0,f=!1,h=!1,m=!0;if(typeof e!="function")throw new TypeError(zY);t=OS(t)||0,lw(n)&&(f=!0,h="maxWait"in n,s=h?jY(OS(n.maxWait)||0,t):s,m="trailing"in n?!!n.trailing:m);function g(W){var P=i,E=r;return i=r=void 0,d=W,a=e.apply(E,P),a}function v(W){return d=W,l=setTimeout(C,t),f?g(W):a}function y(W){var P=W-c,E=W-d,k=t-P;return h?UY(k,s-E):k}function A(W){var P=W-c,E=W-d;return c===void 0||P>=t||P<0||h&&E>=s}function C(){var W=cw();if(A(W))return M(W);l=setTimeout(C,y(W))}function M(W){return l=void 0,m&&i?g(W):(i=r=void 0,a)}function B(){l!==void 0&&clearTimeout(l),d=0,i=c=r=l=void 0}function N(){return l===void 0?a:M(cw())}function j(){var W=cw(),P=A(W);if(i=arguments,r=this,c=W,P){if(l===void 0)return v(c);if(h)return clearTimeout(l),l=setTimeout(C,t),g(c)}return l===void 0&&(l=setTimeout(C,t)),a}return j.cancel=B,j.flush=N,j}/**
145
145
  * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
146
146
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
147
147
  */var HY=mY("vue",{version:"8.2.0",frameworkVersion:o.version});function qY(e){return BS(e.licenseKey)?e:uY(e,[HY])}/**
@@ -1579,7 +1579,7 @@ Original error: ${n.name}: ${n.message}`:"";return e+s+a+l}function uA(e,t){cons
1579
1579
  transform: scale(1.1);
1580
1580
  }
1581
1581
  `});return(N,j)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-2 w-full",o.unref(n).class]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[d.value?(o.openBlock(),o.createElementBlock("div",Pde)):o.createCommentVNode("",!0),j[0]||(j[0]=o.createElementVNode("div",{class:"h-6 w-full rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[d.value?(o.openBlock(),o.createBlock(o.unref(gd),{key:0,for:c.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",Bde,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",Nde,[e.showValue?(o.openBlock(),o.createElementBlock("div",Dde,[o.createElementVNode("span",Mde,o.toDisplayString(r.valuePrefix)+o.toDisplayString(e.min)+o.toDisplayString(r.valueSuffix),1),o.createElementVNode("span",Rde,o.toDisplayString(m.value),1),o.createElementVNode("span",Ide,o.toDisplayString(r.valuePrefix)+o.toDisplayString(e.max)+o.toDisplayString(r.valueSuffix),1)])):o.createCommentVNode("",!0),o.createElementVNode("div",Ode,[o.createElementVNode("div",{class:o.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[e.size==="sm"?"h-2":e.size==="md"?"h-2.5":"h-3"]])},[o.createElementVNode("div",{class:o.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[e.color==="blue"?"bg-blue-500":e.color==="green"?"bg-green-500":e.color==="red"?"bg-red-500":e.color==="yellow"?"bg-yellow-500":e.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:o.normalizeStyle({width:`${g.value}%`})},null,6)],2),o.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:e.modelValue,min:e.min,max:e.max,step:e.step,disabled:e.disabled,placeholder:e.placeholder,class:o.normalizeClass(f.value),onInput:v,onChange:y,onMousedown:A,onMouseup:C,onTouchstart:A,onTouchend:C},null,42,Lde)]),e.marks.length>0?(o.openBlock(),o.createElementBlock("div",Fde,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.marks,W=>(o.openBlock(),o.createElementBlock("div",{key:W.value,class:"absolute flex flex-col items-center",style:o.normalizeStyle({left:`${M(W.value)}%`,transform:"translateX(-50%)"})},[j[1]||(j[1]=o.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),o.createElementVNode("span",$de,o.toDisplayString(W.label),1)],4))),128))])):o.createCommentVNode("",!0)]),l.value?(o.openBlock(),o.createElementBlock("div",zde,[j[2]||(j[2]=o.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),o.createTextVNode(" "+o.toDisplayString(e.error),1)])):o.createCommentVNode("",!0)],64)),B.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent("style"),{key:2},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(B.value),1)]),_:1})):o.createCommentVNode("",!0)],10,Tde)),[[o.vShow,e.visible]])}}),Ude={key:0,class:"ml-1 text-destructive"},Wde={class:"flex flex-col"},Hde={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},qde={class:"relative flex-shrink-0 mt-0.5"},Kde=["id","name","value","checked","disabled","required","onChange"],Gde=["onClick"],Yde=["for"],Zde={key:0,class:"ml-1 text-red-500"},Xde={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},M0=o.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},placeholder:{},clearable:{type:Boolean},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},itemTitle:{default:"name"},itemValue:{default:"id"},returnObject:{type:Boolean},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(e,{emit:t}){o.useAttrs();const{apiUrl:n}=o.inject("externalApi")||{},i=t,r=e,s=o.ref([]),a=o.ref(!1),l=o.ref(null),c=async()=>{var j,W;const N=((j=r.endpoint)==null?void 0:j.apiUrl)||r.apiUrl;if(N){a.value=!0,l.value=null;try{const P={page:1,perPage:100},E=((W=r.endpoint)==null?void 0:W.apiMethod)||r.apiMethod,k=await n(N,E,P);let $=k;r.dataPath?$=r.dataPath.split(".").reduce((O,q)=>O&&O[q]!=="undefined"?O[q]:void 0,k):typeof k=="object"&&!Array.isArray(k)&&k.data&&($=k.data),Array.isArray($)?s.value=$:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(P){console.error("DCodeRadio fetch error:",P),l.value="Gagal memuat data dari endpoint."}finally{a.value=!1}}};o.onMounted(()=>{var N;((N=r.endpoint)!=null&&N.apiUrl||r.apiUrl)&&c()});const d=o.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(s.value.length>0)return s.value;const N=r.itemValue||r.model||"id",j=r.itemTitle||(r.label===""?"name":r.label);return j&&r.label!==""?[{[N]:N,[j]:j}]:[]}),f=N=>{if(typeof N!="object")return N;const j=r.itemValue||r.model||"id";return N[j]},h=N=>{if(typeof N!="object")return String(N);const j=r.itemTitle||"name";return N[j]},m=o.computed(()=>r.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),g=o.computed(()=>!!r.error||!!l.value),v=o.computed(()=>r.error||l.value),y=(N,j)=>{if(N==null)return r.modelValue===N;const W=r.modelValue;if(W==null)return N==null;const P=N,E=j==null?void 0:j.id,k=j==null?void 0:j.code;return(I=>{if(I==null)return!1;const O=typeof I=="object"&&I!==null?I.id??I.value??I.code??I:I;return String(O)===String(P)||E!=null&&String(O)===String(E)||k!=null&&String(O)===String(k)})(W)},A=o.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[r.size]),C=N=>{const j=d.value.find(P=>{const E=f(P);return String(E)===String(N)||typeof P=="object"&&P&&(String(P.id)===String(N)||String(P.code)===String(N))}),W=r.returnObject&&j?j:N;i("update:modelValue",W),i("change",W)},M=(N,j)=>{if(r.disabled||r.readonly){j.preventDefault();return}j.target.checked&&C(N)},B=N=>{!r.disabled&&!r.readonly&&!y(N)&&C(N)};return o.watch(()=>{var N;return((N=r.endpoint)==null?void 0:N.apiUrl)||r.apiUrl},(N,j)=>{N&&N!==j&&c()}),(N,j)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["grid gap-3",e.disabled||e.readonly?"cursor-not-allowed":""])},[e.label?(o.openBlock(),o.createBlock(gd,{key:0,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",Ude,"*")):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",Wde,[a.value?(o.openBlock(),o.createElementBlock("div",Hde,[o.createVNode(o.unref(Ne.Loader2),{class:"w-4 h-4 animate-spin"}),j[0]||(j[0]=o.createTextVNode(" Sedang memuat opsi... ",-1))])):o.createCommentVNode("",!0),r.skeleton?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex",e.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,W=>o.createElementVNode("div",{key:W,class:"flex items-center gap-2"},[...j[1]||(j[1]=[o.createElementVNode("div",{class:"w-5 h-5 rounded-full bg-neutral-200 dark:bg-neutral-700 animate-pulse"},null,-1),o.createElementVNode("div",{class:"h-4 w-16 bg-neutral-200 dark:bg-neutral-700 rounded animate-pulse"},null,-1)])])),64))],2)):(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["flex",e.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d.value,(W,P)=>(o.openBlock(),o.createElementBlock("div",{key:P,class:o.normalizeClass(["flex items-start",A.value.container,e.disabled||e.readonly?"opacity-60 cursor-not-allowed":"cursor-pointer"])},[o.createElementVNode("div",qde,[o.createElementVNode("input",{id:e.id?`${e.id}-${P}`:`${m.value}-${P}`,name:m.value,type:"radio",value:f(W),checked:y(f(W),W),disabled:e.disabled||e.readonly,required:e.required&&P===0,onChange:E=>M(f(W),E),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,Kde)]),o.createElementVNode("div",{class:o.normalizeClass(["flex-1 min-w-0",y(f(W),W)?"font-bold":""]),onClick:E=>B(f(W))},[o.createElementVNode("label",{for:e.id?`${e.id}-${P}`:`${m.value}-${P}`,class:o.normalizeClass([A.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",e.disabled||e.readonly?"cursor-not-allowed opacity-60":""])},[o.createTextVNode(o.toDisplayString(h(W))+" ",1),e.required&&d.value.length===1&&e.label?(o.openBlock(),o.createElementBlock("span",Zde,"*")):o.createCommentVNode("",!0)],10,Yde)],10,Gde)],2))),128))],2)),g.value&&v.value?(o.openBlock(),o.createElementBlock("div",Xde,[o.createVNode(o.unref(Ne.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),o.createTextVNode(" "+o.toDisplayString(v.value),1)])):o.createCommentVNode("",!0)])],2)),[[o.vShow,e.visible]])}}),Jde={class:"grid gap-3"},Qde={key:0,class:"ml-1 text-destructive"},Vde={class:"flex flex-col"},eue={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},tue=["onClick"],nue=["id","name","value","checked","disabled","required","onChange"],iue={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},rue=["for"],oue={key:0,class:"ml-1 text-red-500"},sue={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},R0=o.defineComponent({name:"DCodeRadioCustom",inheritAttrs:!1,__name:"DCodeRadioCustom",props:{modelValue:{default:void 0},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},isTab:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(e,{emit:t}){o.useAttrs();const{apiUrl:n}=o.inject("externalApi")||{},i=t,r=e,s=o.ref(r.modelValue??void 0);o.watch(()=>r.modelValue,$=>{s.value=$},{immediate:!0});const a=o.ref([]),l=o.ref(!1),c=o.ref(null),d=o.computed(()=>r.disabled||l.value||!!c.value),f=async()=>{var I,O;const $=((I=r.endpoint)==null?void 0:I.apiUrl)||r.apiUrl;if($){l.value=!0,c.value=null;try{const q={page:1,perPage:100},X=((O=r.endpoint)==null?void 0:O.apiMethod)||r.apiMethod,oe=await n($,X,q);let ue=oe;r.dataPath?ue=r.dataPath.split(".").reduce((re,ge)=>re&&re[ge]!=="undefined"?re[ge]:void 0,oe):typeof oe=="object"&&!Array.isArray(oe)&&oe.data&&(ue=oe.data),Array.isArray(ue)?a.value=ue:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(q){console.error("DCodeRadioCustom fetch error:",q),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}};o.watch(()=>{var $;return(($=r.endpoint)==null?void 0:$.apiUrl)||r.apiUrl},($,I)=>{$&&$!==I&&f()});const h=o.ref(!1);let m=null;const g=()=>{typeof document<"u"&&(h.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};o.onMounted(()=>{var $;(($=r.endpoint)!=null&&$.apiUrl||r.apiUrl)&&f(),g(),typeof document<"u"&&(m=new MutationObserver(g),m.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),m.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),o.onBeforeUnmount(()=>{m&&m.disconnect()});const v=o.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(a.value.length>0)return a.value;const $=r.itemValue||r.model||"id",I=r.itemTitle||(r.label===""?"name":r.label);return I&&r.label!==""?[{[$]:$,[I]:I}]:[]}),y=$=>{if(typeof $!="object")return $;const I=r.itemValue||r.model||"id";return $[I]},A=$=>{if(typeof $!="object")return String($);const I=r.itemTitle||"name";return $[I]},C=Math.random().toString(36).slice(2,7),M=o.computed(()=>r.id?`radio-custom-${r.id}`:`radio-custom-${r.model}-${C}`),B=o.computed(()=>!!r.error||!!c.value),N=o.computed(()=>r.error||c.value),j=($,I)=>{if($==null)return r.modelValue===$;const O=r.modelValue;if(O==null)return $==null;const q=$,X=I==null?void 0:I.id,oe=I==null?void 0:I.code;return(te=>{if(te==null)return!1;const re=typeof te=="object"&&te!==null?te.id??te.value??te.code??te:te;return String(re)===String(q)||X!=null&&String(re)===String(X)||oe!=null&&String(re)===String(oe)})(O)},W=o.computed(()=>{const $={sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2",tabPadding:"px-3 py-1.5"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2",tabPadding:"px-4 py-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3",tabPadding:"px-5 py-2.5"}};return $[r.size]||$.md}),P=$=>{const I=($==null?void 0:$.icon)||r.icon;return Es(I,tn)},E=($,I)=>{I.target.checked&&(s.value=$,i("update:modelValue",$),i("change",$))},k=$=>{r.disabled||j($)||(s.value=$,i("update:modelValue",$),i("change",$))};return($,I)=>(o.openBlock(),o.createElementBlock("div",Jde,[e.label?(o.openBlock(),o.createBlock(gd,{key:0,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",Qde,"*")):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0),o.createElementVNode("div",Vde,[l.value?(o.openBlock(),o.createElementBlock("div",eue,[o.createVNode(o.unref(Ne.Loader2),{class:"w-4 h-4 animate-spin"}),I[0]||(I[0]=o.createTextVNode(" Sedang memuat opsi... ",-1))])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass([e.isTab?"flex flex-wrap items-center gap-1.5 p-1.5 rounded-xl bg-gray-100 dark:bg-neutral-800/90 border border-gray-200/80 dark:border-neutral-700/80 w-full":["grid",e.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"]])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(v.value,(O,q)=>(o.openBlock(),o.createElementBlock("div",{key:q,class:o.normalizeClass([e.isTab?["relative flex items-center justify-center gap-2 rounded-lg transition-all duration-200 select-none flex-1 min-w-[100px]",W.value.tabPadding,j(y(O),O)?h.value?"bg-neutral-700 text-primary-400 shadow-sm border border-neutral-600 font-semibold":"bg-white text-primary-600 shadow-sm border border-gray-200/80 font-semibold":h.value?"text-neutral-400 hover:text-neutral-200 hover:bg-neutral-700/50 border border-transparent":"text-gray-600 hover:text-gray-900 hover:bg-gray-200/60 border border-transparent"]:["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",j(y(O),O)?h.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":h.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm"],d.value?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:X=>!d.value&&k(y(O))},[o.createElementVNode("input",{id:e.id?`${e.id}-${q}`:`${M.value}-${q}`,name:M.value,type:"radio",value:y(O),checked:j(y(O),O),disabled:d.value,required:e.required&&q===0,onChange:X=>E(y(O),X),class:"sr-only",tabindex:"-1"},null,40,nue),e.isTab?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[P(O)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(P(O)),{key:0,class:"w-4 h-4 flex-shrink-0"})):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",j(y(O),O)?h.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":h.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[P(O)?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(P(O)),{key:0,class:"w-6 h-6"})):(o.openBlock(),o.createElementBlock("svg",iue,[...I[1]||(I[1]=[o.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2)),o.createElementVNode("label",{for:e.id?`${e.id}-${q}`:`${M.value}-${q}`,class:o.normalizeClass([W.value.label,"text-center leading-tight select-none transition-colors duration-200",e.isTab?"":["font-medium",j(y(O),O)?h.value?"text-primary-400":"text-primary-700":h.value?"text-neutral-300":"text-gray-700"],e.disabled?"cursor-not-allowed":"cursor-pointer"])},[o.createTextVNode(o.toDisplayString(A(O))+" ",1),e.required&&v.value.length===1&&e.label?(o.openBlock(),o.createElementBlock("span",oue,"*")):o.createCommentVNode("",!0)],10,rue)],10,tue))),128))],2),B.value&&N.value?(o.openBlock(),o.createElementBlock("div",sue,[o.createVNode(o.unref(Ne.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),o.createTextVNode(" "+o.toDisplayString(N.value),1)])):o.createCommentVNode("",!0)])]))}}),aue=["aria-busy"],lue={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},cue=["for"],due={key:0,class:"ml-1 text-destructive"},uue=["id","disabled"],fue={class:"min-w-0 flex-1 text-left"},hue={key:0,class:"flex flex-wrap gap-1.5"},mue={class:"max-w-[220px] truncate"},pue=["onClick"],gue={key:0,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent"},yue={key:1,class:"text-muted-foreground truncate"},bue={class:"flex items-center gap-2 shrink-0"},vue={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},wue=["placeholder","onKeydown"],_ue={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},kue=["disabled","onClick"],xue={class:"truncate"},Eue={key:0,class:"text-primary-600 dark:text-primary-400"},Cue={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},Sue={key:0},Aue={key:1},Tue={key:1,class:"text-xs text-destructive"},I0=o.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},label:{default:""},placeholder:{default:"Pilih data…"},clearable:{type:Boolean,default:!1},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},maxChips:{default:5},maxSelected:{default:5},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},virtual:{type:Boolean,default:!0},itemHeight:{default:40},maxRows:{default:5},overscan:{default:6}},emits:["update:modelValue","clear","max"],setup(e,{emit:t}){const n=o.useAttrs(),i=t,r=e,s=o.computed(()=>(r.label||n.label)??void 0),a=o.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=o.computed(()=>`app-multiselect-${n.id||s.value||"field"}-${l}`),d=o.computed(()=>{if(r.required)return!0;const Ie=n.required,Ce=n["aria-required"];return Ie===""||Ie===!0||Ie==="true"||(Ce==="true"||Ce===!0)}),f=o.computed(()=>!!r.error);function h(Ie){return Ie?typeof r.itemTitle=="function"?r.itemTitle(Ie)??"":String((Ie==null?void 0:Ie[r.itemTitle])??""):""}function m(Ie){return Ie?typeof r.itemValue=="function"?r.itemValue(Ie):Ie==null?void 0:Ie[r.itemValue]:null}function g(Ie,Ce){return m(Ie)??Ce}const v=o.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),y=o.computed(()=>{var Ie;return!!((Ie=r.endpoint)!=null&&Ie.apiUrl)||!!r.fetchItems}),A=o.ref([]),{DCodeApi:C}=o.inject("externalApi")||{},M=o.ref(!1),B=o.ref(!1),N=o.computed(()=>{var Ce;const Ie=(Ce=r.endpoint)==null?void 0:Ce.apiOptions;if(Ie)return typeof Ie=="function"?Ie():Ie}),j=o.computed(()=>{var ye,Me;const Ie=((ye=r.endpoint)==null?void 0:ye.apiUrl)??"",Ce=(((Me=r.endpoint)==null?void 0:Me.apiMethod)??"GET").toUpperCase(),ne=JSON.stringify(N.value??null);return`${Ce} ${Ie} :: ${ne}`}),W=o.computed(()=>y.value?A.value:r.items||[]);async function P(){var Ie;if(y.value&&!(!((Ie=r.endpoint)!=null&&Ie.apiUrl)&&!r.fetchItems)&&!M.value){M.value=!0;try{let Ce=[];if(r.fetchItems){const ne=await r.fetchItems(),ye=(ne==null?void 0:ne.data)??ne;Ce=(ye==null?void 0:ye.data)??ye}else if(C){if(typeof C!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const ne={page:1,perPage:100,...N.value||{}},ye=await C("","",ne,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),Me=(ye==null?void 0:ye.data)??ye;Ce=(Me==null?void 0:Me.data)??Me}A.value=Array.isArray(Ce)?Ce:[],B.value=!0}catch(Ce){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",Ce),A.value=[]}finally{M.value=!1}}}o.watch(()=>j.value,()=>{A.value=[],B.value=!1}),o.onMounted(()=>{r.autoFetchOnMount&&y.value&&P()});const E=o.computed(()=>{const Ie=v.value;if(r.returnObject)return Ie;const Ce=new Map;for(const ne of W.value){const ye=m(ne);ye!=null&&Ce.set(String(ye),ne),ne.id!=null&&Ce.set(String(ne.id),ne),ne.code!=null&&Ce.set(String(ne.code),ne)}return Ie.map(ne=>Ce.get(String(ne))??{[r.itemValue]:ne,[r.itemTitle]:String(ne)})}),k=o.computed(()=>r.maxChips===null?E.value:E.value.slice(0,r.maxChips));function $(Ie){const Ce=v.value,ne=m(Ie),ye=Ie==null?void 0:Ie.id,Me=Ie==null?void 0:Ie.code,Ke=$e=>{if($e==null)return!1;const He=r.returnObject&&typeof $e=="object"?m($e):$e;return String(He)===String(ne)||ye!=null&&String(He)===String(ye)||Me!=null&&String(He)===String(Me)};return Ce.some($e=>Ke($e))}const I=o.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const Ie=Number(r.maxSelected);return Number.isFinite(Ie)&&Ie>0?Ie:null}),O=o.computed(()=>{const Ie=I.value;return Ie===null?!1:v.value.length>=Ie});function q(Ie){return!$(Ie)&&O.value}const X=o.computed(()=>{const Ie=v.value,Ce=new Set;if(r.returnObject)for(const ne of Ie)Ce.add(m(ne));else for(const ne of Ie)Ce.add(ne);return Ce}),oe=o.computed(()=>{const Ie=X.value;return(W.value||[]).filter(Ce=>!Ie.has(m(Ce)))}),ue=o.computed(()=>W.value.length===0?!1:oe.value.length===0),te=o.ref(null),re=o.ref(null),ge=o.ref(null),ce=o.ref(!1),se=o.ref(""),z=o.ref(0),G=o.ref(0),{floatingStyles:ee}=Ju(te,re,{whileElementsMounted:Ku,placement:"bottom-start",middleware:[Gu(8),Zu(),Yu({padding:8}),Cb({apply({rects:Ie,elements:Ce}){Object.assign(Ce.floating.style,{width:`${Ie.reference.width}px`,"--floating-width":`${Ie.reference.width}px`})}})]}),K=o.computed(()=>ee.value),Y=o.computed(()=>{const Ie=Number(r.maxRows);return Number.isFinite(Ie)&&Ie>0?Ie:5});async function F(){r.disabled||r.readonly||(ce.value=!0,G.value=0,requestAnimationFrame(()=>{ge.value&&(ge.value.scrollTop=0),z.value=0}),y.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!B.value)&&!M.value&&await P())}function _(){ce.value=!1}function b(){ce.value?_():F()}function R(Ie){var ne,ye;if(!ce.value)return;const Ce=Ie.target;(ne=te.value)!=null&&ne.contains(Ce)||(ye=re.value)!=null&&ye.contains(Ce)||_()}o.onMounted(()=>document.addEventListener("mousedown",R)),o.onBeforeUnmount(()=>document.removeEventListener("mousedown",R));function S(Ie){if(r.disabled||r.readonly)return;if(q(Ie)){i("max");return}const Ce=[...v.value];if(r.returnObject){const ne=m(Ie);if(Ce.some(Me=>m(Me)===ne))return;i("update:modelValue",[...Ce,Ie])}else{const ne=m(Ie);if(Ce.includes(ne))return;i("update:modelValue",[...Ce,ne])}se.value="",G.value=0,requestAnimationFrame(()=>{ge.value&&(ge.value.scrollTop=0),z.value=0})}function T(Ie){if(r.disabled||r.readonly)return;const Ce=[...v.value];if(r.returnObject){const ne=m(Ie);i("update:modelValue",Ce.filter(ye=>m(ye)!==ne))}else{const ne=m(Ie);i("update:modelValue",Ce.filter(ye=>ye!==ne))}}function D(){r.disabled||r.readonly||(i("update:modelValue",[]),i("clear"),_())}const Z=o.computed(()=>{const Ie=se.value.trim().toLowerCase(),Ce=oe.value;return Ie?Ce.filter(ne=>h(ne).toLowerCase().includes(Ie)):Ce}),J=o.computed(()=>Z.value.length);o.watch(ce,Ie=>{Ie||(se.value="")});const fe=o.computed(()=>{if(ue.value)return r.itemHeight;const Ie=J.value;return(Ie<=0?1:Math.min(Ie,Y.value))*r.itemHeight}),ae=o.computed(()=>r.virtual?J.value*r.itemHeight:0),we=o.computed(()=>r.virtual?Math.ceil(fe.value/r.itemHeight)+r.overscan:J.value),pe=o.computed(()=>{if(!r.virtual)return 0;const Ie=Math.floor(z.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,Ie)}),ke=o.computed(()=>r.virtual?Math.min(J.value,pe.value+we.value):J.value),be=o.computed(()=>r.virtual?pe.value*r.itemHeight:0),Se=o.computed(()=>{const Ie=Z.value;return r.virtual?Ie.slice(pe.value,ke.value):Ie});function ve(Ie){const Ce=Ie.target;z.value=Ce.scrollTop}function Be(Ie){return Ie===G.value}function Ee(Ie){const Ce=ge.value;if(!Ce||!r.virtual)return;const ne=Ie*r.itemHeight,ye=ne+r.itemHeight,Me=Ce.scrollTop,Ke=Ce.scrollTop+Ce.clientHeight;ne<Me?Ce.scrollTop=ne:ye>Ke&&(Ce.scrollTop=ye-Ce.clientHeight)}function Oe(Ie){const Ce=Math.max(0,J.value-1);G.value=Math.min(Ce,Math.max(0,G.value+Ie)),Ee(G.value)}function Ae(){const Ie=Z.value[G.value];Ie&&S(Ie)}const Re=o.computed(()=>r.clearable&&!r.disabled&&!r.readonly&&E.value.length>0),De=o.computed(()=>f.value?"border-destructive ring-1 ring-destructive":ce.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(Ie,Ce)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",[o.unref(n).class,r.disabled?"cursor-not-allowed":""]]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",lue)):o.createCommentVNode("",!0),Ce[3]||(Ce[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[o.createTextVNode(o.toDisplayString(s.value)+" ",1),d.value?(o.openBlock(),o.createElementBlock("span",due,"*")):o.createCommentVNode("",!0)],8,cue)):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"referenceEl",ref:te,class:"relative"},[o.createElementVNode("button",{id:c.value,type:"button",class:o.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border rounded-lg flex items-center",["bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 text-foreground dark:text-gray-300",r.disabled?"cursor-not-allowed opacity-50":r.readonly?"cursor-default bg-neutral-50/50 dark:bg-neutral-900/30":"",De.value]]),disabled:r.disabled||r.readonly,onClick:b},[o.createElementVNode("div",fue,[E.value.length?(o.openBlock(),o.createElementBlock("div",hue,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(k.value,(ne,ye)=>(o.openBlock(),o.createElementBlock("div",{key:`chip-${g(ne,ye)}`,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent gap-1"},[o.createElementVNode("span",mue,o.toDisplayString(h(ne)),1),r.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:o.withModifiers(Me=>T(ne),["stop"]),"aria-label":"Remove"}," ✕ ",8,pue))]))),128)),r.maxChips!==null&&E.value.length>r.maxChips?(o.openBlock(),o.createElementBlock("div",gue," +"+o.toDisplayString(E.value.length-(r.maxChips??0)),1)):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",yue,o.toDisplayString(r.placeholder),1))]),o.createElementVNode("div",bue,[Re.value?(o.openBlock(),o.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:o.withModifiers(D,["stop"]),"aria-label":"Clear"}," ✕ ")):o.createCommentVNode("",!0),o.createVNode(o.unref(Ne.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,uue),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[ce.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:re,class:"-mt-1 z-[9999] pointer-events-auto w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-800 border-gray-200 dark:border-neutral-700/50",style:o.normalizeStyle(K.value)},[r.searchable&&!ue.value?(o.openBlock(),o.createElementBlock("div",vue,[o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":Ce[0]||(Ce[0]=ne=>se.value=ne),placeholder:r.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[Ce[1]||(Ce[1]=o.withKeys(o.withModifiers(ne=>Oe(1),["prevent"]),["down"])),Ce[2]||(Ce[2]=o.withKeys(o.withModifiers(ne=>Oe(-1),["prevent"]),["up"])),o.withKeys(o.withModifiers(Ae,["prevent"]),["enter"]),o.withKeys(o.withModifiers(_,["prevent"]),["esc"])]},null,40,wue),[[o.vModelText,se.value]])])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"listEl",ref:ge,class:"relative overflow-auto",style:o.normalizeStyle({height:fe.value+"px"}),onScroll:ve},[ue.value?(o.openBlock(),o.createElementBlock("div",_ue," All items have been selected ")):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[r.virtual?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({height:ae.value+"px"})},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:o.normalizeStyle(r.virtual?{transform:`translateY(${be.value}px)`}:void 0)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Se.value,(ne,ye)=>(o.openBlock(),o.createElementBlock("button",{key:String(g(ne,pe.value+ye)),type:"button",class:o.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[q(ne)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",Be(pe.value+ye)?"bg-neutral-50 dark:bg-neutral-800/60":"",$(ne)?"font-semibold":"font-normal"]]),style:o.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||q(ne),onClick:Me=>S(ne)},[o.createElementVNode("span",xue,o.toDisplayString(h(ne)),1),$(ne)?(o.openBlock(),o.createElementBlock("span",Eue,"✓")):o.createCommentVNode("",!0)],14,kue))),128))],6),J.value===0?(o.openBlock(),o.createElementBlock("div",Cue,[M.value?(o.openBlock(),o.createElementBlock("span",Sue,"Loading data…")):(o.openBlock(),o.createElementBlock("span",Aue,"Tidak ada data"))])):o.createCommentVNode("",!0)],64))],36)],4)):o.createCommentVNode("",!0)]))],512),f.value?(o.openBlock(),o.createElementBlock("p",Tue,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,aue)),[[o.vShow,a.value]])}}),Pue={class:"permission-menu w-full space-y-4"},Bue={class:"bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-4"},Nue={class:"flex items-center justify-between"},Due={class:"flex items-center gap-3 flex-1"},Mue=["onClick"],Rue={key:1,class:"w-7"},Iue={key:2,class:"flex-shrink-0"},Oue={class:"text-lg font-semibold flex-1"},Lue={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},Fue={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},$ue={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},zue=["checked","onChange"],jue={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},Uue={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},Wue={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},Hue={class:"bg-neutral-50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-3"},que={class:"flex items-center justify-between"},Kue={class:"flex items-center gap-3 flex-1"},Gue={key:0,class:"flex-shrink-0"},Yue={class:"text-base font-semibold flex-1"},Zue={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},Xue={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},Jue=["checked","onChange"],Que={class:"text-xs font-medium"},Vue={key:0,class:"p-3"},efe={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},tfe=["checked","onChange"],nfe={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},O0=Mn(o.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(e,{expose:t,emit:n}){const{t:i}=Yn.useI18n(),r=e,s=n,a=o.computed(()=>r.menuList&&r.menuList.length>0?r.menuList:r.treeData||[]),l=o.ref(new Map),c=o.ref(new Set),d=$=>$.detail&&$.detail.length>0,f=$=>$.code==="VIEW"||$.name.toUpperCase()==="VIEW",h=($=!0)=>{(O=>{O.forEach(q=>{const X=d(q);q.permission.forEach(oe=>{const ue=`${q.id}-${oe.id}-parent`;if(!l.value.has(ue)){let te=!1;$&&(te=q.checked??!1),l.value.set(ue,te)}}),X&&q.detail.forEach(oe=>{oe.permission.forEach(ue=>{const te=`${oe.id}-${ue.id}-child`;l.value.has(te)||l.value.set(te,$?oe.checked??!1:!1)})})})})(a.value)},m=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",r.modelValue),l.value.clear(),h(!1),r.modelValue&&r.modelValue.length>0&&r.modelValue.forEach($=>{const I=$.menuId,O=$.actionsIds;a.value.forEach(q=>{q.id===I&&O.forEach(X=>{const oe=`${I}-${X}-parent`;l.value.set(oe,!0)}),q.detail&&q.detail.length>0&&q.detail.forEach(X=>{X.id===I&&O.forEach(oe=>{const ue=`${I}-${oe}-child`;l.value.set(ue,!0)})})})})};m(),o.watch(()=>r.modelValue,()=>{m()},{deep:!0}),o.watch(()=>a.value.length,($,I)=>{I===0&&$>0&&m()});const g=$=>{c.value.has($)?c.value.delete($):c.value.add($)},v=$=>c.value.has($),y=($,I,O=!1)=>{const q=`${$}-${I}-${O?"child":"parent"}`;return l.value.get(q)??!1},A=()=>{const $=W();s("update:modelValue",$.permissions)},C=($,I,O,q=!1)=>{const X=O.target.checked,oe=`${$}-${I}-${q?"child":"parent"}`;l.value.set(oe,X),s("permission-change",$,I,X,!q),A()},M=$=>d($)?$.permission.filter(f):$.permission,B=($,I,O)=>{const q=O.target.checked;I.permission.forEach(X=>{if(f(X)){const ue=`${I.id}-${X.id}-child`;l.value.set(ue,q);return}const oe=`${I.id}-${X.id}-child`;l.value.set(oe,q)}),l.value=new Map(l.value),s("menu-check",I.id,q),A()},N=($,I=!1)=>{const O=I?$.permission:M($);return!O||O.length===0?!1:O.every(q=>{const X=`${$.id}-${q.id}-${I?"child":"parent"}`;return l.value.get(X)??!1})},j=()=>{const $={};return a.value.forEach(I=>{var O;$[I.id]={name:I.name,parentPermissions:I.permission.map(q=>({id:q.id,name:q.name,checked:y(I.id,q.id,!1)})),children:((O=I.detail)==null?void 0:O.map(q=>({id:q.id,name:q.name,permissions:q.permission.map(X=>({id:X.id,name:X.name,checked:y(q.id,X.id,!0)}))})))||[]}}),$},W=()=>{const $=[],I=(O,q=!1)=>{const X=[];O.permission.forEach(oe=>{const ue=`${O.id}-${oe.id}-${q?"child":"parent"}`;(l.value.get(ue)??!1)&&X.push(oe.id)}),X.length>0&&$.push({menuId:O.id,actionsIds:X})};return a.value.forEach(O=>{I(O,!1),O.detail&&O.detail.length>0&&O.detail.forEach(q=>{I(q,!0)})}),{permissions:$}};return t({getCurrentStates:j,getPermissionsForDatabase:W,getAllPermissionsWithStatus:()=>{const $=[],I=(O,q=!1)=>{const X=O.permission.map(ue=>{const te=`${O.id}-${ue.id}-${q?"child":"parent"}`,re=l.value.get(te)??!1;return{id:ue.id,name:ue.name,checked:re}}),oe=X.filter(ue=>ue.checked).map(ue=>ue.id);$.push({menuId:O.id,menuName:O.name,actionsIds:oe,actions:X})};return a.value.forEach(O=>{I(O,!1),O.detail&&O.detail.length>0&&O.detail.forEach(q=>{I(q,!0)})}),{permissions:$}},permissionStates:l,expandAll:()=>{a.value.forEach($=>{d($)&&c.value.add($.id)})},collapseAll:()=>{c.value.clear()}}),($,I)=>(o.openBlock(),o.createElementBlock("div",Pue,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,O=>(o.openBlock(),o.createElementBlock("div",{key:O.id,class:o.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":d(O)}])},[o.createElementVNode("div",Bue,[o.createElementVNode("div",Nue,[o.createElementVNode("div",Due,[d(O)?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:q=>g(O.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[v(O.id)?(o.openBlock(),o.createBlock(o.unref(Ne.ChevronDown),{key:0,class:"w-5 h-5"})):(o.openBlock(),o.createBlock(o.unref(Ne.ChevronRight),{key:1,class:"w-5 h-5"}))],8,Mue)):(o.openBlock(),o.createElementBlock("div",Rue)),e.showIcons&&O.icon?(o.openBlock(),o.createElementBlock("span",Iue,[o.createElementVNode("i",{class:o.normalizeClass([O.icon,"text-2xl"])},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("h3",Oue,o.toDisplayString(O.name),1)])])]),O.permission&&O.permission.length>0?(o.openBlock(),o.createElementBlock("div",Lue,[o.createElementVNode("h4",Fue,o.toDisplayString(o.unref(i)("common.permissions"))+": ",1),o.createElementVNode("div",$ue,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(M(O),q=>(o.openBlock(),o.createElementBlock("label",{key:q.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-neutral-900/50 transition-all group"},[o.createElementVNode("input",{type:"checkbox",checked:y(O.id,q.id,!1),onChange:X=>C(O.id,q.id,X,!1),class:"w-4 h-4 text-blue-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-blue-500 dark:focus:ring-blue-600 cursor-pointer"},null,40,zue),o.createElementVNode("span",jue,o.toDisplayString(q.name),1)]))),128))])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[5000px]","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-[5000px]","leave-to-class":"opacity-0 max-h-0"},{default:o.withCtx(()=>[d(O)&&v(O.id)?(o.openBlock(),o.createElementBlock("div",Uue,[o.createElementVNode("h4",Wue,[I[0]||(I[0]=o.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),o.createTextVNode(" "+o.toDisplayString(o.unref(i)("common.subMenus")),1)]),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(O.detail,q=>(o.openBlock(),o.createElementBlock("div",{key:q.id,class:"bg-white dark:bg-neutral-800 rounded-lg border border-gray-200 dark:border-neutral-700/50 overflow-hidden shadow-sm hover:shadow transition-shadow"},[o.createElementVNode("div",Hue,[o.createElementVNode("div",que,[o.createElementVNode("div",Kue,[e.showIcons&&q.icon?(o.openBlock(),o.createElementBlock("span",Gue,[o.createElementVNode("i",{class:o.normalizeClass([q.icon,"text-xl"])},null,2)])):o.createCommentVNode("",!0),o.createElementVNode("h5",Yue,o.toDisplayString(q.name),1),q.path?(o.openBlock(),o.createElementBlock("span",Zue,o.toDisplayString(q.path),1)):o.createCommentVNode("",!0),o.createElementVNode("label",Xue,[o.createElementVNode("input",{type:"checkbox",checked:N(q,!0),onChange:X=>B(O,q,X),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,Jue),o.createElementVNode("span",Que,o.toDisplayString(o.unref(i)("common.selectAll")),1)])])])]),q.permission&&q.permission.length>0?(o.openBlock(),o.createElementBlock("div",Vue,[o.createElementVNode("div",efe,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(q.permission,X=>(o.openBlock(),o.createElementBlock("label",{key:X.id,class:"flex items-center gap-2 px-2.5 py-1.5 bg-gray-50 dark:bg-zinc-900/50 border border-gray-200 dark:border-neutral-700 rounded-md cursor-pointer hover:border-pink-400 dark:hover:border-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-all group"},[o.createElementVNode("input",{type:"checkbox",checked:y(q.id,X.id,!0),onChange:oe=>C(q.id,X.id,oe,!0),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,tfe),o.createElementVNode("span",nfe,o.toDisplayString(X.name),1)]))),128))])])):o.createCommentVNode("",!0)]))),128))])):o.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-d20eb07e"]]),ife={class:"space-y-4"},rfe={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},ofe={key:0,class:"text-danger-500"},sfe={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},afe={class:"text-neutral-600 dark:text-neutral-400"},lfe={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},cfe={class:"text-neutral-500 dark:text-neutral-400"},dfe={key:3,class:"space-y-3"},ufe={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},ffe={class:"flex items-center gap-3"},hfe={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},mfe={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},pfe={class:"flex items-center gap-2 text-sm font-medium"},gfe={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},yfe={class:"p-4"},bfe={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},vfe={class:"ml-2 flex-1 min-w-0"},wfe=["for"],_fe={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},kfe={key:4,class:"mt-1 text-xs text-danger-600"},L0=o.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,{t:r}=Yn.useI18n(),s=o.ref(!0),a=o.ref([]),l=o.ref({}),c=o.ref([]),d=o.ref({}),f=C=>{if(!C)return[];if(Array.isArray(C)&&C.length>0&&C[0].module&&Array.isArray(C[0].permissions))return C.map(M=>({menuId:M.menuId,module:M.module,label:M.label||M.module,permissions:M.permissions}));if(Array.isArray(C)&&C.length>0&&C[0].key){const M={};return C.forEach(B=>{const N=B.key,j=N&&N.includes(".")?N.split(".")[0]:"other";M[j]||(M[j]={menuId:0,module:j,label:j,permissions:[]}),M[j].permissions.push({id:B.id,key:B.key,label:B.label,description:B.description})}),Object.values(M)}if(Array.isArray(C)&&C.length>0&&C[0].id&&C[0].name&&Array.isArray(C[0].permission)){const M=[],B=(N,j="")=>{const W=j?`${j}.${N.name}`:N.name,P=W.toLowerCase().replace(/\s+/g,"_"),E=[];if(N.detail&&Array.isArray(N.detail)&&N.detail.forEach(k=>{E.push(k.id)}),N.permission&&N.permission.length>0){const k=N.permission.map($=>({id:$.id,key:`${P}.${$.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${$.name} ${N.name}`,description:`Permission to ${$.name.toLowerCase()} ${N.name.toLowerCase()}`}));M.push({menuId:N.id,module:P,label:N.name,permissions:k,subMenuIds:E.length>0?E:void 0})}N.detail&&Array.isArray(N.detail)&&N.detail.forEach(k=>{B(k,W)})};return C.forEach(N=>B(N)),M}return C.data?f(C.data):[]},h=async()=>{s.value=!0;try{let C;n.treeData&&n.treeData.length>0?C=n.treeData:C=[];const M=f(C);a.value=M;const B={},N=[],j={};M.forEach(P=>{P.permissions.forEach(E=>{const k=typeof E.id=="string"?parseInt(E.id):E.id;j[k]=P.menuId})});const W=new Set;n.modelValue&&Array.isArray(n.modelValue)&&n.modelValue.forEach(P=>{N.push(P.menuId),P.actionsIds&&Array.isArray(P.actionsIds)&&P.actionsIds.forEach(E=>W.add(E))}),M.forEach(P=>P.permissions.forEach(E=>{const k=typeof E.id=="string"?parseInt(E.id):E.id;B[k]=W.has(k)})),l.value=B,c.value=N,d.value=j}catch{a.value=[]}finally{s.value=!1}},m=C=>C.permissions.filter(M=>{const B=typeof M.id=="string"?parseInt(M.id):M.id;return l.value[B]}).length,g=C=>C.permissions.every(M=>{const B=typeof M.id=="string"?parseInt(M.id):M.id;return l.value[B]}),v=C=>{const M=m(C);return M>0&&M<C.permissions.length},y=o.ref(!1),A=(C,M)=>{y.value=!0,C.permissions.map(j=>typeof j.id=="string"?parseInt(j.id):j.id),C.permissions.forEach(j=>{const W=typeof j.id=="string"?parseInt(j.id):j.id;l.value[W]=M});let B=n.modelValue?[...n.modelValue]:[],N=[C.menuId];C.subMenuIds&&C.subMenuIds.length>0&&(N=[...N,...C.subMenuIds],C.subMenuIds.forEach(j=>{const W=a.value.find(P=>P.menuId===j);W&&W.permissions.forEach(P=>{const E=typeof P.id=="string"?parseInt(P.id):P.id;l.value[E]=M})})),M?N.forEach(j=>{const W=a.value.find(P=>P.menuId===j);if(W){const P=W.permissions.map(k=>typeof k.id=="string"?parseInt(k.id):k.id),E=B.findIndex(k=>k.menuId===j);E!==-1?B[E]={menuId:j,actionsIds:P}:B.push({menuId:j,actionsIds:P})}}):B=B.filter(j=>!N.includes(j.menuId)),c.value=B.map(j=>j.menuId),i("update:modelValue",B),setTimeout(()=>{y.value=!1},100)};return o.watch(()=>n.modelValue,C=>{if(!C)return;const M=new Set,B=[];C.forEach(N=>{B.push(N.menuId),N.actionsIds&&Array.isArray(N.actionsIds)&&N.actionsIds.forEach(j=>M.add(j))}),Object.keys(l.value).forEach(N=>{const j=parseInt(N);l.value[j]=M.has(j)}),c.value=B}),o.watch(()=>n.treeData,C=>{C&&C.length>0&&h()},{deep:!0}),o.watch(l,(C,M)=>{if(y.value)return;if(Object.keys(C).map(N=>parseInt(N)).filter(N=>C[N]!==(M==null?void 0:M[N])).length>0){let N=n.modelValue?[...n.modelValue]:[];const j={};Object.keys(C).forEach(W=>{const P=parseInt(W);if(C[P]){const E=d.value[P];E!==void 0&&(j[E]||(j[E]=[]),j[E].push(P))}}),Object.keys(j).forEach(W=>{const P=parseInt(W),E=j[P],k=N.findIndex($=>$.menuId===P);k!==-1?N[k]={menuId:P,actionsIds:E}:N.push({menuId:P,actionsIds:E})}),N=N.filter(W=>j[W.menuId]&&j[W.menuId].length>0),c.value=N.map(W=>W.menuId),i("update:modelValue",N)}},{deep:!0}),o.onMounted(h),(C,M)=>(o.openBlock(),o.createElementBlock("div",ife,[e.label?(o.openBlock(),o.createElementBlock("label",rfe,[o.createTextVNode(o.toDisplayString(e.label)+" ",1),e.required?(o.openBlock(),o.createElementBlock("span",ofe,"*")):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),s.value?(o.openBlock(),o.createElementBlock("div",sfe,[o.createVNode(o.unref(Ne.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),o.createElementVNode("span",afe,o.toDisplayString(o.unref(r)("common.loadingPermissions")),1)])):a.value.length===0?(o.openBlock(),o.createElementBlock("div",lfe,[o.createElementVNode("p",cfe,o.toDisplayString(o.unref(r)("common.noPermissions")),1)])):(o.openBlock(),o.createElementBlock("div",dfe,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,B=>(o.openBlock(),o.createElementBlock("div",{key:B.module,class:"bg-white dark:bg-neutral-800 rounded-lg border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm hover:shadow-md transition-shadow"},[o.createElementVNode("div",ufe,[o.createElementVNode("div",ffe,[o.createVNode($l,{modelValue:g(B),indeterminate:v(B),"onUpdate:modelValue":N=>A(B,!!N),disabled:e.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),o.createElementVNode("div",null,[o.createElementVNode("div",hfe,o.toDisplayString(B.label||B.module),1),o.createElementVNode("div",mfe,o.toDisplayString(m(B))+" "+o.toDisplayString(o.unref(r)("common.from"))+" "+o.toDisplayString(B.permissions.length)+" "+o.toDisplayString(o.unref(r)("common.selected")),1)])]),o.createElementVNode("div",pfe,[o.createElementVNode("div",gfe,o.toDisplayString(m(B))+"/"+o.toDisplayString(B.permissions.length),1)])]),o.createElementVNode("div",yfe,[o.createElementVNode("div",bfe,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(B.permissions,N=>(o.openBlock(),o.createElementBlock("div",{key:N.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[o.createVNode($l,{modelValue:l.value[typeof N.id=="string"?parseInt(N.id):N.id],"onUpdate:modelValue":j=>l.value[typeof N.id=="string"?parseInt(N.id):N.id]=j,disabled:e.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),o.createElementVNode("div",vfe,[o.createElementVNode("label",{for:`perm-${N.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},o.toDisplayString(N.label||N.key),9,wfe),N.description?(o.openBlock(),o.createElementBlock("p",_fe,o.toDisplayString(N.description),1)):o.createCommentVNode("",!0)])]))),128))])])]))),128))])),e.error?(o.openBlock(),o.createElementBlock("p",kfe,o.toDisplayString(e.error),1)):o.createCommentVNode("",!0)]))}}),xfe=["aria-busy"],Efe={class:"flex items-center gap-2 shrink-0"},Cfe={class:"flex-1 text-right overflow-hidden flex items-center justify-end gap-2"},Sfe=["title"],Afe=["href"],Tfe={class:"truncate max-w-[150px]"},Pfe=["title"],F0=Mn(o.defineComponent({name:"DCodeStaticLabel",__name:"DCodeStaticLabel",props:{label:{},modelValue:{},value:{},icon:{},color:{},valueType:{},prefix:{},suffix:{},type:{},locale:{default:"id-ID"},badgeColor:{default:"secondary"},placeholder:{default:"-"},skeleton:{type:Boolean,default:!1},dummyMode:{type:Boolean,default:!1}},setup(e){const t=e,n=o.ref(!1),i=o.computed(()=>t.modelValue??t.value),r=o.computed(()=>(t.valueType||t.type||"text").toUpperCase()),s=o.computed(()=>{const c=t.color||"secondary",d={primary:"border-blue-200 text-blue-700 dark:text-blue-400 dark:border-blue-900/50",success:"border-green-200 text-green-700 dark:text-green-400 dark:border-green-900/50",warning:"border-yellow-200 text-yellow-700 dark:text-yellow-400 dark:border-yellow-900/50",danger:"border-red-200 text-red-700 dark:text-red-400 dark:border-red-900/50",info:"border-cyan-200 text-cyan-700 dark:text-cyan-400 dark:border-cyan-900/50",secondary:"border-slate-200 text-slate-700 dark:border-slate-700/50 dark:text-slate-200",dark:"border-b border-gray-300 text-gray-900 dark:text-gray-100 dark:border-gray-700"};return d[c]||d.secondary}),a=o.computed(()=>{const c=t.badgeColor||"secondary",d={primary:"bg-blue-50 border-blue-200 text-blue-700 dark:bg-blue-950/20 dark:border-blue-900/50 dark:text-blue-400",success:"bg-green-50 border-green-200 text-green-700 dark:bg-green-950/20 dark:border-green-900/50 dark:text-green-400",warning:"bg-yellow-50 border-yellow-200 text-yellow-700 dark:bg-yellow-950/20 dark:border-yellow-900/50 dark:text-yellow-400",danger:"bg-red-50 border-red-200 text-red-700 dark:bg-red-950/20 dark:border-red-900/50 dark:text-red-400",info:"bg-cyan-50 border-cyan-200 text-cyan-700 dark:bg-cyan-950/20 dark:border-cyan-900/50 dark:text-cyan-400",secondary:"bg-slate-50 border-slate-200 text-slate-700 dark:bg-slate-900/20 dark:border-slate-800 dark:text-slate-200",dark:"bg-neutral-100 border-neutral-300 text-neutral-900 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-100"};return d[c]||d.secondary}),l=o.computed(()=>{const c=i.value;if(c==null||c==="")return t.dummyMode?t.placeholder:"-";let d="";switch(r.value){case"DATE":d=Jc(c,"short",t.locale);break;case"DATETIME":d=Jc(c,"datetime",t.locale);break;case"CURRENCY":const m=t.prefix||"IDR";d=Rb(c,m);break;case"BOOLEAN":typeof c=="boolean"?d=t.locale.startsWith("id")?c?"Ya":"Tidak":c?"Yes":"No":d=String(c);break;case"NUMBER":const g=Number(c);d=isNaN(g)?String(c):new Intl.NumberFormat(t.locale).format(g);break;case"PASSWORD":d=n.value?String(c):"•".repeat(String(c).length||8);break;case"FILE":typeof c=="string"?d=c.split("/").pop()||"Attachment":d=c.name??c.label??"Attachment";break;default:typeof c=="object"&&c!==null?d=c.name??c.label??c.code??c.value??c.id??JSON.stringify(c):d=String(c);break}const f=r.value!=="CURRENCY"&&t.prefix?t.prefix:"",h=t.suffix||"";return`${f}${d}${h}`});return(c,d)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-row justify-between items-center gap-4 py-3 px-0 border-b transition-all duration-300 rounded-none bg-transparent",s.value]),"aria-busy":e.skeleton},[e.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[d[1]||(d[1]=o.createElementVNode("div",{class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1)),d[2]||(d[2]=o.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-shimmer"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",Efe,[o.createVNode(jl,{label:e.label,icon:e.icon,class:"text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider"},null,8,["label","icon"])]),o.createElementVNode("div",Cfe,[o.renderSlot(c.$slots,"value",{},()=>[r.value==="PASSWORD"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("span",{class:"text-sm font-mono font-medium truncate block",title:String(i.value||"")},o.toDisplayString(l.value),9,Sfe),o.createElementVNode("button",{type:"button",class:"p-1 hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded transition-colors text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200",onClick:d[0]||(d[0]=f=>n.value=!n.value)},[n.value?(o.openBlock(),o.createBlock(o.unref(Ne.EyeOff),{key:1,class:"w-4 h-4"})):(o.openBlock(),o.createBlock(o.unref(Ne.Eye),{key:0,class:"w-4 h-4"}))])],64)):r.value==="BADGE"?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-semibold border transition-all duration-200",a.value])},o.toDisplayString(l.value),3)):r.value==="FILE"&&i.value&&i.value!==e.placeholder?(o.openBlock(),o.createElementBlock("a",{key:2,href:String(i.value),target:"_blank",class:"inline-flex items-center gap-1.5 text-xs font-semibold text-blue-600 dark:text-blue-400 hover:underline transition-all"},[o.createVNode(o.unref(Ne.FileText),{class:"w-3.5 h-3.5"}),o.createElementVNode("span",Tfe,o.toDisplayString(l.value),1),o.createVNode(o.unref(Ne.Download),{class:"w-3 h-3 text-neutral-400"})],8,Afe)):(o.openBlock(),o.createElementBlock("span",{key:3,class:"text-sm font-medium truncate block",title:l.value},o.toDisplayString(l.value),9,Pfe))],!0)])],64))],10,xfe))}}),[["__scopeId","data-v-6070f2ab"]]),Bfe={class:"w-full"},Nfe={key:0,class:"flex flex-col"},Dfe={key:0,class:"flex flex-col items-center justify-center p-20 bg-neutral-50 dark:bg-neutral-900/50 rounded-xl border border-neutral-200 dark:border-neutral-800"},Mfe={key:1,class:"flex flex-col items-center justify-center p-12 bg-red-50 dark:bg-red-950/30 rounded-xl border border-red-100 dark:border-red-900/50"},Rfe={class:"text-xs font-bold text-red-600 dark:text-red-400 uppercase tracking-wider mb-3"},Ife={key:2,class:"flex flex-col items-center justify-center p-16 bg-neutral-50/50 dark:bg-neutral-900/20 rounded-2xl border-2 border-dashed border-neutral-200 dark:border-neutral-800 transition-colors"},Ofe={class:"p-4 rounded-full bg-neutral-100 dark:bg-neutral-800 mb-4"},Lfe={class:"text-sm font-semibold text-neutral-500 dark:text-neutral-400"},Ffe={key:3,class:"flex flex-col gap-6"},$fe={class:"text-base font-bold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},zfe={key:0,class:"px-2 py-0.5 rounded-full bg-primary/10 text-primary text-[10px] font-semibold uppercase tracking-wider"},jfe={class:"flex items-center gap-4 text-xs text-neutral-500 dark:text-neutral-400 font-medium"},Ufe={class:"flex items-center gap-1.5"},Wfe={class:"flex items-center gap-1.5"},Hfe={class:"hidden sm:inline-block px-1.5 py-0.5 rounded bg-neutral-100 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 font-mono text-[10px]"},qfe={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Kfe={key:0,class:"flex flex-col gap-2 group/img"},Gfe=["onClick"],Yfe=["src","alt"],Zfe={class:"absolute inset-0 bg-black/20 opacity-0 group-hover/img:opacity-100 transition-opacity flex items-center justify-center pointer-events-none"},Xfe={class:"p-2 rounded-full bg-white/90 dark:bg-neutral-900/90 backdrop-blur-sm shadow-md text-neutral-800 dark:text-neutral-200"},Jfe={key:1,class:"flex flex-col gap-2 group/img"},Qfe=["onClick"],Vfe=["src","alt"],ehe={class:"absolute inset-0 bg-black/20 opacity-0 group-hover/img:opacity-100 transition-opacity flex items-center justify-center pointer-events-none"},the={class:"p-2 rounded-full bg-white/90 dark:bg-neutral-900/90 backdrop-blur-sm shadow-md text-neutral-800 dark:text-neutral-200"},nhe={key:1,class:"p-4 text-center text-xs text-neutral-400 dark:text-neutral-500 italic"},ihe={key:1,class:"space-y-2 group"},rhe={key:0,class:"flex flex-col items-center justify-center p-20 bg-neutral-50 dark:bg-neutral-900/50 rounded-xl border border-neutral-200 dark:border-neutral-800"},ohe={key:1,class:"flex flex-col items-center justify-center p-12 bg-red-50 dark:bg-red-950/30 rounded-xl border border-red-100 dark:border-red-900/50"},she={class:"text-xs font-bold text-red-600 dark:text-red-400 uppercase tracking-wider mb-3"},ahe={key:2,class:"flex flex-col items-center justify-center p-16 bg-neutral-50/50 dark:bg-neutral-900/20 rounded-2xl border-2 border-dashed border-neutral-200 dark:border-neutral-800 transition-colors"},lhe={class:"p-4 rounded-full bg-neutral-100 dark:bg-neutral-800 mb-4"},che={class:"text-sm font-semibold text-neutral-500 dark:text-neutral-400"},dhe=["onClick"],uhe=["src","alt"],fhe={class:"absolute top-2 right-2 p-1.5 rounded-lg bg-black/50 backdrop-blur-sm text-white opacity-0 group-hover/item:opacity-100 transition-opacity z-10 pointer-events-none"},hhe={class:"flex flex-col gap-1 text-[11px] leading-tight"},mhe={class:"flex gap-2 min-w-0"},phe={class:"font-bold text-neutral-900 dark:text-neutral-100 break-all flex-1"},ghe={key:0,class:"flex gap-2 min-w-0 border-t border-neutral-200/50 dark:border-neutral-700/50 pt-1 mt-0.5"},yhe={class:"font-semibold text-neutral-800 dark:text-neutral-200 break-all flex-1"},bhe={key:1,class:"flex gap-2 min-w-0 border-t border-neutral-200/50 dark:border-neutral-700/50 pt-1 mt-0.5"},vhe={class:"font-semibold text-neutral-800 dark:text-neutral-200 break-all flex-1"},whe={class:"flex items-center justify-between px-6 py-4 border-b border-white/10 bg-black/40 text-white z-20"},_he={class:"flex items-center gap-3 min-w-0"},khe={class:"flex flex-col min-w-0"},xhe={class:"flex items-center gap-2"},Ehe={class:"text-sm font-bold truncate"},Che={key:0,class:"px-2 py-0.5 rounded text-[10px] font-bold uppercase tracking-wider bg-primary/20 text-primary border border-primary/30"},She={key:0,class:"text-xs text-neutral-400 font-medium mt-0.5"},Ahe={class:"flex items-center gap-2"},The={class:"flex items-center justify-center p-4 max-w-full max-h-full pointer-events-none"},Phe=["src","alt"],Bhe={class:"flex justify-center pb-6 pt-2 z-20 pointer-events-none"},Nhe={class:"flex items-center gap-1.5 px-4 py-2 rounded-full bg-neutral-900/90 border border-white/15 backdrop-blur-md shadow-2xl text-white pointer-events-auto"},Dhe={class:"px-2 font-mono text-xs font-semibold text-neutral-300 min-w-[52px] text-center"},$0=Mn(o.defineComponent({name:"DCodeStaticImage",__name:"DCodeStaticImage",props:{modelValue:{},items:{},timelineData:{},endpoint:{},apiUrl:{},apiModule:{},apiAction:{},apiMethod:{default:"GET"},apiParams:{default:()=>({})},baseUrl:{},alt:{default:"Image"},label:{},aspectRatio:{default:"16/9"},width:{},height:{},fit:{default:"cover"},rounded:{type:Boolean,default:!1},allowPreview:{type:Boolean,default:!0},columns:{default:3},gap:{default:"0.5rem"},title:{default:"Static Image / Evidence"},dummyMode:{type:Boolean,default:!1}},setup(e){const{t}=Yn.useI18n(),n=e,{DCodeApi:i}=o.inject("externalApi")||{},r=o.ref(!1),s=o.ref(""),a=o.ref([]),l=o.computed(()=>{if(a.value.length>0)return a.value;const Y=n.items!==void 0&&n.items!==null?n.items:n.modelValue;if(console.log("[DCodeStaticImage] Resolving items. props.items:",n.items,"props.modelValue:",n.modelValue,"resolved source:",Y),Y){if(Array.isArray(Y))return Y;const F=Y;return F.data&&Array.isArray(F.data)?F.data:F.payload&&Array.isArray(F.payload)?F.payload:[Y]}return[]}),c=async()=>{var T;if(n.dummyMode){a.value=[{name:"Evidence Sample",noRef:"DUM-001",startTime:new Date().toISOString(),endTime:new Date().toISOString(),duration:36e5,detail:[{id:1,noRef:"EV-001",name:"Initial Condition",startTime:new Date().toISOString(),endTime:new Date().toISOString(),duration:18e5,beforeUrl:"https://placehold.co/600x400/f3f4f6/6b7280?text=Before+Sample",afterUrl:"https://placehold.co/600x400/ecfdf5/059669?text=After+Sample"}]}];return}const Y=n.endpoint||{},F=Y.apiUrl||n.apiUrl,_=Y.apiModule||n.apiModule,b=Y.apiAction||n.apiAction,R=(Y.apiMethod||n.apiMethod||"GET").toUpperCase(),S=Y.apiParams||n.apiParams||{};if(!(!F&&!_)){r.value=!0,s.value="";try{let D;_&&b?D=await i(_,b,S):F&&(D=await i(F,R,S));let Z=[];D&&(Array.isArray(D.data)?Z=D.data:Array.isArray(D.payload)?Z=D.payload:Array.isArray(D)?Z=D:(T=D.data)!=null&&T.items&&Array.isArray(D.data.items)&&(Z=D.data.items)),Z.length>0?a.value=Z:a.value=[]}catch(D){console.error("[DCodeStaticImage] Error loading data:",D),s.value=D.message||"Failed to load images data"}finally{r.value=!1}}};o.watch([()=>n.endpoint,()=>n.apiUrl,()=>n.apiModule],()=>{c()},{deep:!0}),o.onMounted(()=>{c()});const d=o.computed(()=>n.timelineData&&n.timelineData.length>0?n.timelineData:l.value),f=o.computed(()=>{const Y=d.value;let F=[];return Y.forEach(_=>{_.detail&&Array.isArray(_.detail)?F=F.concat(_.detail):(_.beforeUrl||_.afterUrl||_.url||_.src)&&F.push(_)}),F}),h=o.computed(()=>!!(l.value.some(F=>F.detail&&Array.isArray(F.detail)||F.beforeUrl||F.afterUrl)||(n.apiUrl||n.apiModule)&&(r.value||s.value))),m=o.computed(()=>{const Y=l.value;console.log("[DCodeStaticImage] Normalizing source items:",Y);const F=typeof window<"u"&&window.location.protocol==="https:",_=R=>{if(!R)return"";let S=R;return S.includes("217.217.254.189:8000")?S=S.replace(/^https?:\/\/217\.217\.254\.189:8000/,""):F&&S.startsWith("http:")&&(S=S.replace("http:","https:")),S},b=Y.map(R=>{if(typeof R=="string")return{src:_(R),alt:n.alt};const S=_(R.src||R.url||R.urlFull||R.path||R.beforeUrl||R.afterUrl||"");return{...R,src:S,alt:R.alt||R.label||n.alt}}).filter(R=>!!R.src);return console.log("[DCodeStaticImage] Normalized items outcome:",b),b}),g=o.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${Math.min(n.columns,m.value.length||1)}, minmax(0, 1fr))`,gap:n.gap,width:n.width||"100%"})),v=o.computed(()=>["w-full h-full transition-all duration-500",n.rounded?"rounded-xl":"rounded-none",n.fit==="cover"?"object-cover":n.fit==="contain"?"object-contain":n.fit==="fill"?"object-fill":"object-none"].join(" ")),y=Y=>Y?new Date(Y).toLocaleTimeString("id-ID",{hour:"2-digit",minute:"2-digit",second:"2-digit"}):"",A=Y=>Y?new Date(Y).toLocaleDateString("id-ID",{day:"numeric",month:"short",year:"numeric"}):"",C=Y=>{if(Y<1e3)return`${Y}ms`;const F=Math.floor(Y/1e3);return F<60?`${F}s`:`${Math.floor(F/60)}m ${F%60}s`},M=o.ref(!1),B=o.ref(0),N=o.ref(1),j=o.ref(0),W=o.ref({x:0,y:0}),P=o.ref(!1),E=o.ref({x:0,y:0}),k=o.computed(()=>{if(h.value){const Y=[];return f.value.forEach(F=>{F.beforeUrl&&Y.push({src:F.beforeUrl,alt:`${F.name} - Before`,title:F.name,label:"Before"}),F.afterUrl&&Y.push({src:F.afterUrl,alt:`${F.name} - After`,title:F.name,label:"After"})}),Y}return m.value.map(Y=>{var F;return{src:Y.src,alt:Y.alt,title:((F=Y.src)==null?void 0:F.split("/").pop())||n.title||"Image Preview",label:Y.label||n.label}})}),$=o.computed(()=>!k.value||k.value.length===0?null:k.value[B.value]||k.value[0]||null),I=()=>{N.value=1,j.value=0,W.value={x:0,y:0}},O=(Y,F,_)=>{if(!n.allowPreview)return;const b=k.value.findIndex(R=>R.src===Y);B.value=b!==-1?b:0,I(),M.value=!0},q=()=>{M.value=!1,I()},X=()=>{N.value=Math.min(Number((N.value+.25).toFixed(2)),5)},oe=()=>{N.value=Math.max(Number((N.value-.25).toFixed(2)),.25)},ue=()=>{j.value=(j.value+90)%360},te=()=>{j.value=(j.value-90+360)%360},re=()=>{k.value.length<=1||(B.value=(B.value+1)%k.value.length,I())},ge=()=>{k.value.length<=1||(B.value=(B.value-1+k.value.length)%k.value.length,I())},ce=Y=>{Y.preventDefault(),Y.deltaY<0?X():oe()},se=Y=>{Y.button===0&&(P.value=!0,E.value={x:Y.clientX-W.value.x,y:Y.clientY-W.value.y})},z=Y=>{P.value&&(W.value={x:Y.clientX-E.value.x,y:Y.clientY-E.value.y})},G=()=>{P.value=!1},ee=(Y,F)=>{if(!Y)return;const _=document.createElement("a");_.href=Y,_.download=F||Y.split("/").pop()||"image",_.target="_blank",document.body.appendChild(_),_.click(),document.body.removeChild(_)},K=Y=>{M.value&&(Y.key==="Escape"?q():Y.key==="ArrowRight"?re():Y.key==="ArrowLeft"?ge():Y.key==="+"||Y.key==="="?X():Y.key==="-"?oe():Y.key==="r"||Y.key==="R"?ue():Y.key==="0"&&I())};return o.onMounted(()=>{typeof window<"u"&&window.addEventListener("keydown",K)}),o.onBeforeUnmount(()=>{typeof window<"u"&&window.removeEventListener("keydown",K)}),(Y,F)=>(o.openBlock(),o.createElementBlock("div",Bfe,[h.value?(o.openBlock(),o.createElementBlock("div",Nfe,[r.value?(o.openBlock(),o.createElementBlock("div",Dfe,[o.createVNode(o.unref(Ne.Loader2),{class:"h-8 w-8 text-primary animate-spin mb-3"}),F[1]||(F[1]=o.createElementVNode("p",{class:"text-[10px] font-black uppercase tracking-widest text-neutral-400 animate-pulse"},"Syncing Visual Data...",-1))])):s.value?(o.openBlock(),o.createElementBlock("div",Mfe,[o.createVNode(o.unref(Ne.AlertTriangle),{class:"h-8 w-8 text-red-500 mb-4 opacity-80"}),o.createElementVNode("span",Rfe,o.toDisplayString(s.value),1),o.createElementVNode("button",{onClick:c,class:"text-[10px] font-black uppercase underline tracking-wider opacity-60 hover:opacity-100"},"Retry Fetching")])):f.value.length===0?(o.openBlock(),o.createElementBlock("div",Ife,[o.createElementVNode("div",Ofe,[o.createVNode(o.unref(Ne.ImageIcon),{class:"h-8 w-8 text-neutral-400 dark:text-neutral-500 opacity-60"})]),o.createElementVNode("span",Lfe,o.toDisplayString(o.unref(t)("common.noData")),1),F[2]||(F[2]=o.createElementVNode("p",{class:"text-[10px] text-neutral-400 dark:text-neutral-500 mt-1 uppercase tracking-widest font-medium"},"No visual records found",-1))])):(o.openBlock(),o.createElementBlock("div",Ffe,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f.value,(_,b)=>(o.openBlock(),o.createElementBlock("div",{key:b,class:"flex flex-col gap-4"},[o.createVNode(Fo,null,{header:o.withCtx(()=>[o.createElementVNode("h4",$fe,[o.createTextVNode(o.toDisplayString(_.name)+" ",1),_.noRef?(o.openBlock(),o.createElementBlock("span",zfe,o.toDisplayString(_.noRef),1)):o.createCommentVNode("",!0)])]),actions:o.withCtx(()=>[o.createElementVNode("div",jfe,[o.createElementVNode("span",Ufe,[o.createVNode(o.unref(Ne.Calendar),{class:"w-3.5 h-3.5"}),o.createTextVNode(" "+o.toDisplayString(A(_.startTime)),1)]),o.createElementVNode("span",Wfe,[o.createVNode(o.unref(Ne.Clock),{class:"w-3.5 h-3.5"}),o.createTextVNode(" "+o.toDisplayString(y(_.startTime))+" - "+o.toDisplayString(y(_.endTime)),1)]),o.createElementVNode("span",Hfe,o.toDisplayString(C(_.duration)),1)])]),default:o.withCtx(()=>[_.beforeUrl||_.afterUrl?(o.openBlock(),o.createElementBlock("div",qfe,[_.beforeUrl?(o.openBlock(),o.createElementBlock("div",Kfe,[F[3]||(F[3]=o.createElementVNode("div",{class:"flex items-center justify-between"},[o.createElementVNode("span",{class:"text-[11px] font-bold uppercase tracking-wider text-neutral-500 dark:text-neutral-400 bg-neutral-200 dark:bg-neutral-800 px-2 py-0.5 rounded-md"},"Before")],-1)),o.createElementVNode("div",{class:"relative overflow-hidden rounded-lg border border-neutral-200 dark:border-neutral-700 bg-neutral-100 dark:bg-neutral-900 aspect-video shadow-sm transition-all duration-300 group-hover/img:shadow-md cursor-zoom-in",onClick:R=>O(_.beforeUrl,_.name)},[o.createElementVNode("img",{src:_.beforeUrl,alt:_.name+" Before",class:"w-full h-full object-contain bg-white/50 dark:bg-black/20 transition-transform duration-300 group-hover/img:scale-105",loading:"lazy"},null,8,Yfe),o.createElementVNode("div",Zfe,[o.createElementVNode("div",Xfe,[o.createVNode(o.unref(Ne.Maximize2),{class:"w-4 h-4"})])])],8,Gfe)])):o.createCommentVNode("",!0),_.afterUrl?(o.openBlock(),o.createElementBlock("div",Jfe,[F[4]||(F[4]=o.createElementVNode("div",{class:"flex items-center justify-between"},[o.createElementVNode("span",{class:"text-[11px] font-bold uppercase tracking-wider text-green-600 dark:text-green-400 bg-green-100 dark:bg-green-900/30 px-2 py-0.5 rounded-md border border-green-200 dark:border-green-800/50"},"After")],-1)),o.createElementVNode("div",{class:"relative overflow-hidden rounded-lg border border-neutral-200 dark:border-neutral-700 bg-neutral-100 dark:bg-neutral-900 aspect-video shadow-sm transition-all duration-300 group-hover/img:shadow-md cursor-zoom-in",onClick:R=>O(_.afterUrl,_.name)},[o.createElementVNode("img",{src:_.afterUrl,alt:_.name+" After",class:"w-full h-full object-contain bg-white/50 dark:bg-black/20 transition-transform duration-300 group-hover/img:scale-105",loading:"lazy"},null,8,Vfe),o.createElementVNode("div",ehe,[o.createElementVNode("div",the,[o.createVNode(o.unref(Ne.Maximize2),{class:"w-4 h-4"})])])],8,Qfe)])):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",nhe," No images captured for this step. "))]),_:2},1024)]))),128))]))])):(o.openBlock(),o.createElementBlock("div",ihe,[r.value?(o.openBlock(),o.createElementBlock("div",rhe,[o.createVNode(o.unref(Ne.Loader2),{class:"h-8 w-8 text-primary animate-spin mb-3"}),F[5]||(F[5]=o.createElementVNode("p",{class:"text-[10px] font-black uppercase tracking-widest text-neutral-400 animate-pulse"},"Syncing Visual Data...",-1))])):s.value?(o.openBlock(),o.createElementBlock("div",ohe,[o.createVNode(o.unref(Ne.AlertTriangle),{class:"h-8 w-8 text-red-500 mb-4 opacity-80"}),o.createElementVNode("span",she,o.toDisplayString(s.value),1),o.createElementVNode("button",{onClick:c,class:"text-[10px] font-black uppercase underline tracking-wider opacity-60 hover:opacity-100"},"Retry Fetching")])):m.value.length===0?(o.openBlock(),o.createElementBlock("div",ahe,[o.createElementVNode("div",lhe,[o.createVNode(o.unref(Ne.ImageIcon),{class:"h-8 w-8 text-neutral-400 dark:text-neutral-500 opacity-60"})]),o.createElementVNode("span",che,o.toDisplayString(o.unref(t)("common.noData")),1),F[6]||(F[6]=o.createElementVNode("p",{class:"text-[10px] text-neutral-400 dark:text-neutral-500 mt-1 uppercase tracking-widest font-medium"},"No visual records found",-1))])):(o.openBlock(),o.createElementBlock("div",{key:3,style:o.normalizeStyle(g.value)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(m.value,(_,b)=>{var R;return o.openBlock(),o.createElementBlock("div",{key:b,class:"flex flex-col space-y-1 group/item"},[o.createElementVNode("div",{class:o.normalizeClass(["relative overflow-hidden bg-neutral-100 dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 transition-all duration-300 transform hover:scale-[1.02] hover:z-10 cursor-zoom-in",[e.rounded?"rounded-xl":"rounded-none"]]),style:o.normalizeStyle({aspectRatio:e.aspectRatio}),onClick:S=>O(_.src,_.alt||_.label,_.label)},[o.createElementVNode("img",{src:_.src,alt:_.alt,class:o.normalizeClass(v.value),loading:"lazy"},null,10,uhe),o.createElementVNode("div",fhe,[o.createVNode(o.unref(Ne.Maximize2),{class:"w-3.5 h-3.5"})]),o.createElementVNode("div",{class:o.normalizeClass(["absolute bottom-2 left-2 right-2 p-3 rounded-xl border border-neutral-200/50 dark:border-neutral-700/50 shadow-xl opacity-0 translate-y-2 group-hover/item:opacity-100 group-hover/item:translate-y-0 transition-all duration-300 z-10 select-none",["dark:bg-neutral-900/80"]]),style:{background:"rgba(255, 255, 255, 0.85)","backdrop-filter":"blur(8px)"}},[o.createElementVNode("div",hhe,[o.createElementVNode("div",mhe,[F[7]||(F[7]=o.createElementVNode("span",{class:"w-12 shrink-0 text-neutral-500 font-medium tracking-tight"},"Name",-1)),o.createElementVNode("span",phe,o.toDisplayString(((R=_.src)==null?void 0:R.split("/").pop())||"Untitled"),1)]),_.label?(o.openBlock(),o.createElementBlock("div",ghe,[F[8]||(F[8]=o.createElementVNode("span",{class:"w-12 shrink-0 text-neutral-500 font-medium tracking-tight"},"Label",-1)),o.createElementVNode("span",yhe,o.toDisplayString(_.label),1)])):o.createCommentVNode("",!0),e.label?(o.openBlock(),o.createElementBlock("div",bhe,[F[9]||(F[9]=o.createElementVNode("span",{class:"w-12 shrink-0 text-neutral-500 font-medium tracking-tight"},"Gallery",-1)),o.createElementVNode("span",vhe,o.toDisplayString(e.label),1)])):o.createCommentVNode("",!0)])])],14,dhe)])}),128))],4))])),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[o.createVNode(o.Transition,{"enter-active-class":"transition duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:o.withCtx(()=>[M.value&&$.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"fixed inset-0 z-[99999] flex flex-col bg-black/90 backdrop-blur-md select-none",onClick:o.withModifiers(q,["self"])},[o.createElementVNode("div",whe,[o.createElementVNode("div",_he,[o.createElementVNode("div",khe,[o.createElementVNode("div",xhe,[o.createElementVNode("span",Ehe,o.toDisplayString($.value.title||$.value.alt||"Image Preview"),1),$.value.label?(o.openBlock(),o.createElementBlock("span",Che,o.toDisplayString($.value.label),1)):o.createCommentVNode("",!0)]),k.value.length>1?(o.openBlock(),o.createElementBlock("span",She,o.toDisplayString(B.value+1)+" / "+o.toDisplayString(k.value.length),1)):o.createCommentVNode("",!0)])]),o.createElementVNode("div",Ahe,[o.createElementVNode("button",{type:"button",class:"p-2 rounded-lg bg-white/10 hover:bg-white/20 text-neutral-200 hover:text-white transition-colors cursor-pointer",title:"Download",onClick:F[0]||(F[0]=_=>ee($.value.src,$.value.title))},[o.createVNode(o.unref(Ne.Download),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",class:"p-2 rounded-lg bg-white/10 hover:bg-red-500/80 text-neutral-200 hover:text-white transition-colors ml-2 cursor-pointer",title:"Close (Esc)",onClick:q},[o.createVNode(o.unref(Ne.X),{class:"w-5 h-5"})])])]),o.createElementVNode("div",{class:o.normalizeClass(["relative flex-1 flex items-center justify-center overflow-hidden w-full h-full",N.value>1?"cursor-grab active:cursor-grabbing":"cursor-default"]),onWheel:ce,onMousedown:se,onMousemove:z,onMouseup:G,onMouseleave:G,onClick:o.withModifiers(q,["self"])},[k.value.length>1?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"absolute left-4 z-20 p-3 rounded-full bg-black/60 hover:bg-black/90 text-white/80 hover:text-white border border-white/10 backdrop-blur-sm transition-all transform hover:scale-110 shadow-xl cursor-pointer",title:"Previous (Left Arrow)",onClick:o.withModifiers(ge,["stop"])},[o.createVNode(o.unref(Ne.ChevronLeft),{class:"w-6 h-6"})])):o.createCommentVNode("",!0),o.createElementVNode("div",The,[o.createElementVNode("img",{src:$.value.src,alt:$.value.alt,class:"max-h-[75vh] max-w-[85vw] object-contain transition-transform duration-100 ease-out select-none pointer-events-auto rounded-lg shadow-2xl",style:o.normalizeStyle({transform:`translate(${W.value.x}px, ${W.value.y}px) scale(${N.value}) rotate(${j.value}deg)`}),draggable:"false"},null,12,Phe)]),k.value.length>1?(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",class:"absolute right-4 z-20 p-3 rounded-full bg-black/60 hover:bg-black/90 text-white/80 hover:text-white border border-white/10 backdrop-blur-sm transition-all transform hover:scale-110 shadow-xl cursor-pointer",title:"Next (Right Arrow)",onClick:o.withModifiers(re,["stop"])},[o.createVNode(o.unref(Ne.ChevronRight),{class:"w-6 h-6"})])):o.createCommentVNode("",!0)],34),o.createElementVNode("div",Bhe,[o.createElementVNode("div",Nhe,[o.createElementVNode("button",{type:"button",class:"p-2 rounded-full hover:bg-white/15 text-neutral-300 hover:text-white transition-colors cursor-pointer",title:"Zoom Out (-)",onClick:oe},[o.createVNode(o.unref(Ne.ZoomOut),{class:"w-4 h-4"})]),o.createElementVNode("span",Dhe,o.toDisplayString(Math.round(N.value*100))+"% ",1),o.createElementVNode("button",{type:"button",class:"p-2 rounded-full hover:bg-white/15 text-neutral-300 hover:text-white transition-colors cursor-pointer",title:"Zoom In (+)",onClick:X},[o.createVNode(o.unref(Ne.ZoomIn),{class:"w-4 h-4"})]),F[11]||(F[11]=o.createElementVNode("div",{class:"h-4 w-px bg-white/20 mx-1"},null,-1)),o.createElementVNode("button",{type:"button",class:"p-2 rounded-full hover:bg-white/15 text-neutral-300 hover:text-white transition-colors cursor-pointer",title:"Rotate Left (-90°)",onClick:te},[o.createVNode(o.unref(Ne.RotateCcw),{class:"w-4 h-4"})]),o.createElementVNode("button",{type:"button",class:"p-2 rounded-full hover:bg-white/15 text-neutral-300 hover:text-white transition-colors cursor-pointer",title:"Rotate Right (+90° / R)",onClick:ue},[o.createVNode(o.unref(Ne.RotateCw),{class:"w-4 h-4"})]),F[12]||(F[12]=o.createElementVNode("div",{class:"h-4 w-px bg-white/20 mx-1"},null,-1)),o.createElementVNode("button",{type:"button",class:"flex items-center gap-1.5 px-3 py-1.5 rounded-full hover:bg-white/15 text-neutral-300 hover:text-white text-xs font-medium transition-colors cursor-pointer",title:"Reset View (0)",onClick:I},[o.createVNode(o.unref(Ne.RefreshCw),{class:"w-3.5 h-3.5"}),F[10]||(F[10]=o.createElementVNode("span",null,"Reset",-1))])])])])):o.createCommentVNode("",!0)]),_:1})]))]))}}),[["__scopeId","data-v-1c8c7278"]]),Mhe={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Rhe=["src"],Ihe={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground dark:text-neutral-400 gap-2 p-4 text-center"},Ohe={class:"space-y-0.5"},Lhe={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Fhe={class:"text-xs opacity-70"},$he=["disabled"],zhe=["disabled"],jhe={key:2},Uhe=["disabled"],Whe={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Hhe={class:"flex gap-2"},qhe={class:"font-medium truncate"},Khe={class:"flex gap-2"},Ghe={class:"font-medium"},Yhe={class:"flex gap-2"},Zhe={class:"font-medium truncate"},mk=Mn(o.defineComponent({name:"DCodeFileResult",__name:"DCodeFileResult",props:{file:{},title:{default:"File Terpilih"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},showPreview:{type:Boolean,default:!0},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove","preview"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.computed(()=>{var g,v;if(n.forceFileIcon||!n.file)return!1;if(typeof n.file=="string"){const y=["jpg","jpeg","png","gif","webp","svg"],M=(((g=(n.file.split("/").pop()||"").split(".").pop())==null?void 0:g.toLowerCase())||"").split("?")[0];return y.includes(M)}if(typeof n.file=="object"&&!(n.file instanceof File)){const y=n.file.filename||n.file.name||n.file.fileName||n.file.title||"",A=["jpg","jpeg","png","gif","webp","svg"],M=(((v=y.split(".").pop())==null?void 0:v.toLowerCase())||"").split("?")[0];return A.includes(M)?!0:(n.file.mime||n.file.mimeType||n.file.type||"").startsWith("image/")}return(n.file.type||"").startsWith("image/")});o.watch(()=>n.file,g=>{if(r.value&&r.value.startsWith("blob:")&&URL.revokeObjectURL(r.value),!g)r.value=null;else if(typeof g=="string")r.value=g;else if(typeof g=="object"&&!(g instanceof File)){const v=g.url||g.documentUrl||g.fullUrl||g.path;if(v){const y=g.server;r.value=y?`${y.replace(/\/+$/,"")}/${v.replace(/^\/+/,"")}`:v}else r.value=null}else r.value=URL.createObjectURL(g)},{immediate:!0}),o.onBeforeUnmount(()=>{r.value&&r.value.startsWith("blob:")&&URL.revokeObjectURL(r.value),f&&f.disconnect()});function a(g){const v=g/1024,y=v/1024;return y>=1?`${y.toFixed(2)} MB`:v>=1?`${v.toFixed(1)} KB`:`${g} B`}const l=o.computed(()=>{if(!n.file)return null;if(typeof n.file=="string")return{name:n.file.split("/").pop()||"File",size:"-",type:"url"};if(typeof n.file=="object"&&!(n.file instanceof File)){const g=n.file.filename||n.file.name||n.file.fileName||n.file.title||"File",v=n.file.size?a(n.file.size):"-",y=n.file.mime||n.file.mimeType||n.file.type||"unknown";return{name:g,size:v,type:y}}return{name:n.file.name,size:a(n.file.size),type:n.file.type||"unknown"}}),c=o.ref(!1),d=o.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};o.onMounted(()=>{h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const m=o.computed(()=>n.disabled||!c.value?{}:{borderColor:d.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:d.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(g,v)=>e.file?(o.openBlock(),o.createBlock(Rf,{key:0,class:o.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:o.withCtx(()=>[o.createVNode(Of,{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(Lf,{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.title),1)]),_:1}),e.description?(o.openBlock(),o.createElementBlock("div",Mhe,o.toDisplayString(e.description),1)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(If,{class:"pt-2"},{default:o.withCtx(()=>{var y,A,C,M,B;return[o.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:o.normalizeStyle([{height:`${e.previewHeight}px`},m.value]),onMouseenter:v[3]||(v[3]=N=>c.value=!0),onMouseleave:v[4]||(v[4]=N=>c.value=!1)},[s.value&&r.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Rhe)):(o.openBlock(),o.createElementBlock("div",Ihe,[o.createVNode(o.unref(Ne.FileText),{class:"w-10 h-10"}),o.createElementVNode("div",Ohe,[o.createElementVNode("p",Lhe,o.toDisplayString((y=l.value)==null?void 0:y.name),1),o.createElementVNode("p",Fhe,o.toDisplayString((A=l.value)==null?void 0:A.size),1)])])),o.createElementVNode("div",{class:"d-action-buttons",style:o.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[e.showPreview?(o.openBlock(),o.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:o.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#3b82f6",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",marginRight:"8px"}),onClick:v[0]||(v[0]=N=>i("preview"))},[o.createVNode(o.unref(Ne.Eye),{style:{width:"16px",height:"16px"}})],12,$he)):o.createCommentVNode("",!0),e.showEdit&&s.value?(o.openBlock(),o.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:o.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:v[1]||(v[1]=N=>i("edit"))},[o.createVNode(o.unref(Ne.Pencil),{style:{width:"16px",height:"16px"}})],12,zhe)):(o.openBlock(),o.createElementBlock("div",jhe)),e.showRemove?(o.openBlock(),o.createElementBlock("button",{key:3,disabled:e.disabled,class:"d-action-btn shadow-md",style:o.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:v[2]||(v[2]=N=>i("remove"))},[o.createVNode(o.unref(Ne.Trash2),{style:{width:"16px",height:"16px"}})],12,Uhe)):o.createCommentVNode("",!0)],4),o.createElementVNode("div",{class:"d-metadata-overlay",style:o.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:c.value?1:0,transform:c.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:d.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:d.value?"#e5e5e5":"#171717"})},[o.createElementVNode("div",Whe,[o.createElementVNode("div",Hhe,[v[5]||(v[5]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),o.createElementVNode("span",qhe,o.toDisplayString((C=l.value)==null?void 0:C.name),1)]),o.createElementVNode("div",Khe,[v[6]||(v[6]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),o.createElementVNode("span",Ghe,o.toDisplayString((M=l.value)==null?void 0:M.size),1)]),o.createElementVNode("div",Yhe,[v[7]||(v[7]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),o.createElementVNode("span",Zhe,o.toDisplayString((B=l.value)==null?void 0:B.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-27515b06"]]),Xhe={class:"space-y-3"},Jhe={class:"flex flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed border-primary-300 dark:border-primary-700 bg-primary-50/50 dark:bg-primary-900/10",style:{"min-height":"190px"}},Qhe={class:"flex flex-col items-center justify-center min-h-[300px]"},Vhe=["src","alt"],eme=["src"],tme={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},nme={class:"text-sm font-medium"},ime=["href"],z0=o.defineComponent({name:"DCodeFileField",inheritAttrs:!1,__name:"DCodeFileField",props:{modelValue:{default:null},label:{default:"Upload File"},hint:{},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:void 0},allowedTypes:{default:null},accept:{default:"*/*"},minSizeMb:{default:null},maxSizeMb:{default:1},endpoint:{},uploadFn:{},loading:{type:Boolean},template:{default:null}},emits:["update:modelValue","error","uploaded"],setup(e,{emit:t}){const n=e,i=t,r=o.ref(null),s=o.ref(null),a=o.computed(()=>r.value?r.value:n.modelValue?n.modelValue:null);o.watch(()=>n.modelValue,q=>{q instanceof File?r.value=q:q||(r.value=null)},{immediate:!0});const l=o.ref(null);function c(q){l.value=q,i("error",q)}function d(){l.value=null}const f=o.computed(()=>{const q=(n.allowedTypes??"").trim();return q?q.split(/[,\s;]+/g).map(oe=>oe.trim().toLowerCase()).filter(Boolean).map(oe=>oe.includes("/")||oe.startsWith(".")?oe:`.${oe}`):[]});function h(q){const X=q.lastIndexOf(".");return X>=0?q.slice(X).toLowerCase():""}const m=o.computed(()=>{if(f.value.length){const q=f.value.filter(oe=>oe.startsWith("."));return[...f.value.filter(oe=>oe.includes("/")),...q].join(",")}return n.accept}),g=o.computed(()=>f.value.length?f.value.join(", "):n.accept||"Semua File");function v(q){if(f.value.length){const X=(q.type||"").toLowerCase(),oe=h(q.name);return f.value.some(ue=>ue.includes("/")?X===ue:ue.startsWith(".")?oe===ue:oe===`.${ue}`)}if(n.accept){if(n.accept==="*/*")return!0;const X=n.accept.split(",").map(te=>te.trim().toLowerCase()),oe=(q.type||"").toLowerCase(),ue=h(q.name);return X.some(te=>{if(te.endsWith("/*")){const re=te.slice(0,-2);return oe.startsWith(re)}return te.startsWith(".")?ue===te:oe===te})}return!0}function y(q){return q*1024*1024}async function A(q){return q?v(q)?n.minSizeMb!=null&&q.size<y(n.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${n.minSizeMb}MB`:n.maxSizeMb!=null&&q.size>y(n.maxSizeMb)?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${g.value}`:"File tidak valid"}const{apiUrl:C}=o.inject("externalApi")||{},M=ig(),B=o.ref(!1);async function N(q){var X;if(n.uploadFn){try{B.value=!0;const oe=await n.uploadFn(q);r.value=q,i("update:modelValue",oe),i("uploaded",oe)}catch(oe){console.error("Upload Error",oe),M.error("Upload Failed",(oe==null?void 0:oe.message)||"Unknown error"),c((oe==null?void 0:oe.message)||"Upload Failed")}finally{B.value=!1}return}if(!((X=n.endpoint)!=null&&X.apiUrl)){r.value=q,i("update:modelValue",q);return}try{B.value=!0;const oe=new FormData;oe.append("doc",q);const ue=(n.endpoint.apiMethod||"POST").toUpperCase(),te=n.endpoint.apiUrl,re=await C(te,ue,oe),ge=Array.isArray(re==null?void 0:re.data)?re.data[0]:(re==null?void 0:re.data)||re;r.value=q,i("update:modelValue",ge??re),i("uploaded",re)}catch(oe){console.error("Upload Error",oe),M.error("Upload Failed",(oe==null?void 0:oe.message)||"Unknown error"),c((oe==null?void 0:oe.message)||"Upload Failed")}finally{B.value=!1}}async function j(q){if(n.disabled)return;d();const X=await A(q);if(X){c(X);return}s.value=q,await N(q)}function W(){d(),r.value=null,s.value=null,i("update:modelValue",null)}o.watch(()=>n.modelValue,q=>{q instanceof File&&!s.value&&(s.value=q),q||(s.value=null)},{immediate:!0});const{t:P}=Yn.useI18n(),E=o.ref(!1),k=o.ref(""),$=o.ref(""),I=o.ref(""),O=()=>{var re;const q=r.value,X=n.modelValue;let oe="",ue="";if(q instanceof File)oe=URL.createObjectURL(q),ue=q.type;else if(typeof X=="string"){oe=X;const ge=((re=X.split(".").pop())==null?void 0:re.toLowerCase())||"";["jpg","jpeg","png","gif","webp","svg"].includes(ge)?ue=`image/${ge==="jpg"?"jpeg":ge}`:ge==="pdf"&&(ue="application/pdf")}else if(X&&typeof X=="object"){const ge=X,ce=ge.url||ge.documentUrl||ge.fullUrl||ge.path;if(ce){const se=ge.server;oe=se?`${se.replace(/\/+$/,"")}/${ce.replace(/^\/+/,"")}`:ce,ue=ge.mime||ge.mimeType||""}}if(!oe)return;ue==="application/pdf"&&!oe.includes("#")&&(oe+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),k.value=oe;const te=q instanceof File?q.name:typeof X=="string"?X.split("/").pop():(X==null?void 0:X.filename)||(X==null?void 0:X.name)||(X==null?void 0:X.title)||"Preview File";$.value=n.label||te||"Preview File",I.value=ue||"application/octet-stream",E.value=!0};return(q,X)=>(o.openBlock(),o.createElementBlock("div",Xhe,[B.value||e.loading?(o.openBlock(),o.createBlock(o.unref(Rf),{key:0,class:"dark:bg-neutral-800 dark:border-neutral-700/50"},{default:o.withCtx(()=>[o.createVNode(o.unref(Of),{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Lf),{class:"text-sm font-semibold dark:text-neutral-100"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.label),1)]),_:1})]),_:1}),o.createVNode(o.unref(If),{class:"pt-2"},{default:o.withCtx(()=>[o.createElementVNode("div",Jhe,[o.createVNode(o.unref(Ne.Loader2),{class:"w-8 h-8 animate-spin text-primary-500"}),X[3]||(X[3]=o.createElementVNode("span",{class:"text-sm font-medium text-primary-600 dark:text-primary-400"},"Uploading...",-1))])]),_:1})]),_:1})):a.value?(o.openBlock(),o.createBlock(mk,{key:2,file:a.value,title:e.label,description:e.hint,disabled:e.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"show-preview":!0,"preview-height":e.previewHeight,"preview-width":e.previewWidth,onRemove:W,onPreview:O},null,8,["file","title","description","disabled","preview-height","preview-width"])):(o.openBlock(),o.createBlock(yg,{key:1,label:e.label,hint:e.hint,accept:m.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||B.value,template:e.template,onPicked:j,error:l.value,onError:X[0]||(X[0]=oe=>c(oe))},null,8,["label","hint","accept","maxSizeMb","disabled","template","error"])),o.createVNode(Yo,{modelValue:E.value,"onUpdate:modelValue":X[2]||(X[2]=oe=>E.value=oe),title:$.value,"max-width":I.value==="application/pdf"?720:500,"content-class":I.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:o.withCtx(()=>[o.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:X[1]||(X[1]=oe=>E.value=!1)},o.toDisplayString(o.unref(P)("common.close")||"Close"),1)]),default:o.withCtx(()=>[o.createElementVNode("div",Qhe,[I.value.startsWith("image/")?(o.openBlock(),o.createElementBlock("img",{key:0,src:k.value,alt:$.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,Vhe)):I.value==="application/pdf"?(o.openBlock(),o.createElementBlock("iframe",{key:1,src:k.value,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,eme)):(o.openBlock(),o.createElementBlock("div",tme,[o.createVNode(o.unref(Ne.FileText),{class:"w-16 h-16 stroke-1"}),o.createElementVNode("span",nme,o.toDisplayString(o.unref(P)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),o.createElementVNode("a",{href:k.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},o.toDisplayString(o.unref(P)("dynamicUploadList.viewOriginal")||"View Original"),9,ime)]))])]),_:1},8,["modelValue","title","max-width","content-class"])]))}}),rme={class:"flex-1 flex flex-col min-h-[300px]"},ome={key:0,class:"flex-1 flex flex-col items-center justify-center p-10"},sme={key:1,class:"flex-1 flex flex-col items-center justify-center p-10"},ame={class:"bg-red-50 dark:bg-red-950/30 text-red-600 dark:text-red-400 p-6 rounded-lg max-w-md text-center border border-red-100 dark:border-red-900/50"},lme={class:"text-sm opacity-90"},cme={key:2,class:"flex-1 overflow-hidden flex items-center justify-center relative bg-neutral-50/30 dark:bg-neutral-950/20"},dme={class:"w-full h-full p-6 overflow-auto flex items-center justify-center"},ume=["src"],fme=["innerHTML"],hme={key:2,class:"whitespace-pre-wrap font-mono text-xs p-4 rounded bg-neutral-50 dark:bg-neutral-800 border border-neutral-200 dark:border-neutral-700 max-w-full overflow-auto text-neutral-700 dark:text-neutral-300"},mme={key:3,class:"text-neutral-400 dark:text-neutral-600 text-sm italic"},j0=Mn(o.defineComponent({name:"DCodeWorkflowDiagram",__name:"DCodeWorkflowDiagram",props:{auditId:{},fetcher:{},apiModule:{},apiAction:{},apiUrl:{},apiMethod:{default:"POST"},apiParams:{default:()=>({})},height:{default:"auto"},baseUrl:{default:void 0},withAuth:{type:Boolean,default:!1},endpoint:{},dummyMode:{type:Boolean,default:!1}},setup(e){const t=e,{t:n}=Yn.useI18n(),{apiUrl:i}=o.inject("externalApi")||{},r=o.ref(!1),s=o.ref(""),a=o.ref(""),l=o.ref(!1),c=o.ref(""),d=o.computed(()=>a.value.trim().toLowerCase().startsWith("<svg")),f=()=>{c.value&&c.value.startsWith("blob:")&&URL.revokeObjectURL(c.value),c.value=""};o.onUnmounted(()=>{f()});const h=async()=>{var A;if(t.dummyMode){r.value=!1,s.value="",a.value="",l.value=!0,f(),c.value="https://placehold.co/800x400/f9fafb/6b7280?text=Workflow+Diagram+Preview";return}const m=t.endpoint||{},g=m.apiUrl||t.apiUrl,v=(m.apiMethod||t.apiMethod||"GET").toUpperCase(),y=t.apiModule&&t.apiAction||g;if(!t.fetcher&&!y){s.value="Fetcher or API configuration is required";return}r.value=!0,s.value="",a.value="",l.value=!1,f();try{let C;if(t.fetcher)C=await t.fetcher({auditId:t.auditId});else{let B="";if(g)if(g.startsWith("http"))B=g;else if(t.baseUrl){const W=t.baseUrl.replace(/\/$/,""),P=g.startsWith("/")?g:`/${g}`;B=`${W}${P}`}else B=g;else if(t.apiModule&&t.apiAction){const W=`/${t.apiModule}/${t.apiAction}`;t.baseUrl?B=`${t.baseUrl.replace(/\/$/,"")}${W}`:B=W}const N={...t.apiParams};t.auditId&&!N.id&&(N.id=t.auditId),t.auditId&&!N.auditId&&(N.auditId=t.auditId);const j=await i(B,v,N,{withCredentials:!0,responseType:"blob",headers:{Accept:"image/png"}});if(j instanceof Blob)C=j;else if((j==null?void 0:j.data)instanceof Blob)C=j.data;else if((j==null?void 0:j.data)!==void 0){const W=j.data,P=((A=j==null?void 0:j.headers)==null?void 0:A["content-type"])||"application/octet-stream";C=new Blob([W],{type:P})}else C=new Blob([j],{type:"application/octet-stream"})}if(C.size===0)throw new Error("Diagram received but empty (0 bytes).");const M=C.type||"";if(M.startsWith("image/svg")||M.includes("svg")){const B=await C.text();a.value=B}else M.startsWith("text/")?a.value=await C.text():(l.value=!0,c.value=URL.createObjectURL(C))}catch(C){console.error("[DCodeWorkflowDiagram] Error loading diagram:",C),s.value=C.message||"Failed to load diagram"}finally{r.value=!1}};return o.watch(()=>t.auditId,()=>{h()}),o.onMounted(()=>{h()}),(m,g)=>(o.openBlock(),o.createElementBlock("div",{class:"dcode-workflow-diagram flex flex-col bg-white dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 rounded-xl overflow-hidden shadow-sm",style:o.normalizeStyle({height:e.height})},[o.createElementVNode("div",rme,[r.value?(o.openBlock(),o.createElementBlock("div",ome,[o.createVNode(o.unref(Ne.Loader2),{class:"h-10 w-10 text-primary animate-spin mb-4"}),g[0]||(g[0]=o.createElementVNode("span",{class:"text-sm text-neutral-500 dark:text-neutral-400"},"Loading diagram...",-1))])):s.value?(o.openBlock(),o.createElementBlock("div",sme,[o.createElementVNode("div",ame,[o.createVNode(o.unref(Ne.AlertTriangle),{class:"h-10 w-10 mx-auto mb-3 opacity-80"}),g[2]||(g[2]=o.createElementVNode("h4",{class:"text-base font-bold mb-2"},"Error",-1)),o.createElementVNode("p",lme,o.toDisplayString(s.value),1),o.createVNode(Vt,{variant:"outline",size:"sm",class:"mt-4 mx-auto border-red-200 dark:border-red-800 hover:bg-red-100 dark:hover:bg-red-900/50",onClick:h},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.RefreshCw),{class:"h-3.5 w-3.5 mr-2"}),g[1]||(g[1]=o.createTextVNode(" Try Again ",-1))]),_:1})])])):(o.openBlock(),o.createElementBlock("div",cme,[o.createElementVNode("div",dme,[l.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:c.value,alt:"Workflow Diagram",class:"max-w-full h-auto object-contain shadow-sm rounded border border-neutral-200 dark:border-neutral-800"},null,8,ume)):d.value?(o.openBlock(),o.createElementBlock("div",{key:1,innerHTML:a.value,class:"svg-viewer w-full h-full flex items-center justify-center"},null,8,fme)):a.value?(o.openBlock(),o.createElementBlock("div",hme,o.toDisplayString(a.value),1)):(o.openBlock(),o.createElementBlock("div",mme," No diagram data available "))])]))])],4))}}),[["__scopeId","data-v-5867ea89"]]),pme={key:0,class:"inline-block"},au=Mn(o.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(e){const t=e,n=o.computed(()=>Es(t.icon,tn)),i=o.computed(()=>t.visible??!0),r=o.computed(()=>{const h={xs:"px-1.5 py-0.5 text-[10px] gap-1",sm:"px-2.5 py-0.5 text-xs gap-1.5",md:"px-3 py-1 text-sm gap-2",lg:"px-4 py-1.5 text-base gap-2.5"};return h[t.size]||h.sm}),s=o.computed(()=>{const h={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};return h[t.size]||h.sm}),a=o.computed(()=>{const h={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return h[t.size]||h.sm}),l=o.computed(()=>{var g;const h={default:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",DEFAULT:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",SECONDARY:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",DESTRUCTIVE:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",success:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",SUCCESS:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",warning:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",WARNING:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",info:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",INFO:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",danger:"bg-red-500 text-white border-transparent shadow-sm hover:bg-red-600",DANGER:"bg-red-500 text-white border-transparent shadow-sm hover:bg-red-600",outline:"bg-transparent border-border text-foreground",OUTLINE:"bg-transparent border-border text-foreground",tonal:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",TONAL:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",ghost:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",GHOST:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",purple:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",PURPLE:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",pink:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",PINK:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",dark:"bg-gray-900 text-white border-transparent shadow-sm hover:bg-gray-950",light:"bg-gray-100 text-gray-900 border-gray-200 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700",link:"bg-transparent text-blue-600 border-transparent hover:underline hover:text-blue-700",LINK:"bg-transparent text-blue-600 border-transparent hover:underline hover:text-blue-700",elevated:"bg-white text-gray-900 border-gray-200 shadow-md hover:shadow-lg dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700",ELEVATED:"bg-white text-gray-900 border-gray-200 shadow-md hover:shadow-lg dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700"};let m=h[t.variant]||h.default;if(t.color){const v=t.color.toLowerCase().replace(/_/g,"-"),y=((g=t.variant)==null?void 0:g.toLowerCase())||"default",C={primary:{bg:"bg-primary",text:"text-primary-foreground",border:"border-transparent",hover:"hover:bg-primary/80"},success:{bg:"bg-success-500",text:"text-white",border:"border-transparent",hover:"hover:bg-success-600"},warning:{bg:"bg-warning-500",text:"text-white",border:"border-transparent",hover:"hover:bg-warning-600"},danger:{bg:"bg-red-500",text:"text-white",border:"border-transparent",hover:"hover:bg-red-600"},info:{bg:"bg-blue-500",text:"text-white",border:"border-transparent",hover:"hover:bg-blue-600"},purple:{bg:"bg-purple-600",text:"text-white",border:"border-transparent",hover:"hover:bg-purple-700"},pink:{bg:"bg-pink-600",text:"text-white",border:"border-transparent",hover:"hover:bg-pink-700"},"gradient-blue":{bg:"bg-gradient-to-r from-blue-500 to-cyan-500",text:"text-white",border:"border-transparent",hover:"hover:from-blue-600 hover:to-cyan-600"},"gradient-purple":{bg:"bg-gradient-to-r from-purple-500 to-pink-500",text:"text-white",border:"border-transparent",hover:"hover:from-purple-600 hover:to-pink-600"},"gradient-sunset":{bg:"bg-gradient-to-r from-orange-500 to-red-500",text:"text-white",border:"border-transparent",hover:"hover:from-orange-600 hover:to-red-600"},"gradient-emerald":{bg:"bg-gradient-to-r from-emerald-500 to-teal-500",text:"text-white",border:"border-transparent",hover:"hover:from-emerald-600 hover:to-teal-600"}}[v];if(C)switch(y){case"outline":return`${C.border} ${C.text} ${C.hover.replace("hover:bg-","hover:bg-").replace("500","50").replace("600","50")}`;case"tonal":return`${C.bg}/10 ${C.text} ${C.border} ${C.hover.replace("hover:bg-","hover:bg-").replace("500","20").replace("600","20")}`;case"ghost":return`bg-transparent ${C.text} border-transparent hover:bg-accent hover:text-accent-foreground`;case"link":return`bg-transparent ${C.text} border-transparent hover:underline hover:${C.text.replace("text-","text-").replace("-600","-700").replace("-500","-600")}`;case"elevated":return`bg-white ${C.text} border-gray-200 shadow-md hover:shadow-lg dark:bg-gray-800 dark:border-gray-700`;default:return`${C.bg} ${C.text} ${C.border} shadow-sm ${C.hover}`}}return m}),c=o.computed(()=>{const h={default:"bg-primary-foreground",DEFAULT:"bg-primary-foreground",secondary:"bg-secondary-foreground",SECONDARY:"bg-secondary-foreground",destructive:"bg-destructive-foreground",DESTRUCTIVE:"bg-destructive-foreground",success:"bg-white",SUCCESS:"bg-white",warning:"bg-white",WARNING:"bg-white",info:"bg-white",INFO:"bg-white",danger:"bg-white",DANGER:"bg-white",outline:"bg-primary",OUTLINE:"bg-primary",tonal:"bg-primary",TONAL:"bg-primary",ghost:"bg-muted-foreground",GHOST:"bg-muted-foreground",purple:"bg-white",PURPLE:"bg-white",pink:"bg-white",PINK:"bg-white",dark:"bg-white",light:"bg-gray-900",link:"bg-blue-600",LINK:"bg-blue-600",elevated:"bg-gray-900",ELEVATED:"bg-gray-900"};if(t.color){const m=t.color.toLowerCase().replace(/_/g,"-"),g={primary:"bg-primary-foreground",success:"bg-white",warning:"bg-white",danger:"bg-white",info:"bg-white",purple:"bg-white",pink:"bg-white","gradient-blue":"bg-white","gradient-purple":"bg-white","gradient-sunset":"bg-white","gradient-emerald":"bg-white"};if(g[m])return g[m]}return h[t.variant]||"bg-current"}),d=o.computed(()=>{const h={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return nn(h[t.size]||h.sm,"rounded animate-pulse bg-muted")}),f=o.computed(()=>nn("inline-flex items-center font-semibold border transition-all duration-300 select-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 max-w-full whitespace-normal break-words text-left",t.pill?"rounded-full":"rounded-md",r.value,l.value,t.class));return(h,m)=>i.value?(o.openBlock(),o.createElementBlock("div",pme,[e.skeleton?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(d.value)},null,2)):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(f.value)},[e.dot?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["rounded-full animate-pulse flex-shrink-0",s.value,c.value])},null,2)):o.createCommentVNode("",!0),n.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.value),{key:1,class:o.normalizeClass(["flex-shrink-0",a.value]),"stroke-width":"2.5"},null,8,["class"])):o.createCommentVNode("",!0),o.renderSlot(h.$slots,"default",{},()=>[o.createElementVNode("span",null,o.toDisplayString(e.text),1)],!0)],2))])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-4aca395e"]]),gme=o.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createBlock(o.unref(kt.AvatarRoot),{class:o.normalizeClass(o.unref(nn)(o.unref(vme)({size:e.size,shape:e.shape}),t.class))},{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},8,["class"]))}}),yme=o.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createBlock(o.unref(kt.AvatarFallback),o.normalizeProps(o.guardReactiveProps(t)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),bme=o.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createBlock(o.unref(kt.AvatarImage),o.mergeProps(t,{class:"h-full w-full object-cover"}),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),vme=Vm("inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden",{variants:{size:{sm:"h-10 w-10 text-xs",base:"h-16 w-16 text-2xl",lg:"h-32 w-32 text-5xl"},shape:{circle:"rounded-full",square:"rounded-md"}}}),wme={class:"bg-card text-card-foreground"},_me={class:"flex flex-col space-y-1.5 py-6 px-4"},kme={class:"leading-none tracking-tight text-lg font-bold"},xme={class:"pb-10 px-4"},Eme={key:0,class:"flex flex-col items-center justify-center py-20 gap-3"},Cme={key:1,class:"bg-destructive/10 border border-destructive/20 p-8 rounded-2xl text-center space-y-3"},Sme={class:"text-sm font-bold text-destructive"},Ame={class:"timeline-phases-wrapper"},Tme={key:0,class:"timeline-phase-header"},Pme={class:"flex flex-col sm:flex-row sm:items-center gap-4 md:bg-white dark:md:bg-neutral-900 md:px-6 md:py-2 md:rounded-full md:shadow-sm md:border md:border-neutral-200 dark:md:border-neutral-800"},Bme={class:"inline-flex items-center gap-2 px-3 py-1.5 rounded-full bg-neutral-50 dark:bg-neutral-900 border border-neutral-200 dark:border-neutral-800 text-[10px] font-black uppercase tracking-widest text-neutral-500 shadow-sm"},Nme={key:0,class:"opacity-40"},Dme={key:0,class:"flex items-center gap-3 text-[10px] font-bold text-neutral-400 uppercase tracking-tight"},Mme={key:0,class:"flex items-center gap-1.5"},Rme={key:1,class:"bg-primary/5 text-primary px-2 py-0.5 rounded border border-primary/10"},Ime={key:1,class:"timeline-details-wrapper"},Ome={class:"timeline-card-wrapper"},Lme={class:"timeline-card-content"},Fme={class:"p-4 sm:p-5"},$me={class:"text-base font-extrabold text-neutral-900 dark:text-neutral-100 group-hover:text-primary transition-colors"},zme={class:"text-[11px] font-medium text-neutral-400 font-mono tracking-tighter"},jme={class:"text-[10px] font-black uppercase text-neutral-400 tracking-widest"},Ume={class:"leading-tight"},Wme={class:"text-xs font-black text-neutral-800 dark:text-neutral-200 uppercase tracking-tight"},Hme={class:"text-[10px] font-bold text-neutral-400"},qme={key:3,class:"flex flex-col items-center justify-center py-24 text-center"},Kme={class:"p-6 rounded-full bg-neutral-50 dark:bg-neutral-900 shadow-inner mb-4 border border-dashed border-neutral-200 dark:border-neutral-800"},U0=Mn(o.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiModule:{},apiAction:{},apiMethod:{default:"GET"},apiParams:{},endpoint:{},title:{default:"Timeline With Icons"},dummyMode:{type:Boolean,default:!1},orientation:{default:"VERTICAL"}},setup(e){const t=e,{DCodeApi:n}=o.inject("externalApi")||{},i=o.ref(!1),r=o.ref(null),s=o.ref([]),a=o.computed(()=>{if(s.value.length>0)return s.value;if(t.items){if(Array.isArray(t.items))return t.items;const y=t.items;if(y.data&&Array.isArray(y.data))return y.data;if(y.payload&&Array.isArray(y.payload))return y.payload}return[]}),l=async()=>{var B,N,j,W,P,E;if(t.dummyMode){s.value=[{name:"Phase 1: Initialization",noRef:"P-001",startTime:new Date().toISOString(),endTime:new Date().toISOString(),duration:3600,detail:[{id:1,noRef:"DET-001",name:"Initial Check",startTime:new Date().toISOString(),endTime:new Date().toISOString(),duration:600,status:"Completed",color:"success",desc:"System health check performed successfully."}]}];return}const y=t.apiUrl||((B=t.endpoint)==null?void 0:B.apiUrl),A=t.apiModule||((N=t.endpoint)==null?void 0:N.apiModule),C=t.apiAction||((j=t.endpoint)==null?void 0:j.apiAction),M=t.apiMethod||((W=t.endpoint)==null?void 0:W.apiMethod)||"GET";if(!(!y&&!A)){i.value=!0,r.value=null;try{let k;A&&C?k=await n(A,C,t.apiParams):y&&(k=await n(y,M,t.apiParams));let $=[];k&&(Array.isArray(k.data)?$=k.data:Array.isArray(k.payload)?$=k.payload:Array.isArray(k)?$=k:(P=k.data)!=null&&P.items&&Array.isArray(k.data.items)?$=k.data.items:(E=k.payload)!=null&&E.items&&Array.isArray(k.payload.items)?$=k.payload.items:Array.isArray(k.items)&&($=k.items)),$.length>0?s.value=$:s.value=[]}catch(k){console.error("Failed to fetch timeline items:",k),r.value=k.message||"Failed to fetch data"}finally{i.value=!1}}};o.onMounted(()=>{var C,M;const y=t.apiUrl||((C=t.endpoint)==null?void 0:C.apiUrl),A=t.apiModule||((M=t.endpoint)==null?void 0:M.apiModule);(y||A)&&l()}),o.watch([()=>t.apiUrl,()=>t.apiModule,()=>t.apiAction,()=>t.apiParams,()=>t.endpoint],()=>{var C,M;const y=t.apiUrl||((C=t.endpoint)==null?void 0:C.apiUrl),A=t.apiModule||((M=t.endpoint)==null?void 0:M.apiModule);y||A?l():s.value=[]},{deep:!0});const c=y=>{if(!y)return"-";try{return qo(nS(y),"MMMM dd, yyyy HH:mm")}catch{return y}},d=y=>{if(!y)return"-";try{return qo(nS(y),"HH:mm")}catch{return y}},f=y=>{if(!y&&y!==0)return"-";if(y<60)return`${y}s`;const A=Math.floor(y/60),C=y%60;if(A<60)return`${A}m ${C}s`;const M=Math.floor(A/60),B=A%60;return`${M}h ${B}m`},h=(y,A=Ne.Circle)=>y&&Es(y,tn)||A,m=y=>{const A={primary:"bg-blue-500/10 text-blue-600 border-blue-200 dark:border-blue-900/30",success:"bg-emerald-500/10 text-emerald-600 border-emerald-200 dark:border-emerald-900/30",emerald:"bg-emerald-500/10 text-emerald-600 border-emerald-200 dark:border-emerald-900/30",warning:"bg-amber-500/10 text-amber-600 border-amber-200 dark:border-amber-900/30",amber:"bg-amber-500/10 text-amber-600 border-amber-200 dark:border-amber-900/30",danger:"bg-rose-500/10 text-rose-600 border-rose-200 dark:border-rose-900/30",rose:"bg-rose-500/10 text-rose-600 border-rose-200 dark:border-rose-900/30",info:"bg-sky-500/10 text-sky-600 border-sky-200 dark:border-sky-900/30",sky:"bg-sky-500/10 text-sky-600 border-sky-200 dark:border-sky-900/30",secondary:"bg-slate-500/10 text-slate-600 border-slate-200 dark:border-slate-800/30"};return A[y||"primary"]||A.primary},g=y=>({primary:"default",success:"success",emerald:"success",warning:"warning",amber:"warning",danger:"destructive",rose:"destructive",info:"info",sky:"info",secondary:"secondary"})[y||"secondary"]||"secondary",v=y=>(y==null?void 0:y.split(" ").filter(Boolean).slice(0,2).map(A=>{var C;return(C=A[0])==null?void 0:C.toUpperCase()}).join(""))||"??";return(y,A)=>(o.openBlock(),o.createElementBlock("div",wme,[o.createElementVNode("div",_me,[o.createElementVNode("h3",kme,o.toDisplayString(e.title),1)]),o.createElementVNode("div",xme,[i.value?(o.openBlock(),o.createElementBlock("div",Eme,[o.createVNode(o.unref(Ne.Loader2),{class:"w-8 h-8 text-primary animate-spin"}),A[0]||(A[0]=o.createElementVNode("p",{class:"text-xs font-bold uppercase tracking-widest text-muted-foreground animate-pulse"},"Syncing CBAS Data...",-1))])):r.value?(o.openBlock(),o.createElementBlock("div",Cme,[o.createVNode(o.unref(Ne.AlertCircle),{class:"w-8 h-8 text-destructive mx-auto"}),o.createElementVNode("p",Sme,o.toDisplayString(r.value),1),o.createElementVNode("button",{onClick:l,class:"text-xs font-black uppercase underline tracking-wider opacity-60 hover:opacity-100"},"Retry Synchronization")])):a.value.length>0?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["timeline-container",`is-${e.orientation}`])},[A[2]||(A[2]=o.createElementVNode("div",{class:"timeline-main-line bg-neutral-200 dark:bg-neutral-800"},null,-1)),o.createElementVNode("div",Ame,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(C,M)=>(o.openBlock(),o.createElementBlock("div",{key:M,class:"timeline-phase-group"},[C&&C.name?(o.openBlock(),o.createElementBlock("div",Tme,[o.createElementVNode("div",Pme,[o.createElementVNode("div",Bme,[o.createTextVNode(" Phase: "+o.toDisplayString(C.name)+" ",1),C.noRef?(o.openBlock(),o.createElementBlock("span",Nme,"#"+o.toDisplayString(C.noRef),1)):o.createCommentVNode("",!0)]),C.duration||C.startTime?(o.openBlock(),o.createElementBlock("div",Dme,[C.startTime?(o.openBlock(),o.createElementBlock("div",Mme,[o.createVNode(o.unref(Ne.Clock),{class:"w-3 h-3"}),o.createTextVNode(" "+o.toDisplayString(d(C.startTime))+" - "+o.toDisplayString(d(C.endTime)),1)])):o.createCommentVNode("",!0),C.duration?(o.openBlock(),o.createElementBlock("div",Rme," Total: "+o.toDisplayString(f(C.duration)),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),C&&C.detail&&C.detail.length>0?(o.openBlock(),o.createElementBlock("div",Ime,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.detail,(B,N)=>(o.openBlock(),o.createElementBlock("div",{key:B.id||N,class:o.normalizeClass(["timeline-item-container",[N%2===0?"is-even":"is-odd"]])},[A[1]||(A[1]=o.createElementVNode("div",{class:"timeline-inner-line"},null,-1)),o.createElementVNode("div",{class:o.normalizeClass(["timeline-node-icon",m(B.color)])},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h(B.icon)),{class:"h-4 w-4"}))],2),o.createElementVNode("div",Ome,[o.createElementVNode("div",Lme,[o.createElementVNode("div",Fme,[o.createElementVNode("div",{class:o.normalizeClass(["flex flex-col sm:flex-row sm:items-start justify-between gap-4",e.orientation==="VERTICAL"&&N%2===0?"md:flex-row-reverse md:text-right":""])},[o.createElementVNode("div",{class:o.normalizeClass(["space-y-1",e.orientation==="VERTICAL"&&N%2===0?"md:items-end":""])},[o.createElementVNode("div",{class:o.normalizeClass(["flex items-center gap-2",e.orientation==="VERTICAL"&&N%2===0?"md:justify-end":""])},[o.createElementVNode("h4",$me,o.toDisplayString(B.name),1),B.status?(o.openBlock(),o.createBlock(au,{key:0,variant:g(B.color),class:"h-4 px-1.5 text-[8px] uppercase font-black tracking-widest"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(B.status),1)]),_:2},1032,["variant"])):o.createCommentVNode("",!0)],2),o.createElementVNode("p",zme," #"+o.toDisplayString(B.noRef),1)],2),o.createElementVNode("div",{class:o.normalizeClass(["text-left sm:text-right shrink-0",e.orientation==="VERTICAL"&&N%2===0?"md:text-left":""])},[o.createElementVNode("p",jme,o.toDisplayString(c(B.startTime)),1),o.createElementVNode("p",{class:o.normalizeClass(["mt-1 text-[11px] font-bold text-primary flex items-center justify-start sm:justify-end gap-1.5",e.orientation==="VERTICAL"&&N%2===0?"md:justify-start":""])},[o.createVNode(o.unref(Ne.Clock),{class:"w-3 h-3"}),o.createTextVNode(" "+o.toDisplayString(f(B.duration)),1)],2)],2)],2),B.desc?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["mt-4 text-sm text-neutral-600 dark:text-neutral-400 leading-relaxed font-medium",e.orientation==="VERTICAL"&&N%2===0?"md:text-right":""])},o.toDisplayString(B.desc),3)):o.createCommentVNode("",!0),B.personName?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["mt-4 pt-4 border-t border-neutral-100 dark:border-neutral-800 flex items-center gap-3",e.orientation==="VERTICAL"&&N%2===0?"md:flex-row-reverse md:text-right":""])},[o.createVNode(o.unref(gme),{class:"h-9 w-9 border-2 border-background shadow-inner"},{default:o.withCtx(()=>[B.avatarUrl?(o.openBlock(),o.createBlock(o.unref(bme),{key:0,src:B.avatarUrl},null,8,["src"])):o.createCommentVNode("",!0),o.createVNode(o.unref(yme),{class:"bg-neutral-100 text-neutral-400 text-[10px] font-bold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(v(B.personName)),1)]),_:2},1024)]),_:2},1024),o.createElementVNode("div",Ume,[o.createElementVNode("p",Wme,o.toDisplayString(B.personName),1),o.createElementVNode("p",Hme,o.toDisplayString(B.personRole||"Process Specialist"),1)])],2)):o.createCommentVNode("",!0)])])])],2))),128))])):o.createCommentVNode("",!0)]))),128))])],2)):(o.openBlock(),o.createElementBlock("div",qme,[o.createElementVNode("div",Kme,[o.createVNode(o.unref(Ne.Clock),{class:"w-12 h-12 text-neutral-300 dark:text-neutral-700 stroke-[1.5]"})]),A[3]||(A[3]=o.createElementVNode("h4",{class:"text-sm font-bold text-neutral-400 uppercase tracking-widest mb-1"},"No activity detected",-1)),A[4]||(A[4]=o.createElementVNode("p",{class:"text-[10px] font-medium text-neutral-300 dark:text-neutral-600 uppercase"},"The timeline history is currently empty",-1))]))])]))}}),[["__scopeId","data-v-abaacc74"]]),Gme={key:0,class:"flex items-center justify-between px-4 py-3 border-b border-gray-100 bg-white dark:border-neutral-700/50 dark:bg-neutral-900/50 backdrop-blur-sm sticky top-0 z-10"},Yme={class:"flex items-center gap-3 overflow-hidden"},Zme={class:"flex h-8 w-8 items-center justify-center rounded-lg bg-primary/10 text-primary"},Xme={class:"text-sm font-semibold text-gray-700 dark:text-neutral-200 truncate"},Jme={class:"flex items-center gap-1.5 ml-4"},Qme={class:"relative flex-1 w-full overflow-hidden bg-gray-50 dark:bg-neutral-950/20"},Vme={key:0,class:"absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-white/90 backdrop-blur-sm dark:bg-neutral-900/90"},epe={class:"relative flex items-center justify-center"},tpe={key:1,class:"flex h-full w-full flex-col items-center justify-center gap-4 p-8 text-center"},npe={class:"rounded-2xl bg-amber-50 p-4 dark:bg-amber-900/20"},ipe={class:"max-w-md"},rpe={class:"text-lg font-bold text-gray-900 dark:text-neutral-100"},ope={class:"mt-2 text-sm leading-relaxed text-gray-500 dark:text-neutral-400"},spe={class:"flex flex-wrap justify-center gap-3 mt-2"},ape=["src"],lpe={key:1,class:"flex h-full w-full flex-col items-center justify-center gap-4 p-8 text-center bg-gray-50/50 dark:bg-neutral-900/30"},cpe={class:"rounded-2xl bg-white p-5 shadow-sm dark:bg-neutral-800"},W0=Mn(o.defineComponent({name:"DCodePdfViewer",__name:"DCodePdfViewer",props:{itemValue:{default:null},modelValue:{default:null},label:{default:"PDF Viewer"},baseUrl:{default:""},height:{default:"700px"},showDownload:{type:Boolean,default:!0},showFullscreen:{type:Boolean,default:!0}},setup(e){const t=e,{DCodeApi:n}=o.inject("externalApi")||{},i=o.computed(()=>{let P="",E="",k=!1;const $=X=>{X&&(typeof X=="string"?(X.includes("/")||X.startsWith("http")||X.startsWith("data:"))&&(P=X):typeof X=="object"&&X!==null&&(P=X.url||X.path||X.link||"",E=X.server||X.baseUrl||X.base_url||""))};if(t.itemValue&&typeof t.itemValue=="string"&&t.modelValue&&typeof t.modelValue=="object"){const X=t.itemValue.split(".");let oe=t.modelValue,ue,te=!0;for(const re of X)if(oe&&typeof oe=="object"&&re in oe)ue=oe,oe=oe[re];else{te=!1;break}te&&oe!==void 0&&oe!==null&&($(oe),k=!0,!E&&ue&&(E=ue.server||ue.baseUrl||ue.base_url||""))}if(P||(t.modelValue&&typeof t.modelValue!="object"?$(t.modelValue):!k&&t.itemValue&&$(t.itemValue)),!P||typeof P!="string"||P.trim()==="")return null;const I=typeof window<"u"?window.location.protocol:"https:",O=I==="https:";P.startsWith("//")&&(P=`${I}${P}`);const q=t.baseUrl||E;if(q&&!P.startsWith("http")&&!P.startsWith("data:")){let X=q.trim().replace(/\/$/,"");if(!X)return null;O&&X.startsWith("http:")?X=X.replace("http:","https:"):X.startsWith("//")&&(X=`${I}${X}`);const oe=P.startsWith("/")?P:`/${P}`;P=`${X}${oe}`}try{const X=new URL(P,window.location.origin);if(X.pathname==="/"||X.pathname===""||X.href===window.location.origin+"/")return null}catch{if(!P.startsWith("data:")&&!P.startsWith("blob:"))return null}return O&&P.startsWith("http:")&&(P=P.replace("http:","https:")),P}),r=o.computed(()=>typeof window>"u"?!1:window.location.protocol==="https:"&&typeof i.value=="string"&&i.value.startsWith("http:")),s=o.ref(!0),a=o.ref(!1),l=o.ref(!1),c=o.ref(null),d=o.ref(null),f=o.ref(!1);let h=null;const m=()=>{d.value&&(URL.revokeObjectURL(d.value),d.value=null)},g=async P=>{if(P){f.value=!0,s.value=!0,a.value=!1;try{if(typeof n=="function")try{const $=await n(P,"GET",{},{responseType:"blob"}),I=$ instanceof Blob?$:($==null?void 0:$.data)instanceof Blob?$.data:new Blob([($==null?void 0:$.data)||$],{type:"application/pdf"});if(I&&I.size>0){m(),d.value=URL.createObjectURL(I),f.value=!1,s.value=!1;return}}catch($){console.warn("DCodePdfViewer: DCodeApi fetch failed, trying native fetch",$)}const E=await fetch(P);if(!E.ok)throw new Error(`HTTP error! status: ${E.status}`);const k=await E.blob();m(),d.value=URL.createObjectURL(k)}catch(E){console.error("DCodePdfViewer: Blob fetch failed, falling back to direct URL",E),a.value=!0}finally{f.value=!1,s.value=!1}}},v=o.computed(()=>{const P=t.height;return{height:l.value?"100vh":typeof P=="number"?`${P}px`:P,minHeight:l.value?"100vh":"500px"}}),y=()=>{h&&(clearTimeout(h),h=null)},A=()=>{if(y(),r.value&&!d.value&&!f.value){g(i.value);return}h=setTimeout(()=>{s.value&&(s.value=!1,a.value=!0)},1e4)},C=()=>{y(),s.value=!1,a.value=!1},M=()=>{y(),s.value=!1,a.value=!0},B=()=>{c.value&&(document.fullscreenElement?(document.exitFullscreen(),l.value=!1):(c.value.requestFullscreen().catch(P=>{console.error(`Error attempting to enable full-screen mode: ${P.message}`)}),l.value=!0))},N=()=>{l.value=!!document.fullscreenElement};o.onMounted(()=>{document.addEventListener("fullscreenchange",N),i.value&&A()}),o.onBeforeUnmount(()=>{document.removeEventListener("fullscreenchange",N),y(),m()}),o.watch(()=>i.value,P=>{m(),P&&(s.value=!0,a.value=!1,r.value?g(P):A())},{immediate:!0});const j=()=>{i.value&&window.open(i.value,"_blank")},W=()=>{if(!i.value)return;const P=document.createElement("a");P.href=i.value,P.download=t.label||"document.pdf",P.target="_blank",document.body.appendChild(P),P.click(),document.body.removeChild(P)};return(P,E)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"containerRef",ref:c,class:o.normalizeClass(["d-pdf-viewer-container relative w-full overflow-hidden flex flex-col rounded-xl border border-gray-200 bg-white dark:border-neutral-700/50 dark:bg-neutral-900",{"fixed inset-0 z-[9999] rounded-none !h-screen":l.value}]),style:o.normalizeStyle(v.value)},[i.value?(o.openBlock(),o.createElementBlock("div",Gme,[o.createElementVNode("div",Yme,[o.createElementVNode("div",Zme,[o.createVNode(o.unref(Ne.FileText),{class:"h-4 w-4"})]),o.createElementVNode("span",Xme,o.toDisplayString(e.label),1)]),o.createElementVNode("div",Jme,[o.createElementVNode("button",{type:"button",onClick:j,class:"flex h-8 w-8 items-center justify-center rounded-lg text-gray-500 transition-all hover:bg-gray-100 hover:text-primary dark:text-neutral-400 dark:hover:bg-neutral-800",title:"Buka di Tab Baru"},[o.createVNode(o.unref(Ne.ExternalLink),{class:"h-4 w-4"})]),e.showDownload?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",onClick:W,class:"flex h-8 w-8 items-center justify-center rounded-lg text-gray-500 transition-all hover:bg-gray-100 hover:text-primary dark:text-neutral-400 dark:hover:bg-neutral-800",title:"Unduh PDF"},[o.createVNode(o.unref(Ne.Download),{class:"h-4 w-4"})])):o.createCommentVNode("",!0),e.showFullscreen?(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",onClick:B,class:"flex h-8 w-8 items-center justify-center rounded-lg text-gray-500 transition-all hover:bg-gray-100 hover:text-primary dark:text-neutral-400 dark:hover:bg-neutral-800",title:"Layar Penuh"},[l.value?(o.openBlock(),o.createBlock(o.unref(Ne.Minimize2),{key:0,class:"h-4 w-4"})):(o.openBlock(),o.createBlock(o.unref(Ne.Maximize2),{key:1,class:"h-4 w-4"}))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),o.createElementVNode("div",Qme,[i.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",Vme,[o.createElementVNode("div",epe,[E[0]||(E[0]=o.createElementVNode("div",{class:"h-12 w-12 rounded-full border-4 border-primary/20 border-t-primary animate-spin"},null,-1)),o.createVNode(o.unref(Ne.Loader2),{class:"absolute h-5 w-5 animate-pulse text-primary"})]),E[1]||(E[1]=o.createElementVNode("p",{class:"text-sm font-medium text-gray-600 dark:text-neutral-300"},"Menyiapkan dokumen...",-1))])):o.createCommentVNode("",!0),(a.value||r.value)&&!d.value&&!f.value?(o.openBlock(),o.createElementBlock("div",tpe,[o.createElementVNode("div",npe,[o.createVNode(o.unref(Ne.FileWarning),{class:"h-10 w-10 text-amber-500 dark:text-amber-400"})]),o.createElementVNode("div",ipe,[o.createElementVNode("h3",rpe,o.toDisplayString(r.value?"Keamanan Browser Memblokir":"Gagal Memuat PDF"),1),o.createElementVNode("p",ope,[r.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createTextVNode(" Dokumen ini berasal dari sumber yang tidak aman (HTTP) dan diblokir oleh browser (HTTPS). Silakan buka di tab baru atau unduh file untuk melihatnya. ")],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createTextVNode(" Kami tidak dapat menampilkan dokumen secara langsung. Ini bisa terjadi karena file tidak ditemukan, masalah jaringan, atau batasan akses dari server. ")],64))])]),o.createElementVNode("div",spe,[o.createElementVNode("button",{onClick:j,class:"flex items-center gap-2 rounded-xl bg-primary px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition-all hover:bg-primary/90 hover:shadow-md"},[o.createVNode(o.unref(Ne.ExternalLink),{class:"h-4 w-4"}),E[2]||(E[2]=o.createTextVNode(" Buka di Tab Baru ",-1))]),e.showDownload?(o.openBlock(),o.createElementBlock("button",{key:0,onClick:W,class:"flex items-center gap-2 rounded-xl border border-gray-200 bg-white px-5 py-2.5 text-sm font-semibold text-gray-700 shadow-sm transition-all hover:bg-gray-50 dark:border-neutral-700 dark:bg-neutral-800 dark:text-neutral-200 dark:hover:bg-neutral-700"},[o.createVNode(o.unref(Ne.Download),{class:"h-4 w-4"}),E[3]||(E[3]=o.createTextVNode(" Unduh Dokumen ",-1))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),!r.value||d.value?o.withDirectives((o.openBlock(),o.createElementBlock("iframe",{key:2,src:`${d.value||i.value}#toolbar=0&navpanes=0&scrollbar=1`,class:"h-full w-full border-none bg-gray-50 dark:bg-neutral-900",onLoad:C,onError:M},null,40,ape)),[[o.vShow,!a.value&&!s.value]]):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock("div",lpe,[o.createElementVNode("div",cpe,[o.createVNode(o.unref(Ne.FileWarning),{class:"h-10 w-10 text-gray-300 dark:text-neutral-600"})]),E[4]||(E[4]=o.createElementVNode("div",null,[o.createElementVNode("p",{class:"text-lg font-bold text-gray-700 dark:text-neutral-200"},"Belum ada file PDF"),o.createElementVNode("p",{class:"mt-1 text-sm text-gray-500 dark:text-neutral-400 max-w-xs leading-relaxed"}," Silakan unggah dokumen terlebih dahulu atau periksa ketersediaan file pada sistem. ")],-1))]))])],6))}}),[["__scopeId","data-v-49ec8019"]]),dpe={key:0,class:"robot-list-wrapper"},upe={class:"flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-4 mb-4 px-1"},fpe={class:"relative w-full sm:w-72"},hpe={class:"flex items-center gap-2 self-end sm:self-auto"},mpe=["onClick"],ppe={class:"text-[9px] opacity-60"},gpe=["disabled"],ype={class:"overflow-hidden rounded-2xl border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 shadow-sm"},bpe={class:"w-full text-left border-collapse"},vpe={class:"divide-y divide-neutral-100 dark:divide-neutral-800"},wpe={class:"px-6 py-4"},_pe={class:"flex items-center gap-4"},kpe={class:"w-10 h-10 rounded-xl bg-primary-50 dark:bg-primary-500/10 flex items-center justify-center border border-primary-100 dark:border-primary-500/20"},xpe={class:"text-sm font-black text-neutral-900 dark:text-neutral-100"},Epe={class:"text-[10px] font-bold text-neutral-400 uppercase tracking-wider"},Cpe={class:"px-6 py-4"},Spe={class:"space-y-1"},Ape={class:"flex items-center gap-2"},Tpe={class:"text-xs font-bold text-neutral-700 dark:text-neutral-300"},Ppe={class:"flex items-center gap-2"},Bpe={class:"text-[10px] font-medium text-neutral-500"},Npe={class:"px-6 py-4"},Dpe={class:"space-y-1"},Mpe={class:"flex items-center gap-2"},Rpe={class:"text-xs font-bold text-neutral-700 dark:text-neutral-300"},Ipe={class:"flex items-center gap-2"},Ope={class:"text-[10px] font-medium text-neutral-500"},Lpe={class:"px-6 py-4 text-center"},Fpe={class:"px-6 py-4 text-center"},$pe={class:"px-6 py-4 text-right"},zpe={class:"text-[10px] font-black text-neutral-900 dark:text-neutral-100 mb-0.5"},jpe={class:"text-[9px] font-bold text-neutral-400"},Upe={key:0,class:"flex items-center justify-between px-6 py-4 border-t border-neutral-100 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-800/30 text-xs font-bold text-neutral-500"},Wpe={class:"flex items-center gap-2"},Hpe=["disabled"],qpe=["disabled"],Kpe={key:1,class:"flex flex-col items-center justify-center py-16"},Gpe={key:2,class:"flex items-center justify-center py-16"},lu=2,H0=Mn(o.defineComponent({name:"DCodeRobotList",__name:"DCodeRobotList",props:{title:{default:"Robot Monitoring"},modelValue:{default:()=>[]},visible:{type:Boolean,default:!0},dummyMode:{type:Boolean,default:!1},endpoint:{default:()=>({})},socketEndpoint:{},socketParams:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r=[{id:1,code:"SUPERVISOR",name:"ROBOT SUPERVISOR",url:"https://robot-supervisor.example.com",urlStream:"https://robot-supervisor-stream.example.com",operator:{id:1,name:"Alex",code:"alex@example.com"},supervisor:{id:2,name:"Sarah",code:"sarah@example.com"},robotRole:{id:252,code:"APPV",name:"ROBOT ROLE APPROVER"},channel:{id:248,code:"WP",name:"WEB PORTAL"},status:{id:15,code:"AKT",name:"AKTIF"},healthStatus:"UP",statusProcessing:"IDLE",idle:!0,connected:!0,lastUpdate:"2026-05-12 11:07:41"},{id:2,code:"OPERATOR",name:"ROBOT OPERATOR",url:"https://robot-operator.example.com",urlStream:"https://robot-operator-stream.example.com",operator:{id:1,name:"Alex",code:"alex@example.com"},supervisor:{id:2,name:"Sarah",code:"sarah@example.com"},robotRole:{id:251,code:"REQ",name:"ROBOT ROLE REQUESTOR"},channel:{id:248,code:"WP",name:"WEB PORTAL"},status:{id:15,code:"AKT",name:"AKTIF"},healthStatus:"UP",statusProcessing:"IDLE",idle:!0,connected:!0,lastUpdate:"2026-05-12 11:07:45"}],s=o.ref(n.dummyMode?r:n.modelValue||[]),a=o.ref(!1),l=o.ref(""),c=o.inject("externalApi")||{},{DCodeApi:d}=c,f=c.socket||c.managedSocket,h=f==null?void 0:f.on,m=f==null?void 0:f.off,g=(f==null?void 0:f.send)||(f==null?void 0:f.emit),v=(f==null?void 0:f.connect)||(f==null?void 0:f.init),y=o.computed(()=>{var O;return f?typeof f.isConnected=="function"?f.isConnected():typeof f.isConnected=="boolean"?f.isConnected:((O=f.isConnected)==null?void 0:O.value)!==void 0?f.isConnected.value:!0:!1}),A=o.computed(()=>{var O;return((O=n.endpoint)==null?void 0:O.socket)||n.socketEndpoint}),C=o.computed(()=>n.socketParams||{}),M=O=>{if(!O)return;const q=(O==null?void 0:O.data)??(O==null?void 0:O.result)??O,X=(q==null?void 0:q.data)??(q==null?void 0:q.items)??(q==null?void 0:q.list)??(q==null?void 0:q.rows)??q;Array.isArray(X)?(s.value=X,i("update:modelValue",s.value)):typeof X=="object"&&X!==null?(s.value=[X],i("update:modelValue",s.value)):B()};o.watch(()=>A.value,(O,q)=>{!h||!m||n.dummyMode||(q&&m(q,M),O&&(v&&v(),h(O,M),y.value&&g&&g(O,C.value)))},{immediate:!0}),o.watch(()=>y.value,O=>{O&&A.value&&g&&!n.dummyMode&&g(A.value,C.value)}),o.onUnmounted(()=>{m&&A.value&&m(A.value,M)});const B=async()=>{var O;if(n.dummyMode){s.value=r,i("update:modelValue",s.value);return}if(!(!((O=n.endpoint)!=null&&O.apiUrl)||typeof d!="function")){a.value=!0;try{const q=await d("","",{},{_url:n.endpoint.apiUrl,_method:n.endpoint.apiMethod||"GET"}),X=(q==null?void 0:q.data)??q,oe=(X==null?void 0:X.data)??X;s.value=Array.isArray(oe)?oe:[oe],i("update:modelValue",s.value)}catch(q){console.error("[DCodeRobotList] Fetch data failed:",q)}finally{a.value=!1}}},N=o.ref("ALL"),j=O=>O==="ALL"?s.value.length:s.value.filter(q=>(q.healthStatus||"").toUpperCase()===O).length,W=o.computed(()=>{let O=s.value;if(N.value!=="ALL"&&(O=O.filter(X=>(X.healthStatus||"").toUpperCase()===N.value)),!l.value)return O;const q=l.value.toLowerCase();return O.filter(X=>{var oe,ue,te,re,ge,ce;return((oe=X.code||X.robotCode)==null?void 0:oe.toLowerCase().includes(q))||((ue=X.name)==null?void 0:ue.toLowerCase().includes(q))||((te=X.healthStatus)==null?void 0:te.toLowerCase().includes(q))||((re=X.statusProcessing)==null?void 0:re.toLowerCase().includes(q))||((ce=(ge=X.operator)==null?void 0:ge.name)==null?void 0:ce.toLowerCase().includes(q))})}),P=o.ref(1),E=o.computed(()=>Math.ceil(W.value.length/lu)),k=o.computed(()=>{const O=(P.value-1)*lu,q=O+lu;return W.value.slice(O,q)});o.watch(W,()=>{P.value=E.value||1},{immediate:!0}),o.watch(()=>n.modelValue,O=>{n.dummyMode||O&&O.length>0&&(s.value=O)},{immediate:!0}),o.onMounted(()=>{B()});const $=O=>{if(!O)return"secondary";switch(O.toUpperCase()){case"UP":return"success";case"DOWN":return"destructive";case"OFFLINE":return"destructive";case"IDLE":return"warning";default:return"secondary"}},I=O=>{if(!O)return"ghost";switch(O.toUpperCase()){case"IDLE":return"ghost";case"BUSY":case"PROCESSING":return"info";default:return"ghost"}};return(O,q)=>e.visible?(o.openBlock(),o.createElementBlock("div",dpe,[o.createElementVNode("div",upe,[o.createElementVNode("div",fpe,[o.createVNode(o.unref(Ne.Search),{class:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-neutral-400"}),o.withDirectives(o.createElementVNode("input",{"onUpdate:modelValue":q[0]||(q[0]=X=>l.value=X),type:"text",placeholder:"Search robots...",class:"w-full pl-10 pr-4 py-2 text-xs rounded-xl border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 focus:ring-2 focus:ring-primary-500/20 focus:border-primary-500 outline-none transition-all"},null,512),[[o.vModelText,l.value]])]),o.createElementVNode("div",hpe,[q[3]||(q[3]=o.createElementVNode("span",{class:"text-[10px] font-black uppercase tracking-widest text-neutral-400 mr-1"},"Health:",-1)),(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(["ALL","UP","DOWN"],X=>o.createElementVNode("button",{key:X,onClick:oe=>N.value=X,class:o.normalizeClass(["px-3 py-1.5 text-[10px] font-black uppercase tracking-wider rounded-lg border transition-all duration-200 flex items-center gap-1.5",N.value===X?"bg-neutral-900 dark:bg-white text-white dark:text-neutral-900 border-neutral-900 dark:border-white shadow-sm":"bg-white dark:bg-neutral-900 text-neutral-500 hover:text-neutral-900 dark:hover:text-white border-neutral-200 dark:border-neutral-800 hover:border-neutral-300 dark:hover:border-neutral-700"])},[X!=="ALL"?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["w-1.5 h-1.5 rounded-full",X==="UP"?"bg-emerald-500":"bg-red-500"])},null,2)):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(X)+" ",1),o.createElementVNode("span",ppe," ("+o.toDisplayString(j(X))+") ",1)],10,mpe)),64)),o.createElementVNode("button",{onClick:B,class:"p-2 rounded-xl border border-neutral-200 dark:border-neutral-800 hover:bg-neutral-50 dark:hover:bg-neutral-800 transition-colors ml-1",disabled:a.value},[o.createVNode(o.unref(Ne.RefreshCw),{class:o.normalizeClass(["w-3.5 h-3.5 text-neutral-500",{"animate-spin":a.value}])},null,8,["class"])],8,gpe)])]),o.createElementVNode("div",ype,[o.createElementVNode("table",bpe,[q[4]||(q[4]=o.createElementVNode("thead",null,[o.createElementVNode("tr",{class:"bg-neutral-50 dark:bg-neutral-800/50 border-b border-neutral-100 dark:border-neutral-800"},[o.createElementVNode("th",{class:"px-6 py-4 text-[10px] font-black uppercase tracking-widest text-neutral-400"},"Robot Info"),o.createElementVNode("th",{class:"px-6 py-4 text-[10px] font-black uppercase tracking-widest text-neutral-400"},"Operator & SPV"),o.createElementVNode("th",{class:"px-6 py-4 text-[10px] font-black uppercase tracking-widest text-neutral-400"},"Role & Channel"),o.createElementVNode("th",{class:"px-6 py-4 text-[10px] font-black uppercase tracking-widest text-neutral-400 text-center"},"Health"),o.createElementVNode("th",{class:"px-6 py-4 text-[10px] font-black uppercase tracking-widest text-neutral-400 text-center"},"Processing"),o.createElementVNode("th",{class:"px-6 py-4 text-[10px] font-black uppercase tracking-widest text-neutral-400 text-right"},"Last Update")])],-1)),o.createElementVNode("tbody",vpe,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(k.value,X=>{var oe,ue,te,re,ge,ce;return o.openBlock(),o.createElementBlock("tr",{key:X.id||X.code,class:"group hover:bg-neutral-50/50 dark:hover:bg-neutral-800/30 transition-colors"},[o.createElementVNode("td",wpe,[o.createElementVNode("div",_pe,[o.createElementVNode("div",kpe,[o.createVNode(o.unref(Ne.Terminal),{class:"w-5 h-5 text-primary-500"})]),o.createElementVNode("div",null,[o.createElementVNode("div",xpe,o.toDisplayString(X.name),1),o.createElementVNode("div",Epe,o.toDisplayString(X.code),1)])])]),o.createElementVNode("td",Cpe,[o.createElementVNode("div",Spe,[o.createElementVNode("div",Ape,[o.createVNode(o.unref(Ne.User),{class:"w-3 h-3 text-neutral-400"}),o.createElementVNode("span",Tpe,o.toDisplayString(((oe=X.operator)==null?void 0:oe.name)||"-"),1)]),o.createElementVNode("div",Ppe,[o.createVNode(o.unref(Ne.ShieldCheck),{class:"w-3 h-3 text-neutral-400"}),o.createElementVNode("span",Bpe,o.toDisplayString(((ue=X.supervisor)==null?void 0:ue.name)||"-"),1)])])]),o.createElementVNode("td",Npe,[o.createElementVNode("div",Dpe,[o.createElementVNode("div",Mpe,[o.createVNode(o.unref(Ne.Settings),{class:"w-3 h-3 text-neutral-400"}),o.createElementVNode("span",Rpe,o.toDisplayString(((te=X.robotRole)==null?void 0:te.name)||"-"),1)]),o.createElementVNode("div",Ipe,[o.createVNode(o.unref(Ne.Globe),{class:"w-3 h-3 text-neutral-400"}),o.createElementVNode("span",Ope,o.toDisplayString(((re=X.channel)==null?void 0:re.name)||"-"),1)])])]),o.createElementVNode("td",Lpe,[o.createVNode(au,{variant:$(X.healthStatus),pill:"",class:"px-3 py-1 text-[9px] font-black uppercase tracking-wider"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X.healthStatus),1)]),_:2},1032,["variant"])]),o.createElementVNode("td",Fpe,[o.createVNode(au,{variant:I(X.statusProcessing),size:"xs",pill:"",class:"px-2 py-0.5 text-[9px] font-black uppercase"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(X.statusProcessing),1)]),_:2},1032,["variant"])]),o.createElementVNode("td",$pe,[o.createElementVNode("div",zpe,o.toDisplayString(((ge=X.lastUpdate)==null?void 0:ge.split(" ")[1])||"-"),1),o.createElementVNode("div",jpe,o.toDisplayString(((ce=X.lastUpdate)==null?void 0:ce.split(" ")[0])||"-"),1)])])}),128))])]),W.value.length>lu?(o.openBlock(),o.createElementBlock("div",Upe,[o.createElementVNode("div",null," Showing "+o.toDisplayString((P.value-1)*lu+1)+" to "+o.toDisplayString(Math.min(P.value*lu,W.value.length))+" of "+o.toDisplayString(W.value.length)+" entries ",1),o.createElementVNode("div",Wpe,[o.createElementVNode("button",{onClick:q[1]||(q[1]=X=>P.value=Math.max(1,P.value-1)),disabled:P.value===1,class:"flex items-center gap-1 px-3 py-1.5 rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 hover:bg-neutral-50 dark:hover:bg-neutral-800 disabled:opacity-50 disabled:pointer-events-none transition-colors"},[o.createVNode(o.unref(Ne.ChevronLeft),{class:"w-3.5 h-3.5"}),q[5]||(q[5]=o.createTextVNode(" Previous ",-1))],8,Hpe),o.createElementVNode("button",{onClick:q[2]||(q[2]=X=>P.value=Math.min(E.value,P.value+1)),disabled:P.value===E.value,class:"flex items-center gap-1 px-3 py-1.5 rounded-lg border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900 hover:bg-neutral-50 dark:hover:bg-neutral-800 disabled:opacity-50 disabled:pointer-events-none transition-colors"},[q[6]||(q[6]=o.createTextVNode(" Next ",-1)),o.createVNode(o.unref(Ne.ChevronRight),{class:"w-3.5 h-3.5"})],8,qpe)])])):o.createCommentVNode("",!0),W.value.length===0&&!a.value?(o.openBlock(),o.createElementBlock("div",Kpe,[o.createVNode(o.unref(Ne.Activity),{class:"w-10 h-10 text-neutral-200 dark:text-neutral-800 mb-4"}),q[7]||(q[7]=o.createElementVNode("h3",{class:"text-sm font-black text-neutral-400 uppercase tracking-widest"},"No Robots Found",-1))])):o.createCommentVNode("",!0),a.value&&s.value.length===0?(o.openBlock(),o.createElementBlock("div",Gpe,[o.createVNode(o.unref(Ne.RefreshCw),{class:"w-8 h-8 text-primary-500 animate-spin"})])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)}}),[["__scopeId","data-v-e8bbf101"]]),Ype={class:"dcode-checklist-item relative flex flex-col items-center justify-start text-center px-2 py-2 h-full w-full after:absolute after:top-[15%] after:bottom-[15%] after:-right-[8px] after:w-px after:bg-neutral-200 dark:after:bg-neutral-800"},Zpe={class:"flex items-start justify-center gap-2 mb-3"},Xpe={key:0,class:"mt-0.5 flex-shrink-0 text-neutral-400"},Jpe={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400 leading-tight"},Qpe={key:1,class:"mt-auto px-4 py-1 text-xs font-semibold rounded-md border bg-neutral-100 border-neutral-200 text-neutral-400 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-500"},Vpe={key:1,class:"mt-auto px-4 py-1 text-xs font-semibold rounded-md border bg-neutral-100 border-neutral-200 text-neutral-400 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-500"},ege=["title"],tge={key:1,class:"mt-auto text-sm text-neutral-400 dark:text-neutral-500"},nge={name:"DCodeBarCustom"},pk=o.defineComponent({...nge,props:{label:{},icon:{},modelValue:{},border:{type:Boolean,default:!0},shadow:{type:Boolean,default:!1},padding:{default:"px-4 py-4 sm:py-5"},containerClass:{default:""},valueType:{},prefix:{},suffix:{},locale:{default:"id-ID"}},setup(e){const t=["lengkap","selesai","aktif","valid","approved","complete","done","yes","ya","true","success","verified"],n=e,i=o.computed(()=>n.icon&&(tn[n.icon]||tn[n.icon+"Icon"])||null),r=o.computed(()=>(n.valueType||"TEXT").toUpperCase()),s=o.computed(()=>{const d=n.modelValue;return d==null||d===""?null:typeof d=="object"&&"value"in d?d.value:d}),a=o.computed(()=>{const d=s.value;if(d==null||d==="")return"";const f=r.value,h=n.locale||"id-ID";let m="";switch(f){case"DATE":m=Jc(d,"short",h);break;case"DATETIME":m=Jc(d,"datetime",h);break;case"CURRENCY":{if(n.prefix)m=Rb(d,n.prefix);else{const y=Number(d);m=isNaN(y)?String(d):new Intl.NumberFormat(h,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0}).format(y)}break}case"BOOLEAN":typeof d=="boolean"?m=h.startsWith("id")?d?"Ya":"Tidak":d?"Yes":"No":m=String(d);break;case"NUMBER":{const y=Number(d);m=isNaN(y)?String(d):new Intl.NumberFormat(h).format(y);break}case"PERCENT":m=`${d}%`;break;default:typeof d=="boolean"?m=h.startsWith("id")?d?"Lengkap":"Belum Lengkap":d?"Complete":"Incomplete":typeof d=="object"&&d!==null?m=d.name??d.label??d.code??d.value??String(d):m=String(d);break}const g=f!=="CURRENCY"&&n.prefix?n.prefix:"",v=n.suffix||"";return`${g}${m}${v}`}),l=o.computed(()=>{const d=a.value.toLowerCase();return t.some(f=>d.includes(f))}),c=o.computed(()=>{const d=s.value;return typeof d=="boolean"?d:typeof d=="string"?d.toLowerCase()==="true"||d.toLowerCase()==="ya"||d.toLowerCase()==="yes":!1});return(d,f)=>(o.openBlock(),o.createElementBlock("div",Ype,[o.createElementVNode("div",Zpe,[i.value?(o.openBlock(),o.createElementBlock("div",Xpe,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(i.value),{class:"w-4 h-4 sm:w-5 sm:h-5"}))])):o.createCommentVNode("",!0),o.createElementVNode("p",Jpe,o.toDisplayString(e.label||"Checklist Item"),1)]),r.value==="BADGE"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[a.value?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["mt-auto px-4 py-1 text-xs font-semibold rounded-md border",l.value?"bg-green-50 border-green-200 text-green-700 dark:bg-green-950/30 dark:border-green-900/50 dark:text-green-400":"bg-red-50 border-red-200 text-red-700 dark:bg-red-950/30 dark:border-red-900/50 dark:text-red-400"])},o.toDisplayString(a.value),3)):(o.openBlock(),o.createElementBlock("span",Qpe," - "))],64)):r.value==="BOOLEAN"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value!==null?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["mt-auto px-4 py-1 text-xs font-semibold rounded-md border",c.value?"bg-green-50 border-green-200 text-green-700 dark:bg-green-950/30 dark:border-green-900/50 dark:text-green-400":"bg-red-50 border-red-200 text-red-700 dark:bg-red-950/30 dark:border-red-900/50 dark:text-red-400"])},o.toDisplayString(a.value),3)):(o.openBlock(),o.createElementBlock("span",Vpe," - "))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[a.value?(o.openBlock(),o.createElementBlock("p",{key:0,class:"mt-auto text-base font-bold text-neutral-900 dark:text-neutral-50 truncate max-w-full",title:a.value},o.toDisplayString(a.value),9,ege)):(o.openBlock(),o.createElementBlock("p",tge,"-"))],64))]))}}),ige={key:0},rge=["value","name"],oge={key:1,class:"flex flex-col gap-1"},sge={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},age=["src"],lge={key:1,class:"text-sm text-neutral-400 italic"},cge={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},dge={key:3,class:"text-xs text-neutral-400 italic"},Fh=o.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},dummyMode:{type:Boolean,default:!1},selectedTokenCore:{default:null}},emits:["update:modelValue"],setup(e,{emit:t}){let n=o.ref("en");try{n=Yn.useI18n().locale}catch{}const i=e,r=t,s=o.ref(i.modelValue);o.watch(()=>i.modelValue,M=>{s.value=M});const a={DCodeTextField:ad,DCodeMapField:kg,DCodeAutoComplete:Qu,DCodeInfiniteAutoComplete:Km,DCodeDatePicker:eg,DCodeTimePicker:tg,DCodeDateTimePicker:ng,DCodeTextarea:Sd,DCodeTextArea:Sd,DCodeTextEditor:N0,DCodeCheckbox:$l,DCodeSwitch:wg,DCodeSegment:_g,DCodeOtpInput:vg,DCodeImageField:bg,DCodeSlider:D0,DCodeRadio:M0,DCodeButton:Vt,DCodeButtonGroup:ba,DCodeRadioCustom:R0,DCodeDynamicUploadList:rg,DCodeDynamicCollapse:G0,DCodeMultiSelect:I0,DCodeCurrencyField:qp,DCodePercentField:Kp,DCodePermissionMenu:O0,DCodeTreePermissions:L0,DCodeCardCheckboxList:Hp,DCodeBeforeAfter:lp,DCodeListLabels:cp,DCodeStaticLabel:F0,DCodeStaticImage:$0,DCodeFileField:z0,DCodeWorkflowDiagram:j0,DCodeTimelineWithIcons:U0,DCodePdfViewer:W0,DCodeRobotList:H0,DCodeBarCustom:pk},l=o.computed(()=>{const M=i.field.component;return a[M]||null}),c=o.computed(()=>{var B;const M=((B=i.field.component)==null?void 0:B.toLowerCase())||"";return M.includes("image")||M.includes("upload")}),d=o.computed(()=>{var B;const M=((B=i.field.component)==null?void 0:B.toLowerCase())||"";return M.includes("switch")||M.includes("checkbox")}),f=o.computed(()=>{var W,P,E;const M=i.field.props||i.field.propsFieldCustom||i.field.propsFieldGlobal||{},B=((W=i.dynamicLabels)==null?void 0:W.labelID)||M.labelID,N=((P=i.dynamicLabels)==null?void 0:P.labelEN)||M.labelEN,j=((E=i.dynamicLabels)==null?void 0:E.labelKR)||M.labelKR;return n.value==="kr"||n.value==="ko"?j||N||B||i.field.model:n.value==="id"?B||N||i.field.model:N||B||i.field.model}),h=o.computed(()=>{const M=i.modelValue;return M==null||M===""?null:Array.isArray(M)?M.map(B=>typeof B=="object"&&B!==null?B.label||B.name||B.code||B.value||JSON.stringify(B):String(B)).join(", "):typeof M=="object"?M.label||M.name||M.code||M.value||M.id||JSON.stringify(M):String(M)}),m=o.inject("dynamicFormContext",null),g=(M,B)=>{const N={label:"",placeholder:"",title:""},j=(B==null?void 0:B.labelID)||M.labelID,W=(B==null?void 0:B.labelEN)||M.labelEN,P=(B==null?void 0:B.labelKR)||M.labelKR;(j||W||P)&&(N.label=n.value==="kr"||n.value==="ko"?P||W:n.value==="id"?j:W);const E=(B==null?void 0:B.placeholderID)||M.placeholderID,k=(B==null?void 0:B.placeholderEN)||M.placeholderEN,$=(B==null?void 0:B.placeholderKR)||M.placeholderKR;(E||k||$)&&(N.placeholder=n.value==="kr"||n.value==="ko"?$||k:n.value==="id"?E:k);const I=(B==null?void 0:B.titleID)||M.titleID,O=(B==null?void 0:B.titleEN)||M.titleEN,q=(B==null?void 0:B.titleKR)||M.titleKR;return(I||O||q)&&(N.title=n.value==="kr"||n.value==="ko"?q||O:n.value==="id"?I:O),N},v=(M,B)=>{const N={};if(!Array.isArray(M)||M.length===0)return N;const j=W=>{if(typeof W!="string")return;if(W.startsWith("$route.")){if(W.replace("$route.",""),typeof window<"u"){const k=window.location.pathname.match(new RegExp("/([^/]+)$"));return k?k[1]:void 0}return}if(W.startsWith("$query.")){const k=W.replace("$query.","");if(typeof window<"u"){const $=new URLSearchParams(window.location.search);if($.has(k))return $.get(k)}return}if(W.startsWith("$value(")){const k=W.match(/\$value\(([^)]+)\)/);let $=k?k[1]:W.replace("$value(","").replace(")","");return($.startsWith("'")&&$.endsWith("'")||$.startsWith('"')&&$.endsWith('"'))&&($=$.slice(1,-1)),$}const P=W.replace(/^formData\./,"");let E=B?Ye(B,P):void 0;if(E===void 0&&typeof window<"u"){const k=new URLSearchParams(window.location.search);k.has(P)&&(E=k.get(P))}return E};return M.forEach(W=>{if(typeof W=="string"){const P=j(W);if(P!=null&&P!==""){const E=W.startsWith("$")&&W.split(".").pop()||W;N[E]=P}}else typeof W=="object"&&W!==null&&Object.entries(W).forEach(([P,E])=>{let k=j(E);if((k==null||k==="")&&typeof window<"u"){const $=new URLSearchParams(window.location.search);$.has(P)&&(k=$.get(P))}k!=null&&k!==""&&(N[P]=k)})}),N},y=M=>{const B=M.endpoint||M.endpointComponent||M.endpointReference||{};if(!B.apiUrl&&!B.socket)return{};const N=m!=null&&m.resolveKeyParams?m.resolveKeyParams(B.keyParam||[],void 0,i.field,i.formData):v(B.keyParam||[],i.formData);let j=B.apiUrl;if(j){const W=typeof(m==null?void 0:m.resolvedBaseUrl)=="object"&&"value"in m.resolvedBaseUrl?m.resolvedBaseUrl.value:m==null?void 0:m.resolvedBaseUrl,P=i.baseUrl||W;if(P&&typeof P=="string"&&typeof j=="string"&&!j.startsWith("http")){const E=P.replace(/\/$/,""),k=j.startsWith("/")?j:`/${j}`;j=`${E}${k}`}}return{endpoint:{apiUrl:j,apiMethod:B.apiMethod||"GET",socket:B.socket},...Object.keys(N).length?{apiParams:N}:{}}},A=o.computed(()=>{var $,I,O,q;const M=i.field.props||i.field.propsFieldCustom||i.field.propsFieldGlobal||{},B={},N=g(M,i.dynamicLabels);N.label&&(B.label=N.label,i.field.component==="DCodeButton"&&(B.text=N.label),i.field.component==="DCodeSwitch"&&!N.title&&(B.title=N.label)),N.placeholder&&(B.placeholder=N.placeholder),N.title&&(B.title=N.title),B.required=i.required!==void 0?i.required:M.required??!1,B.readonly=i.readonly!==void 0?i.readonly:M.readonly??!1,B.disabled=i.disabled!==void 0?i.disabled:M.disabled??!1,["disabled","readonly","clearable","icon","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter","range","autoRangeDays","disablePast","maxDaysAhead","displayFormat","modelType","placement","prependInner","selectLabel","cancelLabel","tone","skeleton","allowedTypes","maxSizeMb","minSizeMb","bgColor","variant","size","rounded","borderColor","borderStyle","type","valueType","textCase","prefix","suffix","allowChars","allowSpaces","pattern","showCharCount","returnNumber","applyTextCaseToValue","socketEndpoint","socketParams","accordion","renderSubForm","subLayoutCodeKey","layoutMapping","currency","locale","valueFormat","zoom","defaultLat","defaultLng","enableSearch","enableCurrentLocation","enableManualInput","searchParamName","debounceMs","height","is24","enableSeconds","minutesIncrement","template","isTab","buttons","orientation","gap"].forEach(X=>{M[X]!==void 0&&M[X]!==null&&(B[X]=M[X])}),i.field.component==="DCodeDynamicCollapse"&&(B.formData=i.formData,B.isEditMode=!i.readonly,B.dummyMode=i.dummyMode,B.selectedTokenCore=i.selectedTokenCore||(m==null?void 0:m.selectedTokenCore)),i.skeleton&&(B.skeleton=!0),B.minLength=(($=i.dynamicLength)==null?void 0:$.minLength)??M.minLength,B.maxLength=((I=i.dynamicLength)==null?void 0:I.maxLength)??M.maxLength,M.valueType&&(B.type=M.valueType),i.field.component==="DCodeCurrencyField"&&(B.currency=M.currency||"IDR"),i.error&&(B.error=i.error),Object.assign(B,y(M));const W=M.endpointReference||M.endpointPropAction||M.endpoint||{};if(W.apiUrl){let X=W.apiUrl;if(i.baseUrl&&typeof X=="string"&&!X.startsWith("http")){const oe=i.baseUrl.replace(/\/$/,""),ue=X.startsWith("/")?X:`/${X}`;X=`${oe}${ue}`}B.endpointReference={...W,apiUrl:X}}const P=Array.isArray((O=i.field.logic)==null?void 0:O.optionsFilterRule)&&i.field.logic.optionsFilterRule.length>0,E=((q=m==null?void 0:m.rawItemsCache)==null?void 0:q[i.field.key])||[];if(P||i.options&&i.options.length>0||M.items&&M.items.length>0||M.options&&M.options.length>0||E.length>0){B.items=i.options||M.items||M.options||E,B.options=B.items;const X=["DCodeAutoComplete","DCodeInfiniteAutoComplete"].includes(i.field.component);(P||i.field.component!=="DCodeDynamicUploadList"&&!X)&&(delete B.endpoint,delete B.apiParams,delete B.apiUrl)}if(i.baseUrl&&(B.baseUrl=i.baseUrl),i.loading&&(B.loading=!0),i.dummyMode&&(B.dummyMode=i.dummyMode),i.field.component==="DCodePdfViewer"){const X=M.itemValue;if(X&&typeof X=="string"){const oe=X.split(".");let ue=i.formData,te;for(const re of oe)te=ue,ue=ue==null?void 0:ue[re];if(ue!=null&&(B.itemValue=ue,typeof ue=="string"&&!ue.startsWith("http")&&te)){const re=te.server||te.baseUrl||te.base_url;re&&(B.baseUrl=re)}}}return B}),C=M=>{s.value=M,r("update:modelValue",M)};return(M,B)=>e.field.isHidden?(o.openBlock(),o.createElementBlock("div",ige,[o.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,rge)])):e.viewOnly?(o.openBlock(),o.createElementBlock("div",oge,[o.createElementVNode("span",sge,o.toDisplayString(f.value),1),c.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[h.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:h.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,age)):(o.openBlock(),o.createElementBlock("span",lge,"-"))],64)):d.value?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",h.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},o.toDisplayString(h.value?"✓ Ya":"✗ Tidak"),3)):(o.openBlock(),o.createElementBlock("span",cge,o.toDisplayString(h.value||"-"),1))])):l.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),o.mergeProps({key:2},A.value,{"model-value":s.value,"onUpdate:modelValue":C}),null,16,["model-value"])):(o.openBlock(),o.createElementBlock("div",dge," Unknown field: "+o.toDisplayString(e.field.component),1))}}),uge={class:"flex items-center gap-2"},fge=o.defineComponent({__name:"DynamicFormSection",props:{section:{},sIdx:{},dummyMode:{type:Boolean}},setup(e){const t=o.inject("dynamicFormContext",{}),n=o.computed(()=>{var re,ge,ce;const ue=(ce=(ge=(re=e.section)==null?void 0:re.propsForm)==null?void 0:ge.actionSection)==null?void 0:ce.some(se=>r==null?void 0:r(se)),te=e.sIdx===0;return ue||te}),{resolveSectionLabels:i,isActionVisible:r,handleGlobalButtonClick:s,locale:a,t:l,handleCancel:c,sortedFields:d,isFieldVisible:f,isFieldHidden:h,getDeepValue:m,formData:g,sectionLoading:v,fieldLoading:y,getSectionKey:A,isFieldRequired:C,isFieldDisabled:M,isFieldReadonly:B,getFilteredItems:N,errors:j,resolveFieldLabels:W,resolveFieldLength:P,resolvedBaseUrl:E,handleFieldUpdate:k,resolveSectionGridClass:$,resolveFieldColumnClass:I,touched:O,isSubmitted:q}=t,X=(ue,te)=>{k(ue,te)},oe=ue=>typeof d!="function"?[]:d(ue||[]);return(ue,te)=>{var re;return o.openBlock(),o.createBlock(Fo,{title:(re=o.unref(i)(e.section))==null?void 0:re.title,border:!0,padding:"",class:"overflow-hidden"},o.createSlots({default:o.withCtx(()=>{var ge,ce,se,z,G,ee;return[o.createElementVNode("div",{class:o.normalizeClass(["p-4 grid gap-4",o.unref($)(((ce=(ge=e.section)==null?void 0:ge.propsForm)==null?void 0:ce.layoutColumns)||((se=e.section)==null?void 0:se.layoutColumns))])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(oe(((G=(z=e.section)==null?void 0:z.propsForm)==null?void 0:G.fields)||((ee=e.section)==null?void 0:ee.fields)),K=>{var Y,F,_,b,R,S,T,D,Z;return o.openBlock(),o.createElementBlock(o.Fragment,{key:K==null?void 0:K.key},[o.unref(f)(K,void 0,K.model)?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(I)(K,((F=(Y=e.section)==null?void 0:Y.propsForm)==null?void 0:F.layoutColumns)||((_=e.section)==null?void 0:_.layoutColumns)))},[o.createVNode(Fh,{field:K,"model-value":o.unref(m)(o.unref(g),K.model)??o.unref(g)[K.model],"form-data":o.unref(g),required:(b=o.unref(C))==null?void 0:b(K,void 0,K.model),disabled:(R=o.unref(M))==null?void 0:R(K,void 0,K.model),readonly:(S=o.unref(B))==null?void 0:S(K,void 0,K.model),options:(T=o.unref(N))==null?void 0:T(K,void 0,K.model),error:o.unref(O)[K.model]||o.unref(q)?o.unref(j)[K.model]||o.unref(m)(o.unref(j),K.model):null,"dynamic-labels":(D=o.unref(W))==null?void 0:D(K,void 0,K.model),"dynamic-length":(Z=o.unref(P))==null?void 0:Z(K,void 0,K.model),"base-url":o.unref(E),skeleton:o.unref(v)[o.unref(A)(e.section)],loading:o.unref(y)[K.model]||o.unref(m)(o.unref(y),K.model),"dummy-mode":e.dummyMode,"onUpdate:modelValue":J=>X(K.model,J)},null,8,["field","model-value","form-data","required","disabled","readonly","options","error","dynamic-labels","dynamic-length","base-url","skeleton","loading","dummy-mode","onUpdate:modelValue"])],2)),[[o.vShow,!o.unref(h)(K,void 0,K.model)]]):o.createCommentVNode("",!0)],64)}),128))],2)]}),_:2},[n.value?{name:"actions",fn:o.withCtx(()=>{var ge,ce,se,z;return[o.createElementVNode("div",uge,[(se=(ce=(ge=e.section)==null?void 0:ge.propsForm)==null?void 0:ce.actionSection)!=null&&se.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(e.section.propsForm.actionSection,(G,ee)=>{var K,Y,F,_,b,R,S,T,D,Z,J,fe,ae,we,pe,ke,be,Se,ve,Be,Ee,Oe;return o.openBlock(),o.createElementBlock(o.Fragment,{key:ee},[(K=o.unref(r))!=null&&K(G)&&(G.type==="BUTTONGROUP"||((Y=G.propsActionGlobal)==null?void 0:Y.type)==="BUTTONGROUP"||G.buttons&&G.buttons.length||(F=G.propsActionGlobal)!=null&&F.buttons&&G.propsActionGlobal.buttons.length)?(o.openBlock(),o.createBlock(ba,{key:0,icon:G.icon||((_=G.propsActionGlobal)==null?void 0:_.icon),"label-k-r":G.labelKR||((b=G.propsActionGlobal)==null?void 0:b.labelKR),"label-e-n":G.labelEN||((R=G.propsActionGlobal)==null?void 0:R.labelEN),"label-i-d":G.labelID||((S=G.propsActionGlobal)==null?void 0:S.labelID),"bg-color":((D=G.bgColor||((T=G.propsActionGlobal)==null?void 0:T.bgColor))==null?void 0:D.toLowerCase())||"primary",variant:((J=G.variant||((Z=G.propsActionGlobal)==null?void 0:Z.variant))==null?void 0:J.toLowerCase())||"outline",buttons:G.buttons||G.propsCustom||((fe=G.propsActionGlobal)==null?void 0:fe.buttons)||[],size:"sm",onAction:te[0]||(te[0]=Ae=>{var Re;return(Re=o.unref(s))==null?void 0:Re(Ae)}),onButtonClick:te[1]||(te[1]=Ae=>{var Re;return(Re=o.unref(s))==null?void 0:Re(Ae)})},null,8,["icon","label-k-r","label-e-n","label-i-d","bg-color","variant","buttons"])):(ae=o.unref(r))!=null&&ae(G)?(o.openBlock(),o.createBlock(Vt,{key:1,icon:G.icon||((we=G.propsActionGlobal)==null?void 0:we.icon),text:o.unref(a)==="kr"||o.unref(a)==="ko"?G.labelKR||((pe=G.propsActionGlobal)==null?void 0:pe.labelKR)||G.labelEN||((ke=G.propsActionGlobal)==null?void 0:ke.labelEN):o.unref(a)==="id"?G.labelID||((be=G.propsActionGlobal)==null?void 0:be.labelID):G.labelEN||((Se=G.propsActionGlobal)==null?void 0:Se.labelEN),"bg-color":((Be=G.bgColor||((ve=G.propsActionGlobal)==null?void 0:ve.bgColor))==null?void 0:Be.toLowerCase())||"primary",variant:((Oe=G.variant||((Ee=G.propsActionGlobal)==null?void 0:Ee.variant))==null?void 0:Oe.toLowerCase())||"outline",size:"sm",onClick:Ae=>{var Re;return(Re=o.unref(s))==null?void 0:Re(G)}},null,8,["icon","text","bg-color","variant","onClick"])):o.createCommentVNode("",!0)],64)}),128)):o.createCommentVNode("",!0),e.sIdx===0?(o.openBlock(),o.createBlock(Vt,{key:1,size:"sm",icon:"List",text:(z=o.unref(l))==null?void 0:z("common.back"),variant:"outline",onClick:te[2]||(te[2]=G=>{var ee;return(ee=o.unref(c))==null?void 0:ee()})},null,8,["text"])):o.createCommentVNode("",!0)])]}),key:"0"}:void 0]),1032,["title"])}}}),hge={key:0,class:"fixed inset-0 z-[100] flex justify-end"},mge={key:0,class:"relative w-full max-w-sm h-full bg-white dark:bg-slate-900 shadow-2xl flex flex-col border-l border-gray-200 dark:border-gray-800"},pge={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},gge={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},yge={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},bge={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},vge=o.defineComponent({__name:"DataFilterSheet",props:{title:{default:void 0},description:{default:void 0}},setup(e,{expose:t}){const n=o.ref(!1),i=()=>{n.value=!0,document.body.style.overflow="hidden"},r=()=>{n.value=!1,document.body.style.overflow=""};return t({open:i,close:r}),(s,a)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",{onClick:i},[o.renderSlot(s.$slots,"trigger",{},()=>[o.createVNode(Vt,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[n.value?(o.openBlock(),o.createElementBlock("div",hge,[o.createVNode(o.Transition,{appear:"","enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:o.withCtx(()=>[n.value?(o.openBlock(),o.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:r})):o.createCommentVNode("",!0)]),_:1}),o.createVNode(o.Transition,{appear:"","enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:o.withCtx(()=>[n.value?(o.openBlock(),o.createElementBlock("div",mge,[o.createElementVNode("div",pge,[o.createElementVNode("div",null,[o.createElementVNode("h3",gge,o.toDisplayString(e.title),1),e.description?(o.openBlock(),o.createElementBlock("p",yge,o.toDisplayString(e.description),1)):o.createCommentVNode("",!0)]),o.createVNode(Vt,{variant:"ghost",size:"icon",onClick:r,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),o.createElementVNode("div",bge,[o.renderSlot(s.$slots,"default")])])):o.createCommentVNode("",!0)]),_:3})])):o.createCommentVNode("",!0)]))]))}}),wge={key:0},_ge=["value","name"],kge=o.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{},disabled:{type:Boolean},required:{type:Boolean},readonly:{type:Boolean},options:{},dynamicLabels:{},dynamicLength:{},baseUrl:{}},emits:["update:modelValue"],setup(e,{emit:t}){const{locale:n}=Yn.useI18n(),i=e,r=t,s=o.ref(i.modelValue);o.watch(()=>i.modelValue,f=>{s.value=f});const a={DCodeTextField:ad,DCodeAutoComplete:Qu,DCodeInfiniteAutoComplete:Km,DCodeDatePicker:eg,DCodeTimePicker:tg,DCodeDateTimePicker:ng,DCodeTextarea:Sd,DCodeTextArea:Sd,DCodeCheckbox:$l,DCodeSwitch:wg,DCodeOtpInput:vg,DCodeImageField:bg,DCodeSlider:D0,DCodeRobotList:H0,DCodeRadio:M0,DCodeRadioCustom:R0,DCodeButton:Vt,DCodeChart:Wp,DCodeMultiSelect:I0,DCodeCurrencyField:qp,DCodeBeforeAfter:lp,DCodeListLabels:cp,DCodeSegment:_g,DCodeMapField:kg,DCodeTextEditor:N0,DCodeDynamicUploadList:rg,DCodeDynamicCollapse:G0,DCodePercentField:Kp,DCodePermissionMenu:O0,DCodeTreePermissions:L0,DCodeCardCheckboxList:Hp,DCodeStaticLabel:F0,DCodeStaticImage:$0,DCodeFileField:z0,DCodeWorkflowDiagram:j0,DCodeTimelineWithIcons:U0,DCodePdfViewer:W0},l=o.computed(()=>{const f=i.field.component;return a[f]||null}),c=o.computed(()=>{var y,A,C,M,B;const f=i.field.props,h={},m=N=>{if(!N||!N.apiUrl||N.apiUrl.startsWith("http")||!i.baseUrl)return N;const j=i.baseUrl.replace(/\/$/,""),W=N.apiUrl.startsWith("/")?N.apiUrl:`/${N.apiUrl}`;return{...N,apiUrl:`${j}${W}`}};(f.labelID||f.labelEN||f.labelKR)&&(h.label=n.value==="kr"||n.value==="ko"?f.labelKR||f.labelEN:n.value==="id"?f.labelID:f.labelEN,i.field.component==="DCodeSwitch"&&(h.title=h.label)),(f.placeholderID||f.placeholderEN||f.placeholderKR)&&(h.placeholder=n.value==="kr"||n.value==="ko"?f.placeholderKR||f.placeholderEN:n.value==="id"?f.placeholderID:f.placeholderEN),(i.required!==void 0||f.required!==void 0)&&(h.required=i.required!==void 0?i.required:f.required),(i.disabled!==void 0||f.disabled!==void 0)&&(h.disabled=i.disabled!==void 0?i.disabled:f.disabled),(i.readonly!==void 0||f.readonly!==void 0)&&(h.readonly=i.readonly!==void 0?i.readonly:f.readonly),f.valueType&&(h.type=f.valueType),(((y=i.dynamicLength)==null?void 0:y.minLength)!==void 0||f.minLength!==void 0)&&(h.minLength=((A=i.dynamicLength)==null?void 0:A.minLength)??f.minLength),(((C=i.dynamicLength)==null?void 0:C.maxLength)!==void 0||f.maxLength!==void 0)&&(h.maxLength=((M=i.dynamicLength)==null?void 0:M.maxLength)??f.maxLength),f.min!==void 0&&(h.min=f.min),f.max!==void 0&&(h.max=f.max);const g=Array.isArray((B=i.field.logic)==null?void 0:B.optionsFilterRule)&&i.field.logic.optionsFilterRule.length>0;g?(h.options=i.options||[],h.items=h.options):((i.options||f.options)&&(h.options=i.options||f.options,h.items=h.options),f.endpoint&&(h.endpoint=m(f.endpoint))),f.endpointReference&&(h.endpointReference=m(f.endpointReference)),f.endpointPropAction&&(h.endpointPropAction=m(f.endpointPropAction)),f.itemTitle&&(h.itemTitle=f.itemTitle),f.itemValue&&(h.itemValue=f.itemValue),f.returnObject!==void 0&&(h.returnObject=f.returnObject),f.clearable!==void 0&&(h.clearable=f.clearable);const v=["labelID","labelEN","labelKR","placeholderID","placeholderEN","placeholderKR"];return g&&v.push("endpoint"),Object.keys(f).forEach(N=>{!v.includes(N)&&!h.hasOwnProperty(N)&&(h[N]=f[N])}),i.dynamicLabels&&((i.dynamicLabels.labelID||i.dynamicLabels.labelEN||i.dynamicLabels.labelKR)&&(h.label=n.value==="kr"||n.value==="ko"?i.dynamicLabels.labelKR||i.dynamicLabels.labelEN:n.value==="id"?i.dynamicLabels.labelID:i.dynamicLabels.labelEN,i.field.component==="DCodeSwitch"&&(h.title=h.label)),(i.dynamicLabels.placeholderID||i.dynamicLabels.placeholderEN||i.dynamicLabels.placeholderKR)&&(h.placeholder=n.value==="kr"||n.value==="ko"?i.dynamicLabels.placeholderKR||i.dynamicLabels.placeholderEN:n.value==="id"?i.dynamicLabels.placeholderID:i.dynamicLabels.placeholderEN)),h}),d=f=>{s.value=f,r("update:modelValue",f)};return(f,h)=>e.field.isHidden?(o.openBlock(),o.createElementBlock("div",wge,[o.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,_ge)])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),o.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[h[0]||(h[0]=m=>s.value=m),d]}),null,16,["modelValue"]))}}),xge=o.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r=Gn.useVModel(n,"modelValue",i,{passive:!0,defaultValue:n.defaultValue});return(s,a)=>o.withDirectives((o.openBlock(),o.createElementBlock("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>o.isRef(r)?r.value=l:null),class:o.normalizeClass(o.unref(nn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n.class))},null,2)),[[o.vModelText,o.unref(r)]])}}),Ege=o.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(e,{emit:t}){const n=e,i=t,r=Gn.reactiveOmit(n,"class"),s=kt.useForwardPropsEmits(r,i);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationRoot),o.mergeProps({"data-slot":"pagination"},o.unref(s),{class:n.class}),{default:o.withCtx(c=>[o.renderSlot(a.$slots,"default",o.normalizeProps(o.guardReactiveProps(c)))]),_:3},16,["class"]))}}),Cge=o.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class");return(i,r)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationList),o.mergeProps({"data-slot":"pagination-content"},o.unref(n),{class:o.unref(nn)("flex flex-row items-center gap-1",t.class)}),{default:o.withCtx(s=>[o.renderSlot(i.$slots,"default",o.normalizeProps(o.guardReactiveProps(s)))]),_:3},16,["class"]))}}),Sge=o.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class");return(i,r)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationEllipsis),o.mergeProps({"data-slot":"pagination-ellipsis"},o.unref(n),{class:o.unref(nn)("flex size-9 items-center justify-center",t.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default",{},()=>[o.createVNode(o.unref(Ne.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=o.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),Age=o.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class","size"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationFirst),o.mergeProps({"data-slot":"pagination-first",class:o.unref(nn)(o.unref(Qc)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},o.unref(i)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(Ne.ChevronLeftIcon)),s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),Tge=o.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class","size","isActive");return(i,r)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationListItem),o.mergeProps({"data-slot":"pagination-item"},o.unref(n),{class:o.unref(nn)(o.unref(Qc)({variant:"ghost",size:e.size}),e.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",t.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"]))}}),Pge=o.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class","size"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationLast),o.mergeProps({"data-slot":"pagination-last",class:o.unref(nn)(o.unref(Qc)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},o.unref(i)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),o.createVNode(o.unref(Ne.ChevronRightIcon))])]),_:3},16,["class"]))}}),Bge=o.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class","size"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationNext),o.mergeProps({"data-slot":"pagination-next",class:o.unref(nn)(o.unref(Qc)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},o.unref(i)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),o.createVNode(o.unref(Ne.ChevronRightIcon))])]),_:3},16,["class"]))}}),Nge=o.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class","size"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.PaginationPrev),o.mergeProps({"data-slot":"pagination-previous",class:o.unref(nn)(o.unref(Qc)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},o.unref(i)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(Ne.ChevronLeftIcon)),s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),Dge=o.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},nullableValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(e,{emit:t}){const n=e,i=t,r=kt.useForwardPropsEmits(n,i);return(s,a)=>(o.openBlock(),o.createBlock(o.unref(kt.SelectRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),Mge=o.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},memoDependencies:{},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},dir:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(e,{emit:t}){const n=e,i=t,r=Gn.reactiveOmit(n,"class"),s=kt.useForwardPropsEmits(r,i);return(a,l)=>(o.openBlock(),o.createBlock(o.unref(kt.SelectPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(kt.SelectContent),o.mergeProps({...o.unref(s),...a.$attrs},{class:o.unref(nn)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",n.class)}),{default:o.withCtx(()=>[o.createVNode(o.unref(Lge)),o.createVNode(o.unref(kt.SelectViewport),{class:o.normalizeClass(o.unref(nn)("p-1",e.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},8,["class"]),o.createVNode(o.unref(Oge))]),_:3},16,["class"])]),_:3}))}}),Rge={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},Ige=o.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.SelectItem),o.mergeProps(o.unref(i),{class:o.unref(nn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.class)}),{default:o.withCtx(()=>[o.createElementVNode("span",Rge,[o.createVNode(o.unref(kt.SelectItemIndicator),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.Check),{class:"h-4 w-4"})]),_:1})]),o.createVNode(o.unref(kt.SelectItemText),null,{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),Oge=o.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.SelectScrollDownButton),o.mergeProps(o.unref(i),{class:o.unref(nn)("flex cursor-default items-center justify-center py-1",t.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(Ne.ChevronDown))])]),_:3},16,["class"]))}}),Lge=o.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.SelectScrollUpButton),o.mergeProps(o.unref(i),{class:o.unref(nn)("flex cursor-default items-center justify-center py-1",t.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(Ne.ChevronUp))])]),_:3},16,["class"]))}}),Fge=o.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class"),i=kt.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(kt.SelectTrigger),o.mergeProps(o.unref(i),{class:o.unref(nn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",t.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default"),o.createVNode(o.unref(kt.SelectIcon),{"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),$ge=o.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(n,i)=>(o.openBlock(),o.createBlock(o.unref(kt.SelectValue),o.normalizeProps(o.guardReactiveProps(t)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),zge={v:"4.8.0",meta:{g:"LottieFiles AE ",a:"",k:"",d:"",tc:""},fr:25,ip:0,op:273,w:500,h:500,nm:"not_found",ddd:0,assets:JSON.parse('[{"id":"image_0","w":175,"h":173,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACtCAYAAADGWi9+AAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAYj0lEQVR4nO2dXVMb2ZnH/+cg1BIIkABjPF7bxFvZnamaqYHUrh1XqjbMxc7YV4Mucj3kEwzfIOwnCLnei+BP0PgmME5twWQry8DWFrh2qpKt3aRgXB4DtngRWKIlcc5eSGLUp7ul7qPWS7fO78rdWK1G+vP0c57zvAAKhUKhUCgUCoVCoVAoFAqFQqEIMqTTN9Au9Ofb0+B8CgzTICRJCZ8GAHAkOfBxnZeeEYJdAGAMewD2ALIHXO0hFttNfzJz2up7V9gTSvHqq5tTQN8sCKYp4dOc4+ctfLt9DuwCfAOUbqQ/fbDbwvdS1BAa8epfbc2Bk1kCPgfgXgdv5YwDG+BkBbH+FWWZW0egxauvbs4CdJ4QzAEY6fT92MGBZ0rIrSFw4tXXd5IwjHkCsgCPFjYej6E/EkF/fx80LQpKKQBgIB5zfI1hFHDFGAAgn78EAOTyBkrFEoqlkpe3P+McK+gjS8q18IfAiLfsx9JFt1ZW06IYiGvQotGyaPsjvt8TYwyXRgH5/CVyeeNa3I0gBF8zxhbTTx5t+H5TPUTXi7dGtF80+r+JwQEkBuMtE6sbLt7lcHGRRz5/6cYy73OChfRnD1facW9ho2vFq6/vJHFZWGok2ng8hpGhQSQSA9duQLdQFfLFuxxYxfWwQ1liObpSvPraNwsEZBEO7gGlFInBAYyNjnTMwnqBMYaLixwyx2d1rXF5cccW0k8e7bXv7oJLV4lXf749TRlfdto0oJQilRxCKjncdVbWLRfvcjg5Pa/nH59x8MX0458utfO+gkjXiFdf3VokBL+y+1kYRCuSy1/izdsTGEbB9ucVV2JeWWFnOi5efXVzihK64mRtU8khjI0mQyNakWz2op47ccY5WUg/ebDc5tsKBB0Vr766PU8IX4KNbxuPxzAxnoKmRTtwZ+2FMYbM8SlOTs9tf845niIWXVCbHGY6Jl59bXuJgH8pnqeUYmx0BKnkcCduq6MYRgEHRxlbV4IALxhnc8qN+IG2i7e8Q1ZYJsDn4s80LYr3Jm8EIoLQSt68PXaywmecklm1Q1emreLV13eS1Chs2Pm3qeQQboyPtvN2upqLdzkcHGbs4sPKD67QNvE6LcwopZgYT2F4ONGuW3Gkut1bzn/ovPUvFkv4/uCNrRvBOfllrwu4LeLVn29PE8Y3ICzMKKW4c/tm2xZlhlGAYRRQLJWQyxtgjDmGqmrpj0QQ6Y9cJ/XE4zHEahJ7WgljDEdvTpA9v7D8rNcF3HLx6qubU4TQXQjC1bQo7ty+2VIBFIslXLzLIZ83cPEu5/v1q8k/g4MDdTPT/ODgMKMELNBS8Tr5uK0UblWw2fN3rqyqX1S3rFPJoZY9SU5Os3jz9sRyvlcF3DLxtlu4ufwlstl3ttbJCwR4wYEpNJHc3h+JYGx0pCV+fDZ7gYOjjOU8p2Sm16IQrRPv2taKGA5rhXBz+Utkjs885tJiw0sRZbliAwDoLAimCTANF4nwrdrWdhBwz4XRWiJeuw0Iv4VrGAUcvT1pKNpycB8rANvwM+XwhyJPPmcXs66lFZbYzgcmwAumRWd7ZSfOd/FWtnx/W3uOUor7U7d9EW6jrdQK+xxkBfxqqR07UuXc4+IcJXyhXhm931vedgLmwLP044dzvrxBl+OreO0iC36Gw3L5SxweZurlxO5zThY7uXjRn29P44ov1EuiHxsdwdho0pf323/52rIw5Rz/kn7ycNGXN+hifBXvs7WtXdHyTE6M+fK4zByfInN85vTjjotWpFH5Ujwew+TEWNObIYwx7H/32vIH3QsLON/Ea5eP68eWL2MMr16/cfJtuz5xW1/dnKWELtm5E5RSvHfrRtMxYsMoYP/la/H0Ptei02H2f30Rb2UHbaf2nKZFce/OraauWy/LKmglM/VKm/x4OtnFgDnIb9KPHyw0deEuxhfxiu4CpRT37txq6pFoGAW8fHVon5jS5dbWiXplTn74wS9fHVqeUGF2H5pe/utr31hW2M0WRtYR7j6nZDaIwgWA9KcPdpkWneUcT8WfZY7PcHBo3XzwwuTEmCWiQxlfbuqiXUxTlldf30kSo7CHmkdhPB7Dnds3pa/pJNywxTArbsSvxfPNrhNs3YeQbh83Z3kvC5YSnonxlPTlnITLOZ5+/vhhqBYf6cc/XeKc/FI8f3J6jmxWfos7lRxGXFgAEsKX9PUdf2JzXYS0eMsxXXMYqJmkFMYYDo6sydec42n6ycN52fvsZtJPHizbCfjgKNNUFtzYqGVNOILLQugWbk1YXrpoOqK0qQXHq9fWpOswC7eKo4AP7aMsbhiIxzA8ZI5eEIKFsFlfKfE6WV3Z7d/M8alllUyAF2EXbhU7ATs9idzSC9ZX0vJara5stW81K0xgn2nRWakLBpSygM1RCMMoIHMs5+b390dCb309i1df30lW2oxeI2t1GWM4tIaHzjglc2FanLkl/eThPCH4uvbcyek5ci7TPUXsrW8xNEk73hVnGPMQEm9krW7m+NS6Jw++GNaguhtYNDoHwPQoOrSvIm6IvfXli83cXzfhWbyVjuTXJAblWosaRsGS1lhO5wvmBoRfpD+ZOeUE87XniqUSTk6zUtdLJYfEU/f059vTcnfXXXhSXaWiwFRBYPNocsWRtRbrDJyFakEhS/qzhysceFZ7LnN8hmLR0xgBAOUcE0v48oqH4nP2aDLpfO2RbAfyXP7SugcPvhiUJJu2UP5DNrkPdVJC65IaMVtfcc0SVDyJV/ylR4YGpd7ULrrQ6+6CSPrJoz3OYfpMsucXUtY3kRgQT43oX20FXsCuxVv5ZU0+gs2H0hBbq8vJoucL9QKx6BJ8sL7VsnwTLPjW173l5WS29lB2oZbNvhNP7YcxacQP0p/MnNpZX5nIQ2IwbjoOg+vgWn2VyZLXiB+GG4rFkrVgUFnd+thY3zOJxB1b1yHgUQdX4i3XY5mjDGLmkhtskk3OlNWtT/qTmVMOslx77rR+5bQtlFLrd3bFA219XVrevtnaI02LSkUZsudml0H8UhQO8CuT61AslaSSdsSnJaWYbeq+Oow78RKYHi8Dcc3zGxWLNh+48KUo7Ek/ebRHgBe152TaWonxXs7x8+burLO4Ei8l3CReLeo9Z1d0GcpZYyqu6xYGczlPLm94voZdlXKQ/V5X4hX/QmX83bzwYZdbMClcw7np8zKMglTUwer3IrzitfvLlPF3rYs1tuH5Ij1M5Sm1X3tOJtsspvULZ/iU9E11mMaWl5t/ORmra7e4UHN2vcM5NmqP3XbGrCUSMRueIC/aGouXmR8r/RHvVlcUr5izqnAL2ag9ujSKnq9gSdLhCGxyemPxEmL65fr7+zy/iZizW+6Pq/BMH0x5zjLhspgYcajT1bLbaSheS6RBojrYujIme54vooCYpM8Y87xoC9MYXM+/iWy5j5mrPc8XUQAohxhrjy8lrK/o+v3Q+T1YuFiwNe8TWR5vsVjPlvk0DUHTtX2RLpgx5wcNxSv6RH6MbOrF4kq/YNws3nZOPOo2wuMA9QocFr+3V2m5eHv5w1W0lpaLV1xQiAsOhUKWlotXXNlWBvQpFE3TevFaV7bSkyUVilrUgi1oCDuevYwb8Zrqp3o5NNMN+LHjGRYaipcQc2jmSqZnVkh2dLoRf3Y8g0lb3Iaw7Oh0A2JhgB9ZfkHd8WwoXsawV3ssk0Nq/YDprOeLKKpV3CaanaAJBHfH043l3Wv2TSxplCS4pScdhVIfMvwsxmff7v8FARfiNacvyhT+WabTQIlXCqEwQKYQ1jIijDRvnDqFC/Ga0xdLEo3exARoAPfsHoGK+oglO5qlHq0xor/LOAmkvwu4EK9Ya1YslaQSoK2POHMjE0V99PWdpLhYk8nwsz452V4Tt9VR3EYbTH6RTAK0pVEJCXarobZTKMzWHtobhMZYG7/w8FpeAOAwx3plIg6DQotNAnwepsk0LUdoSWppWeqCYtH61AxyFbdLy8s3ao9ku7VYAuohmkzTSioTmExz7xIJ71067WbdNXdnncWdeCndqD2UsbyA1VpQEo7ZCC1H+CO3bRbtAtHoMKGUPmi4Em+latWU4yAzG1ecTMOBj4PcK6tdiOOnZIQL2HxnxPxEDRqut4c5zL0WLi7ynt9M06LW3baQTKZpFXYTmGzGUzXEtrdZNLohfWNdgJe2/qZGb7Kugzj6ihB8oWK+zlBqHpUbj8ekogxiS1RC8HVQt4WruBdvrN8k3mKpJOU6DA8nbDKhzF+Qooy+ujkrxnZlrC5gfVIyoetkEHEt3nJ7efNgOxnXAbB+ARXrOyt1sRBDCF2uPe6PRCQXapeWlltiy9Qg4i0lUnAdLt7lpHJDU8lhi+9LCVVd0mvQ175ZgODr3rw5JnUtcQITIfg6DI29vYm37DpcRx0YY7i48O46UEotvi8HPq58YT2Pvro5RWCekhSPx6S2gxljFn+XsXDMAvEk3spcMJP1lR0pOjycsMk2I4sqdAZQSpchFKpOjKekrmUzcPtMXL8EFe+VFH3EMplGZuEG2H4hI5Tx5V7eNtZXtxbFRdrY6Ih0rdqJMPaKgywHPcpQxbN4058+2BWbQ4sfkFs0LWrrPuCy0JP+r766OUsIflV7rvwZyf0tZ7M20zJDNIFJqoaNMbZYe5zPX0rNRwCAsdGk1X0g+KLX/F/9+fY0IdTyOJ+ckFukAVaXjnM8DcNCrYqUeCuZSKY0yTdvT6RvYnJizBL7JSC/1le356UvGiD09Z0kYXwFgp87OTEm7S5kjk+t4THB5Qs60tXDnMBkGQ2jgKzETFygXET43q0blvOE8N+GXcD6+k6SGoUNCGGx4aEEhocTUtdkjFldOYLfiZ3Vg460eNOfPVwRfd/M8Zl0T4CBeMz2ERlmAVeFK/ZAjsdjmJSM6QJlq2v1dfEj6Qt2KU31bRB932KphMyx/EJ2eDhhWcAB4RSw/nx7mhiFXVG4mhbFbZunkFsMo+C0gP5AX9tWbkOV9JNHG+KW8cnpeVMtocZGkxgesj4uywLeWpa+cBehr27OEsY3ILgKmhbFnds3mxp6cnCUcfwZAf8yTHH05jvmcLYAIde33gfohsmbY7YJKITgi2dfbW0EOQ6sr24tEkLXISzO/BBu5vjUYjj6hOtRzkNjfYkfF9HXvlkgIL+uPZdKDuHG+GhT181mL5z+EM44wXz6s4eB2SnSVzenKKXLdpPW4/EYbt+60ZRwDaOA/ZevTedGhgZw/94kdr79q+k85+xHYQiZ+dKrLP34p0t2GxeyO29VhocTeM/+Sx0hHLq+trUShFxgfe2bBULorp1wh4cSTVtcxhi+f/3Gcn7mo/u4e3vcpnKbhKJ20LdGe4yxeYjuw2EGRYkmJbUkBgdw5/ZN23gnAT4nhO7qq1uL3ehK6KubsytrW3uVp5JlJTo5MdZUVKHKwWHGEtP98P27GBkqp0/ev3fT9DMKMt/0m3YBvrgNVfTV7XlC+G9rz/nhywFl65I5Pq23FX3GOZYQiy51eu9eX92cpZRachSqaFq0qQ2IWjLHp5adtPHRIfzsHz+4Ps7lDfz+D+ZC4bnHD3397juB77+Avrq1LJZpDw8lfLEwQDmx+tDG0tRwxkGWwa+W2unX6es7SVwW5yrFkvec/t/Y6Ih0roKI3ZqgP9KHf/75NPoj5uaGv/u3/0KxdHV9zCmZCfqmhf+Nc2PRBWIUpmvjl9V8Uj8EPBCP4d7dWzg5zTqlY44Q8C9B6JfP1rZeMPBlcL7SCiHr6ztJFAqzYJgjRuGLeqYgHo9hYjzlWydzwyjgyGZL/mcPPrAIFwBGhgfw9rjmqXV11XVullda8ujQVzenCKG7EPy8G+MppJLDvr1PsVhC5vjMkmztwD7n2ADIBvqwK2N19NXNKVA6DYZpSmGpL7OjPxLBzZtjvkwOrWIYBbx8dWjZRZv5sLxAs+OP//knk3g5Z58EuVsO0CLxApUdpHIg3pJsIrtn74RHEV9DgBcgOGUcp+JkyfJ/IMnqDAg3Qq0lHo8hlRyS7rHghJNw79+bxEfv33V8nRKvR+wWcEBrBAyUF3Vn2Qucnp7X84lbRrWTTSo51JJBJ07CvfPeOH7y0f26rxV9XgD/NPf44b/7fpNtpOUrTicB+7mIs8MwCsieXyCXN1o6wagq2EQi7ruVrcVJuJMTKTyc+XHd19pFGwjwgmnR2U5HZpqhLeGSTgm4CmMMufwl8vlLXBpF++4xLtG0KLRoFJrWjwHJBiBeyWYvcPT2xHLPI0MDjgu0Wv6yf4Bv//yd5XzQBdy2WJ+TgP2KA3uFMXbdZ7iemDUtCkop+iMRX4aXeMUujguULe5PPrrfULgA8Ps/vHDs7BlkAbc1UO0k4P5IORm9lwfiiTDGcHCYsd1id+PjVnGyurUEVcBt32VxikIA/ofSgophFPD96ze2i85GUYVacnkDG//xrbhQsyWIAu7IFqH+fHuaMr4sJmIDlSqCibGOPKK7ASc3AagfxxUplq7wx+0/4ezcbLnHRkccrx80AXdsf1tf30nCKCwT4HPxZ9WOOr1khQ2jgIOjjG1kpD/Sh589+OA60aYRTsKtpqnWSTUNlIA7npxhlwtcJR6PYWx0xNfdqW6jUcJRaiSBR//w964WZgDw+ugEO//9V4uroGlR3Ltz6/rYrYDLORuX00D3za/ouHiBaz94BQ4JLcND5dq2sLkSVdHWC9v1R/owOZHC305N1rW83716i5ffvzHnL1RwiujUEzBAvgf4MYAPTWeBF4yTpfSTB8uON9MmukK8QNWNKC4S8C+d/k9YRJzNXiBzfOZ5F3AgrmEgHsVYquxOFUtXyJ6/sxVslUahyPoCdqYb3IuuEW+Veou5KsNDiZZtwbaKci+FbCNLewZO/hWE/wJ10irdkkoOYWw02TCGHlQBd514q1RiwkuwCalV0bQoUiNDSCQG2r7J4ZZc/hLZ7LuGSUOc4yli0YUf/MzCAik3dnH8/Z2QWSvUi3KMDA2gWLqy3ejopIC7VrxANcHb3ZeYGBxAYjDeFUKu5lVcXOQbugac4ynAFu3yjcuulDFPQebrPYlqIYTg7t9MenoqOeVNjI8OYebD+9c1cLm8ge2d/7VEMTol4K4WbxWvligejyExGIemRdsSqSgWS5Vmg4brbvH1RGvHD6v+vimATxGKSXDMA9DE/0spdaz7E/GaqeYUhuuEgAMh3ipuS21E4vEYYlo/IpEINC2KWCVfQYZc/hKMMRhG4TpjzUOSj68lSvV2K90IWDbFslsEHCjx1qI/357GFV8gBHOQ8AuBck5FxEXkoipWWQjB14yR5VaEl2QF3ExuMNAdAg6seGvRv9qaA8NcM0L2G0LwNeN8pVX1c7V4FXCzwq3SaQGHQry1VCzyXKXGbBptEjMBXjCQDRC+gWh0o92LF7cC9ku4VTop4NCJV6QsZkwDfIpSzIIj6Xbl7sA+IdhjnOwCbA+c73bLtmkjAd+cGMXh0bFvwq3SKQGHXrz18DS4MBbbDUKySj0B29GscKt0QsA9Ld6w4lbAfgm3SrsFrMQbUhoJ2G/hVmmngJV4Q0xFwN9A2MholXCrtEvASrwhZ2Vt6xzAdZMMsQlfq2iHgLszm0XhC5UF6bVw+yN9eDDzd215b6fqDw58TI2CL93tlXjDDKUmgYwMD7iuyPCDVgtYiTfMcD5VexiJtD+Jv5UCVuINM5ybmgdmz5sbsyBLqwSsxBtmYjGTeHN5A3/+v1cduZVGApa5phJviEl/MnNazhv+gf/5yyt89+ptR+6nnoBlBhwq8YYetghh0M3Ot3/tOgHLDDhU4g056SeP9jgnC+L5Tgv4wcyPrZEPxhe9XEeJtwdIP3mwzDn5pXi+kwIeiGv48H1zMQwBPvcyV0+Jt0foRgE3O+BQibeH6EYBT06khDNk1u1rlXh7jG4T8K0Jc4iXALNuX6vE24N0k4DHRy2dQF2XbSnx9ijdJGBZlHh7mKALWIm3xwmygJV4FR0V8NvjrHjKvtufDUq8CgCdE/DrI3NBBQc23L5WiVdxTScEfHAkTq7nG25fq8SrMNFOAX/36q215y/nK25fr8SrsNAOARdLV/j2z/umcxx45qWvmxKvwpZWCrhaWWwZbkjJopfrKPEqHKkn4L/sH0hd06kknoP8Jv3pg12Hl9mi+jYoGuI0M3pyIoWP3r9rzQxzwGlGnGwvByVehSucBAyUO/DcvT1ul6eAYukKrw9PHGfEAdjnWnRapgmJEq/CNfUEXGV8dOj637l8wXaCUJVmu+co8So80WhaqVtqR3fJXkOJVyGFvrq1KDMnrjyfgy360ZBbiVchTXU6EwifqySROwl5n4OsgGLZa0ShHkq8Ct+oFE9OmU4GpKO8QqFQKBQKhUKhUCgUCoVCoVAoFAqFa/4fCbut2hEefs8AAAAASUVORK5CYII=","e":1},{"id":"image_1","w":85,"h":85,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAEE0lEQVR4nO2d/XXaMBTF72OB0AnqThA6Qd0JygalEzQj0A3aCUo3gAnqbEAmKNmATHD7hyTqEuMvycgW73cOJzYY83zzJMuS3pNgJJDMAWT2tQAwb/jKEcDe/RWRYjjruiGxfpjkEkBuX/eBTvsEI/QWQCEix0DnHS8klyS3JI+8DluSK5JNXj8tSGYk11cUsoojyQ3JLLYeXlgxNxGFvMT0xCU5p/HMsbPhFKoFmjozZjHvypHkQ2zdKqHxzm1kgXwoGLBK8G5S0bQvtwDuvK2JywuABxHZ+J5o5vNlmqLzG9MXFDDX8JPkd98T9fZUkhsAn30NGCk7AKu+Dw+9RE1cUMcTgLyPsJ1FJblHuMfKsdNL2E51qvXQWxEUMNdasGN7trWoN1Lkq7iHad20ppWo9i5/i4I6PlinakVjnWrbob89DEqJL23asbWi2rrkgDTaoSF4gblx7esOair+G6igZe5gNKnloqg0PfOfAhqUCvck13UHVBZ/LfaNvABYiMih6sNLnvoAFbSOOwAX+wheeartAvszoEEp8bFqFLfKU9eDm5IO66o3//NU9dJevPLWc09dXc2UdFidv3HuqUfoDaoPb8o9WSdPte1SFbQfq/LO7NIHSidW5Z1T8dei78079zAwA7ToB2LpNlzxz+PYkRS521BRw5G7DQEAkoxmSlq8F5H9zPbsK2HIAFP8s6hmpMUCUFFDcxJ1EdmQlJgDRtTxT3ydDhngOetPecVbQEUdBC3+A6CiDsAMZihaCYjWqQOgooblGTCiph8Uez0OgBG1dgab0okjoJ4amj2gnhqaA6Cd1KExndR25ymqKYngZlg7UbUK8OfRbThRO4W0KJWcNHSiFnHsSIrCbcwAwE6u2sWyJgGeyxEr5cdUrQL6synvlOdSafBEf96VgypOnmqrAPXW7uzOo1R0ero/9dPTreK/rmjQ1Hmsik7RkB8/2oX8qLe2ptJLAQ2j9OH9pWjqyuEU2xJYD2nRxPlRF57eFO9fAPgQ2qKJ8wwT7Huxc79p4G8FEzGs/KMxX1WtqPamNc4Eg3H41iZNc6u8VDZV21dfiybOTkSWzYd1SPZFcovbzVTRKelXF1HnMH2Gt5TsC+iRRa1TWrobFLZVdp9zOk37sf+tHLcxUOg8tPP4Xd+slHOYbsJU27C9M1ICPSeoichRRHKk2Uewg4eggOesPxFZAfiCdB4QvonIchQrWZBckNwPlYX7Chw41shHxl95og/fOfZ8/zQrUUwhPX1BclqBeSRza/jYKDjWot4WGnHHsIbKllMX8xyaVSseeN0b2oGmns+uea1RFvmyF1le5CvksM0j/i3yFWU2Y7SV08rQ3DAymIhutxRdBhvrWcEzzBiaW5LuALMknU4JTZW/U1qiUwiP8oYAAAAASUVORK5CYII=","e":1},{"id":"image_2","w":186,"h":242,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAADyCAYAAAD6Bd/wAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAPn0lEQVR4nO3dXVobR74G8LeqW60vGgkZFA/J2OZ54rkNZwXxDiY7GGYHnrOBISs4mbMCZwPnOCsYZwf2re05Mk6GsYUQSE2jr+6ucyGaMCBA6KtK1Pu7sUBSV7n00vp3qVoNEBERERGRScSiGqrVjp7ETrytlNoWSjw7a/3bRbVP2u1B4QMEPiioD0jw6unWxqtFNT7XoL+t1bellDtKiGdCqW/m2RYtrZ8g8NKJnZdbW2vH82pkLkF//7GxoyCeXw53PptBLuci4zpwHYms50LKhb2pkEa9foQkUegPYvT6ETq9AaIoufiQAMD/OImzu7W19mHW7c80Ze8/NnagsAvgcfo7v5hFseAhn80w1PRvoihB2OmjHfbQ70cX7/px1oGfSfLe1urbwnFepHtw15Xwi1mU/TzDTWPpdAcIwh6CsHf+OwX1vZu4P8yipJk6he/2DnYFxF8BQEqBkp9jwGliUZSgfniCTm8AAFBCvFFxvPOHrerrabY7cRprtaNyLOKX6cxJMe+h+mCFAaeZCDt91A9PkCRq+AuBP3/9aP3FpNubKJUXSxUpBdbXivCL2Un7QDRSkijUD08Qdvrpr378+vH6ziTbunPQz6YMfwaw6roSD9d9ZD13kraJxtJsneKo1Ul/nCjsdwr6xZB7nosvq6ssVWghgrCH+uFJ+uOdwy7HfWCtdlQWjvMCDDlp4BezqD5YSX/807u9g927PH/soMcifimU+sZ1JUNOWlwMu4D46/uPje/Gfe5YQX+3d7ALgW+lFHi47jPkpI1fzP428aHwY6129GSc590a9Le1+nY6T76+VuSBJ2lXfbACb5jD1VjEL8Z5zq1BP6vLUcx7nEIkY1QrxeENgW/HKWFuDPr7j42ddK78woEAkXZZz8VaKT/8QeG/b3v8zXv04QItlPwc63IyTqVUgOtKAPj9P/YOn9/02GuD/v5jYwfAY9eVqJQKs+0h0Yyk2VRQ/3nT464NuoJ4DoB1ORnNL2bP9+pnO+eRRgb9ba2+nS65Lfv5uXSQaFYuTDdee1A6MuhSyp10A6zNyXSrxVx684+12lF51GOuK12+A4BiwZtDt4hmy3VlOq+O2IlH7tWvBP3sk6bHwHDunGgZrP5Wvjwbdf+VoMdOvA0MT2QmWhZexklvPht1/5WgK6W2ASCX40f9tDzyufMd8+NRdfqVoKdfLpRxnct3ERktrdMjRNuX77t2Ht11xl7BS2QERwxnCIUjnly+72qaz0525ipFWjZpua2UenL5vmt325w/p/uE9QlZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysYeWJotxchCLvo9SPE6QVVyWg5z0Uu62KlmINj4GmYRgW9FXRw0AwxiGLdXaE7Oj2/6G0bJT+PjUrRqK9MMSLocaLw66fjC4NFy6wVdBCEXTxc91Ey5NuYtQc9ThQ+/rOJbj/S3RWaoSRR2K+3AcCIsGs/GGXI77f9ehutoHP7A+dMa9APmicMuQU+NQLtx13agh4nCs3Wqa7maYGSROGgGWrtg7agt4IOEk4dWiMIu1qnirUFPQh7upomDZJEaZ1V0xZ0TiXap9sbaGtb+6wL2WMQJdraZtBpYXTOvDDotDCFnL7rYmkLOr9/3T6OxquoaGvZ/+0iqGSJQk7f5Tw1Bj2rq2nSIOM6yGX1La3SGnSTlnHSfG1Uilrb13owulld1dk8LUgh72lfwag16IW8hy/WfZ1doDmTUuCrh1eub7v4fujuQKVUwPqa3rc1mo+M6+DxZsWIU+u0n3gBABuVFeSyGXw2YDknzUbJz+OLdd+IkAOGBB0YHpwW8h5Owi6ax6dcp76EpBTwizmU/RwKeX1TiaMYE3QAcKRAyc+fH7hw4dfykFJqnT68jbk9A4zbK9Dy0n4wSrQIDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUjv2Q0PrtuvM5Lai9aLptBIe8t/PvEZzXWjiNRyHnGfqOuUb3q9iI0W6doBR3dXdGm5OexUSnO/UJmp50+mq1TBGFvptvNuA5Kfg6VctGYiwAABgX9cyNAs3WquxvatYIOWkEH62tFbFRW5tLGPMd6EMVoHIVoBV1sVleN+epv7TV6nCjs7R8x5Jc0jkLs19sz3WacKNR+OVzIWA+iGHv7R8a8O2sP+udGwCtbXKMVdGYa9l8/HS/8kjn79bYRr6/WoNtej4+jFXRmUkcfNE+0Be6XT8eIE6Wl7ZS2oMeJwkHzRFfzS+VzI5jq+XGitJaGSaLQPA61tQ9oDPpJ2EWi+a98WQyieKp3vlbQ0T7Wuo/BtAV91tNa990049Vq6y8Pk0Rpfc0Z9CURTlFfm3LNVp0fAGqfdaHxTFp6mHQl7kGUaGubQb/nBgOTgq6vLwz6PZfNZnR34dy8lzXcRFvQpUHrIJbBpCExab1JxtW3X9XWctGQNRDLYpo1I6asN9H5mmsLul/M6mp6KU0zXiaMtZRC6x+ctqCX/LzWmm2ZZFxnqrCW/Lz2UrFSKmhtX+vB6Bfrvs7ml8a04+RIMbclv+PIuA4q5aK29gHNQfeLWZT8vM4uGK9SKsyk9KiUClrGWkqBrx6WtR8Ua59e3KyuMuzXKPn5mb7rLXqspRR4vFkx4vQ6/T3A8AXIuBKNI70r3Ewhz0qNedS1ixrrnOfid9WSESEHDAk6AGxUVlBezeOgGSKwdGWjlAJlP49KuTDXA/V5jnXOc1Ep6ymTbmJM0IHhQctmdRXAKk47fQyiGH2DPsKeFy/jIOtlFrr3uzzW3X6EOJ58LUouO+y/qTNpRgX9IlM+5LBBIe/d+/HWfjBKtAgMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBWO/ZHQQxRgM4nv/jbpexkHGdZA5+1eHacc6vdqcyV9UalTQ40SheRyiFXSNurT3omRcByU/h0q5OPdLocxyrC9eVMAvZlEpFYwLvTFBbwUdfGoEVl4AIDWIYjSOQjRbp9isluZ22cRm6xQHzZO5jHUQ9hCEPRTy3tnVNcz4vnQjavT9ehv79bbVIb8oSRR+/XSMz41g5tver7fxeQE7lNNOH//3yyG6vWiu7YxLe9A/NwK0go7ubhgp3fPOyn69vdCxThKFvf2mEWHXGvQg7KHZOtXZBeM1jkKcdvpTbycIe1p2KEmi8K96a+HtXqY16PN4a76P9uvtqbehc6y7/Wim70yT0Bb0VtCxcmZlEoMoRhD2Jn6+CWPdCrpa29cW9GleOBtNM14mjPUgimdSgk1KW9BDjf/pZTRNSEwIOqD3NdcWdE4l3s2kpUds0DgPosmvYzot7dOLNF+93kB3F87pPE5g0O+5TMaMTyYBzH1Zw00Y9CUhJwyJKR/BA0DW07fiRFvQTVv0Y7riFOOV0xiwi3LZjLa2tQV9XguW7qtpxqu0mp9hTyYjpdC6c9MW9JKfn/jt2DZSCqwUcxM/34Sx9os5O2t0RwpUSgVdzS+VjcrKVCHRPdZSCnyx7mtrH9B8MLpRWWGtfov0RIZpbVRWtNXqm9WS1r05YMCsy1cPy8YcLJkm57n4XbU0s+09+rKy8LHerK4acTymPeiOFHj0ZQUlX/8Bk0kqpQK2fv9gpnvCdKwXETwpBb56WDbmdTViV+pIgc3qKsp+DgczWn+9rAp5DxtrxbmVdM5ZAE87/bmMtTw7HljEea93YUTQU4W8h8d573ylW38Qo9ePjFqvMWsZ10HGlfAyDgp5b2Ef8Fwc6yDsIY6Ticc657mQUiCXzRhRpoxiVNBTw7PhzXjLu+8yrmPF7Jf2Gp1oERh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZIVRQW8BQK8fLbgrRNNJbriIwdWgK7y+7UlEJur34+GNBK8u33c16ALHANAfxPPtFdGMDeLrM3sl6ArqNcDShZZLkihEUQIAeLq18ery/Vf36Ge7/R736LREOr0BAEAJ8WbU/VeCnv419PvR+V8Ikek63WHQhVKvRt0/enpR4WcACC2+3ictl/OsiqsHosA1QRdCvASAdtibU7eIZqf3W/XR/vrR+stRjxkZdJnIFwDLF1oOraCb3vzf6x4zMuhbW2vHAH4EgGbrdOYdI5qVJFEIziqPJEl+uO5x1y4BUIl6AQBB2ONenYx1HHSGNxR+/sNW9fV1j7s26E+3Nl6lB6Xcq5OJoijBUWsYdKXU7k2PvXFRV/rkIOydT98QmaJxFA5vKPw86kOii24M+tmT/wYA9eYJ17+QMcJO/3xKMVHJ89sef+syXSdxdgG0oyj57S+ISKMoSlA/PAEAKKjvb6rNU2KcDb+rHTwTUvwdAKoPVuAXs1N1lGhSSaLwz3ob/X4EJcSbp48ebI/zvLFOvHi6tfFKQX0PAPXDE9brpE3jKER/uOCw7cbyu3GfN9YePfV+r/ECwJ+kFNisriLruXfrJdEU6ocnF+fM/2OckiV1p6ADwPsPjVcQ+FZKgfW1IssYmrskUWgchechh8Cfv360/uIu27jzOaOOcr4D8FOSKNQPTy5+/Eo0c2lNPk3Ih0+bUFrGAEAx76H6YAVSTrw5oivCTh/1w/Np7bZK1B9vmy+/zlTJ/Mfe4XMF9V8AwFKGZuVyqaKEeKPieOcuNfllU++C39bq28JxXgilvgGAfDaDtVIe+Vxm2k2TZZJE4TjooBV0L344+TcncXbPFhpObGa1xru9g10B8RcAq8Aw8P5Klnt4ulUUJWiH3X8LuBLiDeLk+aSlymUzLaprtaNyLOMfcFa7A8OSppj3UCx4yGczrOMJwPBkiW4vQjvspfPiqT0I7E5ywHmTuaSuVjsqRzJ6LiB2ADy+eJ/nucg4Ep7nABju+el+i+IEgyhGkij0+zF6g2jUuqmfIPDiujOEpjX33evbWn1bSrmjhHiW1vFEGH4j3CsIvHRi5+W0NfhtFl5HvKsdPJNSbidIygLiCRSeLLoPtHhKDM/OF0K8dmLn9dbW2ge9PSIiIiIiIp3+H/yNcCHjpRNmAAAAAElFTkSuQmCC","e":1},{"id":"image_3","w":216,"h":260,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAEECAYAAABKq/oNAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAeX0lEQVR4nO2dX3Ybx5XGv6puNEAIAkGR4vAokQnO2H41ZwXiDuysIM4GJjnZQJIV2LOCaHZg74DeAfwqKQFgOxoOBRIgBDXxp7tqHtAFNWmA+NdV1Q3c3zl+oAii22R/qFu37ncvQBAEQRAEQRAEQZiC2b4BItu8ql+ecodXpZSnDKwKieq010kmzzl4RwhRc+HWTk72OkZv1BIkMGIh6vV2JUBwCo6ziZAYXqz6fpKxH5mU50KIl5+fHNaSu9N0QQIjfsXr+rsz5rAqJE4hcQqGUwC7017LOYOXc+DlHHDGUMi7v3pNEAoEgUAQCgxHIYaj8P5LmgzsWy74y01b2UhgW0y93q6GTngahXenkrEqk/KLWa8v5F24DofrcBTy7lhUfPlHSAgJvz9CfxDA748ghFTf6krIb1zhfrspQiOBbQEqvOOcn0rI03nhnevwyarkec7kax0osXW6fQShUP/cBcMfP/3k4KWWixqEBLZhqPBOSlllkp0tGt4pEU0L8UzR84d3hSbxgyOdr7K8mpHAMkq93q4GCKpR0mFueBcXUiHvwnXHoV4a6XT76Lzvqy+7UsgvPzt5em7xllaGBJZy7oV31Sjp8GB457ocBc/VHt7pZDgK0Wr7HxMiDH/IYshIAksR0ZnSaSy8qwI4nvbatIV3OhBC4vrmFj1/OP6HDIqMBGaBVcK7uIjSHN7p4PrmFt3eYPxFxkRGAtPM6/q7s3vh3cykQzy8c92PmTxinABptf3xFxkSGQksIe6UDM0J7wBMzpHiKfFVzpS2iVbbn4SLQoj/zEIFCP1Fl+ReeFeVjJ1SeGeOy6sP8PsjAOg6wjlOewqfBPYAy4R3KumgwjuVDieSRQiJi1ZPZRe///T44Cvb9/QQJDD8qiL8FMAp5oR3d6odKLwzynAU4u3l+/EXDL/79JOD7+ze0Wy26qlYtiL8zh7J+5gSJ+wTO4xufnp8ULV8OzPZWIGtWhEer3Yg0osQEr/8X3dcKJzirGLmBXa/IhwLhnfrVoQT9oml7lO7imXmyUpzRThhj5/+9ybVq1gq46BpFeEhwl0GBonIOxR9NFB4t92UH+XHezGJrwC8tH0/97G6gi1r+MtSRThhhiAU+OWiCwBwhHNycrLXsHtHdzH2UR+J6SyWdHgRIgQkwCKdMzlenTalIpzQj3o2hqMQoROeIWWrmFaB1evtiuDia8HwdSjDL1R0Ny2829SKcEI/paKH65vbVIaJWp7mer1dDXn41xDh7wGARcIq5F0UPJfCOyJRYh/KZxZvYyqJ7sGUsAD8Xv1bIe+iVPRQLOQoHU5oo/GvcUli2vZhia1gr5vv/hoi/DOAx8B42S6X8rR3IoxQyLvoDwIECKoAGpZvZ8LaAqvX29XAEd+p7F8h7+LJ7g4JizCKl3PQHwQAxxmAc8u3M2Etgb2uvzsLefg9kyhzzvBkdwelopfUvRHEwqj9fFTNkxpWFtibn1pfQ+LvwPjT43D/ESUtCGuoiEkyVrV6I/dYSWBxcZWKHg72isneFUEsiRLYQ4UKNlh6ySFxEWmEczaJoF7VL1MTJi4lsNf1d2ckLiKtuO74ceYOz57A6vV2lXH2PUDiItJJwRvveKSUVbt38pGFBRay8CWAspdz8GR3R98dEcSKqBWMSXZm904+spDA/tG8+hMYXnDOcLj/iCoyiFQyOXtl06ds2mCuwOr1dkVC/g0AKo8LlIonUkusuOG4Xm9XbN6LYq5aQh5+C6BcyLsol/IGbokgVkeJLECQikTHgwKr19tVRIW7lccFE/dDEGuhBMZ5OjKJDwosqowf20zIp0VkALWFkUhHJnGmwKIY9ncArV5EdpgsBBLpXsFCJ/wKQJmayBBZQqXqH+o4ZpLZIeLYfk2JDSJTuA6fHCNFOQSrPLQH+xIAijs5Q7dCEMmgEh2hE1oPE6cK7HX93RmASQdcgsgSE+uKlOkUWOQKpdWLyCRpMl9OFZi6MbL9E1kkTebLqQJTN0bhIZFFVNY7DebL6StYrIENQWQRtTiofIK1+7B5cSL7jIIQg2GIwTDAYBggFOMuswXPRd5zsFPIIeea32q4LkcQCjCHVY1fPH4fNi9OZAchJPqRiAbDAKNA4HY8jHwq8e+Vih72K0XkPXOPW8Eb90m0bb4kgRG/wu+PEAQhRoGA3x9hMAzGM7hWpOcP0fOH2K8UsV8x44T3PNUEx675kgS2xdwP70aBwGAYaLveVcfHKAhxdPBY2zUUkwQds1uTSALbAuLhXRAI9IfBg+GdTrq9AXKuo30lix0x7dbr7crJyV5H6wVnQALbMOKrUTzUSxNXHR+loqd9T6bmhkXmy3OtF5vBrP/DJoDj4Sikw+aUMoqEcxvtkXSHd0lzef0Bz492tV5DCSwyX55rvdgMpgtMogGG4yAUJDDLpCm8S5Lb/gijINSawo+ZL63tw6YKTDJ5zsBeDIchigWqRzRFfCVKa3iXJD1/iL2yvhaAhbwLvAcg7XWZmiowxlgDEuhnKOTIEvHwLp7J2zZu+yOtAkuD+XL6ChbKBuMMwQZ/eppCnSOp8G7dM6VNItT8e1DmSyEk6vV21cbky6kC++zk6fmbZgtBSAJblG0L77KCGswXmS8bpq8/M08qGfuRSflFfxBQ0W8MlXRQ4d28kiHCLkpgkfnyO9PXn6kcJmUDwBfDUbi1AlMr0WAYUningYKB2sTJ3DBL5svZKxhkjYF9uQ1hYjy8ix/UEnrJe/qPgGKexnQJjDFWgwSGo9Dk/Whl2YpwQh+cM5SK+juWxaKvY+0Xm8JMgTmhUwt5mFmBJV0RTiTLXnnH2JQe1xl7w17X3519dvL03MhF1bVnfePkZK/xptmCEBJBKFLbPsB0RTixPjmXaz3/uo+Xc6yZLx/eZUr8AIYXQZAOgakUOIV32YVzhmeHZaMz5rycA78/stJO+2GBMTQAvLCdqu/2+pGXiBIPWYZzhudHu0adzcBH86UNgT24LDGwGgBrB86jIETzbQcXrR6JK+PsFHI4flYxLi7ArvnyQYEJIWqAnUziYBig+bZD+6mMUyp6+O3RLp4f7VppfgP82nxp8toPfpy4cGshzGcShZD4+eKGsn4ZIudyuK6DYiGHnMuR91wrq9UsCvlxExzT5ssHfwMnJ3udN83WDYBdk+bLf112SVwpZqeQQ8Fz4UZCKniu0aTFKkzCxHFb+HNj1537CokaGF6YMl/6/RFlB1NC3nPvrEZ5z7EW5q1LrF991eh1573AtPmy073Vfg3iLpwz5D13Et6pUG+TsGW+nCsw0+bLnj80cp1tZefeHikL4V0STKIvw+bLuQIToahxzo2YL30KDRPjbmiX7fAuCThnE/Plq/rl6ecnhzUT150rsM9PDmvKfCmE3IpPuyyhwjvVC34Tw7ukUN4w7vAqgHQIDPhovtxmb1gaUOFdznUmmTz6wFscG+bLhdRC5kuz3A/v1NfEetgwXy62ghkyXzpb9mkcD+/UmRKFd/qwYb5c7GNR4Bwcf9Fd0ZGPQp5NPGSOJxrioR5hDhvmy4UE5sJthAjRH+hP1ZeKHrq9gfbr6CJ+jkThXfpQ7bRNmS8X+ssr8yUA7ebL/UoxEwKj8C6buA432q9+8Y9WQ+bLnOtgr7yDdooqOuIrEYV32UaZLyXMTL5cXGAMNRgyX+5XihPnsknSXhFOrI9p8+XCTw8Da0hII9YV5Xz9+eJGm8iyWBFOrE+sZCpdAhNC1BhnxtzNSmRXHX+tcJHCOyJObHuza6Jf/cICs2G+5Jzh6ZNHqJQLuOr46PnDmSn8bagIJ5IhZr6sQnO/+oUFFpkvrUy+zLnOZHC23x9BCInBMJgIicI7YhlMmi+X28FHky9tjpZVq1Kp6Fm5PpF9YiVTVd3XWirfLpk8B0Bzw4hMowQmmf6axKUExhhrADT5ksg2kxVMyi90X2spgYlw3MaNVjAiyyjzJQC8ql9qXcWWEphygSrzJUFkFbWKReZLbSxd8yQZ+xHYrLFGxPahhv9F5kttLC0wJqW1br8EkRSuG7Vxk+xM53WWX8EgG4C9fvUEkQSxfvVVnddZvixejA/maAUjsowp8+XSAnPhNgAYMV8ShE5UouN1/d2ZrmssLbCoOPIGoDCRWI5REMLvj+78ZzMbrcLEyHyp5xor/VTUr344ClMx+ZJIH8rPFwRiMnh+lpjynou9cgHlUsHoPZowX64msMh8aapfPZFe4nOx43Oyl32Pi1YPVx0fzw7LxkyusX716VrBTJoviXQhhMRNr4+eP0x8Cs4oEGi+7eDooGRkNVOpep3my5XiOzX5kvZg28VVx8c/f7nGu+sPWkdMXbR66Pb62t5fcd98qeMaKwlMtbuiFWw7EEKi+baDq45vLClxef0Bo0D/86XS9ZH5MnHWyVA0AUrXbzpqnK/pBkRCSFx1fO3Xmfgax+bLxFldYHJstaYwcbP512XX2iD6bm+gfRWLTb7Usg9bWWBkvtx8ur2+9XG+ugcyxsyXVR3vv3I+lDFWMzn5clsRQk7OkdSZUpycy1Es5LRk3UyEaPPo+UPslXe0vb9u8+XKAhOhaHDOKdGRIPFzJL8/QhCEc8+UbjEOpS6vP2CvvIP9SjGxe1n2PEsHupMqnDO4DkcQCi2TL1cWmJp8KYSkyZdLMoqEcxtVO6iD2nVQSYGeP8Szw8dr935My6xsE/s/1x0LjDv8FAlPvlzryJwmX87nfsmQ7j3NYBig+baD42eVtURmIkW+CCY+uAueqyZfVpN+77VUEZkvSWC4WzK0aHinCyEk3l6+x/Oj3ZUf0DSEhwCMlE3pNF+ut4JBNhjYVu3D4uHdKAgxGIbW0tgPMRgGaHdvE9uT2aJgQGCxfvXVpN97vbuPJl9u6lnYMhXhaeSq42OvvLPSKpZzOdIwQOqRgQazsSa6x/V6u3JystdJ6r3XEpjqV5/1ao4kKsLTyk2vv1Kaexya2R2EqI4gTKAmXwYIEh3Mt5bAon71NwB2dU++TAJ1pqTCOxXqbTKrniOVih7eXX/QcEeL82/RPAIT6Jp8uX6Am1LzpUo0DIZhJsO7pFj1A0QNa7f1AbRX3jHqNdRlvlxfYCkxXyqfUrc3SGXSIYvsV4r45eLG+HXLpTyePnlk9Jq6zJfJCEzata70/CEuWu+3coXSSbGQMz4ve6+8Y1xcwB3z5Ysk33ftmE6G4z6JtgR20XqPt5ddEpcmnj55hHIpr/06paKH42cVK+ICxnswlW1N0ny59gr22cnT8zfNlhXbykXrPbo9u5mutJPEQa0afpjU71pNIy14LvKeE432tT/W18s5iU++TOoUrwnguD8IjFV09PwhiWsBktoXHx08RqmYx7vr3lJHGPlIRCppkuYZ2UpgSU6+TEoNNQDHplYxISQuWu+NXCvrJBnelYoeSsUnk4Y38exsPhrjWyzk7gyezxI6zJeJ/AYkZI2BfWlqH3bT69OeawF2ooc9acZC27wRvjrMl4kcXDHGjE5codBwPpwzHB2UbN9GplDbmyTNl4kITISiAZgTGJ1zzefoYH1P2DaiwsSk+tUnIjDlAlXmS534G17atC5q5drEEM4EE+uKw6pJvF9ytU0SPwDUK9EmO4Ucnh/tGu/xvknEJl9Wk3i/5HbADA0AL0ym6olxxflO1PSG5gSsj+epJjjJmC8TU4IyX+pO1efc9BQUm0adI43PlsYHtdQLJVliky8TSdUnt9QYMl/mXAecs41O08dFFD+oJfQTM1/uJmG+TExgJs2XpaK3Ean6+yVDrutQmJcCkjRfJiawuPlyOArjnwSJUy4VMieweJnQTiFH4V2KUQJLwnyZbDYiMl8GodAqsGIhZ9UM+BD3w7sslgxtO2ofJiHX3ocl+5c3aL78zWEZ//zl2tpeLB7euZGIKLzbDGLmy+q675W8wAyZLzlneH60i58vbrSLLEsV4cT6JGm+TFRgMpQNxs31Scx7Lp4f7eKi1UukfCrn8kmigcK77UWZL4WQqNfb1ZOTvcbK75XgfVkxXyqRtbu3aHdvF17NVKKBwjtiGsobFjrhKdYwXyb+8az61Zus6OCcYb9SxH6leMerpHCi/RKFd8SiKIFJKU8BfLfq+ySuACZlAxb71W+qV4kwS1Lmy8TrjiRkDaDRskS2Scp8mbjATJsvCUIHSZkvExeYEzokMGIjSMJ8mbjAVEpTCElhIpFpJvOb1zBf6vF+RObLYEMmlBDbyaTcb4122noENjZfZn6sEbHdKPNl6gTGwCiTSGSeJMyXWgQmhKBEB5F57psvV3kPLQJz4ZLAiI1Apesj8+XSaBFYZLO+AUhkRLaZhInjfvXL/3yC93IXQ+ZLIvvE52KryaRqwIRyNOwUctgtFYy7wGMlU9WVfj65W7mLZPKcgVmffEmkh/hc7Pjg+Yd/RmAUDNHzh3h3/QH7lSL2yjvGhLau+VKbwBhjDUjcqWontgchJHr+YDIjO6n2DlcdH91eH88Oy0a8epPoa0XzpbYmg2ryJR02bxejIMRF6z3e/HSFi1YP7e5t4r1TRoHAzxc3RmYUcM4mq+Wr+uXSiQ5tAvvs5Ok5QGdh20S310fzbcdIxy8hpLHRwWoV4w6vLvuzWtvkSsZ+BKiiYxvo9vq4aPWMNiEaBQJXHV/7dSbWFbl8lymtAovMl5Sq33B6/hAXrZ6Va7e7txgFep+vSdHvCuZLvSsYmS83njSM8+35Q63vPzkLw/IlU3onKYhxV1Rawczh90fo9vq46vi46vhod2+1zlS76vjW5wToFlis9cXxsj+rNc/pwm2ECElgGoifI8UPamfBOUOp6GG/Uky06c9Nr5/Ye62KiWyi63AEocDr+rszlcBb6Oc03hNOTvYab5qtifkyttQSCyKERP+eiFZJewsh0e0N0O0NJh241sXvj6yvXgCMZRKDUCxtvtR/UifxAxheBAEJbB7xMiE/qnbQ8fBcdXwMhgGODh6vVRGRxtkAuvByzjjUXtIbpl9gUb96mnz5kVEQYjAM76xKpge79/whLq97ODp4bPS6WWVV86X2J56BNSTkVu7DkgrvdNHtDZD3XOyVd2zfylrsGKh1jZVMpUtgQoga4/pHy9rmoYrwNHPV8a1UqSeJiUazse3N7jL96rULTE2+3JQVbJWK8DQjhMRNr7/SKpaWedmmOjkX8i76gwABgioW7FevXWDR5MsmgGPdky+TJB7eBYFItCI8bfT84UoCMxGazaNcyhubNXDPfHm+0M9ou5s4Eg2w9Aosq+FdUqz6wZFzHeQ919oKzjnD4ZOSsevFSqaqi/6MEYEp82UarCvKpzROg4eZDu+SRAi50j5sr1ywUoeoBjCa3DvG+tUvnOgwIrA0mC+FkEvPENsm+sNgJed5uVTATW9gNHxW4jI9HHGygi3Rr97ILlWE4zZutlawwTBA8207FXVzaWWdhMVvDsvGEh7lUh7//tsnViaPrmK+NPJb+fzkcFJVb/oBHwwD/Hxxs1V7qlVYJ1HAOcNvNa4oO4Uc9itFnPx2b+3qk3VZ1nxp7GNATb40OZhPCGlkSHrWSSIbmHMdPD/anVTwr/YePBo4794ZPJ8mCp671ORLYwKzMfny8tqswzarJHWOxDnD0yePUCkXcNXx0fOHU3//PBrpW4hEpAbPZwE3CoWZZGcLvV7nzcSRkDUG9qWpio5REBrpDZF1OGfYLRUSfc+c60xqHEf3jjwKnpvpqpFYv/rqIq83dxRv2HzZ6dr3KWWB/UpR6wOfi1Yn9V+WxQUsb740JjAXbgMw1wCn59PqNY9S0ct8oa8NVKJjkcmXxgQWFUfeAGZ6dFDW8GHynktWlRVRYSLnfG6q3my1poSR8zCdPSg2gb3yDo6fVTIfrtliUtEBWZ33WrMCG5svqU+iJcqlPI6fVfD0ySPbt5JpljFfGj0ON2W+LFg45U8bec+9M5kk69m7NLGM+dLok2jKfKlKWrbhDCzn8sk5UvygltDHMuZLo3+Jz06enr9ptoyk6ouFnPZ+eaZRK5EbCYlWJXssar608VHXBHCsuwlOuVTIrMDuh3c5l6euZGjb8XLOOJcwx3xpXmCR+VJ3mFgqelbNgIugSoZUeJelkqFtZ9HJl8YFZtJ8eXRQQvNtR/t1FmHn3h6Jwrtss6j50rjAGGM1U+bL8WFqyajjNh7epbUinFifRc2XxgUmQtHgnBurSSxHhaxJiyzLFeHE+nDOJv3qX9UvT5Xn8T7GBfb5yWFN9atftQ/EspRLBeQ9F5fXH1aytscTDXSmRChcdyww7vBTAOkQGGDHfJn3XDw/2p2M95nmVbpv+FNfE8Q0YubL6qzXWHl6mJQ1GDZfKpRtQuH3R5QGJ1ZiEfOlnRUMssHAUtHtl/ZNxKrESqaqs15jp/dxZL7c9H71xGYTa6J7XK+3K9NeY0Vgps2XBKELJbIAwdTzMCsCM22+JAhdzDNf2huPEZkv07API4hVmWe+tCewyHw5HJLAiOwyyYLPMF9aExgDawC0ghGbgeQsPUkOYGy+BGgPRmSbeTWJ1gT22cnTc4BWMCLbzCuZsz0DtAlQup7YXGwLjMJEYqOxKjAJSal6ItPMWxysCowxRgIjMs3EmS/xw7TvWxWYCEUDIIER2UXIh1sDWhWYcoEq8yVBZA1VKCGZPJ/2fdtJjsnSSqsYkUVUbxnGxoUT97EvMDZu2kipeiKLqOfWCZ3zad+3LjAJ2QAoVU9kj9gUn+as9tnWBUbmSyKr+LcTgc0chm5dYC5cGmlEZBK1gkkh0yuwk5O9DiLzJSU6iKwQ60rWVHW107AuMAAfJ19SmEhkhE63DwBgYN8+9Lp0CIzMl0SG6PlDtRh0ueAvH3ptugRGISKRcoSQk9VLQn4TbXFmkgqByXCcqieBEWmn2xuo1etnV7gPhodASgSmNom0ByPSTH8QoPN+vHqB4b/mrV5ASgQWQeZLIrUIIdFq++rL7z/95GBmaj5OmgRGmUQitVy0eurZbDrC+XrRn0uNwMh8SaSVVttXz2VXCPHVIqGhIjUCI/MlkUZabR89fwgAkEJ+OWvQ3ixSM/zKCZ1ayEMSGJEKhJC4vP7wMSfA8IeHKjZmkZoVTFUjCyFpH0ZYZTgKcdHqKXF1wfC7Tz85eLnKe6VGYAAm5stJnwOCMEy3N8BFqxffc71YNGM4jXQJjMyXhCX6gwBvL9/j+uZ2XMQr8YMjnONl91z3Sc0eDAAYWE1C/p5CRMIU6vA49qHeZWB/+Y/q/twqjUVIlcCEEDXG0zFalthchJDw+yN0e4P7z9r/OML50zJp+HmkSmAu3FqIcSZRCDm37zdBLEIQCgxHIYbDEH5/NO0D/H8c4fx1lu1/HVL3BL/+6arGpPzicP8RDSgnlqY/CDAchR9FFX1Y30cy9iOXeMkFf5nkinWfVK1gAMCkPAfwhX87IoERM5mIaBiiPwwQBOLh4x2JH8BQA0PNCZ3vdIoqTuoEJoR4yTn/Y6xjD7HFCCExHIXoD4I7q9IsJGM/MikbErLGGKs5oVPTEfotSupCRAB402w1ABwf7BVRKnq2b4cwxH0RzQrvIm4gUZNMnjPGGjKUjVUqLXSTuhUMGPc5kJDfdHsDEtgGEg/vlJAWCO8aDKwmhKi5cGumQrx1SeUKVq+3KyEPmwDKRwelj4OmiUxxP7wLQjGviKAJoKbCOxGKxroHvbZJpcAA4HXz3V8Z2F+8nINnh49t3w4xh4mIAoH+MFgovFNJh7SGd0mQWoHFV7Enuzsol/K2b4nA3TOleDp8JlF4JyEbEDjPUniXBKkVGAD8o3n1Jwn5DecMzw4fw3XSVTq5yajwLr5H2rbwLglSLTDg48FzIe/i6KBk+3Y2komIlgzvGFhDCFHb1PAuCVIvsHq9XQ15+COAcrmUx5PdHdu3lFkme6R71Q6ziM6UarHwrmHzTCmLpF5gAPDmp9bXkPg7ANDZ2Hzi4Z0S0dzwTqIRnSlReJcgmRAYALxptr4F8EeARBbnfni3aMkQhXdmyIzAAOBNs/USwO+B7RPZiuFdQ0LWKLyzR6YEBtwV2abuyRatCI+Ih3cNEYoahXfpIXMCA+6Gi4W8i4O9YiZT+KtWhKvwbtvOlLJIJgUGTBIf/w2gzDlD5XEhtYfR8fAuixXhxOpkVmAA8Kp+ecoc5yWT8gsA8HIOnuzuWK1d3MSKcGJ1Mi0wRVTx8TcAZWAcNpaKntYkyDZVhBOrsxECA8a1iwEP/sTA/gzgMQBwzlAs5FDcyaHguSv1+Fi3IpzCu+1mYwSmiAntawDH8e95OQdezoHr8Jlh5BLZu62pCCdWZ+MEFudV/fKUc/61ZOxM7dNWYssrwonV2WiBxanX25UAwSk4zhhYBRKnU18YCYlKhgiCIAiCIAiCIAgiW/w/zQ1m2VyA5iUAAAAASUVORK5CYII=","e":1},{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"magnify","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":42,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":90,"s":[8]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":121,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":134,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":164,"s":[53]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":183,"s":[53]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":219,"s":[53]},{"t":272,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[333.752,339.42,0],"to":[-26,-25,0],"ti":[-4.333,25,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":42,"s":[177.752,189.42,0],"to":[4.333,-25,0],"ti":[-25.667,-23.333,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[359.752,189.42,0],"to":[25.667,23.333,0],"ti":[4.667,-23.333,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":121,"s":[331.752,329.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":134,"s":[331.752,329.42,0],"to":[-28.333,4.667,0],"ti":[28.333,-4.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":164,"s":[161.752,357.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":183,"s":[161.752,357.42,0],"to":[0,-24.333,0],"ti":[-28.667,3,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":219,"s":[161.752,211.42,0],"to":[28.667,-3,0],"ti":[-28.667,-21.333,0]},{"t":272,"s":[333.752,339.42,0]}],"ix":2},"a":{"a":0,"k":[87.194,86.29,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"glass 2","parent":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"glass","parent":1,"td":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"paper","tt":1,"refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[125,125,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":0,"nm":"paper","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"paper_1","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[263.625,231.897,0],"ix":2},"a":{"a":0,"k":[92.771,120.853,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"paper_2","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[214.478,258.49,0],"ix":2},"a":{"a":0,"k":[107.933,130,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}]}]'),layers:[{ddd:0,ind:1,ty:0,nm:"not_found 2",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[250,250,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,w:500,h:500,ip:0,op:273,st:0,bm:0}],markers:[]},jge={class:"dcode-card animate-slide-up"},Uge={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 dark:border-primary-900/50 rounded-t-xl relative z-30"},Wge={key:0,class:"mb-3 flex items-center gap-2"},Hge={class:"font-bold text-sm text-white dark:text-neutral-100 uppercase tracking-wider"},qge={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between items-start gap-4"},Kge={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 xl:max-w-[15vw] md:max-w-[20vw] max-w-[30vw]"},Gge={class:"relative w-full sm:w-64"},Yge={key:0,class:"relative"},Zge={class:"flex flex-col h-full"},Xge={key:0,class:"flex-1 overflow-y-auto py-4"},Jge={class:"grid grid-cols-1 gap-4 px-1"},Qge={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4"},Vge={class:"grid grid-cols-2 gap-3 w-full"},e0e={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},t0e={key:0,class:"absolute top-0 left-0 right-0 z-[30] h-0.5 overflow-hidden bg-zinc-100 dark:bg-zinc-800"},n0e={class:"dcode-table w-full"},i0e={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},r0e=["onClick"],o0e={key:0,class:"flex items-center justify-center w-full"},s0e=["checked","indeterminate"],a0e={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},l0e={class:"flex items-center justify-center w-full"},c0e={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},d0e={key:0,class:"px-3 py-3"},u0e={key:1},f0e=["colspan"],h0e={class:"flex flex-col items-center gap-2"},m0e={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},p0e={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},g0e={key:0,class:"flex items-center justify-center w-full"},y0e=["checked","onChange"],b0e=["href","target"],v0e={key:0,class:"text-[10px]"},w0e={key:0,class:"px-3 py-0.5 !text-center"},_0e={key:0,class:"flex items-center justify-center gap-1.5"},k0e={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},x0e=["colspan"],E0e={key:1,class:"px-4 py-3 bg-zinc-50/50 dark:bg-zinc-800/30 border-t border-neutral-200 dark:border-neutral-700 flex flex-col sm:flex-row items-center justify-between gap-4 w-full"},C0e={class:"flex items-center gap-4"},S0e={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},A0e={class:"text-neutral-900 dark:text-neutral-100 font-medium"},T0e={class:"text-neutral-900 dark:text-neutral-100 font-medium"},P0e={class:"text-neutral-900 dark:text-neutral-100 font-medium"},B0e={class:"flex-shrink-0"},N0e={class:"space-y-4"},D0e={class:"text-gray-600 dark:text-gray-400"},M0e={key:0,class:"absolute inset-0 z-10 bg-white/50 dark:bg-neutral-900/50 flex items-center justify-center backdrop-blur-[1px]"},R0e={class:"flex flex-col items-center gap-2"},I0e={class:"text-xs font-medium text-neutral-500"},O0e={key:1,class:"mb-2 p-3 bg-amber-50 dark:bg-amber-900/20 border border-amber-100 dark:border-amber-900/30 rounded-lg flex items-center gap-3"},L0e={class:"p-1.5 bg-amber-100 dark:bg-amber-900/40 rounded-md text-amber-600 dark:text-amber-400"},F0e={class:"flex flex-col gap-0.5"},$0e={class:"text-[10px] font-bold uppercase tracking-wider text-amber-500/70 dark:text-amber-400/50"},z0e={class:"text-xs text-amber-700 dark:text-amber-300 leading-relaxed font-medium transition-all"},j0e={class:"flex items-end gap-2"},$h=o.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},page:{},startIndex:{},endIndex:{},remotePagination:{type:Boolean},totalItems:{},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{default:()=>({})},socketEndpoint:{},socketRequest:{},socketParams:{default:()=>({})},configKey:{},tableConfig:{},dynamicColumns:{type:Boolean,default:!1},searchApiEndpoint:{},enableQuickSearch:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},ignorePermissions:{type:Boolean,default:!1},userPermissions:{default:null},permissionChecker:{type:Function,default:void 0},permissions:{default:void 0},checkPermission:{type:Function,default:void 0},menuPermissions:{default:()=>[]},dummyMode:{type:Boolean,default:!1},baseUrl:{default:void 0},controlled:{type:Boolean,default:!1},tokenCores:{default:()=>[]},selectedTokenCore:{default:void 0},filters:{},accept:{}},emits:["update:search","update:sort","update:page","update:perPage","update:startIndex","update:endIndex","create","export","action","update:selection","selection-change","navigate","search","reset","refresh","update:filters"],setup(e,{expose:t,emit:n}){var tb,Dm,nb,wr,ua,ib,fo,rb,fa,ob,yl,Mm,Yc,sb;const i=e,r=n,s=o.getCurrentInstance(),a=o.inject("externalApi")||{},l=o.inject("dynamicFormContext",null),{apiUrl:c}=a,{locale:d,t:f}=Yn.useI18n(),h=(H,V)=>f(H,V),m=o.computed(()=>d.value==="kr"||d.value==="ko"?"데이터 필터":(d.value==="id","Filter Data")),g=o.computed(()=>d.value==="kr"||d.value==="ko"?"데이터를 필터링할 검색 조건을 입력하세요.":d.value==="id"?"Masukkan parameter pencarian untuk memfilter data.":"Enter search parameters to filter the data."),v=a.socket||a.managedSocket,y=v==null?void 0:v.on,A=v==null?void 0:v.off,C=(v==null?void 0:v.send)||(v==null?void 0:v.emit),M=(v==null?void 0:v.connect)||(v==null?void 0:v.init),B=o.computed(()=>{var H;return v?typeof v.isConnected=="function"?v.isConnected():typeof v.isConnected=="boolean"?v.isConnected:((H=v.isConnected)==null?void 0:H.value)!==void 0?v.isConnected.value:!0:(l&&(l.tableRowFormData||(l.tableRowFormData=o.reactive({}))),!1)}),N=o.inject("hasActionAccess",void 0),j=o.inject("userPermissions",null),W=o.inject("baseUrl",""),P=o.computed(()=>{var ie,he,_e;const H=i.selectedTokenCore||(l==null?void 0:l.selectedTokenCore);if(typeof(H==null?void 0:H.address)=="string")return H.address;if(typeof i.baseUrl=="string"&&i.baseUrl!=="")return i.baseUrl;const V=l==null?void 0:l.resolvedBaseUrl,le=typeof V=="object"&&V!==null&&"value"in V?V.value:V;if(typeof le=="string"&&le!=="")return le;const me=i.tokenCores&&i.tokenCores.length>0?i.tokenCores:(l==null?void 0:l.tokenCores)||[],xe=((ie=ae.value)==null?void 0:ie.idTokenCore)||((he=i.tableConfig)==null?void 0:he.idTokenCore);if(xe&&Array.isArray(me)&&me.length>0){const ze=String(xe),qe=me.find(Qe=>String(Qe.id)===ze);if(qe!=null&&qe.address)return qe.address}return W||((_e=window.CONFIG)==null?void 0:_e.apiUrl)||""});let E={query:{},params:{},path:""};try{const H=bs.useRoute();H?E=H:(nb=(Dm=(tb=s==null?void 0:s.appContext)==null?void 0:tb.config)==null?void 0:Dm.globalProperties)!=null&&nb.$route&&(E=s.appContext.config.globalProperties.$route)}catch(H){console.warn("useRoute not available, using fallback",H)}let k={back:()=>console.warn("Router back() not available"),push:H=>{console.warn("Router push() logic called from fallback:",H),typeof H=="string"&&H.startsWith("/")&&(globalThis.location.href=H)}};try{const H=bs.useRouter();H?k=H:(ib=(ua=(wr=s==null?void 0:s.appContext)==null?void 0:wr.config)==null?void 0:ua.globalProperties)!=null&&ib.$router&&(k=s.appContext.config.globalProperties.$router)}catch(H){console.warn("useRouter not available, using fallback",H)}const $=o.ref(""),I=o.ref(i.page||1),O=o.ref(i.perPage),q=o.ref({key:"",direction:"asc"}),X=o.ref([]),oe=!i.controlled&&!i.dummyMode&&!!((rb=(fo=i.tableConfig)==null?void 0:fo.endpoint)!=null&&rb.apiUrl||(ob=(fa=i.tableConfig)==null?void 0:fa.endpointSection)!=null&&ob.apiUrl||(Mm=(yl=i.tableConfig)==null?void 0:yl.endpointTable)!=null&&Mm.apiUrl||(sb=(Yc=i.tableConfig)==null?void 0:Yc.endpointGlobal)!=null&&sb.apiUrl||i.apiUrl||i.apiModule),ue=o.ref(oe),te=o.ref(0),re=o.ref(null),ge=o.ref(!0),ce=o.ref(!0),se=o.ref(!0),z=o.ref([]),G=o.ref([]),ee=o.ref(!1),K=o.ref(!1),Y=o.ref(!1),F=o.ref(!1),_=o.ref(null),b=o.ref(i.filters?{...i.filters}:{});o.watch(()=>i.filters,H=>{H&&(b.value={...H})},{deep:!0}),o.watch(b,H=>{r("update:filters",H)},{deep:!0});const R=o.reactive({});o.watch(b,H=>{H&&(console.log("[DataTable][watch filters] Triggered. newVal:",JSON.stringify(H)),Object.keys(R).forEach(V=>{V in H||delete R[V]}),Object.assign(R,H),console.log("[DataTable][watch filters] After sync. parentFormDataWrapper:",JSON.stringify(R)))},{deep:!0,immediate:!0}),o.provide("parentFormData",R),o.provide("rootFormData",R);const S=o.ref([]),T=o.reactive({}),D=o.computed(()=>!S.value||S.value.length===0?[]:[...S.value].sort((H,V)=>(H.seq||0)-(V.seq||0))),Z=H=>{const V={paths:new Map,models:new Map},le=me=>{me.forEach(xe=>{if(xe.model){const he={field:xe,path:xe.model};V.paths.set(xe.model,he);const _e=V.models.get(xe.model)||[];_e.push(he),V.models.set(xe.model,_e)}const ie=xe.fields||xe.props&&xe.props.fields;Array.isArray(ie)&&le(ie)})};return le(H),V},J=o.computed(()=>Z(D.value)),fe=o.computed(()=>({sections:[{fields:D.value}]})),ae=o.ref(null),we=o.ref(null),pe=o.ref(null),ke=o.reactive({}),be=o.reactive({}),Se=o.reactive({}),ve=o.computed(()=>{var et,it,Et,Bt;if(!ae.value)return!1;const H=ae.value,V=H.isViewOnly??((et=H.propsActionGlobal)==null?void 0:et.isViewOnly)??((it=H.propsActionCustom)==null?void 0:it.isViewOnly);if(V!=null)return!!V;const le=(H.permission||"").toUpperCase(),me=(H.actionType||((Et=H.propsActionGlobal)==null?void 0:Et.actionType)||((Bt=H.propsActionCustom)==null?void 0:Bt.actionType)||"").toUpperCase();if(["EXPORT","SUBMIT","CREATE","UPDATE","EDIT","DELETE","APPROVE","REJECT","PROCESS","EXECUTE"].includes(le)||["EXPORT","SUBMIT","CREATE","UPDATE","EDIT","DELETE","APPROVE","REJECT","PROCESS","EXECUTE"].includes(me))return!1;const he=(H.key||H.action||"").toLowerCase(),_e=le==="VIEW"||le==="READ"||le==="DETAIL",ze=me==="READ"||me==="VIEW"||me==="DETAIL",qe=he==="detail"||he==="view"||he==="read"||he==="show"||he.startsWith("view_");let Qe=_e||ze||qe;if(!Qe&&Be.value&&Be.value.length>0){const qt=["DCodePdfViewer","DCodeWorkflowDiagram"];Be.value.every(Ft=>qt.includes(Ft.component))&&(Qe=!0)}return Qe});o.watch(ke,H=>{l!=null&&l.tableRowFormData&&Object.keys(H).forEach(V=>{l.tableRowFormData[V]=H[V]})},{deep:!0,immediate:!0});const Be=o.computed(()=>{if(!ae.value)return[];const H=ae.value;return[...H.fieldActionCustom||[],...H.fieldActionGlobal||[],...H.field||[]].map(le=>{const me=le.key||le.model,xe=le.props||le.propsFieldGlobal||le.propsFieldCustom||{};return{...le,props:{...xe,items:Se[me]||xe.items||[]}}})}),Ee=o.computed(()=>Z(Be.value)),Oe=o.computed(()=>({sections:[{fields:Be.value}]})),Ae=o.computed(()=>d.value),{isFieldVisible:Re,isFieldRequired:De,isFieldDisabled:Ie,isFieldReadonly:Ce,isFieldHidden:ne,resolveFieldLabels:ye,resolveFieldLength:Me,getFilteredItems:Ke,applyCalculations:$e,getNormalizedData:He,resolveDefaultValue:rt,resolveSectionGridClass:Ve,resolveFieldColumnClass:Fe}=Kv({formData:ke,errors:be,fieldMap:Ee,rawItemsCache:Se,activeSchema:Oe,locale:Ae,parentFormData:(l==null?void 0:l.formData)||R,rootFormData:(l==null?void 0:l.formData)||R,activeTableAction:ae,activeTableRow:we,tableRows:o.computed(()=>Uc.value||X.value||i.data||[])}),{validateField:Ue}=fS({formData:ke,locale:Ae,errors:be,fieldMap:Ee,activeSchema:Oe,isSectionVisible:()=>!0,isFieldVisible:H=>Re(H),isFieldRequired:(H,V)=>De(H,V),resolveFieldLength:(H,V)=>Me(H,V)}),at=(H,V)=>{ke[H.model]=V;const le=Ue(H,V,ke);le?be[H.model]=le:delete be[H.model]},{isFieldVisible:nt,isFieldRequired:Tt,isFieldDisabled:fi,isFieldReadonly:hn,resolveFieldLabels:Jt,resolveFieldLength:cn,getFilteredItems:vn,resolveFieldColumnClass:gr}=Kv({formData:b,errors:{},fieldMap:J,rawItemsCache:T,activeSchema:fe,locale:Ae}),Do=o.computed(()=>{if(Di.value||S.value.some(le=>{if(!nt(le))return!1;const me=b.value[le.model],xe=cn(le);return!!(Tt(le)&&(me==null||me==="")||me&&(xe==null?void 0:xe.minLength)!==void 0&&String(me).length<Number(xe.minLength))}))return!0;const V=S.value.filter(le=>nt(le));return!!(V.length>0&&V.every(me=>!b.value[me.model]))}),Bi=o.ref([]),Ic=o.computed(()=>{var le,me,xe;if(!((le=ae.value)!=null&&le.dialogConfig))return((me=ae.value)==null?void 0:me.label)||h("common.actions");const H=ae.value.dialogConfig;return(d.value==="kr"||d.value==="ko"?H.titleKR||H.titleEN:d.value==="id"?H.titleID:H.titleEN)||((xe=ae.value)==null?void 0:xe.label)||h("common.actions")}),ki=o.computed(()=>{var V;if(!((V=ae.value)!=null&&V.dialogConfig))return null;const H=ae.value.dialogConfig;return d.value==="kr"||d.value==="ko"?H.descriptionKR||H.descriptionEN:d.value==="id"?H.descriptionID:H.descriptionEN}),pt=o.computed(()=>{var me,xe,ie,he,_e;if((Be.value||[]).some(ze=>ze.component==="DCodePdfViewer"||ze.component==="DCodeWorkflowDiagram"))return"95vw";if(!((me=ae.value)!=null&&me.dialogConfig)&&!((xe=ae.value)!=null&&xe.openDialog))return 450;const le=String(((he=(ie=ae.value)==null?void 0:ie.dialogConfig)==null?void 0:he.layoutColumns)||((_e=ae.value)==null?void 0:_e.layoutColumns)||"1").toUpperCase();return le==="FULL"||le==="1"||le==="ONE"?450:800}),yr=async(H,V=!1)=>{console.log(`[prefetchDialogFieldItems][START] ${H.key||H.model}`,{force:V});const le=H.propsFieldGlobal||H.propsFieldCustom||H.propsFilters||H.props||{},me=le.endpointComponent||le.endpointReference||le.endpoint;if(!(me!=null&&me.apiUrl)){console.log(`[prefetchDialogFieldItems][EXIT] No apiUrl for ${H.key||H.model}`);return}const xe=H.component||"";if(["DCodeWorkflowDiagram","DCodeStaticImage","DCodeTimelineWithIcons"].includes(xe)){console.log(`[prefetchDialogFieldItems][EXIT] Skipping for component type ${xe}`);return}const he=H.key||H.model;if(!V&&Se[he]){console.log(`[prefetchDialogFieldItems][EXIT] Already in cache for ${he}`);return}const _e=me;if(!(_e!=null&&_e.apiUrl)){console.log(`[prefetchDialogFieldItems][EXIT] Resolved ep has no apiUrl for ${he}`);return}!i.baseUrl&&!_e.apiUrl.startsWith("http")&&console.warn(`[prefetchDialogFieldItems][WARNING] No baseUrl provided for ${he}, attempting relative fetch.`);try{const ze=P.value;!ze&&!_e.apiUrl.startsWith("http")&&console.warn(`[prefetchDialogFieldItems][PROCEED] No explicit baseUrl found for ${he}, letting apiUrl wrapper handle relative path.`);const qe=vo(_e.apiUrl,ze);console.log(`[prefetchDialogFieldItems][FETCHING] ${he}.
1582
- BaseUrl: ${ze||"NONE"}, Final: ${qe}`);const Qe={page:1,perPage:100};if(Array.isArray(_e.keyParam)){let qt=!1;if(_e.keyParam.forEach(wt=>{let Ft="",St="";if(typeof wt=="string")Ft=wt,St=wt;else if(typeof wt=="object"&&wt!==null){const Kt=Object.entries(wt)[0];Kt&&(Ft=Kt[0],St=Kt[1])}if(!Ft||!St)return;const Mt=He(ke)[St];Mt==null||Mt===""?qt=!0:Qe[Ft]=Mt&&typeof Mt=="object"?Mt.id??Mt.code??Mt.value??Mt:Mt}),qt){Se[he]=[];return}}const et={..._e.config||{}};_e.accept&&(et.headers||(et.headers={}),et.headers.Accept=_e.accept,et.headers.accept=_e.accept);const it=await c(qe,_e.apiMethod||"GET",Qe,et),Et=(it==null?void 0:it.data)||it;console.log(`[prefetchDialogFieldItems][RESPONSE] ${he}`,Et);let Bt=[];Array.isArray(Et)?Bt=Et:Et&&(Bt=[Et]),console.log(`[prefetchDialogFieldItems][STORE] ${he} items count: ${Bt.length}`),Se[he]=Bt}catch(ze){console.error(`[prefetchDialogFieldItems] Error fetching items for ${he}:`,ze),Se[he]=[]}};o.watch(ke,(H,V)=>{K.value&&($e(),Be.value.forEach(le=>{const me=le.props||{},xe=me.endpoint||me.endpointReference;Array.isArray(xe==null?void 0:xe.keyParam)&&xe.keyParam.length>0&&yr(le,!0)}))},{deep:!0});const Tu=()=>{Be.value.length&&Be.value.forEach(H=>{var le;const V=rt(H,ke);if(V!=null){const me=ke[H.model],ie=(H.props||{}).returnObject||((le=H.logic)==null?void 0:le.returnObject);(me==null||me===""||ie&&(typeof me=="string"||typeof me=="number")&&(typeof V=="object"&&V!==null))&&(ke[H.model]=V)}})};o.watch(Se,()=>{K.value&&Tu()},{deep:!0});const ai=o.ref([]),cl=o.ref(new Map),ym=o.computed(()=>Array.from(cl.value.values())),Mo=o.computed(()=>{var le,me,xe,ie,he,_e,ze,qe,Qe;const H=Ni.value.find(et=>["CHECKBOX","checkbox"].includes(et.type??""));return(H==null?void 0:H.keyCheckbox)||((xe=(me=(le=re.value)==null?void 0:le.endpointTable)==null?void 0:me.keyParam)==null?void 0:xe[0])||((_e=(he=(ie=re.value)==null?void 0:ie.endpointGlobal)==null?void 0:he.keyParam)==null?void 0:_e[0])||((Qe=(qe=(ze=re.value)==null?void 0:ze.endpoint)==null?void 0:qe.keyParam)==null?void 0:Qe[0])||"id"}),sa=()=>{const H=Ni.value.find(V=>["CHECKBOX","checkbox"].includes(V.type??""));return(H==null?void 0:H.keyPayload)||null},Pu=o.computed(()=>{const H=Mo.value,V=vr.value.map(le=>le[H]).filter(le=>le!=null);return vr.value.length>0&&V.length===0&&console.warn(`[DataTable] selectionKey "${H}" returned no IDs for ${vr.value.length} rows. Selection may not work.`),V}),Bu=o.computed(()=>new Set(ai.value.map(H=>String(H)))),Fy=o.computed(()=>{const H=Pu.value;if(H.length===0)return!1;const V=Bu.value;return H.every(le=>V.has(String(le)))}),T1=o.computed(()=>{const H=Pu.value;if(H.length===0)return!1;const V=Bu.value,le=H.filter(me=>V.has(String(me))).length;return le>0&&le<H.length}),P1=H=>{const V=H[Mo.value];return V!=null&&Bu.value.has(String(V))},$y=H=>{var me;const V=typeof H=="boolean"?H:((me=H==null?void 0:H.target)==null?void 0:me.checked)??!!H,le=Pu.value;if(V){const xe=Bu.value,ie=[...ai.value];vr.value.forEach(he=>{const _e=he[Mo.value];_e!=null&&!xe.has(String(_e))&&(ie.push(_e),cl.value.set(String(_e),he))}),ai.value=ie}else{const xe=new Set(le.map(ie=>String(ie)));ai.value=ai.value.filter(ie=>!xe.has(String(ie))),xe.forEach(ie=>{cl.value.delete(ie)})}},B1=(H,V)=>{var ie;const le=typeof V=="boolean"?V:((ie=V==null?void 0:V.target)==null?void 0:ie.checked)??!!V,me=H[Mo.value];if(me==null)return;const xe=String(me);le?ai.value.some(he=>String(he)===xe)||(ai.value.push(me),cl.value.set(xe,H)):(ai.value=ai.value.filter(he=>String(he)!==xe),cl.value.delete(xe))};o.watch(ai,H=>{var me;const V=sa();if(V){const xe={[V]:H};r("update:selection",xe)}else r("update:selection",H);r("selection-change",ym.value);const le=Fy.value||H.length>1;(me=G.value)!=null&&me.length&&G.value.forEach(xe=>{var ie;(ie=xe.fieldActionGlobal)!=null&&ie.length&&xe.fieldActionGlobal.forEach(he=>{var et,it;const _e=xe.endpoint||((et=xe.propsActionGlobal)==null?void 0:et.endpointPropAction)||xe.propsActionGlobal,ze=(it=_e==null?void 0:_e.keyParam)==null?void 0:it[0],qe=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(he.component);(ze&&he.model===ze||!ze&&/^(id|ids|idAuditTrail|idAppRequest)$/i.test(he.model))&&le&&(!qe||ze&&he.model===ze)&&he.model&&(ke[he.model]=H)})})},{deep:!0});const Nu=H=>{const V=(xe,ie,he)=>{if(!ie)return;const _e=ie.split(".");let ze=xe;for(let qe=0;qe<_e.length-1;qe++){const Qe=_e[qe];ze[Qe]||(ze[Qe]={}),ze=ze[Qe]}ze[_e[_e.length-1]]=he},le=(xe,ie)=>{if(Array.isArray(xe.condition)&&xe.condition.length>0)return xe.condition[ie%xe.condition.length].value;const he=["Active","Pending","Inactive","Success","Failed"];return he[ie%he.length]},me=(xe,ie,he)=>{var Qe,et,it,Et;if(["no","action"].includes(ie.key)||["ACTION","action"].includes(ie.type))return;const ze=(ie.type||"").toUpperCase(),qe=`Data ${ie.label} ${he+1}`;if(ze==="BADGE"||ie.condition){V(xe,ie.key,le(ie,he));return}switch(ze){case"CHECKBOX":V(xe,ie.keyCheckbox||"id",he+1);break;case"HYPERLINK":V(xe,ie.key,`Link ${he+1}`),(et=(Qe=ie.propsCustom)==null?void 0:Qe[0])!=null&&et.urlLink&&V(xe,ie.propsCustom[0].urlLink,`https://example.com/page/${he+1}`);break;case"CURRENCY":V(xe,ie.key,1e6+he*5e4);break;case"DATE":case"DATA":V(xe,ie.key,new Date(Date.now()-he*864e5).toISOString().split("T")[0]);break;case"DATETIME":V(xe,ie.key,new Date(Date.now()-he*36e5).toISOString());break;case"TEXT":(Et=(it=ie.propsCustom)==null?void 0:it[0])!=null&&Et.value?V(xe,`${ie.key}.${ie.propsCustom[0].value}`,qe):V(xe,ie.key,qe);break;default:V(xe,ie.key,qe)}};return Array.from({length:H}).map((xe,ie)=>{const he={id:ie+1,no:ie+1};return Ni.value.forEach(_e=>me(he,_e,ie)),he})},Oc=H=>String(H)==="true"||H===!0,On=H=>H&&typeof H=="string"&&H.trim()?H:void 0,Du=o.computed(()=>{var H,V,le,me,xe,ie;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiModule)||On((me=(le=re.value)==null?void 0:le.endpointTable)==null?void 0:me.apiModule)||On((ie=(xe=re.value)==null?void 0:xe.endpointGlobal)==null?void 0:ie.apiModule)||i.apiModule}),N1=o.computed(()=>{var H,V,le,me,xe,ie;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiAction)||On((me=(le=re.value)==null?void 0:le.endpointTable)==null?void 0:me.apiAction)||On((ie=(xe=re.value)==null?void 0:xe.endpointGlobal)==null?void 0:ie.apiAction)||i.apiAction}),D1=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiMethod)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.apiMethod)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.apiMethod)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.apiMethod)||i.apiMethod||"GET"}),dl=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiUrl)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.apiUrl)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.apiUrl)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.apiUrl)||i.apiUrl}),aa=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.accept)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.accept)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.accept)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.accept)||i.accept}),lo=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.socket)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.socket)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.socket)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.socket)||i.socketEndpoint||i.socketRequest}),Lc=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.socketParams)||((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.socketParams)||((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.socketParams)||((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.socketParams)||i.socketParams||{}}),ul=o.computed(()=>!!lo.value),an=o.computed(()=>{var H;return i.permissionBase||((H=re.value)==null?void 0:H.permissionBase)||""});function Cn(){console.log("[DataTable][loadConfig] Called. Existing filters keys:",Object.keys(b.value),"values:",JSON.stringify(b.value));let H=null;if(i.tableConfig&&(H=i.tableConfig),H){re.value=H,z.value=[],G.value=[],F.value=!1,H.headers?Bi.value=H.headers.map(ie=>{var Qe,et,it,Et,Bt,qt,wt,Ft,St,Mt;const he=(((Qe=ie.custom)==null?void 0:Qe.type)||ie.type||"").toUpperCase();if(ie.key==="action"||he==="ACTION"){Oc(ie.isHidden)&&(F.value=!0);const Kt=((et=ie.custom)==null?void 0:et.actionCustom)||((it=ie.custom)==null?void 0:it.action);if(Kt){const qn=Kt.map(Ct=>{const ut=Ct.propsActionCustom||Ct.props||Ct.propsActionGlobal||{},bi=Ct.propCustomMessage||{},li=Ct.type||ut.type||Ct.actionType||ut.actionType,Kn=Ct.buttons||Ct.propsCustom||ut.buttons||ut.propsCustom||[];return{key:Ct.key,id:Ct.id,permission:Ct.permission,type:li,buttons:Kn,propsCustom:Kn,labelID:ut.labelID||Ct.labelID,labelEN:ut.labelEN||Ct.labelEN,labelKR:ut.labelKR||Ct.labelKR,label:d.value==="kr"||d.value==="ko"?ut.labelKR||ut.labelEN:d.value==="id"?ut.labelID:ut.labelEN,tooltip:d.value==="kr"||d.value==="ko"?ut.tooltipKR||ut.labelKR||ut.tooltipEN||ut.labelEN:d.value==="id"?ut.tooltipID||ut.labelID:ut.tooltipEN||ut.labelEN,icon:ut.icon,variant:ut.variant||"ghost",bgColor:ut.bgColor,action:Ct.key||Ct.id||ut.actionType||ut.key,actionType:ut.actionType,route:ut.route,path:ut.path,targetBehavior:ut.targetBehavior||Ct.targetBehavior,keyRedirect:ut.keyRedirect||Ct.keyRedirect,borderStyle:ut.borderStyle,borderColor:ut.borderColor,rounded:ut.rounded,endpoint:ml(Ct),propsActionCustom:ut,_customMsg:bi,propCustomCondition:Ct.propCustomCondition||[],fieldMapping:Ct.fieldMapping||ut.fieldMapping||null,openDialog:Ct.openDialog??ut.openDialog??!1,dialogConfig:Ct.dialogConfig||ut.dialogConfig||null,layoutColumns:Ct.layoutColumns||ut.layoutColumns||Ct.layout||ut.layout,fieldActionCustom:(Ct.fieldActionCustom||[]).map(Pn=>{const Lr=Pn.propsFieldCustom||Pn.propsFieldGlobal||Pn.propsFilters||Pn.props||{};return{...Pn,props:{...Lr,items:Se[Pn.key]||Se[Pn.model]||Lr.items,endpoint:Lr.endpointComponent||Lr.endpoint}}}),condition:Ct.visibleRule||Ct.propCustomCondition||ut.visibleRule||ut.propCustomCondition||null,requireConfirm:Ct.requireConfirm||ut.requireConfirm||!1,confirmTitle:d.value==="kr"||d.value==="ko"?bi.titleKR||ut.confirmTitleKR||"확인":d.value==="id"?bi.titleID||ut.confirmTitleID||"Konfirmasi":bi.titleEN||ut.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?bi.messageKR||ut.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?bi.messageID||ut.confirmMessageID||"Apakah Anda yakin?":bi.messageEN||ut.confirmMessageEN||"Are you sure?",isHidden:Ct.isHidden||ut.isHidden,routeBack:ut.routeBack,pathBack:ut.pathBack,triggerNavigation:Ct.triggerNavigation}});z.value.push(...qn)}return null}let ze;const qe=((Et=ie.custom)==null?void 0:Et.conditionBadge)||((Bt=ie.custom)==null?void 0:Bt.condition);return he==="BADGE"&&qe&&(ze=qe.map(Kt=>({value:Kt.value,label:d.value==="kr"||d.value==="ko"?Kt.labelKR||Kt.labelEN:d.value==="id"?Kt.labelID:Kt.labelEN,labelID:Kt.labelID,labelEN:Kt.labelEN,labelKR:Kt.labelKR,color:Kt.color||Kt.bgColor,variant:Kt.variant,logic:Kt.logic||Kt.conditionRule||null}))),{key:ie.key,label:(d.value==="kr"||d.value==="ko"?ie.labelKR||ie.labelEN:d.value==="id"?ie.labelID:ie.labelEN)||ie.label||ie.labelKR||ie.labelEN||ie.labelID,width:ie.width,align:ie.align,sortable:!["CHECKBOX","checkbox"].includes(he),type:((qt=ie.custom)==null?void 0:qt.type)||ie.type,condition:ze,keyCheckbox:(wt=ie.custom)==null?void 0:wt.keyCheckbox,keyPayload:(Ft=ie.custom)==null?void 0:Ft.keyPayload,propsCustom:(St=ie.custom)==null?void 0:St.propsCustom,isHidden:ie.isHidden,format:ie.format||((Mt=ie.custom)==null?void 0:Mt.format)}}).filter(ie=>ie!==null):Bi.value=[];const V=H.filters||H.filter;V&&Array.isArray(V)&&(S.value=V.map(ie=>({...ie,props:ie.propsFilters||ie.props||{}})),S.value.forEach(ie=>{b.value[ie.model]===void 0&&(b.value[ie.model]="")}),S.value.forEach(ie=>{var et;if(!((et=ie.logic)!=null&&et.optionsFilterRule))return;const he=ie.propsFilters||ie.props||{},_e=he.endpointComponent||he.endpointReference||he.endpoint;if(!(_e!=null&&_e.apiUrl))return;const ze=ie.key||ie.model;if(T[ze])return;const qe=P.value,Qe=vo(_e.apiUrl,qe);c(Qe,_e.apiMethod||"GET",{page:1,perPage:500}).then(it=>{const Et=(it==null?void 0:it.data)||it;T[ze]=Array.isArray(Et)?Et:Et?[Et]:[]}).catch(()=>{T[ze]=[]})}));const le=H.actionTableGlobal||H.actionGlobal||H.actionSection||H.actionGlobalStep||H.action;le&&Array.isArray(le)&&(G.value=le.map(ie=>{const he=ie.propsActionGlobal||ie.props||{},_e=ie.propCustomMessage||{},ze=ie.type||he.type||ie.actionType||he.actionType,qe=ie.buttons||ie.propsCustom||he.buttons||he.propsCustom||[];return{key:he.key,permission:ie.permission,type:ze,buttons:qe,propsCustom:qe,labelID:he.labelID||ie.labelID,labelEN:he.labelEN||ie.labelEN,labelKR:he.labelKR||ie.labelKR,actionType:ie.actionType||he.actionType||he.type||ie.permission,label:d.value==="kr"||d.value==="ko"?he.labelKR||he.labelEN||"Action":d.value==="id"?he.labelID||he.labelEN||"Action":he.labelEN||"Action",tooltip:d.value==="kr"||d.value==="ko"?he.tooltipKR||he.labelKR||he.tooltipEN||he.labelEN:d.value==="id"?he.tooltipID||he.labelID:he.tooltipEN||he.labelEN,icon:he.icon,variant:he.variant||"default",bgColor:he.bgColor,textColor:he.textColor,route:he.route,path:he.path,targetBehavior:he.targetBehavior||ie.targetBehavior,keyRedirect:he.keyRedirect||ie.keyRedirect,borderStyle:he.borderStyle,borderColor:he.borderColor,rounded:he.rounded,endpoint:he.endpointDialogActionSave||he.endpointDialogAction||he.endpointAction||he.endpointPropAction||ie.endpoint,propsActionGlobal:he,_customMsg:_e,fieldMapping:ie.fieldMapping||he.fieldMapping||null,visibleRule:ie.visibleRule||he.visibleRule||ie.propCustomCondition||he.propCustomCondition||null,openDialog:ie.openDialog??he.openDialog??!1,dialogConfig:ie.dialogConfig||he.dialogConfig||null,layoutColumns:ie.layoutColumns||he.layoutColumns||ie.layout||he.layout,requireConfirm:ie.requireConfirm||he.requireConfirm||!1,confirmTitle:d.value==="kr"||d.value==="ko"?_e.titleKR||he.confirmTitleKR||"확인":d.value==="id"?_e.titleID||he.confirmTitleID||"Konfirmasi":_e.titleEN||he.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?_e.messageKR||he.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?_e.messageID||he.confirmMessageID||"Apakah Anda yakin?":_e.messageEN||he.confirmMessageEN||"Are you sure?",fieldActionGlobal:(ie.fieldActionGlobal||ie.fieldActionCustom||ie.field||[]).map(Qe=>{const et=Qe.propsFieldCustom||Qe.propsFieldGlobal||Qe.propsFilters||Qe.props||{};return{...Qe,props:{...et,items:Se[Qe.key]||Se[Qe.model]||et.items,endpoint:et.endpointComponent||et.endpoint}}}),isHidden:ie.isHidden||he.isHidden,routeBack:he.routeBack,pathBack:he.pathBack}})),H.pagination!==void 0&&(ge.value=H.pagination),H.showQuickSearch!==void 0?ce.value=H.showQuickSearch:ce.value=!0,H.showRefresh!==void 0?se.value=H.showRefresh:se.value=!0;const me=[],xe=ie=>{Array.isArray(ie)&&ie.forEach(he=>{var qe,Qe,et,it;const _e=he.fieldActionGlobal||he.fieldActionCustom||he.fields||he.field||[];Array.isArray(_e)&&me.push(..._e);const ze=he.buttons||he.propsCustom||((qe=he.propsActionCustom)==null?void 0:qe.buttons)||((Qe=he.propsActionCustom)==null?void 0:Qe.propsCustom)||((et=he.propsActionGlobal)==null?void 0:et.buttons)||((it=he.propsActionGlobal)==null?void 0:it.propsCustom)||[];Array.isArray(ze)&&xe(ze)})};xe(H.actionTableGlobal||H.actionGlobal||[]),xe(H.actionTableLine||H.actionLine||[]),(H.headers||[]).forEach(ie=>{var he,_e;(he=ie.custom)!=null&&he.propsCustom&&Array.isArray(ie.custom.propsCustom)&&xe(ie.custom.propsCustom),(_e=ie.custom)!=null&&_e.actionCustom&&Array.isArray(ie.custom.actionCustom)&&xe(ie.custom.actionCustom)}),me.forEach(ie=>{yr(ie)})}}o.watch(()=>i.tableConfig,()=>{Cn()},{deep:!0,immediate:!0}),o.watch(d,()=>{const H=re.value;if(H&&(z.value.length&&(z.value=z.value.map(V=>{const le=V.propsActionCustom||{},me=V._customMsg||{};return{...V,label:d.value==="kr"||d.value==="ko"?le.labelKR||le.labelEN||"":d.value==="id"?le.labelID:le.labelEN,tooltip:d.value==="kr"||d.value==="ko"?le.tooltipKR||le.labelKR||le.tooltipEN||le.labelEN:d.value==="id"?le.tooltipID||le.labelID:le.tooltipEN||le.labelEN,confirmTitle:d.value==="kr"||d.value==="ko"?me.titleKR||le.confirmTitleKR||"확인":d.value==="id"?me.titleID||le.confirmTitleID||"Konfirmasi":me.titleEN||le.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?me.messageKR||le.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?me.messageID||le.confirmMessageID||"Apakah Anda yakin?":me.messageEN||le.confirmMessageEN||"Are you sure?"}})),G.value.length&&(G.value=G.value.map(V=>{const le=V.propsActionGlobal||{},me=V._customMsg||{};return{...V,label:d.value==="kr"||d.value==="ko"?le.labelKR||le.labelEN||"Action":d.value==="id"?le.labelID||le.labelEN||"Action":le.labelEN||"Action",tooltip:d.value==="kr"||d.value==="ko"?le.tooltipKR||le.labelKR||le.tooltipEN||le.labelEN:d.value==="id"?le.tooltipID||le.labelID:le.tooltipEN||le.labelEN,confirmTitle:d.value==="kr"||d.value==="ko"?me.titleKR||le.confirmTitleKR||"확인":d.value==="id"?me.titleID||le.confirmTitleID||"Konfirmasi":me.titleEN||le.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?me.messageKR||le.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?me.messageID||le.confirmMessageID||"Apakah Anda yakin?":me.messageEN||le.confirmMessageEN||"Are you sure?"}})),Bi.value.length)){const V=H.headers||[];Bi.value=Bi.value.map(le=>{var xe;const me=V.find(ie=>ie.key===le.key);return me?{...le,label:d.value==="kr"||d.value==="ko"?me.labelKR||me.labelEN||me.label:(d.value==="id"?me.labelID:me.labelEN)||me.label||me.labelID||me.labelEN,condition:(xe=le.condition)==null?void 0:xe.map(ie=>({...ie,label:d.value==="kr"||d.value==="ko"?ie.labelKR||ie.labelEN||ie.label:d.value==="id"?ie.labelID||ie.label:ie.labelEN||ie.label}))}:le})}});const Ni=o.computed(()=>{let H=[];return i.dynamicColumns||i.configKey||i.tableConfig?H=Bi.value:H=i.columns||[],H.filter(V=>!Oc(V.isHidden))}),co=o.computed(()=>F.value?!1:i.hasActions||Hn.value.length>0),Di=o.computed(()=>i.dummyMode?!1:!!(i.loading||ue.value)),Dn=o.computed(()=>!!Du.value||!!dl.value||ul.value||i.remotePagination),Lt=o.computed(()=>[]),Wn=H=>{var xe;if(!((xe=i.menuPermissions)!=null&&xe.length))return;const V=i.menuPermissions.find(ie=>E.path.startsWith(ie.path));if(!(V!=null&&V.actions))return;const le=H.toUpperCase(),me=V.actions.find(ie=>ie.code===le);return me==null?void 0:me.checked},Fc=(H,V,le)=>{let me=H(V,le);return!me&&le!==le.toLowerCase()&&(me=H(V,le.toLowerCase())),me},Mu=(H,V)=>Array.isArray(j)?[H,H.toLowerCase()].flatMap(xe=>[xe,`${V}_${xe}`,`${V}.${xe}`]).some(xe=>j.includes(xe)):!1,br=(H,V,le)=>{let me=Fc(H,V,le);if(me)return!0;if(E.path){const ie=E.path.split("/").find(Boolean)[0];ie&&ie!==V&&(me=Fc(H,ie,le))}return me||(V!==""&&(me=Fc(H,"",le)),me)?!0:Mu(le,V)},zy=H=>{if(!H)return!0;const V=Wn(H);if(V!==void 0)return V;const le=an.value,me=i.permissionChecker||N;if(me)return br(me,le,H);const xe=H.toUpperCase();return Lt.value.some(ie=>ie.code===xe)},$c=(H,V)=>{if(H.condition)try{return go.apply(H.condition,V)}catch(he){return console.warn("Row action jsonLogic error:",he),!1}if(!H.visibilityCondition)return!0;const{field:le,operator:me,value:xe}=H.visibilityCondition,ie=Qt(V,le);switch(me){case"equals":return ie===xe;case"notEquals":return ie!==xe;case"in":return Array.isArray(xe)&&xe.includes(ie);case"notIn":return Array.isArray(xe)&&!xe.includes(ie);case"greaterThan":return ie>xe;case"lessThan":return ie<xe;case"contains":return String(ie).includes(String(xe));default:return!0}},fs=o.computed(()=>{if(G.value.length===0)return[];const H=i.dummyMode||E.query.preview==="true"||E.query.dummy==="true";return G.value.filter(V=>{var le;if(V.isHidden===!0||V.isHidden==="true")return!1;if(V.visibleRule)try{const me=vr.value[0]||{};if(!go.apply(V.visibleRule,me))return!1}catch(me){console.warn("Header action visibility logic error:",me)}if(i.ignorePermissions||H||(le=re.value)!=null&&le.ignorePermissions||!V.permission)return!0;if(i.checkPermission){let me=i.checkPermission(V.permission);if(!me&&V.permission!==V.permission.toLowerCase()&&(me=i.checkPermission(V.permission.toLowerCase())),me!==void 0)return!!me}return i.permissions?i.permissions.includes(V.permission):!!zy(V.permission)})}),Hn=o.computed(()=>z.value.length===0?z.value:z.value.filter(H=>H.isHidden===!0||H.isHidden==="true"?!1:i.ignorePermissions||i.dummyMode||!H.permission?!0:i.checkPermission?i.checkPermission(H.permission):i.permissions?i.permissions.includes(H.permission):zy(H.permission))),Ro=H=>Hn.value.filter(V=>$c(V,H)),la=(H,V)=>{var xe;if(!H.dynamicColor||!H.colorCondition)return H.bgColor||"primary";const le=Qt(V,H.colorCondition.field),me=(xe=H.colorCondition.conditions)==null?void 0:xe.find(ie=>ie.value===le);return(me==null?void 0:me.bgColor)||H.bgColor||"primary"},zc=H=>{const V=(H||"left").toLowerCase();return V==="center"?"justify-center":V==="right"?"justify-end":"justify-start"},bm={ToggleLeft:Ne.ToggleLeft,SquarePen:Ne.SquarePen,Trash2:Ne.Trash2,Eye:Ne.Eye,CheckCircle:Ne.CheckCircle,Plus:Ne.Plus,Download:Ne.Download,RefreshCw:Ne.RefreshCw,Search:Ne.Search,SlidersHorizontal:Ne.SlidersHorizontal},jc=H=>H&&(Es(H,tn)||bm[H])||null,vr=o.computed(()=>i.dummyMode?Ni.value.length>0?Nu(5):[]:M1.value),fl=o.computed(()=>{if(i.dummyMode)return 5;if(i.controlled||i.remotePagination){if(Y.value&&Dn.value)return te.value;if(i.totalItems!==void 0)return i.totalItems}return Dn.value&&X.value.length>0?te.value:Uc.value.length}),Ru=o.computed(()=>fl.value===0?0:(I.value-1)*O.value+1),vm=o.computed(()=>{const H=I.value*O.value;return Math.min(H,fl.value)}),Qt=(H,V)=>{if(!H||!V)return;if(V.includes(".")){const xe=V.split(".").reduce((ie,he)=>ie&&ie[he],H);if(xe!=null)return xe}if(V in H)return H[V];const le=V.split(".").reduce((xe,ie)=>xe&&xe[ie],H);if(le!=null)return le;const me=V.split(".");if(me.length>1)for(let xe=1;xe<me.length;xe++){const ie=me.slice(xe).join("."),he=ie.split(".").reduce((_e,ze)=>_e&&_e[ze],H);if(he!=null)return console.log(`[DataTable resolvePath] Prefixed path "${V}" resolved via suffix fallback "${ie}" to value:`,he),he;if(ie in H)return console.log(`[DataTable resolvePath] Prefixed path "${V}" resolved via suffix fallback key "${ie}" to value:`,H[ie]),H[ie]}return le},Iu=(H,V)=>{var me,xe;const le=Qt(H,V.key);if((V.type==="TEXT"||V.type==="text")&&((xe=(me=V.propsCustom)==null?void 0:me[0])!=null&&xe.value)){const ie=V.propsCustom[0].value;if(le&&typeof le=="object")return Qt(le,ie)??Qt(H,`${V.key}.${ie}`)??le;const he=Qt(H,`${V.key}.${ie}`);if(he!=null)return he}return le},Uc=o.computed(()=>{let le=(Dn.value&&(X.value.length>0||Y.value)?X.value:i.data||[]).filter(me=>!me||typeof me!="object"?!1:Ni.value.some(xe=>{if(["no","action"].includes(xe.key)||["ACTION","action","CHECKBOX"].includes(xe.type||""))return!1;const he=Qt(me,xe.key);return he!=null&&he!==""}));if(!Dn.value&&$.value){const me=$.value.toLowerCase();le=le.filter(xe=>Ni.value.some(ie=>{const he=Iu(xe,ie);return he==null?!1:String(he).toLowerCase().includes(me)}))}return!Dn.value&&Object.keys(b.value).length>0&&(le=le.filter(me=>Object.entries(b.value).every(([xe,ie])=>{if(ie==null||ie==="")return!0;const he=Qt(me,xe);if(he==null)return!1;const _e=String(he).toLowerCase(),ze=String(ie).toLowerCase();return _e.includes(ze)}))),le}),Ou=o.computed(()=>q.value.key?[...Uc.value].sort((V,le)=>{const me=Qt(V,q.value.key),xe=Qt(le,q.value.key);if(me===xe)return 0;let ie=0;return typeof me=="number"&&typeof xe=="number"?ie=me-xe:ie=String(me).localeCompare(String(xe)),q.value.direction==="asc"?ie:-ie}):Uc.value),M1=o.computed(()=>{if(Dn.value)return Ou.value.map((le,me)=>({...le,no:(I.value-1)*O.value+me+1}));const H=(I.value-1)*O.value,V=H+O.value;return Ou.value.slice(H,V).map((le,me)=>({...le,no:H+me+1}))}),Dt=(H,V)=>{var ie,he,_e,ze,qe,Qe,et,it,Et,Bt,qt,wt,Ft,St,Mt,Kt;const le=Qt(H,V.key);if(le==null||le==="")return"-";const me=((he=(ie=V.propsCustom)==null?void 0:ie[0])==null?void 0:he.value)||((qe=(ze=(_e=V.custom)==null?void 0:_e.propsCustom)==null?void 0:ze[0])==null?void 0:qe.value);if((V.type==="TEXT"||V.type==="text")&&me){if(le&&typeof le=="object")return Qt(le,me)||"-";const qn=V.key.split(".").reduce((li,Kn)=>li&&li[Kn],H);if(qn&&typeof qn=="object")return Qt(qn,me)||"-";const Ct=V.key,ut=Ct.includes(".")?Ct.split(".").pop():Ct,bi=Se[Ct]||(ut?Se[ut]:void 0)||((Qe=l==null?void 0:l.rawItemsCache)==null?void 0:Qe[Ct])||(ut?(et=l==null?void 0:l.rawItemsCache)==null?void 0:et[ut]:void 0)||(l==null?void 0:l.rawItemsCache)&&((it=Object.entries(l.rawItemsCache).find(([li])=>li.endsWith(Ct)||Ct.endsWith(li)||ut&&li.endsWith(ut)))==null?void 0:it[1]);if(Array.isArray(bi)&&bi.length>0){const li=bi.find(Kn=>Kn&&(String(Kn.id)===String(le)||String(Kn.code)===String(le)||String(Kn.value)===String(le)||String(Kn.name)===String(le)));if(li)return Qt(li,me)||"-"}}if(["DATE","date","DATETIME","datetime","DATA","data"].includes(V.type||"")){const qn=((qt=(Bt=(Et=V.custom)==null?void 0:Et.propsCustom)==null?void 0:Bt[0])==null?void 0:qt.value)||V["custom.propsCustom[0].value"]||((wt=V.custom)==null?void 0:wt.format)||((St=(Ft=V.propsCustom)==null?void 0:Ft[0])==null?void 0:St.value)||(typeof V.format=="string"?V.format:null);if(qn)return R3(le,qn);const Ct=(V.type||"").toUpperCase()==="DATETIME";return Jc(le,Ct?"datetime":"long")}if(V.type==="CURRENCY"||V.type==="currency"){const qn=((Kt=(Mt=V.propsCustom)==null?void 0:Mt[0])==null?void 0:Kt.value)||"IDR";return Rb(le,qn)}return V.format?V.format(le):le},Ir=o.computed(()=>Dn.value?Object.values(b.value).some(H=>!!H):!!$.value),_n=[10,25,50,100],wm=()=>{Dn.value&&(b.value={...b.value,keyword:$.value},I.value=1,ei())};let Wc;const _m=()=>{i.enableQuickSearch&&(clearTimeout(Wc),Wc=setTimeout(()=>{wm()},500))};let Hc;const hs=()=>{clearTimeout(Hc),Hc=setTimeout(()=>{Dn.value&&ei()},500)};o.watch($,()=>{i.enableQuickSearch&&Dn.value&&_m()}),o.watch(()=>i.baseUrl,H=>{H&&(console.log(`[DataTable] baseUrl resolved to ${H}. Re-triggering prefetch for actions.`),G.value.forEach(V=>{(V.fieldActionCustom||V.fieldActionGlobal||V.field||[]).forEach(me=>yr(me))}),z.value.forEach(V=>{(V.fieldActionCustom||V.fieldActionGlobal||V.field||[]).forEach(me=>yr(me))}))});const ei=async(H=!1,V=!1)=>{var xe,ie,he,_e,ze,qe,Qe,et;if(i.dummyMode||!Dn.value||ue.value&&!H&&X.value.length>0||!Du.value&&!dl.value&&!lo.value)return;const le=i.data&&i.data.length>0,me=I.value===1&&Object.keys(b.value).length===0&&!$.value;if(!(!V&&le&&me&&!X.value.length&&!ue.value))try{H||(ue.value=!0);const it={page:I.value,perPage:O.value,...b.value,...i.apiParams};if(!Object.keys(it).some(wt=>wt.toLowerCase()==="id"||wt.toLowerCase().endsWith("id"))){const wt=((xe=E==null?void 0:E.params)==null?void 0:xe.id)||((ie=E==null?void 0:E.query)==null?void 0:ie.id)||(typeof window<"u"?new URLSearchParams(window.location.search).get("id"):null);wt&&(it.id=wt)}const Bt=((he=re.value)==null?void 0:he.endpointTable)||((_e=re.value)==null?void 0:_e.endpointSection)||((ze=re.value)==null?void 0:ze.endpoint)||((qe=re.value)==null?void 0:qe.endpointGlobal);if(l!=null&&l.resolveKeyParams&&Array.isArray(Bt==null?void 0:Bt.keyParam)){const wt=l.resolveKeyParams(Bt.keyParam);Object.assign(it,wt)}$.value&&(it.keyword=$.value),Object.keys(it).forEach(wt=>{(it[wt]===""||it[wt]===null||it[wt]===void 0)&&delete it[wt]});let qt;if(Du.value)qt=await c(Du.value,N1.value,it);else if(dl.value){let wt=dl.value;if(i.baseUrl&&typeof i.baseUrl=="string"&&typeof wt=="string"&&!wt.startsWith("http")){const St=i.baseUrl.replace(/\/$/,""),Mt=wt.startsWith("/")?wt:`/${wt}`;wt=`${St}${Mt}`}const Ft={...((et=(Qe=re.value)==null?void 0:Qe.endpoint)==null?void 0:et.config)||{}};aa.value&&(Ft.headers||(Ft.headers={}),Ft.headers.Accept=aa.value,Ft.headers.accept=aa.value),qt=await c(wt,D1.value,it,Ft)}else if(lo.value&&C){const wt={...it,...Lc.value};qt=await new Promise(Ft=>{let St=!1;try{C(lo.value,wt,Mt=>{St||(St=!0,Ft(Mt))})}catch{St||(St=!0,Ft(null))}setTimeout(()=>{St||(St=!0,Ft(null))},2e3)})}ms(qt)}catch(it){console.error("DataTable fetch error",it),ue.value=!1}},qc=H=>{i.dynamicColumns&&Array.isArray(H==null?void 0:H.columns)&&(Bi.value=H.columns.map(V=>({key:V.key||V.field||V.name,label:V.label||V.header||V.name,width:V.width,align:V.align||"LEFT",sortable:V.sortable!==!1,type:V.type,condition:V.condition,format:V.format})))},hi={data:(H,V)=>{var le;return H.totalData||(H.maxPage?H.maxPage*V:(((le=H.data)==null?void 0:le.length)||0)*(H.maxPage||1))},users:H=>{var V;return((V=H.users)==null?void 0:V.length)||0},items:H=>{var V;return H.total||H.totalItems||((V=H.items)==null?void 0:V.length)||0},list:H=>{var V;return H.total||((V=H.list)==null?void 0:V.length)||0},rows:H=>{var V;return H.count||H.total||((V=H.rows)==null?void 0:V.length)||0},result:H=>{var V;return H.total||H.count||((V=H.result)==null?void 0:V.length)||0}},ms=H=>{if(Y.value=!0,H==null){ue.value=!1;return}if(H){qc(H);const V=Object.keys(hi).find(le=>H[le]&&Array.isArray(H[le]));if(V){X.value=H[V];const le=hi[V](H,O.value);te.value=le}else Array.isArray(H)?(X.value=H,te.value=H.length):H&&H.status===!0&&(H.data===null||H.data===void 0)?(X.value=[],te.value=0):Object.keys(H).length>0&&console.warn("DataTable: Unknown response format",H)}ue.value=!1};o.onUnmounted(()=>{clearTimeout(Wc),clearTimeout(Hc)});const km=()=>{Object.keys(b.value).forEach(H=>{b.value[H]=""}),r("reset"),xm()},xm=()=>{I.value=1,r("search",b.value),ei()},Em=(H,V)=>H==null||V===void 0||V===null?!1:typeof H=="string"&&typeof V=="string"?H.toLowerCase().trim()===V.toLowerCase().trim():H==V,jy=H=>{if(typeof H=="boolean")return H?"true":"false";if(typeof H=="object"&&H!==null){const V=H,le=["code","id","name","value","val","label","key","status","statusRequest.name","description"];for(const me of le){const xe=Qt(V,me);if(xe!=null)return String(xe).toLowerCase().trim()}return""}return typeof H=="string"?H.toLowerCase().trim():String(H??"").toLowerCase().trim()},Cm=(H,V)=>{const le=String(V).toLowerCase();return H?["true","1","yes","active","aktif","AKT","enabled","on"].includes(le):["false","0","no","inactive","non active","NAK","disabled","off"].includes(le)},R1=(H,V,le,me)=>{if(H.logic||typeof H.value=="object"&&H.value!==null)try{return go.apply(H.logic||H.value,V)}catch(ie){return console.warn("Badge logic error:",ie),!1}const xe=jy(le);if(Em(H.value,xe)||typeof le=="object"&&le!==null&&["code","id","name","value","val","label","key","status","statusRequest.name","description"].some(he=>Em(H.value,Qt(le,he))))return!0;if(typeof le=="boolean")return Cm(le,H.value);if(me.includes(".")){const ie=me.split(".").slice(0,-1).join("."),he=Qt(V,ie);if(he&&typeof he=="object"&&["code","id","name","value","val","label","key","status","statusRequest.name","description"].some(ze=>Em(H.value,Qt(he,ze))))return!0}return!1},Kc=(H,V)=>{var _e;const le=Qt(H,V.key),xe=[...Array.isArray(V.condition)?V.condition:[],...Array.isArray(V.propsCustom)?V.propsCustom:[],...Array.isArray((_e=V.custom)==null?void 0:_e.propsCustom)?V.custom.propsCustom:[]].find(ze=>R1(ze,H,le,V.key)),ie=ze=>typeof ze=="object"?(ze==null?void 0:ze.name)||(ze==null?void 0:ze.code)||"-":ze,he={variant:(xe==null?void 0:xe.variant)||"secondary",class:"",label:ie(le),color:xe==null?void 0:xe.color};return xe&&(xe.labelEN||xe.labelID||xe.labelKR)&&(he.label=d.value==="kr"||d.value==="ko"?xe.labelKR||xe.labelEN||xe.labelID:d.value==="id"?xe.labelID||xe.labelEN:xe.labelEN||xe.labelID),he},Rt=(H,V,le)=>{var me,xe,ie,he;return((xe=(me=H.custom)==null?void 0:me.props)==null?void 0:xe[V])??((ie=H.props)==null?void 0:ie[V])??((he=H.custom)==null?void 0:he[V])??H[V]??le},I1=(H,V)=>{var me,xe;return[...Array.isArray((me=V.custom)==null?void 0:me.propsCustom)?V.custom.propsCustom:[],...Array.isArray(V.propsCustom)?V.propsCustom:[],...Array.isArray((xe=V.custom)==null?void 0:xe.buttons)?V.custom.buttons:[],...Array.isArray(V.buttons)?V.buttons:[]].filter(ie=>$c(ie,H))},Or=H=>{q.value.key===H?q.value.direction=q.value.direction==="asc"?"desc":"asc":(q.value.key=H,q.value.direction="asc"),r("update:sort",q.value)},hl=H=>{if(H===I.value)return;I.value=H,Dn.value&&ei();const V=(H-1)*O.value+1,le=H*O.value;r("update:page",H),r("update:startIndex",V),r("update:endIndex",le)},Uy=H=>{O.value=H,I.value=1,Dn.value&&ei();const V=1,le=H;r("update:perPage",H),r("update:page",1),r("update:startIndex",V),r("update:endIndex",le)},Wy=()=>{$.value="",b.value=i.filters?{...i.filters}:{},I.value=1,r("reset"),r("refresh"),r("search",b.value),i.controlled||ei(!1,!0)};o.watch(()=>i.data,()=>{X.value=[],Y.value=!1},{deep:!0});const Sm=H=>{var me,xe;if(!H)return H;const V=Ni.value.find(ie=>ie.key===H.model),le=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect"].includes(H.component);if((xe=(me=V==null?void 0:V.propsCustom)==null?void 0:me[0])!=null&&xe.value&&le){const ie={...H},he=H.props||H.propsFieldGlobal||H.propsFieldCustom||{};return ie.props={...he,returnObject:!0},ie}return H};function ml(H){if(!H)return null;const V=H.propsActionCustom||H.props||H.propsActionGlobal||{},le=[H.endpointPropAction,V.endpointPropAction,H.endpointAction,V.endpointAction,H.endpointDialogActionSave,V.endpointDialogActionSave,H.endpointDialogAction,V.endpointDialogAction,H.endpoint,V.endpoint];for(const me of le)if(me&&typeof me=="object"&&me.apiUrl&&me.apiUrl!=="")return me;return le.find(me=>me&&typeof me=="object")||null}const Hy=H=>{var V,le,me,xe;if((H.route||H.keyRedirect&&H.targetBehavior==="IN_PLACE"&&H.path)&&!i.dummyMode){if(H.path&&H.route){const _e=H.route.startsWith("/")?H.route:"/"+H.route;sessionStorage.setItem(`layout_${_e}`,H.path)}const ie=H.path?{code:H.path}:{},he=H.fieldMapping||((V=H.propsActionGlobal)==null?void 0:V.fieldMapping)||((le=H.propsActionCustom)==null?void 0:le.fieldMapping)||((me=H.props)==null?void 0:me.fieldMapping);he&&typeof he=="object"&&Object.entries(he).forEach(([_e,ze])=>{if(typeof ze=="string"){const qe=ke[_e];qe!==void 0&&(ie[ze]=qe)}}),r("navigate",{route:H.route,path:H.path,query:ie,targetBehavior:H.targetBehavior}),H.targetBehavior!=="IN_PLACE"&&(k==null||k.push({path:H.route,query:ie}))}else{const ie=ml(H);ie!=null&&ie.apiUrl?Yy(H,null,ie):r("action",{action:((xe=H.propsActionCustom)==null?void 0:xe.key)||H.key||"create",row:null,selection:ai.value})}},Lu=H=>{if(H.requireConfirm){_.value={button:H,row:null},ee.value=!0;return}if(H.openDialog||i.dummyMode&&H.route){ae.value=H,we.value=null,pe.value=null,Object.keys(ke).forEach(le=>delete ke[le]);const V=H.fieldActionGlobal||H.fieldActionCustom||H.field||[];V.length&&V.forEach(le=>{yr(le);const me=ml(H),xe=me!=null&&me.keyParam&&me.keyParam.length>0?me.keyParam[0]:null,ie=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(le.component),he=xe&&le.model===xe,_e=!xe&&/^(id|ids|idAuditTrail|idAppRequest)$/i.test(le.model);if(he||_e&&!ie)ke[le.model]=ai.value;else if(ke[le.model]===void 0||ke[le.model]===""){const ze=rt(le,ke);ke[le.model]=ze!==void 0?ze:null}}),console.log("[DataTable][handleHeaderAction] Before applyCalculations. Filters:",JSON.stringify(b.value),"ParentFormDataWrapper:",JSON.stringify(R)),$e(),K.value=!0,setTimeout(()=>{Tu()},50)}else Hy(H)},qy=(H,V)=>{var ie,he,_e;Mo.value;const le=Bf(V);Object.keys(le).forEach(ze=>{ke[ze]=le[ze]}),V&&typeof V=="object"&&Object.keys(V).forEach(ze=>{ke[ze]===void 0&&(ke[ze]=V[ze])});const me=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);me&&typeof me=="object"&&Object.entries(me).forEach(([ze,qe])=>{if(typeof qe=="string"){const Qe=Qt(V,ze);Qe!==void 0&&(ke[qe]=Qe)}});const xe=Be.value;console.log(`[initializeDialogData] Processing ${xe.length} fields:`,xe.map(ze=>ze.key||ze.model)),xe.length>0&&xe.forEach(ze=>{yr(ze,!0);const qe=ze.model||ze.key;if(!qe)return;const Qe=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(ze.component);if(/^(id|ids|idAuditTrail|idAppRequest)$/i.test(qe)&&(!Qe||qe==="idAppRequest")){const et=V[Mo.value]||le[qe]||V.id;ke[qe]=/id$|idAppRequest|idSlikLogin/i.test(qe)?et:[et]}else if(H.action==="showToken"&&qe==="token")ke[qe]=V.token??le.token??"";else{let et=Qt(V,qe);if(et==null){const it=qe.includes(".")?qe.split(".").pop():null;it&&(et=Qt(V,it))}if(et!=null)ke[qe]=et;else{const it=rt(ze,ke);ke[qe]=it!==void 0?it:null}}}),setTimeout(()=>{Tu()},50)},Am=(H,V)=>{const le={};if(V.keyParam&&Array.isArray(V.keyParam)&&V.keyParam.forEach((me,xe)=>{if(typeof me=="string"){const ie=V.model&&xe===0?V.model:me,he=Qt(H,me);he!==void 0&&(le[ie]=he)}else typeof me=="object"&&me!==null&&Object.entries(me).forEach(([ie,he])=>{const _e=Qt(H,he);_e!==void 0&&(le[ie]=_e)})}),Object.keys(le).length===0&&H){const me=Mo.value;H[me]?le[me]=H[me]:H.id&&(le.id=H.id)}return le},O1=H=>{let V=H;V.item&&(V=V.item),Array.isArray(V)&&(V=V[0]||{});const le=Bf(V);if(Object.keys(le).forEach(me=>{ke[me]=le[me]}),Object.keys(V).forEach(me=>{we.value&&(we.value[me]=V[me])}),!ke.token){const me=Object.keys(V).find(xe=>xe.toLowerCase().includes("token"));me&&(ke.token=V[me])}},uo=(H,V,le,me,xe)=>{const ie=(H==null?void 0:H.data)??(H==null?void 0:H.result)??H;ie&&typeof ie=="object"?O1(ie):typeof ie=="string"&&"token"in ke&&(ke.token=ie),me&&xe!=="delete"&&r("action",{action:V.action||xe,row:we.value||le})},L1=async(H,V,le,me,xe)=>{ue.value=!0;const ie=Am(V,le);try{const he={...le.config||{}};le.accept&&(he.headers||(he.headers={}),he.headers.Accept=le.accept,he.headers.accept=le.accept);const _e=await c(le.apiUrl,"GET",ie,he);uo(_e,H,V,me,xe)}catch(he){console.error("Fetch Data Failed",he)}finally{ue.value=!1}},pl=async(H,V,le)=>{var me;if(console.log("[DataTable][handleRowAction] Clicked button:",H.key||H.id,"Props:",H),H.requireConfirm){_.value={button:H,row:V},ee.value=!0;return}if(H.openDialog){ae.value=H,we.value=V,pe.value=le!==void 0?le:null,Object.keys(ke).forEach(ze=>delete ke[ze]),qy(H,V),$e();const xe=H.propsActionCustom||H.props||H.propsActionGlobal||{},ie=ml(H),he=(H.actionType||H.permission||"").toLowerCase(),_e=/detail|view|edit|update|delete|destroy/i.test(he)||/detail|view|edit|update|delete|destroy/i.test(H.action||"");K.value=!0,((me=ie==null?void 0:ie.apiMethod)==null?void 0:me.toUpperCase())==="GET"&&ie.apiUrl&&(ie===H.endpointDialogActionSave||ie===xe.endpointDialogActionSave||L1(H,V,ie,_e,he));return}$1(H,V,le)},ps=(H,V)=>{var he;let le=H.route||"";if(!le)return"";const me=H.propsActionCustom||H.propsActionGlobal,xe=(he=me==null?void 0:me.endpointForm)==null?void 0:he.keyParam;if(le.includes(":"))return le.replaceAll(/:(\w+)/g,(_e,ze)=>{if(xe&&xe.length>0){let qe=null;for(const Qe of xe)if(typeof Qe=="object"&&Qe!==null)if(Qe[ze]!==void 0){qe=Qe[ze];break}else{const et=Object.values(Qe);et.length>0&&(qe=et[0])}else typeof Qe=="string"&&(qe=Qe);if(qe){const Qe=String(qe).split(".").reduce((et,it)=>et&&et[it],V);if(Qe!=null)return Qe}}return(V?V[ze]||V.id:null)||ze});let ie=V==null?void 0:V.id;if(xe&&xe.length>0){const _e=xe[0];let ze=null;if(typeof _e=="object"&&_e!==null?ze=_e.id||_e.key||Object.values(_e)[0]:ze=_e,ze&&V){const qe=String(ze).split(".").reduce((Qe,et)=>Qe&&Qe[et],V);qe!=null&&(ie=qe)}}return ie?`${le.replace(/\/$/,"")}/${ie}`:le},Ky=(H,V,le)=>{var ie,he,_e;const me=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);if(!me||typeof me!="object")return;const xe=[];if(Object.entries(me).forEach(([ze,qe])=>{if(typeof qe=="string"){const Qe=Qt(V,ze);if(Qe===void 0)xe.push(ze);else{let et=Qe;Qe&&typeof Qe=="object"&&!Array.isArray(Qe)&&/id|code|idSlik|idOperator|idSupervisor/i.test(qe)&&(et=Qe.id??Qe.code??Qe.value??Qe),le[qe]=et}}}),xe.length>0){const ze=d.value||"en",qe=ze==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Qe=ze==="id"?`Terdapat ketidaksesuaian skema pada field: ${xe.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${xe.join(", ")}. Please contact the development team.`;xt.warning(`${qe}: ${Qe}`,{autoClose:5e3,position:"top-right"})}},Gy=(H,V)=>{var ie,he,_e,ze;if(console.log("[DataTable][performRoutingAction] Button:",H,"row:",V),H.path&&H.route){const qe=H.route.startsWith("/")?H.route:"/"+H.route;sessionStorage.setItem(`layout_${qe}`,H.path)}let le=ps(H,V);const me=H.path?{code:H.path}:{};if(le&&le.includes("?")){const[qe,Qe]=le.split("?");le=qe;const et=new URLSearchParams(Qe);for(const[it,Et]of et.entries())me[it]=Et}const xe=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);xe&&typeof xe=="object"&&Object.entries(xe).forEach(([qe,Qe])=>{if(typeof Qe=="string"){const et=Qt(V,qe);et!==void 0&&(me[Qe]=et)}}),V&&V.id&&me.id===void 0&&(me.id=V.id),r("navigate",{route:le,path:H.path,query:me,targetBehavior:H.targetBehavior||((ze=H.action)==null?void 0:ze.targetBehavior)}),H.targetBehavior!=="IN_PLACE"&&(k==null||k.push({path:le,query:me}))},Tm=(H,V,le)=>{const me={};if(V)Ky(H,V,me),le.keyParam&&Array.isArray(le.keyParam)&&le.keyParam.forEach((xe,ie)=>{if(typeof xe=="string"){const he=le.model&&ie===0?le.model:xe,_e=Qt(V,xe);_e!==void 0&&(me[he]=_e)}else typeof xe=="object"&&xe!==null&&Object.entries(xe).forEach(([he,_e])=>{const ze=Qt(V,_e);ze!==void 0&&(me[he]=ze)})}),Object.keys(me).length===0&&V.id&&(me.id=V.id);else{const xe=Zy(H,le);me[xe]=ai.value||[]}return me},F1=H=>{if(!H)return null;const V=H.match(/filename\*=(?:UTF-8'')?([^;\n]+)/i);if(V){const me=V[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(me)}catch{return me}}const le=H.match(/filename=(?:"?)([^";]+)(?:"?)/i);if(le){const me=le[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(me)}catch{return me}}return null},Pm=(H,V)=>{if(!H||!H.headers)return null;const le=H.headers;if(typeof le.get=="function")return le.get(V);const me=Object.keys(le).find(xe=>xe.toLowerCase()===V.toLowerCase());return me?le[me]:null},Bm=H=>{const V=Pm(H,"content-disposition")||Pm(H,"Content-Disposition"),le=F1(V);return H instanceof Blob?{blob:H,filename:le}:(H==null?void 0:H.data)instanceof Blob?{blob:H.data,filename:le}:{blob:H,filename:le}},Yy=(H,V,le)=>{ue.value=!0;const me=Tm(H,V,le),xe=xt.loading(d.value==="id"?"Memproses...":"Processing..."),ie=le.responseType==="blob"||le.responseType==="arraybuffer"||le.accept&&!le.accept.includes("json")||le.apiUrl&&(le.apiUrl.includes("/export")||le.apiUrl.includes("/download"))||H.actionType==="EXPORT"||H.permission==="EXPORT",he={...le.config||{}};le.accept&&(he.headers||(he.headers={}),he.headers.Accept=le.accept,he.headers.accept=le.accept),ie&&(he.responseType=le.responseType||"blob"),c(le.apiUrl,le.apiMethod||"POST",me,he).then(_e=>{var Qe,et,it,Et;if(ie&&(_e instanceof Blob||((Qe=_e==null?void 0:_e.constructor)==null?void 0:Qe.name)==="Blob"||(_e==null?void 0:_e.size)!==void 0||(_e==null?void 0:_e.data)instanceof Blob||((it=(et=_e==null?void 0:_e.data)==null?void 0:et.constructor)==null?void 0:it.name)==="Blob"||((Et=_e==null?void 0:_e.data)==null?void 0:Et.size)!==void 0||(_e==null?void 0:_e.data)instanceof ArrayBuffer)){const{blob:Bt,filename:qt}=Bm(_e),wt=Bt instanceof Blob?Bt:new Blob([Bt],{type:le.accept||"application/octet-stream"});if(wt.type==="application/json"){const bi=new FileReader;bi.onload=()=>{try{const Kn=JSON.parse(bi.result).message||(d.value==="id"?"Gagal mengunduh file":"Failed to download file");xt.update(xe,{render:Kn,type:"error",isLoading:!1,autoClose:5e3})}catch{const Kn=window.URL.createObjectURL(wt),Pn=document.createElement("a");Pn.href=Kn;const Lr=H.label||H.text||H.tooltip||"Export",j1=qt||`${Lr}_${new Date().toISOString().slice(0,10)}.pdf`;Pn.setAttribute("download",j1),document.body.appendChild(Pn),Pn.click(),Pn.remove(),window.URL.revokeObjectURL(Kn),xt.update(xe,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3})}},bi.readAsText(wt);return}const Ft=window.URL.createObjectURL(wt),St=document.createElement("a");St.href=Ft;let Mt="txt";const Kt=(le.accept||"").toLowerCase(),qn=(le.apiUrl||"").toLowerCase();ke!=null&&ke.format?Mt=String(ke.format).toLowerCase():Kt.includes("pdf")?Mt="pdf":Kt.includes("excel")||Kt.includes("sheet")||Kt.includes("spreadsheet")||Kt.includes("xlsx")?Mt="xlsx":Kt.includes("csv")?Mt="csv":Kt.includes("zip")?Mt="zip":qn.includes("pdf")?Mt="pdf":qn.includes("excel")||qn.includes("xlsx")?Mt="xlsx":qn.includes("csv")?Mt="csv":qn.includes("zip")&&(Mt="zip");const Ct=H.label||H.text||H.tooltip||"Export";let ut=qt||`${Ct}_${new Date().toISOString().slice(0,10)}.${Mt}`;Mt==="txt"&&ut.toLowerCase().endsWith(".bin")&&(ut=ut.replace(/\.bin$/i,".txt")),St.setAttribute("download",ut),document.body.appendChild(St),St.click(),St.remove(),window.URL.revokeObjectURL(Ft),xt.update(xe,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3}),ei(),r("action",{action:H.action||"success",row:V});return}const ze=(_e==null?void 0:_e.status)===!0,qe=(_e==null?void 0:_e.message)||(ze?d.value==="id"?"Sukses":"Success":d.value==="id"?"Gagal":"Failed");xt.update(xe,{render:qe,type:ze?"success":"error",isLoading:!1,autoClose:ze?2e3:5e3}),ze&&(ei(),r("action",{action:H.action||"success",row:V}))}).catch(_e=>{console.error("Action Failed",_e),xt.update(xe,{render:_e.message||"Action failed",type:"error",isLoading:!1,autoClose:5e3})}).finally(()=>{ue.value=!1})},$1=(H,V,le)=>{if(console.log("[DataTable][executeRowAction] Button:",H,"route:",H.route,"keyRedirect:",H.keyRedirect,"targetBehavior:",H.targetBehavior,"path:",H.path),i.dummyMode){if(H.triggerNavigation){console.log("[DataTable][executeRowAction] triggerNavigation detected in dummy mode, emitting action event"),r("action",{action:H.action,row:V,rowIndex:le});return}ae.value=H,we.value=V,pe.value=null,Object.keys(ke).forEach(me=>delete ke[me]),qy(H,V),K.value=!0;return}if(H.route||H.keyRedirect&&H.targetBehavior==="IN_PLACE"&&H.path)Gy(H,V);else{const me=ml(H);me!=null&&me.apiUrl?Yy(H,V,me):r("action",{action:H.action,row:V,rowIndex:le})}},Nm=()=>{if(_.value){const{button:H,row:V}=_.value;er(),V===null?Lu({...H,requireConfirm:!1}):pl({...H,requireConfirm:!1},V)}},Zy=(H,V)=>{let le=V==null?void 0:V.model;if(!le&&(V!=null&&V.keyParam)&&V.keyParam.length>0){const he=V.keyParam[0];typeof he=="string"?le=he:typeof he=="object"&&he!==null&&(le=Object.keys(he)[0])}if(le)return le;const me=sa();if(me)return me;const ie=(H.fieldActionGlobal||H.fieldActionCustom||H.field||[]).find(he=>{const _e=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(he.component);return/^(id|ids|idAuditTrail|idAppRequest)$/i.test(he.model)&&!_e});return ie?ie.model:"ids"},Xy=(H,V,le)=>{var ie,he,_e;let me={...ke};const xe=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);if(we.value){const ze=Mo.value,qe=we.value[ze];me[le]||(/id$|idAppRequest|idSlikLogin/i.test(le)||V!=null&&V.model?me[le]=qe:me[le]=[qe])}else me[le]||(me[le]=ai.value||[]);if(xe&&typeof xe=="object"){const ze={},qe=Object.keys(xe),Qe=(H.fieldActionCustom||H.fieldActionGlobal||H.fields||[]).map(it=>it.model||it.key);[...new Set([...Qe,le])].forEach(it=>{it&&!qe.includes(it)&&me[it]!==void 0&&(ze[it]=me[it])}),Object.entries(xe).forEach(([it,Et])=>{if(typeof Et=="string"){const Bt=Qt(me,it)??(we.value?Qt(we.value,it):void 0);if(Bt!==void 0){let qt=Bt;Bt&&typeof Bt=="object"&&!Array.isArray(Bt)&&/id|code|idSlik|idOperator|idSupervisor/i.test(Et)&&(qt=Bt.id??Bt.code??Bt.value??Bt),ze[Et]=/id$|idAppRequest|idSlikLogin/i.test(Et)&&Array.isArray(qt)?qt[0]:qt}}}),me=ze}return me},Jy=(H,V,le)=>{if(l!=null&&l.resolveKeyParams&&Array.isArray(V==null?void 0:V.keyParam)){const he=l.resolveKeyParams(V.keyParam);console.log("[DataTable][handleApiSave] Resolved keyParams:",he),Object.assign(le,he)}const me=xt.loading(d.value==="id"?"Memproses...":"Processing..."),xe=V.responseType==="blob"||V.responseType==="arraybuffer"||V.accept&&!V.accept.includes("json")||V.apiUrl&&(V.apiUrl.includes("/export")||V.apiUrl.includes("/download"))||H.actionType==="EXPORT"||H.permission==="EXPORT",ie={...V.config||{}};V.accept&&(ie.headers||(ie.headers={}),ie.headers.Accept=V.accept,ie.headers.accept=V.accept),xe&&(ie.responseType=V.responseType||"blob"),c(V.apiUrl,V.apiMethod||"POST",le,ie).then(he=>{var qe,Qe,et,it;if(xe&&(he instanceof Blob||((qe=he==null?void 0:he.constructor)==null?void 0:qe.name)==="Blob"||(he==null?void 0:he.size)!==void 0||(he==null?void 0:he.data)instanceof Blob||((et=(Qe=he==null?void 0:he.data)==null?void 0:Qe.constructor)==null?void 0:et.name)==="Blob"||((it=he==null?void 0:he.data)==null?void 0:it.size)!==void 0||(he==null?void 0:he.data)instanceof ArrayBuffer)){const{blob:Et,filename:Bt}=Bm(he),qt=Et instanceof Blob?Et:new Blob([Et],{type:V.accept||"application/octet-stream"});if(qt.type==="application/json"){const ut=new FileReader;ut.onload=()=>{try{const li=JSON.parse(ut.result).message||(d.value==="id"?"Gagal mengunduh file":"Failed to download file");xt.update(me,{render:li,type:"error",isLoading:!1,autoClose:5e3})}catch{const li=window.URL.createObjectURL(qt),Kn=document.createElement("a");Kn.href=li;const Pn=H.label||H.text||H.tooltip||"Export",Lr=Bt||`${Pn}_${new Date().toISOString().slice(0,10)}.pdf`;Kn.setAttribute("download",Lr),document.body.appendChild(Kn),Kn.click(),Kn.remove(),window.URL.revokeObjectURL(li),xt.update(me,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3})}},ut.readAsText(qt);return}const wt=window.URL.createObjectURL(qt),Ft=document.createElement("a");Ft.href=wt;let St="txt";const Mt=(V.accept||"").toLowerCase(),Kt=(V.apiUrl||"").toLowerCase();ke!=null&&ke.format?St=String(ke.format).toLowerCase():le!=null&&le.format?St=String(le.format).toLowerCase():Mt.includes("pdf")?St="pdf":Mt.includes("excel")||Mt.includes("sheet")||Mt.includes("spreadsheet")||Mt.includes("xlsx")?St="xlsx":Mt.includes("csv")?St="csv":Mt.includes("zip")?St="zip":Kt.includes("pdf")?St="pdf":Kt.includes("excel")||Kt.includes("xlsx")?St="xlsx":Kt.includes("csv")?St="csv":Kt.includes("zip")&&(St="zip");const qn=H.label||H.text||H.tooltip||"Export";let Ct=Bt||`${qn}_${new Date().toISOString().slice(0,10)}.${St}`;St==="txt"&&Ct.toLowerCase().endsWith(".bin")&&(Ct=Ct.replace(/\.bin$/i,".txt")),Ft.setAttribute("download",Ct),document.body.appendChild(Ft),Ft.click(),Ft.remove(),window.URL.revokeObjectURL(wt),xt.update(me,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3}),K.value=!1,we.value||(ai.value=[]),da.value="",ei(),r("action",{action:"success",row:null}),gl(H);return}const _e=(he==null?void 0:he.status)===!0,ze=(he==null?void 0:he.message)||(_e?d.value==="id"?"Sukses":"Success":d.value==="id"?"Gagal":"Failed");xt.update(me,{render:ze,type:_e?"success":"error",isLoading:!1,autoClose:_e?2e3:5e3}),_e&&(K.value=!1,we.value||(ai.value=[]),da.value="",ei(),r("action",{action:"success",row:null}),gl(H))}).catch(he=>{console.error("Action Failed",he),xt.update(me,{render:he.message||"Action failed",type:"error",isLoading:!1,autoClose:5e3})})},gl=H=>{var le,me;const V=(H==null?void 0:H.routeBack)||(H==null?void 0:H.pathBack)||((le=re.value)==null?void 0:le.routeBack)||((me=re.value)==null?void 0:me.pathBack);V&&k.push(V)},ca=(H,V)=>{var me,xe,ie,he,_e;const le={...ke};if(we.value){const ze=((me=i.tableConfig)==null?void 0:me.modelDatatable)||((xe=re.value)==null?void 0:xe.modelDatatable)||H.modelDatatable;r("action",{action:((ie=H.propsActionGlobal)==null?void 0:ie.key)||H.key||V,row:le,originalRow:we.value,rowIndex:pe.value,isLocalSave:!0,actionType:"UPDATE",modelDatatable:ze})}else{const ze=((he=re.value)==null?void 0:he.modelDatatable)||i.apiModule||H.modelDatatable;r("action",{action:((_e=H.propsActionGlobal)==null?void 0:_e.key)||H.key||V,row:le,selection:ai.value,isLocalSave:!0,actionType:"CREATE",modelDatatable:ze})}K.value=!1,we.value||(ai.value=[]),gl(H)},z1=()=>{var _e,ze,qe,Qe;if(!ae.value)return;let H=!0;if(Object.keys(be).forEach(et=>delete be[et]),(Be.value||[]).forEach(et=>{if(et.isHidden||ne(et)||!Re(et))return;const it=ke[et.model],Et=Ue(et,it,ke);Et&&(be[et.model]=Et,H=!1)}),!H){console.warn("[DataTable] Custom action form validation failed:",JSON.parse(JSON.stringify(be)));return}const le=ae.value,me=ml(le),xe=(le.actionType||le.permission||"").toLowerCase(),ie=!!((_e=le.endpointDialogActionSave)!=null&&_e.apiUrl||(qe=(ze=le.propsActionGlobal)==null?void 0:ze.endpointDialogActionSave)!=null&&qe.apiUrl);if((me==null?void 0:me.apiUrl)&&(((Qe=me.apiMethod)==null?void 0:Qe.toUpperCase())!=="GET"||ie)){const et=Zy(le,me),it=Xy(le,me,et);Jy(le,me,it)}else ca(le,xe)},Gc=H=>{const V=ke[H];V&&L3(String(V)).then(()=>{xt.success(h("datatable.copiedSuccess"),{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(le=>{console.error("Failed to copy",le)})},er=()=>{ee.value=!1,_.value=null},Qy=o.computed(()=>_.value?_.value.button.confirmTitle||h("common.confirm"):""),Vy=o.computed(()=>_.value?_.value.button.confirmMessage||h("common.confirmMessage"):"");t({fetchData:ei,filters:b,resetFilters:km,handleRefresh:Wy,currentPage:I,currentPerPage:O});const da=o.ref(""),Fu=H=>{if(!H&&!i.apiParams)return"";const V=(H==null?void 0:H.endpoint)||(H==null?void 0:H.endpointTable)||(H==null?void 0:H.endpointGlobal)||{};return JSON.stringify({url:V.apiUrl||(H==null?void 0:H.apiUrl)||i.apiUrl,module:V.apiModule||(H==null?void 0:H.apiModule)||i.apiModule,action:V.apiAction||(H==null?void 0:H.apiAction)||i.apiAction,method:V.apiMethod||(H==null?void 0:H.apiMethod)||i.apiMethod,params:(H==null?void 0:H.apiParams)||i.apiParams,socket:V.socket||(H==null?void 0:H.socketEndpoint)||i.socketEndpoint,socketParams:(H==null?void 0:H.socketParams)||i.socketParams})};o.watch(()=>i.tableConfig,()=>{if(i.tableConfig){Cn();const H=Fu(i.tableConfig);H!==da.value&&(!i.controlled&&Dn.value?(da.value=H,console.log("[DataTable] Triggering internal auto-fetch due to config change."),hs()):i.controlled&&(da.value=H,console.log("[DataTable] Skipping internal fetch (Controlled Mode).")))}},{deep:!0,immediate:!0});const $u=o.computed(()=>{var H,V,le,me,xe,ie;return d.value==="kr"||d.value==="ko"?((H=re.value)==null?void 0:H.titleKR)||((V=re.value)==null?void 0:V.titleEN)||((le=re.value)==null?void 0:le.titleID)||"":d.value==="id"?((me=re.value)==null?void 0:me.titleID)||"":((xe=re.value)==null?void 0:xe.titleEN)||((ie=re.value)==null?void 0:ie.titleID)||""});o.watch(()=>i.apiModule,()=>{Dn.value&&ei()});const eb=H=>{if(I.value!==1)return;const V=H&&(H.data||H.items||H.list||H.rows||H.result);Array.isArray(H)||V?ms(H):ei(!0)};return o.watch(()=>lo.value,(H,V)=>{!y||!A||(V&&A(V,eb),H&&(M&&M(),y(H,eb),B.value&&C&&C(H,Lc.value)))},{immediate:!0}),o.watch(()=>B.value,H=>{H&&lo.value&&C&&C(lo.value,Lc.value)}),o.watch(()=>i.socketParams,()=>{ul.value&&(B.value&&lo.value&&C&&C(lo.value,Lc.value),ei())},{deep:!0}),o.watch(()=>i.apiParams,(H,V)=>{JSON.stringify(H)!==JSON.stringify(V)&&Dn.value&&hs()},{deep:!0}),o.watch(()=>i.page,H=>{H!==void 0&&H!==I.value&&(I.value=H,Dn.value&&ei())}),o.watch(()=>i.perPage,H=>{H!==void 0&&H!==O.value&&(O.value=H,Dn.value&&ei())}),o.watch(()=>i.startIndex,H=>{if(H!==void 0){const V=Math.floor((H-1)/O.value)+1;V!==I.value&&(I.value=V,Dn.value&&ei())}}),o.watch(()=>G.value,H=>{fs.value},{deep:!0}),o.onMounted(()=>{if(Cn(),Dn.value&&!i.controlled){const H=Fu(re.value||i.tableConfig);H!==da.value&&(da.value=H,ue.value=!0,ei())}}),(H,V)=>{var le,me,xe;return o.openBlock(),o.createElementBlock("div",jge,[Oc((le=re.value)==null?void 0:le.isHidden)?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Uge,[e.nested&&$u.value?(o.openBlock(),o.createElementBlock("div",Wge,[V[11]||(V[11]=o.createElementVNode("div",{class:"h-4 w-1 bg-white/50 rounded-full"},null,-1)),o.createElementVNode("span",Hge,o.toDisplayString($u.value),1)])):o.createCommentVNode("",!0),o.createElementVNode("div",qge,[!e.nested||e.dummyMode||ce.value?(o.openBlock(),o.createElementBlock("div",Kge,[o.createElementVNode("div",Gge,[o.createVNode(o.unref(Ne.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),o.createVNode(o.unref(xge),{modelValue:$.value,"onUpdate:modelValue":V[0]||(V[0]=ie=>$.value=ie),placeholder:h("common.searchPlaceholder"),style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:o.withKeys(wm,["enter"])},null,8,["modelValue","placeholder"])]),S.value.length>0||H.$slots["filter-form"]?(o.openBlock(),o.createElementBlock("div",Yge,[o.createVNode(vge,{title:m.value,description:g.value},{trigger:o.withCtx(()=>[o.createVNode(Vt,{variant:"secondary",icon:"SlidersHorizontal",tooltip:h("common.advanceSearch"),class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"},null,8,["tooltip"])]),default:o.withCtx(()=>[o.createElementVNode("div",Zge,[o.renderSlot(H.$slots,"filter-form",{filters:b.value},()=>[S.value.length>0?(o.openBlock(),o.createElementBlock("div",Xge,[o.createElementVNode("div",Jge,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(D.value,(ie,he)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:he},[o.unref(nt)(ie)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(gr)(ie,"1"))},[o.createVNode(kge,{field:ie,modelValue:b.value[ie.model],"onUpdate:modelValue":_e=>b.value[ie.model]=_e,disabled:o.unref(fi)(ie),required:o.unref(Tt)(ie),readonly:o.unref(hn)(ie),options:o.unref(vn)(ie),"dynamic-labels":o.unref(Jt)(ie),"dynamic-length":o.unref(cn)(ie),baseUrl:P.value},null,8,["field","modelValue","onUpdate:modelValue","disabled","required","readonly","options","dynamic-labels","dynamic-length","baseUrl"])],2)):o.createCommentVNode("",!0)],64))),128))])])):o.createCommentVNode("",!0)]),S.value.length>0||H.$slots["filter-form"]?(o.openBlock(),o.createElementBlock("div",Qge,[o.createElementVNode("div",Vge,[o.createVNode(o.unref(Fr),{variant:"outline",onClick:km,disabled:Di.value,class:"w-full gap-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.RefreshCw),{class:"w-4 h-4"}),o.createTextVNode(" "+o.toDisplayString(h("common.reset")),1)]),_:1},8,["disabled"]),o.createVNode(o.unref(Fr),{onClick:xm,disabled:Do.value,class:"w-full gap-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.Search),{class:"w-4 h-4"}),o.createTextVNode(" "+o.toDisplayString(h("common.search")),1)]),_:1},8,["disabled"])])])):o.createCommentVNode("",!0)])]),_:3},8,["title","description"])])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["flex items-center gap-2 flex-wrap",{"ml-auto":e.nested}])},[(!e.nested||e.dummyMode||se.value)&&Dn.value?(o.openBlock(),o.createBlock(Vt,{key:0,variant:"secondary",icon:"RefreshCw",text:h("common.refresh"),tooltip:h("common.refresh"),class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:Wy,disabled:Di.value},{icon:o.withCtx(()=>[o.createVNode(o.unref(Ne.RefreshCw),{class:o.normalizeClass(["w-3.5 h-3.5",{"animate-spin":Di.value}])},null,8,["class"])]),_:1},8,["text","tooltip","disabled"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(fs.value,(ie,he)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:he},[ie.type==="BUTTONGROUP"||ie.actionType==="BUTTONGROUP"||ie.propsActionGlobal&&ie.propsActionGlobal.type==="BUTTONGROUP"||ie.buttons&&ie.buttons.length||ie.propsCustom&&ie.propsCustom.length?(o.openBlock(),o.createBlock(ba,{key:0,text:ie.label,icon:ie.icon,"label-k-r":ie.labelKR,"label-e-n":ie.labelEN,"label-i-d":ie.labelID||ie.label,variant:ie.variant,"bg-color":ie.bgColor,"text-color":ie.textColor,"border-style":ie.borderStyle||"none","border-color":ie.borderColor,rounded:ie.rounded||"md",buttons:ie.buttons||ie.propsCustom||ie.propsActionGlobal&&(ie.propsActionGlobal.buttons||ie.propsActionGlobal.propsCustom)||[],"menu-align":"right",onAction:V[1]||(V[1]=_e=>Lu(_e)),onButtonClick:V[2]||(V[2]=_e=>Lu(_e))},null,8,["text","icon","label-k-r","label-e-n","label-i-d","variant","bg-color","text-color","border-style","border-color","rounded","buttons"])):(o.openBlock(),o.createBlock(Vt,{key:1,icon:ie.icon,text:ie.label,tooltip:ie.tooltip,variant:ie.variant,"bg-color":ie.bgColor,"text-color":ie.textColor,"border-style":ie.borderStyle||"none","border-color":ie.borderColor,rounded:ie.rounded||"md",class:o.normalizeClass(["gap-2 h-9 shadow-lg shadow-primary-500/20 text-xs font-medium",{"border-none":!ie.borderStyle||ie.borderStyle==="none"}]),onClick:_e=>Lu(ie)},null,8,["icon","text","tooltip","variant","bg-color","text-color","border-style","border-color","rounded","class","onClick"]))],64))),128)),o.renderSlot(H.$slots,"header-actions")],2)])])),o.createElementVNode("div",e0e,[Di.value?(o.openBlock(),o.createElementBlock("div",t0e,[...V[12]||(V[12]=[o.createElementVNode("div",{class:"h-full bg-primary animate-progress-shimmer"},null,-1)])])):o.createCommentVNode("",!0),o.createElementVNode("table",n0e,[o.createElementVNode("thead",i0e,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ni.value,ie=>(o.openBlock(),o.createElementBlock("th",{key:ie.key,class:o.normalizeClass([ie.align?`text-${ie.align.toLowerCase()}`:"text-left",ie.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:o.normalizeStyle(ie.width?{width:ie.width}:{}),onClick:he=>ie.sortable&&Or(ie.key)},[["CHECKBOX","checkbox"].includes(ie.type??"")&&!Oc(ie.isHidden)?(o.openBlock(),o.createElementBlock("div",o0e,[o.createElementVNode("input",{type:"checkbox",class:"h-4 w-4 rounded border-white/30 bg-transparent text-white focus:ring-offset-primary-700 focus:ring-white cursor-pointer accent-primary-500",checked:Fy.value,indeterminate:T1.value,onChange:V[3]||(V[3]=he=>$y(he.target.checked)),onClick:V[4]||(V[4]=o.withModifiers(()=>{},["stop"]))},null,40,s0e)])):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-2 w-full",zc(ie.align)])},[o.createElementVNode("span",null,o.toDisplayString(ie.label),1)],2))],14,r0e))),128)),co.value?(o.openBlock(),o.createElementBlock("th",a0e,[o.createElementVNode("div",l0e,o.toDisplayString(h("common.actions")),1)])):o.createCommentVNode("",!0)])]),o.createElementVNode("tbody",c0e,[Di.value&&X.value.length===0?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(vr.value.length>0?vr.value.length:Math.max(O.value,5),ie=>(o.openBlock(),o.createElementBlock("tr",{key:`skeleton-${ie}`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ni.value,he=>{var _e,ze;return o.openBlock(),o.createElementBlock("td",{key:he.key,class:o.normalizeClass([he.align?`text-${he.align.toLowerCase()}`:"text-left","px-3 py-3"])},[o.createElementVNode("div",{class:o.normalizeClass(["animate-shimmer rounded-md",[["badge","BADGE"].includes(he.type??"")||he.condition?"h-6 w-24 rounded-full":"h-5 w-full max-w-[80%]",((_e=he.align)==null?void 0:_e.toLowerCase())==="center"?"mx-auto":"",((ze=he.align)==null?void 0:ze.toLowerCase())==="right"?"ml-auto":""]])},null,2)],2)}),128)),co.value?(o.openBlock(),o.createElementBlock("td",d0e,[...V[13]||(V[13]=[o.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[o.createElementVNode("div",{class:"w-8 h-8 bg-zinc-200/50 dark:bg-zinc-800/50 rounded-lg animate-pulse"}),o.createElementVNode("div",{class:"w-8 h-8 bg-zinc-200/50 dark:bg-zinc-800/50 rounded-lg animate-pulse delay-75"})],-1)])])):o.createCommentVNode("",!0)]))),128)):vr.value.length===0?(o.openBlock(),o.createElementBlock("tr",u0e,[o.createElementVNode("td",{colspan:Ni.value.length+(co.value?1:0),class:"text-center py-16"},[o.createElementVNode("div",h0e,[o.createVNode(o.unref(iI.Vue3Lottie),{animationData:o.unref(zge),height:200,width:200},null,8,["animationData"]),o.createElementVNode("div",null,[o.createElementVNode("p",m0e,o.toDisplayString(Ir.value?h("dataTable.noSearchResults"):h("common.noData")),1),o.createElementVNode("p",p0e,o.toDisplayString(Ir.value?h("dataTable.tryChangingKeywords"):h("common.noData")),1)])])],8,f0e)])):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:2},o.renderList(vr.value,(ie,he)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:he},[o.createElementVNode("tr",{class:o.normalizeClass(["hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150",{"opacity-50 pointer-events-none select-none grayscale-[30%]":Di.value}])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ni.value,_e=>(o.openBlock(),o.createElementBlock("td",{key:_e.key,class:o.normalizeClass([_e.align?`text-${_e.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[o.renderSlot(H.$slots,`cell-${_e.key}`,{row:ie,value:Qt(ie,_e.key)},()=>{var ze,qe,Qe,et,it,Et,Bt,qt,wt,Ft;return[["CHECKBOX","checkbox"].includes(_e.type??"")&&!Oc(_e.isHidden)?(o.openBlock(),o.createElementBlock("div",g0e,[o.createElementVNode("input",{type:"checkbox",class:"h-4 w-4 rounded border-neutral-300 dark:border-neutral-700 bg-white dark:bg-zinc-800 text-primary-600 focus:ring-primary-500 cursor-pointer",checked:P1(ie),onChange:St=>B1(ie,St.target.checked),onClick:V[5]||(V[5]=o.withModifiers(()=>{},["stop"]))},null,40,y0e)])):_e.type==="badge"||_e.type==="BADGE"||((ze=_e.custom)==null?void 0:ze.type)==="badge"||((qe=_e.custom)==null?void 0:qe.type)==="BADGE"||_e.condition?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[_e.align?`justify-${_e.align.toLowerCase()}`:"justify-start"]])},[o.createVNode(au,{variant:Kc(ie,_e).variant,color:Kc(ie,_e).color,class:o.normalizeClass([Kc(ie,_e).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Kc(ie,_e).label),1)]),_:2},1032,["variant","color","class"])],2)):_e.type==="buttongroup"||_e.type==="BUTTONGROUP"||((Qe=_e.custom)==null?void 0:Qe.type)==="buttongroup"||((et=_e.custom)==null?void 0:et.type)==="BUTTONGROUP"?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[_e.align?`justify-${_e.align.toLowerCase()}`:"justify-start"]])},[o.createVNode(ba,{buttons:I1(ie,_e),size:Rt(_e,"size","sm"),variant:Rt(_e,"variant","default"),"bg-color":Rt(_e,"bgColor",""),"text-color":Rt(_e,"textColor",""),"border-color":Rt(_e,"borderColor",""),"border-style":Rt(_e,"borderStyle","solid"),rounded:Rt(_e,"rounded","md"),orientation:Rt(_e,"orientation","horizontal"),onButtonClick:St=>pl(St,ie,he)},null,8,["buttons","size","variant","bg-color","text-color","border-color","border-style","rounded","orientation","onButtonClick"])],2)):_e.key==="no"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createTextVNode(o.toDisplayString((I.value-1)*O.value+he+1),1)],64)):_e.type==="HYPERLINK"||_e.type==="hyperlink"?(o.openBlock(),o.createElementBlock("a",{key:4,href:Qt(ie,(Et=(it=_e.propsCustom)==null?void 0:it[0])==null?void 0:Et.urlLink)||"#",target:((qt=(Bt=_e.propsCustom)==null?void 0:Bt[0])==null?void 0:qt.target)||"_blank",class:"text-blue-600 dark:text-blue-400 hover:underline inline-flex items-center gap-1 font-medium"},[o.createTextVNode(o.toDisplayString(Qt(ie,_e.key)||"-")+" ",1),((Ft=(wt=_e.propsCustom)==null?void 0:wt[0])==null?void 0:Ft.target)==="_blank"?(o.openBlock(),o.createElementBlock("span",v0e,[...V[14]||(V[14]=[o.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),o.createElementVNode("polyline",{points:"15 3 21 3 21 9"}),o.createElementVNode("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])])):o.createCommentVNode("",!0)],8,b0e)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:5},[o.createTextVNode(o.toDisplayString(Dt(ie,_e)),1)],64))]})],2))),128)),co.value?(o.openBlock(),o.createElementBlock("td",w0e,[o.renderSlot(H.$slots,"actions",{row:ie,buttons:Ro(ie),getButtonColor:la,getIconComponent:jc},()=>[Ro(ie).length>0?(o.openBlock(),o.createElementBlock("div",_0e,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ro(ie),(_e,ze)=>(o.openBlock(),o.createElementBlock("div",{key:ze,class:"group relative"},[_e.type==="BUTTONGROUP"||_e.actionType==="BUTTONGROUP"||_e.propsActionCustom&&_e.propsActionCustom.type==="BUTTONGROUP"||_e.buttons&&_e.buttons.length||_e.propsCustom&&_e.propsCustom.length?(o.openBlock(),o.createBlock(ba,{key:0,text:_e.label,icon:_e.icon,"label-k-r":_e.labelKR,"label-e-n":_e.labelEN,"label-i-d":_e.labelID||_e.label,size:_e.size||"sm",rounded:_e.rounded||"sm","border-style":_e.borderStyle||"none","border-color":_e.borderColor,variant:_e.variant||"ghost","bg-color":la(_e,ie),buttons:_e.buttons||_e.propsCustom||_e.propsActionCustom&&(_e.propsActionCustom.buttons||_e.propsActionCustom.propsCustom)||[],onAction:qe=>pl(qe,ie,he),onButtonClick:qe=>pl(qe,ie,he)},null,8,["text","icon","label-k-r","label-e-n","label-i-d","size","rounded","border-style","border-color","variant","bg-color","buttons","onAction","onButtonClick"])):(o.openBlock(),o.createBlock(Vt,{key:1,tooltip:_e.tooltip||_e.label,icon:_e.icon,text:_e.icon?"":_e.label||h("common.actions"),size:_e.icon?"icon":"sm",rounded:_e.rounded||"sm","border-style":_e.borderStyle||"none","border-color":_e.borderColor,variant:_e.variant||"ghost","bg-color":la(_e,ie),onClick:qe=>pl(_e,ie,he)},null,8,["tooltip","icon","text","size","rounded","border-style","border-color","variant","bg-color","onClick"]))]))),128))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)],2),H.$slots["expanded-row"]?(o.openBlock(),o.createElementBlock("tr",k0e,[o.createElementVNode("td",{colspan:Ni.value.length+(co.value?1:0),class:"px-0 py-0"},[o.renderSlot(H.$slots,"expanded-row",{row:ie,index:he})],8,x0e)])):o.createCommentVNode("",!0)],64))),128))])])]),vr.value.length>0&&e.showPagination&&ge.value?(o.openBlock(),o.createElementBlock("div",E0e,[o.createElementVNode("div",C0e,[o.createVNode(o.unref(Dge),{"model-value":String(O.value),"onUpdate:modelValue":V[6]||(V[6]=ie=>Uy(Number(ie))),disabled:Di.value},{default:o.withCtx(()=>[o.createVNode(o.unref(Fge),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:o.withCtx(()=>[o.createVNode(o.unref($ge),{placeholder:String(O.value)},null,8,["placeholder"])]),_:1}),o.createVNode(o.unref(Mge),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(_n,ie=>o.createVNode(o.unref(Ige),{key:ie,value:String(ie)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value","disabled"]),V[15]||(V[15]=o.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),o.createElementVNode("span",S0e,[o.createTextVNode(o.toDisplayString(h("dataTable.showing"))+" ",1),o.createElementVNode("span",A0e,o.toDisplayString(Ru.value),1),o.createTextVNode(" "+o.toDisplayString(h("dataTable.to"))+" ",1),o.createElementVNode("span",T0e,o.toDisplayString(vm.value),1),o.createTextVNode(" "+o.toDisplayString(h("dataTable.of"))+" ",1),o.createElementVNode("span",P0e,o.toDisplayString(fl.value),1),o.createTextVNode(" "+o.toDisplayString(h("dataTable.data")),1)])]),o.createElementVNode("div",B0e,[o.createVNode(o.unref(Ege),{total:fl.value,"items-per-page":O.value,"sibling-count":1,"show-edges":"",page:I.value,"onUpdate:page":hl,class:"scale-90 origin-right",disabled:Di.value},{default:o.withCtx(()=>[o.createVNode(o.unref(Cge),{class:"flex items-center gap-1"},{default:o.withCtx(({items:ie})=>[o.createVNode(o.unref(Age),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Nge),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ie,(he,_e)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[he.type==="page"?(o.openBlock(),o.createBlock(o.unref(Tge),{key:_e,value:he.value,"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Fr),{class:"w-8 h-8 p-0 text-sm",variant:he.value===I.value?"default":"outline",disabled:he.value===I.value||Di.value,onClick:ze=>hl(he.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(he.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(o.openBlock(),o.createBlock(o.unref(Sge),{key:he.type,index:_e},null,8,["index"]))],64))),256)),o.createVNode(o.unref(Bge),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronRight),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Pge),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page","disabled"])])])):o.createCommentVNode("",!0),o.createVNode(Yo,{modelValue:ee.value,"onUpdate:modelValue":V[7]||(V[7]=ie=>ee.value=ie),title:Qy.value,icon:"AlertCircle","max-width":pt.value,persistent:!1},{actions:o.withCtx(()=>[o.createVNode(Vt,{variant:"outline",onClick:er,text:h("common.cancel")},null,8,["text"]),o.createVNode(Vt,{variant:"default",onClick:Nm,text:h("common.yes")},null,8,["text"])]),default:o.withCtx(()=>[o.createElementVNode("div",N0e,[o.createElementVNode("p",D0e,o.toDisplayString(Vy.value),1)])]),_:1},8,["modelValue","title","max-width"]),o.createVNode(Yo,{modelValue:K.value,"onUpdate:modelValue":V[10]||(V[10]=ie=>K.value=ie),title:Ic.value,description:ki.value,icon:"AlertCircle",size:(((xe=(me=ae.value)==null?void 0:me.dialogConfig)==null?void 0:xe.layoutSize)||"md").toLowerCase()},{actions:o.withCtx(()=>{var ie,he;return[o.createVNode(Vt,{variant:"outline",onClick:V[8]||(V[8]=_e=>K.value=!1),text:ve.value?h("common.close"):h("common.cancel")},null,8,["text"]),!ve.value&&!(e.dummyMode&&((ie=ae.value)!=null&&ie.route))?(o.openBlock(),o.createBlock(Vt,{key:0,variant:"default",onClick:z1,text:h("common.save")},null,8,["text"])):o.createCommentVNode("",!0),!ve.value&&e.dummyMode&&((he=ae.value)!=null&&he.route)?(o.openBlock(),o.createBlock(Vt,{key:1,variant:"default",onClick:V[9]||(V[9]=_e=>K.value=!1),text:h("common.close")},null,8,["text"])):o.createCommentVNode("",!0)]}),default:o.withCtx(()=>{var ie,he,_e,ze;return[o.createElementVNode("div",{class:o.normalizeClass(["grid gap-4 py-4 px-1 relative",o.unref(Ve)(((he=(ie=ae.value)==null?void 0:ie.dialogConfig)==null?void 0:he.layoutColumns)||((_e=ae.value)==null?void 0:_e.layoutColumns))])},[ue.value?(o.openBlock(),o.createElementBlock("div",M0e,[o.createElementVNode("div",R0e,[V[16]||(V[16]=o.createElementVNode("div",{class:"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin"},null,-1)),o.createElementVNode("span",I0e,o.toDisplayString(h("datatable.loadingData")),1)])])):o.createCommentVNode("",!0),e.dummyMode&&((ze=ae.value)!=null&&ze.route)?(o.openBlock(),o.createElementBlock("div",O0e,[o.createElementVNode("div",L0e,[o.createVNode(o.unref(Ne.Search),{class:"w-4 h-4"})]),o.createElementVNode("div",F0e,[o.createElementVNode("span",$0e,o.toDisplayString(h("datatable.navigationInfo")),1),o.createElementVNode("p",z0e,o.toDisplayString(h("datatable.navigationRouteInfo",{route:ae.value.route})),1)])])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Be.value,(qe,Qe)=>{var et,it,Et,Bt,qt,wt,Ft;return o.openBlock(),o.createElementBlock(o.Fragment,{key:Qe},[!qe.isHidden&&!o.unref(ne)(qe)&&o.unref(Re)(qe)&&!(e.dummyMode&&((et=ae.value)!=null&&et.route))?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(Fe)(qe,((Et=(it=ae.value)==null?void 0:it.dialogConfig)==null?void 0:Et.layoutColumns)||((Bt=ae.value)==null?void 0:Bt.layoutColumns)))},[o.createElementVNode("div",j0e,[o.createVNode(Fh,{class:"flex-1 w-full",field:Sm(qe),"model-value":ke[qe.model],"form-data":ke,required:o.unref(De)(qe),disabled:o.unref(Ie)(qe),readonly:o.unref(Ce)(qe),options:o.unref(Ke)(qe),"dynamic-labels":o.unref(ye)(qe),"dynamic-length":o.unref(Me)(qe),error:be[qe.model],"dummy-mode":e.dummyMode,"onUpdate:modelValue":St=>at(qe,St)},null,8,["field","model-value","form-data","required","disabled","readonly","options","dynamic-labels","dynamic-length","error","dummy-mode","onUpdate:modelValue"]),qe.isCopyable||(qt=qe.props)!=null&&qt.isCopyable||((wt=ae.value)==null?void 0:wt.action)==="showToken"||((Ft=ae.value)==null?void 0:Ft.action)==="copyToken"?(o.openBlock(),o.createBlock(Vt,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:h("common.copy"),onClick:St=>Gc(qe.model)},null,8,["tooltip","onClick"])):o.createCommentVNode("",!0)])],2)):o.createCommentVNode("",!0)],64)}),128))],2)]}),_:1},8,["modelValue","title","description","size"])])}}}),U0e={class:"back-label"},W0e=Mn(o.defineComponent({__name:"NavigationBackButton",props:{config:{default:null},locale:{default:"en"}},emits:["click"],setup(e,{emit:t}){const n=e,i=t,r=o.computed(()=>n.config?n.locale==="kr"||n.locale==="ko"?n.config.labelKR||n.config.labelEN||"뒤로":n.locale==="id"?n.config.labelID||n.config.labelEN||"Kembali":n.config.labelEN||"Back":n.locale==="kr"||n.locale==="ko"?"뒤로":n.locale==="id"?"Kembali":"Back"),s=o.computed(()=>Ne.ArrowLeft),a=()=>{i("click")};return(l,c)=>(o.openBlock(),o.createElementBlock("button",{type:"button",class:"navigation-back-button",onClick:a},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.value),{class:"back-icon"})),o.createElementVNode("span",U0e,o.toDisplayString(r.value),1)]))}}),[["__scopeId","data-v-44ccdfe5"]]),H0e={class:"dynamic-table-section-wrapper"},q0e={key:0,class:"floating-back-button"},K0e=Mn(o.defineComponent({__name:"DynamicTableSection",props:{section:{},dummyMode:{type:Boolean}},emits:["navigate"],setup(e,{emit:t}){const n=e,i=o.inject("dynamicFormContext",{}),{resolveSectionLabels:r,tableRows:s=()=>[],isTemporaryTable:a=()=>!1,handleDataTableAction:l=()=>{},resolvedBaseUrl:c="",permissionBase:d="",userPermissions:f=null,checkPermission:h=()=>!0,sectionLoading:m={},tokenCores:g=[],selectedTokenCore:v=null,sectionPagination:y={},fetchSectionData:A=async()=>{},navigation:C=null,locale:M="en"}=i,B=o.computed(()=>{const E=i.resolvedBaseUrl;return typeof E=="object"&&E!==null&&"value"in E?E.value:E});o.computed(()=>{const E=Pt(n.section),k=C==null?void 0:C.hasHistory,$=C==null?void 0:C.currentContext;return k&&$===E}),o.watchEffect(()=>{Pt(n.section)});const N=(E,k)=>{var O,q,X;const $=k==null?void 0:k.action;let I=null;if(E!=null&&E.headers){for(const oe of E.headers)if((O=oe.custom)!=null&&O.actionCustom&&(I=oe.custom.actionCustom.find(ue=>ue.key===$||ue.id===$),I))break}if(I!=null&&I.triggerNavigation){if(!C||typeof C.navigateTo!="function")return;const oe=(X=(q=n.section)==null?void 0:q.propsTable)==null?void 0:X.modelKey,te={...oe?{[oe]:k.row}:{...k.row},_rowIndex:k.rowIndex??0};C.navigateTo(I.triggerNavigation,te);return}l(E,k)},j=async E=>{const k=Pt(n.section);y&&y[k]&&(y[k].page=E,await A(k,n.section))},W=async E=>{const k=Pt(n.section);y&&y[k]&&(y[k].page=1,y[k].perPage=E,await A(k,n.section))},P=async()=>{const E=Pt(n.section);y&&y[E]&&(y[E].page=1),await A(E,n.section)};return(E,k)=>{var $,I,O,q,X,oe,ue,te;return o.openBlock(),o.createElementBlock("div",H0e,[(I=($=o.unref(C))==null?void 0:$.hasHistory)!=null&&I.value&&((q=(O=o.unref(C))==null?void 0:O.currentContext)==null?void 0:q.value)===o.unref(Pt)(e.section)?(o.openBlock(),o.createElementBlock("div",q0e,[o.createVNode(W0e,{config:o.unref(C).getCurrentBackButton(),locale:o.unref(M),onClick:k[0]||(k[0]=re=>o.unref(C).navigateBack())},null,8,["config","locale"])])):o.createCommentVNode("",!0),o.createVNode(Fo,{border:!0,padding:"",class:o.normalizeClass(["overflow-hidden",{"with-back-button":((oe=(X=o.unref(C))==null?void 0:X.hasHistory)==null?void 0:oe.value)&&((te=(ue=o.unref(C))==null?void 0:ue.currentContext)==null?void 0:te.value)===o.unref(Pt)(e.section)}])},{default:o.withCtx(()=>{var re,ge,ce;return[o.createVNode($h,{"table-config":e.section.propsTable,data:o.unref(s)(e.section.propsTable),nested:!0,"show-pagination":e.section.propsTable.pagination??!0,"has-actions":o.unref(a)(e.section.propsTable),"base-url":B.value,"dummy-mode":e.dummyMode,"permission-base":o.unref(d),"user-permissions":o.unref(f),"check-permission":o.unref(h),"token-cores":o.unref(g),"selected-token-core":o.unref(v),loading:o.unref(m)[e.section.key]||o.unref(m)[o.unref(Pt)(e.section)],"total-items":(re=o.unref(y)[o.unref(Pt)(e.section)])==null?void 0:re.totalData,page:((ge=o.unref(y)[o.unref(Pt)(e.section)])==null?void 0:ge.page)||1,"per-page":((ce=o.unref(y)[o.unref(Pt)(e.section)])==null?void 0:ce.perPage)||10,controlled:"",onAction:k[1]||(k[1]=se=>N(e.section.propsTable,se)),onNavigate:k[2]||(k[2]=se=>E.$emit("navigate",se)),"onUpdate:page":j,"onUpdate:perPage":W,onRefresh:P,onReset:P},null,8,["table-config","data","show-pagination","has-actions","base-url","dummy-mode","permission-base","user-permissions","check-permission","token-cores","selected-token-core","loading","total-items","page","per-page"])]}),_:1},8,["class"])])}}}),[["__scopeId","data-v-2a9f03e9"]]),G0e={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},Y0e={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},Z0e={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},X0e=o.defineComponent({__name:"DynamicFormDialogs",setup(e){const t=o.inject("dynamicFormContext",{}),{confirmDialog:n,t:i,confirmAction:r,tableDialogOpen:s,tableDialogTitle:a,tableDialogIcon:l,tableDialogFields:c,isFieldVisible:d,isFieldHidden:f,tableRowFormData:h,tableDialogViewOnly:m,isFieldRequired:g,isFieldDisabled:v,getFilteredItems:y,tableRowErrors:A,resolveFieldLabels:C,resolveFieldLength:M,resolvedBaseUrl:B,handleTableRowUpdate:N,locale:j,saveTableRow:W,confirmDeleteOpen:P,executeTableDelete:E,tableDialogSize:k}=t,$=o.computed(()=>{const I=o.unref(c);return Array.isArray(I)?I.some(O=>O.component==="DCodePdfViewer"||O.component==="DCodeWorkflowDiagram"):!1});return(I,O)=>(o.openBlock(),o.createElementBlock("div",null,[o.createVNode(Yo,{modelValue:o.unref(n).visible,"onUpdate:modelValue":O[1]||(O[1]=q=>o.unref(n).visible=q),title:o.unref(n).title,icon:"AlertTriangle","max-width":450,persistent:o.unref(n).isBlocking},{actions:o.withCtx(()=>[o.unref(n).showCancel?(o.openBlock(),o.createBlock(Vt,{key:0,variant:"outline",text:o.unref(n).cancelText||o.unref(i)("common.cancel"),onClick:O[0]||(O[0]=q=>o.unref(n).visible=!1)},null,8,["text"])):o.createCommentVNode("",!0),o.createVNode(Vt,{text:o.unref(n).okText||o.unref(i)("common.confirm"),onClick:o.unref(r)},null,8,["text","onClick"])]),default:o.withCtx(()=>[o.createElementVNode("div",G0e,o.toDisplayString(o.unref(n).message),1)]),_:1},8,["modelValue","title","persistent"]),o.createVNode(Yo,{modelValue:o.unref(s),"onUpdate:modelValue":O[3]||(O[3]=q=>o.isRef(s)?s.value=q:null),title:o.unref(a),icon:o.unref(l),size:o.unref(k)},o.createSlots({default:o.withCtx(()=>[o.unref(c).length?(o.openBlock(),o.createElementBlock("div",Y0e,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(c),q=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:q.key},[o.unref(d)(q,o.unref(h))?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(q.column==="FULL"?"md:col-span-2":"col-span-1")},[o.createVNode(Fh,{field:q,"model-value":o.unref(h)[q.model],"form-data":o.unref(h),required:o.unref(m)?!1:o.unref(g)(q,o.unref(h)),disabled:o.unref(m)||o.unref(v)(q,o.unref(h)),"view-only":o.unref(m),options:o.unref(y)(q,o.unref(h)),error:o.unref(m)?void 0:o.unref(A)[q.model],"dynamic-labels":o.unref(C)(q,o.unref(h)),"dynamic-length":o.unref(M)(q,o.unref(h)),"base-url":o.unref(B),"onUpdate:modelValue":X=>o.unref(N)(q.model,X)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)),[[o.vShow,!o.unref(f)(q,o.unref(h))]]):o.createCommentVNode("",!0)],64))),128))])):o.createCommentVNode("",!0)]),_:2},[$.value?void 0:{name:"actions",fn:o.withCtx(()=>[o.createVNode(Vt,{variant:"outline",text:o.unref(m)?o.unref(j)==="id"?"Tutup":"Close":o.unref(j)==="id"?"Batal":"Cancel",onClick:O[2]||(O[2]=q=>s.value=!1)},null,8,["text"]),o.unref(m)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Vt,{key:0,text:"Save",onClick:o.unref(W)},null,8,["onClick"]))]),key:"0"}]),1032,["modelValue","title","icon","size"]),o.createVNode(Yo,{modelValue:o.unref(P),"onUpdate:modelValue":O[5]||(O[5]=q=>o.isRef(P)?P.value=q:null),title:o.unref(j)==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:o.withCtx(()=>[o.createVNode(Vt,{variant:"outline",text:o.unref(j)==="id"?"Batal":"Cancel",onClick:O[4]||(O[4]=q=>P.value=!1)},null,8,["text"]),o.createVNode(Vt,{variant:"default","bg-color":"danger",icon:"Trash2",text:o.unref(j)==="id"?"Hapus":"Delete",onClick:o.unref(E)},null,8,["text","onClick"])]),default:o.withCtx(()=>[o.createElementVNode("div",Z0e,o.toDisplayString(o.unref(j)==="id"?"Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.":"Are you sure you want to delete this row? This action cannot be undone."),1)]),_:1},8,["modelValue","title"])]))}}),J0e={class:"w-full flex flex-col min-h-0"},Q0e={class:"flex-1 space-y-6 overflow-y-auto"},q0=o.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0},selectedTokenCore:{default:null},tokenCores:{default:()=>[]},dummyMode:{type:Boolean,default:!1},router:{default:null},permissionBase:{default:""},userPermissions:{default:null},checkPermission:{type:Function,default:void 0},dynamicForm:{},hideActions:{type:Boolean,default:!1},apiParams:{default:()=>({})}},emits:["submit","cancel","action","navigate","update:model","update:modelValue","success","error","step-change"],setup(e,{expose:t,emit:n}){const i=e,r=n,s=i.dynamicForm||CS(i,r);s&&(s.tableRowFormData||(s.tableRowFormData=o.reactive({}))),o.provide("dynamicFormContext",s);const{activeSchema:a,isSectionVisible:l,isSectionHidden:c,inlineState:d,isActionVisible:f,locale:h,isSubmitting:m,isSubmitDisabled:g,handleGlobalButtonClick:v,handleSubmit:y,fieldLoading:A,navigation:C,getSectionKey:M}=s,B=N=>{var P,E;s.revision.value;const j=M(N),W=(E=(P=C==null?void 0:C.navigationState)==null?void 0:P.value)==null?void 0:E.hiddenStates;return W&&j&&typeof W[j]=="boolean"?!W[j]:l(N)};return t({validate:()=>(s.isSubmitted.value=!0,s.validation.validateAll()),isDirty:()=>{const N=s.formData,j=s.originalData;if(!N||!j)return!1;const W=new Set([...Object.keys(N).filter(E=>!E.startsWith("_")),...Object.keys(j).filter(E=>!E.startsWith("_"))]),P=E=>E===void 0||E===""?null:E;for(const E of W)if(JSON.stringify(P(N[E]))!==JSON.stringify(P(j[E])))return!0;return!1},resetDirty:()=>{s.originalData&&s.formData&&Object.assign(s.originalData,JSON.parse(JSON.stringify(s.formData)))}}),(N,j)=>{var W,P,E,k,$,I;return o.openBlock(),o.createElementBlock("div",J0e,[o.createElementVNode("div",Q0e,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((W=o.unref(a))==null?void 0:W.sections,(O,q)=>{var X,oe;return o.openBlock(),o.createElementBlock(o.Fragment,{key:q},[((X=O.type)==null?void 0:X.toUpperCase())==="FORM"&&O.propsForm&&B(O)?o.withDirectives((o.openBlock(),o.createBlock(fge,{key:0,"dummy-mode":i.dummyMode,section:O,sIdx:Number(q)},null,8,["dummy-mode","section","sIdx"])),[[o.vShow,!o.unref(c)(O)]]):((oe=O.type)==null?void 0:oe.toUpperCase())==="TABLE"&&O.propsTable&&B(O)?o.withDirectives((o.openBlock(),o.createBlock(K0e,{key:1,"dummy-mode":i.dummyMode,section:O,onNavigate:j[0]||(j[0]=ue=>N.$emit("navigate",ue))},null,8,["dummy-mode","section"])),[[o.vShow,!o.unref(c)(O)]]):o.createCommentVNode("",!0)],64)}),128))]),!((P=o.unref(d))!=null&&P.global)&&!i.hideActions?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(((k=(E=o.unref(a))==null?void 0:E.ui)==null?void 0:k.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 mt-6 border-t border-neutral-100 dark:border-neutral-800")},[(I=($=o.unref(a))==null?void 0:$.actionGlobal)!=null&&I.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(o.unref(a).actionGlobal,(O,q)=>{var X,oe,ue,te,re;return o.openBlock(),o.createElementBlock(o.Fragment,{key:q},[O.propsActionGlobal&&o.unref(f)(O)&&(O.propsActionGlobal.type==="BUTTONGROUP"||O.buttons&&O.buttons.length||O.propsActionGlobal.buttons&&O.propsActionGlobal.buttons.length)?(o.openBlock(),o.createBlock(ba,{key:0,icon:O.propsActionGlobal.icon,"label-k-r":O.propsActionGlobal.labelKR,"label-e-n":O.propsActionGlobal.labelEN,"label-i-d":O.propsActionGlobal.labelID,"bg-color":((X=O.propsActionGlobal.bgColor)==null?void 0:X.toLowerCase())||"primary",variant:((oe=O.propsActionGlobal.variant)==null?void 0:oe.toLowerCase())||"default",buttons:O.buttons||O.propsCustom||O.propsActionGlobal.buttons||[],onAction:j[1]||(j[1]=ge=>o.unref(v)(ge)),onButtonClick:j[2]||(j[2]=ge=>o.unref(v)(ge))},null,8,["icon","label-k-r","label-e-n","label-i-d","bg-color","variant","buttons"])):O.propsActionGlobal&&o.unref(f)(O)?(o.openBlock(),o.createBlock(Vt,{key:1,icon:O.propsActionGlobal.icon,text:o.unref(h)==="kr"||o.unref(h)==="ko"?O.propsActionGlobal.labelKR||O.propsActionGlobal.labelEN:o.unref(h)==="id"?O.propsActionGlobal.labelID:O.propsActionGlobal.labelEN,"bg-color":((ue=O.propsActionGlobal.bgColor)==null?void 0:ue.toLowerCase())||"primary",variant:((te=O.propsActionGlobal.variant)==null?void 0:te.toLowerCase())||"default",loading:o.unref(m),disabled:o.unref(g)&&(O.permission==="CREATE"||O.permission==="UPDATE"||((re=O.propsActionGlobal)==null?void 0:re.key)==="submit"),onClick:ge=>o.unref(v)(O)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):o.createCommentVNode("",!0)],64)}),128)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.createVNode(X0e)])}}}),V0e=o.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class");return(i,r)=>(o.openBlock(),o.createBlock(o.unref(kt.Separator),o.mergeProps(o.unref(n),{class:o.unref(nn)("shrink-0 bg-border",t.orientation==="horizontal"?"h-px w-full":"w-px h-full",t.class)}),null,16,["class"]))}}),eye=["onClick"],tye={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},nye={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},iye={key:1},rye={key:0,class:"text-white"},oye={key:1},sye={key:2},aye=["disabled","onClick"],lye={key:1,class:"mr-2 text-sm font-bold opacity-70"},cye={class:"whitespace-normal text-sm text-center leading-tight"},dye={class:"flex flex-col flex-1 min-w-0"},uye={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},fye={class:"text-sm text-muted-foreground"},hye={class:"px-1"},mye=["disabled"],pye=["type","disabled"],gye=["disabled"],gk=Mn(o.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1},beforeNext:{},beforePrev:{}},emits:["update:modelValue","change","loaded","error"],setup(e,{emit:t}){const n=e,i=t,r=o.inject("externalApi")||{},s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const a=o.ref(n.defaultTab),l=o.computed({get(){var k;if(typeof n.modelValue=="string"){const $=(k=n.tabs)==null?void 0:k.findIndex(I=>I.key===n.modelValue);if($!==void 0&&$>=0)return $}return(typeof n.modelValue=="number"?n.modelValue:void 0)??a.value},set(k){var $;if(a.value=k,typeof n.modelValue=="string"){const I=($=n.tabs)==null?void 0:$[k];I?i("update:modelValue",I.key):i("update:modelValue",k)}else i("update:modelValue",k)}}),c=o.computed(()=>{var k;return((k=n.tabs)==null?void 0:k.length)??0}),d=o.computed(()=>{var k;return(k=n.tabs)==null?void 0:k[l.value]});function f(k){return c.value<=0?0:Math.min(Math.max(k,0),c.value-1)}function h(k){return k?typeof k=="string"?Es(k,tn):k:null}const m=o.reactive({});function g(k){return m[k.key]||(m[k.key]={loaded:!1,loading:!1,data:null,error:null}),m[k.key]}function v(){if(n.apiOptions)return typeof n.apiOptions=="function"?n.apiOptions():n.apiOptions}function y(k){const $=k.endpoint||{};return{apiModule:k.apiModule||$.apiModule,apiAction:k.apiAction||$.apiAction,apiUrl:$.apiUrl,apiMethod:$.apiMethod||"GET",apiParams:k.apiParams}}function A(k){if(n.isWizard||!n.allowTabClick||n.disabled)return!1;const $=n.tabs[k];return!(!$||$.disabled)}async function C(k){if(typeof k.tab.fetchData=="function"){const ue=await k.tab.fetchData(),te=(ue==null?void 0:ue.data)??ue;return(te==null?void 0:te.data)??te}const $=y(k.tab);if(!($.apiModule&&$.apiAction||$.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const O=v();let q;if($.apiUrl)q=await s("","",O,{_url:$.apiUrl,_method:$.apiMethod,_data:$.apiParams??void 0});else{const ue={...O,...$.apiParams};q=await s($.apiModule,$.apiAction,ue)}const X=(q==null?void 0:q.data)??q;return(X==null?void 0:X.data)??X}async function M(k,{force:$=!1}={}){const I=f(k),O=n.tabs[I];if(!O)return;const q=g(O);if(!(n.cache&&q.loaded&&!$)&&!q.loading){q.loading=!0,q.error=null;try{const X=await C({tabIndex:I,tab:O});q.data=X,q.loaded=!0,i("loaded",{tabIndex:I,tab:O,data:X})}catch(X){const oe=typeof(X==null?void 0:X.message)=="string"&&X.message||typeof X=="string"&&X||"Failed to load tab data.";q.error=oe,i("error",{tabIndex:I,tab:O,message:oe})}finally{q.loading=!1}}}function B(k){const $=f(k);A($)&&$!==l.value&&(l.value=$)}function N(k=l.value){return M(k,{force:!0})}const j=o.ref(!1),W=o.ref(!1);async function P(){if(n.beforePrev&&d.value){W.value=!0;try{if(!await n.beforePrev(d.value))return}finally{W.value=!1}}const k=f(l.value-1);k!==l.value&&(l.value=k)}async function E(){if(n.beforeNext&&d.value){j.value=!0;try{if(!await n.beforeNext(d.value))return}finally{j.value=!1}}const k=f(l.value+1);k!==l.value&&(l.value=k)}return o.watch(()=>n.tabs,k=>{for(const $ of k??[])g($)},{immediate:!0}),o.watch(()=>l.value,async k=>{var I;const $=(I=n.tabs)==null?void 0:I[k];$&&i("change",{tabIndex:k,tab:$}),await M(k)},{immediate:!0}),o.watch(()=>n.autoFetchOnMount,async k=>{k&&await M(l.value)},{immediate:!0}),(k,$)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":e.isVertical}])},[o.createElementVNode("div",{class:o.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":e.isVertical,"pb-2":e.isWizard&&!e.isVertical}])},[o.createElementVNode("div",{class:o.normalizeClass({"mt-4":!e.isVertical||e.isWizard})},[e.isWizard?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["w-full relative flex overflow-visible rounded-lg",e.isVertical?"flex-col gap-2":""])},[e.isVertical?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(e.tabs,(I,O)=>(o.openBlock(),o.createElementBlock("div",{key:I.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[o.createElementVNode("div",{class:o.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[O<l.value?"border-primary bg-primary text-primary-foreground":O===l.value?"border-primary text-primary ring-2 ring-primary/20":"border-border text-muted-foreground"]])},[e.typeWizard==="icon"&&I.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h(I.icon)),{key:0,class:"w-4 h-4"})):e.typeWizard==="number"||!I.icon&&e.typeWizard!=="none"?(o.openBlock(),o.createElementBlock("span",iye,[O<l.value?(o.openBlock(),o.createElementBlock("span",rye,"✓")):(o.openBlock(),o.createElementBlock("span",oye,o.toDisplayString(O+1),1))])):(o.openBlock(),o.createElementBlock("span",sye))],2),o.createElementVNode("span",{class:o.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",O===l.value?"text-primary":"text-muted-foreground"])},o.toDisplayString(I.title),3)]))),128)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(e.tabs,(I,O)=>(o.openBlock(),o.createElementBlock("div",{key:I.key,onClick:q=>B(O),style:o.normalizeStyle({zIndex:e.tabs.length-O}),class:"relative flex-1 group"},[o.createElementVNode("div",{class:o.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[O>0?"pl-8":"",O===l.value?"bg-primary text-primary-foreground":O<l.value?"bg-primary/10 text-primary hover:bg-primary/20":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"]])},[e.typeWizard==="icon"&&I.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h(I.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):e.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",tye,o.toDisplayString(O+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",nye,o.toDisplayString(I.title),1)],2),O<e.tabs.length-1?(o.openBlock(),o.createElementBlock("svg",{key:0,class:o.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[O===l.value?"fill-primary":O<l.value?"fill-primary/10 group-hover:fill-primary/20":"fill-muted group-hover:fill-muted/80"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...$[0]||($[0]=[o.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):o.createCommentVNode("",!0)],12,eye))),128))],2)):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex w-full",e.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.tabs,(I,O)=>(o.openBlock(),o.createElementBlock("button",{key:I.key,type:"button",disabled:!A(O),onClick:q=>B(O),class:o.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 border-border",o.unref(nn)("border-b border-r",!e.isVertical&&O===e.tabs.length-1&&"border-r-0",O===l.value?"bg-primary/10 text-primary font-semibold":"bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground",!A(O)&&"opacity-60 cursor-not-allowed",e.isVertical?"w-full justify-start border-r-0":"flex-1")])},[e.typeWizard==="icon"&&I.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h(I.icon)),{key:0,class:"h-4 w-4 shrink-0"})):e.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",lye,o.toDisplayString(O+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",cye,o.toDisplayString(I.title),1)],10,aye))),128))],2))],2)],2),e.isVertical?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(V0e),{key:0})),o.createElementVNode("div",dye,[o.createElementVNode("div",{class:o.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":e.isVertical}])},[o.createVNode(o.Transition,{name:"wizard-fade",mode:"out-in"},{default:o.withCtx(()=>{var I,O,q,X;return[(o.openBlock(),o.createElementBlock("div",{key:((I=d.value)==null?void 0:I.key)||l.value,class:"w-full"},[d.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(O=m[d.value.key])!=null&&O.loading?o.renderSlot(k.$slots,"loading",{tab:d.value,tabIndex:l.value},()=>[o.createElementVNode("div",uye,[o.createVNode(o.unref(Ne.Loader2),{class:"w-4 h-4 animate-spin"}),$[1]||($[1]=o.createTextVNode(" Loading... ",-1))])],!0,0):o.renderSlot(k.$slots,`tab-${d.value.key}`,{tab:d.value,tabIndex:l.value,data:(q=m[d.value.key])==null?void 0:q.data,loaded:(X=m[d.value.key])==null?void 0:X.loaded,reload:N},()=>[o.createElementVNode("div",fye,[$[2]||($[2]=o.createTextVNode(" Slot ",-1)),o.createElementVNode("code",hye,"tab-"+o.toDisplayString(d.value.key),1),$[3]||($[3]=o.createTextVNode(" belum dibuat. ",-1))])],!0,1)],64)):o.createCommentVNode("",!0)]))]}),_:3})],2),e.isWizard&&e.showNavigation?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":e.isVertical}])},[o.createElementVNode("button",{type:"button",onClick:P,disabled:l.value<=0||W.value||e.loading,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-background border border-border text-foreground shadow-sm hover:bg-muted hover:text-foreground hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-background disabled:hover:text-foreground disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-border focus:ring-offset-2 active:scale-95"},[W.value?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-4 h-4 animate-spin"})):o.createCommentVNode("",!0),$[4]||($[4]=o.createTextVNode(" Sebelumnya ",-1))],8,mye),l.value<c.value-1?(o.openBlock(),o.createElementBlock("button",{key:0,type:e.isSubmit?"submit":"button",onClick:E,disabled:j.value||e.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-primary-foreground transition-all duration-300 rounded-lg shadow-md bg-primary hover:bg-primary/90 hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-primary disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 active:scale-95"},[j.value?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-4 h-4 animate-spin"})):o.createCommentVNode("",!0),$[5]||($[5]=o.createTextVNode(" Selanjutnya ",-1))],8,pye)):e.isWizard?(o.openBlock(),o.createElementBlock("button",{key:1,type:"submit",disabled:e.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-primary-foreground transition-all duration-300 rounded-lg shadow-md bg-primary hover:bg-primary/90 hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-primary disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 active:scale-95"},[e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.submitText),1)],8,gye)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-998781d3"]]),yye={class:"w-full flex flex-col min-h-0"},bye={key:0,class:"flex-1 flex flex-col items-center justify-center text-neutral-400 py-16"},vye={class:"space-y-4 mt-4 min-h-[300px]"},wye={key:0,class:"flex items-center justify-end gap-2 border-b border-neutral-100 dark:border-neutral-800 pb-3 mb-2"},_ye={key:1,class:"flex flex-col items-center justify-center py-16 text-neutral-400"},kye={key:3,class:"flex-1 border-2 border-dashed border-neutral-200 dark:border-neutral-700 rounded-xl bg-neutral-50/50 dark:bg-neutral-900/30 flex flex-col items-center justify-center p-8 text-center min-h-[300px]"},xye={key:4,class:"flex-1 border-2 border-dashed border-red-200 dark:border-red-800 rounded-xl bg-red-50/50 dark:bg-red-900/10 flex flex-col items-center justify-center p-8 text-center min-h-[300px]"},Eye={class:"max-w-md space-y-3"},Cye={class:"text-xs text-red-400 max-w-xs mx-auto"},Sye={key:2,class:"flex items-center gap-2 flex-wrap pt-4 mt-6 border-t border-neutral-100 dark:border-neutral-800"},Aye={class:"py-2 text-sm text-neutral-600 dark:text-neutral-300 whitespace-pre-line"},Tye={class:"flex justify-end gap-2 mt-4"},yk=o.defineComponent({__name:"DynamicWizard",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},selectedTokenCore:{default:null},tokenCores:{default:()=>[]},dummyMode:{type:Boolean,default:!1},router:{default:null},permissionBase:{default:""},userPermissions:{default:null},checkPermission:{type:Function,default:void 0},hideActions:{type:Boolean,default:!1},apiParams:{default:()=>({})}},emits:["submit","cancel","action","update:model","step-change"],setup(e,{emit:t}){const n=e,i=t;let r;try{r=Yn.useI18n().locale}catch{r=o.ref("en")}const{apiUrl:s,DCodeApi:a}=o.inject("externalApi");let l;try{l=n.router||bs.useRouter()}catch{l={back:()=>{var z;return(z=window==null?void 0:window.history)==null?void 0:z.back()},currentRoute:o.computed(()=>({query:{},params:{},path:""}))}}const c=o.ref(0),d=o.reactive({}),f=o.reactive({}),h=o.reactive({}),m=o.ref({...n.model}),g=o.reactive({}),v=o.ref(!1),y=o.reactive({}),A=o.reactive({visible:!1,title:"",message:"",resolvePromise:null});console.log("[DynamicWizard] props.isEditMode:",n.isEditMode);const C=o.computed(()=>n.schema),M=o.computed(()=>{var z;return((z=C.value)==null?void 0:z.isWizard)===!1}),B=o.computed(()=>{if(!C.value)return[];if(Array.isArray(C.value.propsSteps)&&C.value.propsSteps.length>0)return C.value.propsSteps;if(Array.isArray(C.value.sections)){const z=C.value.sections.find(G=>{var ee,K;return((ee=G==null?void 0:G.type)==null?void 0:ee.toUpperCase())==="WIZARD"||((K=G==null?void 0:G.propsWizard)==null?void 0:K.propsSteps)});return z!=null&&z.propsWizard&&Array.isArray(z.propsWizard.propsSteps)?z.propsWizard.propsSteps:C.value.sections}return[]});o.watchEffect(()=>{B.value&&B.value.forEach((z,G)=>{var ee,K;console.log(`[DynamicWizard][STEP-INFO] idx: ${G}, code: ${z.code||z.key}, saveUrl: ${(ee=z.endpointSave)==null?void 0:ee.apiUrl}, updateUrl: ${(K=z.endpointUpdate)==null?void 0:K.apiUrl}`)})});const N=o.computed(()=>{var z,G;if(typeof((z=n.selectedTokenCore)==null?void 0:z.address)=="string")return n.selectedTokenCore.address;if((G=C.value)!=null&&G.idTokenCore&&Array.isArray(n.tokenCores)){const ee=String(C.value.idTokenCore),K=n.tokenCores.find(Y=>String(Y.id)===ee);if(K!=null&&K.address)return K.address}}),j=o.computed(()=>{const z=(typeof r=="object"&&"value"in r?r.value:r||"en").toLowerCase();return z.startsWith("en")?"EN":z.startsWith("kr")||z.startsWith("ko")?"KR":"ID"}),W=o.computed(()=>B.value.filter(z=>{var ee,K,Y,F;const G=((ee=z.logic)==null?void 0:ee.visibleRule)||((Y=(K=z.propsStep)==null?void 0:K.logic)==null?void 0:Y.visibleRule);if(G==null||G==="")return!0;try{Hv();const _={};if(B.value)for(const S of B.value){const T=S.payload||((F=S.propsStep)==null?void 0:F.payload);if(T&&typeof T=="object")try{const D=JSON.parse(JSON.stringify(T));Object.entries(D).forEach(([Z,J])=>{J&&typeof J=="object"&&!Array.isArray(J)?Z in J&&typeof J[Z]=="object"&&!Array.isArray(J[Z])?_[Z]={..._[Z]||{},...J[Z]}:_[Z]={..._[Z]||{},...J}:_[Z]=J})}catch{}}Object.entries(m.value).forEach(([S,T])=>{T&&typeof T=="object"&&!Array.isArray(T)?S in T&&typeof T[S]=="object"&&!Array.isArray(T[S])?_[S]={..._[S]||{},...T[S]}:_[S]={..._[S]||{},...T}:_[S]=T}),Object.values(g).forEach(S=>{S&&typeof S=="object"&&!Array.isArray(S)&&Object.assign(_,S)}),Object.values(_).forEach(S=>{S&&typeof S=="object"&&!Array.isArray(S)&&Object.entries(S).forEach(([T,D])=>{(_[T]===void 0||D!=null)&&(_[T]=D)})}),_._resolveLogicVar=S=>{if(_[S]!==void 0)return _[S];const T=S.split(".");let D=_;for(let J=0;J<T.length&&D!=null;J++)D=D[T[J]];if(D!==void 0)return D;if(S.endsWith(".code")||S.endsWith(".id")||S.endsWith(".value")){const J=S.replace(/\.(code|id|value)$/,""),fe=_._resolveLogicVar(J);if(fe!==void 0)return fe}const Z=T[T.length-1];if(_[Z]!==void 0)return _[Z]};const b=(S,T=0)=>{if(!(!S||typeof S!="object"||T>5))for(const[D,Z]of Object.entries(S))if(typeof Z=="number"){const J=new Number(Z);J.code=Z,J.id=Z,J.value=Z,S[D]=J}else if(typeof Z=="string"){const J=new String(Z);J.code=Z,J.id=Z,J.value=Z,S[D]=J}else typeof Z=="object"&&!Array.isArray(Z)&&b(Z,T+1)};b(_);let R;return typeof G=="string"?R=!!new Function("formData",`return ${G};`)(_):R=!!go.apply(G,_),console.log(`[DynamicWizard][visibleRule] step: ${z.code||z.key}, outcome: ${R}, rule:`,JSON.stringify(G)),R}catch(_){return console.warn(`[DynamicWizard] Gagal mengevaluasi visibleRule untuk step ${z.key}:`,_),!0}}).map((z,G)=>{var Y,F,_,b,R,S,T,D,Z,J,fe,ae,we,pe,ke,be,Se,ve,Be,Ee,Oe,Ae,Re,De,Ie,Ce,ne,ye,Me,Ke,$e;const ee=`title${j.value}`,K=`description${j.value}`;return console.log("[DynamicWizard][wizardTabs] mapping step:",z.code||z.key||G,{isEditMode:n.isEditMode,hasEndpointUpdate:!!z.endpointUpdate,endpointUpdateUrl:(Y=z.endpointUpdate)==null?void 0:Y.apiUrl,endpointSaveUrl:(F=z.endpointSave)==null?void 0:F.apiUrl}),{key:z.key||((_=z.propsStep)==null?void 0:_.key)||`step-${G}`,slotName:`tab-${z.key||((b=z.propsStep)==null?void 0:b.key)||`step-${G}`}`,modelKey:z.modelKey||((R=z.propsStep)==null?void 0:R.modelKey)||"",fieldMapping:((S=z.propsStep)==null?void 0:S.fieldMapping)||z.fieldMapping||null,title:z[ee]||z.titleEN||z.titleID||((T=z.propsStep)==null?void 0:T[ee])||((D=z.propsStep)==null?void 0:D.titleEN)||((Z=z.propsStep)==null?void 0:Z.titleID)||`Step ${G+1}`,description:z[K]||z.descriptionEN||z.descriptionID||((J=z.propsStep)==null?void 0:J[K])||((fe=z.propsStep)==null?void 0:fe.descriptionEN)||((ae=z.propsStep)==null?void 0:ae.descriptionID)||"",icon:z.icon||((we=z.propsStep)==null?void 0:we.icon)||void 0,isSubmit:z.isSubmit||((pe=z.propsStep)==null?void 0:pe.isSubmit)||!1,endpointActionStepNext:n.isEditMode&&((ke=z.endpointUpdate)!=null&&ke.apiUrl||(Se=(be=z.propsStep)==null?void 0:be.endpointUpdate)!=null&&Se.apiUrl)?z.endpointUpdate||((ve=z.propsStep)==null?void 0:ve.endpointUpdate):((Be=z.propsStep)==null?void 0:Be.endpointSave)||z.endpointSave||((Ee=z.propsStep)==null?void 0:Ee.endpointActionStepNext)||z.endpointActionStepNext,endpointActionStepPrev:((Oe=z.propsStep)==null?void 0:Oe.endpointActionStepPrev)||z.endpointActionStepPrev,actionComponent:z.actionComponent||((Ae=z.propsStep)==null?void 0:Ae.actionComponent)||[],responseMapping:((Re=z.propsStep)==null?void 0:Re.responseMapping)||z.responseMapping||{},requireConfirm:z.requireConfirm||((De=z.propsStep)==null?void 0:De.requireConfirm)||!1,requireConfirmAutomation:z.requireConfirmAutomation||((Ie=z.propsStep)==null?void 0:Ie.requireConfirmAutomation)||!1,confirmTitleID:z.confirmTitleID||((Ce=z.propsStep)==null?void 0:Ce.confirmTitleID)||"",confirmTitleEN:z.confirmTitleEN||((ne=z.propsStep)==null?void 0:ne.confirmTitleEN)||"",confirmTitleKR:z.confirmTitleKR||((ye=z.propsStep)==null?void 0:ye.confirmTitleKR)||"",confirmMessageID:z.confirmMessageID||((Me=z.propsStep)==null?void 0:Me.confirmMessageID)||"",confirmMessageEN:z.confirmMessageEN||((Ke=z.propsStep)==null?void 0:Ke.confirmMessageEN)||"",confirmMessageKR:z.confirmMessageKR||(($e=z.propsStep)==null?void 0:$e.confirmMessageKR)||""}})),P=async z=>{if(!(!z||d[z])){f[z]=!0;try{const G=await s(`/api/auto-layout/form/form-dynamic?code=${z}`,"GET");if(G!=null&&G.status){const ee=Array.isArray(G.data)?G.data[0]:G.data;if(ee){const K=JSON.parse(JSON.stringify(ee));M.value||delete K.actionGlobal,d[z]=K}}}catch(G){console.error(`[DynamicWizard] Failed to fetch form schema for code: ${z}`,G)}finally{f[z]=!1}}},E=async()=>{var ee,K;if(!B.value||B.value.length===0)return;const z=(K=(ee=B.value[0])==null?void 0:ee.fieldMapping)==null?void 0:K.formCode;z&&!d[z]&&await P(z);const G=new Set;B.value.slice(1).forEach(Y=>{var _;const F=(_=Y.fieldMapping)==null?void 0:_.formCode;F&&!d[F]&&G.add(F)}),Array.from(G).forEach((Y,F)=>{setTimeout(()=>{P(Y)},(F+1)*300)})},k=z=>z.modelKey?m.value[z.modelKey]||{}:m.value,$=(z,G)=>{var ee,K;if(z.modelKey){const Y=m.value[z.modelKey]||{},F=G&&typeof G=="object"&&z.modelKey in G?G[z.modelKey]:G;m.value={...m.value,[z.modelKey]:{...Y,...F}};const _=(ee=z.fieldMapping)==null?void 0:ee.formCode;_&&d[_]&&(d[_].payload=JSON.parse(JSON.stringify(m.value[z.modelKey])))}else{m.value={...m.value,...G};const Y=(K=z.fieldMapping)==null?void 0:K.formCode;Y&&d[Y]&&(d[Y].payload=JSON.parse(JSON.stringify(m.value)))}i("update:model",m.value)},I=z=>d[z]||null,O=(z,G)=>{G?y[z]=G:delete y[z]},q=async z=>{var F;console.log("[DynamicWizard] handleBeforeNext triggered for tab:",z);const G=z.endpointActionStepNext;console.log("[DynamicWizard] Resolved endpoint configuration:",G);const ee=y[z.key],K=((F=W.value[W.value.length-1])==null?void 0:F.key)===z.key;if(ee&&!ee.validate())return console.log("[DynamicWizard] Validation failed"),xt.error(j.value==="ID"?"Mohon lengkapi data wajib isi terlebih dahulu":"Please complete all required fields",{autoClose:3e3}),!1;if(n.dummyMode)return console.log("[DynamicWizard] Dummy mode active"),xt.info(j.value==="ID"?"Simulasi langkah selanjutnya (Dummy Mode)":"Next step simulated (Dummy Mode)",{autoClose:2e3}),!0;const Y=ee!=null&&ee.isDirty?ee.isDirty():!0;if(console.log("[DynamicWizard] Form dirty check:",{isFormDirty:Y,isEditMode:n.isEditMode,isLastStep:K,activeForm:ee}),!Y&&n.isEditMode&&!K)return console.log(`[DynamicWizard] Skipping API call for step "${z.titleID||z.key}" because form is not dirty in Edit Mode.`),!0;if(!(G!=null&&G.apiUrl))return console.log("[DynamicWizard] Skipping API call because ep.apiUrl is missing or undefined."),!0;if(z.requireConfirm||z.requireConfirmAutomation){const _=j.value==="KR"?z.confirmTitleKR:j.value==="ID"?z.confirmTitleID:z.confirmTitleEN,b=j.value==="KR"?z.confirmMessageKR:j.value==="ID"?z.confirmMessageID:z.confirmMessageEN;if(A.title=_||(j.value==="ID"?"Konfirmasi":"Confirmation"),A.message=b||(j.value==="ID"?"Apakah Anda yakin ingin melanjutkan?":"Are you sure you want to continue?"),A.visible=!0,!await new Promise(S=>{A.resolvePromise=S}))return!1}try{v.value=!0;const _=z.modelKey?m.value[z.modelKey]||{}:{...m.value};console.log("[nested dynamic][STEP-DATA] Raw stepData for tab:",z.titleID||z.key,JSON.parse(JSON.stringify(_)));const b={};Object.values(g).forEach(ae=>{ae&&typeof ae=="object"&&Object.assign(b,ae)});let R={};G.fieldMapping&&Object.keys(G.fieldMapping).length>0?(console.log("[nested dynamic][MAPPING-START] Applying fieldMapping rules:",G.fieldMapping),Object.entries(G.fieldMapping).forEach(([ae,we])=>{let pe=ae;z.modelKey&&ae.startsWith(`${z.modelKey}.`)&&(pe=ae.substring(z.modelKey.length+1));const ke=pe.lastIndexOf("."),be=ke>=0?pe.substring(ke+1):null;let Se=Ye(_,pe);if(Se==null&&(Se=Ye(_,ae)),Se==null&&be&&(Se=Ye(_,be)),Se==null&&(Se=_[pe]??_[ae]),Se==null&&be&&(Se=_[be]),(Se==null||Array.isArray(Se)&&Se.length===0)&&pe.includes(".")){const Ee=pe.indexOf("."),Oe=pe.substring(0,Ee),Ae=pe.substring(Ee+1),Re=Object.keys(_).filter(De=>De.startsWith(`${Oe}.`)&&De.endsWith(`.${Ae}`));if(Re.length>0){console.log(`[nested dynamic][INDEXED-KEY] Found indexed keys for "${pe}":`,Re);let De=!1;if(Re.forEach(Ie=>{const Ce=_[Ie];if(Array.isArray(Ce)&&Ce.length>0&&Array.isArray(we)&&we.length>0){const ne=we[0];if(typeof ne=="object"&&ne!==null){const ye=Object.entries(ne),Me=Ce.map(Ve=>{const Fe={};return ye.forEach(([Ue,at])=>{let nt=Ye(Ve,Ue);if(nt==null){const hn=Ue.lastIndexOf("."),Jt=hn>=0?Ue.substring(hn+1):Ue;nt=Ve[Jt]??Ve[Ue]}if(nt==null&&Ue.includes(".")){const hn=Ue.split(".");for(let Jt=1;Jt<hn.length;Jt++){const cn=hn.slice(Jt).join("."),vn=Ve[cn]??Ye(Ve,cn)??void 0;if(vn!=null){nt=vn;break}}}const Tt=typeof nt;nt!=null&&Tt==="object"&&!Array.isArray(nt)&&(nt=nt.id??nt.code??nt.value??nt),nt!==void 0&&(Fe[at]=nt)}),Fe}),Ke=Ie.substring(Oe.length),$e=Ae.includes(".")?Ae.substring(Ae.lastIndexOf(".")):`.${Ae}`,He=Ke.replace(new RegExp(`\\.${Ae}$`),""),rt=`${Oe}${He}${$e}`;R[rt]=Me,De=!0,console.log(`[nested dynamic][INDEXED-MAPPED] Mapped "${Ie}" -> "${rt}":`,Me)}}}),De)return}}if(Se==null||Array.isArray(Se)&&Se.length===0){if(Array.isArray(we)&&we.length>0){const Ee=we[0];if(typeof Ee=="object"&&Ee!==null){const Ae=Object.entries(Ee).map(([De])=>{const Ie=De.indexOf(".");return Ie>=0?De.substring(0,Ie):De}),Re=Ae.length>0?Ae[0]:null;if(Re&&Ae.every(De=>De===Re)){const De=Ye(_,Re);Array.isArray(De)&&De.length>0&&(Se=De,console.log(`[nested dynamic][FALLBACK-SOURCE] Resolved source array for "${ae}" via template prefix "${Re}":`,Se))}}}if(Se==null||Array.isArray(Se)&&Se.length===0)return}if(Array.isArray(we)&&we.length>0){const Ee=we[0],Oe=Array.isArray(Se)?Se:[];if(typeof Ee=="object"&&Ee!==null){const Ae=Object.entries(Ee);if(Ae.length===1&&(Ae[0][1]===pe||ae.includes(".")&&Ae[0][1]!==pe&&!_[pe])){const[De,Ie]=Ae[0],Ce=Oe.map(ye=>{let Me=Ye(ye,De);if(Me==null){const Ke=De.lastIndexOf("."),$e=Ke>=0?De.substring(Ke+1):De;Me=ye[$e]??ye[De]}if(Me==null&&De.includes(".")){const Ke=De.split(".");for(let $e=1;$e<Ke.length;$e++){const He=Ke.slice($e).join("."),rt=ye[He]??Ye(ye,He)??void 0;if(rt!=null){Me=rt;break}}}if(Me!=null&&typeof Me=="object"&&!Array.isArray(Me)){const Ke=Me;Me=Ke.id??Ke.code??Ke.value??Ke}return Me}).filter(ye=>ye!=null),ne=Ie||pe;Array.isArray(R[ne])?R[ne].push(...Ce):R[ne]=Ce,console.log(`[nested dynamic][ARRAY-FLAT] Extracted primitive array for "${pe}" -> "${ne}":`,R[ne])}else R[pe]=Oe.map(De=>{const Ie={};return Ae.forEach(([Ce,ne])=>{let ye=Ye(De,Ce);if(ye==null){const $e=Ce.lastIndexOf("."),He=$e>=0?Ce.substring($e+1):Ce;ye=De[He]??De[Ce]}if(ye==null&&Ce.includes(".")){const $e=Ce.split(".");for(let He=1;He<$e.length;He++){const rt=$e.slice(He).join("."),Ve=De[rt]??Ye(De,rt)??void 0;if(Ve!=null){ye=Ve;break}}}const Me=typeof ye;ye!=null&&Me==="object"&&!Array.isArray(ye)&&(ye=ye.id??ye.code??ye.value??ye),ye!==void 0&&(Ie[ne]=ye)}),Ie}),console.log(`[nested dynamic][ARRAY-OBJECT] Mapped object array for "${pe}":`,R[pe])}else typeof Ee=="string"&&(R[Ee]=Oe,console.log(`[nested dynamic][ARRAY-SIMPLE] Mapped simple array for "${pe}" -> "${Ee}":`,R[Ee]));return}const Be=we;Se&&typeof Se=="object"&&!Array.isArray(Se)&&(Be.toLowerCase().endsWith("id")||Be.toLowerCase().endsWith("_id"))?R[Be]=Se.id!==void 0?Se.id:Se.value!==void 0?Se.value:Se:R[Be]=Se,console.log(`[nested dynamic][SIMPLE-FIELD] Mapped field "${pe}" -> "${Be}":`,R[Be])})):R={..._};const S=Object.keys(R).filter(ae=>ae.includes("."));if(S.length>0){console.log("[nested dynamic][CHILD-NESTING-START] Processing child table nesting for dotted keys:",S);for(const ae of S){const we=ae.split("."),pe=we[0],ke=R[pe],be=R[ae];if(Array.isArray(ke)){if(we.length===3&&!isNaN(Number(we[1]))){const Se=Number(we[1]),ve=we[2];ke[Se]&&typeof ke[Se]=="object"&&(ke[Se][ve]=Array.isArray(be)?be:[be],console.log(`[nested dynamic][CHILD-NESTING] Attached indexed child data to "${pe}[${Se}].${ve}":`,ke[Se][ve]))}else if(we.length===2){const Se=we[1];if(Array.isArray(be)&&be.length>0)for(const ve of ke)ve&&typeof ve=="object"&&(!ve[Se]||Array.isArray(ve[Se])&&ve[Se].length===0)&&(ve[Se]=be,console.log(`[nested dynamic][CHILD-NESTING] Attached flat child data to "${pe}.${Se}":`,be))}}delete R[ae]}}const T=oe(G.keyParam||[]),D={...R,...T};console.log("[nested dynamic][FINAL-PAYLOAD] Final submit payload:",JSON.parse(JSON.stringify(D)));const Z=vo(G.apiUrl,N.value),J=await s(Z,G.apiMethod||"POST",D),fe=(J==null?void 0:J.status)===!0||(J==null?void 0:J.success)===!0||(J==null?void 0:J.code)===200||(J==null?void 0:J.code)==="00"||(J==null?void 0:J.status)==="SUCCESS";if(fe){const ae=z.key||z.id;let we=(J==null?void 0:J.data)||(J==null?void 0:J.payload)||J;if(Array.isArray(we)&&we.length>0&&(we=we[0]),g[ae]=we,ee!=null&&ee.resetDirty&&ee.resetDirty(),we&&typeof we=="object"){const pe=["status","success","code","message","error","errorCode","errorMessage"],ke=Bf(we);if(typeof window<"u"&&window.history){const be=new URL(window.location.href);let Se=!1;Object.entries(ke).forEach(([ve,Be])=>{!pe.includes(ve)&&Be!==null&&Be!==void 0&&(typeof Be=="string"||typeof Be=="number"||typeof Be=="boolean")&&be.searchParams.get(ve)!==String(Be)&&(be.searchParams.set(ve,String(Be)),Se=!0)}),Se&&window.history.replaceState(window.history.state,"",be.toString())}}}return fe}catch(_){return console.error("[DynamicWizard] Error in handleBeforeNext:",_),!1}finally{v.value=!1}},X=async z=>{if(n.dummyMode)return!0;const G=z.endpointActionStepPrev;if(!(G!=null&&G.apiUrl))return!0;try{const ee=vo(G.apiUrl,N.value),K=oe(G.keyParam||[]);return await s(ee,G.apiMethod||"POST",K),!0}catch(ee){return console.error("[DynamicWizard] Error in handleBeforePrev:",ee),!0}},oe=z=>{var ee,K,Y;const G={};if(!Array.isArray(z)||z.length===0){const F=(Y=(K=(ee=l==null?void 0:l.currentRoute)==null?void 0:ee.value)==null?void 0:K.params)==null?void 0:Y.id;return F&&(G.id=F),G}return z.forEach(F=>{var _,b,R,S,T,D;if(typeof F=="string"){let Z;if(F.startsWith("$route.")){const J=F.replace("$route.","");n.apiParams&&n.apiParams[J]!==void 0&&n.apiParams[J]!==null?Z=n.apiParams[J]:Z=(R=(b=(_=l==null?void 0:l.currentRoute)==null?void 0:_.value)==null?void 0:b.params)==null?void 0:R[J]}else if(F.startsWith("$query.")){const J=F.replace("$query.","");if(n.apiParams&&n.apiParams[J]!==void 0&&n.apiParams[J]!==null)Z=n.apiParams[J];else{if(typeof window<"u"){const fe=new URLSearchParams(window.location.search);fe.has(J)&&(Z=fe.get(J))}Z===void 0&&(Z=(D=(T=(S=l==null?void 0:l.currentRoute)==null?void 0:S.value)==null?void 0:T.query)==null?void 0:D[J])}}else if(F.startsWith("$value(")){const J=F.match(/\$value\(([^)]+)\)/);Z=J?J[1].replace(/^['"]|['"]$/g,""):void 0}else{if(Z=m.value[F],Z===void 0)for(const J of Object.keys(m.value)){const fe=m.value[J];if(fe&&typeof fe=="object"&&F in fe){Z=fe[F];break}}if(Z===void 0)for(const J of Object.keys(g)){const fe=g[J];if(fe&&typeof fe=="object"&&F in fe){Z=fe[F];break}}}if(Z!=null&&Z!==""){const J=F.startsWith("$")&&F.split(".").pop()||F;G[J]=Z}}else typeof F=="object"&&F!==null&&Object.entries(F).forEach(([Z,J])=>{var we,pe,ke,be,Se,ve,Be,Ee,Oe,Ae,Re,De,Ie,Ce,ne,ye,Me,Ke;const fe=J;let ae;if(fe.startsWith("$route.")){const $e=fe.replace("$route.","");n.apiParams&&n.apiParams[$e]!==void 0&&n.apiParams[$e]!==null?ae=n.apiParams[$e]:ae=((ke=(pe=(we=l==null?void 0:l.currentRoute)==null?void 0:we.value)==null?void 0:pe.params)==null?void 0:ke[$e])||((ve=(Se=(be=l==null?void 0:l.currentRoute)==null?void 0:be.value)==null?void 0:Se.query)==null?void 0:ve[$e])}else if(fe.startsWith("$query.")){const $e=fe.replace("$query.","");if(n.apiParams&&n.apiParams[$e]!==void 0&&n.apiParams[$e]!==null)ae=n.apiParams[$e];else{if(typeof window<"u"){const He=new URLSearchParams(window.location.search);He.has($e)?ae=He.get($e):He.has(Z)&&(ae=He.get(Z))}ae===void 0&&(ae=((Oe=(Ee=(Be=l==null?void 0:l.currentRoute)==null?void 0:Be.value)==null?void 0:Ee.query)==null?void 0:Oe[$e])||((De=(Re=(Ae=l==null?void 0:l.currentRoute)==null?void 0:Ae.value)==null?void 0:Re.query)==null?void 0:De[Z]))}}else if(ae=m.value[fe],ae===void 0)for(const $e of Object.keys(m.value)){const He=m.value[$e];if(He&&typeof He=="object"&&fe in He){ae=He[fe];break}}if(ae==null||ae===""){if(typeof window<"u"){const $e=new URLSearchParams(window.location.search);$e.has(Z)&&(ae=$e.get(Z))}ae===void 0&&(ae=((ne=(Ce=(Ie=l==null?void 0:l.currentRoute)==null?void 0:Ie.value)==null?void 0:Ce.query)==null?void 0:ne[Z])||((Ke=(Me=(ye=l==null?void 0:l.currentRoute)==null?void 0:ye.value)==null?void 0:Me.params)==null?void 0:Ke[Z]))}ae!=null&&ae!==""&&(G[Z]=ae)})}),Object.keys(G).forEach(F=>{const _=G[F];typeof _=="string"&&_!==""&&!isNaN(Number(_))&&(G[F]=Number(_))}),G},ue=async()=>{const z=W.value[c.value];z&&!await q(z)||i("submit",m.value)},te=()=>{i("cancel")},re=()=>{A.resolvePromise&&(A.resolvePromise(!0),A.resolvePromise=null),A.visible=!1},ge=()=>{A.resolvePromise&&(A.resolvePromise(!1),A.resolvePromise=null),A.visible=!1},ce=async(z,G)=>{if(z==="cancel"){te();return}i("action",G,m.value)},se=async(z,G)=>{var K,Y;if(n.isEditMode)return;const ee=d[G];if(ee!=null&&ee.sections)for(const F of ee.sections){const _=(K=F.propsForm)==null?void 0:K.endpointForm;if(((Y=_==null?void 0:_.apiMethod)==null?void 0:Y.toUpperCase())==="GET"&&(_==null?void 0:_.byPassMode)===!0&&(_!=null&&_.apiUrl)){const b=vo(_.apiUrl,N.value),R=oe(_.keyParam||[]);try{f[G]=!0;const S=await s(b,"GET",R);if((S==null?void 0:S.status)===!0||(S==null?void 0:S.success)===!0||(S==null?void 0:S.code)===200||(S==null?void 0:S.code)==="00"||(S==null?void 0:S.status)==="SUCCESS"){let D=(S==null?void 0:S.data)||(S==null?void 0:S.payload)||S;Array.isArray(D)&&D.length>0&&(D=D[0]),S!=null&&S.payload&&(D={...D,...S.payload}),D&&typeof D=="object"&&$(z,D)}}catch(S){console.error("[DynamicWizard] Fetch step data failed:",S)}finally{f[G]=!1,h[G]=(h[G]||0)+1}}}};return o.watch(c,async z=>{var ee;const G=B.value[z];if(G){i("step-change",G.key||`step-${z}`);const K=(ee=G.fieldMapping)==null?void 0:ee.formCode;K&&(d[K]||await P(K),se(G,K))}},{immediate:!0}),o.watch(()=>n.model,z=>{z&&Object.keys(z).length>0&&(m.value={...m.value,...z})},{deep:!0}),o.watch(()=>{var z;return(z=C.value)==null?void 0:z.propsSteps},()=>{E()},{immediate:!0}),(z,G)=>{var ee,K,Y,F,_,b;return o.openBlock(),o.createElementBlock("div",yye,[B.value.length===0?(o.openBlock(),o.createElementBlock("div",bye,[...G[2]||(G[2]=[o.createElementVNode("span",{class:"text-4xl mb-3"},"📋",-1),o.createElementVNode("p",null,"No wizard steps configured",-1)])])):(o.openBlock(),o.createElementBlock("form",{key:1,onSubmit:o.withModifiers(ue,["prevent"]),class:"w-full"},[o.createVNode(gk,{modelValue:c.value,"onUpdate:modelValue":G[0]||(G[0]=R=>c.value=R),tabs:W.value,"auto-fetch-on-mount":!1,"is-vertical":((ee=C.value)==null?void 0:ee.isVertical)||!1,"is-wizard":((K=C.value)==null?void 0:K.isWizard)!==!1,"type-wizard":((F=(Y=C.value)==null?void 0:Y.typeWizard)==null?void 0:F.toLowerCase())||"icon",loading:v.value,"before-next":q,"before-prev":X},o.createSlots({_:2},[o.renderList(W.value,R=>({name:R.slotName,fn:o.withCtx(()=>{var S,T,D,Z,J;return[o.createElementVNode("div",vye,[(S=R.actionComponent)!=null&&S.length?(o.openBlock(),o.createElementBlock("div",wye,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(R.actionComponent,(fe,ae)=>{var we,pe,ke,be,Se,ve,Be;return o.openBlock(),o.createBlock(Vt,{key:ae,icon:fe.icon||((we=fe.propsActionGlobal)==null?void 0:we.icon),text:j.value==="KR"?fe.labelKR||((pe=fe.propsActionGlobal)==null?void 0:pe.labelKR)||fe.labelEN||((ke=fe.propsActionGlobal)==null?void 0:ke.labelEN):j.value==="ID"?fe.labelID||((be=fe.propsActionGlobal)==null?void 0:be.labelID):fe.labelEN||((Se=fe.propsActionGlobal)==null?void 0:Se.labelEN),"bg-color":(fe.bgColor||((ve=fe.propsActionGlobal)==null?void 0:ve.bgColor)||"primary").toLowerCase(),variant:(fe.variant||((Be=fe.propsActionGlobal)==null?void 0:Be.variant)||"outline").toLowerCase(),size:"sm",onClick:Ee=>ce(fe.key||"action",fe)},null,8,["icon","text","bg-color","variant","onClick"])}),128))])):o.createCommentVNode("",!0),(T=R.fieldMapping)!=null&&T.formCode&&f[R.fieldMapping.formCode]?(o.openBlock(),o.createElementBlock("div",_ye,[...G[3]||(G[3]=[o.createElementVNode("div",{class:"w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full animate-spin mb-3"},null,-1),o.createElementVNode("span",{class:"text-xs"},"Loading form...",-1)])])):(D=R.fieldMapping)!=null&&D.formCode&&d[R.fieldMapping.formCode]?(o.openBlock(),o.createBlock(q0,{ref:fe=>O(R.key,fe),key:`form-${R.fieldMapping.formCode}-${h[R.fieldMapping.formCode]||0}`,schema:I(R.fieldMapping.formCode),model:k(R),"onUpdate:model":fe=>$(R,fe),onCancel:te,"is-edit-mode":e.isEditMode,loading:!1,"selected-token-core":e.selectedTokenCore,"token-cores":e.tokenCores,"dummy-mode":e.dummyMode,router:o.unref(l),"permission-base":e.permissionBase,"user-permissions":e.userPermissions,"check-permission":e.checkPermission,"hide-actions":!M.value},null,8,["schema","model","onUpdate:model","is-edit-mode","selected-token-core","token-cores","dummy-mode","router","permission-base","user-permissions","check-permission","hide-actions"])):(Z=R.fieldMapping)!=null&&Z.formCode?(o.openBlock(),o.createElementBlock("div",xye,[o.createElementVNode("div",Eye,[G[5]||(G[5]=o.createElementVNode("div",{class:"text-4xl"},"⚠️",-1)),G[6]||(G[6]=o.createElementVNode("h3",{class:"text-lg font-semibold text-red-700 dark:text-red-400"}," Form Load Failed ",-1)),o.createElementVNode("p",Cye," Failed to load form schema for code: "+o.toDisplayString((J=R.fieldMapping)==null?void 0:J.formCode),1),o.createVNode(Vt,{onClick:fe=>{var ae;return P((ae=R.fieldMapping)==null?void 0:ae.formCode)},text:"Retry",variant:"outline","bg-color":"danger",size:"sm",icon:"RefreshCw"},null,8,["onClick"])])])):(o.openBlock(),o.createElementBlock("div",kye,[...G[4]||(G[4]=[o.createElementVNode("div",{class:"max-w-md space-y-3"},[o.createElementVNode("div",{class:"text-4xl"},"📄"),o.createElementVNode("h3",{class:"text-lg font-semibold text-neutral-700 dark:text-neutral-300"}," No Form Assigned "),o.createElementVNode("p",{class:"text-xs text-neutral-400 max-w-xs mx-auto"}," This wizard step does not have a form code assigned. Configure the step's field mapping to link a form. ")],-1)])]))])]})}))]),1032,["modelValue","tabs","is-vertical","is-wizard","type-wizard","loading"])],32)),!e.hideActions&&((b=(_=C.value)==null?void 0:_.actionGlobal)!=null&&b.length)?(o.openBlock(),o.createElementBlock("div",Sye,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.value.actionGlobal,(R,S)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:S},[R.propsActionGlobal?(o.openBlock(),o.createBlock(Vt,{key:0,icon:R.propsActionGlobal.icon,text:j.value==="KR"?R.propsActionGlobal.labelKR||R.propsActionGlobal.labelEN:j.value==="ID"?R.propsActionGlobal.labelID:R.propsActionGlobal.labelEN,"bg-color":(R.propsActionGlobal.bgColor||"primary").toLowerCase(),variant:(R.propsActionGlobal.variant||"default").toLowerCase(),loading:v.value,onClick:T=>{var D;return ce(((D=R.propsActionGlobal)==null?void 0:D.key)||"action",R)}},null,8,["icon","text","bg-color","variant","loading","onClick"])):o.createCommentVNode("",!0)],64))),128))])):o.createCommentVNode("",!0),o.createVNode(Yo,{modelValue:A.visible,"onUpdate:modelValue":G[1]||(G[1]=R=>A.visible=R),title:A.title,icon:"AlertTriangle","max-width":450,persistent:""},{footer:o.withCtx(()=>[o.createElementVNode("div",Tye,[o.createVNode(Vt,{variant:"outline",text:j.value==="ID"?"Batal":"Cancel",onClick:ge},null,8,["text"]),o.createVNode(Vt,{"bg-color":"primary",text:j.value==="ID"?"Ya, Lanjutkan":"Confirm",onClick:re},null,8,["text"])])]),default:o.withCtx(()=>[o.createElementVNode("div",Aye,o.toDisplayString(A.message),1)]),_:1},8,["modelValue","title"])])}}}),Pye={class:"w-full space-y-6 animate-pulse"},Bye={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},Nye=o.defineComponent({__name:"AutoLayoutSkeleton",setup(e){return(t,n)=>(o.openBlock(),o.createElementBlock("div",Pye,[n[2]||(n[2]=o.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(2,i=>o.createElementVNode("div",{key:i,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[n[1]||(n[1]=o.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[o.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),o.createElementVNode("div",Bye,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(6,r=>o.createElementVNode("div",{key:r,class:o.normalizeClass(r>4?"md:col-span-2":"col-span-1")},[...n[0]||(n[0]=[o.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),o.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),n[3]||(n[3]=o.createElementVNode("div",{class:"flex items-center gap-2"},[o.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),o.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),Dye={class:"w-full"},Mye={class:"relative mx-auto min-h-[37.5rem]"},Rye={key:"content",class:"w-full"},Iye={class:"mb-6"},Oye={class:"text-neutral-500 dark:text-neutral-400"},Lye={key:"skeleton",class:"w-full"},Fye={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},K0=Mn(o.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},apiToken:{},isEditMode:{type:Boolean},model:{},selectedTokenCore:{},router:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function},dummyMode:{type:Boolean},config:{},schema:{},hideActions:{type:Boolean},apiParams:{}},emits:["submit-success","cancel","action-success","update:model","navigate"],setup(e,{emit:t}){var te,re,ge,ce,se,z,G,ee;const n=e,i=t,r=(re=(te=o.getCurrentInstance())==null?void 0:te.appContext)==null?void 0:re.app;r&&!r._context.provides[Symbol.for("vue-router-route-location")]&&r.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const K=bs.useRoute();if(K&&Object.keys(K).length>0)s=K;else{const Y=o.getCurrentInstance();(se=(ce=(ge=Y==null?void 0:Y.appContext)==null?void 0:ge.config)==null?void 0:ce.globalProperties)!=null&&se.$route&&(s=Y.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let a={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:K=>{if(typeof window<"u"){if(typeof K=="string")window.location.href=K;else if(K&&(K.path||K.name)){const Y=K.path||"/",F=new URL(Y,window.location.origin);K.query&&Object.entries(K.query).forEach(([_,b])=>F.searchParams.set(_,String(b))),window.location.href=F.toString()}}},replace:async K=>{if(typeof window<"u"&&window.history){const Y=new URL(window.location.href);K.query&&Object.entries(K.query).forEach(([F,_])=>Y.searchParams.set(F,String(_))),window.history.replaceState({},"",Y.toString())}},currentRoute:o.computed(()=>({query:(s==null?void 0:s.query)||{},params:(s==null?void 0:s.params)||{},path:(s==null?void 0:s.path)||""})),__isFallback:!0};try{const K=n.router||bs.useRouter();if(K)a=K;else{const Y=o.getCurrentInstance();(ee=(G=(z=Y==null?void 0:Y.appContext)==null?void 0:z.config)==null?void 0:G.globalProperties)!=null&&ee.$router&&(a=Y.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=o.inject("externalApi");let d;try{d=Yn.useI18n().locale}catch{d=o.ref("en")}const{setPageTitle:f}=dS(),h=o.computed(()=>n.isEditMode!==void 0?n.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+\/?$/.test(s.path):!1);o.watchEffect(()=>{}),console.log("[AutoLayoutForm] props.isEditMode:",n.isEditMode,"computed isEditMode:",h.value,"route.params:",s.params);const m=o.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const K=s.path.match(/\/edit\/([^\/]+)\/?$/);return K?K[1]:null}),g=o.ref({}),v=o.ref(n.config||n.schema||null),y=o.ref(!v.value),A=o.ref(!1),C=o.ref(null),M=o.ref(0),B=o.ref(n.layoutCode),N=o.computed(()=>{if(!v.value)return null;const K=JSON.parse(JSON.stringify(v.value));let Y=K;if(Array.isArray(K.propsSteps)&&K.propsSteps.length>0)Y=K;else if(Array.isArray(K.sections)){const F=K.sections.find(_=>{var b,R;return((b=_==null?void 0:_.type)==null?void 0:b.toUpperCase())==="WIZARD"||((R=_==null?void 0:_.propsWizard)==null?void 0:R.propsSteps)});F!=null&&F.propsWizard&&Array.isArray(F.propsWizard.propsSteps)?Y={...K,...F.propsWizard}:(typeof K.isWizard=="boolean"||K.typeWizard)&&(Y={...K,propsSteps:K.sections})}if(h.value&&Y){const F=_=>_.endpointUpdate&&_.endpointUpdate.apiUrl?{..._,endpointSave:{..._.endpointSave,..._.endpointUpdate}}:_;Array.isArray(Y.propsSteps)&&(Y.propsSteps=Y.propsSteps.map(F)),Array.isArray(Y.sections)&&(Y.sections=Y.sections.map(F))}return Y}),j=o.computed(()=>N.value?!!(typeof N.value.isWizard=="boolean"||N.value.typeWizard||Array.isArray(N.value.propsSteps)&&N.value.propsSteps.length>0):!1),W=o.computed(()=>{var _;if(!v.value)return"";const K=((_=d==null?void 0:d.value)==null?void 0:_.toLowerCase())||"en",Y=K==="kr"||K==="ko"||K.startsWith("kr-")||K.startsWith("ko-"),F=K==="en"||K.startsWith("en-");return(Y?v.value.titleKR||v.value.titleEN:F?v.value.titleEN:v.value.titleID)||v.value.title||n.layoutCode});o.watch(W,K=>{K&&f(K)},{immediate:!0});const P=(K,Y={})=>(!K||typeof K!="object"||Object.keys(K).forEach(F=>{const _=K[F];Y[F]=_,_&&typeof _=="object"&&!Array.isArray(_)&&!(_ instanceof Date)&&!_._isLogicValue&&P(_,Y)}),Y),E=K=>{var b;if(!K||typeof K!="string"||K.startsWith("http"))return K;const Y=(b=n.selectedTokenCore)==null?void 0:b.address;if(!Y||typeof Y!="string")return K;const F=Y.replace(/\/$/,""),_=K.startsWith("/")?K:`/${K}`;return`${F}${_}`},k=K=>{var Y;if(!K)return!1;for(const F of K){const _=F.propsForm||F.propsFormStep||F.propsTable||F.propsTableStep||F.props||{};if(_.endpointForm||_.endpointTable||F.endpointForm)return!0;if(F.type==="WIZARD"&&((Y=F.propsWizard)!=null&&Y.propsSteps))for(const b of F.propsWizard.propsSteps){const R=Array.isArray(b.sectionsWizard)?b.sectionsWizard:[b.sectionsWizard].filter(Boolean);if(k(R))return!0}}return!1},$=async()=>{var K,Y,F,_,b,R;y.value=!v.value;try{let S=n.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&s.query.code===n.layoutCode&&(S=s.query.code||n.layoutCode),v.value=n.config||n.schema||null;const T=D=>{var Z,J,fe;return D?!!((Z=D.sections)!=null&&Z.length||(J=D.propsSteps)!=null&&J.length||(fe=D.columns)!=null&&fe.length||D.endpointGlobal||D.isWizard||D.typeWizard):!1};if(!v.value&&S){const D=await l(`/api/auto-layout/form/form-dynamic?code=${S}`,"GET");if(D.status){const Z=Array.isArray(D.data)?D.data[0]:D.data;T(Z)&&(v.value=Z)}if(!T(v.value)&&S)try{const Z=await l(`/api/auto-layout/wizard/form-dynamic?code=${S}`,"GET");Z!=null&&Z.status&&(v.value=Array.isArray(Z.data)?Z.data[0]:Z.data)}catch(Z){console.warn("[AutoLayoutForm] Wizard fallback also failed:",Z)}}if(v.value){const D=()=>{var J;const Z={};return(J=v.value)!=null&&J.sections&&v.value.sections.forEach(fe=>{var pe,ke;((fe.propsForm||fe.props||{}).fields||fe.fields||[]).forEach(be=>{var ve;const Se=be.model||((ve=be.props)==null?void 0:ve.model)||be.key;Se&&(Z[Se]=null)}),((pe=fe.type)==null?void 0:pe.toUpperCase())==="WIZARD"&&((ke=fe.propsWizard)!=null&&ke.propsSteps)&&fe.propsWizard.propsSteps.forEach(be=>{(Array.isArray(be.sectionsWizard)?be.sectionsWizard:[be.sectionsWizard].filter(Boolean)).forEach(ve=>{var Ee;(ve.fields||((Ee=ve.propsFormStep)==null?void 0:Ee.fields)||[]).forEach(Oe=>{var Re;const Ae=Oe.model||((Re=Oe.props)==null?void 0:Re.model)||Oe.key;Ae&&(Z[Ae]=null)})})})}),Z};if(g.value=D(),h.value&&m.value&&(g.value.id=m.value),y.value=!1,h.value&&m.value){A.value=!0;try{const Z=((Y=(K=v.value.sections)==null?void 0:K[0])==null?void 0:Y.propsForm)||((_=(F=v.value.sections)==null?void 0:F[0])==null?void 0:_.props),J=(Z==null?void 0:Z.endpointSection)||(Z==null?void 0:Z.endpointForm),fe=v.value.endpointForm,ae=J||fe;if(ae!=null&&ae.apiUrl){A.value=!0;const we=ae.apiUrl,pe=ae.apiMethod||"GET",ke=ae.keyParam||[],be={};ke.length>0?ke.forEach(ve=>{typeof ve=="string"?be[ve]=m.value:typeof ve=="object"&&ve!==null&&Object.entries(ve).forEach(([Be])=>{be[Be]=m.value})}):be.id=m.value;const Se=await c(E(we),pe,be);if(Se.status){let ve=Array.isArray(Se.data)?Se.data[0]:Se.data;Se.payload&&(ve={...ve,...Se.payload});const Be=P(ve);g.value={...g.value,...Be,...ve}}else console.warn("[AutoLayoutForm] Record API returned status: false",Se)}else if((b=v.value.endpointGlobal)!=null&&b.apiUrl){A.value=!0;const we=v.value.endpointGlobal.apiUrl,pe=v.value.endpointGlobal.apiMethod||"GET",ke={id:m.value},be=await c(E(we),pe,ke);if(be.status){const Se=Array.isArray(be.data)?be.data[0]:be.data,ve=P(Se);g.value={...g.value,...ve,...Se}}}else if(!k(v.value.sections)){const we=((R=v.value.endpoint)==null?void 0:R.detailUrl)||(j.value?null:`/api/${B.value}/detail/${m.value}`);if(!we){A.value=!1;return}A.value=!0;const pe=await l(E(we),"GET");if(pe.status){let ke=Array.isArray(pe.data)?pe.data[0]:pe.data;if(pe.payload){const ve={...pe.payload};if(Object.keys(ve).forEach(Be=>{ke[Be]!==void 0&&ke[Be]!==null&&(ve[Be]=ke[Be])}),!("id"in ve)&&ke.id){const Be=Object.keys(ve).find(Ee=>Ee.startsWith("id")&&Ee.length>2&&!ve[Ee]);Be&&(ve[Be]=ke.id)}ke=ve}const be={...ke};Object.keys(g.value).forEach(ve=>{if(be[ve]===void 0||be[ve]===null){if(ve.toLowerCase().startsWith("id")&&ve.length>2){const Ee=ve.substring(2).toLowerCase(),Oe=Array.isArray(pe.data)?pe.data[0]:pe.data,Ae=Object.keys(Oe).find(Re=>Re.toLowerCase()===Ee);Ae&&Oe[Ae]&&typeof Oe[Ae]=="object"&&"id"in Oe[Ae]&&(be[ve]=Oe[Ae].id)}if(ve==="idSupervisor"){const Ee=Array.isArray(pe.data)?pe.data[0]:pe.data;Ee.supervisorId&&(be[ve]=Ee.supervisorId)}}});const Se=P(be);g.value={...g.value,...Se,...be}}}}catch(Z){console.error("Failed to fetch record data:",Z)}finally{A.value=!1,M.value++}}}}catch(S){console.error("Failed to load form layout:",S),y.value=!1}},I=K=>{const Y=Object.keys(g.value||{}).filter(_=>g.value[_]!==null&&g.value[_]!==void 0),F=Object.keys(K||{}).filter(_=>K[_]!==null&&K[_]!==void 0);if(Y.length>3&&F.length<Y.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:Y.length,incomingCount:F.length,data:K});return}g.value=K,i("update:model",K)},O=K=>{var F,_;const Y=(K==null?void 0:K.routeBack)||(K==null?void 0:K.pathBack)||((F=v.value)==null?void 0:F.routeBack)||((_=v.value)==null?void 0:_.pathBack);Y?a.push(Y):a.back()},q=async K=>{var Y,F,_,b,R;if(n.dummyMode){i("submit-success",K),v.value=null,g.value={},O();return}try{const S=(_=(F=(Y=v.value.sections)==null?void 0:Y[0])==null?void 0:F.propsForm)==null?void 0:_.endpointForm,T=v.value.endpointGlobal||v.value.endpoint;let D=null;if(j.value&&((b=N.value)!=null&&b.propsSteps)){const ve=N.value.propsSteps,Be=ve.find(Ee=>Ee.isSubmit)||ve[ve.length-1];Be&&(D=h.value&&(R=Be.endpointUpdate)!=null&&R.apiUrl?Be.endpointUpdate:Be.endpointSave)}const Z=(D==null?void 0:D.apiUrl)||(S==null?void 0:S.submitUrl)||(T==null?void 0:T.submitUrl)||(j.value?"":`/api/generic/${n.layoutCode}`),J=(D==null?void 0:D.apiMethod)||(S==null?void 0:S.submitMethod)||(T==null?void 0:T.submitMethod)||(h.value?"PUT":"POST"),fe=Object.values(K).some(ve=>ve instanceof File||ve instanceof Blob);let ae=K;if(C.value&&K[C.value]){const ve=K[C.value];ae={},Object.values(ve).forEach(Be=>{typeof Be=="object"&&Be!==null&&Object.assign(ae,Be)})}let we;fe?(we=new FormData,Object.keys(ae).forEach(ve=>{const Be=ae[ve];Be!=null&&(Array.isArray(Be)?Be.forEach(Ee=>we.append(`${ve}[]`,Ee)):we.append(ve,Be))})):(we={...ae},h.value&&m.value&&!we.id&&(we.id=m.value));const pe=S||T,ke={...pe==null?void 0:pe.config};pe!=null&&pe.accept&&(ke.headers||(ke.headers={}),ke.headers.Accept=pe.accept,ke.headers.accept=pe.accept);let be=null,Se=!0;if(Z&&!j.value&&(be=await l(E(Z),J,we,ke),Se=(be==null?void 0:be.status)===!0||(be==null?void 0:be.success)===!0||(be==null?void 0:be.code)===200||(be==null?void 0:be.code)==="00"||(be==null?void 0:be.status)==="SUCCESS"),Se){let ve=(be==null?void 0:be.data)||(be==null?void 0:be.payload)||be;if(Array.isArray(ve)&&ve.length>0&&(ve=ve[0]),ve&&typeof ve=="object"){const Be={...(s==null?void 0:s.query)||{}};let Ee=!1;if(Object.entries(ve).forEach(([Oe,Ae])=>{["status","success","code","message"].includes(Oe)||Ae!=null&&(typeof Ae=="string"||typeof Ae=="number"||typeof Ae=="boolean")&&Be[Oe]!==String(Ae)&&(Be[Oe]=String(Ae),Ee=!0)}),Ee&&typeof window<"u"&&window.history){const Oe=new URL(window.location.href);Object.entries(Be).forEach(([Ae,Re])=>{Re!=null&&Oe.searchParams.set(Ae,String(Re))}),window.history.replaceState(window.history.state,"",Oe.toString())}}}Se&&(i("submit-success",we),v.value=null,g.value={},O())}catch(S){console.error("Submit failed:",S)}},X=async(K,Y,F)=>{if(K==="cancel"){oe();return}const _=Y.endpointPropAction||Y.propsActionGlobal&&Y.propsActionGlobal.endpointPropAction;if(_){if(n.dummyMode){i("action-success",K,Y,F||g.value);return}try{y.value=!0;const b=F?{...F}:{...g.value};h.value&&Y.model&&m.value&&(b[Y.model]=m.value);const R=_.apiUrl,S=_.apiMethod||"POST";(await c(E(R),S,b)).status&&(i("action-success",K,Y,b),O(Y))}catch(b){console.error("Action failed:",b)}finally{y.value=!1}}},oe=()=>{i("cancel"),a.back()},ue=K=>{C.value=K};return o.watch(()=>{var K;return[n.layoutCode,s.path,(K=s.query)==null?void 0:K.code,h.value,m.value,n.config,n.schema]},(K,Y)=>{(!Y||K.some((_,b)=>_!==Y[b]))&&(v.value=n.config||n.schema||null,g.value={},y.value=!v.value,$())},{immediate:!0}),o.watch(()=>n.model,K=>{var Y;if(K&&Object.keys(K).length>0)g.value={...g.value,...K};else if(!h.value){const F={};(Y=v.value)!=null&&Y.sections&&v.value.sections.forEach(_=>{var S,T;((_.propsForm||_.props||{}).fields||_.fields||[]).forEach(D=>{var J;const Z=D.model||((J=D.props)==null?void 0:J.model)||D.key;Z&&(F[Z]=null)}),((S=_.type)==null?void 0:S.toUpperCase())==="WIZARD"&&((T=_.propsWizard)!=null&&T.propsSteps)&&_.propsWizard.propsSteps.forEach(D=>{(Array.isArray(D.sectionsWizard)?D.sectionsWizard:[D.sectionsWizard].filter(Boolean)).forEach(J=>{var ae;(J.fields||((ae=J.propsFormStep)==null?void 0:ae.fields)||[]).forEach(we=>{var ke;const pe=we.model||((ke=we.props)==null?void 0:ke.model)||we.key;pe&&(F[pe]=null)})})})}),g.value=F}},{immediate:!0,deep:!0}),o.onUnmounted(()=>{f(""),v.value=null,g.value={}}),(K,Y)=>(o.openBlock(),o.createElementBlock("div",Dye,[o.createElementVNode("div",Mye,[o.createVNode(o.Transition,{name:"fade",mode:"out-in"},{default:o.withCtx(()=>{var F,_,b,R;return[!y.value&&v.value?(o.openBlock(),o.createElementBlock("div",Rye,[o.createElementVNode("div",Iye,[o.createElementVNode("p",Oye,o.toDisplayString(v.value.description),1)]),j.value?(o.openBlock(),o.createBlock(yk,{key:`wizard-${M.value}`,schema:N.value||v.value,model:g.value,"is-edit-mode":h.value,loading:A.value,"selected-token-core":n.selectedTokenCore,"token-cores":n.tokenCores,router:o.unref(a),"permission-base":n.permissionBase,"user-permissions":n.userPermissions,"check-permission":n.checkPermission,"dummy-mode":n.dummyMode,"hide-actions":n.hideActions||((F=n.config)==null?void 0:F.hideActions)||((_=n.schema)==null?void 0:_.hideActions),"api-params":n.apiParams,"onUpdate:model":Y[0]||(Y[0]=S=>I(S)),onSubmit:q,onCancel:oe,onAction:X,onNavigate:Y[1]||(Y[1]=S=>K.$emit("navigate",S)),onStepChange:ue,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core","token-cores","router","permission-base","user-permissions","check-permission","dummy-mode","hide-actions","api-params"])):(o.openBlock(),o.createBlock(q0,{key:`form-${M.value}`,schema:N.value||v.value,model:g.value,"is-edit-mode":h.value,loading:A.value,"selected-token-core":n.selectedTokenCore,router:o.unref(a),"permission-base":n.permissionBase,"user-permissions":n.userPermissions,"check-permission":n.checkPermission,"dummy-mode":n.dummyMode,"hide-actions":n.hideActions||((b=n.config)==null?void 0:b.hideActions)||((R=n.schema)==null?void 0:R.hideActions),"api-params":n.apiParams,"onUpdate:model":Y[2]||(Y[2]=S=>I(S)),onSubmit:q,onCancel:oe,onAction:X,onNavigate:Y[3]||(Y[3]=S=>K.$emit("navigate",S)),onStepChange:ue,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core","router","permission-base","user-permissions","check-permission","dummy-mode","hide-actions","api-params"]))])):y.value?(o.openBlock(),o.createElementBlock("div",Lye,[o.createVNode(Nye)])):(o.openBlock(),o.createElementBlock("div",Fye," Failed to load form configuration for "+o.toDisplayString(n.layoutCode),1))]}),_:1})])]))}}),[["__scopeId","data-v-8d5493eb"]]),$ye={class:"flex flex-col gap-3 w-full"},zye={key:0,class:"flex items-center gap-1 font-semibold text-sm text-slate-700 dark:text-slate-300"},jye={key:0,class:"text-red-500"},Uye={class:"flex flex-col gap-2 w-full"},Wye={key:0,class:"flex flex-col gap-2 w-full"},Hye={key:1,class:"flex flex-col items-center justify-center text-center gap-2 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},qye={class:"text-sm font-medium text-slate-500"},Kye=["disabled","onClick"],Gye={class:"truncate flex-1"},Yye={class:"overflow-hidden"},Zye={class:"p-4 bg-slate-50/50 dark:bg-neutral-900/10"},Xye={key:1,class:"text-xs text-neutral-400 dark:text-neutral-500 italic py-2 text-center"},G0=o.defineComponent({__name:"DCodeDynamicCollapse",props:{modelValue:{type:[Array,String,Number],default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Items"},labelEN:{type:String,default:"Items"},labelKR:{type:String,default:"Items"},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,items:{type:Array,default:void 0},accordion:{type:[Boolean,String],default:!0},required:Boolean,renderSubForm:{type:Boolean,default:!1},subLayoutCodeKey:{type:String,default:"code"},formData:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},layoutMapping:{type:[Object,String],default:()=>({})},dummyMode:{type:Boolean,default:!1},selectedTokenCore:{type:Object,default:()=>null}},emits:["update:modelValue","loaded"],setup(e,{emit:t}){const n=e,i=t,{t:r,locale:s}=Yn.useI18n(),{apiUrl:a}=o.inject("externalApi")||{},l=o.ref([]),c=o.ref(!0),d=o.ref(new Set),f=o.computed(()=>n.accordion===void 0||n.accordion===null?!0:typeof n.accordion=="string"?n.accordion==="true":!!n.accordion),h=o.computed(()=>{if(!n.layoutMapping)return{};if(typeof n.layoutMapping=="string")try{return JSON.parse(n.layoutMapping)}catch(M){return console.warn("Failed to parse layoutMapping JSON string",M),{}}return n.layoutMapping}),m=async()=>{var M;if(n.items!==void 0&&n.items!==null){l.value=n.items,c.value=!1,i("loaded",l.value);return}if(!((M=n.endpointReference)!=null&&M.apiUrl)){c.value=!1;return}c.value=!0;try{const B=await a(n.endpointReference.apiUrl,n.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(n.items!==void 0){c.value=!1;return}let N=(B==null?void 0:B.data)||B;Array.isArray(N)||(N=[N]),l.value=N,i("loaded",l.value)}catch(B){console.error("Failed to fetch dynamic collapse items",B)}finally{c.value=!1}},g=(M,B)=>M&&M[n.itemValue]!==void 0?M[n.itemValue]:B,v=(M,B)=>{const N=g(M,B);return d.value.has(N)},y=(M,B)=>{if(n.disabled)return;const N=g(M,B),j=new Set(d.value);j.has(N)?j.delete(N):(f.value&&j.clear(),j.add(N)),d.value=j;const W=Array.from(d.value);i("update:modelValue",f.value?W[0]??null:W)},A=(M,B)=>{!M||n.disabled||(n.formData[M]=B)};o.onMounted(()=>{m(),n.modelValue!==void 0&&n.modelValue!==null&&(Array.isArray(n.modelValue)?d.value=new Set(n.modelValue):d.value=new Set([n.modelValue]))}),o.watch(()=>n.modelValue,M=>{if(M!=null){const B=Array.isArray(M)?M:[M],N=new Set(B);JSON.stringify(Array.from(N))!==JSON.stringify(Array.from(d.value))&&(d.value=N)}else d.value.clear()},{deep:!0}),o.watch(()=>f.value,M=>{M&&(d.value.clear(),i("update:modelValue",null))}),o.watch(()=>{var M;return(M=n.endpointReference)==null?void 0:M.apiUrl},(M,B)=>{M!==B&&m()}),o.watch(()=>{var M;return(M=n.endpointReference)==null?void 0:M.apiMethod},(M,B)=>{M!==B&&m()}),o.watch(()=>n.items,M=>{var B;M!=null?(l.value=M,c.value=!1):(B=n.endpointReference)!=null&&B.apiUrl||(c.value=!1)},{deep:!0,immediate:!0});const C=o.computed(()=>{if(n.label)return n.label;const M=s.value.toLowerCase();return M.startsWith("kr")||M.startsWith("ko")?n.labelKR:M.startsWith("en")?n.labelEN:n.labelID});return(M,B)=>(o.openBlock(),o.createElementBlock("div",$ye,[C.value?(o.openBlock(),o.createElementBlock("div",zye,[o.createElementVNode("span",null,o.toDisplayString(C.value),1),e.required?(o.openBlock(),o.createElementBlock("span",jye,"*")):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",Uye,[l.value.length===0&&c.value?(o.openBlock(),o.createElementBlock("div",Wye,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,N=>o.createElementVNode("div",{key:N,class:"w-full flex items-center justify-between p-4 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg animate-pulse"},[...B[0]||(B[0]=[o.createElementVNode("div",{class:"h-4 bg-slate-200 dark:bg-neutral-700 rounded w-1/3"},null,-1),o.createElementVNode("div",{class:"h-4 w-4 bg-slate-200 dark:bg-neutral-700 rounded-full"},null,-1)])])),64))])):l.value.length===0&&!c.value?(o.openBlock(),o.createElementBlock("div",Hye,[o.createElementVNode("span",qye,o.toDisplayString(o.unref(r)("dynamicUploadList.noDocsRequired")||"No items available"),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,(N,j)=>(o.openBlock(),o.createElementBlock("div",{key:j,class:o.normalizeClass(["bg-white dark:bg-neutral-800 border transition-all duration-200 rounded-lg shadow-sm overflow-hidden",v(N,j)?"border-primary-500/50 dark:border-primary-500/30 ring-1 ring-primary-500/10":"border-slate-200 dark:border-neutral-700/50"])},[o.createElementVNode("button",{type:"button",class:o.normalizeClass(["w-full flex items-center justify-between p-4 font-semibold text-sm text-left transition-colors duration-200 focus:outline-none",[v(N,j)?"text-primary-600 dark:text-primary-400 bg-primary-50/20 dark:bg-primary-950/10 border-b border-primary-500/20 dark:border-primary-500/10":"text-slate-700 dark:text-neutral-300 hover:bg-slate-50 dark:hover:bg-neutral-700/50"]]),disabled:e.disabled,onClick:W=>y(N,j)},[o.renderSlot(M.$slots,"header",{item:N,index:j,expanded:v(N,j)},()=>[o.createElementVNode("span",Gye,o.toDisplayString(N[e.itemTitle]||N.name||N.code||`Item ${j+1}`),1)]),o.createVNode(o.unref(Ne.ChevronDown),{class:o.normalizeClass(["w-4 h-4 transition-transform duration-200 shrink-0 ml-2",[v(N,j)?"transform rotate-180 text-primary-500":"text-slate-400"]])},null,8,["class"])],10,Kye),o.createElementVNode("div",{class:o.normalizeClass(["grid transition-all duration-200 ease-in-out",v(N,j)?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"])},[o.createElementVNode("div",Yye,[o.createElementVNode("div",Zye,[o.renderSlot(M.$slots,"default",{item:N,index:j,expanded:v(N,j)},()=>[e.renderSubForm&&h.value[N[e.subLayoutCodeKey]||N.code]?(o.openBlock(),o.createBlock(K0,{key:0,layoutCode:h.value[N[e.subLayoutCodeKey]||N.code],model:e.formData[N[e.subLayoutCodeKey]||N.code]||{},"is-edit-mode":e.isEditMode,"dummy-mode":e.dummyMode,"selected-token-core":e.selectedTokenCore,"hide-actions":!0,"onUpdate:model":W=>A(N[e.subLayoutCodeKey]||N.code,W)},null,8,["layoutCode","model","is-edit-mode","dummy-mode","selected-token-core","onUpdate:model"])):e.renderSubForm?(o.openBlock(),o.createElementBlock("div",Xye," Konten Kosong ")):o.createCommentVNode("",!0)])])])],2)],2))),128))])]))}}),FN=o.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(e){const t=e,n=o.computed(()=>tn[t.icon]??tn.X);return(i,r)=>(o.openBlock(),o.createBlock(o.unref(Fr),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.value),{size:Number(e.iconSize)},null,8,["size"]))]),_:1}))}}),Jye={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Qye=["for"],Vye={key:0,class:"!ml-1 !text-destructive"},ebe={class:"relative w-full block box-border"},tbe={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},nbe=["id","readonly","disabled","placeholder"],ibe={class:"absolute inset-y-0 right-4 flex items-center z-10"},rbe={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-800 border-neutral-200/60 dark:border-neutral-700/50 shadow-lg box-border"},obe={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},sbe={key:1,class:"text-sm text-muted-foreground text-center"},abe=["onClick","title"],lbe={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},cbe={class:"flex items-center justify-center flex-1"},dbe={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},ube={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},fbe={key:1,class:"text-xs text-destructive mt-1"},$N=o.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const n=e,i=t,r=o.computed(()=>!!n.error),s=tn,a=o.ref(null),l=o.ref(null),c=Math.random().toString(36).slice(2,7),d=o.computed(()=>`dcode-icon-dropdown-${n.label||"icon-dropdown"}-${c}`),f=o.ref(!1),h=o.computed(()=>(n.modelValue??"").trim()||""),m=o.ref(""),g=o.ref(!1),v=o.ref(!1),y=o.ref(!1),A=o.shallowRef([]),C=o.ref(n.pageSize),M=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),B=async()=>{if(v.value||y.value)return;y.value=!0,await new Promise(z=>setTimeout(z,0));const se=Object.keys(s).filter(z=>!M.has(z)).filter(z=>/^[A-Z]/.test(z)).filter(z=>{if(z.endsWith("Icon")&&z.length>4){const G=z.slice(0,-4);if(s[G])return!1}return!0}).filter(z=>typeof s[z]=="function"||typeof s[z]=="object"&&s[z]).sort((z,G)=>z.localeCompare(G));A.value=se,v.value=!0,y.value=!1},N=o.computed(()=>h.value?Es(h.value,s):null),j=o.ref(h.value),W=o.computed(()=>!!h.value&&!f.value),P=o.computed(()=>{if(!v.value)return[];const se=(m.value??"").trim().toLowerCase();return se?A.value.filter(z=>z.toLowerCase().includes(se)):A.value}),E=o.computed(()=>P.value.slice(0,C.value)),k=o.computed(()=>{const se=n.columns;return se<=2?"grid-cols-2":se===3?"grid-cols-3":se===4?"grid-cols-4":se===5?"grid-cols-5":se>=8?"grid-cols-8":"grid-cols-6"});o.computed(()=>n.clearable?"!pr-10":"!pr-3"),o.computed(()=>N.value&&!f.value?"!pl-12":"!pl-3");const $=async()=>{var se;await o.nextTick(),(se=l.value)==null||se.focus()},I=async se=>{if(n.disabled)return;const z=se!==!1;if(g.value){g.value=!1;return}f.value=!0,await B(),z&&(m.value="",j.value=""),C.value=n.pageSize,await $()},O=()=>{f.value=!1,m.value="",j.value=h.value,C.value=n.pageSize},q=async()=>{n.disabled||(f.value?O():await I())};let X=null;const oe=async se=>{if(n.disabled)return;i("update:modelValue",null),f.value||await I(!1),X&&clearTimeout(X);const z=j.value;X=setTimeout(()=>{m.value=z},300)},ue=se=>{n.disabled||(i("update:modelValue",se),O(),queueMicrotask(()=>{var z;return(z=l.value)==null?void 0:z.blur()}))},te=()=>{n.disabled||(i("update:modelValue",null),i("clear"),g.value=!0,O(),queueMicrotask(()=>{var se;return(se=l.value)==null?void 0:se.focus()}))},re=se=>{if(se.key==="Escape"){se.preventDefault(),O();return}if(se.key==="Enter"&&f.value){const z=P.value[0];z&&(se.preventDefault(),ue(z))}},ge=se=>{if(!f.value)return;const z=se.target;a.value&&!a.value.contains(z)&&O()},ce=se=>{const z=se.target;z.scrollTop+z.clientHeight>=z.scrollHeight-24&&C.value<P.value.length&&(C.value=Math.min(C.value+n.pageSize,P.value.length))};return o.onMounted(()=>{document.addEventListener("mousedown",ge),queueMicrotask(()=>{var se;l.value=((se=a.value)==null?void 0:se.querySelector("input"))??null}),h.value&&B()}),o.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ge),X&&clearTimeout(X)}),o.watch(h,se=>{f.value||(j.value=se)}),o.watch(()=>m.value,()=>{C.value=n.pageSize}),(se,z)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:a,class:"!w-full !block !box-border"},[n.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[n.label?(o.openBlock(),o.createElementBlock("div",Jye)):o.createCommentVNode("",!0),z[3]||(z[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:d.value,class:"!text-sm !font-medium !mb-1 !block"},[o.createTextVNode(o.toDisplayString(n.label)+" ",1),n.required?(o.openBlock(),o.createElementBlock("span",Vye,"*")):o.createCommentVNode("",!0)],8,Qye)):o.createCommentVNode("",!0),o.createElementVNode("div",ebe,[N.value&&!f.value?(o.openBlock(),o.createElementBlock("div",tbe,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(N.value),{size:18}))])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{id:d.value,"onUpdate:modelValue":z[0]||(z[0]=G=>j.value=G),readonly:W.value,disabled:n.disabled,placeholder:n.placeholder,class:o.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 pr-10 outline-none box-border truncate",[N.value&&!f.value?"pl-10":"pl-4",W.value?"cursor-pointer select-none":"",r.value?"border-destructive focus:ring-destructive":""]]),onClick:I,onFocus:I,onInput:oe,onKeydown:re},null,42,nbe),[[o.vModelText,j.value]]),o.createElementVNode("div",ibe,[n.clearable&&h.value?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:z[1]||(z[1]=o.withModifiers(()=>{},["prevent"])),onClick:te,title:"Clear"},[o.createVNode(o.unref(Ne.X),{class:"h-4 w-4"})],32)):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:z[2]||(z[2]=o.withModifiers(()=>{},["prevent"])),onClick:q,title:"Open"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"h-4 w-4"})],32))]),f.value?(o.openBlock(),o.createElementBlock("div",rbe,[o.createElementVNode("div",{class:"p-2 overflow-auto",style:o.normalizeStyle({maxHeight:n.maxHeight}),onScroll:ce},[y.value?(o.openBlock(),o.createElementBlock("div",obe,[o.createVNode(o.unref(Ne.Loader2),{class:"h-4 w-4 animate-spin"}),z[4]||(z[4]=o.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):v.value&&P.value.length===0?(o.openBlock(),o.createElementBlock("div",sbe," Icon tidak ditemukan ")):(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["grid gap-2",k.value])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(E.value,G=>(o.openBlock(),o.createElementBlock("button",{key:G,type:"button",class:o.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",h.value===G?"ring-1 ring-primary":""]),onClick:ee=>ue(G),title:G},[o.createElementVNode("div",lbe,[o.createElementVNode("div",cbe,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(s)[G]),{size:n.iconSize,class:"shrink-0"},null,8,["size"]))]),o.createElementVNode("span",dbe,o.toDisplayString(G),1)])],10,abe))),128))],2)),v.value&&P.value.length>0?(o.openBlock(),o.createElementBlock("div",ube," Showing "+o.toDisplayString(E.value.length)+" / "+o.toDisplayString(P.value.length),1)):o.createCommentVNode("",!0)],36)])):o.createCommentVNode("",!0)]),r.value?(o.openBlock(),o.createElementBlock("p",fbe,o.toDisplayString(n.error),1)):o.createCommentVNode("",!0)],64))],512)),[[o.vShow,e.visible]])}}),hbe={class:"w-full"},mbe={key:0,class:"flex items-center justify-between mb-2"},pbe={key:0,class:"text-sm font-medium text-gray-700 dark:text-neutral-300"},gbe={key:1,class:"text-sm text-gray-600 dark:text-neutral-400"},ybe={name:"DCodeProgress"},zN=o.defineComponent({...ybe,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=o.computed(()=>Math.min(n.modelValue/n.max*100,100)),r=o.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[n.size],"bg-gray-200 dark:bg-neutral-700"].join(" ")),s=o.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[n.color]||l.blue];return n.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),n.animated&&c.push("animate-pulse"),c.join(" ")}),a=o.computed(()=>`${Math.round(i.value)}%`);return(l,c)=>(o.openBlock(),o.createElementBlock("div",hbe,[e.label||e.showValue?(o.openBlock(),o.createElementBlock("div",mbe,[e.label?(o.openBlock(),o.createElementBlock("span",pbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.showValue?(o.openBlock(),o.createElementBlock("span",gbe,o.toDisplayString(a.value),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(r.value)},[o.createElementVNode("div",{class:o.normalizeClass(s.value),style:o.normalizeStyle({width:`${i.value}%`})},null,6)],2)]))}}),bbe={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},jN=Mn(o.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(e){return(t,n)=>(o.openBlock(),o.createBlock(o.Transition,{name:"fade"},{default:o.withCtx(()=>[e.isApiLoading?(o.openBlock(),o.createElementBlock("div",bbe,[o.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:o.normalizeStyle({width:`${e.apiProgress}%`})},null,4)])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),vbe={key:0},wbe={class:"flex items-start justify-between gap-4"},_be={class:"min-w-0"},kbe={class:"truncate text-sm font-medium text-neutral-700 dark:text-neutral-300"},xbe={key:0,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Ebe=["aria-label","aria-valuenow","aria-valuemax"],Cbe=["aria-label","aria-valuenow","aria-valuemax"],Sbe={class:"h-full w-full -rotate-90",viewBox:"0 0 100 100","aria-hidden":"true"},Abe=["stroke-width"],Tbe=["stroke-width","stroke-dashoffset"],Pbe={key:0,class:"text-center"},Bbe={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Nbe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Dbe=["aria-label","aria-valuenow","aria-valuemax"],Mbe={class:"relative w-48 overflow-hidden"},Rbe={class:"h-auto w-full",viewBox:"0 0 100 58","aria-hidden":"true"},Ibe=["stroke-dasharray"],Obe={key:0,class:"text-center"},Lbe={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Fbe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},$be=["aria-label","aria-valuenow","aria-valuemax"],zbe={class:"relative z-10 flex h-full w-full items-center justify-center rounded-full bg-white dark:bg-neutral-900"},jbe={key:0,class:"text-center"},Ube={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Wbe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Hbe=["aria-label","aria-valuenow","aria-valuemax"],qbe={class:"flex items-center gap-1.5"},Kbe={class:"flex items-center justify-between gap-4"},Gbe={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Ybe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Zbe=["aria-label","aria-valuenow","aria-valuemax"],Xbe={class:"relative h-3 rounded-sm bg-neutral-200 dark:bg-neutral-700"},Jbe={class:"flex items-center justify-between gap-4 text-xs"},Qbe={class:"text-neutral-500 dark:text-neutral-400"},UN=o.defineComponent({name:"DCodePercentage",inheritAttrs:!1,__name:"DCodePercentage",props:{value:{default:0},max:{default:100},label:{default:""},caption:{default:""},showValue:{type:Boolean,default:!0},variant:{default:"bar"},size:{default:"md"},target:{default:80},stepCount:{default:5},color:{default:"primary"},visible:{type:Boolean,default:!0}},setup(e){const t=e,n=o.computed(()=>Math.max(Number.isFinite(t.max)?t.max:100,1)),i=o.computed(()=>Math.min(Math.max(Number.isFinite(t.value)?t.value:0,0),n.value)),r=o.computed(()=>i.value/n.value*100),s=o.computed(()=>t.showValue?`${Math.round(r.value)}%`:""),a=o.computed(()=>Math.min(Math.max(t.target/n.value*100,0),100)),l=o.computed(()=>Math.round(r.value/100*t.stepCount)),c=o.computed(()=>"h-2"),d=o.computed(()=>({"h-24 w-24":t.size==="sm","h-32 w-32":t.size==="md","h-40 w-40":t.size==="lg"})),f=o.computed(()=>t.variant==="donut"?16:8),h=o.computed(()=>({"bg-primary-500":t.color==="primary","bg-success-500":t.color==="success","bg-warning-500":t.color==="warning","bg-danger-500":t.color==="danger"})),m=o.computed(()=>({"stroke-primary-500":t.color==="primary","stroke-success-500":t.color==="success","stroke-warning-500":t.color==="warning","stroke-danger-500":t.color==="danger"})),g=o.computed(()=>({"--percentage-color":t.color==="success"?"#22c55e":t.color==="warning"?"#f59e0b":t.color==="danger"?"#ef4444":"#0066cc","--percentage-track":"rgb(229 229 229)"})),v=o.computed(()=>({"text-primary-600 dark:text-primary-400":t.color==="primary","text-success-600 dark:text-success-400":t.color==="success","text-warning-600 dark:text-warning-400":t.color==="warning","text-danger-600 dark:text-danger-400":t.color==="danger"}));return(y,A)=>e.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["w-full",y.$attrs.class])},[e.variant==="bar"?(o.openBlock(),o.createElementBlock("div",vbe,[o.createElementVNode("div",wbe,[o.createElementVNode("div",_be,[o.createElementVNode("p",kbe,o.toDisplayString(e.label),1),e.caption?(o.openBlock(),o.createElementBlock("p",xbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)]),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["shrink-0 text-sm font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)]),o.createElementVNode("div",{class:o.normalizeClass(["mt-3 w-full overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-700",c.value]),role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",{class:o.normalizeClass(["h-full rounded-full transition-[width] duration-500 ease-out",h.value]),style:o.normalizeStyle({width:`${r.value}%`})},null,6)],10,Ebe)])):e.variant==="circle"||e.variant==="donut"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"flex flex-col items-center gap-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",{class:o.normalizeClass(["relative",d.value])},[(o.openBlock(),o.createElementBlock("svg",Sbe,[o.createElementVNode("circle",{cx:"50",cy:"50",r:"40",fill:"none",class:"stroke-neutral-200 dark:stroke-neutral-700","stroke-width":f.value},null,8,Abe),o.createElementVNode("circle",{cx:"50",cy:"50",r:"40",fill:"none",class:o.normalizeClass(["transition-[stroke-dashoffset] duration-500 ease-out",m.value]),"stroke-width":f.value,"stroke-linecap":"round","stroke-dasharray":"251.2","stroke-dashoffset":251.2-251.2*r.value/100},null,10,Tbe)])),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["absolute inset-0 flex items-center justify-center text-xl font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)],2),e.label||e.caption?(o.openBlock(),o.createElementBlock("div",Pbe,[e.label?(o.openBlock(),o.createElementBlock("p",Bbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Nbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],8,Cbe)):e.variant==="semi-circle"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"flex flex-col items-center gap-2",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",Mbe,[(o.openBlock(),o.createElementBlock("svg",Rbe,[A[0]||(A[0]=o.createElementVNode("path",{d:"M10 50 A40 40 0 0 1 90 50",pathLength:"100",fill:"none",class:"stroke-neutral-200 dark:stroke-neutral-700","stroke-width":"10","stroke-linecap":"round"},null,-1)),o.createElementVNode("path",{d:"M10 50 A40 40 0 0 1 90 50",pathLength:"100",fill:"none",class:o.normalizeClass(["transition-[stroke-dasharray] duration-500 ease-out",m.value]),"stroke-width":"10","stroke-linecap":"round","stroke-dasharray":`${r.value} 100`},null,10,Ibe)])),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["absolute inset-x-0 bottom-0 text-center text-2xl font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)]),e.label||e.caption?(o.openBlock(),o.createElementBlock("div",Obe,[e.label?(o.openBlock(),o.createElementBlock("p",Lbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Fbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],8,Dbe)):e.variant==="radial"?(o.openBlock(),o.createElementBlock("div",{key:3,class:"flex flex-col items-center gap-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",{class:"relative flex h-36 w-36 items-center justify-center rounded-full p-2",style:o.normalizeStyle(g.value)},[o.createElementVNode("div",{class:"absolute inset-0 rounded-full",style:o.normalizeStyle({background:`conic-gradient(var(--percentage-color) ${r.value}%, var(--percentage-track) 0)`})},null,4),o.createElementVNode("div",zbe,[e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["text-2xl font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)])],4),e.label||e.caption?(o.openBlock(),o.createElementBlock("div",jbe,[e.label?(o.openBlock(),o.createElementBlock("p",Ube,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Wbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],8,$be)):e.variant==="steps"?(o.openBlock(),o.createElementBlock("div",{key:4,class:"space-y-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",qbe,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.stepCount,C=>(o.openBlock(),o.createElementBlock("span",{key:C,class:o.normalizeClass(["h-2.5 flex-1 rounded-sm",C<=l.value?h.value:"bg-neutral-200 dark:bg-neutral-700"])},null,2))),128))]),o.createElementVNode("div",Kbe,[o.createElementVNode("div",null,[e.label?(o.openBlock(),o.createElementBlock("p",Gbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Ybe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)]),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["text-sm font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)])],8,Hbe)):(o.openBlock(),o.createElementBlock("div",{key:5,class:"space-y-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",Xbe,[o.createElementVNode("div",{class:o.normalizeClass(["h-full rounded-sm transition-[width] duration-500 ease-out",h.value]),style:o.normalizeStyle({width:`${r.value}%`})},null,6),o.createElementVNode("span",{class:"absolute top-1/2 h-5 w-0.5 -translate-y-1/2 bg-neutral-900 dark:bg-white",style:o.normalizeStyle({left:`calc(${a.value}% - 1px)`}),"aria-hidden":"true"},null,4)]),o.createElementVNode("div",Jbe,[o.createElementVNode("span",Qbe,o.toDisplayString(e.label),1),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["font-semibold tabular-nums",v.value])},o.toDisplayString(s.value)+" / target "+o.toDisplayString(a.value)+"%",3)):o.createCommentVNode("",!0)])],8,Zbe))],2)):o.createCommentVNode("",!0)}}),Vbe={class:"flex flex-col gap-1.5"},eve={key:0,class:"flex items-center gap-1"},tve={key:0,class:"text-xs font-medium text-slate-700 dark:text-slate-300 leading-none"},nve={class:"inline-flex items-center text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 cursor-help transition-colors",tabindex:"-1","aria-label":"More info"},ive=["aria-disabled"],rve=["aria-checked","disabled","onClick"],ove=["aria-checked","disabled","onClick"],sve={name:"DCodeSegmentGroup"},WN=o.defineComponent({...sve,props:{modelValue:{},options:{},label:{},description:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r=c=>c.code===n.modelValue,s=c=>{n.disabled||i("update:modelValue",c.code)},a=o.computed(()=>["inline-flex items-center gap-1 rounded-lg border p-1","bg-slate-100 border-slate-200 dark:bg-slate-800/60 dark:border-slate-700",n.disabled?"opacity-50 cursor-not-allowed":""]),l=c=>["relative inline-flex items-center justify-center","min-w-[2.5rem] px-2.5 py-1 rounded-md","font-mono font-bold tracking-wider text-sm","transition-all duration-200 ease-out","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",r(c)?["bg-white dark:bg-slate-900","text-primary dark:text-primary","shadow-sm border border-slate-200 dark:border-slate-600","scale-[1.03]"]:["text-slate-500 dark:text-slate-400","hover:bg-white/60 dark:hover:bg-slate-700/60","border border-transparent"],n.disabled?"cursor-not-allowed":"cursor-pointer"];return(c,d)=>(o.openBlock(),o.createElementBlock("div",Vbe,[e.label||e.description?(o.openBlock(),o.createElementBlock("div",eve,[e.label?(o.openBlock(),o.createElementBlock("span",tve,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.description?(o.openBlock(),o.createBlock(o.unref(td),{key:1,"delay-duration":150},{default:o.withCtx(()=>[o.createVNode(o.unref(Vc),null,{default:o.withCtx(()=>[o.createVNode(o.unref(nd),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("span",nve,[o.createVNode(o.unref(Ne.Info),{class:"w-3.5 h-3.5"})])]),_:1}),o.createVNode(o.unref(ed),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.description),1)]),_:1})]),_:1})]),_:1})):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(a.value),role:"radiogroup","aria-disabled":e.disabled?"true":void 0},[o.createVNode(o.unref(td),{"delay-duration":200},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.options,f=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f.code},[f.tooltip?(o.openBlock(),o.createBlock(o.unref(Vc),{key:0},{default:o.withCtx(()=>[o.createVNode(o.unref(nd),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",role:"radio","aria-checked":r(f),disabled:e.disabled,class:o.normalizeClass(l(f)),onClick:h=>s(f)},o.toDisplayString(f.display),11,rve)]),_:2},1024),o.createVNode(o.unref(ed),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(f.tooltip),1)]),_:2},1024)]),_:2},1024)):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",role:"radio","aria-checked":r(f),disabled:e.disabled,class:o.normalizeClass(l(f)),onClick:h=>s(f)},o.toDisplayString(f.display),11,ove))],64))),128))]),_:1})],10,ive)]))}}),ave={class:"dcode-upload-file"},lve={class:"border-2 border-dashed border-gray-300 dark:border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center text-center hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer"},cve={key:0,class:"text-xs text-gray-500 mt-1"},dve=["accept"],uve={key:1,class:"text-xs text-red-600 mt-1"},HN=o.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,i=r=>{var a;const s=(a=r.target.files)==null?void 0:a[0];s&&n("update:modelValue",s)};return(r,s)=>(o.openBlock(),o.createElementBlock("div",ave,[e.label?(o.openBlock(),o.createBlock(jl,{key:0,label:e.label},null,8,["label"])):o.createCommentVNode("",!0),o.createElementVNode("div",lve,[o.createVNode(o.unref(Ne.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=o.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[o.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),o.createTextVNode(" or drag and drop ")],-1)),e.accept?(o.openBlock(),o.createElementBlock("p",cve,o.toDisplayString(e.accept),1)):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"file",class:"hidden",onChange:i,accept:e.accept},null,40,dve)]),e.errorMessage?(o.openBlock(),o.createElementBlock("p",uve,o.toDisplayString(e.errorMessage),1)):o.createCommentVNode("",!0)]))}}),fve={key:0,class:"flex flex-wrap items-center justify-between gap-3 px-4 py-3 bg-neutral-50 dark:bg-neutral-900 border-b border-neutral-200 dark:border-neutral-800 select-none"},hve={class:"flex items-center gap-2"},mve={key:0,class:"font-semibold text-sm text-neutral-800 dark:text-neutral-200 flex items-center gap-2"},pve={key:1,class:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-violet-100 dark:bg-violet-900/40 text-violet-700 dark:text-violet-300 border border-violet-200 dark:border-violet-700/50"},gve={key:2,class:"flex items-center bg-neutral-200 dark:bg-neutral-800 p-0.5 rounded-lg text-xs ml-2"},yve={key:0,class:"flex items-center gap-1.5"},bve=["title"],vve={key:0,class:"h-4 w-px bg-neutral-300 dark:bg-neutral-700 mx-1"},wve={key:1,class:"flex-1 flex overflow-hidden compare-split"},_ve={class:"compare-panel flex flex-col flex-1 min-w-0 border-r border-neutral-200 dark:border-neutral-800"},kve={class:"compare-panel-header flex items-center justify-between px-3 py-2 bg-amber-50 dark:bg-amber-950/30 border-b border-amber-200 dark:border-amber-800/50 select-none"},xve={class:"inline-flex items-center gap-1.5 text-xs font-semibold text-amber-700 dark:text-amber-400"},Eve={class:"flex items-center gap-1"},Cve={key:0,class:"h-3 w-px bg-amber-200 dark:bg-amber-800 mx-0.5"},Sve={class:"flex-1 relative overflow-hidden bg-neutral-50/50 dark:bg-neutral-950/40"},Ave={key:0,class:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-xs"},Tve={key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},Pve={class:"bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 p-4 rounded-xl max-w-xs border border-red-200 dark:border-red-900/60"},Bve={class:"text-xs opacity-80 font-mono break-words"},Nve={key:2,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},Dve={class:"flex flex-col items-center justify-center text-neutral-400 dark:text-neutral-500"},Mve={class:"text-[11px] text-neutral-400 dark:text-neutral-500 mt-0.5 font-mono"},Rve={class:"compare-panel flex flex-col flex-1 min-w-0"},Ive={class:"compare-panel-header flex items-center justify-between px-3 py-2 bg-emerald-50 dark:bg-emerald-950/30 border-b border-emerald-200 dark:border-emerald-800/50 select-none"},Ove={class:"inline-flex items-center gap-1.5 text-xs font-semibold text-emerald-700 dark:text-emerald-400"},Lve={class:"flex items-center gap-1"},Fve={key:0,class:"h-3 w-px bg-emerald-200 dark:bg-emerald-800 mx-0.5"},$ve={class:"flex-1 relative overflow-hidden bg-neutral-50/50 dark:bg-neutral-950/40"},zve={key:0,class:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-xs"},jve={key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},Uve={class:"bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 p-4 rounded-xl max-w-xs border border-red-200 dark:border-red-900/60"},Wve={class:"text-xs opacity-80 font-mono break-words"},Hve={key:2,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},qve={class:"flex flex-col items-center justify-center text-neutral-400 dark:text-neutral-500"},Kve={class:"text-[11px] text-neutral-400 dark:text-neutral-500 mt-0.5 font-mono"},Gve={key:2,class:"flex-1 relative overflow-hidden bg-neutral-50/50 dark:bg-neutral-950/40"},Yve={key:0,class:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-xs"},Zve={key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-6 text-center"},Xve={class:"bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 p-6 rounded-xl max-w-md border border-red-200 dark:border-red-900/60 shadow-xs"},Jve={class:"text-xs opacity-90 mb-4 break-words font-mono bg-red-100/50 dark:bg-red-900/40 p-2 rounded"},Qve={class:"flex gap-2 justify-center"},Vve={key:2,class:"w-full h-full p-4 overflow-auto font-mono text-xs text-neutral-100 dark:text-neutral-200 bg-neutral-900 dark:bg-neutral-950"},ewe={class:"whitespace-pre-wrap break-all leading-relaxed"},qN=`<?xml version="1.0" encoding="UTF-8"?>
1582
+ BaseUrl: ${ze||"NONE"}, Final: ${qe}`);const Qe={page:1,perPage:100};if(Array.isArray(_e.keyParam)){let qt=!1;if(_e.keyParam.forEach(wt=>{let Ft="",St="";if(typeof wt=="string")Ft=wt,St=wt;else if(typeof wt=="object"&&wt!==null){const Kt=Object.entries(wt)[0];Kt&&(Ft=Kt[0],St=Kt[1])}if(!Ft||!St)return;const Mt=He(ke)[St];Mt==null||Mt===""?qt=!0:Qe[Ft]=Mt&&typeof Mt=="object"?Mt.id??Mt.code??Mt.value??Mt:Mt}),qt){Se[he]=[];return}}const et={..._e.config||{}};_e.accept&&(et.headers||(et.headers={}),et.headers.Accept=_e.accept,et.headers.accept=_e.accept);const it=await c(qe,_e.apiMethod||"GET",Qe,et),Et=(it==null?void 0:it.data)||it;console.log(`[prefetchDialogFieldItems][RESPONSE] ${he}`,Et);let Bt=[];Array.isArray(Et)?Bt=Et:Et&&(Bt=[Et]),console.log(`[prefetchDialogFieldItems][STORE] ${he} items count: ${Bt.length}`),Se[he]=Bt}catch(ze){console.error(`[prefetchDialogFieldItems] Error fetching items for ${he}:`,ze),Se[he]=[]}};o.watch(ke,(H,V)=>{K.value&&($e(),Be.value.forEach(le=>{const me=le.props||{},xe=me.endpoint||me.endpointReference;Array.isArray(xe==null?void 0:xe.keyParam)&&xe.keyParam.length>0&&yr(le,!0)}))},{deep:!0});const Tu=()=>{Be.value.length&&Be.value.forEach(H=>{var le;const V=rt(H,ke);if(V!=null){const me=ke[H.model],ie=(H.props||{}).returnObject||((le=H.logic)==null?void 0:le.returnObject);(me==null||me===""||ie&&(typeof me=="string"||typeof me=="number")&&(typeof V=="object"&&V!==null))&&(ke[H.model]=V)}})};o.watch(Se,()=>{K.value&&Tu()},{deep:!0});const ai=o.ref([]),cl=o.ref(new Map),ym=o.computed(()=>Array.from(cl.value.values())),Mo=o.computed(()=>{var le,me,xe,ie,he,_e,ze,qe,Qe;const H=Ni.value.find(et=>["CHECKBOX","checkbox"].includes(et.type??""));return(H==null?void 0:H.keyCheckbox)||((xe=(me=(le=re.value)==null?void 0:le.endpointTable)==null?void 0:me.keyParam)==null?void 0:xe[0])||((_e=(he=(ie=re.value)==null?void 0:ie.endpointGlobal)==null?void 0:he.keyParam)==null?void 0:_e[0])||((Qe=(qe=(ze=re.value)==null?void 0:ze.endpoint)==null?void 0:qe.keyParam)==null?void 0:Qe[0])||"id"}),sa=()=>{const H=Ni.value.find(V=>["CHECKBOX","checkbox"].includes(V.type??""));return(H==null?void 0:H.keyPayload)||null},Pu=o.computed(()=>{const H=Mo.value,V=vr.value.map(le=>le[H]).filter(le=>le!=null);return vr.value.length>0&&V.length===0&&console.warn(`[DataTable] selectionKey "${H}" returned no IDs for ${vr.value.length} rows. Selection may not work.`),V}),Bu=o.computed(()=>new Set(ai.value.map(H=>String(H)))),Fy=o.computed(()=>{const H=Pu.value;if(H.length===0)return!1;const V=Bu.value;return H.every(le=>V.has(String(le)))}),T1=o.computed(()=>{const H=Pu.value;if(H.length===0)return!1;const V=Bu.value,le=H.filter(me=>V.has(String(me))).length;return le>0&&le<H.length}),P1=H=>{const V=H[Mo.value];return V!=null&&Bu.value.has(String(V))},$y=H=>{var me;const V=typeof H=="boolean"?H:((me=H==null?void 0:H.target)==null?void 0:me.checked)??!!H,le=Pu.value;if(V){const xe=Bu.value,ie=[...ai.value];vr.value.forEach(he=>{const _e=he[Mo.value];_e!=null&&!xe.has(String(_e))&&(ie.push(_e),cl.value.set(String(_e),he))}),ai.value=ie}else{const xe=new Set(le.map(ie=>String(ie)));ai.value=ai.value.filter(ie=>!xe.has(String(ie))),xe.forEach(ie=>{cl.value.delete(ie)})}},B1=(H,V)=>{var ie;const le=typeof V=="boolean"?V:((ie=V==null?void 0:V.target)==null?void 0:ie.checked)??!!V,me=H[Mo.value];if(me==null)return;const xe=String(me);le?ai.value.some(he=>String(he)===xe)||(ai.value.push(me),cl.value.set(xe,H)):(ai.value=ai.value.filter(he=>String(he)!==xe),cl.value.delete(xe))};o.watch(ai,H=>{var me;const V=sa();if(V){const xe={[V]:H};r("update:selection",xe)}else r("update:selection",H);r("selection-change",ym.value);const le=Fy.value||H.length>1;(me=G.value)!=null&&me.length&&G.value.forEach(xe=>{var ie;(ie=xe.fieldActionGlobal)!=null&&ie.length&&xe.fieldActionGlobal.forEach(he=>{var et,it;const _e=xe.endpoint||((et=xe.propsActionGlobal)==null?void 0:et.endpointPropAction)||xe.propsActionGlobal,ze=(it=_e==null?void 0:_e.keyParam)==null?void 0:it[0],qe=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(he.component);(ze&&he.model===ze||!ze&&/^(id|ids|idAuditTrail|idAppRequest)$/i.test(he.model))&&le&&(!qe||ze&&he.model===ze)&&he.model&&(ke[he.model]=H)})})},{deep:!0});const Nu=H=>{const V=(xe,ie,he)=>{if(!ie)return;const _e=ie.split(".");let ze=xe;for(let qe=0;qe<_e.length-1;qe++){const Qe=_e[qe];ze[Qe]||(ze[Qe]={}),ze=ze[Qe]}ze[_e[_e.length-1]]=he},le=(xe,ie)=>{if(Array.isArray(xe.condition)&&xe.condition.length>0)return xe.condition[ie%xe.condition.length].value;const he=["Active","Pending","Inactive","Success","Failed"];return he[ie%he.length]},me=(xe,ie,he)=>{var Qe,et,it,Et;if(["no","action"].includes(ie.key)||["ACTION","action"].includes(ie.type))return;const ze=(ie.type||"").toUpperCase(),qe=`Data ${ie.label} ${he+1}`;if(ze==="BADGE"||ie.condition){V(xe,ie.key,le(ie,he));return}switch(ze){case"CHECKBOX":V(xe,ie.keyCheckbox||"id",he+1);break;case"HYPERLINK":V(xe,ie.key,`Link ${he+1}`),(et=(Qe=ie.propsCustom)==null?void 0:Qe[0])!=null&&et.urlLink&&V(xe,ie.propsCustom[0].urlLink,`https://example.com/page/${he+1}`);break;case"CURRENCY":V(xe,ie.key,1e6+he*5e4);break;case"DATE":case"DATA":V(xe,ie.key,new Date(Date.now()-he*864e5).toISOString().split("T")[0]);break;case"DATETIME":V(xe,ie.key,new Date(Date.now()-he*36e5).toISOString());break;case"TEXT":(Et=(it=ie.propsCustom)==null?void 0:it[0])!=null&&Et.value?V(xe,`${ie.key}.${ie.propsCustom[0].value}`,qe):V(xe,ie.key,qe);break;default:V(xe,ie.key,qe)}};return Array.from({length:H}).map((xe,ie)=>{const he={id:ie+1,no:ie+1};return Ni.value.forEach(_e=>me(he,_e,ie)),he})},Oc=H=>String(H)==="true"||H===!0,On=H=>H&&typeof H=="string"&&H.trim()?H:void 0,Du=o.computed(()=>{var H,V,le,me,xe,ie;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiModule)||On((me=(le=re.value)==null?void 0:le.endpointTable)==null?void 0:me.apiModule)||On((ie=(xe=re.value)==null?void 0:xe.endpointGlobal)==null?void 0:ie.apiModule)||i.apiModule}),N1=o.computed(()=>{var H,V,le,me,xe,ie;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiAction)||On((me=(le=re.value)==null?void 0:le.endpointTable)==null?void 0:me.apiAction)||On((ie=(xe=re.value)==null?void 0:xe.endpointGlobal)==null?void 0:ie.apiAction)||i.apiAction}),D1=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiMethod)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.apiMethod)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.apiMethod)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.apiMethod)||i.apiMethod||"GET"}),dl=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.apiUrl)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.apiUrl)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.apiUrl)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.apiUrl)||i.apiUrl}),aa=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.accept)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.accept)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.accept)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.accept)||i.accept}),lo=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return On((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.socket)||On((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.socket)||On((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.socket)||On((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.socket)||i.socketEndpoint||i.socketRequest}),Lc=o.computed(()=>{var H,V,le,me,xe,ie,he,_e;return((V=(H=re.value)==null?void 0:H.endpoint)==null?void 0:V.socketParams)||((me=(le=re.value)==null?void 0:le.endpointSection)==null?void 0:me.socketParams)||((ie=(xe=re.value)==null?void 0:xe.endpointTable)==null?void 0:ie.socketParams)||((_e=(he=re.value)==null?void 0:he.endpointGlobal)==null?void 0:_e.socketParams)||i.socketParams||{}}),ul=o.computed(()=>!!lo.value),an=o.computed(()=>{var H;return i.permissionBase||((H=re.value)==null?void 0:H.permissionBase)||""});function Cn(){console.log("[DataTable][loadConfig] Called. Existing filters keys:",Object.keys(b.value),"values:",JSON.stringify(b.value));let H=null;if(i.tableConfig&&(H=i.tableConfig),H){re.value=H,z.value=[],G.value=[],F.value=!1,H.headers?Bi.value=H.headers.map(ie=>{var Qe,et,it,Et,Bt,qt,wt,Ft,St,Mt;const he=(((Qe=ie.custom)==null?void 0:Qe.type)||ie.type||"").toUpperCase();if(ie.key==="action"||he==="ACTION"){Oc(ie.isHidden)&&(F.value=!0);const Kt=((et=ie.custom)==null?void 0:et.actionCustom)||((it=ie.custom)==null?void 0:it.action);if(Kt){const qn=Kt.map(Ct=>{const ut=Ct.propsActionCustom||Ct.props||Ct.propsActionGlobal||{},bi=Ct.propCustomMessage||{},li=Ct.type||ut.type||Ct.actionType||ut.actionType,Kn=Ct.buttons||Ct.propsCustom||ut.buttons||ut.propsCustom||[];return{key:Ct.key,id:Ct.id,permission:Ct.permission,type:li,buttons:Kn,propsCustom:Kn,labelID:ut.labelID||Ct.labelID,labelEN:ut.labelEN||Ct.labelEN,labelKR:ut.labelKR||Ct.labelKR,label:d.value==="kr"||d.value==="ko"?ut.labelKR||ut.labelEN:d.value==="id"?ut.labelID:ut.labelEN,tooltip:d.value==="kr"||d.value==="ko"?ut.tooltipKR||ut.labelKR||ut.tooltipEN||ut.labelEN:d.value==="id"?ut.tooltipID||ut.labelID:ut.tooltipEN||ut.labelEN,icon:ut.icon,variant:ut.variant||"ghost",bgColor:ut.bgColor,action:Ct.key||Ct.id||ut.actionType||ut.key,actionType:ut.actionType,route:ut.route,path:ut.path,targetBehavior:ut.targetBehavior||Ct.targetBehavior,keyRedirect:ut.keyRedirect||Ct.keyRedirect,borderStyle:ut.borderStyle,borderColor:ut.borderColor,rounded:ut.rounded,endpoint:ml(Ct),propsActionCustom:ut,_customMsg:bi,propCustomCondition:Ct.propCustomCondition||[],fieldMapping:Ct.fieldMapping||ut.fieldMapping||null,openDialog:Ct.openDialog??ut.openDialog??!1,dialogConfig:Ct.dialogConfig||ut.dialogConfig||null,layoutColumns:Ct.layoutColumns||ut.layoutColumns||Ct.layout||ut.layout,fieldActionCustom:(Ct.fieldActionCustom||[]).map(Pn=>{const Lr=Pn.propsFieldCustom||Pn.propsFieldGlobal||Pn.propsFilters||Pn.props||{};return{...Pn,props:{...Lr,items:Se[Pn.key]||Se[Pn.model]||Lr.items,endpoint:Lr.endpointComponent||Lr.endpoint}}}),condition:Ct.visibleRule||Ct.propCustomCondition||ut.visibleRule||ut.propCustomCondition||null,requireConfirm:Ct.requireConfirm||ut.requireConfirm||!1,confirmTitle:d.value==="kr"||d.value==="ko"?bi.titleKR||ut.confirmTitleKR||"확인":d.value==="id"?bi.titleID||ut.confirmTitleID||"Konfirmasi":bi.titleEN||ut.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?bi.messageKR||ut.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?bi.messageID||ut.confirmMessageID||"Apakah Anda yakin?":bi.messageEN||ut.confirmMessageEN||"Are you sure?",isHidden:Ct.isHidden||ut.isHidden,routeBack:ut.routeBack,pathBack:ut.pathBack,triggerNavigation:Ct.triggerNavigation}});z.value.push(...qn)}return null}let ze;const qe=((Et=ie.custom)==null?void 0:Et.conditionBadge)||((Bt=ie.custom)==null?void 0:Bt.condition);return he==="BADGE"&&qe&&(ze=qe.map(Kt=>({value:Kt.value,label:d.value==="kr"||d.value==="ko"?Kt.labelKR||Kt.labelEN:d.value==="id"?Kt.labelID:Kt.labelEN,labelID:Kt.labelID,labelEN:Kt.labelEN,labelKR:Kt.labelKR,color:Kt.color||Kt.bgColor,variant:Kt.variant,logic:Kt.logic||Kt.conditionRule||null}))),{key:ie.key,label:(d.value==="kr"||d.value==="ko"?ie.labelKR||ie.labelEN:d.value==="id"?ie.labelID:ie.labelEN)||ie.label||ie.labelKR||ie.labelEN||ie.labelID,width:ie.width,align:ie.align,sortable:!["CHECKBOX","checkbox"].includes(he),type:((qt=ie.custom)==null?void 0:qt.type)||ie.type,condition:ze,keyCheckbox:(wt=ie.custom)==null?void 0:wt.keyCheckbox,keyPayload:(Ft=ie.custom)==null?void 0:Ft.keyPayload,propsCustom:(St=ie.custom)==null?void 0:St.propsCustom,isHidden:ie.isHidden,format:ie.format||((Mt=ie.custom)==null?void 0:Mt.format)}}).filter(ie=>ie!==null):Bi.value=[];const V=H.filters||H.filter;V&&Array.isArray(V)&&(S.value=V.map(ie=>({...ie,props:ie.propsFilters||ie.props||{}})),S.value.forEach(ie=>{b.value[ie.model]===void 0&&(b.value[ie.model]="")}),S.value.forEach(ie=>{var et;if(!((et=ie.logic)!=null&&et.optionsFilterRule))return;const he=ie.propsFilters||ie.props||{},_e=he.endpointComponent||he.endpointReference||he.endpoint;if(!(_e!=null&&_e.apiUrl))return;const ze=ie.key||ie.model;if(T[ze])return;const qe=P.value,Qe=vo(_e.apiUrl,qe);c(Qe,_e.apiMethod||"GET",{page:1,perPage:500}).then(it=>{const Et=(it==null?void 0:it.data)||it;T[ze]=Array.isArray(Et)?Et:Et?[Et]:[]}).catch(()=>{T[ze]=[]})}));const le=H.actionTableGlobal||H.actionGlobal||H.actionSection||H.actionGlobalStep||H.action;le&&Array.isArray(le)&&(G.value=le.map(ie=>{const he=ie.propsActionGlobal||ie.props||{},_e=ie.propCustomMessage||{},ze=ie.type||he.type||ie.actionType||he.actionType,qe=ie.buttons||ie.propsCustom||he.buttons||he.propsCustom||[];return{key:he.key,permission:ie.permission,type:ze,buttons:qe,propsCustom:qe,labelID:he.labelID||ie.labelID,labelEN:he.labelEN||ie.labelEN,labelKR:he.labelKR||ie.labelKR,actionType:ie.actionType||he.actionType||he.type||ie.permission,label:d.value==="kr"||d.value==="ko"?he.labelKR||he.labelEN||"Action":d.value==="id"?he.labelID||he.labelEN||"Action":he.labelEN||"Action",tooltip:d.value==="kr"||d.value==="ko"?he.tooltipKR||he.labelKR||he.tooltipEN||he.labelEN:d.value==="id"?he.tooltipID||he.labelID:he.tooltipEN||he.labelEN,icon:he.icon,variant:he.variant||"default",bgColor:he.bgColor,textColor:he.textColor,route:he.route,path:he.path,targetBehavior:he.targetBehavior||ie.targetBehavior,keyRedirect:he.keyRedirect||ie.keyRedirect,borderStyle:he.borderStyle,borderColor:he.borderColor,rounded:he.rounded,endpoint:he.endpointDialogActionSave||he.endpointDialogAction||he.endpointAction||he.endpointPropAction||ie.endpoint,propsActionGlobal:he,_customMsg:_e,fieldMapping:ie.fieldMapping||he.fieldMapping||null,visibleRule:ie.visibleRule||he.visibleRule||ie.propCustomCondition||he.propCustomCondition||null,openDialog:ie.openDialog??he.openDialog??!1,dialogConfig:ie.dialogConfig||he.dialogConfig||null,layoutColumns:ie.layoutColumns||he.layoutColumns||ie.layout||he.layout,requireConfirm:ie.requireConfirm||he.requireConfirm||!1,confirmTitle:d.value==="kr"||d.value==="ko"?_e.titleKR||he.confirmTitleKR||"확인":d.value==="id"?_e.titleID||he.confirmTitleID||"Konfirmasi":_e.titleEN||he.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?_e.messageKR||he.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?_e.messageID||he.confirmMessageID||"Apakah Anda yakin?":_e.messageEN||he.confirmMessageEN||"Are you sure?",fieldActionGlobal:(ie.fieldActionGlobal||ie.fieldActionCustom||ie.field||[]).map(Qe=>{const et=Qe.propsFieldCustom||Qe.propsFieldGlobal||Qe.propsFilters||Qe.props||{};return{...Qe,props:{...et,items:Se[Qe.key]||Se[Qe.model]||et.items,endpoint:et.endpointComponent||et.endpoint}}}),isHidden:ie.isHidden||he.isHidden,routeBack:he.routeBack,pathBack:he.pathBack}})),H.pagination!==void 0&&(ge.value=H.pagination),H.showQuickSearch!==void 0?ce.value=H.showQuickSearch:ce.value=!0,H.showRefresh!==void 0?se.value=H.showRefresh:se.value=!0;const me=[],xe=ie=>{Array.isArray(ie)&&ie.forEach(he=>{var qe,Qe,et,it;const _e=he.fieldActionGlobal||he.fieldActionCustom||he.fields||he.field||[];Array.isArray(_e)&&me.push(..._e);const ze=he.buttons||he.propsCustom||((qe=he.propsActionCustom)==null?void 0:qe.buttons)||((Qe=he.propsActionCustom)==null?void 0:Qe.propsCustom)||((et=he.propsActionGlobal)==null?void 0:et.buttons)||((it=he.propsActionGlobal)==null?void 0:it.propsCustom)||[];Array.isArray(ze)&&xe(ze)})};xe(H.actionTableGlobal||H.actionGlobal||[]),xe(H.actionTableLine||H.actionLine||[]),(H.headers||[]).forEach(ie=>{var he,_e;(he=ie.custom)!=null&&he.propsCustom&&Array.isArray(ie.custom.propsCustom)&&xe(ie.custom.propsCustom),(_e=ie.custom)!=null&&_e.actionCustom&&Array.isArray(ie.custom.actionCustom)&&xe(ie.custom.actionCustom)}),me.forEach(ie=>{yr(ie)})}}o.watch(()=>i.tableConfig,()=>{Cn()},{deep:!0,immediate:!0}),o.watch(d,()=>{const H=re.value;if(H&&(z.value.length&&(z.value=z.value.map(V=>{const le=V.propsActionCustom||{},me=V._customMsg||{};return{...V,label:d.value==="kr"||d.value==="ko"?le.labelKR||le.labelEN||"":d.value==="id"?le.labelID:le.labelEN,tooltip:d.value==="kr"||d.value==="ko"?le.tooltipKR||le.labelKR||le.tooltipEN||le.labelEN:d.value==="id"?le.tooltipID||le.labelID:le.tooltipEN||le.labelEN,confirmTitle:d.value==="kr"||d.value==="ko"?me.titleKR||le.confirmTitleKR||"확인":d.value==="id"?me.titleID||le.confirmTitleID||"Konfirmasi":me.titleEN||le.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?me.messageKR||le.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?me.messageID||le.confirmMessageID||"Apakah Anda yakin?":me.messageEN||le.confirmMessageEN||"Are you sure?"}})),G.value.length&&(G.value=G.value.map(V=>{const le=V.propsActionGlobal||{},me=V._customMsg||{};return{...V,label:d.value==="kr"||d.value==="ko"?le.labelKR||le.labelEN||"Action":d.value==="id"?le.labelID||le.labelEN||"Action":le.labelEN||"Action",tooltip:d.value==="kr"||d.value==="ko"?le.tooltipKR||le.labelKR||le.tooltipEN||le.labelEN:d.value==="id"?le.tooltipID||le.labelID:le.tooltipEN||le.labelEN,confirmTitle:d.value==="kr"||d.value==="ko"?me.titleKR||le.confirmTitleKR||"확인":d.value==="id"?me.titleID||le.confirmTitleID||"Konfirmasi":me.titleEN||le.confirmTitleEN||"Confirm",confirmMessage:d.value==="kr"||d.value==="ko"?me.messageKR||le.confirmMessageKR||"정말로 진행하시겠습니까?":d.value==="id"?me.messageID||le.confirmMessageID||"Apakah Anda yakin?":me.messageEN||le.confirmMessageEN||"Are you sure?"}})),Bi.value.length)){const V=H.headers||[];Bi.value=Bi.value.map(le=>{var xe;const me=V.find(ie=>ie.key===le.key);return me?{...le,label:d.value==="kr"||d.value==="ko"?me.labelKR||me.labelEN||me.label:(d.value==="id"?me.labelID:me.labelEN)||me.label||me.labelID||me.labelEN,condition:(xe=le.condition)==null?void 0:xe.map(ie=>({...ie,label:d.value==="kr"||d.value==="ko"?ie.labelKR||ie.labelEN||ie.label:d.value==="id"?ie.labelID||ie.label:ie.labelEN||ie.label}))}:le})}});const Ni=o.computed(()=>{let H=[];return i.dynamicColumns||i.configKey||i.tableConfig?H=Bi.value:H=i.columns||[],H.filter(V=>!Oc(V.isHidden))}),co=o.computed(()=>F.value?!1:i.hasActions||Hn.value.length>0),Di=o.computed(()=>i.dummyMode?!1:!!(i.loading||ue.value)),Dn=o.computed(()=>!!Du.value||!!dl.value||ul.value||i.remotePagination),Lt=o.computed(()=>[]),Wn=H=>{var xe;if(!((xe=i.menuPermissions)!=null&&xe.length))return;const V=i.menuPermissions.find(ie=>E.path.startsWith(ie.path));if(!(V!=null&&V.actions))return;const le=H.toUpperCase(),me=V.actions.find(ie=>ie.code===le);return me==null?void 0:me.checked},Fc=(H,V,le)=>{let me=H(V,le);return!me&&le!==le.toLowerCase()&&(me=H(V,le.toLowerCase())),me},Mu=(H,V)=>Array.isArray(j)?[H,H.toLowerCase()].flatMap(xe=>[xe,`${V}_${xe}`,`${V}.${xe}`]).some(xe=>j.includes(xe)):!1,br=(H,V,le)=>{let me=Fc(H,V,le);if(me)return!0;if(E.path){const ie=E.path.split("/").find(Boolean)[0];ie&&ie!==V&&(me=Fc(H,ie,le))}return me||(V!==""&&(me=Fc(H,"",le)),me)?!0:Mu(le,V)},zy=H=>{if(!H)return!0;const V=Wn(H);if(V!==void 0)return V;const le=an.value,me=i.permissionChecker||N;if(me)return br(me,le,H);const xe=H.toUpperCase();return Lt.value.some(ie=>ie.code===xe)},$c=(H,V)=>{if(H.condition)try{return go.apply(H.condition,V)}catch(he){return console.warn("Row action jsonLogic error:",he),!1}if(!H.visibilityCondition)return!0;const{field:le,operator:me,value:xe}=H.visibilityCondition,ie=Qt(V,le);switch(me){case"equals":return ie===xe;case"notEquals":return ie!==xe;case"in":return Array.isArray(xe)&&xe.includes(ie);case"notIn":return Array.isArray(xe)&&!xe.includes(ie);case"greaterThan":return ie>xe;case"lessThan":return ie<xe;case"contains":return String(ie).includes(String(xe));default:return!0}},fs=o.computed(()=>{if(G.value.length===0)return[];const H=i.dummyMode||E.query.preview==="true"||E.query.dummy==="true";return G.value.filter(V=>{var le;if(V.isHidden===!0||V.isHidden==="true")return!1;if(V.visibleRule)try{const me=vr.value[0]||{};if(!go.apply(V.visibleRule,me))return!1}catch(me){console.warn("Header action visibility logic error:",me)}if(i.ignorePermissions||H||(le=re.value)!=null&&le.ignorePermissions||!V.permission)return!0;if(i.checkPermission){let me=i.checkPermission(V.permission);if(!me&&V.permission!==V.permission.toLowerCase()&&(me=i.checkPermission(V.permission.toLowerCase())),me!==void 0)return!!me}return i.permissions?i.permissions.includes(V.permission):!!zy(V.permission)})}),Hn=o.computed(()=>z.value.length===0?z.value:z.value.filter(H=>H.isHidden===!0||H.isHidden==="true"?!1:i.ignorePermissions||i.dummyMode||!H.permission?!0:i.checkPermission?i.checkPermission(H.permission):i.permissions?i.permissions.includes(H.permission):zy(H.permission))),Ro=H=>Hn.value.filter(V=>$c(V,H)),la=(H,V)=>{var xe;if(!H.dynamicColor||!H.colorCondition)return H.bgColor||"primary";const le=Qt(V,H.colorCondition.field),me=(xe=H.colorCondition.conditions)==null?void 0:xe.find(ie=>ie.value===le);return(me==null?void 0:me.bgColor)||H.bgColor||"primary"},zc=H=>{const V=(H||"left").toLowerCase();return V==="center"?"justify-center":V==="right"?"justify-end":"justify-start"},bm={ToggleLeft:Ne.ToggleLeft,SquarePen:Ne.SquarePen,Trash2:Ne.Trash2,Eye:Ne.Eye,CheckCircle:Ne.CheckCircle,Plus:Ne.Plus,Download:Ne.Download,RefreshCw:Ne.RefreshCw,Search:Ne.Search,SlidersHorizontal:Ne.SlidersHorizontal},jc=H=>H&&(Es(H,tn)||bm[H])||null,vr=o.computed(()=>i.dummyMode?Ni.value.length>0?Nu(5):[]:M1.value),fl=o.computed(()=>{if(i.dummyMode)return 5;if(i.controlled||i.remotePagination){if(Y.value&&Dn.value)return te.value;if(i.totalItems!==void 0)return i.totalItems}return Dn.value&&X.value.length>0?te.value:Uc.value.length}),Ru=o.computed(()=>fl.value===0?0:(I.value-1)*O.value+1),vm=o.computed(()=>{const H=I.value*O.value;return Math.min(H,fl.value)}),Qt=(H,V)=>{if(!H||!V)return;if(V.includes(".")){const xe=V.split(".").reduce((ie,he)=>ie&&ie[he],H);if(xe!=null)return xe}if(V in H)return H[V];const le=V.split(".").reduce((xe,ie)=>xe&&xe[ie],H);if(le!=null)return le;const me=V.split(".");if(me.length>1)for(let xe=1;xe<me.length;xe++){const ie=me.slice(xe).join("."),he=ie.split(".").reduce((_e,ze)=>_e&&_e[ze],H);if(he!=null)return console.log(`[DataTable resolvePath] Prefixed path "${V}" resolved via suffix fallback "${ie}" to value:`,he),he;if(ie in H)return console.log(`[DataTable resolvePath] Prefixed path "${V}" resolved via suffix fallback key "${ie}" to value:`,H[ie]),H[ie]}return le},Iu=(H,V)=>{var me,xe;const le=Qt(H,V.key);if((V.type==="TEXT"||V.type==="text")&&((xe=(me=V.propsCustom)==null?void 0:me[0])!=null&&xe.value)){const ie=V.propsCustom[0].value;if(le&&typeof le=="object")return Qt(le,ie)??Qt(H,`${V.key}.${ie}`)??le;const he=Qt(H,`${V.key}.${ie}`);if(he!=null)return he}return le},Uc=o.computed(()=>{let le=(Dn.value&&(X.value.length>0||Y.value)?X.value:i.data||[]).filter(me=>!me||typeof me!="object"?!1:Ni.value.some(xe=>{if(["no","action"].includes(xe.key)||["ACTION","action","CHECKBOX"].includes(xe.type||""))return!1;const he=Qt(me,xe.key);return he!=null&&he!==""}));if(!Dn.value&&$.value){const me=$.value.toLowerCase();le=le.filter(xe=>Ni.value.some(ie=>{const he=Iu(xe,ie);return he==null?!1:String(he).toLowerCase().includes(me)}))}return!Dn.value&&Object.keys(b.value).length>0&&(le=le.filter(me=>Object.entries(b.value).every(([xe,ie])=>{if(ie==null||ie==="")return!0;const he=Qt(me,xe);if(he==null)return!1;const _e=String(he).toLowerCase(),ze=String(ie).toLowerCase();return _e.includes(ze)}))),le}),Ou=o.computed(()=>q.value.key?[...Uc.value].sort((V,le)=>{const me=Qt(V,q.value.key),xe=Qt(le,q.value.key);if(me===xe)return 0;let ie=0;return typeof me=="number"&&typeof xe=="number"?ie=me-xe:ie=String(me).localeCompare(String(xe)),q.value.direction==="asc"?ie:-ie}):Uc.value),M1=o.computed(()=>{if(Dn.value||i.controlled)return Ou.value.map((le,me)=>({...le,no:(I.value-1)*O.value+me+1}));const H=(I.value-1)*O.value,V=H+O.value;return Ou.value.slice(H,V).map((le,me)=>({...le,no:H+me+1}))}),Dt=(H,V)=>{var ie,he,_e,ze,qe,Qe,et,it,Et,Bt,qt,wt,Ft,St,Mt,Kt;const le=Qt(H,V.key);if(le==null||le==="")return"-";const me=((he=(ie=V.propsCustom)==null?void 0:ie[0])==null?void 0:he.value)||((qe=(ze=(_e=V.custom)==null?void 0:_e.propsCustom)==null?void 0:ze[0])==null?void 0:qe.value);if((V.type==="TEXT"||V.type==="text")&&me){if(le&&typeof le=="object")return Qt(le,me)||"-";const qn=V.key.split(".").reduce((li,Kn)=>li&&li[Kn],H);if(qn&&typeof qn=="object")return Qt(qn,me)||"-";const Ct=V.key,ut=Ct.includes(".")?Ct.split(".").pop():Ct,bi=Se[Ct]||(ut?Se[ut]:void 0)||((Qe=l==null?void 0:l.rawItemsCache)==null?void 0:Qe[Ct])||(ut?(et=l==null?void 0:l.rawItemsCache)==null?void 0:et[ut]:void 0)||(l==null?void 0:l.rawItemsCache)&&((it=Object.entries(l.rawItemsCache).find(([li])=>li.endsWith(Ct)||Ct.endsWith(li)||ut&&li.endsWith(ut)))==null?void 0:it[1]);if(Array.isArray(bi)&&bi.length>0){const li=bi.find(Kn=>Kn&&(String(Kn.id)===String(le)||String(Kn.code)===String(le)||String(Kn.value)===String(le)||String(Kn.name)===String(le)));if(li)return Qt(li,me)||"-"}}if(["DATE","date","DATETIME","datetime","DATA","data"].includes(V.type||"")){const qn=((qt=(Bt=(Et=V.custom)==null?void 0:Et.propsCustom)==null?void 0:Bt[0])==null?void 0:qt.value)||V["custom.propsCustom[0].value"]||((wt=V.custom)==null?void 0:wt.format)||((St=(Ft=V.propsCustom)==null?void 0:Ft[0])==null?void 0:St.value)||(typeof V.format=="string"?V.format:null);if(qn)return R3(le,qn);const Ct=(V.type||"").toUpperCase()==="DATETIME";return Jc(le,Ct?"datetime":"long")}if(V.type==="CURRENCY"||V.type==="currency"){const qn=((Kt=(Mt=V.propsCustom)==null?void 0:Mt[0])==null?void 0:Kt.value)||"IDR";return Rb(le,qn)}return V.format?V.format(le):le},Ir=o.computed(()=>Dn.value?Object.values(b.value).some(H=>!!H):!!$.value),_n=[10,25,50,100],wm=()=>{Dn.value&&(b.value={...b.value,keyword:$.value},I.value=1,ei())};let Wc;const _m=()=>{i.enableQuickSearch&&(clearTimeout(Wc),Wc=setTimeout(()=>{wm()},500))};let Hc;const hs=()=>{clearTimeout(Hc),Hc=setTimeout(()=>{Dn.value&&ei()},500)};o.watch($,()=>{i.enableQuickSearch&&Dn.value&&_m()}),o.watch(()=>i.baseUrl,H=>{H&&(console.log(`[DataTable] baseUrl resolved to ${H}. Re-triggering prefetch for actions.`),G.value.forEach(V=>{(V.fieldActionCustom||V.fieldActionGlobal||V.field||[]).forEach(me=>yr(me))}),z.value.forEach(V=>{(V.fieldActionCustom||V.fieldActionGlobal||V.field||[]).forEach(me=>yr(me))}))});const ei=async(H=!1,V=!1)=>{var xe,ie,he,_e,ze,qe,Qe,et;if(i.dummyMode||!Dn.value||ue.value&&!H&&X.value.length>0||!Du.value&&!dl.value&&!lo.value)return;const le=i.data&&i.data.length>0,me=I.value===1&&Object.keys(b.value).length===0&&!$.value;if(!(!V&&le&&me&&!X.value.length&&!ue.value))try{H||(ue.value=!0);const it={page:I.value,perPage:O.value,...b.value,...i.apiParams};if(!Object.keys(it).some(wt=>wt.toLowerCase()==="id"||wt.toLowerCase().endsWith("id"))){const wt=((xe=E==null?void 0:E.params)==null?void 0:xe.id)||((ie=E==null?void 0:E.query)==null?void 0:ie.id)||(typeof window<"u"?new URLSearchParams(window.location.search).get("id"):null);wt&&(it.id=wt)}const Bt=((he=re.value)==null?void 0:he.endpointTable)||((_e=re.value)==null?void 0:_e.endpointSection)||((ze=re.value)==null?void 0:ze.endpoint)||((qe=re.value)==null?void 0:qe.endpointGlobal);if(l!=null&&l.resolveKeyParams&&Array.isArray(Bt==null?void 0:Bt.keyParam)){const wt=l.resolveKeyParams(Bt.keyParam);Object.assign(it,wt)}$.value&&(it.keyword=$.value),Object.keys(it).forEach(wt=>{(it[wt]===""||it[wt]===null||it[wt]===void 0)&&delete it[wt]});let qt;if(Du.value)qt=await c(Du.value,N1.value,it);else if(dl.value){let wt=dl.value;if(i.baseUrl&&typeof i.baseUrl=="string"&&typeof wt=="string"&&!wt.startsWith("http")){const St=i.baseUrl.replace(/\/$/,""),Mt=wt.startsWith("/")?wt:`/${wt}`;wt=`${St}${Mt}`}const Ft={...((et=(Qe=re.value)==null?void 0:Qe.endpoint)==null?void 0:et.config)||{}};aa.value&&(Ft.headers||(Ft.headers={}),Ft.headers.Accept=aa.value,Ft.headers.accept=aa.value),qt=await c(wt,D1.value,it,Ft)}else if(lo.value&&C){const wt={...it,...Lc.value};qt=await new Promise(Ft=>{let St=!1;try{C(lo.value,wt,Mt=>{St||(St=!0,Ft(Mt))})}catch{St||(St=!0,Ft(null))}setTimeout(()=>{St||(St=!0,Ft(null))},2e3)})}ms(qt)}catch(it){console.error("DataTable fetch error",it),ue.value=!1}},qc=H=>{i.dynamicColumns&&Array.isArray(H==null?void 0:H.columns)&&(Bi.value=H.columns.map(V=>({key:V.key||V.field||V.name,label:V.label||V.header||V.name,width:V.width,align:V.align||"LEFT",sortable:V.sortable!==!1,type:V.type,condition:V.condition,format:V.format})))},hi={data:(H,V)=>{var le;return H.totalData||(H.maxPage?H.maxPage*V:(((le=H.data)==null?void 0:le.length)||0)*(H.maxPage||1))},users:H=>{var V;return((V=H.users)==null?void 0:V.length)||0},items:H=>{var V;return H.total||H.totalItems||((V=H.items)==null?void 0:V.length)||0},list:H=>{var V;return H.total||((V=H.list)==null?void 0:V.length)||0},rows:H=>{var V;return H.count||H.total||((V=H.rows)==null?void 0:V.length)||0},result:H=>{var V;return H.total||H.count||((V=H.result)==null?void 0:V.length)||0}},ms=H=>{if(Y.value=!0,H==null){ue.value=!1;return}if(H){qc(H);const V=Object.keys(hi).find(le=>H[le]&&Array.isArray(H[le]));if(V){X.value=H[V];const le=hi[V](H,O.value);te.value=le}else Array.isArray(H)?(X.value=H,te.value=H.length):H&&H.status===!0&&(H.data===null||H.data===void 0)?(X.value=[],te.value=0):Object.keys(H).length>0&&console.warn("DataTable: Unknown response format",H)}ue.value=!1};o.onUnmounted(()=>{clearTimeout(Wc),clearTimeout(Hc)});const km=()=>{Object.keys(b.value).forEach(H=>{b.value[H]=""}),r("reset"),xm()},xm=()=>{I.value=1,r("search",b.value),ei()},Em=(H,V)=>H==null||V===void 0||V===null?!1:typeof H=="string"&&typeof V=="string"?H.toLowerCase().trim()===V.toLowerCase().trim():H==V,jy=H=>{if(typeof H=="boolean")return H?"true":"false";if(typeof H=="object"&&H!==null){const V=H,le=["code","id","name","value","val","label","key","status","statusRequest.name","description"];for(const me of le){const xe=Qt(V,me);if(xe!=null)return String(xe).toLowerCase().trim()}return""}return typeof H=="string"?H.toLowerCase().trim():String(H??"").toLowerCase().trim()},Cm=(H,V)=>{const le=String(V).toLowerCase();return H?["true","1","yes","active","aktif","AKT","enabled","on"].includes(le):["false","0","no","inactive","non active","NAK","disabled","off"].includes(le)},R1=(H,V,le,me)=>{if(H.logic||typeof H.value=="object"&&H.value!==null)try{return go.apply(H.logic||H.value,V)}catch(ie){return console.warn("Badge logic error:",ie),!1}const xe=jy(le);if(Em(H.value,xe)||typeof le=="object"&&le!==null&&["code","id","name","value","val","label","key","status","statusRequest.name","description"].some(he=>Em(H.value,Qt(le,he))))return!0;if(typeof le=="boolean")return Cm(le,H.value);if(me.includes(".")){const ie=me.split(".").slice(0,-1).join("."),he=Qt(V,ie);if(he&&typeof he=="object"&&["code","id","name","value","val","label","key","status","statusRequest.name","description"].some(ze=>Em(H.value,Qt(he,ze))))return!0}return!1},Kc=(H,V)=>{var _e;const le=Qt(H,V.key),xe=[...Array.isArray(V.condition)?V.condition:[],...Array.isArray(V.propsCustom)?V.propsCustom:[],...Array.isArray((_e=V.custom)==null?void 0:_e.propsCustom)?V.custom.propsCustom:[]].find(ze=>R1(ze,H,le,V.key)),ie=ze=>typeof ze=="object"?(ze==null?void 0:ze.name)||(ze==null?void 0:ze.code)||"-":ze,he={variant:(xe==null?void 0:xe.variant)||"secondary",class:"",label:ie(le),color:xe==null?void 0:xe.color};return xe&&(xe.labelEN||xe.labelID||xe.labelKR)&&(he.label=d.value==="kr"||d.value==="ko"?xe.labelKR||xe.labelEN||xe.labelID:d.value==="id"?xe.labelID||xe.labelEN:xe.labelEN||xe.labelID),he},Rt=(H,V,le)=>{var me,xe,ie,he;return((xe=(me=H.custom)==null?void 0:me.props)==null?void 0:xe[V])??((ie=H.props)==null?void 0:ie[V])??((he=H.custom)==null?void 0:he[V])??H[V]??le},I1=(H,V)=>{var me,xe;return[...Array.isArray((me=V.custom)==null?void 0:me.propsCustom)?V.custom.propsCustom:[],...Array.isArray(V.propsCustom)?V.propsCustom:[],...Array.isArray((xe=V.custom)==null?void 0:xe.buttons)?V.custom.buttons:[],...Array.isArray(V.buttons)?V.buttons:[]].filter(ie=>$c(ie,H))},Or=H=>{q.value.key===H?q.value.direction=q.value.direction==="asc"?"desc":"asc":(q.value.key=H,q.value.direction="asc"),r("update:sort",q.value)},hl=H=>{if(H===I.value)return;I.value=H,Dn.value&&ei();const V=(H-1)*O.value+1,le=H*O.value;r("update:page",H),r("update:startIndex",V),r("update:endIndex",le)},Uy=H=>{O.value=H,I.value=1,Dn.value&&ei();const V=1,le=H;r("update:perPage",H),r("update:page",1),r("update:startIndex",V),r("update:endIndex",le)},Wy=()=>{$.value="",b.value=i.filters?{...i.filters}:{},I.value=1,r("reset"),r("refresh"),r("search",b.value),i.controlled||ei(!1,!0)};o.watch(()=>i.data,()=>{X.value=[],Y.value=!1},{deep:!0});const Sm=H=>{var me,xe;if(!H)return H;const V=Ni.value.find(ie=>ie.key===H.model),le=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect"].includes(H.component);if((xe=(me=V==null?void 0:V.propsCustom)==null?void 0:me[0])!=null&&xe.value&&le){const ie={...H},he=H.props||H.propsFieldGlobal||H.propsFieldCustom||{};return ie.props={...he,returnObject:!0},ie}return H};function ml(H){if(!H)return null;const V=H.propsActionCustom||H.props||H.propsActionGlobal||{},le=[H.endpointPropAction,V.endpointPropAction,H.endpointAction,V.endpointAction,H.endpointDialogActionSave,V.endpointDialogActionSave,H.endpointDialogAction,V.endpointDialogAction,H.endpoint,V.endpoint];for(const me of le)if(me&&typeof me=="object"&&me.apiUrl&&me.apiUrl!=="")return me;return le.find(me=>me&&typeof me=="object")||null}const Hy=H=>{var V,le,me,xe;if((H.route||H.keyRedirect&&H.targetBehavior==="IN_PLACE"&&H.path)&&!i.dummyMode){if(H.path&&H.route){const _e=H.route.startsWith("/")?H.route:"/"+H.route;sessionStorage.setItem(`layout_${_e}`,H.path)}const ie=H.path?{code:H.path}:{},he=H.fieldMapping||((V=H.propsActionGlobal)==null?void 0:V.fieldMapping)||((le=H.propsActionCustom)==null?void 0:le.fieldMapping)||((me=H.props)==null?void 0:me.fieldMapping);he&&typeof he=="object"&&Object.entries(he).forEach(([_e,ze])=>{if(typeof ze=="string"){const qe=ke[_e];qe!==void 0&&(ie[ze]=qe)}}),r("navigate",{route:H.route,path:H.path,query:ie,targetBehavior:H.targetBehavior}),H.targetBehavior!=="IN_PLACE"&&(k==null||k.push({path:H.route,query:ie}))}else{const ie=ml(H);ie!=null&&ie.apiUrl?Yy(H,null,ie):r("action",{action:((xe=H.propsActionCustom)==null?void 0:xe.key)||H.key||"create",row:null,selection:ai.value})}},Lu=H=>{if(H.requireConfirm){_.value={button:H,row:null},ee.value=!0;return}if(H.openDialog||i.dummyMode&&H.route){ae.value=H,we.value=null,pe.value=null,Object.keys(ke).forEach(le=>delete ke[le]);const V=H.fieldActionGlobal||H.fieldActionCustom||H.field||[];V.length&&V.forEach(le=>{yr(le);const me=ml(H),xe=me!=null&&me.keyParam&&me.keyParam.length>0?me.keyParam[0]:null,ie=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(le.component),he=xe&&le.model===xe,_e=!xe&&/^(id|ids|idAuditTrail|idAppRequest)$/i.test(le.model);if(he||_e&&!ie)ke[le.model]=ai.value;else if(ke[le.model]===void 0||ke[le.model]===""){const ze=rt(le,ke);ke[le.model]=ze!==void 0?ze:null}}),console.log("[DataTable][handleHeaderAction] Before applyCalculations. Filters:",JSON.stringify(b.value),"ParentFormDataWrapper:",JSON.stringify(R)),$e(),K.value=!0,setTimeout(()=>{Tu()},50)}else Hy(H)},qy=(H,V)=>{var ie,he,_e;Mo.value;const le=Bf(V);Object.keys(le).forEach(ze=>{ke[ze]=le[ze]}),V&&typeof V=="object"&&Object.keys(V).forEach(ze=>{ke[ze]===void 0&&(ke[ze]=V[ze])});const me=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);me&&typeof me=="object"&&Object.entries(me).forEach(([ze,qe])=>{if(typeof qe=="string"){const Qe=Qt(V,ze);Qe!==void 0&&(ke[qe]=Qe)}});const xe=Be.value;console.log(`[initializeDialogData] Processing ${xe.length} fields:`,xe.map(ze=>ze.key||ze.model)),xe.length>0&&xe.forEach(ze=>{yr(ze,!0);const qe=ze.model||ze.key;if(!qe)return;const Qe=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(ze.component);if(/^(id|ids|idAuditTrail|idAppRequest)$/i.test(qe)&&(!Qe||qe==="idAppRequest")){const et=V[Mo.value]||le[qe]||V.id;ke[qe]=/id$|idAppRequest|idSlikLogin/i.test(qe)?et:[et]}else if(H.action==="showToken"&&qe==="token")ke[qe]=V.token??le.token??"";else{let et=Qt(V,qe);if(et==null){const it=qe.includes(".")?qe.split(".").pop():null;it&&(et=Qt(V,it))}if(et!=null)ke[qe]=et;else{const it=rt(ze,ke);ke[qe]=it!==void 0?it:null}}}),setTimeout(()=>{Tu()},50)},Am=(H,V)=>{const le={};if(V.keyParam&&Array.isArray(V.keyParam)&&V.keyParam.forEach((me,xe)=>{if(typeof me=="string"){const ie=V.model&&xe===0?V.model:me,he=Qt(H,me);he!==void 0&&(le[ie]=he)}else typeof me=="object"&&me!==null&&Object.entries(me).forEach(([ie,he])=>{const _e=Qt(H,he);_e!==void 0&&(le[ie]=_e)})}),Object.keys(le).length===0&&H){const me=Mo.value;H[me]?le[me]=H[me]:H.id&&(le.id=H.id)}return le},O1=H=>{let V=H;V.item&&(V=V.item),Array.isArray(V)&&(V=V[0]||{});const le=Bf(V);if(Object.keys(le).forEach(me=>{ke[me]=le[me]}),Object.keys(V).forEach(me=>{we.value&&(we.value[me]=V[me])}),!ke.token){const me=Object.keys(V).find(xe=>xe.toLowerCase().includes("token"));me&&(ke.token=V[me])}},uo=(H,V,le,me,xe)=>{const ie=(H==null?void 0:H.data)??(H==null?void 0:H.result)??H;ie&&typeof ie=="object"?O1(ie):typeof ie=="string"&&"token"in ke&&(ke.token=ie),me&&xe!=="delete"&&r("action",{action:V.action||xe,row:we.value||le})},L1=async(H,V,le,me,xe)=>{ue.value=!0;const ie=Am(V,le);try{const he={...le.config||{}};le.accept&&(he.headers||(he.headers={}),he.headers.Accept=le.accept,he.headers.accept=le.accept);const _e=await c(le.apiUrl,"GET",ie,he);uo(_e,H,V,me,xe)}catch(he){console.error("Fetch Data Failed",he)}finally{ue.value=!1}},pl=async(H,V,le)=>{var me;if(console.log("[DataTable][handleRowAction] Clicked button:",H.key||H.id,"Props:",H),H.requireConfirm){_.value={button:H,row:V},ee.value=!0;return}if(H.openDialog){ae.value=H,we.value=V,pe.value=le!==void 0?le:null,Object.keys(ke).forEach(ze=>delete ke[ze]),qy(H,V),$e();const xe=H.propsActionCustom||H.props||H.propsActionGlobal||{},ie=ml(H),he=(H.actionType||H.permission||"").toLowerCase(),_e=/detail|view|edit|update|delete|destroy/i.test(he)||/detail|view|edit|update|delete|destroy/i.test(H.action||"");K.value=!0,((me=ie==null?void 0:ie.apiMethod)==null?void 0:me.toUpperCase())==="GET"&&ie.apiUrl&&(ie===H.endpointDialogActionSave||ie===xe.endpointDialogActionSave||L1(H,V,ie,_e,he));return}$1(H,V,le)},ps=(H,V)=>{var he;let le=H.route||"";if(!le)return"";const me=H.propsActionCustom||H.propsActionGlobal,xe=(he=me==null?void 0:me.endpointForm)==null?void 0:he.keyParam;if(le.includes(":"))return le.replaceAll(/:(\w+)/g,(_e,ze)=>{if(xe&&xe.length>0){let qe=null;for(const Qe of xe)if(typeof Qe=="object"&&Qe!==null)if(Qe[ze]!==void 0){qe=Qe[ze];break}else{const et=Object.values(Qe);et.length>0&&(qe=et[0])}else typeof Qe=="string"&&(qe=Qe);if(qe){const Qe=String(qe).split(".").reduce((et,it)=>et&&et[it],V);if(Qe!=null)return Qe}}return(V?V[ze]||V.id:null)||ze});let ie=V==null?void 0:V.id;if(xe&&xe.length>0){const _e=xe[0];let ze=null;if(typeof _e=="object"&&_e!==null?ze=_e.id||_e.key||Object.values(_e)[0]:ze=_e,ze&&V){const qe=String(ze).split(".").reduce((Qe,et)=>Qe&&Qe[et],V);qe!=null&&(ie=qe)}}return ie?`${le.replace(/\/$/,"")}/${ie}`:le},Ky=(H,V,le)=>{var ie,he,_e;const me=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);if(!me||typeof me!="object")return;const xe=[];if(Object.entries(me).forEach(([ze,qe])=>{if(typeof qe=="string"){const Qe=Qt(V,ze);if(Qe===void 0)xe.push(ze);else{let et=Qe;Qe&&typeof Qe=="object"&&!Array.isArray(Qe)&&/id|code|idSlik|idOperator|idSupervisor/i.test(qe)&&(et=Qe.id??Qe.code??Qe.value??Qe),le[qe]=et}}}),xe.length>0){const ze=d.value||"en",qe=ze==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Qe=ze==="id"?`Terdapat ketidaksesuaian skema pada field: ${xe.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${xe.join(", ")}. Please contact the development team.`;xt.warning(`${qe}: ${Qe}`,{autoClose:5e3,position:"top-right"})}},Gy=(H,V)=>{var ie,he,_e,ze;if(console.log("[DataTable][performRoutingAction] Button:",H,"row:",V),H.path&&H.route){const qe=H.route.startsWith("/")?H.route:"/"+H.route;sessionStorage.setItem(`layout_${qe}`,H.path)}let le=ps(H,V);const me=H.path?{code:H.path}:{};if(le&&le.includes("?")){const[qe,Qe]=le.split("?");le=qe;const et=new URLSearchParams(Qe);for(const[it,Et]of et.entries())me[it]=Et}const xe=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);xe&&typeof xe=="object"&&Object.entries(xe).forEach(([qe,Qe])=>{if(typeof Qe=="string"){const et=Qt(V,qe);et!==void 0&&(me[Qe]=et)}}),V&&V.id&&me.id===void 0&&(me.id=V.id),r("navigate",{route:le,path:H.path,query:me,targetBehavior:H.targetBehavior||((ze=H.action)==null?void 0:ze.targetBehavior)}),H.targetBehavior!=="IN_PLACE"&&(k==null||k.push({path:le,query:me}))},Tm=(H,V,le)=>{const me={};if(V)Ky(H,V,me),le.keyParam&&Array.isArray(le.keyParam)&&le.keyParam.forEach((xe,ie)=>{if(typeof xe=="string"){const he=le.model&&ie===0?le.model:xe,_e=Qt(V,xe);_e!==void 0&&(me[he]=_e)}else typeof xe=="object"&&xe!==null&&Object.entries(xe).forEach(([he,_e])=>{const ze=Qt(V,_e);ze!==void 0&&(me[he]=ze)})}),Object.keys(me).length===0&&V.id&&(me.id=V.id);else{const xe=Zy(H,le);me[xe]=ai.value||[]}return me},F1=H=>{if(!H)return null;const V=H.match(/filename\*=(?:UTF-8'')?([^;\n]+)/i);if(V){const me=V[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(me)}catch{return me}}const le=H.match(/filename=(?:"?)([^";]+)(?:"?)/i);if(le){const me=le[1].trim().replace(/^['"]|['"]$/g,"");try{return decodeURIComponent(me)}catch{return me}}return null},Pm=(H,V)=>{if(!H||!H.headers)return null;const le=H.headers;if(typeof le.get=="function")return le.get(V);const me=Object.keys(le).find(xe=>xe.toLowerCase()===V.toLowerCase());return me?le[me]:null},Bm=H=>{const V=Pm(H,"content-disposition")||Pm(H,"Content-Disposition"),le=F1(V);return H instanceof Blob?{blob:H,filename:le}:(H==null?void 0:H.data)instanceof Blob?{blob:H.data,filename:le}:{blob:H,filename:le}},Yy=(H,V,le)=>{ue.value=!0;const me=Tm(H,V,le),xe=xt.loading(d.value==="id"?"Memproses...":"Processing..."),ie=le.responseType==="blob"||le.responseType==="arraybuffer"||le.accept&&!le.accept.includes("json")||le.apiUrl&&(le.apiUrl.includes("/export")||le.apiUrl.includes("/download"))||H.actionType==="EXPORT"||H.permission==="EXPORT",he={...le.config||{}};le.accept&&(he.headers||(he.headers={}),he.headers.Accept=le.accept,he.headers.accept=le.accept),ie&&(he.responseType=le.responseType||"blob"),c(le.apiUrl,le.apiMethod||"POST",me,he).then(_e=>{var Qe,et,it,Et;if(ie&&(_e instanceof Blob||((Qe=_e==null?void 0:_e.constructor)==null?void 0:Qe.name)==="Blob"||(_e==null?void 0:_e.size)!==void 0||(_e==null?void 0:_e.data)instanceof Blob||((it=(et=_e==null?void 0:_e.data)==null?void 0:et.constructor)==null?void 0:it.name)==="Blob"||((Et=_e==null?void 0:_e.data)==null?void 0:Et.size)!==void 0||(_e==null?void 0:_e.data)instanceof ArrayBuffer)){const{blob:Bt,filename:qt}=Bm(_e),wt=Bt instanceof Blob?Bt:new Blob([Bt],{type:le.accept||"application/octet-stream"});if(wt.type==="application/json"){const bi=new FileReader;bi.onload=()=>{try{const Kn=JSON.parse(bi.result).message||(d.value==="id"?"Gagal mengunduh file":"Failed to download file");xt.update(xe,{render:Kn,type:"error",isLoading:!1,autoClose:5e3})}catch{const Kn=window.URL.createObjectURL(wt),Pn=document.createElement("a");Pn.href=Kn;const Lr=H.label||H.text||H.tooltip||"Export",j1=qt||`${Lr}_${new Date().toISOString().slice(0,10)}.pdf`;Pn.setAttribute("download",j1),document.body.appendChild(Pn),Pn.click(),Pn.remove(),window.URL.revokeObjectURL(Kn),xt.update(xe,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3})}},bi.readAsText(wt);return}const Ft=window.URL.createObjectURL(wt),St=document.createElement("a");St.href=Ft;let Mt="txt";const Kt=(le.accept||"").toLowerCase(),qn=(le.apiUrl||"").toLowerCase();ke!=null&&ke.format?Mt=String(ke.format).toLowerCase():Kt.includes("pdf")?Mt="pdf":Kt.includes("excel")||Kt.includes("sheet")||Kt.includes("spreadsheet")||Kt.includes("xlsx")?Mt="xlsx":Kt.includes("csv")?Mt="csv":Kt.includes("zip")?Mt="zip":qn.includes("pdf")?Mt="pdf":qn.includes("excel")||qn.includes("xlsx")?Mt="xlsx":qn.includes("csv")?Mt="csv":qn.includes("zip")&&(Mt="zip");const Ct=H.label||H.text||H.tooltip||"Export";let ut=qt||`${Ct}_${new Date().toISOString().slice(0,10)}.${Mt}`;Mt==="txt"&&ut.toLowerCase().endsWith(".bin")&&(ut=ut.replace(/\.bin$/i,".txt")),St.setAttribute("download",ut),document.body.appendChild(St),St.click(),St.remove(),window.URL.revokeObjectURL(Ft),xt.update(xe,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3}),ei(),r("action",{action:H.action||"success",row:V});return}const ze=(_e==null?void 0:_e.status)===!0,qe=(_e==null?void 0:_e.message)||(ze?d.value==="id"?"Sukses":"Success":d.value==="id"?"Gagal":"Failed");xt.update(xe,{render:qe,type:ze?"success":"error",isLoading:!1,autoClose:ze?2e3:5e3}),ze&&(ei(),r("action",{action:H.action||"success",row:V}))}).catch(_e=>{console.error("Action Failed",_e),xt.update(xe,{render:_e.message||"Action failed",type:"error",isLoading:!1,autoClose:5e3})}).finally(()=>{ue.value=!1})},$1=(H,V,le)=>{if(console.log("[DataTable][executeRowAction] Button:",H,"route:",H.route,"keyRedirect:",H.keyRedirect,"targetBehavior:",H.targetBehavior,"path:",H.path),i.dummyMode){if(H.triggerNavigation){console.log("[DataTable][executeRowAction] triggerNavigation detected in dummy mode, emitting action event"),r("action",{action:H.action,row:V,rowIndex:le});return}ae.value=H,we.value=V,pe.value=null,Object.keys(ke).forEach(me=>delete ke[me]),qy(H,V),K.value=!0;return}if(H.route||H.keyRedirect&&H.targetBehavior==="IN_PLACE"&&H.path)Gy(H,V);else{const me=ml(H);me!=null&&me.apiUrl?Yy(H,V,me):r("action",{action:H.action,row:V,rowIndex:le})}},Nm=()=>{if(_.value){const{button:H,row:V}=_.value;er(),V===null?Lu({...H,requireConfirm:!1}):pl({...H,requireConfirm:!1},V)}},Zy=(H,V)=>{let le=V==null?void 0:V.model;if(!le&&(V!=null&&V.keyParam)&&V.keyParam.length>0){const he=V.keyParam[0];typeof he=="string"?le=he:typeof he=="object"&&he!==null&&(le=Object.keys(he)[0])}if(le)return le;const me=sa();if(me)return me;const ie=(H.fieldActionGlobal||H.fieldActionCustom||H.field||[]).find(he=>{const _e=["DCodeAutoComplete","DCodeInfiniteAutoComplete","DCodeMultiSelect","DCodeSelect"].includes(he.component);return/^(id|ids|idAuditTrail|idAppRequest)$/i.test(he.model)&&!_e});return ie?ie.model:"ids"},Xy=(H,V,le)=>{var ie,he,_e;let me={...ke};const xe=H.fieldMapping||((ie=H.propsActionGlobal)==null?void 0:ie.fieldMapping)||((he=H.propsActionCustom)==null?void 0:he.fieldMapping)||((_e=H.props)==null?void 0:_e.fieldMapping);if(we.value){const ze=Mo.value,qe=we.value[ze];me[le]||(/id$|idAppRequest|idSlikLogin/i.test(le)||V!=null&&V.model?me[le]=qe:me[le]=[qe])}else me[le]||(me[le]=ai.value||[]);if(xe&&typeof xe=="object"){const ze={},qe=Object.keys(xe),Qe=(H.fieldActionCustom||H.fieldActionGlobal||H.fields||[]).map(it=>it.model||it.key);[...new Set([...Qe,le])].forEach(it=>{it&&!qe.includes(it)&&me[it]!==void 0&&(ze[it]=me[it])}),Object.entries(xe).forEach(([it,Et])=>{if(typeof Et=="string"){const Bt=Qt(me,it)??(we.value?Qt(we.value,it):void 0);if(Bt!==void 0){let qt=Bt;Bt&&typeof Bt=="object"&&!Array.isArray(Bt)&&/id|code|idSlik|idOperator|idSupervisor/i.test(Et)&&(qt=Bt.id??Bt.code??Bt.value??Bt),ze[Et]=/id$|idAppRequest|idSlikLogin/i.test(Et)&&Array.isArray(qt)?qt[0]:qt}}}),me=ze}return me},Jy=(H,V,le)=>{if(l!=null&&l.resolveKeyParams&&Array.isArray(V==null?void 0:V.keyParam)){const he=l.resolveKeyParams(V.keyParam);console.log("[DataTable][handleApiSave] Resolved keyParams:",he),Object.assign(le,he)}const me=xt.loading(d.value==="id"?"Memproses...":"Processing..."),xe=V.responseType==="blob"||V.responseType==="arraybuffer"||V.accept&&!V.accept.includes("json")||V.apiUrl&&(V.apiUrl.includes("/export")||V.apiUrl.includes("/download"))||H.actionType==="EXPORT"||H.permission==="EXPORT",ie={...V.config||{}};V.accept&&(ie.headers||(ie.headers={}),ie.headers.Accept=V.accept,ie.headers.accept=V.accept),xe&&(ie.responseType=V.responseType||"blob"),c(V.apiUrl,V.apiMethod||"POST",le,ie).then(he=>{var qe,Qe,et,it;if(xe&&(he instanceof Blob||((qe=he==null?void 0:he.constructor)==null?void 0:qe.name)==="Blob"||(he==null?void 0:he.size)!==void 0||(he==null?void 0:he.data)instanceof Blob||((et=(Qe=he==null?void 0:he.data)==null?void 0:Qe.constructor)==null?void 0:et.name)==="Blob"||((it=he==null?void 0:he.data)==null?void 0:it.size)!==void 0||(he==null?void 0:he.data)instanceof ArrayBuffer)){const{blob:Et,filename:Bt}=Bm(he),qt=Et instanceof Blob?Et:new Blob([Et],{type:V.accept||"application/octet-stream"});if(qt.type==="application/json"){const ut=new FileReader;ut.onload=()=>{try{const li=JSON.parse(ut.result).message||(d.value==="id"?"Gagal mengunduh file":"Failed to download file");xt.update(me,{render:li,type:"error",isLoading:!1,autoClose:5e3})}catch{const li=window.URL.createObjectURL(qt),Kn=document.createElement("a");Kn.href=li;const Pn=H.label||H.text||H.tooltip||"Export",Lr=Bt||`${Pn}_${new Date().toISOString().slice(0,10)}.pdf`;Kn.setAttribute("download",Lr),document.body.appendChild(Kn),Kn.click(),Kn.remove(),window.URL.revokeObjectURL(li),xt.update(me,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3})}},ut.readAsText(qt);return}const wt=window.URL.createObjectURL(qt),Ft=document.createElement("a");Ft.href=wt;let St="txt";const Mt=(V.accept||"").toLowerCase(),Kt=(V.apiUrl||"").toLowerCase();ke!=null&&ke.format?St=String(ke.format).toLowerCase():le!=null&&le.format?St=String(le.format).toLowerCase():Mt.includes("pdf")?St="pdf":Mt.includes("excel")||Mt.includes("sheet")||Mt.includes("spreadsheet")||Mt.includes("xlsx")?St="xlsx":Mt.includes("csv")?St="csv":Mt.includes("zip")?St="zip":Kt.includes("pdf")?St="pdf":Kt.includes("excel")||Kt.includes("xlsx")?St="xlsx":Kt.includes("csv")?St="csv":Kt.includes("zip")&&(St="zip");const qn=H.label||H.text||H.tooltip||"Export";let Ct=Bt||`${qn}_${new Date().toISOString().slice(0,10)}.${St}`;St==="txt"&&Ct.toLowerCase().endsWith(".bin")&&(Ct=Ct.replace(/\.bin$/i,".txt")),Ft.setAttribute("download",Ct),document.body.appendChild(Ft),Ft.click(),Ft.remove(),window.URL.revokeObjectURL(wt),xt.update(me,{render:d.value==="id"?"File berhasil diunduh!":"File downloaded successfully!",type:"success",isLoading:!1,autoClose:2e3}),K.value=!1,we.value||(ai.value=[]),da.value="",ei(),r("action",{action:"success",row:null}),gl(H);return}const _e=(he==null?void 0:he.status)===!0,ze=(he==null?void 0:he.message)||(_e?d.value==="id"?"Sukses":"Success":d.value==="id"?"Gagal":"Failed");xt.update(me,{render:ze,type:_e?"success":"error",isLoading:!1,autoClose:_e?2e3:5e3}),_e&&(K.value=!1,we.value||(ai.value=[]),da.value="",ei(),r("action",{action:"success",row:null}),gl(H))}).catch(he=>{console.error("Action Failed",he),xt.update(me,{render:he.message||"Action failed",type:"error",isLoading:!1,autoClose:5e3})})},gl=H=>{var le,me;const V=(H==null?void 0:H.routeBack)||(H==null?void 0:H.pathBack)||((le=re.value)==null?void 0:le.routeBack)||((me=re.value)==null?void 0:me.pathBack);V&&k.push(V)},ca=(H,V)=>{var me,xe,ie,he,_e;const le={...ke};if(we.value){const ze=((me=i.tableConfig)==null?void 0:me.modelDatatable)||((xe=re.value)==null?void 0:xe.modelDatatable)||H.modelDatatable;r("action",{action:((ie=H.propsActionGlobal)==null?void 0:ie.key)||H.key||V,row:le,originalRow:we.value,rowIndex:pe.value,isLocalSave:!0,actionType:"UPDATE",modelDatatable:ze})}else{const ze=((he=re.value)==null?void 0:he.modelDatatable)||i.apiModule||H.modelDatatable;r("action",{action:((_e=H.propsActionGlobal)==null?void 0:_e.key)||H.key||V,row:le,selection:ai.value,isLocalSave:!0,actionType:"CREATE",modelDatatable:ze})}K.value=!1,we.value||(ai.value=[]),gl(H)},z1=()=>{var _e,ze,qe,Qe;if(!ae.value)return;let H=!0;if(Object.keys(be).forEach(et=>delete be[et]),(Be.value||[]).forEach(et=>{if(et.isHidden||ne(et)||!Re(et))return;const it=ke[et.model],Et=Ue(et,it,ke);Et&&(be[et.model]=Et,H=!1)}),!H){console.warn("[DataTable] Custom action form validation failed:",JSON.parse(JSON.stringify(be)));return}const le=ae.value,me=ml(le),xe=(le.actionType||le.permission||"").toLowerCase(),ie=!!((_e=le.endpointDialogActionSave)!=null&&_e.apiUrl||(qe=(ze=le.propsActionGlobal)==null?void 0:ze.endpointDialogActionSave)!=null&&qe.apiUrl);if((me==null?void 0:me.apiUrl)&&(((Qe=me.apiMethod)==null?void 0:Qe.toUpperCase())!=="GET"||ie)){const et=Zy(le,me),it=Xy(le,me,et);Jy(le,me,it)}else ca(le,xe)},Gc=H=>{const V=ke[H];V&&L3(String(V)).then(()=>{xt.success(h("datatable.copiedSuccess"),{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(le=>{console.error("Failed to copy",le)})},er=()=>{ee.value=!1,_.value=null},Qy=o.computed(()=>_.value?_.value.button.confirmTitle||h("common.confirm"):""),Vy=o.computed(()=>_.value?_.value.button.confirmMessage||h("common.confirmMessage"):"");t({fetchData:ei,filters:b,resetFilters:km,handleRefresh:Wy,currentPage:I,currentPerPage:O});const da=o.ref(""),Fu=H=>{if(!H&&!i.apiParams)return"";const V=(H==null?void 0:H.endpoint)||(H==null?void 0:H.endpointTable)||(H==null?void 0:H.endpointGlobal)||{};return JSON.stringify({url:V.apiUrl||(H==null?void 0:H.apiUrl)||i.apiUrl,module:V.apiModule||(H==null?void 0:H.apiModule)||i.apiModule,action:V.apiAction||(H==null?void 0:H.apiAction)||i.apiAction,method:V.apiMethod||(H==null?void 0:H.apiMethod)||i.apiMethod,params:(H==null?void 0:H.apiParams)||i.apiParams,socket:V.socket||(H==null?void 0:H.socketEndpoint)||i.socketEndpoint,socketParams:(H==null?void 0:H.socketParams)||i.socketParams})};o.watch(()=>i.tableConfig,()=>{if(i.tableConfig){Cn();const H=Fu(i.tableConfig);H!==da.value&&(!i.controlled&&Dn.value?(da.value=H,console.log("[DataTable] Triggering internal auto-fetch due to config change."),hs()):i.controlled&&(da.value=H,console.log("[DataTable] Skipping internal fetch (Controlled Mode).")))}},{deep:!0,immediate:!0});const $u=o.computed(()=>{var H,V,le,me,xe,ie;return d.value==="kr"||d.value==="ko"?((H=re.value)==null?void 0:H.titleKR)||((V=re.value)==null?void 0:V.titleEN)||((le=re.value)==null?void 0:le.titleID)||"":d.value==="id"?((me=re.value)==null?void 0:me.titleID)||"":((xe=re.value)==null?void 0:xe.titleEN)||((ie=re.value)==null?void 0:ie.titleID)||""});o.watch(()=>i.apiModule,()=>{Dn.value&&ei()});const eb=H=>{if(I.value!==1)return;const V=H&&(H.data||H.items||H.list||H.rows||H.result);Array.isArray(H)||V?ms(H):ei(!0)};return o.watch(()=>lo.value,(H,V)=>{!y||!A||(V&&A(V,eb),H&&(M&&M(),y(H,eb),B.value&&C&&C(H,Lc.value)))},{immediate:!0}),o.watch(()=>B.value,H=>{H&&lo.value&&C&&C(lo.value,Lc.value)}),o.watch(()=>i.socketParams,()=>{ul.value&&(B.value&&lo.value&&C&&C(lo.value,Lc.value),ei())},{deep:!0}),o.watch(()=>i.apiParams,(H,V)=>{JSON.stringify(H)!==JSON.stringify(V)&&Dn.value&&hs()},{deep:!0}),o.watch(()=>i.page,H=>{H!==void 0&&H!==I.value&&(I.value=H,Dn.value&&ei())}),o.watch(()=>i.perPage,H=>{H!==void 0&&H!==O.value&&(O.value=H,Dn.value&&ei())}),o.watch(()=>i.startIndex,H=>{if(H!==void 0){const V=Math.floor((H-1)/O.value)+1;V!==I.value&&(I.value=V,Dn.value&&ei())}}),o.watch(()=>G.value,H=>{fs.value},{deep:!0}),o.onMounted(()=>{if(Cn(),Dn.value&&!i.controlled){const H=Fu(re.value||i.tableConfig);H!==da.value&&(da.value=H,ue.value=!0,ei())}}),(H,V)=>{var le,me,xe;return o.openBlock(),o.createElementBlock("div",jge,[Oc((le=re.value)==null?void 0:le.isHidden)?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",Uge,[e.nested&&$u.value?(o.openBlock(),o.createElementBlock("div",Wge,[V[11]||(V[11]=o.createElementVNode("div",{class:"h-4 w-1 bg-white/50 rounded-full"},null,-1)),o.createElementVNode("span",Hge,o.toDisplayString($u.value),1)])):o.createCommentVNode("",!0),o.createElementVNode("div",qge,[!e.nested||e.dummyMode||ce.value?(o.openBlock(),o.createElementBlock("div",Kge,[o.createElementVNode("div",Gge,[o.createVNode(o.unref(Ne.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),o.createVNode(o.unref(xge),{modelValue:$.value,"onUpdate:modelValue":V[0]||(V[0]=ie=>$.value=ie),placeholder:h("common.searchPlaceholder"),style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:o.withKeys(wm,["enter"])},null,8,["modelValue","placeholder"])]),S.value.length>0||H.$slots["filter-form"]?(o.openBlock(),o.createElementBlock("div",Yge,[o.createVNode(vge,{title:m.value,description:g.value},{trigger:o.withCtx(()=>[o.createVNode(Vt,{variant:"secondary",icon:"SlidersHorizontal",tooltip:h("common.advanceSearch"),class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"},null,8,["tooltip"])]),default:o.withCtx(()=>[o.createElementVNode("div",Zge,[o.renderSlot(H.$slots,"filter-form",{filters:b.value},()=>[S.value.length>0?(o.openBlock(),o.createElementBlock("div",Xge,[o.createElementVNode("div",Jge,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(D.value,(ie,he)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:he},[o.unref(nt)(ie)?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(gr)(ie,"1"))},[o.createVNode(kge,{field:ie,modelValue:b.value[ie.model],"onUpdate:modelValue":_e=>b.value[ie.model]=_e,disabled:o.unref(fi)(ie),required:o.unref(Tt)(ie),readonly:o.unref(hn)(ie),options:o.unref(vn)(ie),"dynamic-labels":o.unref(Jt)(ie),"dynamic-length":o.unref(cn)(ie),baseUrl:P.value},null,8,["field","modelValue","onUpdate:modelValue","disabled","required","readonly","options","dynamic-labels","dynamic-length","baseUrl"])],2)):o.createCommentVNode("",!0)],64))),128))])])):o.createCommentVNode("",!0)]),S.value.length>0||H.$slots["filter-form"]?(o.openBlock(),o.createElementBlock("div",Qge,[o.createElementVNode("div",Vge,[o.createVNode(o.unref(Fr),{variant:"outline",onClick:km,disabled:Di.value,class:"w-full gap-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.RefreshCw),{class:"w-4 h-4"}),o.createTextVNode(" "+o.toDisplayString(h("common.reset")),1)]),_:1},8,["disabled"]),o.createVNode(o.unref(Fr),{onClick:xm,disabled:Do.value,class:"w-full gap-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.Search),{class:"w-4 h-4"}),o.createTextVNode(" "+o.toDisplayString(h("common.search")),1)]),_:1},8,["disabled"])])])):o.createCommentVNode("",!0)])]),_:3},8,["title","description"])])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(["flex items-center gap-2 flex-wrap",{"ml-auto":e.nested}])},[(!e.nested||e.dummyMode||se.value)&&Dn.value?(o.openBlock(),o.createBlock(Vt,{key:0,variant:"secondary",icon:"RefreshCw",text:h("common.refresh"),tooltip:h("common.refresh"),class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:Wy,disabled:Di.value},{icon:o.withCtx(()=>[o.createVNode(o.unref(Ne.RefreshCw),{class:o.normalizeClass(["w-3.5 h-3.5",{"animate-spin":Di.value}])},null,8,["class"])]),_:1},8,["text","tooltip","disabled"])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(fs.value,(ie,he)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:he},[ie.type==="BUTTONGROUP"||ie.actionType==="BUTTONGROUP"||ie.propsActionGlobal&&ie.propsActionGlobal.type==="BUTTONGROUP"||ie.buttons&&ie.buttons.length||ie.propsCustom&&ie.propsCustom.length?(o.openBlock(),o.createBlock(ba,{key:0,text:ie.label,icon:ie.icon,"label-k-r":ie.labelKR,"label-e-n":ie.labelEN,"label-i-d":ie.labelID||ie.label,variant:ie.variant,"bg-color":ie.bgColor,"text-color":ie.textColor,"border-style":ie.borderStyle||"none","border-color":ie.borderColor,rounded:ie.rounded||"md",buttons:ie.buttons||ie.propsCustom||ie.propsActionGlobal&&(ie.propsActionGlobal.buttons||ie.propsActionGlobal.propsCustom)||[],"menu-align":"right",onAction:V[1]||(V[1]=_e=>Lu(_e)),onButtonClick:V[2]||(V[2]=_e=>Lu(_e))},null,8,["text","icon","label-k-r","label-e-n","label-i-d","variant","bg-color","text-color","border-style","border-color","rounded","buttons"])):(o.openBlock(),o.createBlock(Vt,{key:1,icon:ie.icon,text:ie.label,tooltip:ie.tooltip,variant:ie.variant,"bg-color":ie.bgColor,"text-color":ie.textColor,"border-style":ie.borderStyle||"none","border-color":ie.borderColor,rounded:ie.rounded||"md",class:o.normalizeClass(["gap-2 h-9 shadow-lg shadow-primary-500/20 text-xs font-medium",{"border-none":!ie.borderStyle||ie.borderStyle==="none"}]),onClick:_e=>Lu(ie)},null,8,["icon","text","tooltip","variant","bg-color","text-color","border-style","border-color","rounded","class","onClick"]))],64))),128)),o.renderSlot(H.$slots,"header-actions")],2)])])),o.createElementVNode("div",e0e,[Di.value?(o.openBlock(),o.createElementBlock("div",t0e,[...V[12]||(V[12]=[o.createElementVNode("div",{class:"h-full bg-primary animate-progress-shimmer"},null,-1)])])):o.createCommentVNode("",!0),o.createElementVNode("table",n0e,[o.createElementVNode("thead",i0e,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ni.value,ie=>(o.openBlock(),o.createElementBlock("th",{key:ie.key,class:o.normalizeClass([ie.align?`text-${ie.align.toLowerCase()}`:"text-left",ie.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:o.normalizeStyle(ie.width?{width:ie.width}:{}),onClick:he=>ie.sortable&&Or(ie.key)},[["CHECKBOX","checkbox"].includes(ie.type??"")&&!Oc(ie.isHidden)?(o.openBlock(),o.createElementBlock("div",o0e,[o.createElementVNode("input",{type:"checkbox",class:"h-4 w-4 rounded border-white/30 bg-transparent text-white focus:ring-offset-primary-700 focus:ring-white cursor-pointer accent-primary-500",checked:Fy.value,indeterminate:T1.value,onChange:V[3]||(V[3]=he=>$y(he.target.checked)),onClick:V[4]||(V[4]=o.withModifiers(()=>{},["stop"]))},null,40,s0e)])):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-2 w-full",zc(ie.align)])},[o.createElementVNode("span",null,o.toDisplayString(ie.label),1)],2))],14,r0e))),128)),co.value?(o.openBlock(),o.createElementBlock("th",a0e,[o.createElementVNode("div",l0e,o.toDisplayString(h("common.actions")),1)])):o.createCommentVNode("",!0)])]),o.createElementVNode("tbody",c0e,[Di.value&&X.value.length===0?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(vr.value.length>0?vr.value.length:Math.max(O.value,5),ie=>(o.openBlock(),o.createElementBlock("tr",{key:`skeleton-${ie}`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ni.value,he=>{var _e,ze;return o.openBlock(),o.createElementBlock("td",{key:he.key,class:o.normalizeClass([he.align?`text-${he.align.toLowerCase()}`:"text-left","px-3 py-3"])},[o.createElementVNode("div",{class:o.normalizeClass(["animate-shimmer rounded-md",[["badge","BADGE"].includes(he.type??"")||he.condition?"h-6 w-24 rounded-full":"h-5 w-full max-w-[80%]",((_e=he.align)==null?void 0:_e.toLowerCase())==="center"?"mx-auto":"",((ze=he.align)==null?void 0:ze.toLowerCase())==="right"?"ml-auto":""]])},null,2)],2)}),128)),co.value?(o.openBlock(),o.createElementBlock("td",d0e,[...V[13]||(V[13]=[o.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[o.createElementVNode("div",{class:"w-8 h-8 bg-zinc-200/50 dark:bg-zinc-800/50 rounded-lg animate-pulse"}),o.createElementVNode("div",{class:"w-8 h-8 bg-zinc-200/50 dark:bg-zinc-800/50 rounded-lg animate-pulse delay-75"})],-1)])])):o.createCommentVNode("",!0)]))),128)):vr.value.length===0?(o.openBlock(),o.createElementBlock("tr",u0e,[o.createElementVNode("td",{colspan:Ni.value.length+(co.value?1:0),class:"text-center py-16"},[o.createElementVNode("div",h0e,[o.createVNode(o.unref(iI.Vue3Lottie),{animationData:o.unref(zge),height:200,width:200},null,8,["animationData"]),o.createElementVNode("div",null,[o.createElementVNode("p",m0e,o.toDisplayString(Ir.value?h("dataTable.noSearchResults"):h("common.noData")),1),o.createElementVNode("p",p0e,o.toDisplayString(Ir.value?h("dataTable.tryChangingKeywords"):h("common.noData")),1)])])],8,f0e)])):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:2},o.renderList(vr.value,(ie,he)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:he},[o.createElementVNode("tr",{class:o.normalizeClass(["hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150",{"opacity-50 pointer-events-none select-none grayscale-[30%]":Di.value}])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ni.value,_e=>(o.openBlock(),o.createElementBlock("td",{key:_e.key,class:o.normalizeClass([_e.align?`text-${_e.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[o.renderSlot(H.$slots,`cell-${_e.key}`,{row:ie,value:Qt(ie,_e.key)},()=>{var ze,qe,Qe,et,it,Et,Bt,qt,wt,Ft;return[["CHECKBOX","checkbox"].includes(_e.type??"")&&!Oc(_e.isHidden)?(o.openBlock(),o.createElementBlock("div",g0e,[o.createElementVNode("input",{type:"checkbox",class:"h-4 w-4 rounded border-neutral-300 dark:border-neutral-700 bg-white dark:bg-zinc-800 text-primary-600 focus:ring-primary-500 cursor-pointer",checked:P1(ie),onChange:St=>B1(ie,St.target.checked),onClick:V[5]||(V[5]=o.withModifiers(()=>{},["stop"]))},null,40,y0e)])):_e.type==="badge"||_e.type==="BADGE"||((ze=_e.custom)==null?void 0:ze.type)==="badge"||((qe=_e.custom)==null?void 0:qe.type)==="BADGE"||_e.condition?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[_e.align?`justify-${_e.align.toLowerCase()}`:"justify-start"]])},[o.createVNode(au,{variant:Kc(ie,_e).variant,color:Kc(ie,_e).color,class:o.normalizeClass([Kc(ie,_e).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Kc(ie,_e).label),1)]),_:2},1032,["variant","color","class"])],2)):_e.type==="buttongroup"||_e.type==="BUTTONGROUP"||((Qe=_e.custom)==null?void 0:Qe.type)==="buttongroup"||((et=_e.custom)==null?void 0:et.type)==="BUTTONGROUP"?(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[_e.align?`justify-${_e.align.toLowerCase()}`:"justify-start"]])},[o.createVNode(ba,{buttons:I1(ie,_e),size:Rt(_e,"size","sm"),variant:Rt(_e,"variant","default"),"bg-color":Rt(_e,"bgColor",""),"text-color":Rt(_e,"textColor",""),"border-color":Rt(_e,"borderColor",""),"border-style":Rt(_e,"borderStyle","solid"),rounded:Rt(_e,"rounded","md"),orientation:Rt(_e,"orientation","horizontal"),onButtonClick:St=>pl(St,ie,he)},null,8,["buttons","size","variant","bg-color","text-color","border-color","border-style","rounded","orientation","onButtonClick"])],2)):_e.key==="no"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createTextVNode(o.toDisplayString((I.value-1)*O.value+he+1),1)],64)):_e.type==="HYPERLINK"||_e.type==="hyperlink"?(o.openBlock(),o.createElementBlock("a",{key:4,href:Qt(ie,(Et=(it=_e.propsCustom)==null?void 0:it[0])==null?void 0:Et.urlLink)||"#",target:((qt=(Bt=_e.propsCustom)==null?void 0:Bt[0])==null?void 0:qt.target)||"_blank",class:"text-blue-600 dark:text-blue-400 hover:underline inline-flex items-center gap-1 font-medium"},[o.createTextVNode(o.toDisplayString(Qt(ie,_e.key)||"-")+" ",1),((Ft=(wt=_e.propsCustom)==null?void 0:wt[0])==null?void 0:Ft.target)==="_blank"?(o.openBlock(),o.createElementBlock("span",v0e,[...V[14]||(V[14]=[o.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[o.createElementVNode("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),o.createElementVNode("polyline",{points:"15 3 21 3 21 9"}),o.createElementVNode("line",{x1:"10",y1:"14",x2:"21",y2:"3"})],-1)])])):o.createCommentVNode("",!0)],8,b0e)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:5},[o.createTextVNode(o.toDisplayString(Dt(ie,_e)),1)],64))]})],2))),128)),co.value?(o.openBlock(),o.createElementBlock("td",w0e,[o.renderSlot(H.$slots,"actions",{row:ie,buttons:Ro(ie),getButtonColor:la,getIconComponent:jc},()=>[Ro(ie).length>0?(o.openBlock(),o.createElementBlock("div",_0e,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Ro(ie),(_e,ze)=>(o.openBlock(),o.createElementBlock("div",{key:ze,class:"group relative"},[_e.type==="BUTTONGROUP"||_e.actionType==="BUTTONGROUP"||_e.propsActionCustom&&_e.propsActionCustom.type==="BUTTONGROUP"||_e.buttons&&_e.buttons.length||_e.propsCustom&&_e.propsCustom.length?(o.openBlock(),o.createBlock(ba,{key:0,text:_e.label,icon:_e.icon,"label-k-r":_e.labelKR,"label-e-n":_e.labelEN,"label-i-d":_e.labelID||_e.label,size:_e.size||"sm",rounded:_e.rounded||"sm","border-style":_e.borderStyle||"none","border-color":_e.borderColor,variant:_e.variant||"ghost","bg-color":la(_e,ie),buttons:_e.buttons||_e.propsCustom||_e.propsActionCustom&&(_e.propsActionCustom.buttons||_e.propsActionCustom.propsCustom)||[],onAction:qe=>pl(qe,ie,he),onButtonClick:qe=>pl(qe,ie,he)},null,8,["text","icon","label-k-r","label-e-n","label-i-d","size","rounded","border-style","border-color","variant","bg-color","buttons","onAction","onButtonClick"])):(o.openBlock(),o.createBlock(Vt,{key:1,tooltip:_e.tooltip||_e.label,icon:_e.icon,text:_e.icon?"":_e.label||h("common.actions"),size:_e.icon?"icon":"sm",rounded:_e.rounded||"sm","border-style":_e.borderStyle||"none","border-color":_e.borderColor,variant:_e.variant||"ghost","bg-color":la(_e,ie),onClick:qe=>pl(_e,ie,he)},null,8,["tooltip","icon","text","size","rounded","border-style","border-color","variant","bg-color","onClick"]))]))),128))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)],2),H.$slots["expanded-row"]?(o.openBlock(),o.createElementBlock("tr",k0e,[o.createElementVNode("td",{colspan:Ni.value.length+(co.value?1:0),class:"px-0 py-0"},[o.renderSlot(H.$slots,"expanded-row",{row:ie,index:he})],8,x0e)])):o.createCommentVNode("",!0)],64))),128))])])]),vr.value.length>0&&e.showPagination&&ge.value?(o.openBlock(),o.createElementBlock("div",E0e,[o.createElementVNode("div",C0e,[o.createVNode(o.unref(Dge),{"model-value":String(O.value),"onUpdate:modelValue":V[6]||(V[6]=ie=>Uy(Number(ie))),disabled:Di.value},{default:o.withCtx(()=>[o.createVNode(o.unref(Fge),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:o.withCtx(()=>[o.createVNode(o.unref($ge),{placeholder:String(O.value)},null,8,["placeholder"])]),_:1}),o.createVNode(o.unref(Mge),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(_n,ie=>o.createVNode(o.unref(Ige),{key:ie,value:String(ie)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(ie),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value","disabled"]),V[15]||(V[15]=o.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),o.createElementVNode("span",S0e,[o.createTextVNode(o.toDisplayString(h("dataTable.showing"))+" ",1),o.createElementVNode("span",A0e,o.toDisplayString(Ru.value),1),o.createTextVNode(" "+o.toDisplayString(h("dataTable.to"))+" ",1),o.createElementVNode("span",T0e,o.toDisplayString(vm.value),1),o.createTextVNode(" "+o.toDisplayString(h("dataTable.of"))+" ",1),o.createElementVNode("span",P0e,o.toDisplayString(fl.value),1),o.createTextVNode(" "+o.toDisplayString(h("dataTable.data")),1)])]),o.createElementVNode("div",B0e,[o.createVNode(o.unref(Ege),{total:fl.value,"items-per-page":O.value,"sibling-count":1,"show-edges":"",page:I.value,"onUpdate:page":hl,class:"scale-90 origin-right",disabled:Di.value},{default:o.withCtx(()=>[o.createVNode(o.unref(Cge),{class:"flex items-center gap-1"},{default:o.withCtx(({items:ie})=>[o.createVNode(o.unref(Age),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Nge),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ie,(he,_e)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[he.type==="page"?(o.openBlock(),o.createBlock(o.unref(Tge),{key:_e,value:he.value,"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Fr),{class:"w-8 h-8 p-0 text-sm",variant:he.value===I.value?"default":"outline",disabled:he.value===I.value||Di.value,onClick:ze=>hl(he.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(he.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(o.openBlock(),o.createBlock(o.unref(Sge),{key:he.type,index:_e},null,8,["index"]))],64))),256)),o.createVNode(o.unref(Bge),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronRight),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Pge),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(Ne.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page","disabled"])])])):o.createCommentVNode("",!0),o.createVNode(Yo,{modelValue:ee.value,"onUpdate:modelValue":V[7]||(V[7]=ie=>ee.value=ie),title:Qy.value,icon:"AlertCircle","max-width":pt.value,persistent:!1},{actions:o.withCtx(()=>[o.createVNode(Vt,{variant:"outline",onClick:er,text:h("common.cancel")},null,8,["text"]),o.createVNode(Vt,{variant:"default",onClick:Nm,text:h("common.yes")},null,8,["text"])]),default:o.withCtx(()=>[o.createElementVNode("div",N0e,[o.createElementVNode("p",D0e,o.toDisplayString(Vy.value),1)])]),_:1},8,["modelValue","title","max-width"]),o.createVNode(Yo,{modelValue:K.value,"onUpdate:modelValue":V[10]||(V[10]=ie=>K.value=ie),title:Ic.value,description:ki.value,icon:"AlertCircle",size:(((xe=(me=ae.value)==null?void 0:me.dialogConfig)==null?void 0:xe.layoutSize)||"md").toLowerCase()},{actions:o.withCtx(()=>{var ie,he;return[o.createVNode(Vt,{variant:"outline",onClick:V[8]||(V[8]=_e=>K.value=!1),text:ve.value?h("common.close"):h("common.cancel")},null,8,["text"]),!ve.value&&!(e.dummyMode&&((ie=ae.value)!=null&&ie.route))?(o.openBlock(),o.createBlock(Vt,{key:0,variant:"default",onClick:z1,text:h("common.save")},null,8,["text"])):o.createCommentVNode("",!0),!ve.value&&e.dummyMode&&((he=ae.value)!=null&&he.route)?(o.openBlock(),o.createBlock(Vt,{key:1,variant:"default",onClick:V[9]||(V[9]=_e=>K.value=!1),text:h("common.close")},null,8,["text"])):o.createCommentVNode("",!0)]}),default:o.withCtx(()=>{var ie,he,_e,ze;return[o.createElementVNode("div",{class:o.normalizeClass(["grid gap-4 py-4 px-1 relative",o.unref(Ve)(((he=(ie=ae.value)==null?void 0:ie.dialogConfig)==null?void 0:he.layoutColumns)||((_e=ae.value)==null?void 0:_e.layoutColumns))])},[ue.value?(o.openBlock(),o.createElementBlock("div",M0e,[o.createElementVNode("div",R0e,[V[16]||(V[16]=o.createElementVNode("div",{class:"w-8 h-8 border-4 border-primary border-t-transparent rounded-full animate-spin"},null,-1)),o.createElementVNode("span",I0e,o.toDisplayString(h("datatable.loadingData")),1)])])):o.createCommentVNode("",!0),e.dummyMode&&((ze=ae.value)!=null&&ze.route)?(o.openBlock(),o.createElementBlock("div",O0e,[o.createElementVNode("div",L0e,[o.createVNode(o.unref(Ne.Search),{class:"w-4 h-4"})]),o.createElementVNode("div",F0e,[o.createElementVNode("span",$0e,o.toDisplayString(h("datatable.navigationInfo")),1),o.createElementVNode("p",z0e,o.toDisplayString(h("datatable.navigationRouteInfo",{route:ae.value.route})),1)])])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Be.value,(qe,Qe)=>{var et,it,Et,Bt,qt,wt,Ft;return o.openBlock(),o.createElementBlock(o.Fragment,{key:Qe},[!qe.isHidden&&!o.unref(ne)(qe)&&o.unref(Re)(qe)&&!(e.dummyMode&&((et=ae.value)!=null&&et.route))?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(o.unref(Fe)(qe,((Et=(it=ae.value)==null?void 0:it.dialogConfig)==null?void 0:Et.layoutColumns)||((Bt=ae.value)==null?void 0:Bt.layoutColumns)))},[o.createElementVNode("div",j0e,[o.createVNode(Fh,{class:"flex-1 w-full",field:Sm(qe),"model-value":ke[qe.model],"form-data":ke,required:o.unref(De)(qe),disabled:o.unref(Ie)(qe),readonly:o.unref(Ce)(qe),options:o.unref(Ke)(qe),"dynamic-labels":o.unref(ye)(qe),"dynamic-length":o.unref(Me)(qe),error:be[qe.model],"dummy-mode":e.dummyMode,"onUpdate:modelValue":St=>at(qe,St)},null,8,["field","model-value","form-data","required","disabled","readonly","options","dynamic-labels","dynamic-length","error","dummy-mode","onUpdate:modelValue"]),qe.isCopyable||(qt=qe.props)!=null&&qt.isCopyable||((wt=ae.value)==null?void 0:wt.action)==="showToken"||((Ft=ae.value)==null?void 0:Ft.action)==="copyToken"?(o.openBlock(),o.createBlock(Vt,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:h("common.copy"),onClick:St=>Gc(qe.model)},null,8,["tooltip","onClick"])):o.createCommentVNode("",!0)])],2)):o.createCommentVNode("",!0)],64)}),128))],2)]}),_:1},8,["modelValue","title","description","size"])])}}}),U0e={class:"back-label"},W0e=Mn(o.defineComponent({__name:"NavigationBackButton",props:{config:{default:null},locale:{default:"en"}},emits:["click"],setup(e,{emit:t}){const n=e,i=t,r=o.computed(()=>n.config?n.locale==="kr"||n.locale==="ko"?n.config.labelKR||n.config.labelEN||"뒤로":n.locale==="id"?n.config.labelID||n.config.labelEN||"Kembali":n.config.labelEN||"Back":n.locale==="kr"||n.locale==="ko"?"뒤로":n.locale==="id"?"Kembali":"Back"),s=o.computed(()=>Ne.ArrowLeft),a=()=>{i("click")};return(l,c)=>(o.openBlock(),o.createElementBlock("button",{type:"button",class:"navigation-back-button",onClick:a},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(s.value),{class:"back-icon"})),o.createElementVNode("span",U0e,o.toDisplayString(r.value),1)]))}}),[["__scopeId","data-v-44ccdfe5"]]),H0e={class:"dynamic-table-section-wrapper"},q0e={key:0,class:"floating-back-button"},K0e=Mn(o.defineComponent({__name:"DynamicTableSection",props:{section:{},dummyMode:{type:Boolean}},emits:["navigate"],setup(e,{emit:t}){const n=e,i=o.inject("dynamicFormContext",{}),{resolveSectionLabels:r,tableRows:s=()=>[],isTemporaryTable:a=()=>!1,handleDataTableAction:l=()=>{},resolvedBaseUrl:c="",permissionBase:d="",userPermissions:f=null,checkPermission:h=()=>!0,sectionLoading:m={},tokenCores:g=[],selectedTokenCore:v=null,sectionPagination:y={},fetchSectionData:A=async()=>{},navigation:C=null,locale:M="en"}=i,B=o.computed(()=>{const E=i.resolvedBaseUrl;return typeof E=="object"&&E!==null&&"value"in E?E.value:E});o.computed(()=>{const E=Pt(n.section),k=C==null?void 0:C.hasHistory,$=C==null?void 0:C.currentContext;return k&&$===E}),o.watchEffect(()=>{Pt(n.section)});const N=(E,k)=>{var O,q,X;const $=k==null?void 0:k.action;let I=null;if(E!=null&&E.headers){for(const oe of E.headers)if((O=oe.custom)!=null&&O.actionCustom&&(I=oe.custom.actionCustom.find(ue=>ue.key===$||ue.id===$),I))break}if(I!=null&&I.triggerNavigation){if(!C||typeof C.navigateTo!="function")return;const oe=(X=(q=n.section)==null?void 0:q.propsTable)==null?void 0:X.modelKey,te={...oe?{[oe]:k.row}:{...k.row},_rowIndex:k.rowIndex??0};C.navigateTo(I.triggerNavigation,te);return}l(E,k)},j=async E=>{const k=Pt(n.section);y&&y[k]&&(y[k].page=E,await A(k,n.section))},W=async E=>{const k=Pt(n.section);y&&y[k]&&(y[k].page=1,y[k].perPage=E,await A(k,n.section))},P=async()=>{const E=Pt(n.section);y&&y[E]&&(y[E].page=1),await A(E,n.section)};return(E,k)=>{var $,I,O,q,X,oe,ue,te;return o.openBlock(),o.createElementBlock("div",H0e,[(I=($=o.unref(C))==null?void 0:$.hasHistory)!=null&&I.value&&((q=(O=o.unref(C))==null?void 0:O.currentContext)==null?void 0:q.value)===o.unref(Pt)(e.section)?(o.openBlock(),o.createElementBlock("div",q0e,[o.createVNode(W0e,{config:o.unref(C).getCurrentBackButton(),locale:o.unref(M),onClick:k[0]||(k[0]=re=>o.unref(C).navigateBack())},null,8,["config","locale"])])):o.createCommentVNode("",!0),o.createVNode(Fo,{border:!0,padding:"",class:o.normalizeClass(["overflow-hidden",{"with-back-button":((oe=(X=o.unref(C))==null?void 0:X.hasHistory)==null?void 0:oe.value)&&((te=(ue=o.unref(C))==null?void 0:ue.currentContext)==null?void 0:te.value)===o.unref(Pt)(e.section)}])},{default:o.withCtx(()=>{var re,ge,ce;return[o.createVNode($h,{"table-config":e.section.propsTable,data:o.unref(s)(e.section.propsTable),nested:!0,"show-pagination":e.section.propsTable.pagination??!0,"has-actions":o.unref(a)(e.section.propsTable),"base-url":B.value,"dummy-mode":e.dummyMode,"permission-base":o.unref(d),"user-permissions":o.unref(f),"check-permission":o.unref(h),"token-cores":o.unref(g),"selected-token-core":o.unref(v),loading:o.unref(m)[e.section.key]||o.unref(m)[o.unref(Pt)(e.section)],"total-items":(re=o.unref(y)[o.unref(Pt)(e.section)])==null?void 0:re.totalData,page:((ge=o.unref(y)[o.unref(Pt)(e.section)])==null?void 0:ge.page)||1,"per-page":((ce=o.unref(y)[o.unref(Pt)(e.section)])==null?void 0:ce.perPage)||10,controlled:"",onAction:k[1]||(k[1]=se=>N(e.section.propsTable,se)),onNavigate:k[2]||(k[2]=se=>E.$emit("navigate",se)),"onUpdate:page":j,"onUpdate:perPage":W,onRefresh:P,onReset:P},null,8,["table-config","data","show-pagination","has-actions","base-url","dummy-mode","permission-base","user-permissions","check-permission","token-cores","selected-token-core","loading","total-items","page","per-page"])]}),_:1},8,["class"])])}}}),[["__scopeId","data-v-2a9f03e9"]]),G0e={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},Y0e={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},Z0e={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},X0e=o.defineComponent({__name:"DynamicFormDialogs",setup(e){const t=o.inject("dynamicFormContext",{}),{confirmDialog:n,t:i,confirmAction:r,tableDialogOpen:s,tableDialogTitle:a,tableDialogIcon:l,tableDialogFields:c,isFieldVisible:d,isFieldHidden:f,tableRowFormData:h,tableDialogViewOnly:m,isFieldRequired:g,isFieldDisabled:v,getFilteredItems:y,tableRowErrors:A,resolveFieldLabels:C,resolveFieldLength:M,resolvedBaseUrl:B,handleTableRowUpdate:N,locale:j,saveTableRow:W,confirmDeleteOpen:P,executeTableDelete:E,tableDialogSize:k}=t,$=o.computed(()=>{const I=o.unref(c);return Array.isArray(I)?I.some(O=>O.component==="DCodePdfViewer"||O.component==="DCodeWorkflowDiagram"):!1});return(I,O)=>(o.openBlock(),o.createElementBlock("div",null,[o.createVNode(Yo,{modelValue:o.unref(n).visible,"onUpdate:modelValue":O[1]||(O[1]=q=>o.unref(n).visible=q),title:o.unref(n).title,icon:"AlertTriangle","max-width":450,persistent:o.unref(n).isBlocking},{actions:o.withCtx(()=>[o.unref(n).showCancel?(o.openBlock(),o.createBlock(Vt,{key:0,variant:"outline",text:o.unref(n).cancelText||o.unref(i)("common.cancel"),onClick:O[0]||(O[0]=q=>o.unref(n).visible=!1)},null,8,["text"])):o.createCommentVNode("",!0),o.createVNode(Vt,{text:o.unref(n).okText||o.unref(i)("common.confirm"),onClick:o.unref(r)},null,8,["text","onClick"])]),default:o.withCtx(()=>[o.createElementVNode("div",G0e,o.toDisplayString(o.unref(n).message),1)]),_:1},8,["modelValue","title","persistent"]),o.createVNode(Yo,{modelValue:o.unref(s),"onUpdate:modelValue":O[3]||(O[3]=q=>o.isRef(s)?s.value=q:null),title:o.unref(a),icon:o.unref(l),size:o.unref(k)},o.createSlots({default:o.withCtx(()=>[o.unref(c).length?(o.openBlock(),o.createElementBlock("div",Y0e,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(o.unref(c),q=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:q.key},[o.unref(d)(q,o.unref(h))?o.withDirectives((o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(q.column==="FULL"?"md:col-span-2":"col-span-1")},[o.createVNode(Fh,{field:q,"model-value":o.unref(h)[q.model],"form-data":o.unref(h),required:o.unref(m)?!1:o.unref(g)(q,o.unref(h)),disabled:o.unref(m)||o.unref(v)(q,o.unref(h)),"view-only":o.unref(m),options:o.unref(y)(q,o.unref(h)),error:o.unref(m)?void 0:o.unref(A)[q.model],"dynamic-labels":o.unref(C)(q,o.unref(h)),"dynamic-length":o.unref(M)(q,o.unref(h)),"base-url":o.unref(B),"onUpdate:modelValue":X=>o.unref(N)(q.model,X)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)),[[o.vShow,!o.unref(f)(q,o.unref(h))]]):o.createCommentVNode("",!0)],64))),128))])):o.createCommentVNode("",!0)]),_:2},[$.value?void 0:{name:"actions",fn:o.withCtx(()=>[o.createVNode(Vt,{variant:"outline",text:o.unref(m)?o.unref(j)==="id"?"Tutup":"Close":o.unref(j)==="id"?"Batal":"Cancel",onClick:O[2]||(O[2]=q=>s.value=!1)},null,8,["text"]),o.unref(m)?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(Vt,{key:0,text:"Save",onClick:o.unref(W)},null,8,["onClick"]))]),key:"0"}]),1032,["modelValue","title","icon","size"]),o.createVNode(Yo,{modelValue:o.unref(P),"onUpdate:modelValue":O[5]||(O[5]=q=>o.isRef(P)?P.value=q:null),title:o.unref(j)==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:o.withCtx(()=>[o.createVNode(Vt,{variant:"outline",text:o.unref(j)==="id"?"Batal":"Cancel",onClick:O[4]||(O[4]=q=>P.value=!1)},null,8,["text"]),o.createVNode(Vt,{variant:"default","bg-color":"danger",icon:"Trash2",text:o.unref(j)==="id"?"Hapus":"Delete",onClick:o.unref(E)},null,8,["text","onClick"])]),default:o.withCtx(()=>[o.createElementVNode("div",Z0e,o.toDisplayString(o.unref(j)==="id"?"Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.":"Are you sure you want to delete this row? This action cannot be undone."),1)]),_:1},8,["modelValue","title"])]))}}),J0e={class:"w-full flex flex-col min-h-0"},Q0e={class:"flex-1 space-y-6 overflow-y-auto"},q0=o.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0},selectedTokenCore:{default:null},tokenCores:{default:()=>[]},dummyMode:{type:Boolean,default:!1},router:{default:null},permissionBase:{default:""},userPermissions:{default:null},checkPermission:{type:Function,default:void 0},dynamicForm:{},hideActions:{type:Boolean,default:!1},apiParams:{default:()=>({})}},emits:["submit","cancel","action","navigate","update:model","update:modelValue","success","error","step-change"],setup(e,{expose:t,emit:n}){const i=e,r=n,s=i.dynamicForm||CS(i,r);s&&(s.tableRowFormData||(s.tableRowFormData=o.reactive({}))),o.provide("dynamicFormContext",s);const{activeSchema:a,isSectionVisible:l,isSectionHidden:c,inlineState:d,isActionVisible:f,locale:h,isSubmitting:m,isSubmitDisabled:g,handleGlobalButtonClick:v,handleSubmit:y,fieldLoading:A,navigation:C,getSectionKey:M}=s,B=N=>{var P,E;s.revision.value;const j=M(N),W=(E=(P=C==null?void 0:C.navigationState)==null?void 0:P.value)==null?void 0:E.hiddenStates;return W&&j&&typeof W[j]=="boolean"?!W[j]:l(N)};return t({validate:()=>(s.isSubmitted.value=!0,s.validation.validateAll()),isDirty:()=>{const N=s.formData,j=s.originalData;if(!N||!j)return!1;const W=new Set([...Object.keys(N).filter(E=>!E.startsWith("_")),...Object.keys(j).filter(E=>!E.startsWith("_"))]),P=E=>E===void 0||E===""?null:E;for(const E of W)if(JSON.stringify(P(N[E]))!==JSON.stringify(P(j[E])))return!0;return!1},resetDirty:()=>{s.originalData&&s.formData&&Object.assign(s.originalData,JSON.parse(JSON.stringify(s.formData)))}}),(N,j)=>{var W,P,E,k,$,I;return o.openBlock(),o.createElementBlock("div",J0e,[o.createElementVNode("div",Q0e,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList((W=o.unref(a))==null?void 0:W.sections,(O,q)=>{var X,oe;return o.openBlock(),o.createElementBlock(o.Fragment,{key:q},[((X=O.type)==null?void 0:X.toUpperCase())==="FORM"&&O.propsForm&&B(O)?o.withDirectives((o.openBlock(),o.createBlock(fge,{key:0,"dummy-mode":i.dummyMode,section:O,sIdx:Number(q)},null,8,["dummy-mode","section","sIdx"])),[[o.vShow,!o.unref(c)(O)]]):((oe=O.type)==null?void 0:oe.toUpperCase())==="TABLE"&&O.propsTable&&B(O)?o.withDirectives((o.openBlock(),o.createBlock(K0e,{key:1,"dummy-mode":i.dummyMode,section:O,onNavigate:j[0]||(j[0]=ue=>N.$emit("navigate",ue))},null,8,["dummy-mode","section"])),[[o.vShow,!o.unref(c)(O)]]):o.createCommentVNode("",!0)],64)}),128))]),!((P=o.unref(d))!=null&&P.global)&&!i.hideActions?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(((k=(E=o.unref(a))==null?void 0:E.ui)==null?void 0:k.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 mt-6 border-t border-neutral-100 dark:border-neutral-800")},[(I=($=o.unref(a))==null?void 0:$.actionGlobal)!=null&&I.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(o.unref(a).actionGlobal,(O,q)=>{var X,oe,ue,te,re;return o.openBlock(),o.createElementBlock(o.Fragment,{key:q},[O.propsActionGlobal&&o.unref(f)(O)&&(O.propsActionGlobal.type==="BUTTONGROUP"||O.buttons&&O.buttons.length||O.propsActionGlobal.buttons&&O.propsActionGlobal.buttons.length)?(o.openBlock(),o.createBlock(ba,{key:0,icon:O.propsActionGlobal.icon,"label-k-r":O.propsActionGlobal.labelKR,"label-e-n":O.propsActionGlobal.labelEN,"label-i-d":O.propsActionGlobal.labelID,"bg-color":((X=O.propsActionGlobal.bgColor)==null?void 0:X.toLowerCase())||"primary",variant:((oe=O.propsActionGlobal.variant)==null?void 0:oe.toLowerCase())||"default",buttons:O.buttons||O.propsCustom||O.propsActionGlobal.buttons||[],onAction:j[1]||(j[1]=ge=>o.unref(v)(ge)),onButtonClick:j[2]||(j[2]=ge=>o.unref(v)(ge))},null,8,["icon","label-k-r","label-e-n","label-i-d","bg-color","variant","buttons"])):O.propsActionGlobal&&o.unref(f)(O)?(o.openBlock(),o.createBlock(Vt,{key:1,icon:O.propsActionGlobal.icon,text:o.unref(h)==="kr"||o.unref(h)==="ko"?O.propsActionGlobal.labelKR||O.propsActionGlobal.labelEN:o.unref(h)==="id"?O.propsActionGlobal.labelID:O.propsActionGlobal.labelEN,"bg-color":((ue=O.propsActionGlobal.bgColor)==null?void 0:ue.toLowerCase())||"primary",variant:((te=O.propsActionGlobal.variant)==null?void 0:te.toLowerCase())||"default",loading:o.unref(m),disabled:o.unref(g)&&(O.permission==="CREATE"||O.permission==="UPDATE"||((re=O.propsActionGlobal)==null?void 0:re.key)==="submit"),onClick:ge=>o.unref(v)(O)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):o.createCommentVNode("",!0)],64)}),128)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0),o.createVNode(X0e)])}}}),V0e=o.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,n=Gn.reactiveOmit(t,"class");return(i,r)=>(o.openBlock(),o.createBlock(o.unref(kt.Separator),o.mergeProps(o.unref(n),{class:o.unref(nn)("shrink-0 bg-border",t.orientation==="horizontal"?"h-px w-full":"w-px h-full",t.class)}),null,16,["class"]))}}),eye=["onClick"],tye={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},nye={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},iye={key:1},rye={key:0,class:"text-white"},oye={key:1},sye={key:2},aye=["disabled","onClick"],lye={key:1,class:"mr-2 text-sm font-bold opacity-70"},cye={class:"whitespace-normal text-sm text-center leading-tight"},dye={class:"flex flex-col flex-1 min-w-0"},uye={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},fye={class:"text-sm text-muted-foreground"},hye={class:"px-1"},mye=["disabled"],pye=["type","disabled"],gye=["disabled"],gk=Mn(o.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1},beforeNext:{},beforePrev:{}},emits:["update:modelValue","change","loaded","error"],setup(e,{emit:t}){const n=e,i=t,r=o.inject("externalApi")||{},s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const a=o.ref(n.defaultTab),l=o.computed({get(){var k;if(typeof n.modelValue=="string"){const $=(k=n.tabs)==null?void 0:k.findIndex(I=>I.key===n.modelValue);if($!==void 0&&$>=0)return $}return(typeof n.modelValue=="number"?n.modelValue:void 0)??a.value},set(k){var $;if(a.value=k,typeof n.modelValue=="string"){const I=($=n.tabs)==null?void 0:$[k];I?i("update:modelValue",I.key):i("update:modelValue",k)}else i("update:modelValue",k)}}),c=o.computed(()=>{var k;return((k=n.tabs)==null?void 0:k.length)??0}),d=o.computed(()=>{var k;return(k=n.tabs)==null?void 0:k[l.value]});function f(k){return c.value<=0?0:Math.min(Math.max(k,0),c.value-1)}function h(k){return k?typeof k=="string"?Es(k,tn):k:null}const m=o.reactive({});function g(k){return m[k.key]||(m[k.key]={loaded:!1,loading:!1,data:null,error:null}),m[k.key]}function v(){if(n.apiOptions)return typeof n.apiOptions=="function"?n.apiOptions():n.apiOptions}function y(k){const $=k.endpoint||{};return{apiModule:k.apiModule||$.apiModule,apiAction:k.apiAction||$.apiAction,apiUrl:$.apiUrl,apiMethod:$.apiMethod||"GET",apiParams:k.apiParams}}function A(k){if(n.isWizard||!n.allowTabClick||n.disabled)return!1;const $=n.tabs[k];return!(!$||$.disabled)}async function C(k){if(typeof k.tab.fetchData=="function"){const ue=await k.tab.fetchData(),te=(ue==null?void 0:ue.data)??ue;return(te==null?void 0:te.data)??te}const $=y(k.tab);if(!($.apiModule&&$.apiAction||$.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const O=v();let q;if($.apiUrl)q=await s("","",O,{_url:$.apiUrl,_method:$.apiMethod,_data:$.apiParams??void 0});else{const ue={...O,...$.apiParams};q=await s($.apiModule,$.apiAction,ue)}const X=(q==null?void 0:q.data)??q;return(X==null?void 0:X.data)??X}async function M(k,{force:$=!1}={}){const I=f(k),O=n.tabs[I];if(!O)return;const q=g(O);if(!(n.cache&&q.loaded&&!$)&&!q.loading){q.loading=!0,q.error=null;try{const X=await C({tabIndex:I,tab:O});q.data=X,q.loaded=!0,i("loaded",{tabIndex:I,tab:O,data:X})}catch(X){const oe=typeof(X==null?void 0:X.message)=="string"&&X.message||typeof X=="string"&&X||"Failed to load tab data.";q.error=oe,i("error",{tabIndex:I,tab:O,message:oe})}finally{q.loading=!1}}}function B(k){const $=f(k);A($)&&$!==l.value&&(l.value=$)}function N(k=l.value){return M(k,{force:!0})}const j=o.ref(!1),W=o.ref(!1);async function P(){if(n.beforePrev&&d.value){W.value=!0;try{if(!await n.beforePrev(d.value))return}finally{W.value=!1}}const k=f(l.value-1);k!==l.value&&(l.value=k)}async function E(){if(n.beforeNext&&d.value){j.value=!0;try{if(!await n.beforeNext(d.value))return}finally{j.value=!1}}const k=f(l.value+1);k!==l.value&&(l.value=k)}return o.watch(()=>n.tabs,k=>{for(const $ of k??[])g($)},{immediate:!0}),o.watch(()=>l.value,async k=>{var I;const $=(I=n.tabs)==null?void 0:I[k];$&&i("change",{tabIndex:k,tab:$}),await M(k)},{immediate:!0}),o.watch(()=>n.autoFetchOnMount,async k=>{k&&await M(l.value)},{immediate:!0}),(k,$)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":e.isVertical}])},[o.createElementVNode("div",{class:o.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":e.isVertical,"pb-2":e.isWizard&&!e.isVertical}])},[o.createElementVNode("div",{class:o.normalizeClass({"mt-4":!e.isVertical||e.isWizard})},[e.isWizard?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["w-full relative flex overflow-visible rounded-lg",e.isVertical?"flex-col gap-2":""])},[e.isVertical?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(e.tabs,(I,O)=>(o.openBlock(),o.createElementBlock("div",{key:I.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[o.createElementVNode("div",{class:o.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[O<l.value?"border-primary bg-primary text-primary-foreground":O===l.value?"border-primary text-primary ring-2 ring-primary/20":"border-border text-muted-foreground"]])},[e.typeWizard==="icon"&&I.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h(I.icon)),{key:0,class:"w-4 h-4"})):e.typeWizard==="number"||!I.icon&&e.typeWizard!=="none"?(o.openBlock(),o.createElementBlock("span",iye,[O<l.value?(o.openBlock(),o.createElementBlock("span",rye,"✓")):(o.openBlock(),o.createElementBlock("span",oye,o.toDisplayString(O+1),1))])):(o.openBlock(),o.createElementBlock("span",sye))],2),o.createElementVNode("span",{class:o.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",O===l.value?"text-primary":"text-muted-foreground"])},o.toDisplayString(I.title),3)]))),128)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(e.tabs,(I,O)=>(o.openBlock(),o.createElementBlock("div",{key:I.key,onClick:q=>B(O),style:o.normalizeStyle({zIndex:e.tabs.length-O}),class:"relative flex-1 group"},[o.createElementVNode("div",{class:o.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[O>0?"pl-8":"",O===l.value?"bg-primary text-primary-foreground":O<l.value?"bg-primary/10 text-primary hover:bg-primary/20":"bg-muted text-muted-foreground hover:bg-muted/80 hover:text-foreground"]])},[e.typeWizard==="icon"&&I.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h(I.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):e.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",tye,o.toDisplayString(O+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",nye,o.toDisplayString(I.title),1)],2),O<e.tabs.length-1?(o.openBlock(),o.createElementBlock("svg",{key:0,class:o.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[O===l.value?"fill-primary":O<l.value?"fill-primary/10 group-hover:fill-primary/20":"fill-muted group-hover:fill-muted/80"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...$[0]||($[0]=[o.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):o.createCommentVNode("",!0)],12,eye))),128))],2)):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex w-full",e.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.tabs,(I,O)=>(o.openBlock(),o.createElementBlock("button",{key:I.key,type:"button",disabled:!A(O),onClick:q=>B(O),class:o.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 border-border",o.unref(nn)("border-b border-r",!e.isVertical&&O===e.tabs.length-1&&"border-r-0",O===l.value?"bg-primary/10 text-primary font-semibold":"bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground",!A(O)&&"opacity-60 cursor-not-allowed",e.isVertical?"w-full justify-start border-r-0":"flex-1")])},[e.typeWizard==="icon"&&I.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(h(I.icon)),{key:0,class:"h-4 w-4 shrink-0"})):e.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",lye,o.toDisplayString(O+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",cye,o.toDisplayString(I.title),1)],10,aye))),128))],2))],2)],2),e.isVertical?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(V0e),{key:0})),o.createElementVNode("div",dye,[o.createElementVNode("div",{class:o.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":e.isVertical}])},[o.createVNode(o.Transition,{name:"wizard-fade",mode:"out-in"},{default:o.withCtx(()=>{var I,O,q,X;return[(o.openBlock(),o.createElementBlock("div",{key:((I=d.value)==null?void 0:I.key)||l.value,class:"w-full"},[d.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(O=m[d.value.key])!=null&&O.loading?o.renderSlot(k.$slots,"loading",{tab:d.value,tabIndex:l.value},()=>[o.createElementVNode("div",uye,[o.createVNode(o.unref(Ne.Loader2),{class:"w-4 h-4 animate-spin"}),$[1]||($[1]=o.createTextVNode(" Loading... ",-1))])],!0,0):o.renderSlot(k.$slots,`tab-${d.value.key}`,{tab:d.value,tabIndex:l.value,data:(q=m[d.value.key])==null?void 0:q.data,loaded:(X=m[d.value.key])==null?void 0:X.loaded,reload:N},()=>[o.createElementVNode("div",fye,[$[2]||($[2]=o.createTextVNode(" Slot ",-1)),o.createElementVNode("code",hye,"tab-"+o.toDisplayString(d.value.key),1),$[3]||($[3]=o.createTextVNode(" belum dibuat. ",-1))])],!0,1)],64)):o.createCommentVNode("",!0)]))]}),_:3})],2),e.isWizard&&e.showNavigation?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":e.isVertical}])},[o.createElementVNode("button",{type:"button",onClick:P,disabled:l.value<=0||W.value||e.loading,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-background border border-border text-foreground shadow-sm hover:bg-muted hover:text-foreground hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-background disabled:hover:text-foreground disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-border focus:ring-offset-2 active:scale-95"},[W.value?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-4 h-4 animate-spin"})):o.createCommentVNode("",!0),$[4]||($[4]=o.createTextVNode(" Sebelumnya ",-1))],8,mye),l.value<c.value-1?(o.openBlock(),o.createElementBlock("button",{key:0,type:e.isSubmit?"submit":"button",onClick:E,disabled:j.value||e.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-primary-foreground transition-all duration-300 rounded-lg shadow-md bg-primary hover:bg-primary/90 hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-primary disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 active:scale-95"},[j.value?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-4 h-4 animate-spin"})):o.createCommentVNode("",!0),$[5]||($[5]=o.createTextVNode(" Selanjutnya ",-1))],8,pye)):e.isWizard?(o.openBlock(),o.createElementBlock("button",{key:1,type:"submit",disabled:e.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-primary-foreground transition-all duration-300 rounded-lg shadow-md bg-primary hover:bg-primary/90 hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-primary disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 active:scale-95"},[e.loading?(o.openBlock(),o.createBlock(o.unref(Ne.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(e.submitText),1)],8,gye)):o.createCommentVNode("",!0)],2)):o.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-998781d3"]]),yye={class:"w-full flex flex-col min-h-0"},bye={key:0,class:"flex-1 flex flex-col items-center justify-center text-neutral-400 py-16"},vye={class:"space-y-4 mt-4 min-h-[300px]"},wye={key:0,class:"flex items-center justify-end gap-2 border-b border-neutral-100 dark:border-neutral-800 pb-3 mb-2"},_ye={key:1,class:"flex flex-col items-center justify-center py-16 text-neutral-400"},kye={key:3,class:"flex-1 border-2 border-dashed border-neutral-200 dark:border-neutral-700 rounded-xl bg-neutral-50/50 dark:bg-neutral-900/30 flex flex-col items-center justify-center p-8 text-center min-h-[300px]"},xye={key:4,class:"flex-1 border-2 border-dashed border-red-200 dark:border-red-800 rounded-xl bg-red-50/50 dark:bg-red-900/10 flex flex-col items-center justify-center p-8 text-center min-h-[300px]"},Eye={class:"max-w-md space-y-3"},Cye={class:"text-xs text-red-400 max-w-xs mx-auto"},Sye={key:2,class:"flex items-center gap-2 flex-wrap pt-4 mt-6 border-t border-neutral-100 dark:border-neutral-800"},Aye={class:"py-2 text-sm text-neutral-600 dark:text-neutral-300 whitespace-pre-line"},Tye={class:"flex justify-end gap-2 mt-4"},yk=o.defineComponent({__name:"DynamicWizard",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},selectedTokenCore:{default:null},tokenCores:{default:()=>[]},dummyMode:{type:Boolean,default:!1},router:{default:null},permissionBase:{default:""},userPermissions:{default:null},checkPermission:{type:Function,default:void 0},hideActions:{type:Boolean,default:!1},apiParams:{default:()=>({})}},emits:["submit","cancel","action","update:model","step-change"],setup(e,{emit:t}){const n=e,i=t;let r;try{r=Yn.useI18n().locale}catch{r=o.ref("en")}const{apiUrl:s,DCodeApi:a}=o.inject("externalApi");let l;try{l=n.router||bs.useRouter()}catch{l={back:()=>{var z;return(z=window==null?void 0:window.history)==null?void 0:z.back()},currentRoute:o.computed(()=>({query:{},params:{},path:""}))}}const c=o.ref(0),d=o.reactive({}),f=o.reactive({}),h=o.reactive({}),m=o.ref({...n.model}),g=o.reactive({}),v=o.ref(!1),y=o.reactive({}),A=o.reactive({visible:!1,title:"",message:"",resolvePromise:null});console.log("[DynamicWizard] props.isEditMode:",n.isEditMode);const C=o.computed(()=>n.schema),M=o.computed(()=>{var z;return((z=C.value)==null?void 0:z.isWizard)===!1}),B=o.computed(()=>{if(!C.value)return[];if(Array.isArray(C.value.propsSteps)&&C.value.propsSteps.length>0)return C.value.propsSteps;if(Array.isArray(C.value.sections)){const z=C.value.sections.find(G=>{var ee,K;return((ee=G==null?void 0:G.type)==null?void 0:ee.toUpperCase())==="WIZARD"||((K=G==null?void 0:G.propsWizard)==null?void 0:K.propsSteps)});return z!=null&&z.propsWizard&&Array.isArray(z.propsWizard.propsSteps)?z.propsWizard.propsSteps:C.value.sections}return[]});o.watchEffect(()=>{B.value&&B.value.forEach((z,G)=>{var ee,K;console.log(`[DynamicWizard][STEP-INFO] idx: ${G}, code: ${z.code||z.key}, saveUrl: ${(ee=z.endpointSave)==null?void 0:ee.apiUrl}, updateUrl: ${(K=z.endpointUpdate)==null?void 0:K.apiUrl}`)})});const N=o.computed(()=>{var z,G;if(typeof((z=n.selectedTokenCore)==null?void 0:z.address)=="string")return n.selectedTokenCore.address;if((G=C.value)!=null&&G.idTokenCore&&Array.isArray(n.tokenCores)){const ee=String(C.value.idTokenCore),K=n.tokenCores.find(Y=>String(Y.id)===ee);if(K!=null&&K.address)return K.address}}),j=o.computed(()=>{const z=(typeof r=="object"&&"value"in r?r.value:r||"en").toLowerCase();return z.startsWith("en")?"EN":z.startsWith("kr")||z.startsWith("ko")?"KR":"ID"}),W=o.computed(()=>B.value.filter(z=>{var ee,K,Y,F;const G=((ee=z.logic)==null?void 0:ee.visibleRule)||((Y=(K=z.propsStep)==null?void 0:K.logic)==null?void 0:Y.visibleRule);if(G==null||G==="")return!0;try{Hv();const _={};if(B.value)for(const S of B.value){const T=S.payload||((F=S.propsStep)==null?void 0:F.payload);if(T&&typeof T=="object")try{const D=JSON.parse(JSON.stringify(T));Object.entries(D).forEach(([Z,J])=>{J&&typeof J=="object"&&!Array.isArray(J)?Z in J&&typeof J[Z]=="object"&&!Array.isArray(J[Z])?_[Z]={..._[Z]||{},...J[Z]}:_[Z]={..._[Z]||{},...J}:_[Z]=J})}catch{}}Object.entries(m.value).forEach(([S,T])=>{T&&typeof T=="object"&&!Array.isArray(T)?S in T&&typeof T[S]=="object"&&!Array.isArray(T[S])?_[S]={..._[S]||{},...T[S]}:_[S]={..._[S]||{},...T}:_[S]=T}),Object.values(g).forEach(S=>{S&&typeof S=="object"&&!Array.isArray(S)&&Object.assign(_,S)}),Object.values(_).forEach(S=>{S&&typeof S=="object"&&!Array.isArray(S)&&Object.entries(S).forEach(([T,D])=>{(_[T]===void 0||D!=null)&&(_[T]=D)})}),_._resolveLogicVar=S=>{if(_[S]!==void 0)return _[S];const T=S.split(".");let D=_;for(let J=0;J<T.length&&D!=null;J++)D=D[T[J]];if(D!==void 0)return D;if(S.endsWith(".code")||S.endsWith(".id")||S.endsWith(".value")){const J=S.replace(/\.(code|id|value)$/,""),fe=_._resolveLogicVar(J);if(fe!==void 0)return fe}const Z=T[T.length-1];if(_[Z]!==void 0)return _[Z]};const b=(S,T=0)=>{if(!(!S||typeof S!="object"||T>5))for(const[D,Z]of Object.entries(S))if(typeof Z=="number"){const J=new Number(Z);J.code=Z,J.id=Z,J.value=Z,S[D]=J}else if(typeof Z=="string"){const J=new String(Z);J.code=Z,J.id=Z,J.value=Z,S[D]=J}else typeof Z=="object"&&!Array.isArray(Z)&&b(Z,T+1)};b(_);let R;return typeof G=="string"?R=!!new Function("formData",`return ${G};`)(_):R=!!go.apply(G,_),console.log(`[DynamicWizard][visibleRule] step: ${z.code||z.key}, outcome: ${R}, rule:`,JSON.stringify(G)),R}catch(_){return console.warn(`[DynamicWizard] Gagal mengevaluasi visibleRule untuk step ${z.key}:`,_),!0}}).map((z,G)=>{var Y,F,_,b,R,S,T,D,Z,J,fe,ae,we,pe,ke,be,Se,ve,Be,Ee,Oe,Ae,Re,De,Ie,Ce,ne,ye,Me,Ke,$e;const ee=`title${j.value}`,K=`description${j.value}`;return console.log("[DynamicWizard][wizardTabs] mapping step:",z.code||z.key||G,{isEditMode:n.isEditMode,hasEndpointUpdate:!!z.endpointUpdate,endpointUpdateUrl:(Y=z.endpointUpdate)==null?void 0:Y.apiUrl,endpointSaveUrl:(F=z.endpointSave)==null?void 0:F.apiUrl}),{key:z.key||((_=z.propsStep)==null?void 0:_.key)||`step-${G}`,slotName:`tab-${z.key||((b=z.propsStep)==null?void 0:b.key)||`step-${G}`}`,modelKey:z.modelKey||((R=z.propsStep)==null?void 0:R.modelKey)||"",fieldMapping:((S=z.propsStep)==null?void 0:S.fieldMapping)||z.fieldMapping||null,title:z[ee]||z.titleEN||z.titleID||((T=z.propsStep)==null?void 0:T[ee])||((D=z.propsStep)==null?void 0:D.titleEN)||((Z=z.propsStep)==null?void 0:Z.titleID)||`Step ${G+1}`,description:z[K]||z.descriptionEN||z.descriptionID||((J=z.propsStep)==null?void 0:J[K])||((fe=z.propsStep)==null?void 0:fe.descriptionEN)||((ae=z.propsStep)==null?void 0:ae.descriptionID)||"",icon:z.icon||((we=z.propsStep)==null?void 0:we.icon)||void 0,isSubmit:z.isSubmit||((pe=z.propsStep)==null?void 0:pe.isSubmit)||!1,endpointActionStepNext:n.isEditMode&&((ke=z.endpointUpdate)!=null&&ke.apiUrl||(Se=(be=z.propsStep)==null?void 0:be.endpointUpdate)!=null&&Se.apiUrl)?z.endpointUpdate||((ve=z.propsStep)==null?void 0:ve.endpointUpdate):((Be=z.propsStep)==null?void 0:Be.endpointSave)||z.endpointSave||((Ee=z.propsStep)==null?void 0:Ee.endpointActionStepNext)||z.endpointActionStepNext,endpointActionStepPrev:((Oe=z.propsStep)==null?void 0:Oe.endpointActionStepPrev)||z.endpointActionStepPrev,actionComponent:z.actionComponent||((Ae=z.propsStep)==null?void 0:Ae.actionComponent)||[],responseMapping:((Re=z.propsStep)==null?void 0:Re.responseMapping)||z.responseMapping||{},requireConfirm:z.requireConfirm||((De=z.propsStep)==null?void 0:De.requireConfirm)||!1,requireConfirmAutomation:z.requireConfirmAutomation||((Ie=z.propsStep)==null?void 0:Ie.requireConfirmAutomation)||!1,confirmTitleID:z.confirmTitleID||((Ce=z.propsStep)==null?void 0:Ce.confirmTitleID)||"",confirmTitleEN:z.confirmTitleEN||((ne=z.propsStep)==null?void 0:ne.confirmTitleEN)||"",confirmTitleKR:z.confirmTitleKR||((ye=z.propsStep)==null?void 0:ye.confirmTitleKR)||"",confirmMessageID:z.confirmMessageID||((Me=z.propsStep)==null?void 0:Me.confirmMessageID)||"",confirmMessageEN:z.confirmMessageEN||((Ke=z.propsStep)==null?void 0:Ke.confirmMessageEN)||"",confirmMessageKR:z.confirmMessageKR||(($e=z.propsStep)==null?void 0:$e.confirmMessageKR)||""}})),P=async z=>{if(!(!z||d[z])){f[z]=!0;try{const G=await s(`/api/auto-layout/form/form-dynamic?code=${z}`,"GET");if(G!=null&&G.status){const ee=Array.isArray(G.data)?G.data[0]:G.data;if(ee){const K=JSON.parse(JSON.stringify(ee));M.value||delete K.actionGlobal,d[z]=K}}}catch(G){console.error(`[DynamicWizard] Failed to fetch form schema for code: ${z}`,G)}finally{f[z]=!1}}},E=async()=>{var ee,K;if(!B.value||B.value.length===0)return;const z=(K=(ee=B.value[0])==null?void 0:ee.fieldMapping)==null?void 0:K.formCode;z&&!d[z]&&await P(z);const G=new Set;B.value.slice(1).forEach(Y=>{var _;const F=(_=Y.fieldMapping)==null?void 0:_.formCode;F&&!d[F]&&G.add(F)}),Array.from(G).forEach((Y,F)=>{setTimeout(()=>{P(Y)},(F+1)*300)})},k=z=>z.modelKey?m.value[z.modelKey]||{}:m.value,$=(z,G)=>{var ee,K;if(z.modelKey){const Y=m.value[z.modelKey]||{},F=G&&typeof G=="object"&&z.modelKey in G?G[z.modelKey]:G;m.value={...m.value,[z.modelKey]:{...Y,...F}};const _=(ee=z.fieldMapping)==null?void 0:ee.formCode;_&&d[_]&&(d[_].payload=JSON.parse(JSON.stringify(m.value[z.modelKey])))}else{m.value={...m.value,...G};const Y=(K=z.fieldMapping)==null?void 0:K.formCode;Y&&d[Y]&&(d[Y].payload=JSON.parse(JSON.stringify(m.value)))}i("update:model",m.value)},I=z=>d[z]||null,O=(z,G)=>{G?y[z]=G:delete y[z]},q=async z=>{var F;console.log("[DynamicWizard] handleBeforeNext triggered for tab:",z);const G=z.endpointActionStepNext;console.log("[DynamicWizard] Resolved endpoint configuration:",G);const ee=y[z.key],K=((F=W.value[W.value.length-1])==null?void 0:F.key)===z.key;if(ee&&!ee.validate())return console.log("[DynamicWizard] Validation failed"),xt.error(j.value==="ID"?"Mohon lengkapi data wajib isi terlebih dahulu":"Please complete all required fields",{autoClose:3e3}),!1;if(n.dummyMode)return console.log("[DynamicWizard] Dummy mode active"),xt.info(j.value==="ID"?"Simulasi langkah selanjutnya (Dummy Mode)":"Next step simulated (Dummy Mode)",{autoClose:2e3}),!0;const Y=ee!=null&&ee.isDirty?ee.isDirty():!0;if(console.log("[DynamicWizard] Form dirty check:",{isFormDirty:Y,isEditMode:n.isEditMode,isLastStep:K,activeForm:ee}),!Y&&n.isEditMode&&!K)return console.log(`[DynamicWizard] Skipping API call for step "${z.titleID||z.key}" because form is not dirty in Edit Mode.`),!0;if(!(G!=null&&G.apiUrl))return console.log("[DynamicWizard] Skipping API call because ep.apiUrl is missing or undefined."),!0;if(z.requireConfirm||z.requireConfirmAutomation){const _=j.value==="KR"?z.confirmTitleKR:j.value==="ID"?z.confirmTitleID:z.confirmTitleEN,b=j.value==="KR"?z.confirmMessageKR:j.value==="ID"?z.confirmMessageID:z.confirmMessageEN;if(A.title=_||(j.value==="ID"?"Konfirmasi":"Confirmation"),A.message=b||(j.value==="ID"?"Apakah Anda yakin ingin melanjutkan?":"Are you sure you want to continue?"),A.visible=!0,!await new Promise(S=>{A.resolvePromise=S}))return!1}try{v.value=!0;const _=z.modelKey?m.value[z.modelKey]||{}:{...m.value};console.log("[nested dynamic][STEP-DATA] Raw stepData for tab:",z.titleID||z.key,JSON.parse(JSON.stringify(_)));const b={};Object.values(g).forEach(ae=>{ae&&typeof ae=="object"&&Object.assign(b,ae)});let R={};G.fieldMapping&&Object.keys(G.fieldMapping).length>0?(console.log("[nested dynamic][MAPPING-START] Applying fieldMapping rules:",G.fieldMapping),Object.entries(G.fieldMapping).forEach(([ae,we])=>{let pe=ae;z.modelKey&&ae.startsWith(`${z.modelKey}.`)&&(pe=ae.substring(z.modelKey.length+1));const ke=pe.lastIndexOf("."),be=ke>=0?pe.substring(ke+1):null;let Se=Ye(_,pe);if(Se==null&&(Se=Ye(_,ae)),Se==null&&be&&(Se=Ye(_,be)),Se==null&&(Se=_[pe]??_[ae]),Se==null&&be&&(Se=_[be]),(Se==null||Array.isArray(Se)&&Se.length===0)&&pe.includes(".")){const Ee=pe.indexOf("."),Oe=pe.substring(0,Ee),Ae=pe.substring(Ee+1),Re=Object.keys(_).filter(De=>De.startsWith(`${Oe}.`)&&De.endsWith(`.${Ae}`));if(Re.length>0){console.log(`[nested dynamic][INDEXED-KEY] Found indexed keys for "${pe}":`,Re);let De=!1;if(Re.forEach(Ie=>{const Ce=_[Ie];if(Array.isArray(Ce)&&Ce.length>0&&Array.isArray(we)&&we.length>0){const ne=we[0];if(typeof ne=="object"&&ne!==null){const ye=Object.entries(ne),Me=Ce.map(Ve=>{const Fe={};return ye.forEach(([Ue,at])=>{let nt=Ye(Ve,Ue);if(nt==null){const hn=Ue.lastIndexOf("."),Jt=hn>=0?Ue.substring(hn+1):Ue;nt=Ve[Jt]??Ve[Ue]}if(nt==null&&Ue.includes(".")){const hn=Ue.split(".");for(let Jt=1;Jt<hn.length;Jt++){const cn=hn.slice(Jt).join("."),vn=Ve[cn]??Ye(Ve,cn)??void 0;if(vn!=null){nt=vn;break}}}const Tt=typeof nt;nt!=null&&Tt==="object"&&!Array.isArray(nt)&&(nt=nt.id??nt.code??nt.value??nt),nt!==void 0&&(Fe[at]=nt)}),Fe}),Ke=Ie.substring(Oe.length),$e=Ae.includes(".")?Ae.substring(Ae.lastIndexOf(".")):`.${Ae}`,He=Ke.replace(new RegExp(`\\.${Ae}$`),""),rt=`${Oe}${He}${$e}`;R[rt]=Me,De=!0,console.log(`[nested dynamic][INDEXED-MAPPED] Mapped "${Ie}" -> "${rt}":`,Me)}}}),De)return}}if(Se==null||Array.isArray(Se)&&Se.length===0){if(Array.isArray(we)&&we.length>0){const Ee=we[0];if(typeof Ee=="object"&&Ee!==null){const Ae=Object.entries(Ee).map(([De])=>{const Ie=De.indexOf(".");return Ie>=0?De.substring(0,Ie):De}),Re=Ae.length>0?Ae[0]:null;if(Re&&Ae.every(De=>De===Re)){const De=Ye(_,Re);Array.isArray(De)&&De.length>0&&(Se=De,console.log(`[nested dynamic][FALLBACK-SOURCE] Resolved source array for "${ae}" via template prefix "${Re}":`,Se))}}}if(Se==null||Array.isArray(Se)&&Se.length===0)return}if(Array.isArray(we)&&we.length>0){const Ee=we[0],Oe=Array.isArray(Se)?Se:[];if(typeof Ee=="object"&&Ee!==null){const Ae=Object.entries(Ee);if(Ae.length===1&&(Ae[0][1]===pe||ae.includes(".")&&Ae[0][1]!==pe&&!_[pe])){const[De,Ie]=Ae[0],Ce=Oe.map(ye=>{let Me=Ye(ye,De);if(Me==null){const Ke=De.lastIndexOf("."),$e=Ke>=0?De.substring(Ke+1):De;Me=ye[$e]??ye[De]}if(Me==null&&De.includes(".")){const Ke=De.split(".");for(let $e=1;$e<Ke.length;$e++){const He=Ke.slice($e).join("."),rt=ye[He]??Ye(ye,He)??void 0;if(rt!=null){Me=rt;break}}}if(Me!=null&&typeof Me=="object"&&!Array.isArray(Me)){const Ke=Me;Me=Ke.id??Ke.code??Ke.value??Ke}return Me}).filter(ye=>ye!=null),ne=Ie||pe;Array.isArray(R[ne])?R[ne].push(...Ce):R[ne]=Ce,console.log(`[nested dynamic][ARRAY-FLAT] Extracted primitive array for "${pe}" -> "${ne}":`,R[ne])}else R[pe]=Oe.map(De=>{const Ie={};return Ae.forEach(([Ce,ne])=>{let ye=Ye(De,Ce);if(ye==null){const $e=Ce.lastIndexOf("."),He=$e>=0?Ce.substring($e+1):Ce;ye=De[He]??De[Ce]}if(ye==null&&Ce.includes(".")){const $e=Ce.split(".");for(let He=1;He<$e.length;He++){const rt=$e.slice(He).join("."),Ve=De[rt]??Ye(De,rt)??void 0;if(Ve!=null){ye=Ve;break}}}const Me=typeof ye;ye!=null&&Me==="object"&&!Array.isArray(ye)&&(ye=ye.id??ye.code??ye.value??ye),ye!==void 0&&(Ie[ne]=ye)}),Ie}),console.log(`[nested dynamic][ARRAY-OBJECT] Mapped object array for "${pe}":`,R[pe])}else typeof Ee=="string"&&(R[Ee]=Oe,console.log(`[nested dynamic][ARRAY-SIMPLE] Mapped simple array for "${pe}" -> "${Ee}":`,R[Ee]));return}const Be=we;Se&&typeof Se=="object"&&!Array.isArray(Se)&&(Be.toLowerCase().endsWith("id")||Be.toLowerCase().endsWith("_id"))?R[Be]=Se.id!==void 0?Se.id:Se.value!==void 0?Se.value:Se:R[Be]=Se,console.log(`[nested dynamic][SIMPLE-FIELD] Mapped field "${pe}" -> "${Be}":`,R[Be])})):R={..._};const S=Object.keys(R).filter(ae=>ae.includes("."));if(S.length>0){console.log("[nested dynamic][CHILD-NESTING-START] Processing child table nesting for dotted keys:",S);for(const ae of S){const we=ae.split("."),pe=we[0],ke=R[pe],be=R[ae];if(Array.isArray(ke)){if(we.length===3&&!isNaN(Number(we[1]))){const Se=Number(we[1]),ve=we[2];ke[Se]&&typeof ke[Se]=="object"&&(ke[Se][ve]=Array.isArray(be)?be:[be],console.log(`[nested dynamic][CHILD-NESTING] Attached indexed child data to "${pe}[${Se}].${ve}":`,ke[Se][ve]))}else if(we.length===2){const Se=we[1];if(Array.isArray(be)&&be.length>0)for(const ve of ke)ve&&typeof ve=="object"&&(!ve[Se]||Array.isArray(ve[Se])&&ve[Se].length===0)&&(ve[Se]=be,console.log(`[nested dynamic][CHILD-NESTING] Attached flat child data to "${pe}.${Se}":`,be))}}delete R[ae]}}const T=oe(G.keyParam||[]),D={...R,...T};console.log("[nested dynamic][FINAL-PAYLOAD] Final submit payload:",JSON.parse(JSON.stringify(D)));const Z=vo(G.apiUrl,N.value),J=await s(Z,G.apiMethod||"POST",D),fe=(J==null?void 0:J.status)===!0||(J==null?void 0:J.success)===!0||(J==null?void 0:J.code)===200||(J==null?void 0:J.code)==="00"||(J==null?void 0:J.status)==="SUCCESS";if(fe){const ae=z.key||z.id;let we=(J==null?void 0:J.data)||(J==null?void 0:J.payload)||J;if(Array.isArray(we)&&we.length>0&&(we=we[0]),g[ae]=we,ee!=null&&ee.resetDirty&&ee.resetDirty(),we&&typeof we=="object"){const pe=["status","success","code","message","error","errorCode","errorMessage"],ke=Bf(we);if(typeof window<"u"&&window.history){const be=new URL(window.location.href);let Se=!1;Object.entries(ke).forEach(([ve,Be])=>{!pe.includes(ve)&&Be!==null&&Be!==void 0&&(typeof Be=="string"||typeof Be=="number"||typeof Be=="boolean")&&be.searchParams.get(ve)!==String(Be)&&(be.searchParams.set(ve,String(Be)),Se=!0)}),Se&&window.history.replaceState(window.history.state,"",be.toString())}}}return fe}catch(_){return console.error("[DynamicWizard] Error in handleBeforeNext:",_),!1}finally{v.value=!1}},X=async z=>{if(n.dummyMode)return!0;const G=z.endpointActionStepPrev;if(!(G!=null&&G.apiUrl))return!0;try{const ee=vo(G.apiUrl,N.value),K=oe(G.keyParam||[]);return await s(ee,G.apiMethod||"POST",K),!0}catch(ee){return console.error("[DynamicWizard] Error in handleBeforePrev:",ee),!0}},oe=z=>{var ee,K,Y;const G={};if(!Array.isArray(z)||z.length===0){const F=(Y=(K=(ee=l==null?void 0:l.currentRoute)==null?void 0:ee.value)==null?void 0:K.params)==null?void 0:Y.id;return F&&(G.id=F),G}return z.forEach(F=>{var _,b,R,S,T,D;if(typeof F=="string"){let Z;if(F.startsWith("$route.")){const J=F.replace("$route.","");n.apiParams&&n.apiParams[J]!==void 0&&n.apiParams[J]!==null?Z=n.apiParams[J]:Z=(R=(b=(_=l==null?void 0:l.currentRoute)==null?void 0:_.value)==null?void 0:b.params)==null?void 0:R[J]}else if(F.startsWith("$query.")){const J=F.replace("$query.","");if(n.apiParams&&n.apiParams[J]!==void 0&&n.apiParams[J]!==null)Z=n.apiParams[J];else{if(typeof window<"u"){const fe=new URLSearchParams(window.location.search);fe.has(J)&&(Z=fe.get(J))}Z===void 0&&(Z=(D=(T=(S=l==null?void 0:l.currentRoute)==null?void 0:S.value)==null?void 0:T.query)==null?void 0:D[J])}}else if(F.startsWith("$value(")){const J=F.match(/\$value\(([^)]+)\)/);Z=J?J[1].replace(/^['"]|['"]$/g,""):void 0}else{if(Z=m.value[F],Z===void 0)for(const J of Object.keys(m.value)){const fe=m.value[J];if(fe&&typeof fe=="object"&&F in fe){Z=fe[F];break}}if(Z===void 0)for(const J of Object.keys(g)){const fe=g[J];if(fe&&typeof fe=="object"&&F in fe){Z=fe[F];break}}}if(Z!=null&&Z!==""){const J=F.startsWith("$")&&F.split(".").pop()||F;G[J]=Z}}else typeof F=="object"&&F!==null&&Object.entries(F).forEach(([Z,J])=>{var we,pe,ke,be,Se,ve,Be,Ee,Oe,Ae,Re,De,Ie,Ce,ne,ye,Me,Ke;const fe=J;let ae;if(fe.startsWith("$route.")){const $e=fe.replace("$route.","");n.apiParams&&n.apiParams[$e]!==void 0&&n.apiParams[$e]!==null?ae=n.apiParams[$e]:ae=((ke=(pe=(we=l==null?void 0:l.currentRoute)==null?void 0:we.value)==null?void 0:pe.params)==null?void 0:ke[$e])||((ve=(Se=(be=l==null?void 0:l.currentRoute)==null?void 0:be.value)==null?void 0:Se.query)==null?void 0:ve[$e])}else if(fe.startsWith("$query.")){const $e=fe.replace("$query.","");if(n.apiParams&&n.apiParams[$e]!==void 0&&n.apiParams[$e]!==null)ae=n.apiParams[$e];else{if(typeof window<"u"){const He=new URLSearchParams(window.location.search);He.has($e)?ae=He.get($e):He.has(Z)&&(ae=He.get(Z))}ae===void 0&&(ae=((Oe=(Ee=(Be=l==null?void 0:l.currentRoute)==null?void 0:Be.value)==null?void 0:Ee.query)==null?void 0:Oe[$e])||((De=(Re=(Ae=l==null?void 0:l.currentRoute)==null?void 0:Ae.value)==null?void 0:Re.query)==null?void 0:De[Z]))}}else if(ae=m.value[fe],ae===void 0)for(const $e of Object.keys(m.value)){const He=m.value[$e];if(He&&typeof He=="object"&&fe in He){ae=He[fe];break}}if(ae==null||ae===""){if(typeof window<"u"){const $e=new URLSearchParams(window.location.search);$e.has(Z)&&(ae=$e.get(Z))}ae===void 0&&(ae=((ne=(Ce=(Ie=l==null?void 0:l.currentRoute)==null?void 0:Ie.value)==null?void 0:Ce.query)==null?void 0:ne[Z])||((Ke=(Me=(ye=l==null?void 0:l.currentRoute)==null?void 0:ye.value)==null?void 0:Me.params)==null?void 0:Ke[Z]))}ae!=null&&ae!==""&&(G[Z]=ae)})}),Object.keys(G).forEach(F=>{const _=G[F];typeof _=="string"&&_!==""&&!isNaN(Number(_))&&(G[F]=Number(_))}),G},ue=async()=>{const z=W.value[c.value];z&&!await q(z)||i("submit",m.value)},te=()=>{i("cancel")},re=()=>{A.resolvePromise&&(A.resolvePromise(!0),A.resolvePromise=null),A.visible=!1},ge=()=>{A.resolvePromise&&(A.resolvePromise(!1),A.resolvePromise=null),A.visible=!1},ce=async(z,G)=>{if(z==="cancel"){te();return}i("action",G,m.value)},se=async(z,G)=>{var K,Y;if(n.isEditMode)return;const ee=d[G];if(ee!=null&&ee.sections)for(const F of ee.sections){const _=(K=F.propsForm)==null?void 0:K.endpointForm;if(((Y=_==null?void 0:_.apiMethod)==null?void 0:Y.toUpperCase())==="GET"&&(_==null?void 0:_.byPassMode)===!0&&(_!=null&&_.apiUrl)){const b=vo(_.apiUrl,N.value),R=oe(_.keyParam||[]);try{f[G]=!0;const S=await s(b,"GET",R);if((S==null?void 0:S.status)===!0||(S==null?void 0:S.success)===!0||(S==null?void 0:S.code)===200||(S==null?void 0:S.code)==="00"||(S==null?void 0:S.status)==="SUCCESS"){let D=(S==null?void 0:S.data)||(S==null?void 0:S.payload)||S;Array.isArray(D)&&D.length>0&&(D=D[0]),S!=null&&S.payload&&(D={...D,...S.payload}),D&&typeof D=="object"&&$(z,D)}}catch(S){console.error("[DynamicWizard] Fetch step data failed:",S)}finally{f[G]=!1,h[G]=(h[G]||0)+1}}}};return o.watch(c,async z=>{var ee;const G=B.value[z];if(G){i("step-change",G.key||`step-${z}`);const K=(ee=G.fieldMapping)==null?void 0:ee.formCode;K&&(d[K]||await P(K),se(G,K))}},{immediate:!0}),o.watch(()=>n.model,z=>{z&&Object.keys(z).length>0&&(m.value={...m.value,...z})},{deep:!0}),o.watch(()=>{var z;return(z=C.value)==null?void 0:z.propsSteps},()=>{E()},{immediate:!0}),(z,G)=>{var ee,K,Y,F,_,b;return o.openBlock(),o.createElementBlock("div",yye,[B.value.length===0?(o.openBlock(),o.createElementBlock("div",bye,[...G[2]||(G[2]=[o.createElementVNode("span",{class:"text-4xl mb-3"},"📋",-1),o.createElementVNode("p",null,"No wizard steps configured",-1)])])):(o.openBlock(),o.createElementBlock("form",{key:1,onSubmit:o.withModifiers(ue,["prevent"]),class:"w-full"},[o.createVNode(gk,{modelValue:c.value,"onUpdate:modelValue":G[0]||(G[0]=R=>c.value=R),tabs:W.value,"auto-fetch-on-mount":!1,"is-vertical":((ee=C.value)==null?void 0:ee.isVertical)||!1,"is-wizard":((K=C.value)==null?void 0:K.isWizard)!==!1,"type-wizard":((F=(Y=C.value)==null?void 0:Y.typeWizard)==null?void 0:F.toLowerCase())||"icon",loading:v.value,"before-next":q,"before-prev":X},o.createSlots({_:2},[o.renderList(W.value,R=>({name:R.slotName,fn:o.withCtx(()=>{var S,T,D,Z,J;return[o.createElementVNode("div",vye,[(S=R.actionComponent)!=null&&S.length?(o.openBlock(),o.createElementBlock("div",wye,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(R.actionComponent,(fe,ae)=>{var we,pe,ke,be,Se,ve,Be;return o.openBlock(),o.createBlock(Vt,{key:ae,icon:fe.icon||((we=fe.propsActionGlobal)==null?void 0:we.icon),text:j.value==="KR"?fe.labelKR||((pe=fe.propsActionGlobal)==null?void 0:pe.labelKR)||fe.labelEN||((ke=fe.propsActionGlobal)==null?void 0:ke.labelEN):j.value==="ID"?fe.labelID||((be=fe.propsActionGlobal)==null?void 0:be.labelID):fe.labelEN||((Se=fe.propsActionGlobal)==null?void 0:Se.labelEN),"bg-color":(fe.bgColor||((ve=fe.propsActionGlobal)==null?void 0:ve.bgColor)||"primary").toLowerCase(),variant:(fe.variant||((Be=fe.propsActionGlobal)==null?void 0:Be.variant)||"outline").toLowerCase(),size:"sm",onClick:Ee=>ce(fe.key||"action",fe)},null,8,["icon","text","bg-color","variant","onClick"])}),128))])):o.createCommentVNode("",!0),(T=R.fieldMapping)!=null&&T.formCode&&f[R.fieldMapping.formCode]?(o.openBlock(),o.createElementBlock("div",_ye,[...G[3]||(G[3]=[o.createElementVNode("div",{class:"w-8 h-8 border-2 border-blue-500 border-t-transparent rounded-full animate-spin mb-3"},null,-1),o.createElementVNode("span",{class:"text-xs"},"Loading form...",-1)])])):(D=R.fieldMapping)!=null&&D.formCode&&d[R.fieldMapping.formCode]?(o.openBlock(),o.createBlock(q0,{ref:fe=>O(R.key,fe),key:`form-${R.fieldMapping.formCode}-${h[R.fieldMapping.formCode]||0}`,schema:I(R.fieldMapping.formCode),model:k(R),"onUpdate:model":fe=>$(R,fe),onCancel:te,"is-edit-mode":e.isEditMode,loading:!1,"selected-token-core":e.selectedTokenCore,"token-cores":e.tokenCores,"dummy-mode":e.dummyMode,router:o.unref(l),"permission-base":e.permissionBase,"user-permissions":e.userPermissions,"check-permission":e.checkPermission,"hide-actions":!M.value},null,8,["schema","model","onUpdate:model","is-edit-mode","selected-token-core","token-cores","dummy-mode","router","permission-base","user-permissions","check-permission","hide-actions"])):(Z=R.fieldMapping)!=null&&Z.formCode?(o.openBlock(),o.createElementBlock("div",xye,[o.createElementVNode("div",Eye,[G[5]||(G[5]=o.createElementVNode("div",{class:"text-4xl"},"⚠️",-1)),G[6]||(G[6]=o.createElementVNode("h3",{class:"text-lg font-semibold text-red-700 dark:text-red-400"}," Form Load Failed ",-1)),o.createElementVNode("p",Cye," Failed to load form schema for code: "+o.toDisplayString((J=R.fieldMapping)==null?void 0:J.formCode),1),o.createVNode(Vt,{onClick:fe=>{var ae;return P((ae=R.fieldMapping)==null?void 0:ae.formCode)},text:"Retry",variant:"outline","bg-color":"danger",size:"sm",icon:"RefreshCw"},null,8,["onClick"])])])):(o.openBlock(),o.createElementBlock("div",kye,[...G[4]||(G[4]=[o.createElementVNode("div",{class:"max-w-md space-y-3"},[o.createElementVNode("div",{class:"text-4xl"},"📄"),o.createElementVNode("h3",{class:"text-lg font-semibold text-neutral-700 dark:text-neutral-300"}," No Form Assigned "),o.createElementVNode("p",{class:"text-xs text-neutral-400 max-w-xs mx-auto"}," This wizard step does not have a form code assigned. Configure the step's field mapping to link a form. ")],-1)])]))])]})}))]),1032,["modelValue","tabs","is-vertical","is-wizard","type-wizard","loading"])],32)),!e.hideActions&&((b=(_=C.value)==null?void 0:_.actionGlobal)!=null&&b.length)?(o.openBlock(),o.createElementBlock("div",Sye,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.value.actionGlobal,(R,S)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:S},[R.propsActionGlobal?(o.openBlock(),o.createBlock(Vt,{key:0,icon:R.propsActionGlobal.icon,text:j.value==="KR"?R.propsActionGlobal.labelKR||R.propsActionGlobal.labelEN:j.value==="ID"?R.propsActionGlobal.labelID:R.propsActionGlobal.labelEN,"bg-color":(R.propsActionGlobal.bgColor||"primary").toLowerCase(),variant:(R.propsActionGlobal.variant||"default").toLowerCase(),loading:v.value,onClick:T=>{var D;return ce(((D=R.propsActionGlobal)==null?void 0:D.key)||"action",R)}},null,8,["icon","text","bg-color","variant","loading","onClick"])):o.createCommentVNode("",!0)],64))),128))])):o.createCommentVNode("",!0),o.createVNode(Yo,{modelValue:A.visible,"onUpdate:modelValue":G[1]||(G[1]=R=>A.visible=R),title:A.title,icon:"AlertTriangle","max-width":450,persistent:""},{footer:o.withCtx(()=>[o.createElementVNode("div",Tye,[o.createVNode(Vt,{variant:"outline",text:j.value==="ID"?"Batal":"Cancel",onClick:ge},null,8,["text"]),o.createVNode(Vt,{"bg-color":"primary",text:j.value==="ID"?"Ya, Lanjutkan":"Confirm",onClick:re},null,8,["text"])])]),default:o.withCtx(()=>[o.createElementVNode("div",Aye,o.toDisplayString(A.message),1)]),_:1},8,["modelValue","title"])])}}}),Pye={class:"w-full space-y-6 animate-pulse"},Bye={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},Nye=o.defineComponent({__name:"AutoLayoutSkeleton",setup(e){return(t,n)=>(o.openBlock(),o.createElementBlock("div",Pye,[n[2]||(n[2]=o.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(2,i=>o.createElementVNode("div",{key:i,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[n[1]||(n[1]=o.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[o.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),o.createElementVNode("div",Bye,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(6,r=>o.createElementVNode("div",{key:r,class:o.normalizeClass(r>4?"md:col-span-2":"col-span-1")},[...n[0]||(n[0]=[o.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),o.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),n[3]||(n[3]=o.createElementVNode("div",{class:"flex items-center gap-2"},[o.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),o.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),Dye={class:"w-full"},Mye={class:"relative mx-auto min-h-[37.5rem]"},Rye={key:"content",class:"w-full"},Iye={class:"mb-6"},Oye={class:"text-neutral-500 dark:text-neutral-400"},Lye={key:"skeleton",class:"w-full"},Fye={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},K0=Mn(o.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},apiToken:{},isEditMode:{type:Boolean},model:{},selectedTokenCore:{},router:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function},dummyMode:{type:Boolean},config:{},schema:{},hideActions:{type:Boolean},apiParams:{}},emits:["submit-success","cancel","action-success","update:model","navigate"],setup(e,{emit:t}){var te,re,ge,ce,se,z,G,ee;const n=e,i=t,r=(re=(te=o.getCurrentInstance())==null?void 0:te.appContext)==null?void 0:re.app;r&&!r._context.provides[Symbol.for("vue-router-route-location")]&&r.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const K=bs.useRoute();if(K&&Object.keys(K).length>0)s=K;else{const Y=o.getCurrentInstance();(se=(ce=(ge=Y==null?void 0:Y.appContext)==null?void 0:ge.config)==null?void 0:ce.globalProperties)!=null&&se.$route&&(s=Y.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let a={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:K=>{if(typeof window<"u"){if(typeof K=="string")window.location.href=K;else if(K&&(K.path||K.name)){const Y=K.path||"/",F=new URL(Y,window.location.origin);K.query&&Object.entries(K.query).forEach(([_,b])=>F.searchParams.set(_,String(b))),window.location.href=F.toString()}}},replace:async K=>{if(typeof window<"u"&&window.history){const Y=new URL(window.location.href);K.query&&Object.entries(K.query).forEach(([F,_])=>Y.searchParams.set(F,String(_))),window.history.replaceState({},"",Y.toString())}},currentRoute:o.computed(()=>({query:(s==null?void 0:s.query)||{},params:(s==null?void 0:s.params)||{},path:(s==null?void 0:s.path)||""})),__isFallback:!0};try{const K=n.router||bs.useRouter();if(K)a=K;else{const Y=o.getCurrentInstance();(ee=(G=(z=Y==null?void 0:Y.appContext)==null?void 0:z.config)==null?void 0:G.globalProperties)!=null&&ee.$router&&(a=Y.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=o.inject("externalApi");let d;try{d=Yn.useI18n().locale}catch{d=o.ref("en")}const{setPageTitle:f}=dS(),h=o.computed(()=>n.isEditMode!==void 0?n.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+\/?$/.test(s.path):!1);o.watchEffect(()=>{}),console.log("[AutoLayoutForm] props.isEditMode:",n.isEditMode,"computed isEditMode:",h.value,"route.params:",s.params);const m=o.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const K=s.path.match(/\/edit\/([^\/]+)\/?$/);return K?K[1]:null}),g=o.ref({}),v=o.ref(n.config||n.schema||null),y=o.ref(!v.value),A=o.ref(!1),C=o.ref(null),M=o.ref(0),B=o.ref(n.layoutCode),N=o.computed(()=>{if(!v.value)return null;const K=JSON.parse(JSON.stringify(v.value));let Y=K;if(Array.isArray(K.propsSteps)&&K.propsSteps.length>0)Y=K;else if(Array.isArray(K.sections)){const F=K.sections.find(_=>{var b,R;return((b=_==null?void 0:_.type)==null?void 0:b.toUpperCase())==="WIZARD"||((R=_==null?void 0:_.propsWizard)==null?void 0:R.propsSteps)});F!=null&&F.propsWizard&&Array.isArray(F.propsWizard.propsSteps)?Y={...K,...F.propsWizard}:(typeof K.isWizard=="boolean"||K.typeWizard)&&(Y={...K,propsSteps:K.sections})}if(h.value&&Y){const F=_=>_.endpointUpdate&&_.endpointUpdate.apiUrl?{..._,endpointSave:{..._.endpointSave,..._.endpointUpdate}}:_;Array.isArray(Y.propsSteps)&&(Y.propsSteps=Y.propsSteps.map(F)),Array.isArray(Y.sections)&&(Y.sections=Y.sections.map(F))}return Y}),j=o.computed(()=>N.value?!!(typeof N.value.isWizard=="boolean"||N.value.typeWizard||Array.isArray(N.value.propsSteps)&&N.value.propsSteps.length>0):!1),W=o.computed(()=>{var _;if(!v.value)return"";const K=((_=d==null?void 0:d.value)==null?void 0:_.toLowerCase())||"en",Y=K==="kr"||K==="ko"||K.startsWith("kr-")||K.startsWith("ko-"),F=K==="en"||K.startsWith("en-");return(Y?v.value.titleKR||v.value.titleEN:F?v.value.titleEN:v.value.titleID)||v.value.title||n.layoutCode});o.watch(W,K=>{K&&f(K)},{immediate:!0});const P=(K,Y={})=>(!K||typeof K!="object"||Object.keys(K).forEach(F=>{const _=K[F];Y[F]=_,_&&typeof _=="object"&&!Array.isArray(_)&&!(_ instanceof Date)&&!_._isLogicValue&&P(_,Y)}),Y),E=K=>{var b;if(!K||typeof K!="string"||K.startsWith("http"))return K;const Y=(b=n.selectedTokenCore)==null?void 0:b.address;if(!Y||typeof Y!="string")return K;const F=Y.replace(/\/$/,""),_=K.startsWith("/")?K:`/${K}`;return`${F}${_}`},k=K=>{var Y;if(!K)return!1;for(const F of K){const _=F.propsForm||F.propsFormStep||F.propsTable||F.propsTableStep||F.props||{};if(_.endpointForm||_.endpointTable||F.endpointForm)return!0;if(F.type==="WIZARD"&&((Y=F.propsWizard)!=null&&Y.propsSteps))for(const b of F.propsWizard.propsSteps){const R=Array.isArray(b.sectionsWizard)?b.sectionsWizard:[b.sectionsWizard].filter(Boolean);if(k(R))return!0}}return!1},$=async()=>{var K,Y,F,_,b,R;y.value=!v.value;try{let S=n.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&s.query.code===n.layoutCode&&(S=s.query.code||n.layoutCode),v.value=n.config||n.schema||null;const T=D=>{var Z,J,fe;return D?!!((Z=D.sections)!=null&&Z.length||(J=D.propsSteps)!=null&&J.length||(fe=D.columns)!=null&&fe.length||D.endpointGlobal||D.isWizard||D.typeWizard):!1};if(!v.value&&S){const D=await l(`/api/auto-layout/form/form-dynamic?code=${S}`,"GET");if(D.status){const Z=Array.isArray(D.data)?D.data[0]:D.data;T(Z)&&(v.value=Z)}if(!T(v.value)&&S)try{const Z=await l(`/api/auto-layout/wizard/form-dynamic?code=${S}`,"GET");Z!=null&&Z.status&&(v.value=Array.isArray(Z.data)?Z.data[0]:Z.data)}catch(Z){console.warn("[AutoLayoutForm] Wizard fallback also failed:",Z)}}if(v.value){const D=()=>{var J;const Z={};return(J=v.value)!=null&&J.sections&&v.value.sections.forEach(fe=>{var pe,ke;((fe.propsForm||fe.props||{}).fields||fe.fields||[]).forEach(be=>{var ve;const Se=be.model||((ve=be.props)==null?void 0:ve.model)||be.key;Se&&(Z[Se]=null)}),((pe=fe.type)==null?void 0:pe.toUpperCase())==="WIZARD"&&((ke=fe.propsWizard)!=null&&ke.propsSteps)&&fe.propsWizard.propsSteps.forEach(be=>{(Array.isArray(be.sectionsWizard)?be.sectionsWizard:[be.sectionsWizard].filter(Boolean)).forEach(ve=>{var Ee;(ve.fields||((Ee=ve.propsFormStep)==null?void 0:Ee.fields)||[]).forEach(Oe=>{var Re;const Ae=Oe.model||((Re=Oe.props)==null?void 0:Re.model)||Oe.key;Ae&&(Z[Ae]=null)})})})}),Z};if(g.value=D(),h.value&&m.value&&(g.value.id=m.value),y.value=!1,h.value&&m.value){A.value=!0;try{const Z=((Y=(K=v.value.sections)==null?void 0:K[0])==null?void 0:Y.propsForm)||((_=(F=v.value.sections)==null?void 0:F[0])==null?void 0:_.props),J=(Z==null?void 0:Z.endpointSection)||(Z==null?void 0:Z.endpointForm),fe=v.value.endpointForm,ae=J||fe;if(ae!=null&&ae.apiUrl){A.value=!0;const we=ae.apiUrl,pe=ae.apiMethod||"GET",ke=ae.keyParam||[],be={};ke.length>0?ke.forEach(ve=>{typeof ve=="string"?be[ve]=m.value:typeof ve=="object"&&ve!==null&&Object.entries(ve).forEach(([Be])=>{be[Be]=m.value})}):be.id=m.value;const Se=await c(E(we),pe,be);if(Se.status){let ve=Array.isArray(Se.data)?Se.data[0]:Se.data;Se.payload&&(ve={...ve,...Se.payload});const Be=P(ve);g.value={...g.value,...Be,...ve}}else console.warn("[AutoLayoutForm] Record API returned status: false",Se)}else if((b=v.value.endpointGlobal)!=null&&b.apiUrl){A.value=!0;const we=v.value.endpointGlobal.apiUrl,pe=v.value.endpointGlobal.apiMethod||"GET",ke={id:m.value},be=await c(E(we),pe,ke);if(be.status){const Se=Array.isArray(be.data)?be.data[0]:be.data,ve=P(Se);g.value={...g.value,...ve,...Se}}}else if(!k(v.value.sections)){const we=((R=v.value.endpoint)==null?void 0:R.detailUrl)||(j.value?null:`/api/${B.value}/detail/${m.value}`);if(!we){A.value=!1;return}A.value=!0;const pe=await l(E(we),"GET");if(pe.status){let ke=Array.isArray(pe.data)?pe.data[0]:pe.data;if(pe.payload){const ve={...pe.payload};if(Object.keys(ve).forEach(Be=>{ke[Be]!==void 0&&ke[Be]!==null&&(ve[Be]=ke[Be])}),!("id"in ve)&&ke.id){const Be=Object.keys(ve).find(Ee=>Ee.startsWith("id")&&Ee.length>2&&!ve[Ee]);Be&&(ve[Be]=ke.id)}ke=ve}const be={...ke};Object.keys(g.value).forEach(ve=>{if(be[ve]===void 0||be[ve]===null){if(ve.toLowerCase().startsWith("id")&&ve.length>2){const Ee=ve.substring(2).toLowerCase(),Oe=Array.isArray(pe.data)?pe.data[0]:pe.data,Ae=Object.keys(Oe).find(Re=>Re.toLowerCase()===Ee);Ae&&Oe[Ae]&&typeof Oe[Ae]=="object"&&"id"in Oe[Ae]&&(be[ve]=Oe[Ae].id)}if(ve==="idSupervisor"){const Ee=Array.isArray(pe.data)?pe.data[0]:pe.data;Ee.supervisorId&&(be[ve]=Ee.supervisorId)}}});const Se=P(be);g.value={...g.value,...Se,...be}}}}catch(Z){console.error("Failed to fetch record data:",Z)}finally{A.value=!1,M.value++}}}}catch(S){console.error("Failed to load form layout:",S),y.value=!1}},I=K=>{const Y=Object.keys(g.value||{}).filter(_=>g.value[_]!==null&&g.value[_]!==void 0),F=Object.keys(K||{}).filter(_=>K[_]!==null&&K[_]!==void 0);if(Y.length>3&&F.length<Y.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:Y.length,incomingCount:F.length,data:K});return}g.value=K,i("update:model",K)},O=K=>{var F,_;const Y=(K==null?void 0:K.routeBack)||(K==null?void 0:K.pathBack)||((F=v.value)==null?void 0:F.routeBack)||((_=v.value)==null?void 0:_.pathBack);Y?a.push(Y):a.back()},q=async K=>{var Y,F,_,b,R;if(n.dummyMode){i("submit-success",K),v.value=null,g.value={},O();return}try{const S=(_=(F=(Y=v.value.sections)==null?void 0:Y[0])==null?void 0:F.propsForm)==null?void 0:_.endpointForm,T=v.value.endpointGlobal||v.value.endpoint;let D=null;if(j.value&&((b=N.value)!=null&&b.propsSteps)){const ve=N.value.propsSteps,Be=ve.find(Ee=>Ee.isSubmit)||ve[ve.length-1];Be&&(D=h.value&&(R=Be.endpointUpdate)!=null&&R.apiUrl?Be.endpointUpdate:Be.endpointSave)}const Z=(D==null?void 0:D.apiUrl)||(S==null?void 0:S.submitUrl)||(T==null?void 0:T.submitUrl)||(j.value?"":`/api/generic/${n.layoutCode}`),J=(D==null?void 0:D.apiMethod)||(S==null?void 0:S.submitMethod)||(T==null?void 0:T.submitMethod)||(h.value?"PUT":"POST"),fe=Object.values(K).some(ve=>ve instanceof File||ve instanceof Blob);let ae=K;if(C.value&&K[C.value]){const ve=K[C.value];ae={},Object.values(ve).forEach(Be=>{typeof Be=="object"&&Be!==null&&Object.assign(ae,Be)})}let we;fe?(we=new FormData,Object.keys(ae).forEach(ve=>{const Be=ae[ve];Be!=null&&(Array.isArray(Be)?Be.forEach(Ee=>we.append(`${ve}[]`,Ee)):we.append(ve,Be))})):(we={...ae},h.value&&m.value&&!we.id&&(we.id=m.value));const pe=S||T,ke={...pe==null?void 0:pe.config};pe!=null&&pe.accept&&(ke.headers||(ke.headers={}),ke.headers.Accept=pe.accept,ke.headers.accept=pe.accept);let be=null,Se=!0;if(Z&&!j.value&&(be=await l(E(Z),J,we,ke),Se=(be==null?void 0:be.status)===!0||(be==null?void 0:be.success)===!0||(be==null?void 0:be.code)===200||(be==null?void 0:be.code)==="00"||(be==null?void 0:be.status)==="SUCCESS"),Se){let ve=(be==null?void 0:be.data)||(be==null?void 0:be.payload)||be;if(Array.isArray(ve)&&ve.length>0&&(ve=ve[0]),ve&&typeof ve=="object"){const Be={...(s==null?void 0:s.query)||{}};let Ee=!1;if(Object.entries(ve).forEach(([Oe,Ae])=>{["status","success","code","message"].includes(Oe)||Ae!=null&&(typeof Ae=="string"||typeof Ae=="number"||typeof Ae=="boolean")&&Be[Oe]!==String(Ae)&&(Be[Oe]=String(Ae),Ee=!0)}),Ee&&typeof window<"u"&&window.history){const Oe=new URL(window.location.href);Object.entries(Be).forEach(([Ae,Re])=>{Re!=null&&Oe.searchParams.set(Ae,String(Re))}),window.history.replaceState(window.history.state,"",Oe.toString())}}}Se&&(i("submit-success",we),v.value=null,g.value={},O())}catch(S){console.error("Submit failed:",S)}},X=async(K,Y,F)=>{if(K==="cancel"){oe();return}const _=Y.endpointPropAction||Y.propsActionGlobal&&Y.propsActionGlobal.endpointPropAction;if(_){if(n.dummyMode){i("action-success",K,Y,F||g.value);return}try{y.value=!0;const b=F?{...F}:{...g.value};h.value&&Y.model&&m.value&&(b[Y.model]=m.value);const R=_.apiUrl,S=_.apiMethod||"POST";(await c(E(R),S,b)).status&&(i("action-success",K,Y,b),O(Y))}catch(b){console.error("Action failed:",b)}finally{y.value=!1}}},oe=()=>{i("cancel"),a.back()},ue=K=>{C.value=K};return o.watch(()=>{var K;return[n.layoutCode,s.path,(K=s.query)==null?void 0:K.code,h.value,m.value,n.config,n.schema]},(K,Y)=>{(!Y||K.some((_,b)=>_!==Y[b]))&&(v.value=n.config||n.schema||null,g.value={},y.value=!v.value,$())},{immediate:!0}),o.watch(()=>n.model,K=>{var Y;if(K&&Object.keys(K).length>0)g.value={...g.value,...K};else if(!h.value){const F={};(Y=v.value)!=null&&Y.sections&&v.value.sections.forEach(_=>{var S,T;((_.propsForm||_.props||{}).fields||_.fields||[]).forEach(D=>{var J;const Z=D.model||((J=D.props)==null?void 0:J.model)||D.key;Z&&(F[Z]=null)}),((S=_.type)==null?void 0:S.toUpperCase())==="WIZARD"&&((T=_.propsWizard)!=null&&T.propsSteps)&&_.propsWizard.propsSteps.forEach(D=>{(Array.isArray(D.sectionsWizard)?D.sectionsWizard:[D.sectionsWizard].filter(Boolean)).forEach(J=>{var ae;(J.fields||((ae=J.propsFormStep)==null?void 0:ae.fields)||[]).forEach(we=>{var ke;const pe=we.model||((ke=we.props)==null?void 0:ke.model)||we.key;pe&&(F[pe]=null)})})})}),g.value=F}},{immediate:!0,deep:!0}),o.onUnmounted(()=>{f(""),v.value=null,g.value={}}),(K,Y)=>(o.openBlock(),o.createElementBlock("div",Dye,[o.createElementVNode("div",Mye,[o.createVNode(o.Transition,{name:"fade",mode:"out-in"},{default:o.withCtx(()=>{var F,_,b,R;return[!y.value&&v.value?(o.openBlock(),o.createElementBlock("div",Rye,[o.createElementVNode("div",Iye,[o.createElementVNode("p",Oye,o.toDisplayString(v.value.description),1)]),j.value?(o.openBlock(),o.createBlock(yk,{key:`wizard-${M.value}`,schema:N.value||v.value,model:g.value,"is-edit-mode":h.value,loading:A.value,"selected-token-core":n.selectedTokenCore,"token-cores":n.tokenCores,router:o.unref(a),"permission-base":n.permissionBase,"user-permissions":n.userPermissions,"check-permission":n.checkPermission,"dummy-mode":n.dummyMode,"hide-actions":n.hideActions||((F=n.config)==null?void 0:F.hideActions)||((_=n.schema)==null?void 0:_.hideActions),"api-params":n.apiParams,"onUpdate:model":Y[0]||(Y[0]=S=>I(S)),onSubmit:q,onCancel:oe,onAction:X,onNavigate:Y[1]||(Y[1]=S=>K.$emit("navigate",S)),onStepChange:ue,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core","token-cores","router","permission-base","user-permissions","check-permission","dummy-mode","hide-actions","api-params"])):(o.openBlock(),o.createBlock(q0,{key:`form-${M.value}`,schema:N.value||v.value,model:g.value,"is-edit-mode":h.value,loading:A.value,"selected-token-core":n.selectedTokenCore,router:o.unref(a),"permission-base":n.permissionBase,"user-permissions":n.userPermissions,"check-permission":n.checkPermission,"dummy-mode":n.dummyMode,"hide-actions":n.hideActions||((b=n.config)==null?void 0:b.hideActions)||((R=n.schema)==null?void 0:R.hideActions),"api-params":n.apiParams,"onUpdate:model":Y[2]||(Y[2]=S=>I(S)),onSubmit:q,onCancel:oe,onAction:X,onNavigate:Y[3]||(Y[3]=S=>K.$emit("navigate",S)),onStepChange:ue,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core","router","permission-base","user-permissions","check-permission","dummy-mode","hide-actions","api-params"]))])):y.value?(o.openBlock(),o.createElementBlock("div",Lye,[o.createVNode(Nye)])):(o.openBlock(),o.createElementBlock("div",Fye," Failed to load form configuration for "+o.toDisplayString(n.layoutCode),1))]}),_:1})])]))}}),[["__scopeId","data-v-8d5493eb"]]),$ye={class:"flex flex-col gap-3 w-full"},zye={key:0,class:"flex items-center gap-1 font-semibold text-sm text-slate-700 dark:text-slate-300"},jye={key:0,class:"text-red-500"},Uye={class:"flex flex-col gap-2 w-full"},Wye={key:0,class:"flex flex-col gap-2 w-full"},Hye={key:1,class:"flex flex-col items-center justify-center text-center gap-2 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},qye={class:"text-sm font-medium text-slate-500"},Kye=["disabled","onClick"],Gye={class:"truncate flex-1"},Yye={class:"overflow-hidden"},Zye={class:"p-4 bg-slate-50/50 dark:bg-neutral-900/10"},Xye={key:1,class:"text-xs text-neutral-400 dark:text-neutral-500 italic py-2 text-center"},G0=o.defineComponent({__name:"DCodeDynamicCollapse",props:{modelValue:{type:[Array,String,Number],default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Items"},labelEN:{type:String,default:"Items"},labelKR:{type:String,default:"Items"},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,items:{type:Array,default:void 0},accordion:{type:[Boolean,String],default:!0},required:Boolean,renderSubForm:{type:Boolean,default:!1},subLayoutCodeKey:{type:String,default:"code"},formData:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},layoutMapping:{type:[Object,String],default:()=>({})},dummyMode:{type:Boolean,default:!1},selectedTokenCore:{type:Object,default:()=>null}},emits:["update:modelValue","loaded"],setup(e,{emit:t}){const n=e,i=t,{t:r,locale:s}=Yn.useI18n(),{apiUrl:a}=o.inject("externalApi")||{},l=o.ref([]),c=o.ref(!0),d=o.ref(new Set),f=o.computed(()=>n.accordion===void 0||n.accordion===null?!0:typeof n.accordion=="string"?n.accordion==="true":!!n.accordion),h=o.computed(()=>{if(!n.layoutMapping)return{};if(typeof n.layoutMapping=="string")try{return JSON.parse(n.layoutMapping)}catch(M){return console.warn("Failed to parse layoutMapping JSON string",M),{}}return n.layoutMapping}),m=async()=>{var M;if(n.items!==void 0&&n.items!==null){l.value=n.items,c.value=!1,i("loaded",l.value);return}if(!((M=n.endpointReference)!=null&&M.apiUrl)){c.value=!1;return}c.value=!0;try{const B=await a(n.endpointReference.apiUrl,n.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(n.items!==void 0){c.value=!1;return}let N=(B==null?void 0:B.data)||B;Array.isArray(N)||(N=[N]),l.value=N,i("loaded",l.value)}catch(B){console.error("Failed to fetch dynamic collapse items",B)}finally{c.value=!1}},g=(M,B)=>M&&M[n.itemValue]!==void 0?M[n.itemValue]:B,v=(M,B)=>{const N=g(M,B);return d.value.has(N)},y=(M,B)=>{if(n.disabled)return;const N=g(M,B),j=new Set(d.value);j.has(N)?j.delete(N):(f.value&&j.clear(),j.add(N)),d.value=j;const W=Array.from(d.value);i("update:modelValue",f.value?W[0]??null:W)},A=(M,B)=>{!M||n.disabled||(n.formData[M]=B)};o.onMounted(()=>{m(),n.modelValue!==void 0&&n.modelValue!==null&&(Array.isArray(n.modelValue)?d.value=new Set(n.modelValue):d.value=new Set([n.modelValue]))}),o.watch(()=>n.modelValue,M=>{if(M!=null){const B=Array.isArray(M)?M:[M],N=new Set(B);JSON.stringify(Array.from(N))!==JSON.stringify(Array.from(d.value))&&(d.value=N)}else d.value.clear()},{deep:!0}),o.watch(()=>f.value,M=>{M&&(d.value.clear(),i("update:modelValue",null))}),o.watch(()=>{var M;return(M=n.endpointReference)==null?void 0:M.apiUrl},(M,B)=>{M!==B&&m()}),o.watch(()=>{var M;return(M=n.endpointReference)==null?void 0:M.apiMethod},(M,B)=>{M!==B&&m()}),o.watch(()=>n.items,M=>{var B;M!=null?(l.value=M,c.value=!1):(B=n.endpointReference)!=null&&B.apiUrl||(c.value=!1)},{deep:!0,immediate:!0});const C=o.computed(()=>{if(n.label)return n.label;const M=s.value.toLowerCase();return M.startsWith("kr")||M.startsWith("ko")?n.labelKR:M.startsWith("en")?n.labelEN:n.labelID});return(M,B)=>(o.openBlock(),o.createElementBlock("div",$ye,[C.value?(o.openBlock(),o.createElementBlock("div",zye,[o.createElementVNode("span",null,o.toDisplayString(C.value),1),e.required?(o.openBlock(),o.createElementBlock("span",jye,"*")):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",Uye,[l.value.length===0&&c.value?(o.openBlock(),o.createElementBlock("div",Wye,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(3,N=>o.createElementVNode("div",{key:N,class:"w-full flex items-center justify-between p-4 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg animate-pulse"},[...B[0]||(B[0]=[o.createElementVNode("div",{class:"h-4 bg-slate-200 dark:bg-neutral-700 rounded w-1/3"},null,-1),o.createElementVNode("div",{class:"h-4 w-4 bg-slate-200 dark:bg-neutral-700 rounded-full"},null,-1)])])),64))])):l.value.length===0&&!c.value?(o.openBlock(),o.createElementBlock("div",Hye,[o.createElementVNode("span",qye,o.toDisplayString(o.unref(r)("dynamicUploadList.noDocsRequired")||"No items available"),1)])):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.value,(N,j)=>(o.openBlock(),o.createElementBlock("div",{key:j,class:o.normalizeClass(["bg-white dark:bg-neutral-800 border transition-all duration-200 rounded-lg shadow-sm overflow-hidden",v(N,j)?"border-primary-500/50 dark:border-primary-500/30 ring-1 ring-primary-500/10":"border-slate-200 dark:border-neutral-700/50"])},[o.createElementVNode("button",{type:"button",class:o.normalizeClass(["w-full flex items-center justify-between p-4 font-semibold text-sm text-left transition-colors duration-200 focus:outline-none",[v(N,j)?"text-primary-600 dark:text-primary-400 bg-primary-50/20 dark:bg-primary-950/10 border-b border-primary-500/20 dark:border-primary-500/10":"text-slate-700 dark:text-neutral-300 hover:bg-slate-50 dark:hover:bg-neutral-700/50"]]),disabled:e.disabled,onClick:W=>y(N,j)},[o.renderSlot(M.$slots,"header",{item:N,index:j,expanded:v(N,j)},()=>[o.createElementVNode("span",Gye,o.toDisplayString(N[e.itemTitle]||N.name||N.code||`Item ${j+1}`),1)]),o.createVNode(o.unref(Ne.ChevronDown),{class:o.normalizeClass(["w-4 h-4 transition-transform duration-200 shrink-0 ml-2",[v(N,j)?"transform rotate-180 text-primary-500":"text-slate-400"]])},null,8,["class"])],10,Kye),o.createElementVNode("div",{class:o.normalizeClass(["grid transition-all duration-200 ease-in-out",v(N,j)?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"])},[o.createElementVNode("div",Yye,[o.createElementVNode("div",Zye,[o.renderSlot(M.$slots,"default",{item:N,index:j,expanded:v(N,j)},()=>[e.renderSubForm&&h.value[N[e.subLayoutCodeKey]||N.code]?(o.openBlock(),o.createBlock(K0,{key:0,layoutCode:h.value[N[e.subLayoutCodeKey]||N.code],model:e.formData[N[e.subLayoutCodeKey]||N.code]||{},"is-edit-mode":e.isEditMode,"dummy-mode":e.dummyMode,"selected-token-core":e.selectedTokenCore,"hide-actions":!0,"onUpdate:model":W=>A(N[e.subLayoutCodeKey]||N.code,W)},null,8,["layoutCode","model","is-edit-mode","dummy-mode","selected-token-core","onUpdate:model"])):e.renderSubForm?(o.openBlock(),o.createElementBlock("div",Xye," Konten Kosong ")):o.createCommentVNode("",!0)])])])],2)],2))),128))])]))}}),FN=o.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(e){const t=e,n=o.computed(()=>tn[t.icon]??tn.X);return(i,r)=>(o.openBlock(),o.createBlock(o.unref(Fr),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.value),{size:Number(e.iconSize)},null,8,["size"]))]),_:1}))}}),Jye={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Qye=["for"],Vye={key:0,class:"!ml-1 !text-destructive"},ebe={class:"relative w-full block box-border"},tbe={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},nbe=["id","readonly","disabled","placeholder"],ibe={class:"absolute inset-y-0 right-4 flex items-center z-10"},rbe={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-800 border-neutral-200/60 dark:border-neutral-700/50 shadow-lg box-border"},obe={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},sbe={key:1,class:"text-sm text-muted-foreground text-center"},abe=["onClick","title"],lbe={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},cbe={class:"flex items-center justify-center flex-1"},dbe={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},ube={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},fbe={key:1,class:"text-xs text-destructive mt-1"},$N=o.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},clearable:{type:Boolean,default:!0},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},error:{default:null},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(e,{emit:t}){const n=e,i=t,r=o.computed(()=>!!n.error),s=tn,a=o.ref(null),l=o.ref(null),c=Math.random().toString(36).slice(2,7),d=o.computed(()=>`dcode-icon-dropdown-${n.label||"icon-dropdown"}-${c}`),f=o.ref(!1),h=o.computed(()=>(n.modelValue??"").trim()||""),m=o.ref(""),g=o.ref(!1),v=o.ref(!1),y=o.ref(!1),A=o.shallowRef([]),C=o.ref(n.pageSize),M=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),B=async()=>{if(v.value||y.value)return;y.value=!0,await new Promise(z=>setTimeout(z,0));const se=Object.keys(s).filter(z=>!M.has(z)).filter(z=>/^[A-Z]/.test(z)).filter(z=>{if(z.endsWith("Icon")&&z.length>4){const G=z.slice(0,-4);if(s[G])return!1}return!0}).filter(z=>typeof s[z]=="function"||typeof s[z]=="object"&&s[z]).sort((z,G)=>z.localeCompare(G));A.value=se,v.value=!0,y.value=!1},N=o.computed(()=>h.value?Es(h.value,s):null),j=o.ref(h.value),W=o.computed(()=>!!h.value&&!f.value),P=o.computed(()=>{if(!v.value)return[];const se=(m.value??"").trim().toLowerCase();return se?A.value.filter(z=>z.toLowerCase().includes(se)):A.value}),E=o.computed(()=>P.value.slice(0,C.value)),k=o.computed(()=>{const se=n.columns;return se<=2?"grid-cols-2":se===3?"grid-cols-3":se===4?"grid-cols-4":se===5?"grid-cols-5":se>=8?"grid-cols-8":"grid-cols-6"});o.computed(()=>n.clearable?"!pr-10":"!pr-3"),o.computed(()=>N.value&&!f.value?"!pl-12":"!pl-3");const $=async()=>{var se;await o.nextTick(),(se=l.value)==null||se.focus()},I=async se=>{if(n.disabled)return;const z=se!==!1;if(g.value){g.value=!1;return}f.value=!0,await B(),z&&(m.value="",j.value=""),C.value=n.pageSize,await $()},O=()=>{f.value=!1,m.value="",j.value=h.value,C.value=n.pageSize},q=async()=>{n.disabled||(f.value?O():await I())};let X=null;const oe=async se=>{if(n.disabled)return;i("update:modelValue",null),f.value||await I(!1),X&&clearTimeout(X);const z=j.value;X=setTimeout(()=>{m.value=z},300)},ue=se=>{n.disabled||(i("update:modelValue",se),O(),queueMicrotask(()=>{var z;return(z=l.value)==null?void 0:z.blur()}))},te=()=>{n.disabled||(i("update:modelValue",null),i("clear"),g.value=!0,O(),queueMicrotask(()=>{var se;return(se=l.value)==null?void 0:se.focus()}))},re=se=>{if(se.key==="Escape"){se.preventDefault(),O();return}if(se.key==="Enter"&&f.value){const z=P.value[0];z&&(se.preventDefault(),ue(z))}},ge=se=>{if(!f.value)return;const z=se.target;a.value&&!a.value.contains(z)&&O()},ce=se=>{const z=se.target;z.scrollTop+z.clientHeight>=z.scrollHeight-24&&C.value<P.value.length&&(C.value=Math.min(C.value+n.pageSize,P.value.length))};return o.onMounted(()=>{document.addEventListener("mousedown",ge),queueMicrotask(()=>{var se;l.value=((se=a.value)==null?void 0:se.querySelector("input"))??null}),h.value&&B()}),o.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ge),X&&clearTimeout(X)}),o.watch(h,se=>{f.value||(j.value=se)}),o.watch(()=>m.value,()=>{C.value=n.pageSize}),(se,z)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:a,class:"!w-full !block !box-border"},[n.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[n.label?(o.openBlock(),o.createElementBlock("div",Jye)):o.createCommentVNode("",!0),z[3]||(z[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[n.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:d.value,class:"!text-sm !font-medium !mb-1 !block"},[o.createTextVNode(o.toDisplayString(n.label)+" ",1),n.required?(o.openBlock(),o.createElementBlock("span",Vye,"*")):o.createCommentVNode("",!0)],8,Qye)):o.createCommentVNode("",!0),o.createElementVNode("div",ebe,[N.value&&!f.value?(o.openBlock(),o.createElementBlock("div",tbe,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(N.value),{size:18}))])):o.createCommentVNode("",!0),o.withDirectives(o.createElementVNode("input",{id:d.value,"onUpdate:modelValue":z[0]||(z[0]=G=>j.value=G),readonly:W.value,disabled:n.disabled,placeholder:n.placeholder,class:o.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 pr-10 outline-none box-border truncate",[N.value&&!f.value?"pl-10":"pl-4",W.value?"cursor-pointer select-none":"",r.value?"border-destructive focus:ring-destructive":""]]),onClick:I,onFocus:I,onInput:oe,onKeydown:re},null,42,nbe),[[o.vModelText,j.value]]),o.createElementVNode("div",ibe,[n.clearable&&h.value?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:z[1]||(z[1]=o.withModifiers(()=>{},["prevent"])),onClick:te,title:"Clear"},[o.createVNode(o.unref(Ne.X),{class:"h-4 w-4"})],32)):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:z[2]||(z[2]=o.withModifiers(()=>{},["prevent"])),onClick:q,title:"Open"},[o.createVNode(o.unref(Ne.ChevronDown),{class:"h-4 w-4"})],32))]),f.value?(o.openBlock(),o.createElementBlock("div",rbe,[o.createElementVNode("div",{class:"p-2 overflow-auto",style:o.normalizeStyle({maxHeight:n.maxHeight}),onScroll:ce},[y.value?(o.openBlock(),o.createElementBlock("div",obe,[o.createVNode(o.unref(Ne.Loader2),{class:"h-4 w-4 animate-spin"}),z[4]||(z[4]=o.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):v.value&&P.value.length===0?(o.openBlock(),o.createElementBlock("div",sbe," Icon tidak ditemukan ")):(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["grid gap-2",k.value])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(E.value,G=>(o.openBlock(),o.createElementBlock("button",{key:G,type:"button",class:o.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",h.value===G?"ring-1 ring-primary":""]),onClick:ee=>ue(G),title:G},[o.createElementVNode("div",lbe,[o.createElementVNode("div",cbe,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(s)[G]),{size:n.iconSize,class:"shrink-0"},null,8,["size"]))]),o.createElementVNode("span",dbe,o.toDisplayString(G),1)])],10,abe))),128))],2)),v.value&&P.value.length>0?(o.openBlock(),o.createElementBlock("div",ube," Showing "+o.toDisplayString(E.value.length)+" / "+o.toDisplayString(P.value.length),1)):o.createCommentVNode("",!0)],36)])):o.createCommentVNode("",!0)]),r.value?(o.openBlock(),o.createElementBlock("p",fbe,o.toDisplayString(n.error),1)):o.createCommentVNode("",!0)],64))],512)),[[o.vShow,e.visible]])}}),hbe={class:"w-full"},mbe={key:0,class:"flex items-center justify-between mb-2"},pbe={key:0,class:"text-sm font-medium text-gray-700 dark:text-neutral-300"},gbe={key:1,class:"text-sm text-gray-600 dark:text-neutral-400"},ybe={name:"DCodeProgress"},zN=o.defineComponent({...ybe,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=o.computed(()=>Math.min(n.modelValue/n.max*100,100)),r=o.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[n.size],"bg-gray-200 dark:bg-neutral-700"].join(" ")),s=o.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[n.color]||l.blue];return n.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),n.animated&&c.push("animate-pulse"),c.join(" ")}),a=o.computed(()=>`${Math.round(i.value)}%`);return(l,c)=>(o.openBlock(),o.createElementBlock("div",hbe,[e.label||e.showValue?(o.openBlock(),o.createElementBlock("div",mbe,[e.label?(o.openBlock(),o.createElementBlock("span",pbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.showValue?(o.openBlock(),o.createElementBlock("span",gbe,o.toDisplayString(a.value),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(r.value)},[o.createElementVNode("div",{class:o.normalizeClass(s.value),style:o.normalizeStyle({width:`${i.value}%`})},null,6)],2)]))}}),bbe={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},jN=Mn(o.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(e){return(t,n)=>(o.openBlock(),o.createBlock(o.Transition,{name:"fade"},{default:o.withCtx(()=>[e.isApiLoading?(o.openBlock(),o.createElementBlock("div",bbe,[o.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:o.normalizeStyle({width:`${e.apiProgress}%`})},null,4)])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),vbe={key:0},wbe={class:"flex items-start justify-between gap-4"},_be={class:"min-w-0"},kbe={class:"truncate text-sm font-medium text-neutral-700 dark:text-neutral-300"},xbe={key:0,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Ebe=["aria-label","aria-valuenow","aria-valuemax"],Cbe=["aria-label","aria-valuenow","aria-valuemax"],Sbe={class:"h-full w-full -rotate-90",viewBox:"0 0 100 100","aria-hidden":"true"},Abe=["stroke-width"],Tbe=["stroke-width","stroke-dashoffset"],Pbe={key:0,class:"text-center"},Bbe={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Nbe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Dbe=["aria-label","aria-valuenow","aria-valuemax"],Mbe={class:"relative w-48 overflow-hidden"},Rbe={class:"h-auto w-full",viewBox:"0 0 100 58","aria-hidden":"true"},Ibe=["stroke-dasharray"],Obe={key:0,class:"text-center"},Lbe={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Fbe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},$be=["aria-label","aria-valuenow","aria-valuemax"],zbe={class:"relative z-10 flex h-full w-full items-center justify-center rounded-full bg-white dark:bg-neutral-900"},jbe={key:0,class:"text-center"},Ube={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Wbe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Hbe=["aria-label","aria-valuenow","aria-valuemax"],qbe={class:"flex items-center gap-1.5"},Kbe={class:"flex items-center justify-between gap-4"},Gbe={key:0,class:"text-sm font-medium text-neutral-700 dark:text-neutral-300"},Ybe={key:1,class:"mt-1 text-xs text-neutral-500 dark:text-neutral-400"},Zbe=["aria-label","aria-valuenow","aria-valuemax"],Xbe={class:"relative h-3 rounded-sm bg-neutral-200 dark:bg-neutral-700"},Jbe={class:"flex items-center justify-between gap-4 text-xs"},Qbe={class:"text-neutral-500 dark:text-neutral-400"},UN=o.defineComponent({name:"DCodePercentage",inheritAttrs:!1,__name:"DCodePercentage",props:{value:{default:0},max:{default:100},label:{default:""},caption:{default:""},showValue:{type:Boolean,default:!0},variant:{default:"bar"},size:{default:"md"},target:{default:80},stepCount:{default:5},color:{default:"primary"},visible:{type:Boolean,default:!0}},setup(e){const t=e,n=o.computed(()=>Math.max(Number.isFinite(t.max)?t.max:100,1)),i=o.computed(()=>Math.min(Math.max(Number.isFinite(t.value)?t.value:0,0),n.value)),r=o.computed(()=>i.value/n.value*100),s=o.computed(()=>t.showValue?`${Math.round(r.value)}%`:""),a=o.computed(()=>Math.min(Math.max(t.target/n.value*100,0),100)),l=o.computed(()=>Math.round(r.value/100*t.stepCount)),c=o.computed(()=>"h-2"),d=o.computed(()=>({"h-24 w-24":t.size==="sm","h-32 w-32":t.size==="md","h-40 w-40":t.size==="lg"})),f=o.computed(()=>t.variant==="donut"?16:8),h=o.computed(()=>({"bg-primary-500":t.color==="primary","bg-success-500":t.color==="success","bg-warning-500":t.color==="warning","bg-danger-500":t.color==="danger"})),m=o.computed(()=>({"stroke-primary-500":t.color==="primary","stroke-success-500":t.color==="success","stroke-warning-500":t.color==="warning","stroke-danger-500":t.color==="danger"})),g=o.computed(()=>({"--percentage-color":t.color==="success"?"#22c55e":t.color==="warning"?"#f59e0b":t.color==="danger"?"#ef4444":"#0066cc","--percentage-track":"rgb(229 229 229)"})),v=o.computed(()=>({"text-primary-600 dark:text-primary-400":t.color==="primary","text-success-600 dark:text-success-400":t.color==="success","text-warning-600 dark:text-warning-400":t.color==="warning","text-danger-600 dark:text-danger-400":t.color==="danger"}));return(y,A)=>e.visible?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["w-full",y.$attrs.class])},[e.variant==="bar"?(o.openBlock(),o.createElementBlock("div",vbe,[o.createElementVNode("div",wbe,[o.createElementVNode("div",_be,[o.createElementVNode("p",kbe,o.toDisplayString(e.label),1),e.caption?(o.openBlock(),o.createElementBlock("p",xbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)]),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["shrink-0 text-sm font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)]),o.createElementVNode("div",{class:o.normalizeClass(["mt-3 w-full overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-700",c.value]),role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",{class:o.normalizeClass(["h-full rounded-full transition-[width] duration-500 ease-out",h.value]),style:o.normalizeStyle({width:`${r.value}%`})},null,6)],10,Ebe)])):e.variant==="circle"||e.variant==="donut"?(o.openBlock(),o.createElementBlock("div",{key:1,class:"flex flex-col items-center gap-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",{class:o.normalizeClass(["relative",d.value])},[(o.openBlock(),o.createElementBlock("svg",Sbe,[o.createElementVNode("circle",{cx:"50",cy:"50",r:"40",fill:"none",class:"stroke-neutral-200 dark:stroke-neutral-700","stroke-width":f.value},null,8,Abe),o.createElementVNode("circle",{cx:"50",cy:"50",r:"40",fill:"none",class:o.normalizeClass(["transition-[stroke-dashoffset] duration-500 ease-out",m.value]),"stroke-width":f.value,"stroke-linecap":"round","stroke-dasharray":"251.2","stroke-dashoffset":251.2-251.2*r.value/100},null,10,Tbe)])),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["absolute inset-0 flex items-center justify-center text-xl font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)],2),e.label||e.caption?(o.openBlock(),o.createElementBlock("div",Pbe,[e.label?(o.openBlock(),o.createElementBlock("p",Bbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Nbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],8,Cbe)):e.variant==="semi-circle"?(o.openBlock(),o.createElementBlock("div",{key:2,class:"flex flex-col items-center gap-2",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",Mbe,[(o.openBlock(),o.createElementBlock("svg",Rbe,[A[0]||(A[0]=o.createElementVNode("path",{d:"M10 50 A40 40 0 0 1 90 50",pathLength:"100",fill:"none",class:"stroke-neutral-200 dark:stroke-neutral-700","stroke-width":"10","stroke-linecap":"round"},null,-1)),o.createElementVNode("path",{d:"M10 50 A40 40 0 0 1 90 50",pathLength:"100",fill:"none",class:o.normalizeClass(["transition-[stroke-dasharray] duration-500 ease-out",m.value]),"stroke-width":"10","stroke-linecap":"round","stroke-dasharray":`${r.value} 100`},null,10,Ibe)])),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["absolute inset-x-0 bottom-0 text-center text-2xl font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)]),e.label||e.caption?(o.openBlock(),o.createElementBlock("div",Obe,[e.label?(o.openBlock(),o.createElementBlock("p",Lbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Fbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],8,Dbe)):e.variant==="radial"?(o.openBlock(),o.createElementBlock("div",{key:3,class:"flex flex-col items-center gap-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",{class:"relative flex h-36 w-36 items-center justify-center rounded-full p-2",style:o.normalizeStyle(g.value)},[o.createElementVNode("div",{class:"absolute inset-0 rounded-full",style:o.normalizeStyle({background:`conic-gradient(var(--percentage-color) ${r.value}%, var(--percentage-track) 0)`})},null,4),o.createElementVNode("div",zbe,[e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["text-2xl font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)])],4),e.label||e.caption?(o.openBlock(),o.createElementBlock("div",jbe,[e.label?(o.openBlock(),o.createElementBlock("p",Ube,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Wbe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],8,$be)):e.variant==="steps"?(o.openBlock(),o.createElementBlock("div",{key:4,class:"space-y-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",qbe,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.stepCount,C=>(o.openBlock(),o.createElementBlock("span",{key:C,class:o.normalizeClass(["h-2.5 flex-1 rounded-sm",C<=l.value?h.value:"bg-neutral-200 dark:bg-neutral-700"])},null,2))),128))]),o.createElementVNode("div",Kbe,[o.createElementVNode("div",null,[e.label?(o.openBlock(),o.createElementBlock("p",Gbe,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.caption?(o.openBlock(),o.createElementBlock("p",Ybe,o.toDisplayString(e.caption),1)):o.createCommentVNode("",!0)]),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["text-sm font-semibold tabular-nums",v.value])},o.toDisplayString(s.value),3)):o.createCommentVNode("",!0)])],8,Hbe)):(o.openBlock(),o.createElementBlock("div",{key:5,class:"space-y-3",role:"progressbar","aria-label":e.label||void 0,"aria-valuenow":i.value,"aria-valuemin":0,"aria-valuemax":n.value},[o.createElementVNode("div",Xbe,[o.createElementVNode("div",{class:o.normalizeClass(["h-full rounded-sm transition-[width] duration-500 ease-out",h.value]),style:o.normalizeStyle({width:`${r.value}%`})},null,6),o.createElementVNode("span",{class:"absolute top-1/2 h-5 w-0.5 -translate-y-1/2 bg-neutral-900 dark:bg-white",style:o.normalizeStyle({left:`calc(${a.value}% - 1px)`}),"aria-hidden":"true"},null,4)]),o.createElementVNode("div",Jbe,[o.createElementVNode("span",Qbe,o.toDisplayString(e.label),1),e.showValue?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["font-semibold tabular-nums",v.value])},o.toDisplayString(s.value)+" / target "+o.toDisplayString(a.value)+"%",3)):o.createCommentVNode("",!0)])],8,Zbe))],2)):o.createCommentVNode("",!0)}}),Vbe={class:"flex flex-col gap-1.5"},eve={key:0,class:"flex items-center gap-1"},tve={key:0,class:"text-xs font-medium text-slate-700 dark:text-slate-300 leading-none"},nve={class:"inline-flex items-center text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 cursor-help transition-colors",tabindex:"-1","aria-label":"More info"},ive=["aria-disabled"],rve=["aria-checked","disabled","onClick"],ove=["aria-checked","disabled","onClick"],sve={name:"DCodeSegmentGroup"},WN=o.defineComponent({...sve,props:{modelValue:{},options:{},label:{},description:{},disabled:{type:Boolean}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,i=t,r=c=>c.code===n.modelValue,s=c=>{n.disabled||i("update:modelValue",c.code)},a=o.computed(()=>["inline-flex items-center gap-1 rounded-lg border p-1","bg-slate-100 border-slate-200 dark:bg-slate-800/60 dark:border-slate-700",n.disabled?"opacity-50 cursor-not-allowed":""]),l=c=>["relative inline-flex items-center justify-center","min-w-[2.5rem] px-2.5 py-1 rounded-md","font-mono font-bold tracking-wider text-sm","transition-all duration-200 ease-out","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-1",r(c)?["bg-white dark:bg-slate-900","text-primary dark:text-primary","shadow-sm border border-slate-200 dark:border-slate-600","scale-[1.03]"]:["text-slate-500 dark:text-slate-400","hover:bg-white/60 dark:hover:bg-slate-700/60","border border-transparent"],n.disabled?"cursor-not-allowed":"cursor-pointer"];return(c,d)=>(o.openBlock(),o.createElementBlock("div",Vbe,[e.label||e.description?(o.openBlock(),o.createElementBlock("div",eve,[e.label?(o.openBlock(),o.createElementBlock("span",tve,o.toDisplayString(e.label),1)):o.createCommentVNode("",!0),e.description?(o.openBlock(),o.createBlock(o.unref(td),{key:1,"delay-duration":150},{default:o.withCtx(()=>[o.createVNode(o.unref(Vc),null,{default:o.withCtx(()=>[o.createVNode(o.unref(nd),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("span",nve,[o.createVNode(o.unref(Ne.Info),{class:"w-3.5 h-3.5"})])]),_:1}),o.createVNode(o.unref(ed),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(e.description),1)]),_:1})]),_:1})]),_:1})):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(a.value),role:"radiogroup","aria-disabled":e.disabled?"true":void 0},[o.createVNode(o.unref(td),{"delay-duration":200},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.options,f=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:f.code},[f.tooltip?(o.openBlock(),o.createBlock(o.unref(Vc),{key:0},{default:o.withCtx(()=>[o.createVNode(o.unref(nd),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",role:"radio","aria-checked":r(f),disabled:e.disabled,class:o.normalizeClass(l(f)),onClick:h=>s(f)},o.toDisplayString(f.display),11,rve)]),_:2},1024),o.createVNode(o.unref(ed),{side:"bottom"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(f.tooltip),1)]),_:2},1024)]),_:2},1024)):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",role:"radio","aria-checked":r(f),disabled:e.disabled,class:o.normalizeClass(l(f)),onClick:h=>s(f)},o.toDisplayString(f.display),11,ove))],64))),128))]),_:1})],10,ive)]))}}),ave={class:"dcode-upload-file"},lve={class:"border-2 border-dashed border-gray-300 dark:border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center text-center hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer"},cve={key:0,class:"text-xs text-gray-500 mt-1"},dve=["accept"],uve={key:1,class:"text-xs text-red-600 mt-1"},HN=o.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,i=r=>{var a;const s=(a=r.target.files)==null?void 0:a[0];s&&n("update:modelValue",s)};return(r,s)=>(o.openBlock(),o.createElementBlock("div",ave,[e.label?(o.openBlock(),o.createBlock(jl,{key:0,label:e.label},null,8,["label"])):o.createCommentVNode("",!0),o.createElementVNode("div",lve,[o.createVNode(o.unref(Ne.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=o.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[o.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),o.createTextVNode(" or drag and drop ")],-1)),e.accept?(o.openBlock(),o.createElementBlock("p",cve,o.toDisplayString(e.accept),1)):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"file",class:"hidden",onChange:i,accept:e.accept},null,40,dve)]),e.errorMessage?(o.openBlock(),o.createElementBlock("p",uve,o.toDisplayString(e.errorMessage),1)):o.createCommentVNode("",!0)]))}}),fve={key:0,class:"flex flex-wrap items-center justify-between gap-3 px-4 py-3 bg-neutral-50 dark:bg-neutral-900 border-b border-neutral-200 dark:border-neutral-800 select-none"},hve={class:"flex items-center gap-2"},mve={key:0,class:"font-semibold text-sm text-neutral-800 dark:text-neutral-200 flex items-center gap-2"},pve={key:1,class:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-semibold bg-violet-100 dark:bg-violet-900/40 text-violet-700 dark:text-violet-300 border border-violet-200 dark:border-violet-700/50"},gve={key:2,class:"flex items-center bg-neutral-200 dark:bg-neutral-800 p-0.5 rounded-lg text-xs ml-2"},yve={key:0,class:"flex items-center gap-1.5"},bve=["title"],vve={key:0,class:"h-4 w-px bg-neutral-300 dark:bg-neutral-700 mx-1"},wve={key:1,class:"flex-1 flex overflow-hidden compare-split"},_ve={class:"compare-panel flex flex-col flex-1 min-w-0 border-r border-neutral-200 dark:border-neutral-800"},kve={class:"compare-panel-header flex items-center justify-between px-3 py-2 bg-amber-50 dark:bg-amber-950/30 border-b border-amber-200 dark:border-amber-800/50 select-none"},xve={class:"inline-flex items-center gap-1.5 text-xs font-semibold text-amber-700 dark:text-amber-400"},Eve={class:"flex items-center gap-1"},Cve={key:0,class:"h-3 w-px bg-amber-200 dark:bg-amber-800 mx-0.5"},Sve={class:"flex-1 relative overflow-hidden bg-neutral-50/50 dark:bg-neutral-950/40"},Ave={key:0,class:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-xs"},Tve={key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},Pve={class:"bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 p-4 rounded-xl max-w-xs border border-red-200 dark:border-red-900/60"},Bve={class:"text-xs opacity-80 font-mono break-words"},Nve={key:2,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},Dve={class:"flex flex-col items-center justify-center text-neutral-400 dark:text-neutral-500"},Mve={class:"text-[11px] text-neutral-400 dark:text-neutral-500 mt-0.5 font-mono"},Rve={class:"compare-panel flex flex-col flex-1 min-w-0"},Ive={class:"compare-panel-header flex items-center justify-between px-3 py-2 bg-emerald-50 dark:bg-emerald-950/30 border-b border-emerald-200 dark:border-emerald-800/50 select-none"},Ove={class:"inline-flex items-center gap-1.5 text-xs font-semibold text-emerald-700 dark:text-emerald-400"},Lve={class:"flex items-center gap-1"},Fve={key:0,class:"h-3 w-px bg-emerald-200 dark:bg-emerald-800 mx-0.5"},$ve={class:"flex-1 relative overflow-hidden bg-neutral-50/50 dark:bg-neutral-950/40"},zve={key:0,class:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-xs"},jve={key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},Uve={class:"bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 p-4 rounded-xl max-w-xs border border-red-200 dark:border-red-900/60"},Wve={class:"text-xs opacity-80 font-mono break-words"},Hve={key:2,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-4 text-center"},qve={class:"flex flex-col items-center justify-center text-neutral-400 dark:text-neutral-500"},Kve={class:"text-[11px] text-neutral-400 dark:text-neutral-500 mt-0.5 font-mono"},Gve={key:2,class:"flex-1 relative overflow-hidden bg-neutral-50/50 dark:bg-neutral-950/40"},Yve={key:0,class:"absolute inset-0 z-20 flex flex-col items-center justify-center bg-white/80 dark:bg-neutral-900/80 backdrop-blur-xs"},Zve={key:1,class:"absolute inset-0 z-10 flex flex-col items-center justify-center p-6 text-center"},Xve={class:"bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 p-6 rounded-xl max-w-md border border-red-200 dark:border-red-900/60 shadow-xs"},Jve={class:"text-xs opacity-90 mb-4 break-words font-mono bg-red-100/50 dark:bg-red-900/40 p-2 rounded"},Qve={class:"flex gap-2 justify-center"},Vve={key:2,class:"w-full h-full p-4 overflow-auto font-mono text-xs text-neutral-100 dark:text-neutral-200 bg-neutral-900 dark:bg-neutral-950"},ewe={class:"whitespace-pre-wrap break-all leading-relaxed"},qN=`<?xml version="1.0" encoding="UTF-8"?>
1583
1583
  <bpmn:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1584
1584
  xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
1585
1585
  xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"