@gemafajarramadhan/dynamic-ui 1.2.63 → 1.2.64
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.
- package/dist/dynamic-ui.css +1 -1
- package/dist/dynamic-ui.es.js +6711 -6636
- package/dist/dynamic-ui.umd.js +13 -13
- package/package.json +1 -1
package/dist/dynamic-ui.umd.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(ae,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(ae=typeof globalThis<"u"?globalThis:ae||self,e(ae.DynamicUI={},ae.Vue,ae.LucideIcons,ae.rekaUi,ae.core,ae.VueI18n,ae.VueDatePicker,ae.Uppy,ae.UppyDashboard,ae.UppyImageEditor,ae.VueRouter,ae.Vue3Lottie))})(this,(function(ae,e,te,fe,We,gt,Jd,Qd,Us,Zd,un,eu){"use strict";var NA=Object.defineProperty;var MA=(ae,e,te)=>e in ae?NA(ae,e,{enumerable:!0,configurable:!0,writable:!0,value:te}):ae[e]=te;var de=(ae,e,te)=>MA(ae,typeof e!="symbol"?e+"":e,te);var Hr;function tu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const At=tu(te);let Ct={};function Ws(t){Ct={...Ct,...t}}function nu(){return Ct}function ou(){return Ct.apiBaseUrl?Ct.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function ru(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Ct.getAuthToken?n=Ct.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),Ct.getHeaders){const o=Ct.getHeaders();return{...t,...o}}return t}function au(){Ct.onUnauthorized&&Ct.onUnauthorized()}async function su(t,n,o,r){const a=nu();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(n||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${n}' tidak valid, fallback ke 'GET'.`);const c=ou(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...ru(),...r||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const k=new URLSearchParams;Object.entries(o).forEach(([w,p])=>{p!=null&&k.append(w,String(p))});const C=k.toString();C&&(f=`${d}${d.includes("?")?"&":"?"}${C}`)}const m=await fetch(f,u);if(m.status===401&&au(),!m.ok){const k=await m.text();throw new Error(`HTTP ${m.status}: ${k}`)}return(m.headers.get("content-type")||"").includes("application/json")?m.json():{status:!0,data:await m.text()}}function Ke(){const t=(n,o,r,a)=>{let s=n,i=o,l=r,c=a;return a&&typeof a=="object"?(a._url&&(s=a._url,i=a._method||i||"POST",a._data&&(l={...l||{},...a._data})),a.headers&&(c=a.headers)):n&&o&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(o.toUpperCase())||(s=`${n.endsWith("/")?n.slice(0,-1):n}/${o}`,i="POST")),su(s,i,l,c)};return{apiUrl:t,DCodeApi:t}}const Pn=Math.min,dt=Math.max,Po=Math.round,To=Math.floor,Vt=t=>({x:t,y:t}),iu={left:"right",right:"left",bottom:"top",top:"bottom"};function Hs(t,n,o){return dt(t,Pn(n,o))}function Jn(t,n){return typeof t=="function"?t(n):t}function Qt(t){return t.split("-")[0]}function Qn(t){return t.split("-")[1]}function qs(t){return t==="x"?"y":"x"}function Gs(t){return t==="y"?"height":"width"}function It(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function Ks(t){return qs(It(t))}function lu(t,n,o){o===void 0&&(o=!1);const r=Qn(t),a=Ks(t),s=Gs(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=vo(i)),[i,vo(i)]}function cu(t){const n=vo(t);return[ta(t),n,ta(n)]}function ta(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Xs=["left","right"],Ys=["right","left"],du=["top","bottom"],uu=["bottom","top"];function fu(t,n,o){switch(t){case"top":case"bottom":return o?n?Ys:Xs:n?Xs:Ys;case"left":case"right":return n?du:uu;default:return[]}}function mu(t,n,o,r){const a=Qn(t);let s=fu(Qt(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(ta)))),s}function vo(t){const n=Qt(t);return iu[n]+t.slice(n.length)}function hu(t){return{top:0,right:0,bottom:0,left:0,...t}}function pu(t){return typeof t!="number"?hu(t):{top:t,right:t,bottom:t,left:t}}function Oo(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function Js(t,n,o){let{reference:r,floating:a}=t;const s=It(n),i=Ks(n),l=Gs(i),c=Qt(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let h;switch(c){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Qn(n)){case"start":h[i]-=m*(o&&d?-1:1);break;case"end":h[i]+=m*(o&&d?-1:1);break}return h}async function gu(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:h=0}=Jn(n,t),k=pu(h),w=l[m?f==="floating"?"reference":"floating":f],p=Oo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(w)))==null||o?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),A=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),S=await(s.isElement==null?void 0:s.isElement(D))?await(s.getScale==null?void 0:s.getScale(D))||{x:1,y:1}:{x:1,y:1},V=Oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:A,offsetParent:D,strategy:c}):A);return{top:(p.top-V.top+k.top)/S.y,bottom:(V.bottom-p.bottom+k.bottom)/S.y,left:(p.left-V.left+k.left)/S.x,right:(V.right-p.right+k.right)/S.x}}const bu=50,yu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:gu},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:f}=Js(d,r,c),m=r,h=0;const k={};for(let C=0;C<s.length;C++){const w=s[C];if(!w)continue;const{name:p,fn:A}=w,{x:D,y:S,data:V,reset:B}=await A({x:u,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:k,rects:d,platform:l,elements:{reference:t,floating:n}});u=D??u,f=S??f,k[p]={...k[p],...V},B&&h<bu&&(h++,typeof B=="object"&&(B.placement&&(m=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):B.rects),{x:u,y:f}=Js(d,m,c)),C=-1)}return{x:u,y:f,placement:m,strategy:a,middlewareData:k}},xu=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:k="none",flipAlignment:C=!0,...w}=Jn(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=Qt(a),A=It(l),D=Qt(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(d.floating)),V=m||(D||!C?[vo(l)]:cu(l)),B=k!=="none";!m&&B&&V.push(...mu(l,C,k,S));const g=[l,...V],b=await c.detectOverflow(n,w),_=[];let y=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&_.push(b[p]),f){const T=lu(a,i,S);_.push(b[T[0]],b[T[1]])}if(y=[...y,{placement:a,overflows:_}],!_.every(T=>T<=0)){var x,E;const T=(((x=s.flip)==null?void 0:x.index)||0)+1,$=g[T];if($&&(!(f==="alignment"?A!==It($):!1)||y.every(j=>It(j.placement)===A?j.overflows[0]>0:!0)))return{data:{index:T,overflows:y},reset:{placement:$}};let v=(E=y.filter(I=>I.overflows[0]<=0).sort((I,j)=>I.overflows[1]-j.overflows[1])[0])==null?void 0:E.placement;if(!v)switch(h){case"bestFit":{var M;const I=(M=y.filter(j=>{if(B){const U=It(j.placement);return U===A||U==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(U=>U>0).reduce((U,P)=>U+P,0)]).sort((j,U)=>j[1]-U[1])[0])==null?void 0:M[0];I&&(v=I);break}case"initialPlacement":v=l;break}if(a!==v)return{reset:{placement:v}}}return{}}}},ku=new Set(["left","top"]);async function wu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=Qt(o),l=Qn(o),c=It(o)==="y",d=ku.has(i)?-1:1,u=s&&c?-1:1,f=Jn(n,t);let{mainAxis:m,crossAxis:h,alignmentAxis:k}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof k=="number"&&(h=l==="end"?k*-1:k),c?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Cu=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await wu(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Bu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:A,y:D}=p;return{x:A,y:D}}},...d}=Jn(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),m=It(Qt(a)),h=qs(m);let k=u[h],C=u[m];if(i){const p=h==="y"?"top":"left",A=h==="y"?"bottom":"right",D=k+f[p],S=k-f[A];k=Hs(D,k,S)}if(l){const p=m==="y"?"top":"left",A=m==="y"?"bottom":"right",D=C+f[p],S=C-f[A];C=Hs(D,C,S)}const w=c.fn({...n,[h]:k,[m]:C});return{...w,data:{x:w.x-o,y:w.y-r,enabled:{[h]:i,[m]:l}}}}}},Eu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=Jn(t,n),u=await i.detectOverflow(n,d),f=Qt(a),m=Qn(a),h=It(a)==="y",{width:k,height:C}=s.floating;let w,p;f==="top"||f==="bottom"?(w=f,p=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,w=m==="end"?"top":"bottom");const A=C-u.top-u.bottom,D=k-u.left-u.right,S=Pn(C-u[w],A),V=Pn(k-u[p],D),B=!n.middlewareData.shift;let g=S,b=V;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=D),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(g=A),B&&!m){const y=dt(u.left,0),x=dt(u.right,0),E=dt(u.top,0),M=dt(u.bottom,0);h?b=k-2*(y!==0||x!==0?y+x:dt(u.left,u.right)):g=C-2*(E!==0||M!==0?E+M:dt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:g});const _=await i.getDimensions(l.floating);return k!==_.width||C!==_.height?{reset:{rects:!0}}:{}}}};function Fo(){return typeof window<"u"}function fn(t){return na(t)?(t.nodeName||"").toLowerCase():"#document"}function ut(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Dt(t){var n;return(n=(na(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function na(t){return Fo()?t instanceof Node||t instanceof ut(t).Node:!1}function Bt(t){return Fo()?t instanceof Element||t instanceof ut(t).Element:!1}function Lt(t){return Fo()?t instanceof HTMLElement||t instanceof ut(t).HTMLElement:!1}function Qs(t){return!Fo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ut(t).ShadowRoot}function Zn(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Et(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function _u(t){return/^(table|td|th)$/.test(fn(t))}function zo(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Su=/transform|translate|scale|rotate|perspective|filter/,Au=/paint|layout|strict|content/,mn=t=>!!t&&t!=="none";let oa;function ra(t){const n=Bt(t)?Et(t):t;return mn(n.transform)||mn(n.translate)||mn(n.scale)||mn(n.rotate)||mn(n.perspective)||!aa()&&(mn(n.backdropFilter)||mn(n.filter))||Su.test(n.willChange||"")||Au.test(n.contain||"")}function Vu(t){let n=Zt(t);for(;Lt(n)&&!Tn(n);){if(ra(n))return n;if(zo(n))return null;n=Zt(n)}return null}function aa(){return oa==null&&(oa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),oa}function Tn(t){return/^(html|body|#document)$/.test(fn(t))}function Et(t){return ut(t).getComputedStyle(t)}function Ro(t){return Bt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Zt(t){if(fn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Qs(t)&&t.host||Dt(t);return Qs(n)?n.host:n}function Zs(t){const n=Zt(t);return Tn(n)?t.ownerDocument?t.ownerDocument.body:t.body:Lt(n)&&Zn(n)?n:Zs(n)}function eo(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=Zs(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=ut(a);if(s){const l=sa(i);return n.concat(i,i.visualViewport||[],Zn(a)?a:[],l&&o?eo(l):[])}else return n.concat(a,eo(a,[],o))}function sa(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ei(t){const n=Et(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=Lt(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=Po(o)!==s||Po(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function ia(t){return Bt(t)?t:t.contextElement}function vn(t){const n=ia(t);if(!Lt(n))return Vt(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=ei(n);let i=(s?Po(o.width):o.width)/r,l=(s?Po(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Du=Vt(0);function ti(t){const n=ut(t);return!aa()||!n.visualViewport?Du:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Nu(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==ut(t)?!1:n}function hn(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=ia(t);let i=Vt(1);n&&(r?Bt(r)&&(i=vn(r)):i=vn(t));const l=Nu(s,o,r)?ti(s):Vt(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(s){const m=ut(s),h=r&&Bt(r)?ut(r):r;let k=m,C=sa(k);for(;C&&r&&h!==k;){const w=vn(C),p=C.getBoundingClientRect(),A=Et(C),D=p.left+(C.clientLeft+parseFloat(A.paddingLeft))*w.x,S=p.top+(C.clientTop+parseFloat(A.paddingTop))*w.y;c*=w.x,d*=w.y,u*=w.x,f*=w.y,c+=D,d+=S,k=ut(C),C=sa(k)}}return Oo({width:u,height:f,x:c,y:d})}function Io(t,n){const o=Ro(t).scrollLeft;return n?n.left+o:hn(Dt(t)).left+o}function ni(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-Io(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Mu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=Dt(r),l=n?zo(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=Vt(1);const u=Vt(0),f=Lt(r);if((f||!f&&!s)&&((fn(r)!=="body"||Zn(i))&&(c=Ro(r)),f)){const h=hn(r);d=vn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const m=i&&!f&&!s?ni(i,c):Vt(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:o.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Pu(t){return Array.from(t.getClientRects())}function Tu(t){const n=Dt(t),o=Ro(t),r=t.ownerDocument.body,a=dt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=dt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+Io(t);const l=-o.scrollTop;return Et(r).direction==="rtl"&&(i+=dt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const oi=25;function vu(t,n){const o=ut(t),r=Dt(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=aa();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Io(r);if(d<=0){const u=r.ownerDocument,f=u.body,m=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,k=Math.abs(r.clientWidth-f.clientWidth-h);k<=oi&&(s-=k)}else d<=oi&&(s+=d);return{width:s,height:i,x:l,y:c}}function Ou(t,n){const o=hn(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=Lt(t)?vn(t):Vt(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function ri(t,n,o){let r;if(n==="viewport")r=vu(t,o);else if(n==="document")r=Tu(Dt(t));else if(Bt(n))r=Ou(n,o);else{const a=ti(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Oo(r)}function ai(t,n){const o=Zt(t);return o===n||!Bt(o)||Tn(o)?!1:Et(o).position==="fixed"||ai(o,n)}function Fu(t,n){const o=n.get(t);if(o)return o;let r=eo(t,[],!1).filter(l=>Bt(l)&&fn(l)!=="body"),a=null;const s=Et(t).position==="fixed";let i=s?Zt(t):t;for(;Bt(i)&&!Tn(i);){const l=Et(i),c=ra(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Zn(i)&&!c&&ai(t,i))?r=r.filter(u=>u!==i):a=l,i=Zt(i)}return n.set(t,r),r}function zu(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?zo(n)?[]:Fu(n,this._c):[].concat(o),r],l=ri(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let m=1;m<i.length;m++){const h=ri(n,i[m],a);c=dt(h.top,c),d=Pn(h.right,d),u=Pn(h.bottom,u),f=dt(h.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Ru(t){const{width:n,height:o}=ei(t);return{width:n,height:o}}function Iu(t,n,o){const r=Lt(n),a=Dt(n),s=o==="fixed",i=hn(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=Vt(0);function d(){c.x=Io(a)}if(r||!r&&!s)if((fn(n)!=="body"||Zn(a))&&(l=Ro(n)),r){const h=hn(n,!0,s,n);c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?ni(a,l):Vt(0),f=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:f,y:m,width:i.width,height:i.height}}function la(t){return Et(t).position==="static"}function si(t,n){if(!Lt(t)||Et(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return Dt(t)===o&&(o=o.ownerDocument.body),o}function ii(t,n){const o=ut(t);if(zo(t))return o;if(!Lt(t)){let a=Zt(t);for(;a&&!Tn(a);){if(Bt(a)&&!la(a))return a;a=Zt(a)}return o}let r=si(t,n);for(;r&&_u(r)&&la(r);)r=si(r,n);return r&&Tn(r)&&la(r)&&!ra(r)?o:r||Vu(t)||o}const Lu=async function(t){const n=this.getOffsetParent||ii,o=this.getDimensions,r=await o(t.floating);return{reference:Iu(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $u(t){return Et(t).direction==="rtl"}const ju={convertOffsetParentRelativeRectToViewportRelativeRect:Mu,getDocumentElement:Dt,getClippingRect:zu,getOffsetParent:ii,getElementRects:Lu,getClientRects:Pu,getDimensions:Ru,getScale:vn,isElement:Bt,isRTL:$u};function li(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function Uu(t,n){let o=null,r;const a=Dt(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:m,height:h}=d;if(l||n(),!m||!h)return;const k=To(f),C=To(a.clientWidth-(u+m)),w=To(a.clientHeight-(f+h)),p=To(u),D={rootMargin:-k+"px "+-C+"px "+-w+"px "+-p+"px",threshold:dt(0,Pn(1,c))||1};let S=!0;function V(B){const g=B[0].intersectionRatio;if(g!==c){if(!S)return i();g?i(!1,g):r=setTimeout(()=>{i(!1,1e-7)},1e3)}g===1&&!li(d,t.getBoundingClientRect())&&i(),S=!1}try{o=new IntersectionObserver(V,{...D,root:a.ownerDocument})}catch{o=new IntersectionObserver(V,D)}o.observe(t)}return i(!0),s}function ca(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=ia(t),u=a||s?[...d?eo(d):[],...n?eo(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?Uu(d,o):null;let m=-1,h=null;i&&(h=new ResizeObserver(p=>{let[A]=p;A&&A.target===d&&h&&n&&(h.unobserve(n),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var D;(D=h)==null||D.observe(n)})),o()}),d&&!c&&h.observe(d),n&&h.observe(n));let k,C=c?hn(t):null;c&&w();function w(){const p=hn(t);C&&!li(C,p)&&o(),C=p,k=requestAnimationFrame(w)}return o(),()=>{var p;u.forEach(A=>{a&&A.removeEventListener("scroll",o),s&&A.removeEventListener("resize",o)}),f==null||f(),(p=h)==null||p.disconnect(),h=null,c&&cancelAnimationFrame(k)}}const da=Cu,ua=Bu,fa=xu,ma=Eu,Wu=(t,n,o)=>{const r=new Map,a={platform:ju,...o},s={...a.platform,_c:r};return yu(t,n,{...a,platform:s})};function Hu(t){return t!=null&&typeof t=="object"&&"$el"in t}function ci(t){if(Hu(t)){const n=t.$el;return na(n)&&fn(n)==="#comment"?null:n}return t}function to(t){return typeof t=="function"?t():e.unref(t)}function di(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ui(t,n){const o=di(t);return Math.round(n*o)/o}function ha(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var g;return(g=to(o.open))!=null?g:!0}),s=e.computed(()=>to(o.middleware)),i=e.computed(()=>{var g;return(g=to(o.placement))!=null?g:"bottom"}),l=e.computed(()=>{var g;return(g=to(o.strategy))!=null?g:"absolute"}),c=e.computed(()=>{var g;return(g=to(o.transform))!=null?g:!0}),d=e.computed(()=>ci(t.value)),u=e.computed(()=>ci(n.value)),f=e.ref(0),m=e.ref(0),h=e.ref(l.value),k=e.ref(i.value),C=e.shallowRef({}),w=e.ref(!1),p=e.computed(()=>{const g={position:h.value,left:"0",top:"0"};if(!u.value)return g;const b=ui(u.value,f.value),_=ui(u.value,m.value);return c.value?{...g,transform:"translate("+b+"px, "+_+"px)",...di(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:b+"px",top:_+"px"}});let A;function D(){if(d.value==null||u.value==null)return;const g=a.value;Wu(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,m.value=b.y,h.value=b.strategy,k.value=b.placement,C.value=b.middlewareData,w.value=g!==!1})}function S(){typeof A=="function"&&(A(),A=void 0)}function V(){if(S(),r===void 0){D();return}if(d.value!=null&&u.value!=null){A=r(d.value,u.value,D);return}}function B(){a.value||(w.value=!1)}return e.watch([s,i,l,a],D,{flush:"sync"}),e.watch([d,u],V,{flush:"sync"}),e.watch(a,B,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(S),{x:e.shallowReadonly(f),y:e.shallowReadonly(m),strategy:e.shallowReadonly(h),placement:e.shallowReadonly(k),middlewareData:e.shallowReadonly(C),isPositioned:e.shallowReadonly(w),floatingStyles:p,update:D}}const qu=["aria-busy"],Gu={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Ku=["for"],Xu={key:0,class:"ml-1 text-destructive"},Yu={class:"relative"},Ju={key:0,class:"flex items-center text-gray-500 gap-2"},Qu=["id","placeholder","disabled","readonly","value"],Zu={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},ef=["disabled"],tf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},nf=["onMouseenter","onClick"],of={key:0},rf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},af={key:0},sf={key:1},lf={key:2},cf={key:1,class:"mt-1 text-xs text-red-600"},Lo=e.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=H=>{const re=a[H];return re===""||re===!0||re==="true"||re===1||re==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),f=e.computed(()=>i("required")),m=e.computed(()=>i("readonly")),h=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),k=e.computed(()=>f.value||i("aria-required")),C=e.computed(()=>o.error||o.errorMessage||a["error-message"]),w=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const H=a.minChars??a["min-chars"];if(H==null||H==="")return 0;const re=typeof H=="number"?H:Number.parseInt(String(H),10);return Number.isFinite(re)&&re>0?re:0}),A=e.computed(()=>{const H=a.rules;return Array.isArray(H)?H:[]}),D=e.computed(()=>{const H=a.id||a.label;return H?`app-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),S=e.ref(o.modelValue),V=e.ref([]),B=e.ref(!1),g=e.ref(!1),b=e.computed(()=>a.items),_=e.computed(()=>{const H=T.value;return H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems?V.value:b.value??[]}),y=e.computed(()=>!!a.loading),x=e.computed(()=>y.value||B.value),E=e.computed(()=>{const{label:H,items:re,loading:pe,rules:Ie,"item-title":Ee,"item-value":Q,itemTitle:oe,itemValue:se,minChars:xe,"min-chars":He,clearable:zt,required:qr,"aria-required":Fd,disabled:Gr,readonly:zd,visible:rt,"return-object":Rd,returnObject:Kr,class:Id,"fetch-items":Xr,fetchItems:Ld,error:$s,errorMessage:$d,"error-message":jd,...Yr}=a||{};return Yr}),M=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},T=e.computed(()=>{const H=o.endpoint||{};return{apiModule:o.apiModule||H.apiModule,apiAction:o.apiAction||H.apiAction,apiUrl:H.apiUrl,apiMethod:H.apiMethod||"GET"}}),$=e.ref(null),v=e.ref(null),I=e.ref(null),{floatingStyles:j}=ha(v,I,{placement:"bottom-start",whileElementsMounted:ca,middleware:[da(4),fa(),ua(),ma({apply({rects:H,elements:re,availableHeight:pe}){Object.assign(re.floating.style,{width:`${H.reference.width}px`,maxHeight:`${pe}px`})}})]}),U=e.ref(!1),P=e.ref(""),R=e.ref(-1),G=e.ref(null),q=e.computed(()=>!p.value||(P.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),W=H=>{if(H==null)return"";if(typeof H=="string"||typeof H=="number")return String(H);const re=c.value;return typeof re=="function"?re(H):(H==null?void 0:H[re])??(H==null?void 0:H.name)??(H==null?void 0:H.nama)??(H==null?void 0:H.label)??(H==null?void 0:H.title)??"-"},Z=H=>{if(H==null)return null;if(typeof H=="string"||typeof H=="number")return H;const re=d.value;return typeof re=="function"?re(H):(H==null?void 0:H[re])??(H==null?void 0:H.id)??(H==null?void 0:H.value)??(H==null?void 0:H.code)??null},ne=e.computed(()=>{const H=S.value;if(H==null||H==="")return"";if(Array.isArray(H))return H.length?H.map(Ie=>{if(h.value&&typeof Ie=="object"||typeof Ie=="object")return W(Ie);const Ee=_.value.find(Q=>Z(Q)==Ie);return Ee?W(Ee):String(Ie)}).join(", "):"";if(typeof H=="object")return W(H);const re=_.value.find(pe=>Z(pe)==H);return re?W(re):String(H)}),ue=e.computed(()=>{const H=_.value||[],re=(P.value||"").trim().toLowerCase(),pe=(ne.value||"").toLowerCase(),Ie=!re||re===pe;let Ee=H;if(Ie||(Ee=H.filter(Q=>W(Q).toLowerCase().includes(re))),Ee.length>0){const Q=oe=>{const se=Z(oe);return Array.isArray(S.value)?S.value.some(xe=>xe==se):S.value==se};Ee=[...Ee].sort((oe,se)=>{const xe=Q(oe),He=Q(se);return xe&&!He?-1:!xe&&He?1:0})}return Ee}),ke=H=>Array.isArray(H)?H.length===0:H==null||H==="",me=H=>{if(G.value=null,f.value&&ke(H)&&!A.value.length)return G.value="This field is required",!1;for(const re of A.value){const pe=re(H);if(pe===!1)return G.value="Invalid value",!1;if(typeof pe=="string")return G.value=pe,!1}return!0},X=async()=>{if(u.value||m.value)return;U.value=!0,R.value=ue.value.length?0:-1,P.value=ne.value||"";const H=T.value,re=H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems;o.autoFetchOnOpen&&re&&!g.value&&(await ze(),R.value=ue.value.length?0:-1)},O=()=>{U.value=!1,R.value=-1,P.value=ne.value||""},K=H=>{const re=h.value?H:Z(H);let pe=re;Array.isArray(S.value)&&(pe=[re]),S.value=pe,r("update:modelValue",pe),G.value=null,me(pe),P.value=W(H),O()},ee=()=>{V.value=[],g.value=!1,S.value=Array.isArray(S.value)?[]:null,r("update:modelValue",S.value),P.value="",G.value=null},he=()=>{l.value=!0,ee(),O(),setTimeout(()=>{l.value=!1},0)},Ve=H=>{if(u.value||m.value)return;const re=H.target.value;P.value=re,G.value&&(G.value=null),U.value||(U.value=!0),R.value=ue.value.length?0:-1;const pe=T.value.apiModule&&T.value.apiAction||T.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&pe&&!x.value&&!g.value&&ze()},Ne=H=>{var pe;if(u.value||m.value)return;const re={ArrowDown:()=>{if(H.preventDefault(),!U.value){X();return}ue.value.length&&(R.value=Math.min(R.value+1,ue.value.length-1))},ArrowUp:()=>{!U.value||!ue.value.length||(H.preventDefault(),R.value=Math.max(R.value-1,0))},Enter:()=>{if(!U.value)return;H.preventDefault();const Ie=ue.value[R.value];Ie&&K(Ie)},Escape:()=>{H.preventDefault(),O()},Tab:()=>{O()}};(pe=re[H.key])==null||pe.call(re)},ze=async()=>{const H=T.value;if(H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems){B.value=!0;try{let pe;if(o.fetchItems){const Ie=M()||{},Ee={page:1,perPage:100,search:(P.value||"").trim(),...Ie,...o.apiParams},Q=await o.fetchItems(Ee),oe=(Q==null?void 0:Q.data)??Q;pe=(oe==null?void 0:oe.data)??oe}else{const Ee=Ke().DCodeApi;if(typeof Ee!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const oe={page:1,perPage:100,...M()||{},...o.apiParams};let se;H.apiUrl?se=await Ee("","",oe,{_url:H.apiUrl,_method:H.apiMethod||"POST"}):se=await Ee(H.apiModule,H.apiAction,oe);const xe=(se==null?void 0:se.data)??se;pe=(xe==null?void 0:xe.data)??xe}V.value=Array.isArray(pe)?pe:[],g.value=!0}catch(pe){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",pe),G.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(pe==null?void 0:pe.message)||(pe==null?void 0:pe.toString())||"Failed to load options"}`,V.value=[],g.value=!0}finally{B.value=!1}}},Re=H=>{const re=Z(H);return h.value?S.value?Array.isArray(S.value)?S.value.some(pe=>Z(pe)==re):Z(S.value)==re:!1:Array.isArray(S.value)?S.value.some(pe=>pe==re):S.value==re};e.watch(()=>[M(),T.value,o.apiParams],([H,re,pe],[Ie,Ee,Q])=>{const oe=T.value;if(!(oe.apiModule&&oe.apiAction||oe.apiUrl||o.fetchItems)){ee();return}const xe=JSON.stringify(H??null)===JSON.stringify(Ie??null),He=JSON.stringify(pe??null)===JSON.stringify(Q??null);xe&&He||(ee(),He||ze())},{deep:!0}),e.watch(()=>o.modelValue,(H,re)=>{S.value=H,!l.value&&(H==null||H==="")&&re!=null&&o.apiModule&&o.apiAction&&(V.value=[],g.value=!1),P.value=ne.value||""},{immediate:!0});const Ue=T.value;(Ue.apiModule&&Ue.apiAction||Ue.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ke(o.modelValue))&&ze();const Ze=H=>{const re=$.value,pe=I.value,Ie=H.target;re&&re.contains(Ie)||pe&&pe.contains(Ie)||U.value&&O()},ct=e.computed(()=>{const H=o.modelValue;return H==null?!1:typeof H=="string"?H.trim().length>0:Array.isArray(H)?H.length>0:typeof H=="object"?Object.keys(H).length>0:!0}),St=e.computed(()=>!!o.clearable&&ct.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",Ze)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ze)}),(H,re)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:$,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",Gu)):e.createCommentVNode("",!0),re[6]||(re[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:D.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),k.value?(e.openBlock(),e.createElementBlock("span",Xu,"*")):e.createCommentVNode("",!0)],8,Ku)):e.createCommentVNode("",!0),e.createElementVNode("div",Yu,[e.createElementVNode("div",{ref_key:"reference",ref:v,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||m.value?"opacity-60 cursor-not-allowed":"",G.value||C.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||H.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",Ju,[e.renderSlot(H.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(E.value,{id:D.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||m.value?"cursor-not-allowed":"cursor-text"],placeholder:w.value,disabled:u.value,readonly:m.value,value:U.value?P.value:ne.value||P.value,onFocus:re[0]||(re[0]=()=>{U.value||X()}),onClick:re[1]||(re[1]=()=>{U.value||X()}),onInput:Ve,onKeydown:Ne,onBlur:re[2]||(re[2]=()=>me(S.value))}),null,16,Qu),x.value?(e.openBlock(),e.createElementBlock("svg",Zu,[...re[7]||(re[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):St.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:re[3]||(re[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(he,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||m.value,onClick:re[4]||(re[4]=pe=>U.value?O():X()),"aria-label":"Toggle"},[e.createVNode(e.unref(te.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":U.value}])},null,8,["class"])],8,ef))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:I,style:e.normalizeStyle(e.unref(j)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",tf,[ue.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue.value,(pe,Ie)=>(e.openBlock(),e.createElementBlock("button",{key:Z(pe)??Ie,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Ie===R.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ee=>R.value=Ie,onMousedown:re[5]||(re[5]=e.withModifiers(()=>{},["prevent"])),onClick:Ee=>K(pe)},[e.createTextVNode(e.toDisplayString(W(pe))+" ",1),Re(pe)?(e.openBlock(),e.createElementBlock("span",of," ✓ ")):e.createCommentVNode("",!0)],42,nf))),128)):e.renderSlot(H.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",rf,[x.value?(e.openBlock(),e.createElementBlock("span",af,"Loading data…")):q.value?(e.openBlock(),e.createElementBlock("span",sf,e.toDisplayString(q.value),1)):(e.openBlock(),e.createElementBlock("span",lf,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),G.value||C.value?(e.openBlock(),e.createElementBlock("p",cf,e.toDisplayString(G.value||C.value),1)):e.createCommentVNode("",!0)],64))],10,qu)),[[e.vShow,t.visible]])}}),df=["aria-busy"],uf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},ff=["for"],mf={key:0,class:"ml-1 text-destructive"},hf={class:"relative"},pf={key:0,class:"flex items-center text-gray-500 gap-2"},gf=["id","placeholder","disabled","value"],bf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},yf=["disabled"],xf={key:0,class:"p-3 space-y-2"},kf=["onMouseenter","onClick"],wf={class:"flex items-center space-x-3"},Cf={class:"flex-1"},Bf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Ef={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},_f={key:0},Sf={key:2,class:"p-3 text-center"},Af={class:"inline-flex items-center space-x-2"},Vf={class:"text-sm text-gray-500"},Df={key:3,class:"p-3 text-center"},Nf={class:"text-xs text-gray-400"},Mf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Pf={key:1,class:"mt-1 text-xs text-red-600"},Tf={key:2,class:"mt-1 text-xs text-gray-500"},fi=e.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const R=o.label||o.placeholder;return R?`app-infinite-autocomplete-${R}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),m=e.ref([]),h=e.ref(!1),k=e.ref(!1),C=e.ref(-1),w=e.ref(1),p=e.ref(!0),A=e.ref(0),D=e.ref(),{floatingStyles:S}=ha(c,d,{placement:"bottom-start",whileElementsMounted:ca,middleware:[da(4),fa(),ua(),ma({apply({rects:R,elements:G}){Object.assign(G.floating.style,{width:`${R.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const V=e.computed(()=>f.value?m.value.filter(R=>_(R).toLowerCase().includes(f.value.toLowerCase())):m.value),B=e.computed(()=>{if(k.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return _(o.modelValue);{const R=m.value.find(G=>y(G)===o.modelValue);return R?_(R):String(o.modelValue)}}return""}),g=()=>{k.value=!0},b=()=>{k.value=!1},_=R=>typeof o.itemTitle=="function"?o.itemTitle(R):R[o.itemTitle]||"",y=R=>typeof o.itemValue=="function"?o.itemValue(R):R[o.itemValue]||R,x=R=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(R):R[o.itemSubtitle]||"":"",E=R=>o.modelValue?o.returnObject?y(R)===y(o.modelValue):y(R)===o.modelValue:!1,M=R=>{var q;const G=o.returnObject?R:y(R);r("update:modelValue",G),r("select",R),k.value=!1,f.value="",(q=s.value)==null||q.blur()},T=()=>{var R;r("update:modelValue",null),f.value="",(R=s.value)==null||R.focus()},$=R=>{k.value=!0,r("focus",R),o.autoFetchOnOpen&&!h.value&&(o.refreshOnOpen||m.value.length===0)&&P(!0)},v=R=>{setTimeout(()=>{k.value=!1,r("blur",R)},200)},I=R=>{const G=R.target;f.value=G.value,D.value&&clearTimeout(D.value),D.value=setTimeout(()=>{r("search",f.value),w.value=1,p.value=!0,P(!0)},o.debounceMs)},j=R=>{if(k.value)switch(R.key){case"ArrowDown":R.preventDefault(),C.value=Math.min(C.value+1,V.value.length-1);break;case"ArrowUp":R.preventDefault(),C.value=Math.max(C.value-1,0);break;case"Enter":R.preventDefault(),C.value>=0&&V.value[C.value]&&M(V.value[C.value]);break;case"Escape":k.value=!1;break}},U=R=>{if(!p.value||h.value)return;const G=R.target,{scrollTop:q,scrollHeight:W,clientHeight:Z}=G;q+Z>=W-o.threshold&&P()},P=async(R=!1)=>{var G,q;if(!h.value){h.value=!0;try{let W=[];if(o.fetchItems)W=await o.fetchItems();else{const Z=Ke(),ne=((G=o.endpoint)==null?void 0:G.apiModule)||o.apiModule,ue=((q=o.endpoint)==null?void 0:q.apiAction)||o.apiAction;if(!ne||!ue)throw new Error("API module and action are required");const ke={page:R?1:w.value,pageSize:o.pageSize,search:f.value,...o.apiParams},me=await Z.apiUrl(`/${ne}/${ue}`,"GET",ke);W=me.data||me.items||me||[],A.value=me.total||me.totalItems||W.length}R?(m.value=W,w.value=1):(m.value.push(...W),w.value++),p.value=W.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:W,page:w.value,hasMore:p.value,total:A.value})}catch(W){console.error("Error fetching items:",W),r("error",W)}finally{h.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&P()}),e.onUnmounted(()=>{D.value&&clearTimeout(D.value)}),e.watch(()=>o.modelValue,R=>{R||(f.value="")}),(R,G)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",uf)):e.createCommentVNode("",!0),G[3]||(G[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",mf,"*")):e.createCommentVNode("",!0)],8,ff)):e.createCommentVNode("",!0),e.createElementVNode("div",hf,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",pf,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},R.$attrs,{id:u.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:B.value,onFocus:$,onBlur:v,onInput:I,onKeydown:j}),null,16,gf),h.value?(e.openBlock(),e.createElementBlock("svg",bf,[...G[4]||(G[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:G[0]||(G[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(T,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.disabled,onClick:G[1]||(G[1]=q=>k.value?b():g()),"aria-label":"Toggle"},[e.createVNode(e.unref(te.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":k.value}])},null,8,["class"])],8,yf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[k.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(S)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:U},[h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",xf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,q=>e.createElementVNode("div",{key:q,class:"flex items-center space-x-3"},[...G[5]||(G[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):V.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(V.value,(q,W)=>(e.openBlock(),e.createElementBlock("button",{key:y(q)??W,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",W===C.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Z=>C.value=W,onMousedown:G[2]||(G[2]=e.withModifiers(()=>{},["prevent"])),onClick:Z=>M(q)},[e.renderSlot(R.$slots,"item",{item:q,index:W},()=>[e.createElementVNode("div",wf,[e.createElementVNode("div",Cf,[e.createElementVNode("div",Bf,e.toDisplayString(_(q)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Ef,e.toDisplayString(x(q)),1)):e.createCommentVNode("",!0)])])]),E(q)?(e.openBlock(),e.createElementBlock("span",_f," ✓ ")):e.createCommentVNode("",!0)],42,kf))),128)):e.createCommentVNode("",!0),h.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Sf,[e.createElementVNode("div",Af,[G[6]||(G[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Vf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Df,[e.createElementVNode("div",Nf,e.toDisplayString(t.endOfResultsText),1)])):!h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",Mf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Pf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",Tf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,df)),[[e.vShow,t.visible]])}});function mi(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=mi(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function hi(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=mi(t))&&(r&&(r+=" "),r+=n);return r}const vf=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},Of=(t,n)=>({classGroupId:t,validator:n}),pi=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),$o="-",gi=[],Ff="arbitrary..",zf=t=>{const n=If(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Rf(i);const l=i.split($o),c=l[0]===""&&l.length>1?1:0;return bi(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?vf(d,c):c:d||gi}return o[i]||gi}}},bi=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=bi(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join($o):t.slice(n).join($o),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Rf=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?Ff+r:void 0})(),If=t=>{const{theme:n,classGroups:o}=t;return Lf(o,n)},Lf=(t,n)=>{const o=pi();for(const r in t){const a=t[r];pa(a,o,r,n)}return o},pa=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];$f(i,n,o,r)}},$f=(t,n,o,r)=>{if(typeof t=="string"){jf(t,n,o);return}if(typeof t=="function"){Uf(t,n,o,r);return}Wf(t,n,o,r)},jf=(t,n,o)=>{const r=t===""?n:yi(n,t);r.classGroupId=o},Uf=(t,n,o,r)=>{if(Hf(t)){pa(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Of(o,t))},Wf=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];pa(c,yi(n,l),o,r)}},yi=(t,n)=>{let o=t;const r=n.split($o),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=pi(),o.nextPart.set(i,l)),o=l}return o},Hf=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,qf=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},ga="!",xi=":",Gf=[],ki=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),Kf=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let C=0;C<u;C++){const w=a[C];if(i===0&&l===0){if(w===xi){s.push(a.slice(c,C)),c=C+1;continue}if(w==="/"){d=C;continue}}w==="["?i++:w==="]"?i--:w==="("?l++:w===")"&&l--}const f=s.length===0?a:a.slice(c);let m=f,h=!1;f.endsWith(ga)?(m=f.slice(0,-1),h=!0):f.startsWith(ga)&&(m=f.slice(1),h=!0);const k=d&&d>c?d-c:void 0;return ki(s,h,m,k)};if(n){const a=n+xi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):ki(Gf,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},Xf=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},Yf=t=>({cache:qf(t.cacheSize),parseClassName:Kf(t),sortModifiers:Xf(t),...zf(t)}),Jf=/\s+/,Qf=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(Jf);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:m,hasImportantModifier:h,baseClassName:k,maybePostfixModifierPosition:C}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let w=!!C,p=r(w?k.substring(0,C):k);if(!p){if(!w){c=u+(c.length>0?" "+c:c);continue}if(p=r(k),!p){c=u+(c.length>0?" "+c:c);continue}w=!1}const A=m.length===0?"":m.length===1?m[0]:s(m).join(":"),D=h?A+ga:A,S=D+p;if(i.indexOf(S)>-1)continue;i.push(S);const V=a(p,w);for(let B=0;B<V.length;++B){const g=V[B];i.push(D+g)}c=u+(c.length>0?" "+c:c)}return c},Zf=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=wi(o))&&(a&&(a+=" "),a+=r);return a},wi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=wi(t[r]))&&(o&&(o+=" "),o+=n);return o},em=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=Yf(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=Qf(c,o);return a(c,u),u};return s=i,(...c)=>s(Zf(...c))},tm=[],Ye=t=>{const n=o=>o[t]||tm;return n.isThemeGetter=!0,n},Ci=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,nm=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,om=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rm=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,am=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,sm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,im=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,en=t=>nm.test(t),Ce=t=>!!t&&!Number.isNaN(Number(t)),tn=t=>!!t&&Number.isInteger(Number(t)),ba=t=>t.endsWith("%")&&Ce(t.slice(0,-1)),$t=t=>om.test(t),Ei=()=>!0,lm=t=>rm.test(t)&&!am.test(t),ya=()=>!1,cm=t=>sm.test(t),dm=t=>im.test(t),um=t=>!le(t)&&!ce(t),fm=t=>nn(t,Ni,ya),le=t=>Ci.test(t),pn=t=>nn(t,Mi,lm),_i=t=>nn(t,km,Ce),mm=t=>nn(t,Ti,Ei),hm=t=>nn(t,Pi,ya),Si=t=>nn(t,Vi,ya),pm=t=>nn(t,Di,dm),jo=t=>nn(t,vi,cm),ce=t=>Bi.test(t),no=t=>gn(t,Mi),gm=t=>gn(t,Pi),Ai=t=>gn(t,Vi),bm=t=>gn(t,Ni),ym=t=>gn(t,Di),Uo=t=>gn(t,vi,!0),xm=t=>gn(t,Ti,!0),nn=(t,n,o)=>{const r=Ci.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},gn=(t,n,o=!1)=>{const r=Bi.exec(t);return r?r[1]?n(r[1]):o:!1},Vi=t=>t==="position"||t==="percentage",Di=t=>t==="image"||t==="url",Ni=t=>t==="length"||t==="size"||t==="bg-size",Mi=t=>t==="length",km=t=>t==="number",Pi=t=>t==="family-name",Ti=t=>t==="number"||t==="weight",vi=t=>t==="shadow",wm=em(()=>{const t=Ye("color"),n=Ye("font"),o=Ye("text"),r=Ye("font-weight"),a=Ye("tracking"),s=Ye("leading"),i=Ye("breakpoint"),l=Ye("container"),c=Ye("spacing"),d=Ye("radius"),u=Ye("shadow"),f=Ye("inset-shadow"),m=Ye("text-shadow"),h=Ye("drop-shadow"),k=Ye("blur"),C=Ye("perspective"),w=Ye("aspect"),p=Ye("ease"),A=Ye("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],S=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],V=()=>[...S(),ce,le],B=()=>["auto","hidden","clip","visible","scroll"],g=()=>["auto","contain","none"],b=()=>[ce,le,c],_=()=>[en,"full","auto",...b()],y=()=>[tn,"none","subgrid",ce,le],x=()=>["auto",{span:["full",tn,ce,le]},tn,ce,le],E=()=>[tn,"auto",ce,le],M=()=>["auto","min","max","fr",ce,le],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],$=()=>["start","end","center","stretch","center-safe","end-safe"],v=()=>["auto",...b()],I=()=>[en,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],j=()=>[en,"screen","full","dvw","lvw","svw","min","max","fit",...b()],U=()=>[en,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],P=()=>[t,ce,le],R=()=>[...S(),Ai,Si,{position:[ce,le]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",bm,fm,{size:[ce,le]}],W=()=>[ba,no,pn],Z=()=>["","none","full",d,ce,le],ne=()=>["",Ce,no,pn],ue=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Ce,ba,Ai,Si],X=()=>["","none",k,ce,le],O=()=>["none",Ce,ce,le],K=()=>["none",Ce,ce,le],ee=()=>[Ce,ce,le],he=()=>[en,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$t],breakpoint:[$t],color:[Ei],container:[$t],"drop-shadow":[$t],ease:["in","out","in-out"],font:[um],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$t],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$t],shadow:[$t],spacing:["px",Ce],text:[$t],"text-shadow":[$t],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",en,le,ce,w]}],container:["container"],columns:[{columns:[Ce,le,ce,l]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:V()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:g()}],"overscroll-x":[{"overscroll-x":g()}],"overscroll-y":[{"overscroll-y":g()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:_()}],"inset-x":[{"inset-x":_()}],"inset-y":[{"inset-y":_()}],start:[{"inset-s":_(),start:_()}],end:[{"inset-e":_(),end:_()}],"inset-bs":[{"inset-bs":_()}],"inset-be":[{"inset-be":_()}],top:[{top:_()}],right:[{right:_()}],bottom:[{bottom:_()}],left:[{left:_()}],visibility:["visible","invisible","collapse"],z:[{z:[tn,"auto",ce,le]}],basis:[{basis:[en,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,en,"auto","initial","none",le]}],grow:[{grow:["",Ce,ce,le]}],shrink:[{shrink:["",Ce,ce,le]}],order:[{order:[tn,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:x()}],"col-start":[{"col-start":E()}],"col-end":[{"col-end":E()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:x()}],"row-start":[{"row-start":E()}],"row-end":[{"row-end":E()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":M()}],"auto-rows":[{"auto-rows":M()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...$(),"normal"]}],"justify-self":[{"justify-self":["auto",...$()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...$(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...$(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...$(),"baseline"]}],"place-self":[{"place-self":["auto",...$()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:v()}],mx:[{mx:v()}],my:[{my:v()}],ms:[{ms:v()}],me:[{me:v()}],mbs:[{mbs:v()}],mbe:[{mbe:v()}],mt:[{mt:v()}],mr:[{mr:v()}],mb:[{mb:v()}],ml:[{ml:v()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],"inline-size":[{inline:["auto",...j()]}],"min-inline-size":[{"min-inline":["auto",...j()]}],"max-inline-size":[{"max-inline":["none",...j()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[l,"screen",...I()]}],"min-w":[{"min-w":[l,"screen","none",...I()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",o,no,pn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xm,mm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ba,le]}],"font-family":[{font:[gm,hm,n]}],"font-features":[{"font-features":[le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ce,le]}],"line-clamp":[{"line-clamp":[Ce,"none",ce,_i]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ce,pn]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ce,"auto",ce,le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:R()}],"bg-repeat":[{bg:G()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tn,ce,le],radial:["",ce,le],conic:[tn,ce,le]},ym,pm]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ce,le]}],"outline-w":[{outline:["",Ce,no,pn]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Uo,jo]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",f,Uo,jo]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ce,pn]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",m,Uo,jo]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ce,ce,le]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":S()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:R()}],"mask-repeat":[{mask:G()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:X()}],brightness:[{brightness:[Ce,ce,le]}],contrast:[{contrast:[Ce,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",h,Uo,jo]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ce,ce,le]}],"hue-rotate":[{"hue-rotate":[Ce,ce,le]}],invert:[{invert:["",Ce,ce,le]}],saturate:[{saturate:[Ce,ce,le]}],sepia:[{sepia:["",Ce,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}],"backdrop-blur":[{"backdrop-blur":X()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ce,le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ce,le]}],ease:[{ease:["linear","initial",p,ce,le]}],delay:[{delay:[Ce,ce,le]}],animate:[{animate:["none",A,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ce,le]}],"perspective-origin":[{"perspective-origin":V()}],rotate:[{rotate:O()}],"rotate-x":[{"rotate-x":O()}],"rotate-y":[{"rotate-y":O()}],"rotate-z":[{"rotate-z":O()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:V()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,le]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ce,no,pn,_i]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function _e(...t){return wm(hi(t))}function Oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xa={},ka={},Wo={exports:{}},Fi;function Cm(){if(Fi)return Wo.exports;Fi=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return Wo.exports=n(),Wo.exports.createColors=n,Wo.exports}var zi;function Bm(){return zi||(zi=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a(Cm());function a(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&n.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(m=>console.warn(d,"-",m)))}function l(d){return r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(ka)),ka}var Ri;function Em(){return Ri||(Ri=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Bm());function o(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:i,to:l}){n.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(xa)),xa}var wa,Ii;function _m(){if(Ii)return wa;Ii=1;let t=Em();return wa=(t.__esModule?t:{default:t}).default,wa}var Sm=_m();const Am=Oi(Sm),Vm=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},Dm=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),Nm=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):Dm(t),bn=(t,n)=>{if(!t)return null;if(n[t])return n[t];const o=t.split(/[-_]/).map(r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join("");return n[o]||null},Li=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$i=hi,Ho=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return $i(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const m=Li(u)||Li(f);return a[d][m]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(k=>{let[C,w]=k;return Array.isArray(w)?w.includes({...s,...l}[C]):{...s,...l}[C]===w})?[...d,f,m]:d},[]);return $i(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},_t=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(_e)(e.unref(On)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),On=Ho("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ji=e.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=fe.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(fe.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Ui=e.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(fe.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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 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",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Wi=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Hi=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Mm={class:"relative z-10"},Pm="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",Tm=e.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>bn(o.icon,At)),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const q=String(o.variant||"default").toLowerCase();return q==="tonal"?"secondary":q==="elevated"?"default":q}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:q,...W}=n;return W}),u=e.computed(()=>_e(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),m=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),h=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),k=e.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),C=e.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),w=e.computed(()=>_e("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",k.value,m.value,h.value,f.value)),p=e.computed(()=>{const W=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),A=e.computed(()=>{const W=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),D=e.computed(()=>!!p.value),S=e.computed(()=>/\bborder-/.test(u.value??"")),V=e.computed(()=>/\bhover:/.test(u.value??"")),B=e.computed(()=>{const q=u.value??"";return i.value!=="outline"?q:q.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),g=e.ref(null),b=q=>{const W=q.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return W?{r:Number(W[1]),g:Number(W[2]),b:Number(W[3]),a:W[4]?Number(W[4]):1}:null},_=(q,W)=>{const Z=b(q);if(!Z)return q;const ne=ue=>Math.max(0,Math.min(255,Math.round(ue)));return`rgba(${ne(Z.r*(1-W))}, ${ne(Z.g*(1-W))}, ${ne(Z.b*(1-W))}, ${Z.a})`},y=q=>{if(globalThis.window===void 0)return null;const W=document.createElement("div");W.className=q,W.style.position="absolute",W.style.visibility="hidden",W.style.pointerEvents="none",W.style.width="1px",W.style.height="1px",document.body.appendChild(W);const Z=globalThis.getComputedStyle(W).backgroundColor;return W.remove(),!Z||Z==="transparent"||Z==="rgba(0, 0, 0, 0)"?null:Z},x=[50,100,200,300,400,500,600,700,800,900,950],E=q=>{const W=x.indexOf(q);return W===-1?q:x[Math.min(x.length-1,W+2)]},M=(q,W)=>{const Z=Am[q];if(!Z)return null;if(typeof Z=="string")return Z;if(!W)return null;const ne=Z[W];return typeof ne=="string"?ne:null},T=(q,W=!1)=>{if(!q)return null;const Z=W?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ne=q.match(Z);return ne?{colorName:ne[1],shade:ne[2]?Number.parseInt(ne[2],10):null}:null},$=()=>{const q=p.value;if(!q){g.value=null;return}const W=T(q),Z=W==null?void 0:W.colorName,ne=(W==null?void 0:W.shade)??null,ue=(Z?M(Z,ne):null)??y(q);if(!ue){g.value=null;return}let ke;const me=T(A.value,!0),X=me?M(me.colorName,me.shade??null):null;if(X)ke=X;else if(Z&&ne){const O=E(ne);ke=M(Z,O)??_(ue,.2)}else ke=_(ue,.2);g.value={"--btn-color":ue,"--btn-color-hover":ke}};e.onMounted(()=>{$()}),e.watch([p,A],async()=>{await e.nextTick(),$()});const v=e.computed(()=>{const q=/\bdark:bg-/.test(u.value??"");return!D.value||i.value==="outline"||q?"":g.value?"dcode-btn--fill dcode-btn--fill-hover":V.value?"":"hover:brightness-90"}),I=e.computed(()=>{if(!D.value||i.value!=="outline")return"";const q=["dcode-btn--outline","dcode-btn--outline-hover"];return S.value||q.push("border"),!g.value&&!V.value&&q.push("hover:brightness-90"),q.join(" ")}),j=e.computed(()=>g.value??void 0),U={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},P={"gradient-blue":{bg:"bg-gradient-to-r from-blue-500 to-cyan-500",text:"text-white",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",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",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",hover:"hover:from-emerald-600 hover:to-teal-600"}},R=e.computed(()=>{const q=[],W=l.value,Z=String(o.borderColor||"").toLowerCase(),ne=W?U[W]:null,ue=W?P[W]:null,ke=Z?U[Z]:null;return W&&(ne?ke&&Z!==W?(q.push(ne.bg,ke.hoverBg),o.textColor||q.push(ne.text,ke.hoverText)):(q.push(ne.bg,ne.hoverBg),o.textColor||q.push(ne.text,ne.hoverText)):ue?(q.push(ue.bg,ue.hover),o.textColor||q.push(ue.text)):W==="transparent"?ke?(q.push("bg-transparent",ke.hoverBg),o.textColor||q.push("text-inherit",ke.hoverText)):q.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):q.push(W)),Z?ke?q.push(ke.border,ke.hoverBorder):q.push(Z):ne&&i.value!=="ghost"&&i.value!=="link"&&q.push(ne.border,ne.hoverBorder),o.textColor&&q.push(o.textColor),q.join(" ")}),G=e.computed(()=>_e(Pm,k.value,C.value,B.value,v.value,I.value,R.value));return(q,W)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(w.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(Wi),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(ji),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(Hi),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(_t),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:G.value,style:j.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(Ui),{side:"top","side-offset":8,class:"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 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:e.withCtx(()=>[e.createElementVNode("span",Mm,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(_t),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:G.value,style:j.value},d.value),{default:e.withCtx(()=>[e.renderSlot(q.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),at=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Le=at(Tm,[["__scopeId","data-v-c123cb99"]]),vm={key:0,class:"flex items-center justify-between bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 px-4 py-3 backdrop-blur-sm"},Om={class:"flex flex-col gap-1"},Fm={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},zm={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},Rm={key:0,class:"flex items-center gap-2"},Im={name:"DCodeCard"},qi=e.defineComponent({...Im,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-700";case 3:return"bg-neutral-100 dark:bg-neutral-600";case 1:default:return"bg-white dark:bg-neutral-800"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200/60 dark:border-neutral-700/50":t.border&&t.level===1},{"border-neutral-300/60 dark:border-neutral-600/50":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",vm,[e.createElementVNode("div",Om,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",Fm,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",zm,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Rm,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200/60 dark:border-neutral-700/50",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),Lm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},$m={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},jm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Um={class:"flex items-center justify-between"},Wm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Hm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},qm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},Gm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},Km={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Xm={class:"flex items-center justify-between"},Ym={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Jm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},Qm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Ca=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=gt.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,f=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=f,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",Lm,[e.createElementVNode("div",$m,[e.createElementVNode("div",jm,[e.createElementVNode("div",Um,[e.createElementVNode("h3",Wm,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",Hm,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",qm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",Gm,[e.createElementVNode("div",Km,[e.createElementVNode("div",Xm,[e.createElementVNode("h3",Ym,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",Jm,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",Qm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),Zm=["aria-busy"],eh={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},th={key:1,class:"flex justify-end"},nh=["for"],oh={key:0,class:"ml-1 text-destructive"},rh={class:"relative w-full group"},ah={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},sh={key:1},ih=["id","value","placeholder"],lh={key:1,class:"absolute inset-y-0 right-4 flex items-center"},ch={key:2,class:"absolute inset-y-0 right-4 flex items-center"},dh={key:3,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"},uh={key:1,class:"text-xs text-destructive"},Fn=e.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var O;return((O=l.valueType)==null?void 0:O.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=e.computed(()=>{const O=o.required,K=o["aria-required"];return O===""||O===!0||O==="true"||(K==="true"||K===!0)}),m=e.computed(()=>{const{label:O,class:K,id:ee,required:he,"aria-required":Ve,...Ne}=o;return Ne}),h=e.computed(()=>{var K,ee;const O={...m.value};return((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&(O.type="text",O.inputmode="numeric",O.pattern="[0-9]*"),((ee=l.valueType)==null?void 0:ee.toLowerCase())==="email"&&(O.type="email",O.inputmode="email"),r.value&&(O.type=a.value?"text":"password"),l.disabled&&(O.disabled=!0),l.maxLength&&(O.maxlength=l.maxLength),l.minLength&&(O.minlength=l.minLength),l.maxValue&&(O.max=l.maxValue),l.minValue&&(O.min=l.minValue),O}),k=e.computed(()=>{const O=l.modelValue;return O==null||String(O).length===0}),C=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!k.value:!0:!1),w=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,O=>{const K=String(O??"");K!==p.value&&(p.value=K)});const A=e.ref(!1),D=e.ref(!1),S=O=>O.split(/(\s+)/).map(K=>{if(K.trim()==="")return K;const ee=K.toLowerCase();return ee.charAt(0).toUpperCase()+ee.slice(1)}).join(""),V=O=>{const K=O.toLowerCase(),ee=K.search(new RegExp("\\p{L}","u"));return ee<0?K:K.slice(0,ee)+K.charAt(ee).toUpperCase()+K.slice(ee+1)},B=O=>{switch(l.textCase){case"uppercase":return O.toUpperCase();case"lowercase":return O.toLowerCase();case"titlecase":return S(O);case"sentencecase":return V(O);case"none":default:return O}},g=O=>{if(!O)return null;const K=Array.isArray(O)?O.join(""):O;return K?new Set(K):null},b=e.computed(()=>g(l.allowChars)),_=(O,K)=>(O.lastIndex=0,O.test(K)),y=O=>{var Re;const K=(Re=l.valueType)==null?void 0:Re.toLowerCase();if(K==="free"||K==="email"||K==="password")return!0;const ee=O===" ",he=/\d/.test(O),Ve=new RegExp("\\p{L}","u").test(O),Ne=new RegExp("\\p{N}","u").test(O),ze=/[\/\-_.,]/.test(O);return K==="number"?he:K==="letter"?Ve||ze||l.allowSpaces&&ee:K==="letternumber"?Ve||Ne||ze||l.allowSpaces&&ee:!0},x=O=>{let K="";for(const ee of O){const he=!!b.value&&b.value.has(ee);l.pattern&&!he&&!_(l.pattern,ee)||!he&&!y(ee)||(K+=ee)}return K},E=e.computed(()=>{const O=l.maxLength??o.maxlength??o.maxLength;let K=Number.NaN;return typeof O=="number"?K=O:typeof O=="string"&&(K=Number.parseInt(O,10)),Number.isFinite(K)&&K>0?K:-1}),M=e.computed(()=>p.value.length),T=e.computed(()=>l.showCharCount?E.value>0:!1),$=O=>E.value>0?O.slice(0,E.value):O,v=O=>{const K=x(O),ee=l.applyTextCaseToValue?B(K):K;return $(ee)};let I=null;const j=O=>{var K;if(O==="")return null;if(((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&l.returnNumber){const ee=Number(O);return Number.isFinite(ee)?ee:null}return O},U=O=>{p.value=O,i("update:modelValue",j(O))},P=(O,K)=>{const ee=$(K);D.value=!0,O.value=ee,U(ee),queueMicrotask(()=>D.value=!1)},R=(O,K)=>{const ee=O.selectionStart??O.value.length,he=O.selectionEnd??O.value.length;if(E.value>0){const Ve=O.value.length-(he-ee),Ne=E.value-Ve;if(Ne<=0)return;K=K.slice(0,Ne)}O.setRangeText(K,ee,he,"end"),P(O,v(O.value))},G=O=>{var he;if(!I||A.value||D.value||!((he=O.inputType)!=null&&he.startsWith("insert")))return;const K=O.data;if(K==null)return;const ee=v(K);ee!==K&&(O.preventDefault(),ee.length>0&&R(I,ee))},q=O=>{var he;if(!I||A.value||D.value)return;const K=((he=O.clipboardData)==null?void 0:he.getData("text"))??"",ee=v(K);ee!==K&&(O.preventDefault(),ee.length>0&&R(I,ee))},W=O=>{if(!I||A.value||D.value)return;const K=O.target,ee=K.value??"",he=v(ee);he===ee?U(he):P(K,he)},Z=()=>A.value=!0,ne=()=>{if(A.value=!1,!I)return;const O=I.value??"",K=v(O);K===O?U(K):P(I,K)};e.onMounted(()=>{if(I=document.getElementById(u.value),!I)return;I.addEventListener("beforeinput",G),I.addEventListener("paste",q),I.addEventListener("input",W),I.addEventListener("compositionstart",Z),I.addEventListener("compositionend",ne);const O=I.value??"",K=v(O);K===O?U(K):P(I,K)}),e.onBeforeUnmount(()=>{I&&(I.removeEventListener("beforeinput",G),I.removeEventListener("paste",q),I.removeEventListener("input",W),I.removeEventListener("compositionstart",Z),I.removeEventListener("compositionend",ne),I=null)});const ue=()=>{p.value="",I&&(I.value=""),i("update:modelValue",null),i("clear")},ke=e.computed(()=>T.value&&M.value>0),me=e.computed(()=>`${M.value} / ${E.value}`),X=e.computed(()=>!!l.error);return(O,K)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",eh)):e.createCommentVNode("",!0),K[1]||(K[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),T.value?(e.openBlock(),e.createElementBlock("div",th,[...K[0]||(K[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),f.value?(e.openBlock(),e.createElementBlock("span",oh,"*")):e.createCommentVNode("",!0)],8,nh)):e.createCommentVNode("",!0),e.createElementVNode("div",rh,[l.icon||l.prependInner||O.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",ah,[e.renderSlot(O.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",sh,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},h.value,{placeholder:l.placeholder,style:`text-transform: ${w.value}; padding-left: ${l.icon||l.prependInner||O.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${C.value||r.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 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",X.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,ih),r.value?(e.openBlock(),e.createElementBlock("div",lh,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(te.Eye):e.unref(te.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),C.value&&!r.value?(e.openBlock(),e.createElementBlock("div",ch,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:ue}," ✕ ")])):e.createCommentVNode("",!0),ke.value&&!X.value?(e.openBlock(),e.createElementBlock("p",dh,e.toDisplayString(me.value),1)):e.createCommentVNode("",!0)]),X.value?(e.openBlock(),e.createElementBlock("p",uh,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,Zm)),[[e.vShow,t.visible]])}}),fh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},mh={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},hh={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},ph={class:"flex items-center justify-between"},gh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},bh={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm"},yh={class:"p-6 flex-1"},xh={class:"flex flex-col gap-4"},kh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},wh={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Ch={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Bh={class:"flex items-center justify-between"},Eh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},_h={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/30 shadow-sm"},Sh={class:"p-6 flex-1"},Ah={class:"flex flex-col gap-4"},Vh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ba=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=gt.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",fh,[e.createElementVNode("div",mh,[e.createElementVNode("div",hh,[e.createElementVNode("div",ph,[e.createElementVNode("h3",gh,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",bh,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",yh,[e.createElementVNode("div",xh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(Fn,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",kh)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",wh,[e.createElementVNode("div",Ch,[e.createElementVNode("div",Bh,[e.createElementVNode("h3",Eh,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",_h,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Sh,[e.createElementVNode("div",Ah,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(Fn,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",Vh,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
|
|
1
|
+
(function(ae,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(ae=typeof globalThis<"u"?globalThis:ae||self,e(ae.DynamicUI={},ae.Vue,ae.LucideIcons,ae.rekaUi,ae.core,ae.VueI18n,ae.VueDatePicker,ae.Uppy,ae.UppyDashboard,ae.UppyImageEditor,ae.VueRouter,ae.Vue3Lottie))})(this,(function(ae,e,te,me,We,bt,Qd,Zd,Us,eu,un,tu){"use strict";var VA=Object.defineProperty;var DA=(ae,e,te)=>e in ae?VA(ae,e,{enumerable:!0,configurable:!0,writable:!0,value:te}):ae[e]=te;var de=(ae,e,te)=>DA(ae,typeof e!="symbol"?e+"":e,te);var Hr;function nu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Vt=nu(te);let Bt={};function Ws(t){Bt={...Bt,...t}}function ou(){return Bt}function ru(){return Bt.apiBaseUrl?Bt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function au(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Bt.getAuthToken?n=Bt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),Bt.getHeaders){const o=Bt.getHeaders();return{...t,...o}}return t}function su(){Bt.onUnauthorized&&Bt.onUnauthorized()}async function iu(t,n,o,r){const a=ou();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(n||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${n}' tidak valid, fallback ke 'GET'.`);const c=ru(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...au(),...r||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const x=new URLSearchParams;Object.entries(o).forEach(([y,p])=>{p!=null&&x.append(y,String(p))});const C=x.toString();C&&(f=`${d}${d.includes("?")?"&":"?"}${C}`)}const m=await fetch(f,u);if(m.status===401&&su(),!m.ok){const x=await m.text();throw new Error(`HTTP ${m.status}: ${x}`)}return(m.headers.get("content-type")||"").includes("application/json")?m.json():{status:!0,data:await m.text()}}function Ke(){const t=(n,o,r,a)=>{let s=n,i=o,l=r,c=a;return a&&typeof a=="object"?(a._url&&(s=a._url,i=a._method||i||"POST",a._data&&(l={...l||{},...a._data})),a.headers&&(c=a.headers)):n&&o&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(o.toUpperCase())||(s=`${n.endsWith("/")?n.slice(0,-1):n}/${o}`,i="POST")),iu(s,i,l,c)};return{apiUrl:t,DCodeApi:t}}const Mn=Math.min,dt=Math.max,Po=Math.round,To=Math.floor,Dt=t=>({x:t,y:t}),lu={left:"right",right:"left",bottom:"top",top:"bottom"};function Hs(t,n,o){return dt(t,Mn(n,o))}function Jn(t,n){return typeof t=="function"?t(n):t}function Qt(t){return t.split("-")[0]}function Qn(t){return t.split("-")[1]}function qs(t){return t==="x"?"y":"x"}function Gs(t){return t==="y"?"height":"width"}function Rt(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function Ks(t){return qs(Rt(t))}function cu(t,n,o){o===void 0&&(o=!1);const r=Qn(t),a=Ks(t),s=Gs(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=vo(i)),[i,vo(i)]}function du(t){const n=vo(t);return[ta(t),n,ta(n)]}function ta(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const Xs=["left","right"],Ys=["right","left"],uu=["top","bottom"],fu=["bottom","top"];function mu(t,n,o){switch(t){case"top":case"bottom":return o?n?Ys:Xs:n?Xs:Ys;case"left":case"right":return n?uu:fu;default:return[]}}function hu(t,n,o,r){const a=Qn(t);let s=mu(Qt(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(ta)))),s}function vo(t){const n=Qt(t);return lu[n]+t.slice(n.length)}function pu(t){return{top:0,right:0,bottom:0,left:0,...t}}function gu(t){return typeof t!="number"?pu(t):{top:t,right:t,bottom:t,left:t}}function Oo(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function Js(t,n,o){let{reference:r,floating:a}=t;const s=Rt(n),i=Ks(n),l=Gs(i),c=Qt(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let h;switch(c){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Qn(n)){case"start":h[i]-=m*(o&&d?-1:1);break;case"end":h[i]+=m*(o&&d?-1:1);break}return h}async function bu(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:h=0}=Jn(n,t),x=gu(h),y=l[m?f==="floating"?"reference":"floating":f],p=Oo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(y)))==null||o?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),S=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,V=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),E=await(s.isElement==null?void 0:s.isElement(V))?await(s.getScale==null?void 0:s.getScale(V))||{x:1,y:1}:{x:1,y:1},A=Oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:S,offsetParent:V,strategy:c}):S);return{top:(p.top-A.top+x.top)/E.y,bottom:(A.bottom-p.bottom+x.bottom)/E.y,left:(p.left-A.left+x.left)/E.x,right:(A.right-p.right+x.right)/E.x}}const yu=50,xu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:bu},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:f}=Js(d,r,c),m=r,h=0;const x={};for(let C=0;C<s.length;C++){const y=s[C];if(!y)continue;const{name:p,fn:S}=y,{x:V,y:E,data:A,reset:k}=await S({x:u,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:x,rects:d,platform:l,elements:{reference:t,floating:n}});u=V??u,f=E??f,x[p]={...x[p],...A},k&&h<yu&&(h++,typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(d=k.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):k.rects),{x:u,y:f}=Js(d,m,c)),C=-1)}return{x:u,y:f,placement:m,strategy:a,middlewareData:x}},ku=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:C=!0,...y}=Jn(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=Qt(a),S=Rt(l),V=Qt(l)===l,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),A=m||(V||!C?[vo(l)]:du(l)),k=x!=="none";!m&&k&&A.push(...hu(l,C,x,E));const g=[l,...A],b=await c.detectOverflow(n,y),M=[];let w=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&M.push(b[p]),f){const N=cu(a,i,E);M.push(b[N[0]],b[N[1]])}if(w=[...w,{placement:a,overflows:M}],!M.every(N=>N<=0)){var _,B;const N=(((_=s.flip)==null?void 0:_.index)||0)+1,O=g[N];if(O&&(!(f==="alignment"?S!==Rt(O):!1)||w.every($=>Rt($.placement)===S?$.overflows[0]>0:!0)))return{data:{index:N,overflows:w},reset:{placement:O}};let v=(B=w.filter(L=>L.overflows[0]<=0).sort((L,$)=>L.overflows[1]-$.overflows[1])[0])==null?void 0:B.placement;if(!v)switch(h){case"bestFit":{var D;const L=(D=w.filter($=>{if(k){const U=Rt($.placement);return U===S||U==="y"}return!0}).map($=>[$.placement,$.overflows.filter(U=>U>0).reduce((U,P)=>U+P,0)]).sort(($,U)=>$[1]-U[1])[0])==null?void 0:D[0];L&&(v=L);break}case"initialPlacement":v=l;break}if(a!==v)return{reset:{placement:v}}}return{}}}},wu=new Set(["left","top"]);async function Cu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=Qt(o),l=Qn(o),c=Rt(o)==="y",d=wu.has(i)?-1:1,u=s&&c?-1:1,f=Jn(n,t);let{mainAxis:m,crossAxis:h,alignmentAxis:x}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof x=="number"&&(h=l==="end"?x*-1:x),c?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Bu=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await Cu(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Eu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:S,y:V}=p;return{x:S,y:V}}},...d}=Jn(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),m=Rt(Qt(a)),h=qs(m);let x=u[h],C=u[m];if(i){const p=h==="y"?"top":"left",S=h==="y"?"bottom":"right",V=x+f[p],E=x-f[S];x=Hs(V,x,E)}if(l){const p=m==="y"?"top":"left",S=m==="y"?"bottom":"right",V=C+f[p],E=C-f[S];C=Hs(V,C,E)}const y=c.fn({...n,[h]:x,[m]:C});return{...y,data:{x:y.x-o,y:y.y-r,enabled:{[h]:i,[m]:l}}}}}},_u=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=Jn(t,n),u=await i.detectOverflow(n,d),f=Qt(a),m=Qn(a),h=Rt(a)==="y",{width:x,height:C}=s.floating;let y,p;f==="top"||f==="bottom"?(y=f,p=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,y=m==="end"?"top":"bottom");const S=C-u.top-u.bottom,V=x-u.left-u.right,E=Mn(C-u[y],S),A=Mn(x-u[p],V),k=!n.middlewareData.shift;let g=E,b=A;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=V),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(g=S),k&&!m){const w=dt(u.left,0),_=dt(u.right,0),B=dt(u.top,0),D=dt(u.bottom,0);h?b=x-2*(w!==0||_!==0?w+_:dt(u.left,u.right)):g=C-2*(B!==0||D!==0?B+D:dt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:g});const M=await i.getDimensions(l.floating);return x!==M.width||C!==M.height?{reset:{rects:!0}}:{}}}};function Fo(){return typeof window<"u"}function fn(t){return na(t)?(t.nodeName||"").toLowerCase():"#document"}function ut(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Nt(t){var n;return(n=(na(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function na(t){return Fo()?t instanceof Node||t instanceof ut(t).Node:!1}function Et(t){return Fo()?t instanceof Element||t instanceof ut(t).Element:!1}function Lt(t){return Fo()?t instanceof HTMLElement||t instanceof ut(t).HTMLElement:!1}function Qs(t){return!Fo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ut(t).ShadowRoot}function Zn(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=_t(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function Su(t){return/^(table|td|th)$/.test(fn(t))}function zo(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Au=/transform|translate|scale|rotate|perspective|filter/,Vu=/paint|layout|strict|content/,mn=t=>!!t&&t!=="none";let oa;function ra(t){const n=Et(t)?_t(t):t;return mn(n.transform)||mn(n.translate)||mn(n.scale)||mn(n.rotate)||mn(n.perspective)||!aa()&&(mn(n.backdropFilter)||mn(n.filter))||Au.test(n.willChange||"")||Vu.test(n.contain||"")}function Du(t){let n=Zt(t);for(;Lt(n)&&!Pn(n);){if(ra(n))return n;if(zo(n))return null;n=Zt(n)}return null}function aa(){return oa==null&&(oa=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),oa}function Pn(t){return/^(html|body|#document)$/.test(fn(t))}function _t(t){return ut(t).getComputedStyle(t)}function Io(t){return Et(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Zt(t){if(fn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Qs(t)&&t.host||Nt(t);return Qs(n)?n.host:n}function Zs(t){const n=Zt(t);return Pn(n)?t.ownerDocument?t.ownerDocument.body:t.body:Lt(n)&&Zn(n)?n:Zs(n)}function eo(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=Zs(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=ut(a);if(s){const l=sa(i);return n.concat(i,i.visualViewport||[],Zn(a)?a:[],l&&o?eo(l):[])}else return n.concat(a,eo(a,[],o))}function sa(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ei(t){const n=_t(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=Lt(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=Po(o)!==s||Po(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function ia(t){return Et(t)?t:t.contextElement}function Tn(t){const n=ia(t);if(!Lt(n))return Dt(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=ei(n);let i=(s?Po(o.width):o.width)/r,l=(s?Po(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Nu=Dt(0);function ti(t){const n=ut(t);return!aa()||!n.visualViewport?Nu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Mu(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==ut(t)?!1:n}function hn(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=ia(t);let i=Dt(1);n&&(r?Et(r)&&(i=Tn(r)):i=Tn(t));const l=Mu(s,o,r)?ti(s):Dt(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(s){const m=ut(s),h=r&&Et(r)?ut(r):r;let x=m,C=sa(x);for(;C&&r&&h!==x;){const y=Tn(C),p=C.getBoundingClientRect(),S=_t(C),V=p.left+(C.clientLeft+parseFloat(S.paddingLeft))*y.x,E=p.top+(C.clientTop+parseFloat(S.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=V,d+=E,x=ut(C),C=sa(x)}}return Oo({width:u,height:f,x:c,y:d})}function Ro(t,n){const o=Io(t).scrollLeft;return n?n.left+o:hn(Nt(t)).left+o}function ni(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-Ro(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Pu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=Nt(r),l=n?zo(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=Dt(1);const u=Dt(0),f=Lt(r);if((f||!f&&!s)&&((fn(r)!=="body"||Zn(i))&&(c=Io(r)),f)){const h=hn(r);d=Tn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const m=i&&!f&&!s?ni(i,c):Dt(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:o.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Tu(t){return Array.from(t.getClientRects())}function vu(t){const n=Nt(t),o=Io(t),r=t.ownerDocument.body,a=dt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=dt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+Ro(t);const l=-o.scrollTop;return _t(r).direction==="rtl"&&(i+=dt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const oi=25;function Ou(t,n){const o=ut(t),r=Nt(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=aa();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Ro(r);if(d<=0){const u=r.ownerDocument,f=u.body,m=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,x=Math.abs(r.clientWidth-f.clientWidth-h);x<=oi&&(s-=x)}else d<=oi&&(s+=d);return{width:s,height:i,x:l,y:c}}function Fu(t,n){const o=hn(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=Lt(t)?Tn(t):Dt(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function ri(t,n,o){let r;if(n==="viewport")r=Ou(t,o);else if(n==="document")r=vu(Nt(t));else if(Et(n))r=Fu(n,o);else{const a=ti(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Oo(r)}function ai(t,n){const o=Zt(t);return o===n||!Et(o)||Pn(o)?!1:_t(o).position==="fixed"||ai(o,n)}function zu(t,n){const o=n.get(t);if(o)return o;let r=eo(t,[],!1).filter(l=>Et(l)&&fn(l)!=="body"),a=null;const s=_t(t).position==="fixed";let i=s?Zt(t):t;for(;Et(i)&&!Pn(i);){const l=_t(i),c=ra(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Zn(i)&&!c&&ai(t,i))?r=r.filter(u=>u!==i):a=l,i=Zt(i)}return n.set(t,r),r}function Iu(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?zo(n)?[]:zu(n,this._c):[].concat(o),r],l=ri(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let m=1;m<i.length;m++){const h=ri(n,i[m],a);c=dt(h.top,c),d=Mn(h.right,d),u=Mn(h.bottom,u),f=dt(h.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Ru(t){const{width:n,height:o}=ei(t);return{width:n,height:o}}function Lu(t,n,o){const r=Lt(n),a=Nt(n),s=o==="fixed",i=hn(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=Dt(0);function d(){c.x=Ro(a)}if(r||!r&&!s)if((fn(n)!=="body"||Zn(a))&&(l=Io(n)),r){const h=hn(n,!0,s,n);c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?ni(a,l):Dt(0),f=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:f,y:m,width:i.width,height:i.height}}function la(t){return _t(t).position==="static"}function si(t,n){if(!Lt(t)||_t(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return Nt(t)===o&&(o=o.ownerDocument.body),o}function ii(t,n){const o=ut(t);if(zo(t))return o;if(!Lt(t)){let a=Zt(t);for(;a&&!Pn(a);){if(Et(a)&&!la(a))return a;a=Zt(a)}return o}let r=si(t,n);for(;r&&Su(r)&&la(r);)r=si(r,n);return r&&Pn(r)&&la(r)&&!ra(r)?o:r||Du(t)||o}const $u=async function(t){const n=this.getOffsetParent||ii,o=this.getDimensions,r=await o(t.floating);return{reference:Lu(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ju(t){return _t(t).direction==="rtl"}const Uu={convertOffsetParentRelativeRectToViewportRelativeRect:Pu,getDocumentElement:Nt,getClippingRect:Iu,getOffsetParent:ii,getElementRects:$u,getClientRects:Tu,getDimensions:Ru,getScale:Tn,isElement:Et,isRTL:ju};function li(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function Wu(t,n){let o=null,r;const a=Nt(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:m,height:h}=d;if(l||n(),!m||!h)return;const x=To(f),C=To(a.clientWidth-(u+m)),y=To(a.clientHeight-(f+h)),p=To(u),V={rootMargin:-x+"px "+-C+"px "+-y+"px "+-p+"px",threshold:dt(0,Mn(1,c))||1};let E=!0;function A(k){const g=k[0].intersectionRatio;if(g!==c){if(!E)return i();g?i(!1,g):r=setTimeout(()=>{i(!1,1e-7)},1e3)}g===1&&!li(d,t.getBoundingClientRect())&&i(),E=!1}try{o=new IntersectionObserver(A,{...V,root:a.ownerDocument})}catch{o=new IntersectionObserver(A,V)}o.observe(t)}return i(!0),s}function ca(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=ia(t),u=a||s?[...d?eo(d):[],...n?eo(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?Wu(d,o):null;let m=-1,h=null;i&&(h=new ResizeObserver(p=>{let[S]=p;S&&S.target===d&&h&&n&&(h.unobserve(n),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var V;(V=h)==null||V.observe(n)})),o()}),d&&!c&&h.observe(d),n&&h.observe(n));let x,C=c?hn(t):null;c&&y();function y(){const p=hn(t);C&&!li(C,p)&&o(),C=p,x=requestAnimationFrame(y)}return o(),()=>{var p;u.forEach(S=>{a&&S.removeEventListener("scroll",o),s&&S.removeEventListener("resize",o)}),f==null||f(),(p=h)==null||p.disconnect(),h=null,c&&cancelAnimationFrame(x)}}const da=Bu,ua=Eu,fa=ku,ma=_u,Hu=(t,n,o)=>{const r=new Map,a={platform:Uu,...o},s={...a.platform,_c:r};return xu(t,n,{...a,platform:s})};function qu(t){return t!=null&&typeof t=="object"&&"$el"in t}function ci(t){if(qu(t)){const n=t.$el;return na(n)&&fn(n)==="#comment"?null:n}return t}function to(t){return typeof t=="function"?t():e.unref(t)}function di(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ui(t,n){const o=di(t);return Math.round(n*o)/o}function ha(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var g;return(g=to(o.open))!=null?g:!0}),s=e.computed(()=>to(o.middleware)),i=e.computed(()=>{var g;return(g=to(o.placement))!=null?g:"bottom"}),l=e.computed(()=>{var g;return(g=to(o.strategy))!=null?g:"absolute"}),c=e.computed(()=>{var g;return(g=to(o.transform))!=null?g:!0}),d=e.computed(()=>ci(t.value)),u=e.computed(()=>ci(n.value)),f=e.ref(0),m=e.ref(0),h=e.ref(l.value),x=e.ref(i.value),C=e.shallowRef({}),y=e.ref(!1),p=e.computed(()=>{const g={position:h.value,left:"0",top:"0"};if(!u.value)return g;const b=ui(u.value,f.value),M=ui(u.value,m.value);return c.value?{...g,transform:"translate("+b+"px, "+M+"px)",...di(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:b+"px",top:M+"px"}});let S;function V(){if(d.value==null||u.value==null)return;const g=a.value;Hu(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,m.value=b.y,h.value=b.strategy,x.value=b.placement,C.value=b.middlewareData,y.value=g!==!1})}function E(){typeof S=="function"&&(S(),S=void 0)}function A(){if(E(),r===void 0){V();return}if(d.value!=null&&u.value!=null){S=r(d.value,u.value,V);return}}function k(){a.value||(y.value=!1)}return e.watch([s,i,l,a],V,{flush:"sync"}),e.watch([d,u],A,{flush:"sync"}),e.watch(a,k,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(E),{x:e.shallowReadonly(f),y:e.shallowReadonly(m),strategy:e.shallowReadonly(h),placement:e.shallowReadonly(x),middlewareData:e.shallowReadonly(C),isPositioned:e.shallowReadonly(y),floatingStyles:p,update:V}}const Gu=["aria-busy"],Ku={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Xu=["for"],Yu={key:0,class:"ml-1 text-destructive"},Ju={class:"relative"},Qu={key:0,class:"flex items-center text-gray-500 gap-2"},Zu=["id","placeholder","disabled","readonly","value"],ef={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},tf=["disabled"],nf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},of=["onMouseenter","onClick"],rf={key:0},af={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},sf={key:0},lf={key:1},cf={key:2},df={key:1,class:"mt-1 text-xs text-red-600"},Lo=e.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=H=>{const re=a[H];return re===""||re===!0||re==="true"||re===1||re==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),f=e.computed(()=>i("required")),m=e.computed(()=>o.readonly||i("readonly")),h=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),x=e.computed(()=>f.value||i("aria-required")),C=e.computed(()=>o.error||o.errorMessage||a["error-message"]),y=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const H=a.minChars??a["min-chars"];if(H==null||H==="")return 0;const re=typeof H=="number"?H:Number.parseInt(String(H),10);return Number.isFinite(re)&&re>0?re:0}),S=e.computed(()=>{const H=a.rules;return Array.isArray(H)?H:[]}),V=e.computed(()=>{const H=a.id||a.label;return H?`app-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),E=e.ref(o.modelValue),A=e.ref([]),k=e.ref(!1),g=e.ref(!1),b=e.computed(()=>a.items),M=e.computed(()=>{const H=N.value;return H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems?A.value:b.value??[]}),w=e.computed(()=>!!a.loading),_=e.computed(()=>w.value||k.value),B=e.computed(()=>{const{label:H,items:re,loading:pe,rules:Re,"item-title":Ee,"item-value":Q,itemTitle:oe,itemValue:se,minChars:xe,"min-chars":He,clearable:zt,required:qr,"aria-required":zd,disabled:Gr,readonly:Id,visible:rt,"return-object":Rd,returnObject:Kr,class:Ld,"fetch-items":Xr,fetchItems:$d,error:$s,errorMessage:jd,"error-message":Ud,...Yr}=a||{};return Yr}),D=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},N=e.computed(()=>{const H=o.endpoint||{};return{apiModule:o.apiModule||H.apiModule,apiAction:o.apiAction||H.apiAction,apiUrl:H.apiUrl,apiMethod:H.apiMethod||"GET"}}),O=e.ref(null),v=e.ref(null),L=e.ref(null),{floatingStyles:$}=ha(v,L,{placement:"bottom-start",whileElementsMounted:ca,middleware:[da(4),fa(),ua(),ma({apply({rects:H,elements:re,availableHeight:pe}){Object.assign(re.floating.style,{width:`${H.reference.width}px`,maxHeight:`${pe}px`})}})]}),U=e.ref(!1),P=e.ref(""),F=e.ref(-1),X=e.ref(null),q=e.computed(()=>!p.value||(P.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),W=H=>{if(H==null)return"";if(typeof H=="string"||typeof H=="number")return String(H);const re=c.value;return typeof re=="function"?re(H):(H==null?void 0:H[re])??(H==null?void 0:H.name)??(H==null?void 0:H.nama)??(H==null?void 0:H.label)??(H==null?void 0:H.title)??"-"},Z=H=>{if(H==null)return null;if(typeof H=="string"||typeof H=="number")return H;const re=d.value;return typeof re=="function"?re(H):(H==null?void 0:H[re])??(H==null?void 0:H.id)??(H==null?void 0:H.value)??(H==null?void 0:H.code)??null},ne=e.computed(()=>{const H=E.value;if(H==null||H==="")return"";if(Array.isArray(H))return H.length?H.map(Re=>{if(h.value&&typeof Re=="object"||typeof Re=="object")return W(Re);const Ee=M.value.find(Q=>Z(Q)==Re);return Ee?W(Ee):String(Re)}).join(", "):"";if(typeof H=="object")return W(H);const re=M.value.find(pe=>Z(pe)==H);return re?W(re):String(H)}),ue=e.computed(()=>{const H=M.value||[],re=(P.value||"").trim().toLowerCase(),pe=(ne.value||"").toLowerCase(),Re=!re||re===pe;let Ee=H;if(Re||(Ee=H.filter(Q=>W(Q).toLowerCase().includes(re))),Ee.length>0){const Q=oe=>{const se=Z(oe);return Array.isArray(E.value)?E.value.some(xe=>xe==se):E.value==se};Ee=[...Ee].sort((oe,se)=>{const xe=Q(oe),He=Q(se);return xe&&!He?-1:!xe&&He?1:0})}return Ee}),ke=H=>Array.isArray(H)?H.length===0:H==null||H==="",fe=H=>{if(X.value=null,f.value&&ke(H)&&!S.value.length)return X.value="This field is required",!1;for(const re of S.value){const pe=re(H);if(pe===!1)return X.value="Invalid value",!1;if(typeof pe=="string")return X.value=pe,!1}return!0},K=async()=>{if(u.value||m.value)return;U.value=!0,F.value=ue.value.length?0:-1,P.value=ne.value||"";const H=N.value,re=H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems;o.autoFetchOnOpen&&re&&!g.value&&(await ze(),F.value=ue.value.length?0:-1)},z=()=>{U.value=!1,F.value=-1,P.value=ne.value||""},G=H=>{const re=h.value?H:Z(H);let pe=re;Array.isArray(E.value)&&(pe=[re]),E.value=pe,r("update:modelValue",pe),X.value=null,fe(pe),P.value=W(H),z()},ee=()=>{A.value=[],g.value=!1,E.value=Array.isArray(E.value)?[]:null,r("update:modelValue",E.value),P.value="",X.value=null},he=()=>{l.value=!0,ee(),z(),setTimeout(()=>{l.value=!1},0)},De=H=>{if(u.value||m.value)return;const re=H.target.value;P.value=re,X.value&&(X.value=null),U.value||(U.value=!0),F.value=ue.value.length?0:-1;const pe=N.value.apiModule&&N.value.apiAction||N.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&pe&&!_.value&&!g.value&&ze()},Ae=H=>{var pe;if(u.value||m.value)return;const re={ArrowDown:()=>{if(H.preventDefault(),!U.value){K();return}ue.value.length&&(F.value=Math.min(F.value+1,ue.value.length-1))},ArrowUp:()=>{!U.value||!ue.value.length||(H.preventDefault(),F.value=Math.max(F.value-1,0))},Enter:()=>{if(!U.value)return;H.preventDefault();const Re=ue.value[F.value];Re&&G(Re)},Escape:()=>{H.preventDefault(),z()},Tab:()=>{z()}};(pe=re[H.key])==null||pe.call(re)},ze=async()=>{const H=N.value;if(H.apiModule&&H.apiAction||H.apiUrl||o.fetchItems){k.value=!0;try{let pe;if(o.fetchItems){const Re=D()||{},Ee={page:1,perPage:100,search:(P.value||"").trim(),...Re,...o.apiParams},Q=await o.fetchItems(Ee),oe=(Q==null?void 0:Q.data)??Q;pe=(oe==null?void 0:oe.data)??oe}else{const Ee=Ke().DCodeApi;if(typeof Ee!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const oe={page:1,perPage:100,...D()||{},...o.apiParams};let se;H.apiUrl?se=await Ee("","",oe,{_url:H.apiUrl,_method:H.apiMethod||"POST"}):se=await Ee(H.apiModule,H.apiAction,oe);const xe=(se==null?void 0:se.data)??se;pe=(xe==null?void 0:xe.data)??xe}A.value=Array.isArray(pe)?pe:[],g.value=!0}catch(pe){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",pe),X.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(pe==null?void 0:pe.message)||(pe==null?void 0:pe.toString())||"Failed to load options"}`,A.value=[],g.value=!0}finally{k.value=!1}}},Ie=H=>{const re=Z(H);return h.value?E.value?Array.isArray(E.value)?E.value.some(pe=>Z(pe)==re):Z(E.value)==re:!1:Array.isArray(E.value)?E.value.some(pe=>pe==re):E.value==re};e.watch(()=>[D(),N.value,o.apiParams],([H,re,pe],[Re,Ee,Q])=>{const oe=N.value;if(!(oe.apiModule&&oe.apiAction||oe.apiUrl||o.fetchItems)){ee();return}const xe=JSON.stringify(H??null)===JSON.stringify(Re??null),He=JSON.stringify(pe??null)===JSON.stringify(Q??null);xe&&He||(ee(),He||ze())},{deep:!0}),e.watch(()=>o.modelValue,(H,re)=>{E.value=H,!l.value&&(H==null||H==="")&&re!=null&&o.apiModule&&o.apiAction&&(A.value=[],g.value=!1),P.value=ne.value||""},{immediate:!0});const Ue=N.value;(Ue.apiModule&&Ue.apiAction||Ue.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!ke(o.modelValue))&&ze();const Ze=H=>{const re=O.value,pe=L.value,Re=H.target;re&&re.contains(Re)||pe&&pe.contains(Re)||U.value&&z()},ct=e.computed(()=>{const H=o.modelValue;return H==null?!1:typeof H=="string"?H.trim().length>0:Array.isArray(H)?H.length>0:typeof H=="object"?Object.keys(H).length>0:!0}),At=e.computed(()=>!!o.clearable&&ct.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",Ze)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ze)}),(H,re)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:O,class:e.normalizeClass(["w-full",[e.unref(a).class,u.value?"cursor-not-allowed":""]]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",Ku)):e.createCommentVNode("",!0),re[6]||(re[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:V.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),x.value?(e.openBlock(),e.createElementBlock("span",Yu,"*")):e.createCommentVNode("",!0)],8,Xu)):e.createCommentVNode("",!0),e.createElementVNode("div",Ju,[e.createElementVNode("div",{ref_key:"reference",ref:v,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||m.value?"opacity-60 cursor-not-allowed":"",X.value||C.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||H.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",Qu,[e.renderSlot(H.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(B.value,{id:V.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||m.value?"cursor-not-allowed":"cursor-text"],placeholder:y.value,disabled:u.value,readonly:m.value,value:U.value?P.value:ne.value||P.value,onFocus:re[0]||(re[0]=()=>{U.value||K()}),onClick:re[1]||(re[1]=()=>{U.value||K()}),onInput:De,onKeydown:Ae,onBlur:re[2]||(re[2]=()=>fe(E.value))}),null,16,Zu),_.value?(e.openBlock(),e.createElementBlock("svg",ef,[...re[7]||(re[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):At.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:re[3]||(re[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(he,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||m.value,onClick:re[4]||(re[4]=pe=>U.value?z():K()),"aria-label":"Toggle"},[e.createVNode(e.unref(te.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":U.value}])},null,8,["class"])],8,tf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:L,style:e.normalizeStyle(e.unref($)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",nf,[ue.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ue.value,(pe,Re)=>(e.openBlock(),e.createElementBlock("button",{key:Z(pe)??Re,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Re===F.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ee=>F.value=Re,onMousedown:re[5]||(re[5]=e.withModifiers(()=>{},["prevent"])),onClick:Ee=>G(pe)},[e.createTextVNode(e.toDisplayString(W(pe))+" ",1),Ie(pe)?(e.openBlock(),e.createElementBlock("span",rf," ✓ ")):e.createCommentVNode("",!0)],42,of))),128)):e.renderSlot(H.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",af,[_.value?(e.openBlock(),e.createElementBlock("span",sf,"Loading data…")):q.value?(e.openBlock(),e.createElementBlock("span",lf,e.toDisplayString(q.value),1)):(e.openBlock(),e.createElementBlock("span",cf,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),X.value||C.value?(e.openBlock(),e.createElementBlock("p",df,e.toDisplayString(X.value||C.value),1)):e.createCommentVNode("",!0)],64))],10,Gu)),[[e.vShow,t.visible]])}}),uf=["aria-busy"],ff={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},mf=["for"],hf={key:0,class:"ml-1 text-destructive"},pf={class:"relative"},gf={key:0,class:"flex items-center text-gray-500 gap-2"},bf=["id","placeholder","disabled","value"],yf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},xf=["disabled"],kf={key:0,class:"p-3 space-y-2"},wf=["onMouseenter","onClick"],Cf={class:"flex items-center space-x-3"},Bf={class:"flex-1"},Ef={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},_f={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Sf={key:0},Af={key:2,class:"p-3 text-center"},Vf={class:"inline-flex items-center space-x-2"},Df={class:"text-sm text-gray-500"},Nf={key:3,class:"p-3 text-center"},Mf={class:"text-xs text-gray-400"},Pf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Tf={key:1,class:"mt-1 text-xs text-red-600"},vf={key:2,class:"mt-1 text-xs text-gray-500"},fi=e.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const F=o.label||o.placeholder;return F?`app-infinite-autocomplete-${F}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),m=e.ref([]),h=e.ref(!1),x=e.ref(!1),C=e.ref(-1),y=e.ref(1),p=e.ref(!0),S=e.ref(0),V=e.ref(),{floatingStyles:E}=ha(c,d,{placement:"bottom-start",whileElementsMounted:ca,middleware:[da(4),fa(),ua(),ma({apply({rects:F,elements:X}){Object.assign(X.floating.style,{width:`${F.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const A=e.computed(()=>f.value?m.value.filter(F=>M(F).toLowerCase().includes(f.value.toLowerCase())):m.value),k=e.computed(()=>{if(x.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return M(o.modelValue);{const F=m.value.find(X=>w(X)===o.modelValue);return F?M(F):String(o.modelValue)}}return""}),g=()=>{x.value=!0},b=()=>{x.value=!1},M=F=>typeof o.itemTitle=="function"?o.itemTitle(F):F[o.itemTitle]||"",w=F=>typeof o.itemValue=="function"?o.itemValue(F):F[o.itemValue]||F,_=F=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(F):F[o.itemSubtitle]||"":"",B=F=>o.modelValue?o.returnObject?w(F)===w(o.modelValue):w(F)===o.modelValue:!1,D=F=>{var q;const X=o.returnObject?F:w(F);r("update:modelValue",X),r("select",F),x.value=!1,f.value="",(q=s.value)==null||q.blur()},N=()=>{var F;r("update:modelValue",null),f.value="",(F=s.value)==null||F.focus()},O=F=>{x.value=!0,r("focus",F),o.autoFetchOnOpen&&!h.value&&(o.refreshOnOpen||m.value.length===0)&&P(!0)},v=F=>{setTimeout(()=>{x.value=!1,r("blur",F)},200)},L=F=>{const X=F.target;f.value=X.value,V.value&&clearTimeout(V.value),V.value=setTimeout(()=>{r("search",f.value),y.value=1,p.value=!0,P(!0)},o.debounceMs)},$=F=>{if(x.value)switch(F.key){case"ArrowDown":F.preventDefault(),C.value=Math.min(C.value+1,A.value.length-1);break;case"ArrowUp":F.preventDefault(),C.value=Math.max(C.value-1,0);break;case"Enter":F.preventDefault(),C.value>=0&&A.value[C.value]&&D(A.value[C.value]);break;case"Escape":x.value=!1;break}},U=F=>{if(!p.value||h.value)return;const X=F.target,{scrollTop:q,scrollHeight:W,clientHeight:Z}=X;q+Z>=W-o.threshold&&P()},P=async(F=!1)=>{var X,q;if(!h.value){h.value=!0;try{let W=[];if(o.fetchItems)W=await o.fetchItems();else{const Z=Ke(),ne=((X=o.endpoint)==null?void 0:X.apiModule)||o.apiModule,ue=((q=o.endpoint)==null?void 0:q.apiAction)||o.apiAction;if(!ne||!ue)throw new Error("API module and action are required");const ke={page:F?1:y.value,pageSize:o.pageSize,search:f.value,...o.apiParams},fe=await Z.apiUrl(`/${ne}/${ue}`,"GET",ke);W=fe.data||fe.items||fe||[],S.value=fe.total||fe.totalItems||W.length}F?(m.value=W,y.value=1):(m.value.push(...W),y.value++),p.value=W.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:W,page:y.value,hasMore:p.value,total:S.value})}catch(W){console.error("Error fetching items:",W),r("error",W)}finally{h.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&P()}),e.onUnmounted(()=>{V.value&&clearTimeout(V.value)}),e.watch(()=>o.modelValue,F=>{F||(f.value="")}),(F,X)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",ff)):e.createCommentVNode("",!0),X[3]||(X[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",hf,"*")):e.createCommentVNode("",!0)],8,mf)):e.createCommentVNode("",!0),e.createElementVNode("div",pf,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",gf,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},F.$attrs,{id:u.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:k.value,onFocus:O,onBlur:v,onInput:L,onKeydown:$}),null,16,bf),h.value?(e.openBlock(),e.createElementBlock("svg",yf,[...X[4]||(X[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:X[0]||(X[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(N,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.disabled,onClick:X[1]||(X[1]=q=>x.value?b():g()),"aria-label":"Toggle"},[e.createVNode(e.unref(te.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":x.value}])},null,8,["class"])],8,xf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[x.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(E)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:U},[h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",kf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,q=>e.createElementVNode("div",{key:q,class:"flex items-center space-x-3"},[...X[5]||(X[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):A.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,(q,W)=>(e.openBlock(),e.createElementBlock("button",{key:w(q)??W,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",W===C.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Z=>C.value=W,onMousedown:X[2]||(X[2]=e.withModifiers(()=>{},["prevent"])),onClick:Z=>D(q)},[e.renderSlot(F.$slots,"item",{item:q,index:W},()=>[e.createElementVNode("div",Cf,[e.createElementVNode("div",Bf,[e.createElementVNode("div",Ef,e.toDisplayString(M(q)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",_f,e.toDisplayString(_(q)),1)):e.createCommentVNode("",!0)])])]),B(q)?(e.openBlock(),e.createElementBlock("span",Sf," ✓ ")):e.createCommentVNode("",!0)],42,wf))),128)):e.createCommentVNode("",!0),h.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Af,[e.createElementVNode("div",Vf,[X[6]||(X[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Df,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Nf,[e.createElementVNode("div",Mf,e.toDisplayString(t.endOfResultsText),1)])):!h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",Pf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Tf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",vf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,uf)),[[e.vShow,t.visible]])}});function mi(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=mi(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function hi(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=mi(t))&&(r&&(r+=" "),r+=n);return r}const Of=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},Ff=(t,n)=>({classGroupId:t,validator:n}),pi=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),$o="-",gi=[],zf="arbitrary..",If=t=>{const n=Lf(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Rf(i);const l=i.split($o),c=l[0]===""&&l.length>1?1:0;return bi(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?Of(d,c):c:d||gi}return o[i]||gi}}},bi=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=bi(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join($o):t.slice(n).join($o),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Rf=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?zf+r:void 0})(),Lf=t=>{const{theme:n,classGroups:o}=t;return $f(o,n)},$f=(t,n)=>{const o=pi();for(const r in t){const a=t[r];pa(a,o,r,n)}return o},pa=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];jf(i,n,o,r)}},jf=(t,n,o,r)=>{if(typeof t=="string"){Uf(t,n,o);return}if(typeof t=="function"){Wf(t,n,o,r);return}Hf(t,n,o,r)},Uf=(t,n,o)=>{const r=t===""?n:yi(n,t);r.classGroupId=o},Wf=(t,n,o,r)=>{if(qf(t)){pa(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Ff(o,t))},Hf=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];pa(c,yi(n,l),o,r)}},yi=(t,n)=>{let o=t;const r=n.split($o),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=pi(),o.nextPart.set(i,l)),o=l}return o},qf=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Gf=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},ga="!",xi=":",Kf=[],ki=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),Xf=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let C=0;C<u;C++){const y=a[C];if(i===0&&l===0){if(y===xi){s.push(a.slice(c,C)),c=C+1;continue}if(y==="/"){d=C;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?a:a.slice(c);let m=f,h=!1;f.endsWith(ga)?(m=f.slice(0,-1),h=!0):f.startsWith(ga)&&(m=f.slice(1),h=!0);const x=d&&d>c?d-c:void 0;return ki(s,h,m,x)};if(n){const a=n+xi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):ki(Kf,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},Yf=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},Jf=t=>({cache:Gf(t.cacheSize),parseClassName:Xf(t),sortModifiers:Yf(t),...If(t)}),Qf=/\s+/,Zf=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(Qf);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:m,hasImportantModifier:h,baseClassName:x,maybePostfixModifierPosition:C}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let y=!!C,p=r(y?x.substring(0,C):x);if(!p){if(!y){c=u+(c.length>0?" "+c:c);continue}if(p=r(x),!p){c=u+(c.length>0?" "+c:c);continue}y=!1}const S=m.length===0?"":m.length===1?m[0]:s(m).join(":"),V=h?S+ga:S,E=V+p;if(i.indexOf(E)>-1)continue;i.push(E);const A=a(p,y);for(let k=0;k<A.length;++k){const g=A[k];i.push(V+g)}c=u+(c.length>0?" "+c:c)}return c},em=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=wi(o))&&(a&&(a+=" "),a+=r);return a},wi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=wi(t[r]))&&(o&&(o+=" "),o+=n);return o},tm=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=Jf(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=Zf(c,o);return a(c,u),u};return s=i,(...c)=>s(em(...c))},nm=[],Ye=t=>{const n=o=>o[t]||nm;return n.isThemeGetter=!0,n},Ci=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Bi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,om=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,am=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,im=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lm=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,en=t=>om.test(t),Ce=t=>!!t&&!Number.isNaN(Number(t)),tn=t=>!!t&&Number.isInteger(Number(t)),ba=t=>t.endsWith("%")&&Ce(t.slice(0,-1)),$t=t=>rm.test(t),Ei=()=>!0,cm=t=>am.test(t)&&!sm.test(t),ya=()=>!1,dm=t=>im.test(t),um=t=>lm.test(t),fm=t=>!le(t)&&!ce(t),mm=t=>nn(t,Ni,ya),le=t=>Ci.test(t),pn=t=>nn(t,Mi,cm),_i=t=>nn(t,wm,Ce),hm=t=>nn(t,Ti,Ei),pm=t=>nn(t,Pi,ya),Si=t=>nn(t,Vi,ya),gm=t=>nn(t,Di,um),jo=t=>nn(t,vi,dm),ce=t=>Bi.test(t),no=t=>gn(t,Mi),bm=t=>gn(t,Pi),Ai=t=>gn(t,Vi),ym=t=>gn(t,Ni),xm=t=>gn(t,Di),Uo=t=>gn(t,vi,!0),km=t=>gn(t,Ti,!0),nn=(t,n,o)=>{const r=Ci.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},gn=(t,n,o=!1)=>{const r=Bi.exec(t);return r?r[1]?n(r[1]):o:!1},Vi=t=>t==="position"||t==="percentage",Di=t=>t==="image"||t==="url",Ni=t=>t==="length"||t==="size"||t==="bg-size",Mi=t=>t==="length",wm=t=>t==="number",Pi=t=>t==="family-name",Ti=t=>t==="number"||t==="weight",vi=t=>t==="shadow",Cm=tm(()=>{const t=Ye("color"),n=Ye("font"),o=Ye("text"),r=Ye("font-weight"),a=Ye("tracking"),s=Ye("leading"),i=Ye("breakpoint"),l=Ye("container"),c=Ye("spacing"),d=Ye("radius"),u=Ye("shadow"),f=Ye("inset-shadow"),m=Ye("text-shadow"),h=Ye("drop-shadow"),x=Ye("blur"),C=Ye("perspective"),y=Ye("aspect"),p=Ye("ease"),S=Ye("animate"),V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...E(),ce,le],k=()=>["auto","hidden","clip","visible","scroll"],g=()=>["auto","contain","none"],b=()=>[ce,le,c],M=()=>[en,"full","auto",...b()],w=()=>[tn,"none","subgrid",ce,le],_=()=>["auto",{span:["full",tn,ce,le]},tn,ce,le],B=()=>[tn,"auto",ce,le],D=()=>["auto","min","max","fr",ce,le],N=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],O=()=>["start","end","center","stretch","center-safe","end-safe"],v=()=>["auto",...b()],L=()=>[en,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],$=()=>[en,"screen","full","dvw","lvw","svw","min","max","fit",...b()],U=()=>[en,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],P=()=>[t,ce,le],F=()=>[...E(),Ai,Si,{position:[ce,le]}],X=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",ym,mm,{size:[ce,le]}],W=()=>[ba,no,pn],Z=()=>["","none","full",d,ce,le],ne=()=>["",Ce,no,pn],ue=()=>["solid","dashed","dotted","double"],ke=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],fe=()=>[Ce,ba,Ai,Si],K=()=>["","none",x,ce,le],z=()=>["none",Ce,ce,le],G=()=>["none",Ce,ce,le],ee=()=>[Ce,ce,le],he=()=>[en,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$t],breakpoint:[$t],color:[Ei],container:[$t],"drop-shadow":[$t],ease:["in","out","in-out"],font:[fm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$t],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$t],shadow:[$t],spacing:["px",Ce],text:[$t],"text-shadow":[$t],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",en,le,ce,y]}],container:["container"],columns:[{columns:[Ce,le,ce,l]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:g()}],"overscroll-x":[{"overscroll-x":g()}],"overscroll-y":[{"overscroll-y":g()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{"inset-s":M(),start:M()}],end:[{"inset-e":M(),end:M()}],"inset-bs":[{"inset-bs":M()}],"inset-be":[{"inset-be":M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[tn,"auto",ce,le]}],basis:[{basis:[en,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ce,en,"auto","initial","none",le]}],grow:[{grow:["",Ce,ce,le]}],shrink:[{shrink:["",Ce,ce,le]}],order:[{order:[tn,"first","last","none",ce,le]}],"grid-cols":[{"grid-cols":w()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":w()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":D()}],"auto-rows":[{"auto-rows":D()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...N(),"normal"]}],"justify-items":[{"justify-items":[...O(),"normal"]}],"justify-self":[{"justify-self":["auto",...O()]}],"align-content":[{content:["normal",...N()]}],"align-items":[{items:[...O(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...O(),{baseline:["","last"]}]}],"place-content":[{"place-content":N()}],"place-items":[{"place-items":[...O(),"baseline"]}],"place-self":[{"place-self":["auto",...O()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:v()}],mx:[{mx:v()}],my:[{my:v()}],ms:[{ms:v()}],me:[{me:v()}],mbs:[{mbs:v()}],mbe:[{mbe:v()}],mt:[{mt:v()}],mr:[{mr:v()}],mb:[{mb:v()}],ml:[{ml:v()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...U()]}],"min-block-size":[{"min-block":["auto",...U()]}],"max-block-size":[{"max-block":["none",...U()]}],w:[{w:[l,"screen",...L()]}],"min-w":[{"min-w":[l,"screen","none",...L()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",o,no,pn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,km,hm]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ba,le]}],"font-family":[{font:[bm,pm,n]}],"font-features":[{"font-features":[le]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ce,le]}],"line-clamp":[{"line-clamp":[Ce,"none",ce,_i]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",ce,le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ce,le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ce,"from-font","auto",ce,pn]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Ce,"auto",ce,le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ce,le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ce,le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:F()}],"bg-repeat":[{bg:X()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},tn,ce,le],radial:["",ce,le],conic:[tn,ce,le]},xm,gm]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:ne()}],"border-w-x":[{"border-x":ne()}],"border-w-y":[{"border-y":ne()}],"border-w-s":[{"border-s":ne()}],"border-w-e":[{"border-e":ne()}],"border-w-bs":[{"border-bs":ne()}],"border-w-be":[{"border-be":ne()}],"border-w-t":[{"border-t":ne()}],"border-w-r":[{"border-r":ne()}],"border-w-b":[{"border-b":ne()}],"border-w-l":[{"border-l":ne()}],"divide-x":[{"divide-x":ne()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ne()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-bs":[{"border-bs":P()}],"border-color-be":[{"border-be":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ce,ce,le]}],"outline-w":[{outline:["",Ce,no,pn]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",u,Uo,jo]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",f,Uo,jo]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:ne()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Ce,pn]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":ne()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",m,Uo,jo]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Ce,ce,le]}],"mix-blend":[{"mix-blend":[...ke(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ke()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":fe()}],"mask-image-linear-to-pos":[{"mask-linear-to":fe()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":fe()}],"mask-image-t-to-pos":[{"mask-t-to":fe()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":fe()}],"mask-image-r-to-pos":[{"mask-r-to":fe()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":fe()}],"mask-image-b-to-pos":[{"mask-b-to":fe()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":fe()}],"mask-image-l-to-pos":[{"mask-l-to":fe()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":fe()}],"mask-image-x-to-pos":[{"mask-x-to":fe()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":fe()}],"mask-image-y-to-pos":[{"mask-y-to":fe()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ce,le]}],"mask-image-radial-from-pos":[{"mask-radial-from":fe()}],"mask-image-radial-to-pos":[{"mask-radial-to":fe()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":fe()}],"mask-image-conic-to-pos":[{"mask-conic-to":fe()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:F()}],"mask-repeat":[{mask:X()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ce,le]}],filter:[{filter:["","none",ce,le]}],blur:[{blur:K()}],brightness:[{brightness:[Ce,ce,le]}],contrast:[{contrast:[Ce,ce,le]}],"drop-shadow":[{"drop-shadow":["","none",h,Uo,jo]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Ce,ce,le]}],"hue-rotate":[{"hue-rotate":[Ce,ce,le]}],invert:[{invert:["",Ce,ce,le]}],saturate:[{saturate:[Ce,ce,le]}],sepia:[{sepia:["",Ce,ce,le]}],"backdrop-filter":[{"backdrop-filter":["","none",ce,le]}],"backdrop-blur":[{"backdrop-blur":K()}],"backdrop-brightness":[{"backdrop-brightness":[Ce,ce,le]}],"backdrop-contrast":[{"backdrop-contrast":[Ce,ce,le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ce,ce,le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ce,ce,le]}],"backdrop-invert":[{"backdrop-invert":["",Ce,ce,le]}],"backdrop-opacity":[{"backdrop-opacity":[Ce,ce,le]}],"backdrop-saturate":[{"backdrop-saturate":[Ce,ce,le]}],"backdrop-sepia":[{"backdrop-sepia":["",Ce,ce,le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ce,le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ce,"initial",ce,le]}],ease:[{ease:["linear","initial",p,ce,le]}],delay:[{delay:[Ce,ce,le]}],animate:[{animate:["none",S,ce,le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ce,le]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:G()}],"scale-x":[{"scale-x":G()}],"scale-y":[{"scale-y":G()}],"scale-z":[{"scale-z":G()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[ce,le,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ce,le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ce,le]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Ce,no,pn,_i]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function _e(...t){return Cm(hi(t))}function Oi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var xa={},ka={},Wo={exports:{}},Fi;function Bm(){if(Fi)return Wo.exports;Fi=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return Wo.exports=n(),Wo.exports.createColors=n,Wo.exports}var zi;function Em(){return zi||(zi=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a(Bm());function a(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&n.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(m=>console.warn(d,"-",m)))}function l(d){return r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(ka)),ka}var Ii;function _m(){return Ii||(Ii=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Em());function o(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:i,to:l}){n.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(xa)),xa}var wa,Ri;function Sm(){if(Ri)return wa;Ri=1;let t=_m();return wa=(t.__esModule?t:{default:t}).default,wa}var Am=Sm();const Vm=Oi(Am),Dm=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},Nm=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),Mm=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):Nm(t),bn=(t,n)=>{if(!t)return null;if(n[t])return n[t];const o=t.split(/[-_]/).map(r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()).join("");return n[o]||null},Li=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,$i=hi,Ho=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return $i(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const m=Li(u)||Li(f);return a[d][m]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(x=>{let[C,y]=x;return Array.isArray(y)?y.includes({...s,...l}[C]):{...s,...l}[C]===y})?[...d,f,m]:d},[]);return $i(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},St=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(me.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(_e)(e.unref(vn)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),vn=Ho("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ji=e.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=me.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(me.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Ui=e.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=me.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(me.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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 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",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Wi=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(me.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Hi=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(me.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Pm={class:"relative z-10"},Tm="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",vm=e.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>bn(o.icon,Vt)),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const q=String(o.variant||"default").toLowerCase();return q==="tonal"?"secondary":q==="elevated"?"default":q}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:q,...W}=n;return W}),u=e.computed(()=>_e(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),m=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),h=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),x=e.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),C=e.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),y=e.computed(()=>_e("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",x.value,m.value,h.value,f.value)),p=e.computed(()=>{const W=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),S=e.computed(()=>{const W=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),V=e.computed(()=>!!p.value),E=e.computed(()=>/\bborder-/.test(u.value??"")),A=e.computed(()=>/\bhover:/.test(u.value??"")),k=e.computed(()=>{const q=u.value??"";return i.value!=="outline"?q:q.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),g=e.ref(null),b=q=>{const W=q.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return W?{r:Number(W[1]),g:Number(W[2]),b:Number(W[3]),a:W[4]?Number(W[4]):1}:null},M=(q,W)=>{const Z=b(q);if(!Z)return q;const ne=ue=>Math.max(0,Math.min(255,Math.round(ue)));return`rgba(${ne(Z.r*(1-W))}, ${ne(Z.g*(1-W))}, ${ne(Z.b*(1-W))}, ${Z.a})`},w=q=>{if(globalThis.window===void 0)return null;const W=document.createElement("div");W.className=q,W.style.position="absolute",W.style.visibility="hidden",W.style.pointerEvents="none",W.style.width="1px",W.style.height="1px",document.body.appendChild(W);const Z=globalThis.getComputedStyle(W).backgroundColor;return W.remove(),!Z||Z==="transparent"||Z==="rgba(0, 0, 0, 0)"?null:Z},_=[50,100,200,300,400,500,600,700,800,900,950],B=q=>{const W=_.indexOf(q);return W===-1?q:_[Math.min(_.length-1,W+2)]},D=(q,W)=>{const Z=Vm[q];if(!Z)return null;if(typeof Z=="string")return Z;if(!W)return null;const ne=Z[W];return typeof ne=="string"?ne:null},N=(q,W=!1)=>{if(!q)return null;const Z=W?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ne=q.match(Z);return ne?{colorName:ne[1],shade:ne[2]?Number.parseInt(ne[2],10):null}:null},O=()=>{const q=p.value;if(!q){g.value=null;return}const W=N(q),Z=W==null?void 0:W.colorName,ne=(W==null?void 0:W.shade)??null,ue=(Z?D(Z,ne):null)??w(q);if(!ue){g.value=null;return}let ke;const fe=N(S.value,!0),K=fe?D(fe.colorName,fe.shade??null):null;if(K)ke=K;else if(Z&&ne){const z=B(ne);ke=D(Z,z)??M(ue,.2)}else ke=M(ue,.2);g.value={"--btn-color":ue,"--btn-color-hover":ke}};e.onMounted(()=>{O()}),e.watch([p,S],async()=>{await e.nextTick(),O()});const v=e.computed(()=>{const q=/\bdark:bg-/.test(u.value??"");return!V.value||i.value==="outline"||q?"":g.value?"dcode-btn--fill dcode-btn--fill-hover":A.value?"":"hover:brightness-90"}),L=e.computed(()=>{if(!V.value||i.value!=="outline")return"";const q=["dcode-btn--outline","dcode-btn--outline-hover"];return E.value||q.push("border"),!g.value&&!A.value&&q.push("hover:brightness-90"),q.join(" ")}),$=e.computed(()=>g.value??void 0),U={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},P={"gradient-blue":{bg:"bg-gradient-to-r from-blue-500 to-cyan-500",text:"text-white",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",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",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",hover:"hover:from-emerald-600 hover:to-teal-600"}},F=e.computed(()=>{const q=[],W=l.value,Z=String(o.borderColor||"").toLowerCase(),ne=W?U[W]:null,ue=W?P[W]:null,ke=Z?U[Z]:null;return W&&(ne?ke&&Z!==W?(q.push(ne.bg,ke.hoverBg),o.textColor||q.push(ne.text,ke.hoverText)):(q.push(ne.bg,ne.hoverBg),o.textColor||q.push(ne.text,ne.hoverText)):ue?(q.push(ue.bg,ue.hover),o.textColor||q.push(ue.text)):W==="transparent"?ke?(q.push("bg-transparent",ke.hoverBg),o.textColor||q.push("text-inherit",ke.hoverText)):q.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):q.push(W)),Z?ke?q.push(ke.border,ke.hoverBorder):q.push(Z):ne&&i.value!=="ghost"&&i.value!=="link"&&q.push(ne.border,ne.hoverBorder),o.textColor&&q.push(o.textColor),q.join(" ")}),X=e.computed(()=>_e(Tm,x.value,C.value,k.value,v.value,L.value,F.value));return(q,W)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(y.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(Wi),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(ji),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(Hi),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(St),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:X.value,style:$.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(Ui),{side:"top","side-offset":8,class:"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 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:e.withCtx(()=>[e.createElementVNode("span",Pm,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(St),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:X.value,style:$.value},d.value),{default:e.withCtx(()=>[e.renderSlot(q.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),at=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Le=at(vm,[["__scopeId","data-v-c123cb99"]]),Om={key:0,class:"flex items-center justify-between bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 px-4 py-3 backdrop-blur-sm"},Fm={class:"flex flex-col gap-1"},zm={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},Im={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},Rm={key:0,class:"flex items-center gap-2"},Lm={name:"DCodeCard"},qi=e.defineComponent({...Lm,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-700";case 3:return"bg-neutral-100 dark:bg-neutral-600";case 1:default:return"bg-white dark:bg-neutral-800"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200/60 dark:border-neutral-700/50":t.border&&t.level===1},{"border-neutral-300/60 dark:border-neutral-600/50":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Om,[e.createElementVNode("div",Fm,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",zm,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",Im,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Rm,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200/60 dark:border-neutral-700/50",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),$m={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},jm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},Um={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Wm={class:"flex items-center justify-between"},Hm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},qm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},Gm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},Km={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},Xm={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Ym={class:"flex items-center justify-between"},Jm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Qm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},Zm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Ca=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=bt.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,f=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=f,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",$m,[e.createElementVNode("div",jm,[e.createElementVNode("div",Um,[e.createElementVNode("div",Wm,[e.createElementVNode("h3",Hm,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",qm,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",Gm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",Km,[e.createElementVNode("div",Xm,[e.createElementVNode("div",Ym,[e.createElementVNode("h3",Jm,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",Qm,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",Zm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),eh=["aria-busy"],th={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},nh={key:1,class:"flex justify-end"},oh=["for"],rh={key:0,class:"ml-1 text-destructive"},ah={class:"relative w-full group"},sh={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},ih={key:1},lh=["id","value","placeholder"],ch={key:1,class:"absolute inset-y-0 right-4 flex items-center"},dh={key:2,class:"absolute inset-y-0 right-4 flex items-center"},uh={key:3,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"},fh={key:1,class:"text-xs text-destructive"},On=e.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var z;return((z=l.valueType)==null?void 0:z.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=e.computed(()=>{const z=o.required,G=o["aria-required"];return z===""||z===!0||z==="true"||(G==="true"||G===!0)}),m=e.computed(()=>{const{label:z,class:G,id:ee,required:he,"aria-required":De,...Ae}=o;return Ae}),h=e.computed(()=>{var G,ee;const z={...m.value};return((G=l.valueType)==null?void 0:G.toLowerCase())==="number"&&(z.type="text",z.inputmode="numeric",z.pattern="[0-9]*"),((ee=l.valueType)==null?void 0:ee.toLowerCase())==="email"&&(z.type="email",z.inputmode="email"),r.value&&(z.type=a.value?"text":"password"),l.disabled&&(z.disabled=!0),l.readonly&&(z.readonly=!0),l.maxLength&&(z.maxlength=l.maxLength),l.minLength&&(z.minlength=l.minLength),l.maxValue&&(z.max=l.maxValue),l.minValue&&(z.min=l.minValue),z}),x=e.computed(()=>{const z=l.modelValue;return z==null||String(z).length===0}),C=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!x.value:!0:!1),y=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,z=>{const G=String(z??"");G!==p.value&&(p.value=G)});const S=e.ref(!1),V=e.ref(!1),E=z=>z.split(/(\s+)/).map(G=>{if(G.trim()==="")return G;const ee=G.toLowerCase();return ee.charAt(0).toUpperCase()+ee.slice(1)}).join(""),A=z=>{const G=z.toLowerCase(),ee=G.search(new RegExp("\\p{L}","u"));return ee<0?G:G.slice(0,ee)+G.charAt(ee).toUpperCase()+G.slice(ee+1)},k=z=>{switch(l.textCase){case"uppercase":return z.toUpperCase();case"lowercase":return z.toLowerCase();case"titlecase":return E(z);case"sentencecase":return A(z);case"none":default:return z}},g=z=>{if(!z)return null;const G=Array.isArray(z)?z.join(""):z;return G?new Set(G):null},b=e.computed(()=>g(l.allowChars)),M=(z,G)=>(z.lastIndex=0,z.test(G)),w=z=>{var Ie;const G=(Ie=l.valueType)==null?void 0:Ie.toLowerCase();if(G==="free"||G==="email"||G==="password")return!0;const ee=z===" ",he=/\d/.test(z),De=new RegExp("\\p{L}","u").test(z),Ae=new RegExp("\\p{N}","u").test(z),ze=/[\/\-_.,]/.test(z);return G==="number"?he:G==="letter"?De||ze||l.allowSpaces&&ee:G==="letternumber"?De||Ae||ze||l.allowSpaces&&ee:!0},_=z=>{let G="";for(const ee of z){const he=!!b.value&&b.value.has(ee);l.pattern&&!he&&!M(l.pattern,ee)||!he&&!w(ee)||(G+=ee)}return G},B=e.computed(()=>{const z=l.maxLength??o.maxlength??o.maxLength;let G=Number.NaN;return typeof z=="number"?G=z:typeof z=="string"&&(G=Number.parseInt(z,10)),Number.isFinite(G)&&G>0?G:-1}),D=e.computed(()=>p.value.length),N=e.computed(()=>l.showCharCount?B.value>0:!1),O=z=>B.value>0?z.slice(0,B.value):z,v=z=>{const G=_(z),ee=l.applyTextCaseToValue?k(G):G;return O(ee)};let L=null;const $=z=>{var G;if(z==="")return null;if(((G=l.valueType)==null?void 0:G.toLowerCase())==="number"&&l.returnNumber){const ee=Number(z);return Number.isFinite(ee)?ee:null}return z},U=z=>{p.value=z,i("update:modelValue",$(z))},P=(z,G)=>{const ee=O(G);V.value=!0,z.value=ee,U(ee),queueMicrotask(()=>V.value=!1)},F=(z,G)=>{const ee=z.selectionStart??z.value.length,he=z.selectionEnd??z.value.length;if(B.value>0){const De=z.value.length-(he-ee),Ae=B.value-De;if(Ae<=0)return;G=G.slice(0,Ae)}z.setRangeText(G,ee,he,"end"),P(z,v(z.value))},X=z=>{var he;if(!L||S.value||V.value||!((he=z.inputType)!=null&&he.startsWith("insert")))return;const G=z.data;if(G==null)return;const ee=v(G);ee!==G&&(z.preventDefault(),ee.length>0&&F(L,ee))},q=z=>{var he;if(!L||S.value||V.value)return;const G=((he=z.clipboardData)==null?void 0:he.getData("text"))??"",ee=v(G);ee!==G&&(z.preventDefault(),ee.length>0&&F(L,ee))},W=z=>{if(!L||S.value||V.value)return;const G=z.target,ee=G.value??"",he=v(ee);he===ee?U(he):P(G,he)},Z=()=>S.value=!0,ne=()=>{if(S.value=!1,!L)return;const z=L.value??"",G=v(z);G===z?U(G):P(L,G)};e.onMounted(()=>{if(L=document.getElementById(u.value),!L)return;L.addEventListener("beforeinput",X),L.addEventListener("paste",q),L.addEventListener("input",W),L.addEventListener("compositionstart",Z),L.addEventListener("compositionend",ne);const z=L.value??"",G=v(z);G===z?U(G):P(L,G)}),e.onBeforeUnmount(()=>{L&&(L.removeEventListener("beforeinput",X),L.removeEventListener("paste",q),L.removeEventListener("input",W),L.removeEventListener("compositionstart",Z),L.removeEventListener("compositionend",ne),L=null)});const ue=()=>{p.value="",L&&(L.value=""),i("update:modelValue",null),i("clear")},ke=e.computed(()=>N.value&&D.value>0),fe=e.computed(()=>`${D.value} / ${B.value}`),K=e.computed(()=>!!l.error);return(z,G)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",[e.unref(o).class,l.disabled?"cursor-not-allowed":""]]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",th)):e.createCommentVNode("",!0),G[1]||(G[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),N.value?(e.openBlock(),e.createElementBlock("div",nh,[...G[0]||(G[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),f.value?(e.openBlock(),e.createElementBlock("span",rh,"*")):e.createCommentVNode("",!0)],8,oh)):e.createCommentVNode("",!0),e.createElementVNode("div",ah,[l.icon||l.prependInner||z.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",sh,[e.renderSlot(z.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",ih,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},h.value,{placeholder:l.placeholder,style:`text-transform: ${y.value}; padding-left: ${l.icon||l.prependInner||z.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${C.value||r.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 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",K.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,lh),r.value?(e.openBlock(),e.createElementBlock("div",ch,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(te.Eye):e.unref(te.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),C.value&&!r.value?(e.openBlock(),e.createElementBlock("div",dh,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:ue}," ✕ ")])):e.createCommentVNode("",!0),ke.value&&!K.value?(e.openBlock(),e.createElementBlock("p",uh,e.toDisplayString(fe.value),1)):e.createCommentVNode("",!0)]),K.value?(e.openBlock(),e.createElementBlock("p",fh,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,eh)),[[e.vShow,t.visible]])}}),mh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},hh={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},ph={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},gh={class:"flex items-center justify-between"},bh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},yh={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm"},xh={class:"p-6 flex-1"},kh={class:"flex flex-col gap-4"},wh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ch={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Bh={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Eh={class:"flex items-center justify-between"},_h={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Sh={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/30 shadow-sm"},Ah={class:"p-6 flex-1"},Vh={class:"flex flex-col gap-4"},Dh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ba=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=bt.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",mh,[e.createElementVNode("div",hh,[e.createElementVNode("div",ph,[e.createElementVNode("div",gh,[e.createElementVNode("h3",bh,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",yh,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",xh,[e.createElementVNode("div",kh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(On,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",wh)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Ch,[e.createElementVNode("div",Bh,[e.createElementVNode("div",Eh,[e.createElementVNode("h3",_h,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",Sh,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Ah,[e.createElementVNode("div",Vh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(On,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",Dh,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
|
|
2
2
|
* @kurkle/color v0.3.4
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2024 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function oo(t){return t+.5|0}const on=(t,n,o)=>Math.max(Math.min(t,o),n);function ro(t){return on(oo(t*2.55),0,255)}function rn(t){return on(oo(t*255),0,255)}function jt(t){return on(oo(t/2.55)/100,0,1)}function Gi(t){return on(oo(t*100),0,100)}const
|
|
6
|
+
*/function oo(t){return t+.5|0}const on=(t,n,o)=>Math.max(Math.min(t,o),n);function ro(t){return on(oo(t*2.55),0,255)}function rn(t){return on(oo(t*255),0,255)}function jt(t){return on(oo(t/2.55)/100,0,1)}function Gi(t){return on(oo(t*100),0,100)}const yt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ea=[..."0123456789ABCDEF"],Nh=t=>Ea[t&15],Mh=t=>Ea[(t&240)>>4]+Ea[t&15],qo=t=>(t&240)>>4===(t&15),Ph=t=>qo(t.r)&&qo(t.g)&&qo(t.b)&&qo(t.a);function Th(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&yt[t[1]]*17,g:255&yt[t[2]]*17,b:255&yt[t[3]]*17,a:n===5?yt[t[4]]*17:255}:(n===7||n===9)&&(o={r:yt[t[1]]<<4|yt[t[2]],g:yt[t[3]]<<4|yt[t[4]],b:yt[t[5]]<<4|yt[t[6]],a:n===9?yt[t[7]]<<4|yt[t[8]]:255})),o}const vh=(t,n)=>t<255?n(t):"";function Oh(t){var n=Ph(t)?Nh:Mh;return t?"#"+n(t.r)+n(t.g)+n(t.b)+vh(t.a,n):void 0}const Fh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Ki(t,n,o){const r=n*Math.min(o,1-o),a=(s,i=(s+t/30)%12)=>o-r*Math.max(Math.min(i-3,9-i,1),-1);return[a(0),a(8),a(4)]}function zh(t,n,o){const r=(a,s=(a+t/60)%6)=>o-o*n*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function Ih(t,n,o){const r=Ki(t,1,.5);let a;for(n+o>1&&(a=1/(n+o),n*=a,o*=a),a=0;a<3;a++)r[a]*=1-n-o,r[a]+=n;return r}function Rh(t,n,o,r,a){return t===a?(n-o)/r+(n<o?6:0):n===a?(o-t)/r+2:(t-n)/r+4}function _a(t){const o=t.r/255,r=t.g/255,a=t.b/255,s=Math.max(o,r,a),i=Math.min(o,r,a),l=(s+i)/2;let c,d,u;return s!==i&&(u=s-i,d=l>.5?u/(2-s-i):u/(s+i),c=Rh(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Sa(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(rn)}function Aa(t,n,o){return Sa(Ki,t,n,o)}function Lh(t,n,o){return Sa(Ih,t,n,o)}function $h(t,n,o){return Sa(zh,t,n,o)}function Xi(t){return(t%360+360)%360}function jh(t){const n=Fh.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?ro(+n[5]):rn(+n[5]));const a=Xi(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=Lh(a,s,i):n[1]==="hsv"?r=$h(a,s,i):r=Aa(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function Uh(t,n){var o=_a(t);o[0]=Xi(o[0]+n),o=Aa(o),t.r=o[0],t.g=o[1],t.b=o[2]}function Wh(t){if(!t)return;const n=_a(t),o=n[0],r=Gi(n[1]),a=Gi(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${jt(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const Yi={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Ji={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Hh(){const t={},n=Object.keys(Ji),o=Object.keys(Yi);let r,a,s,i,l;for(r=0;r<n.length;r++){for(i=l=n[r],a=0;a<o.length;a++)s=o[a],l=l.replace(s,Yi[s]);s=parseInt(Ji[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let Go;function qh(t){Go||(Go=Hh(),Go.transparent=[0,0,0,0]);const n=Go[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const Gh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Kh(t){const n=Gh.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?ro(i):on(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?ro(r):on(r,0,255)),a=255&(n[4]?ro(a):on(a,0,255)),s=255&(n[6]?ro(s):on(s,0,255)),{r,g:a,b:s,a:o}}}function Xh(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${jt(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Va=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Fn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Yh(t,n,o){const r=Fn(jt(t.r)),a=Fn(jt(t.g)),s=Fn(jt(t.b));return{r:rn(Va(r+o*(Fn(jt(n.r))-r))),g:rn(Va(a+o*(Fn(jt(n.g))-a))),b:rn(Va(s+o*(Fn(jt(n.b))-s))),a:t.a+o*(n.a-t.a)}}function Ko(t,n,o){if(t){let r=_a(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=Aa(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function Qi(t,n){return t&&Object.assign(n||{},t)}function Zi(t){var n={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(n={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(n.a=rn(t[3]))):(n=Qi(t,{r:0,g:0,b:0,a:1}),n.a=rn(n.a)),n}function Jh(t){return t.charAt(0)==="r"?Kh(t):jh(t)}class ao{constructor(n){if(n instanceof ao)return n;const o=typeof n;let r;o==="object"?r=Zi(n):o==="string"&&(r=Th(n)||qh(n)||Jh(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=Qi(this._rgb);return n&&(n.a=jt(n.a)),n}set rgb(n){this._rgb=Zi(n)}rgbString(){return this._valid?Xh(this._rgb):void 0}hexString(){return this._valid?Oh(this._rgb):void 0}hslString(){return this._valid?Wh(this._rgb):void 0}mix(n,o){if(n){const r=this.rgb,a=n.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=r.a-a.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,r.r=255&d*r.r+s*a.r+.5,r.g=255&d*r.g+s*a.g+.5,r.b=255&d*r.b+s*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}interpolate(n,o){return n&&(this._rgb=Yh(this._rgb,n._rgb,o)),this}clone(){return new ao(this.rgb)}alpha(n){return this._rgb.a=rn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=oo(n.r*.3+n.g*.59+n.b*.11);return n.r=n.g=n.b=o,this}opaquer(n){const o=this._rgb;return o.a*=1+n,this}negate(){const n=this._rgb;return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,this}lighten(n){return Ko(this._rgb,2,n),this}darken(n){return Ko(this._rgb,2,-n),this}saturate(n){return Ko(this._rgb,1,n),this}desaturate(n){return Ko(this._rgb,1,-n),this}rotate(n){return Uh(this._rgb,n),this}}/*!
|
|
7
7
|
* Chart.js v4.5.1
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function Ut(){}const Jh=(()=>{let t=0;return()=>t++})();function ve(t){return t==null}function Xe(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Se(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function et(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Nt(t,n){return et(t)?t:n}function we(t,n){return typeof t>"u"?n:t}const Qh=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,el=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function $e(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Oe(t,n,o,r){let a,s,i;if(Xe(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Se(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function Xo(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function Yo(t){if(Xe(t))return t.map(Yo);if(Se(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Yo(t[o[a]]);return n}return t}function tl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function Zh(t,n,o,r){if(!tl(t))return;const a=n[t],s=o[t];Se(a)&&Se(s)?so(a,s,r):n[t]=Yo(s)}function so(t,n,o){const r=Xe(n)?n:[n],a=r.length;if(!Se(t))return t;o=o||{};const s=o.merger||Zh;let i;for(let l=0;l<a;++l){if(i=r[l],!Se(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function io(t,n){return so(t,n,{merger:ep})}function ep(t,n,o){if(!tl(t))return;const r=n[t],a=o[t];Se(r)&&Se(a)?io(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Yo(a))}const nl={"":t=>t,x:t=>t.x,y:t=>t.y};function tp(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function np(t){const n=tp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function yn(t,n){return(nl[n]||(nl[n]=np(n)))(t)}function Da(t){return t.charAt(0).toUpperCase()+t.slice(1)}const lo=t=>typeof t<"u",an=t=>typeof t=="function",ol=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function op(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Fe=Math.PI,je=2*Fe,rp=je+Fe,Jo=Number.POSITIVE_INFINITY,ap=Fe/180,Je=Fe/2,xn=Fe/4,rl=Fe*2/3,al=Math.log10,Mt=Math.sign;function co(t,n,o){return Math.abs(t-n)<o}function sl(t){const n=Math.round(t);t=co(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(al(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function sp(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function ip(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function uo(t){return!ip(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function lp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function cp(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function Wt(t){return t*(Fe/180)}function dp(t){return t*(180/Fe)}function il(t){if(!et(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function ll(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*Fe&&(s+=je),{angle:s,distance:a}}function Na(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function up(t,n){return(t-n+rp)%je-Fe}function ft(t){return(t%je+je)%je}function fo(t,n,o,r){const a=ft(t),s=ft(n),i=ft(o),l=ft(s-a),c=ft(i-a),d=ft(a-s),u=ft(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function tt(t,n,o){return Math.max(n,Math.min(o,t))}function fp(t){return tt(t,-32768,32767)}function Ht(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function Ma(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const kn=(t,n,o,r)=>Ma(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),mp=(t,n,o)=>Ma(t,o,r=>t[r][n]>=o);function hp(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const cl=["push","pop","shift","splice","unshift"];function pp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),cl.forEach(o=>{const r="_onData"+Da(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function dl(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(cl.forEach(s=>{delete t[s]}),delete t._chartjs)}function ul(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const fl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function ml(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,fl.call(window,()=>{r=!1,t.apply(n,o)}))}}function gp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const Pa=t=>t==="start"?"left":t==="end"?"right":"center",nt=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,bp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function yp(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:f,max:m,minDefined:h,maxDefined:k}=i.getUserBounds();if(h){if(a=Math.min(kn(c,u,f).lo,o?r:kn(n,u,i.getPixelForValue(f)).lo),d){const C=c.slice(0,a+1).reverse().findIndex(w=>!ve(w[l.axis]));a-=Math.max(0,C)}a=tt(a,0,r-1)}if(k){let C=Math.max(kn(c,i.axis,m,!0).hi+1,o?0:kn(n,u,i.getPixelForValue(m),!0).hi+1);if(d){const w=c.slice(C-1).findIndex(p=>!ve(p[l.axis]));C+=Math.max(0,w)}s=tt(C,a,r)-a}else s=r-a}return{start:a,count:s}}function xp(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const Qo=t=>t===0||t===1,hl=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*je/o)),pl=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*je/o)+1,mo={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Je)+1,easeOutSine:t=>Math.sin(t*Je),easeInOutSine:t=>-.5*(Math.cos(Fe*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Qo(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Qo(t)?t:hl(t,.075,.3),easeOutElastic:t=>Qo(t)?t:pl(t,.075,.3),easeInOutElastic(t){return Qo(t)?t:t<.5?.5*hl(t*2,.1125,.45):.5+.5*pl(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-mo.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?mo.easeInBounce(t*2)*.5:mo.easeOutBounce(t*2-1)*.5+.5};function Ta(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function gl(t){return Ta(t)?t:new ao(t)}function va(t){return Ta(t)?t:new ao(t).saturate(.5).darken(.1).hexString()}const kp=["x","y","borderWidth","radius","tension"],wp=["color","borderColor","backgroundColor"];function Cp(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:wp},numbers:{type:"number",properties:kp}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function Bp(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const bl=new Map;function Ep(t,n){n=n||{};const o=t+JSON.stringify(n);let r=bl.get(o);return r||(r=new Intl.NumberFormat(t,n),bl.set(o,r)),r}function Oa(t,n,o){return Ep(n,o).format(t)}const _p={values(t){return Xe(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(a="scientific"),s=Sp(t,o)}const i=al(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Oa(t,r,c)}};function Sp(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var yl={formatters:_p};function Ap(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,o)=>o.lineWidth,tickColor:(n,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:yl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const wn=Object.create(null),Fa=Object.create(null);function ho(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function za(t,n,o){return typeof n=="string"?so(ho(t,n),o):so(ho(t,""),n)}class Vp{constructor(n,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,a)=>va(a.backgroundColor),this.hoverBorderColor=(r,a)=>va(a.borderColor),this.hoverColor=(r,a)=>va(a.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(o)}set(n,o){return za(this,n,o)}get(n){return ho(this,n)}describe(n,o){return za(Fa,n,o)}override(n,o){return za(wn,n,o)}route(n,o,r,a){const s=ho(this,n),i=ho(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return Se(c)?Object.assign({},d,c):we(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var Ge=new Vp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Cp,Bp,Ap]);function Dp(t){return!t||ve(t.size)||ve(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function xl(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function Cn(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function kl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function Ra(t,n,o,r){wl(t,n,o,r,null)}function wl(t,n,o,r,a){let s,i,l,c,d,u,f,m;const h=n.pointStyle,k=n.rotation,C=n.radius;let w=(k||0)*ap;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(w),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(C)||C<=0)){switch(t.beginPath(),h){default:a?t.ellipse(o,r,a/2,C,0,0,je):t.arc(o,r,C,0,je),t.closePath();break;case"triangle":u=a?a/2:C,t.moveTo(o+Math.sin(w)*u,r-Math.cos(w)*C),w+=rl,t.lineTo(o+Math.sin(w)*u,r-Math.cos(w)*C),w+=rl,t.lineTo(o+Math.sin(w)*u,r-Math.cos(w)*C),t.closePath();break;case"rectRounded":d=C*.516,c=C-d,i=Math.cos(w+xn)*c,f=Math.cos(w+xn)*(a?a/2-d:c),l=Math.sin(w+xn)*c,m=Math.sin(w+xn)*(a?a/2-d:c),t.arc(o-f,r-l,d,w-Fe,w-Je),t.arc(o+m,r-i,d,w-Je,w),t.arc(o+f,r+l,d,w,w+Je),t.arc(o-m,r+i,d,w+Je,w+Fe),t.closePath();break;case"rect":if(!k){c=Math.SQRT1_2*C,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}w+=xn;case"rectRot":f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+m,r-i),t.lineTo(o+f,r+l),t.lineTo(o-m,r+i),t.closePath();break;case"crossRot":w+=xn;case"cross":f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"star":f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i),w+=xn,f=Math.cos(w)*(a?a/2:C),i=Math.cos(w)*C,l=Math.sin(w)*C,m=Math.sin(w)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"line":i=a?a/2:Math.cos(w)*C,l=Math.sin(w)*C,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(w)*(a?a/2:C),r+Math.sin(w)*C);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function po(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function Zo(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function er(t){t.restore()}function Np(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function Mp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Pp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),ve(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function Tp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function vp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function go(t,n,o,r,a,s={}){const i=Xe(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Pp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&vp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),ve(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Tp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function tr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*Fe,Fe,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Fe,Je,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,Je,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-Je,!0),t.lineTo(o+i.topLeft,r)}const Op=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Fp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function zp(t,n){const o=(""+t).match(Op);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const Rp=t=>+t||0;function Ia(t,n){const o={},r=Se(n),a=r?Object.keys(n):n,s=Se(t)?r?i=>we(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=Rp(s(i));return o}function Cl(t){return Ia(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Rn(t){return Ia(t,["topLeft","topRight","bottomLeft","bottomRight"])}function yt(t){const n=Cl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ot(t,n){t=t||{},n=n||Ge.font;let o=we(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=we(t.style,n.style);r&&!(""+r).match(Fp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:we(t.family,n.family),lineHeight:zp(we(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:we(t.weight,n.weight),string:""};return a.string=Dp(a),a}function nr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function Ip(t,n,o){const{min:r,max:a}=t,s=el(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Bn(t,n){return Object.assign(Object.create(t),n)}function La(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Al("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>La([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return El(l,c,()=>Gp(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Vl(l).includes(c)},ownKeys(l){return Vl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function In(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Bl(t,r),setContext:s=>In(t,s,o,r),override:s=>In(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return El(s,i,()=>$p(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(s,i,l){return t[i]=l,delete s[i],!0}})}function Bl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:an(o)?o:()=>o,isIndexable:an(r)?r:()=>r}}const Lp=(t,n)=>t?t+Da(n):n,$a=(t,n)=>Se(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function El(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function $p(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return an(l)&&i.isScriptable(n)&&(l=jp(n,l,t,o)),Xe(l)&&l.length&&(l=Up(n,l,t,i.isIndexable)),$a(n,l)&&(l=In(l,a,s&&s[n],i)),l}function jp(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),$a(t,c)&&(c=ja(a._scopes,a,t,c)),c}function Up(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(Se(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=ja(d,a,t,u);n.push(In(f,s,i&&i[t],l))}}return n}function _l(t,n,o){return an(t)?t(n,o):t}const Wp=(t,n)=>t===!0?n:typeof t=="string"?yn(n,t):void 0;function Hp(t,n,o,r,a){for(const s of n){const i=Wp(o,s);if(i){t.add(i);const l=_l(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function ja(t,n,o,r){const a=n._rootScopes,s=_l(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Sl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Sl(l,i,s,c,r),c===null)?!1:La(Array.from(l),[""],a,s,()=>qp(n,o,r))}function Sl(t,n,o,r,a){for(;o;)o=Hp(t,n,o,r,a);return o}function qp(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return Xe(a)&&Se(o)?o:a||{}}function Gp(t,n,o,r){let a;for(const s of n)if(a=Al(Lp(s,t),o),typeof a<"u")return $a(t,a)?ja(o,r,t,a):a}function Al(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Vl(t){let n=t._keys;return n||(n=t._keys=Kp(t._scopes)),n}function Kp(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const Xp=Number.EPSILON||1e-14,Ln=(t,n)=>n<t.length&&!t[n].skip&&t[n],Dl=t=>t==="x"?"y":"x";function Yp(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=Na(s,a),c=Na(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=r*d,m=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+m*(i.x-a.x),y:s.y+m*(i.y-a.y)}}}function Jp(t,n,o){const r=t.length;let a,s,i,l,c,d=Ln(t,0);for(let u=0;u<r-1;++u)if(c=d,d=Ln(t,u+1),!(!c||!d)){if(co(n[u],0,Xp)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function Qp(t,n,o="x"){const r=Dl(o),a=t.length;let s,i,l,c=Ln(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=Ln(t,d+1),!l)continue;const u=l[o],f=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=f+s*n[d])}}function Zp(t,n="x"){const o=Dl(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=Ln(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=Ln(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?Mt(a[i-1])!==Mt(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}Jp(t,a,s),Qp(t,s,n)}function or(t,n,o){return Math.max(Math.min(t,o),n)}function eg(t,n){let o,r,a,s,i,l=po(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&po(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=or(a.cp1x,n.left,n.right),a.cp1y=or(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=or(a.cp2x,n.left,n.right),a.cp2y=or(a.cp2y,n.top,n.bottom)))}function tg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")Zp(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=Yp(d,l,t[Math.min(s+1,i-(r?0:1))%i],n.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}n.capBezierPoints&&eg(t,o)}function Ua(){return typeof window<"u"&&typeof document<"u"}function Wa(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function rr(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const ar=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function ng(t,n){return ar(t).getPropertyValue(n)}const og=["top","right","bottom","left"];function En(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=og[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const rg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function ag(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(rg(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function _n(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=ar(o),s=a.boxSizing==="border-box",i=En(a,"padding"),l=En(a,"border","width"),{x:c,y:d,box:u}=ag(t,o),f=i.left+(u&&l.left),m=i.top+(u&&l.top);let{width:h,height:k}=n;return s&&(h-=i.width+l.width,k-=i.height+l.height),{x:Math.round((c-f)/h*o.width/r),y:Math.round((d-m)/k*o.height/r)}}function sg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&Wa(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=ar(s),c=En(l,"border","width"),d=En(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=rr(l.maxWidth,s,"clientWidth"),a=rr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||Jo,maxHeight:a||Jo}}const sn=t=>Math.round(t*10)/10;function ig(t,n,o,r){const a=ar(t),s=En(a,"margin"),i=rr(a.maxWidth,t,"clientWidth")||Jo,l=rr(a.maxHeight,t,"clientHeight")||Jo,c=sg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const m=En(a,"border","width"),h=En(a,"padding");d-=h.width+m.width,u-=h.height+m.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=sn(Math.min(d,i,c.maxWidth)),u=sn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=sn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=sn(Math.floor(u*r))),{width:d,height:u}}function Nl(t,n,o){const r=n||1,a=sn(t.height*r),s=sn(t.width*r);t.height=sn(t.height),t.width=sn(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const lg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};Ua()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function Ml(t,n){const o=ng(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Sn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function cg(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function dg(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Sn(t,a,o),l=Sn(a,s,o),c=Sn(s,n,o),d=Sn(i,l,o),u=Sn(l,c,o);return Sn(d,u,o)}const ug=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},fg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function $n(t,n,o){return t?ug(n,o):fg()}function Pl(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function Tl(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function vl(t){return t==="angle"?{between:fo,compare:up,normalize:ft}:{between:Ht,compare:(n,o)=>n-o,normalize:n=>n}}function Ol({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function mg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=vl(r),c=n.length;let{start:d,end:u,loop:f}=t,m,h;if(f){for(d+=c,u+=c,m=0,h=c;m<h&&i(l(n[d%c][r]),a,s);++m)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Fl(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=vl(r),{start:u,end:f,loop:m,style:h}=mg(t,n,o),k=[];let C=!1,w=null,p,A,D;const S=()=>c(a,D,p)&&l(a,D)!==0,V=()=>l(s,p)===0||c(s,D,p),B=()=>C||S(),g=()=>!C||V();for(let b=u,_=u;b<=f;++b)A=n[b%i],!A.skip&&(p=d(A[r]),p!==D&&(C=c(p,a,s),w===null&&B()&&(w=l(p,a)===0?b:_),w!==null&&g()&&(k.push(Ol({start:w,end:b,loop:m,count:i,style:h})),w=null),_=b,D=p));return w!==null&&k.push(Ol({start:w,end:f,loop:m,count:i,style:h})),k}function zl(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=Fl(r[a],t.points,n);s.length&&o.push(...s)}return o}function hg(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function pg(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function gg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=hg(o,a,s,r);if(r===!0)return Rl(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return Rl(t,pg(o,i,c,d),o,n)}function Rl(t,n,o,r){return!r||!r.setContext||!o?n:bg(t,n,o,r)}function bg(t,n,o,r){const a=t._chart.getContext(),s=Il(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,m=f;function h(k,C,w,p){const A=l?-1:1;if(k!==C){for(k+=c;o[k%c].skip;)k-=A;for(;o[C%c].skip;)C+=A;k%c!==C%c&&(d.push({start:k%c,end:C%c,loop:w,style:p}),u=p,f=C%c)}}for(const k of n){f=l?f:k.start;let C=o[f%c],w;for(m=f+1;m<=k.end;m++){const p=o[m%c];w=Il(r.setContext(Bn(a,{type:"segment",p0:C,p1:p,p0DataIndex:(m-1)%c,p1DataIndex:m%c,datasetIndex:i}))),yg(w,u)&&h(f,m-1,k.loop,u),C=p,u=w}f<m-1&&h(f,m-1,k.loop,u)}return d}function Il(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function yg(t,n){if(!n)return!1;const o=[],r=function(a,s){return Ta(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function sr(t,n,o){return t.options.clip?t[o]:n[o]}function xg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:sr(o,n,"left"),right:sr(o,n,"right"),top:sr(r,n,"top"),bottom:sr(r,n,"bottom")}:n}function Ll(t,n){const o=n._clip;if(o.disabled)return!1;const r=xg(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.bottom+(o.bottom===!0?0:o.bottom)}}/*!
|
|
11
|
+
*/function Ut(){}const Qh=(()=>{let t=0;return()=>t++})();function ve(t){return t==null}function Xe(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Se(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function et(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Mt(t,n){return et(t)?t:n}function we(t,n){return typeof t>"u"?n:t}const Zh=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,el=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function $e(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Oe(t,n,o,r){let a,s,i;if(Xe(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Se(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function Xo(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function Yo(t){if(Xe(t))return t.map(Yo);if(Se(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Yo(t[o[a]]);return n}return t}function tl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function ep(t,n,o,r){if(!tl(t))return;const a=n[t],s=o[t];Se(a)&&Se(s)?so(a,s,r):n[t]=Yo(s)}function so(t,n,o){const r=Xe(n)?n:[n],a=r.length;if(!Se(t))return t;o=o||{};const s=o.merger||ep;let i;for(let l=0;l<a;++l){if(i=r[l],!Se(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function io(t,n){return so(t,n,{merger:tp})}function tp(t,n,o){if(!tl(t))return;const r=n[t],a=o[t];Se(r)&&Se(a)?io(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Yo(a))}const nl={"":t=>t,x:t=>t.x,y:t=>t.y};function np(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function op(t){const n=np(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function yn(t,n){return(nl[n]||(nl[n]=op(n)))(t)}function Da(t){return t.charAt(0).toUpperCase()+t.slice(1)}const lo=t=>typeof t<"u",an=t=>typeof t=="function",ol=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function rp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Fe=Math.PI,je=2*Fe,ap=je+Fe,Jo=Number.POSITIVE_INFINITY,sp=Fe/180,Je=Fe/2,xn=Fe/4,rl=Fe*2/3,al=Math.log10,Pt=Math.sign;function co(t,n,o){return Math.abs(t-n)<o}function sl(t){const n=Math.round(t);t=co(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(al(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function ip(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function lp(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function uo(t){return!lp(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function cp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function dp(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function Wt(t){return t*(Fe/180)}function up(t){return t*(180/Fe)}function il(t){if(!et(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function ll(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*Fe&&(s+=je),{angle:s,distance:a}}function Na(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function fp(t,n){return(t-n+ap)%je-Fe}function ft(t){return(t%je+je)%je}function fo(t,n,o,r){const a=ft(t),s=ft(n),i=ft(o),l=ft(s-a),c=ft(i-a),d=ft(a-s),u=ft(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function tt(t,n,o){return Math.max(n,Math.min(o,t))}function mp(t){return tt(t,-32768,32767)}function Ht(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function Ma(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const kn=(t,n,o,r)=>Ma(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),hp=(t,n,o)=>Ma(t,o,r=>t[r][n]>=o);function pp(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const cl=["push","pop","shift","splice","unshift"];function gp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),cl.forEach(o=>{const r="_onData"+Da(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function dl(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(cl.forEach(s=>{delete t[s]}),delete t._chartjs)}function ul(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const fl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function ml(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,fl.call(window,()=>{r=!1,t.apply(n,o)}))}}function bp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const Pa=t=>t==="start"?"left":t==="end"?"right":"center",nt=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,yp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function xp(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:f,max:m,minDefined:h,maxDefined:x}=i.getUserBounds();if(h){if(a=Math.min(kn(c,u,f).lo,o?r:kn(n,u,i.getPixelForValue(f)).lo),d){const C=c.slice(0,a+1).reverse().findIndex(y=>!ve(y[l.axis]));a-=Math.max(0,C)}a=tt(a,0,r-1)}if(x){let C=Math.max(kn(c,i.axis,m,!0).hi+1,o?0:kn(n,u,i.getPixelForValue(m),!0).hi+1);if(d){const y=c.slice(C-1).findIndex(p=>!ve(p[l.axis]));C+=Math.max(0,y)}s=tt(C,a,r)-a}else s=r-a}return{start:a,count:s}}function kp(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const Qo=t=>t===0||t===1,hl=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*je/o)),pl=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*je/o)+1,mo={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>-Math.cos(t*Je)+1,easeOutSine:t=>Math.sin(t*Je),easeInOutSine:t=>-.5*(Math.cos(Fe*t)-1),easeInExpo:t=>t===0?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>t===1?1:-Math.pow(2,-10*t)+1,easeInOutExpo:t=>Qo(t)?t:t<.5?.5*Math.pow(2,10*(t*2-1)):.5*(-Math.pow(2,-10*(t*2-1))+2),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Qo(t)?t:hl(t,.075,.3),easeOutElastic:t=>Qo(t)?t:pl(t,.075,.3),easeInOutElastic(t){return Qo(t)?t:t<.5?.5*hl(t*2,.1125,.45):.5+.5*pl(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-mo.easeOutBounce(1-t),easeOutBounce(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:t=>t<.5?mo.easeInBounce(t*2)*.5:mo.easeOutBounce(t*2-1)*.5+.5};function Ta(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function gl(t){return Ta(t)?t:new ao(t)}function va(t){return Ta(t)?t:new ao(t).saturate(.5).darken(.1).hexString()}const wp=["x","y","borderWidth","radius","tension"],Cp=["color","borderColor","backgroundColor"];function Bp(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:Cp},numbers:{type:"number",properties:wp}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function Ep(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const bl=new Map;function _p(t,n){n=n||{};const o=t+JSON.stringify(n);let r=bl.get(o);return r||(r=new Intl.NumberFormat(t,n),bl.set(o,r)),r}function Oa(t,n,o){return _p(n,o).format(t)}const Sp={values(t){return Xe(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(a="scientific"),s=Ap(t,o)}const i=al(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Oa(t,r,c)}};function Ap(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var yl={formatters:Sp};function Vp(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,o)=>o.lineWidth,tickColor:(n,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:yl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const wn=Object.create(null),Fa=Object.create(null);function ho(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function za(t,n,o){return typeof n=="string"?so(ho(t,n),o):so(ho(t,""),n)}class Dp{constructor(n,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,a)=>va(a.backgroundColor),this.hoverBorderColor=(r,a)=>va(a.borderColor),this.hoverColor=(r,a)=>va(a.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(o)}set(n,o){return za(this,n,o)}get(n){return ho(this,n)}describe(n,o){return za(Fa,n,o)}override(n,o){return za(wn,n,o)}route(n,o,r,a){const s=ho(this,n),i=ho(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return Se(c)?Object.assign({},d,c):we(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var Ge=new Dp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Bp,Ep,Vp]);function Np(t){return!t||ve(t.size)||ve(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function xl(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function Cn(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function kl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function Ia(t,n,o,r){wl(t,n,o,r,null)}function wl(t,n,o,r,a){let s,i,l,c,d,u,f,m;const h=n.pointStyle,x=n.rotation,C=n.radius;let y=(x||0)*sp;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(y),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(C)||C<=0)){switch(t.beginPath(),h){default:a?t.ellipse(o,r,a/2,C,0,0,je):t.arc(o,r,C,0,je),t.closePath();break;case"triangle":u=a?a/2:C,t.moveTo(o+Math.sin(y)*u,r-Math.cos(y)*C),y+=rl,t.lineTo(o+Math.sin(y)*u,r-Math.cos(y)*C),y+=rl,t.lineTo(o+Math.sin(y)*u,r-Math.cos(y)*C),t.closePath();break;case"rectRounded":d=C*.516,c=C-d,i=Math.cos(y+xn)*c,f=Math.cos(y+xn)*(a?a/2-d:c),l=Math.sin(y+xn)*c,m=Math.sin(y+xn)*(a?a/2-d:c),t.arc(o-f,r-l,d,y-Fe,y-Je),t.arc(o+m,r-i,d,y-Je,y),t.arc(o+f,r+l,d,y,y+Je),t.arc(o-m,r+i,d,y+Je,y+Fe),t.closePath();break;case"rect":if(!x){c=Math.SQRT1_2*C,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}y+=xn;case"rectRot":f=Math.cos(y)*(a?a/2:C),i=Math.cos(y)*C,l=Math.sin(y)*C,m=Math.sin(y)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+m,r-i),t.lineTo(o+f,r+l),t.lineTo(o-m,r+i),t.closePath();break;case"crossRot":y+=xn;case"cross":f=Math.cos(y)*(a?a/2:C),i=Math.cos(y)*C,l=Math.sin(y)*C,m=Math.sin(y)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"star":f=Math.cos(y)*(a?a/2:C),i=Math.cos(y)*C,l=Math.sin(y)*C,m=Math.sin(y)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i),y+=xn,f=Math.cos(y)*(a?a/2:C),i=Math.cos(y)*C,l=Math.sin(y)*C,m=Math.sin(y)*(a?a/2:C),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"line":i=a?a/2:Math.cos(y)*C,l=Math.sin(y)*C,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(y)*(a?a/2:C),r+Math.sin(y)*C);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function po(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function Zo(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function er(t){t.restore()}function Mp(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function Pp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Tp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),ve(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function vp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Op(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function go(t,n,o,r,a,s={}){const i=Xe(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Tp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Op(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),ve(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),vp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function tr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*Fe,Fe,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Fe,Je,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,Je,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-Je,!0),t.lineTo(o+i.topLeft,r)}const Fp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,zp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ip(t,n){const o=(""+t).match(Fp);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const Rp=t=>+t||0;function Ra(t,n){const o={},r=Se(n),a=r?Object.keys(n):n,s=Se(t)?r?i=>we(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=Rp(s(i));return o}function Cl(t){return Ra(t,{top:"y",right:"x",bottom:"y",left:"x"})}function zn(t){return Ra(t,["topLeft","topRight","bottomLeft","bottomRight"])}function xt(t){const n=Cl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function ot(t,n){t=t||{},n=n||Ge.font;let o=we(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=we(t.style,n.style);r&&!(""+r).match(zp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:we(t.family,n.family),lineHeight:Ip(we(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:we(t.weight,n.weight),string:""};return a.string=Np(a),a}function nr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function Lp(t,n,o){const{min:r,max:a}=t,s=el(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Bn(t,n){return Object.assign(Object.create(t),n)}function La(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Al("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>La([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return El(l,c,()=>Kp(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Vl(l).includes(c)},ownKeys(l){return Vl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function In(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Bl(t,r),setContext:s=>In(t,s,o,r),override:s=>In(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return El(s,i,()=>jp(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i)},getPrototypeOf(){return Reflect.getPrototypeOf(t)},has(s,i){return Reflect.has(t,i)},ownKeys(){return Reflect.ownKeys(t)},set(s,i,l){return t[i]=l,delete s[i],!0}})}function Bl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:an(o)?o:()=>o,isIndexable:an(r)?r:()=>r}}const $p=(t,n)=>t?t+Da(n):n,$a=(t,n)=>Se(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function El(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function jp(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return an(l)&&i.isScriptable(n)&&(l=Up(n,l,t,o)),Xe(l)&&l.length&&(l=Wp(n,l,t,i.isIndexable)),$a(n,l)&&(l=In(l,a,s&&s[n],i)),l}function Up(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),$a(t,c)&&(c=ja(a._scopes,a,t,c)),c}function Wp(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(Se(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=ja(d,a,t,u);n.push(In(f,s,i&&i[t],l))}}return n}function _l(t,n,o){return an(t)?t(n,o):t}const Hp=(t,n)=>t===!0?n:typeof t=="string"?yn(n,t):void 0;function qp(t,n,o,r,a){for(const s of n){const i=Hp(o,s);if(i){t.add(i);const l=_l(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function ja(t,n,o,r){const a=n._rootScopes,s=_l(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Sl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Sl(l,i,s,c,r),c===null)?!1:La(Array.from(l),[""],a,s,()=>Gp(n,o,r))}function Sl(t,n,o,r,a){for(;o;)o=qp(t,n,o,r,a);return o}function Gp(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return Xe(a)&&Se(o)?o:a||{}}function Kp(t,n,o,r){let a;for(const s of n)if(a=Al($p(s,t),o),typeof a<"u")return $a(t,a)?ja(o,r,t,a):a}function Al(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Vl(t){let n=t._keys;return n||(n=t._keys=Xp(t._scopes)),n}function Xp(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const Yp=Number.EPSILON||1e-14,Rn=(t,n)=>n<t.length&&!t[n].skip&&t[n],Dl=t=>t==="x"?"y":"x";function Jp(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=Na(s,a),c=Na(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=r*d,m=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+m*(i.x-a.x),y:s.y+m*(i.y-a.y)}}}function Qp(t,n,o){const r=t.length;let a,s,i,l,c,d=Rn(t,0);for(let u=0;u<r-1;++u)if(c=d,d=Rn(t,u+1),!(!c||!d)){if(co(n[u],0,Yp)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function Zp(t,n,o="x"){const r=Dl(o),a=t.length;let s,i,l,c=Rn(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=Rn(t,d+1),!l)continue;const u=l[o],f=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=f+s*n[d])}}function eg(t,n="x"){const o=Dl(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=Rn(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=Rn(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?Pt(a[i-1])!==Pt(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}Qp(t,a,s),Zp(t,s,n)}function or(t,n,o){return Math.max(Math.min(t,o),n)}function tg(t,n){let o,r,a,s,i,l=po(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&po(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=or(a.cp1x,n.left,n.right),a.cp1y=or(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=or(a.cp2x,n.left,n.right),a.cp2y=or(a.cp2y,n.top,n.bottom)))}function ng(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")eg(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=Jp(d,l,t[Math.min(s+1,i-(r?0:1))%i],n.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}n.capBezierPoints&&tg(t,o)}function Ua(){return typeof window<"u"&&typeof document<"u"}function Wa(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function rr(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const ar=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function og(t,n){return ar(t).getPropertyValue(n)}const rg=["top","right","bottom","left"];function En(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=rg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const ag=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function sg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(ag(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function _n(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=ar(o),s=a.boxSizing==="border-box",i=En(a,"padding"),l=En(a,"border","width"),{x:c,y:d,box:u}=sg(t,o),f=i.left+(u&&l.left),m=i.top+(u&&l.top);let{width:h,height:x}=n;return s&&(h-=i.width+l.width,x-=i.height+l.height),{x:Math.round((c-f)/h*o.width/r),y:Math.round((d-m)/x*o.height/r)}}function ig(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&Wa(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=ar(s),c=En(l,"border","width"),d=En(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=rr(l.maxWidth,s,"clientWidth"),a=rr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||Jo,maxHeight:a||Jo}}const sn=t=>Math.round(t*10)/10;function lg(t,n,o,r){const a=ar(t),s=En(a,"margin"),i=rr(a.maxWidth,t,"clientWidth")||Jo,l=rr(a.maxHeight,t,"clientHeight")||Jo,c=ig(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const m=En(a,"border","width"),h=En(a,"padding");d-=h.width+m.width,u-=h.height+m.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=sn(Math.min(d,i,c.maxWidth)),u=sn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=sn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=sn(Math.floor(u*r))),{width:d,height:u}}function Nl(t,n,o){const r=n||1,a=sn(t.height*r),s=sn(t.width*r);t.height=sn(t.height),t.width=sn(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const cg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};Ua()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function Ml(t,n){const o=og(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Sn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function dg(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function ug(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Sn(t,a,o),l=Sn(a,s,o),c=Sn(s,n,o),d=Sn(i,l,o),u=Sn(l,c,o);return Sn(d,u,o)}const fg=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},mg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function Ln(t,n,o){return t?fg(n,o):mg()}function Pl(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function Tl(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function vl(t){return t==="angle"?{between:fo,compare:fp,normalize:ft}:{between:Ht,compare:(n,o)=>n-o,normalize:n=>n}}function Ol({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function hg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=vl(r),c=n.length;let{start:d,end:u,loop:f}=t,m,h;if(f){for(d+=c,u+=c,m=0,h=c;m<h&&i(l(n[d%c][r]),a,s);++m)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Fl(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=vl(r),{start:u,end:f,loop:m,style:h}=hg(t,n,o),x=[];let C=!1,y=null,p,S,V;const E=()=>c(a,V,p)&&l(a,V)!==0,A=()=>l(s,p)===0||c(s,V,p),k=()=>C||E(),g=()=>!C||A();for(let b=u,M=u;b<=f;++b)S=n[b%i],!S.skip&&(p=d(S[r]),p!==V&&(C=c(p,a,s),y===null&&k()&&(y=l(p,a)===0?b:M),y!==null&&g()&&(x.push(Ol({start:y,end:b,loop:m,count:i,style:h})),y=null),M=b,V=p));return y!==null&&x.push(Ol({start:y,end:f,loop:m,count:i,style:h})),x}function zl(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=Fl(r[a],t.points,n);s.length&&o.push(...s)}return o}function pg(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function gg(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function bg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=pg(o,a,s,r);if(r===!0)return Il(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return Il(t,gg(o,i,c,d),o,n)}function Il(t,n,o,r){return!r||!r.setContext||!o?n:yg(t,n,o,r)}function yg(t,n,o,r){const a=t._chart.getContext(),s=Rl(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,m=f;function h(x,C,y,p){const S=l?-1:1;if(x!==C){for(x+=c;o[x%c].skip;)x-=S;for(;o[C%c].skip;)C+=S;x%c!==C%c&&(d.push({start:x%c,end:C%c,loop:y,style:p}),u=p,f=C%c)}}for(const x of n){f=l?f:x.start;let C=o[f%c],y;for(m=f+1;m<=x.end;m++){const p=o[m%c];y=Rl(r.setContext(Bn(a,{type:"segment",p0:C,p1:p,p0DataIndex:(m-1)%c,p1DataIndex:m%c,datasetIndex:i}))),xg(y,u)&&h(f,m-1,x.loop,u),C=p,u=y}f<m-1&&h(f,m-1,x.loop,u)}return d}function Rl(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function xg(t,n){if(!n)return!1;const o=[],r=function(a,s){return Ta(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function sr(t,n,o){return t.options.clip?t[o]:n[o]}function kg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:sr(o,n,"left"),right:sr(o,n,"right"),top:sr(r,n,"top"),bottom:sr(r,n,"bottom")}:n}function Ll(t,n){const o=n._clip;if(o.disabled)return!1;const r=kg(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.bottom+(o.bottom===!0?0:o.bottom)}}/*!
|
|
12
12
|
* Chart.js v4.5.1
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class kg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=fl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}add(n,o){!o||!o.length||this._getAnims(n).items.push(...o)}has(n){return this._getAnims(n).items.length>0}start(n){const o=this._charts.get(n);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(n){if(!this._running)return!1;const o=this._charts.get(n);return!(!o||!o.running||!o.items.length)}stop(n){const o=this._charts.get(n);if(!o||!o.items.length)return;const r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var qt=new kg;const $l="transparent",wg={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=gl(t||$l),a=r.valid&&gl(n||$l);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Cg{constructor(n,o,r,a){const s=o[r];a=nr([n.to,a,s,n.from]);const i=nr([n.from,s,a]);this._active=!0,this._fn=n.fn||wg[n.type||typeof i],this._easing=mo[n.easing]||mo.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=o,this._prop=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=nr([n.to,o,a,n.from]),this._from=nr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class jl{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Se(n))return;const o=Object.keys(Ge.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Se(s))return;const i={};for(const l of o)i[l]=s[l];(Xe(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=Eg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Bg(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],s=n.$animations||(n.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const m=r.get(d);if(f)if(m&&f.active()){f.update(m,u,l);continue}else f.cancel();if(!m||!m.duration){n[d]=u;continue}s[d]=f=new Cg(m,n,d,u),a.push(f)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return qt.add(this._chart,r),!0}}function Bg(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Eg(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Ul(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function _g(t,n,o){if(o===!1)return!1;const r=Ul(t,o),a=Ul(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Sg(t){let n,o,r,a;return Se(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function Wl(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function Hl(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],et(d)&&(s||n===0||Mt(n)===Mt(d))&&(n+=d)}return!u&&!r.all?0:n}function Ag(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function Ha(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Vg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Dg(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function Ng(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function ql(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function Gl(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Vg(s,i,r),f=n.length;let m;for(let h=0;h<f;++h){const k=n[h],{[c]:C,[d]:w}=k,p=k._stacks||(k._stacks={});m=p[d]=Ng(a,u,C),m[l]=w,m._top=ql(m,i,!0,r.type),m._bottom=ql(m,i,!1,r.type);const A=m._visualValues||(m._visualValues={});A[l]=w}}function qa(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Mg(t,n){return Bn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Pg(t,n,o){return Bn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function bo(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const Ga=t=>t==="reset"||t==="none",Kl=(t,n)=>n?t:Object.assign({},t),Tg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:Wl(o,!0),values:null};class An{constructor(n,o){this.chart=n,this._ctx=n.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=Ha(n.vScale,n),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(n){this.index!==n&&bo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,m,h,k)=>f==="x"?m:f==="r"?k:h,s=o.xAxisID=we(r.xAxisID,qa(n,"x")),i=o.yAxisID=we(r.yAxisID,qa(n,"y")),l=o.rAxisID=we(r.rAxisID,qa(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const o=this._cachedMeta;return n===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&dl(this._data,this),n._stacked&&bo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Se(o)){const a=this._cachedMeta;this._data=Ag(o,a)}else if(r!==o){if(r){dl(r,this);const a=this._cachedMeta;bo(a),a._parsed=[]}o&&Object.isExtensible(o)&&pp(o,this),this._syncList=[],this._data=o}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const o=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=Ha(o.vScale,o),o.stack!==r.stack&&(a=!0,bo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(Gl(this,o._parsed),o._stacked=Ha(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,f,m;if(this._parsing===!1)r._parsed=a,r._sorted=!0,m=a;else{Xe(a[n])?m=this.parseArrayData(r,a,n,o):Se(a[n])?m=this.parseObjectData(r,a,n,o):m=this.parsePrimitiveData(r,a,n,o);const h=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=m[u],c&&(h()&&(c=!1),d=f);r._sorted=c}i&&Gl(this,m)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let m,h,k;for(m=0,h=a;m<h;++m)k=m+r,f[m]={[l]:u||s.parse(d[k],k),[c]:i.parse(o[k],k)};return f}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,m,h;for(u=0,f=a;u<f;++u)m=u+r,h=o[m],d[u]={x:s.parse(yn(h,l),m),y:i.parse(yn(h,c),m)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:Wl(a,!0),values:o._stacks[n.axis]._visualValues};return Hl(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=Hl(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=Tg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Dg(l);let m,h;function k(){h=a[m];const C=h[l.axis];return!et(h[n.axis])||u>C||f<C}for(m=0;m<i&&!(!k()&&(this.updateRangeFromParsed(d,n,h,c),s));++m);if(s){for(m=i-1;m>=0;--m)if(!k()){this.updateRangeFromParsed(d,n,h,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],et(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=Sg(we(this.options.clip,_g(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=a[u];f.hidden||(f.active&&d?i.push(f):f.draw(n,s))}for(u=0;u<i.length;++u)i[u].draw(n,s)}getStyle(n,o){const r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Pg(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Mg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,s}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,o){return this._resolveElementOptions(this.dataElementType.id,o,n)}_resolveElementOptions(n,o="default",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&lo(r);if(l)return Kl(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],m=d.getOptionScopes(this.getDataset(),u),h=Object.keys(Ge.elements[n]),k=()=>this.getContext(r,a,o),C=d.resolveNamedOptions(m,h,k,f);return C.$shared&&(C.$shared=c,s[i]=Object.freeze(Kl(C,c))),C}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),m=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(m,this.getContext(n,r,o))}const d=new jl(a,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,o){return!o||Ga(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){Ga(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!Ga(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const o=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.data,i=n+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=n;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&bo(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,o){o&&this._sync(["_removeElements",n,o]);const r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}de(An,"defaults",{}),de(An,"datasetElementType",null),de(An,"dataElementType",null);function vg(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=ul(r.sort((a,s)=>a-s))}return t._cache.$bar}function Og(t){const n=t.iScale,o=vg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(lo(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function Fg(t,n,o,r){const a=o.barThickness;let s,i;return ve(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function zg(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?n.end-n.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/r,ratio:o.barPercentage,start:d}}function Rg(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),n[o.axis]=d,n._custom={barStart:c,barEnd:d,start:a,end:s,min:i,max:l}}function Xl(t,n,o,r){return Xe(t)?Rg(t,n,o,r):n[o.axis]=o.parse(t,r),n}function Yl(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,m;for(d=o,u=o+r;d<u;++d)m=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(Xl(m,f,s,d));return c}function Ka(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Ig(t,n,o){return t!==0?Mt(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function Lg(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function $g(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=Lg(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[Jl(u,i,l,c)]=!0,a=d)),s[Jl(a,i,l,c)]=!0,t.borderSkipped=s}function Jl(t,n,o,r){return r?(t=jg(t,n,o),t=Ql(t,o,n)):t=Ql(t,n,o),t}function jg(t,n,o){return t===n?o:t===o?n:t}function Ql(t,n,o){return t==="start"?n:t==="end"?o:t}function Ug(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class ir extends An{parsePrimitiveData(n,o,r,a){return Yl(n,o,r,a)}parseArrayData(n,o,r,a){return Yl(n,o,r,a)}parseObjectData(n,o,r,a){const{iScale:s,vScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let m,h,k,C;for(m=r,h=r+a;m<h;++m)C=o[m],k={},k[s.axis]=s.parse(yn(C,d),m),f.push(Xl(yn(C,u),k,i,m));return f}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._custom;s&&o===this._cachedMeta.vScale&&(n.min=Math.min(n.min,s.min),n.max=Math.max(n.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const o=this._cachedMeta,{iScale:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=Ka(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,n)}updateElements(n,o,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:m}=this._getSharedOptions(o,a);for(let h=o;h<o+r;h++){const k=this.getParsed(h),C=s||ve(k[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),w=this._calculateBarIndexPixels(h,u),p=(k._stacks||{})[l.axis],A={horizontal:d,base:C.base,enableBorderRadius:!p||Ka(k._custom)||i===p._top||i===p._bottom,x:d?C.head:w.center,y:d?w.center:C.head,height:d?w.size:Math.abs(C.size),width:d?Math.abs(C.size):w.size};m&&(A.options=f||this.resolveDataElementOptions(h,n[h].active?"active":a));const D=A.options||n[h].options;$g(A,D,p,i),Ug(A,D,u.ratio),this.updateElement(n[h],h,A,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(h=>h[r.axis]===c),m=f&&f[u.vScale.axis];if(ve(m)||isNaN(m))return!0};for(const u of a)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===n))break;return i.length||i.push(void 0),i}_getStackCount(n){return this._getStacks(void 0,n).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const n=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(n).filter(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[we(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||Og(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=Ka(d);let f=c[o.axis],m=0,h=r?this.applyStack(o,c,r):f,k,C;h!==f&&(m=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Mt(f)!==Mt(d.barEnd)&&(m=0),m+=f);const w=!ve(s)&&!u?s:m;let p=o.getPixelForValue(w);if(this.chart.getDataVisibility(n)?k=o.getPixelForValue(m+h):k=p,C=k-p,Math.abs(C)<i){C=Ig(C,o,l)*i,f===l&&(p-=C/2);const A=o.getPixelForDecimal(0),D=o.getPixelForDecimal(1),S=Math.min(A,D),V=Math.max(A,D);p=Math.max(Math.min(p,V),S),k=p+C,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(k)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const A=Mt(C)*o.getLineWidthForValue(l)/2;p+=A,C-=A}return{size:C,base:p,head:k,center:k+C/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=we(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=a.barThickness==="flex"?zg(n,o,a,u*d):Fg(n,o,a,u*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(we(m,this.getFirstScaleIdForIndexAxis())),k=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+h;l=f.start+f.chunk*k+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.axis],n),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const n=this._cachedMeta,o=n.vScale,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}de(ir,"id","bar"),de(ir,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),de(ir,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Wg(t,n,o){let r=1,a=1,s=0,i=0;if(n<je){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),m=Math.sin(c),h=(D,S,V)=>fo(D,l,c,!0)?1:Math.max(S,S*o,V,V*o),k=(D,S,V)=>fo(D,l,c,!0)?-1:Math.min(S,S*o,V,V*o),C=h(0,d,f),w=h(Je,u,m),p=k(Fe,d,f),A=k(Fe+Je,u,m);r=(C-p)/2,a=(w-A)/2,s=-(C+p)/2,i=-(w+A)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class jn extends An{constructor(n,o){super(n,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,o){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Se(r[n])){const{key:c="value"}=this._parsing;s=d=>+yn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return Wt(this.options.rotation-90)}_getCircumference(){return Wt(this.options.circumference)}_getRotationExtents(){let n=je,o=-je;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._getCircumference();n=Math.min(n,s),o=Math.max(o,s+i)}return{rotation:n,circumference:o-n}}update(n){const o=this.chart,{chartArea:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(Qh(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:m,ratioY:h,offsetX:k,offsetY:C}=Wg(f,u,c),w=(r.width-i)/m,p=(r.height-i)/h,A=Math.max(Math.min(w,p)/2,0),D=el(this.options.radius,A),S=Math.max(D*c,0),V=(D-S)/this._getVisibleDatasetWeightTotal();this.offsetX=k*D,this.offsetY=C*D,a.total=this.calculateTotal(),this.outerRadius=D-V*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-V*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/je)}updateElements(n,o,r,a){const s=a==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,m=s&&d.animateScale,h=m?0:this.innerRadius,k=m?0:this.outerRadius,{sharedOptions:C,includeOptions:w}=this._getSharedOptions(o,a);let p=this._getRotation(),A;for(A=0;A<o;++A)p+=this._circumference(A,s);for(A=o;A<o+r;++A){const D=this._circumference(A,s),S=n[A],V={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+D,circumference:D,outerRadius:k,innerRadius:h};w&&(V.options=C||this.resolveDataElementOptions(A,S.active?"active":a)),p+=D,this.updateElement(S,A,V,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?je*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=Oa(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(we(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}de(jn,"id","doughnut"),de(jn,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),de(jn,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),de(jn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=n.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=n.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!n.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class lr extends An{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=yp(o,a,i);this._drawStart=l,this._drawCount=c,xp(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,a),m=i.axis,h=l.axis,{spanGaps:k,segment:C}=this.options,w=uo(k)?k:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",A=o+r,D=n.length;let S=o>0&&this.getParsed(o-1);for(let V=0;V<D;++V){const B=n[V],g=p?B:{};if(V<o||V>=A){g.skip=!0;continue}const b=this.getParsed(V),_=ve(b[h]),y=g[m]=i.getPixelForValue(b[m],V),x=g[h]=s||_?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[h],V);g.skip=isNaN(y)||isNaN(x)||_,g.stop=V>0&&Math.abs(b[m]-S[m])>w,C&&(g.parsed=b,g.raw=d.data[V]),f&&(g.options=u||this.resolveDataElementOptions(V,B.active?"active":a)),p||this.updateElement(B,V,g,a),S=b}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}de(lr,"id","line"),de(lr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),de(lr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Xa extends jn{}de(Xa,"id","pie"),de(Xa,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Vn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ya{constructor(n){de(this,"options");this.options=n||{}}static override(n){Object.assign(Ya.prototype,n)}init(){}formats(){return Vn()}parse(){return Vn()}format(){return Vn()}add(){return Vn()}diff(){return Vn()}startOf(){return Vn()}endOf(){return Vn()}}var Hg={_date:Ya};function qg(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?mp:kn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const m=d(s,n,o-f),h=d(s,n,o+f);return{lo:m.lo,hi:h.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:m}=t,h=m.slice(0,u.lo+1).reverse().findIndex(C=>!ve(C[f.axis]));u.lo-=Math.max(0,h);const k=m.slice(u.hi).findIndex(C=>!ve(C[f.axis]));u.hi+=Math.max(0,k)}return u}}return{lo:0,hi:s.length-1}}function cr(t,n,o,r,a){const s=t.getSortedVisibleDatasetMetas(),i=o[n];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:m}=qg(s[l],n,i,a);for(let h=f;h<=m;++h){const k=u[h];k.skip||r(k,d,h)}}}function Gg(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Ja(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||cr(t,o,n,function(l,c,d){!a&&!po(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function Kg(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=ll(i,{x:n.x,y:n.y});fo(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return cr(t,o,n,s),a}function Xg(t,n,o,r,a,s){let i=[];const l=Gg(o);let c=Number.POSITIVE_INFINITY;function d(u,f,m){const h=u.inRange(n.x,n.y,a);if(r&&!h)return;const k=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(k))&&!h)return;const w=l(n,k);w<c?(i=[{element:u,datasetIndex:f,index:m}],c=w):w===c&&i.push({element:u,datasetIndex:f,index:m})}return cr(t,o,n,d),i}function Qa(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?Kg(t,n,o,a):Xg(t,n,o,r,a,s)}function Zl(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return cr(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var Yg={modes:{index(t,n,o,r){const a=_n(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Ja(t,a,s,r,i):Qa(t,a,s,!1,r,i),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,n,o,r){const a=_n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Ja(t,a,s,r,i):Qa(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=_n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Ja(t,a,s,r,i)},nearest(t,n,o,r){const a=_n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Qa(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=_n(n,t);return Zl(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=_n(n,t);return Zl(t,a,"y",o.intersect,r)}}};const ec=["left","top","right","bottom"];function yo(t,n){return t.filter(o=>o.pos===n)}function tc(t,n){return t.filter(o=>ec.indexOf(o.pos)===-1&&o.box.axis===n)}function xo(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function Jg(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function Qg(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!ec.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function Zg(t,n){const o=Qg(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function e0(t){const n=Jg(t),o=xo(n.filter(d=>d.box.fullSize),!0),r=xo(yo(n,"left"),!0),a=xo(yo(n,"right")),s=xo(yo(n,"top"),!0),i=xo(yo(n,"bottom")),l=tc(n,"x"),c=tc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:yo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function nc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function oc(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function t0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Se(a)){o.size&&(t[a]-=o.size);const f=r[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,t[a]+=o.size}s.getPadding&&oc(i,s.getPadding());const l=Math.max(0,n.outerWidth-nc(i,t,"left","right")),c=Math.max(0,n.outerHeight-nc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function n0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function o0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function ko(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,o0(l.horizontal,n));const{same:f,other:m}=t0(n,o,l,r);d|=f&&a.length,u=u||m,c.fullSize||a.push(l)}return d&&ko(a,n,o,r)||u}function dr(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function rc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=n.w*u,m=d.size||c.height;lo(d.start)&&(i=d.start),c.fullSize?dr(c,a.left,i,o.outerWidth-a.right-a.left,m):dr(c,n.left+d.placed,i,f,m),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,m=d.size||c.width;lo(d.start)&&(s=d.start),c.fullSize?dr(c,s,a.top,m,o.outerHeight-a.bottom-a.top):dr(c,s,n.top+d.placed,m,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var xt={addBox(t,n){t.boxes||(t.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(o){n.draw(o)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=yt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=e0(t.boxes),c=l.vertical,d=l.horizontal;Oe(t.boxes,C=>{typeof C.beforeLayout=="function"&&C.beforeLayout()});const u=c.reduce((C,w)=>w.box.options&&w.box.options.display===!1?C:C+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),m=Object.assign({},a);oc(m,yt(r));const h=Object.assign({maxPadding:m,w:s,h:i,x:a.left,y:a.top},a),k=Zg(c.concat(d),f);ko(l.fullSize,h,f,k),ko(c,h,f,k),ko(d,h,f,k)&&ko(c,h,f,k),n0(h),rc(l.leftAndTop,h,f,k),h.x+=h.w,h.y+=h.h,rc(l.rightAndBottom,h,f,k),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Oe(l.chartArea,C=>{const w=C.box;Object.assign(w,t.chartArea),w.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class ac{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class r0 extends ac{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const ur="$chartjs",a0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sc=t=>t===null||t==="";function s0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[ur]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",sc(a)){const s=Ml(t,"width");s!==void 0&&(t.width=s)}if(sc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=Ml(t,"height");s!==void 0&&(t.height=s)}return t}const ic=lg?{passive:!0}:!1;function i0(t,n,o){t&&t.addEventListener(n,o,ic)}function l0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,ic)}function c0(t,n){const o=a0[t.type]||t.type,{x:r,y:a}=_n(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function fr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function d0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||fr(l.addedNodes,r),i=i&&!fr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function u0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||fr(l.removedNodes,r),i=i&&!fr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const wo=new Map;let lc=0;function cc(){const t=window.devicePixelRatio;t!==lc&&(lc=t,wo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function f0(t,n){wo.size||window.addEventListener("resize",cc),wo.set(t,n)}function m0(t){wo.delete(t),wo.size||window.removeEventListener("resize",cc)}function h0(t,n,o){const r=t.canvas,a=r&&Wa(r);if(!a)return;const s=ml((l,c)=>{const d=a.clientWidth;o(l,c),d<a.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(a),f0(t,s),i}function Za(t,n,o){o&&o.disconnect(),n==="resize"&&m0(t)}function p0(t,n,o){const r=t.canvas,a=ml(s=>{t.ctx!==null&&o(c0(s,t))},t);return i0(r,n,a),a}class g0 extends ac{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(s0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[ur])return!1;const r=o[ur].initial;["height","width"].forEach(s=>{const i=r[s];ve(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[ur],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:d0,detach:u0,resize:h0}[o]||p0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:Za,detach:Za,resize:Za}[o]||l0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return ig(n,o,r,a)}isAttached(n){const o=n&&Wa(n);return!!(o&&o.isConnected)}}function b0(t){return!Ua()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?r0:g0}let Gt=(Hr=class{constructor(){de(this,"x");de(this,"y");de(this,"active",!1);de(this,"options");de(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return uo(this.x)&&uo(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},de(Hr,"defaults",{}),de(Hr,"defaultRoutes"),Hr);function y0(t,n){const o=t.options.ticks,r=x0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?w0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return C0(n,d,s,i/a),d;const u=k0(s,n,a);if(i>0){let f,m;const h=i>1?Math.round((c-l)/(i-1)):null;for(mr(n,d,u,ve(h)?0:l-h,l),f=0,m=i-1;f<m;f++)mr(n,d,u,s[f],s[f+1]);return mr(n,d,u,c,ve(h)?n.length:c+h),d}return mr(n,d,u),d}function x0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function k0(t,n,o){const r=B0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=sp(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function w0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function C0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function mr(t,n,o,r,a){const s=we(r,0),i=Math.min(we(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(n.push(t[d]),l++,u=Math.round(s+l*o))}function B0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const E0=t=>t==="left"?"right":t==="right"?"left":t,dc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,uc=(t,n)=>Math.min(n||t,t);function fc(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function _0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function S0(t,n){Oe(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Co(t){return t.drawTicks?t.tickLength:0}function mc(t,n){if(!t.display)return 0;const o=ot(t.font,n),r=yt(t.padding);return(Xe(t.text)?t.text.length:1)*o.lineHeight+r.height}function A0(t,n){return Bn(t,{scale:n,type:"scale"})}function V0(t,n,o){return Bn(t,{tick:o,index:n,type:"tick"})}function D0(t,n,o){let r=Pa(t);return(o&&n!=="right"||!o&&n==="right")&&(r=E0(r)),r}function N0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,m,h,k;const C=i-a,w=l-s;if(t.isHorizontal()){if(h=nt(r,s,l),Se(o)){const p=Object.keys(o)[0],A=o[p];k=u[p].getPixelForValue(A)+C-n}else o==="center"?k=(d.bottom+d.top)/2+C-n:k=dc(t,o,n);m=l-s}else{if(Se(o)){const p=Object.keys(o)[0],A=o[p];h=u[p].getPixelForValue(A)-w+n}else o==="center"?h=(d.left+d.right)/2-w+n:h=dc(t,o,n);k=nt(r,i,a),f=o==="left"?-Je:Je}return{titleX:h,titleY:k,maxWidth:m,rotation:f}}class Un extends Gt{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,o){return n}getUserBounds(){let{_userMin:n,_userMax:o,_suggestedMin:r,_suggestedMax:a}=this;return n=Nt(n,Number.POSITIVE_INFINITY),o=Nt(o,Number.NEGATIVE_INFINITY),r=Nt(r,Number.POSITIVE_INFINITY),a=Nt(a,Number.NEGATIVE_INFINITY),{min:Nt(n,r),max:Nt(o,a),minDefined:et(n),maxDefined:et(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:Nt(o,Nt(r,o)),max:Nt(r,Nt(o,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$e(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ip(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?fc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=y0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,o,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){$e(this.options.afterUpdate,[this])}beforeSetDimensions(){$e(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){$e(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),$e(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$e(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=$e(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){$e(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$e(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=uc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,m=u.highest.height,h=tt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:h/(r-1),f+6>l&&(l=h/(r-(n.offset?.5:1)),c=this.maxHeight-Co(n.grid)-o.padding-mc(n.title,this.chart.options.font),d=Math.sqrt(f*f+m*m),i=dp(Math.min(Math.asin(tt((u.highest.height+6)/l,-1,1)),Math.asin(tt(c/d,-1,1))-Math.asin(tt(m/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){$e(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$e(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=mc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Co(s)+c):(n.height=this.maxHeight,n.width=Co(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:m}=this._getLabelSizes(),h=r.padding*2,k=Wt(this.labelRotation),C=Math.cos(k),w=Math.sin(k);if(l){const p=r.mirror?0:w*f.width+C*m.height;n.height=Math.min(this.maxHeight,n.height+p+h)}else{const p=r.mirror?0:C*f.width+w*m.height;n.width=Math.min(this.maxWidth,n.width+p+h)}this._calculatePadding(d,u,w,C)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,o,r,a){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,h=0;c?d?(m=a*n.width,h=r*o.height):(m=r*n.height,h=a*o.width):s==="start"?h=o.width:s==="end"?m=n.width:s!=="inner"&&(m=n.width/2,h=o.width/2),this.paddingLeft=Math.max((m-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=n.height/2;s==="start"?(u=0,f=n.height):s==="end"&&(u=o.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){$e(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:o}=this.options;return o==="top"||o==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let o,r;for(o=0,r=n.length;o<r;o++)ve(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=fc(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/uc(o,r));let d=0,u=0,f,m,h,k,C,w,p,A,D,S,V;for(f=0;f<o;f+=c){if(k=n[f].label,C=this._resolveTickFontOptions(f),a.font=w=C.string,p=s[w]=s[w]||{data:{},gc:[]},A=C.lineHeight,D=S=0,!ve(k)&&!Xe(k))D=xl(a,p.data,p.gc,D,k),S=A;else if(Xe(k))for(m=0,h=k.length;m<h;++m)V=k[m],!ve(V)&&!Xe(V)&&(D=xl(a,p.data,p.gc,D,V),S+=A);i.push(D),l.push(S),d=Math.max(D,d),u=Math.max(S,u)}S0(s,o);const B=i.indexOf(d),g=l.indexOf(u),b=_=>({width:i[_]||0,height:l[_]||0});return{first:b(0),last:b(o-1),widest:b(B),highest:b(g),widths:i,heights:l}}getLabelForValue(n){return n}getPixelForValue(n,o){return NaN}getValueForPixel(n){}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const o=this._startPixel+n*this._length;return fp(this._alignToPixels?Cn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const r=o[n];return r.$context||(r.$context=V0(this.getContext(),n,r))}return this.$context||(this.$context=A0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=Wt(this.labelRotation),r=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=n.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),m=Co(s),h=[],k=l.setContext(this.getContext()),C=k.display?k.width:0,w=C/2,p=function(v){return Cn(r,v,C)};let A,D,S,V,B,g,b,_,y,x,E,M;if(i==="top")A=p(this.bottom),g=this.bottom-m,_=A-w,x=p(n.top)+w,M=n.bottom;else if(i==="bottom")A=p(this.top),x=n.top,M=p(n.bottom)-w,g=A+w,_=this.top+m;else if(i==="left")A=p(this.right),B=this.right-m,b=A-w,y=p(n.left)+w,E=n.right;else if(i==="right")A=p(this.left),y=n.left,E=p(n.right)-w,B=A+w,b=this.left+m;else if(o==="x"){if(i==="center")A=p((n.top+n.bottom)/2+.5);else if(Se(i)){const v=Object.keys(i)[0],I=i[v];A=p(this.chart.scales[v].getPixelForValue(I))}x=n.top,M=n.bottom,g=A+w,_=g+m}else if(o==="y"){if(i==="center")A=p((n.left+n.right)/2);else if(Se(i)){const v=Object.keys(i)[0],I=i[v];A=p(this.chart.scales[v].getPixelForValue(I))}B=A-w,b=B-m,y=n.left,E=n.right}const T=we(a.ticks.maxTicksLimit,f),$=Math.max(1,Math.ceil(f/T));for(D=0;D<f;D+=$){const v=this.getContext(D),I=s.setContext(v),j=l.setContext(v),U=I.lineWidth,P=I.color,R=j.dash||[],G=j.dashOffset,q=I.tickWidth,W=I.tickColor,Z=I.tickBorderDash||[],ne=I.tickBorderDashOffset;S=_0(this,D,c),S!==void 0&&(V=Cn(r,S,U),d?B=b=y=E=V:g=_=x=M=V,h.push({tx1:B,ty1:g,tx2:b,ty2:_,x1:y,y1:x,x2:E,y2:M,width:U,color:P,borderDash:R,borderDashOffset:G,tickWidth:q,tickColor:W,tickBorderDash:Z,tickBorderDashOffset:ne}))}return this._ticksLength=f,this._borderValue=A,h}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,m=Co(r.grid),h=m+u,k=f?-u:h,C=-Wt(this.labelRotation),w=[];let p,A,D,S,V,B,g,b,_,y,x,E,M="middle";if(a==="top")B=this.bottom-k,g=this._getXAxisLabelAlignment();else if(a==="bottom")B=this.top+k,g=this._getXAxisLabelAlignment();else if(a==="left"){const $=this._getYAxisLabelAlignment(m);g=$.textAlign,V=$.x}else if(a==="right"){const $=this._getYAxisLabelAlignment(m);g=$.textAlign,V=$.x}else if(o==="x"){if(a==="center")B=(n.top+n.bottom)/2+h;else if(Se(a)){const $=Object.keys(a)[0],v=a[$];B=this.chart.scales[$].getPixelForValue(v)+h}g=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")V=(n.left+n.right)/2-h;else if(Se(a)){const $=Object.keys(a)[0],v=a[$];V=this.chart.scales[$].getPixelForValue(v)}g=this._getYAxisLabelAlignment(m).textAlign}o==="y"&&(c==="start"?M="top":c==="end"&&(M="bottom"));const T=this._getLabelSizes();for(p=0,A=l.length;p<A;++p){D=l[p],S=D.label;const $=s.setContext(this.getContext(p));b=this.getPixelForTick(p)+s.labelOffset,_=this._resolveTickFontOptions(p),y=_.lineHeight,x=Xe(S)?S.length:1;const v=x/2,I=$.color,j=$.textStrokeColor,U=$.textStrokeWidth;let P=g;i?(V=b,g==="inner"&&(p===A-1?P=this.options.reverse?"left":"right":p===0?P=this.options.reverse?"right":"left":P="center"),a==="top"?d==="near"||C!==0?E=-x*y+y/2:d==="center"?E=-T.highest.height/2-v*y+y:E=-T.highest.height+y/2:d==="near"||C!==0?E=y/2:d==="center"?E=T.highest.height/2-v*y:E=T.highest.height-x*y,f&&(E*=-1),C!==0&&!$.showLabelBackdrop&&(V+=y/2*Math.sin(C))):(B=b,E=(1-x)*y/2);let R;if($.showLabelBackdrop){const G=yt($.backdropPadding),q=T.heights[p],W=T.widths[p];let Z=E-G.top,ne=0-G.left;switch(M){case"middle":Z-=q/2;break;case"bottom":Z-=q;break}switch(g){case"center":ne-=W/2;break;case"right":ne-=W;break;case"inner":p===A-1?ne-=W:p>0&&(ne-=W/2);break}R={left:ne,top:Z,width:W+G.width,height:q+G.height,color:$.backdropColor}}w.push({label:S,font:_,textOffset:E,options:{rotation:C,color:I,strokeColor:j,strokeWidth:U,textAlign:P,textBaseline:M,translation:[V,B],backdrop:R}})}return w}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-Wt(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:o},left:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:o,options:{border:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,m;this.isHorizontal()?(d=Cn(n,this.left,i)-i/2,u=Cn(n,this.right,l)+l/2,f=m=c):(f=Cn(n,this.top,i)-i/2,m=Cn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,m),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Zo(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;go(r,d,0,u,c,l)}a&&er(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=ot(r.font),i=yt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Se(o)?(c+=i.bottom,Xe(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:m}=N0(this,c,o,l);go(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:m,textAlign:D0(l,o,a),textBaseline:"middle",translation:[d,u]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,o=n.ticks&&n.ticks.z||0,r=we(n.grid&&n.grid.z,-1),a=we(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==Un.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return ot(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class hr{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const o=Object.getPrototypeOf(n);let r;T0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,M0(n,i,r),this.override&&Ge.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in Ge[a]&&(delete Ge[a][r],this.override&&delete wn[r])}}function M0(t,n,o){const r=so(Object.create(null),[o?Ge.get(o):{},Ge.get(n),t.defaults]);Ge.set(n,r),t.defaultRoutes&&P0(n,t.defaultRoutes),t.descriptors&&Ge.describe(n,t.descriptors)}function P0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");Ge.route(s,a,c,l)})}function T0(t){return"id"in t&&"defaults"in t}class v0{constructor(){this.controllers=new hr(An,"datasets",!0),this.elements=new hr(Gt,"elements"),this.plugins=new hr(Object,"plugins"),this.scales=new hr(Un,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,o,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):Oe(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=Da(n);$e(r["before"+a],[],r),o[n](r),$e(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var Pt=new v0;class O0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if($e(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){ve(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),o}_createDescriptors(n,o){const r=n&&n.config,a=we(r.options&&r.options.plugins,{}),s=F0(r);return a===!1&&!o?[]:R0(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function F0(t){const n={},o=[],r=Object.keys(Pt.plugins.items);for(let s=0;s<r.length;s++)o.push(Pt.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function z0(t,n){return!n&&t===!1?null:t===!0?{}:t}function R0(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=z0(r[c],a);d!==null&&s.push({plugin:l,options:I0(t.config,{plugin:l,local:o[c]},d,i)})}return s}function I0(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function es(t,n){const o=Ge.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function L0(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function $0(t,n){return t===n?"_index_":"_value_"}function hc(t){if(t==="x"||t==="y"||t==="r")return t}function j0(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function ts(t,...n){if(hc(t))return t;for(const o of n){const r=o.axis||j0(o.position)||t.length>1&&hc(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function pc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function U0(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return pc(t,"x",o[0])||pc(t,"y",o[0])}return{}}function W0(t,n){const o=wn[t.type]||{scales:{}},r=n.scales||{},a=es(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Se(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=ts(i,l,U0(i,t),Ge.scales[l.type]),d=$0(c,a),u=o.scales||{};s[i]=io(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||es(l,n),u=(wn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const m=L0(f,c),h=i[m+"AxisID"]||m;s[h]=s[h]||Object.create(null),io(s[h],[{axis:m},r[h],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];io(l,[Ge.scales[l.type],Ge.scale])}),s}function gc(t){const n=t.options||(t.options={});n.plugins=we(n.plugins,{}),n.scales=W0(t,n)}function bc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function H0(t){return t=t||{},t.data=bc(t.data),gc(t),t}const yc=new Map,xc=new Set;function pr(t,n){let o=yc.get(t);return o||(o=n(),yc.set(t,o),xc.add(o)),o}const Bo=(t,n,o)=>{const r=yn(n,o);r!==void 0&&t.add(r)};class q0{constructor(n){this._config=H0(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=bc(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),gc(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return pr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return pr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return pr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return pr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>Bo(c,n,f))),u.forEach(f=>Bo(c,a,f)),u.forEach(f=>Bo(c,wn[s]||{},f)),u.forEach(f=>Bo(c,Ge,f)),u.forEach(f=>Bo(c,Fa,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),xc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,wn[o]||{},Ge.datasets[o]||{},{type:o},Ge,Fa]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=kc(this._resolverCache,n,a);let c=i;if(K0(i,o)){s.$shared=!1,r=an(r)?r():r;const d=this.createResolver(n,r,l);c=In(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=kc(this._resolverCache,n,r);return Se(o)?In(s,o,void 0,a):s}}function kc(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:La(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const G0=t=>Se(t)&&Object.getOwnPropertyNames(t).some(n=>an(t[n]));function K0(t,n){const{isScriptable:o,isIndexable:r}=Bl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(an(l)||G0(l))||i&&Xe(l))return!0}return!1}var X0="4.5.1";const Y0=["top","bottom","left","right","chartArea"];function wc(t,n){return t==="top"||t==="bottom"||Y0.indexOf(t)===-1&&n==="x"}function Cc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Bc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),$e(o&&o.onComplete,[t],n)}function J0(t){const n=t.chart,o=n.options.animation;$e(o&&o.onProgress,[t],n)}function Ec(t){return Ua()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const gr={},_c=t=>{const n=Ec(t);return Object.values(gr).filter(o=>o.canvas===n).pop()};function Q0(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function Z0(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class Kt{static register(...n){Pt.add(...n),Sc()}static unregister(...n){Pt.remove(...n),Sc()}constructor(n,o){const r=this.config=new q0(o),a=Ec(n),s=_c(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||b0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Jh(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new O0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=gp(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],gr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}qt.listen(this,"complete",Bc),qt.listen(this,"progress",J0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return ve(n)?o&&s?s:a?r/a:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}get registry(){return Pt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return kl(this.canvas,this.ctx),this}stop(){return qt.stop(this),this}resize(n,o){qt.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Nl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),$e(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Oe(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=ts(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Oe(s,i=>{const l=i.options,c=l.id,d=ts(c,l),u=we(l.type,i.dtype);(l.position===void 0||wc(l.position,d)!==wc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const m=Pt.getScale(u);f=new m({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Oe(a,(i,l)=>{i||delete r[l]}),Oe(r,i=>{xt.configure(this,i,i.options),xt.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Cc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||es(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=Pt.getController(l),{datasetElementType:d,dataElementType:u}=Ge.datasets[l];Object.assign(c,{dataElementType:Pt.getElement(u),datasetElementType:d&&Pt.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Oe(this.data.datasets,(n,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const o=this.config;o.update();const r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),m=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(m),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Oe(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Cc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Oe(this.scales,n=>{xt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!ol(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;Q0(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!ol(a,r(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;xt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Oe(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,an(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(qt.has(this)?this.attached&&!qt.running(this)&&qt.start(this):(this.draw(),Bc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(n=0;n<o.length&&o[n].z<=0;++n)o[n].draw(this.chartArea);for(this._drawDatasets();n<o.length;++n)o[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const o=this._sortedMetasets,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o)this._drawDataset(n[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const o=this.ctx,r={meta:n,index:n.index,cancelable:!0},a=Ll(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Zo(o,a),n.controller.draw(),a&&er(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return po(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=Yg.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:n,_dataset:o,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=Bn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);lo(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a:void 0))}hide(n,o){this._updateVisibility(n,o,!1)}show(n,o){this._updateVisibility(n,o,!0)}_destroyDatasetMeta(n){const o=this._metasets[n];o&&o.controller&&o.controller._destroy(),delete this._metasets[n]}_stop(){let n,o;for(this.stop(),qt.remove(this),n=0,o=this.data.datasets.length;n<o;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:o}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),kl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete gr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,o=this.platform,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Oe(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(c,d)=>{n[c]&&(o.removeEventListener(this,c,d),delete n[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Oe(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Oe(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=n.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!Xo(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,n),l=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=op(n),d=Z0(n,this._lastEvent,r,c);r&&(this._lastEvent=null,$e(s.onHover,[n,l,this],this),c&&$e(s.onClick,[n,l,this],this));const u=!Xo(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}de(Kt,"defaults",Ge),de(Kt,"instances",gr),de(Kt,"overrides",wn),de(Kt,"registry",Pt),de(Kt,"version",X0),de(Kt,"getChart",_c);function Sc(){return Oe(Kt.instances,t=>t._plugins.invalidate())}function eb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,ft(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const m=Math.min(d/l,ft(r-o));t.arc(a,s,l+d/2,o-m/2,r+m/2,!0)}else{const m=Math.min(d/2,i*ft(r-o));if(u==="round")t.arc(a,s,m,o-Fe/2,r+Fe/2,!0);else if(u==="bevel"){const h=2*m*m,k=-h*Math.cos(o+Fe/2)+a,C=-h*Math.sin(o+Fe/2)+s,w=h*Math.cos(r+Fe/2)+a,p=h*Math.sin(r+Fe/2)+s;t.lineTo(k,C),t.lineTo(w,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function tb(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+Je,r-Je),t.closePath(),t.clip()}function nb(t){return Ia(t,["outerStart","outerEnd","innerStart","innerEnd"])}function ob(t,n,o,r){const a=nb(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return tt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:tt(a.innerStart,0,i),innerEnd:tt(a.innerEnd,0,i)}}function Wn(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function br(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+r+o-d,0),m=u>0?u+r+o+d:0;let h=0;const k=a-c;if(r){const $=u>0?u-r:0,v=f>0?f-r:0,I=($+v)/2,j=I!==0?k*I/(I+r):k;h=(k-j)/2}const C=Math.max(.001,k*f-o/Fe)/f,w=(k-C)/2,p=c+w+h,A=a-w-h,{outerStart:D,outerEnd:S,innerStart:V,innerEnd:B}=ob(n,m,f,A-p),g=f-D,b=f-S,_=p+D/g,y=A-S/b,x=m+V,E=m+B,M=p+V/x,T=A-B/E;if(t.beginPath(),s){const $=(_+y)/2;if(t.arc(i,l,f,_,$),t.arc(i,l,f,$,y),S>0){const U=Wn(b,y,i,l);t.arc(U.x,U.y,S,y,A+Je)}const v=Wn(E,A,i,l);if(t.lineTo(v.x,v.y),B>0){const U=Wn(E,T,i,l);t.arc(U.x,U.y,B,A+Je,T+Math.PI)}const I=(A-B/m+(p+V/m))/2;if(t.arc(i,l,m,A-B/m,I,!0),t.arc(i,l,m,I,p+V/m,!0),V>0){const U=Wn(x,M,i,l);t.arc(U.x,U.y,V,M+Math.PI,p-Je)}const j=Wn(g,p,i,l);if(t.lineTo(j.x,j.y),D>0){const U=Wn(g,_,i,l);t.arc(U.x,U.y,D,p-Je,_)}}else{t.moveTo(i,l);const $=Math.cos(_)*f+i,v=Math.sin(_)*f+l;t.lineTo($,v);const I=Math.cos(y)*f+i,j=Math.sin(y)*f+l;t.lineTo(I,j)}t.closePath()}function rb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){br(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%je||je))}return br(t,n,o,r,c,a),t.fill(),c}function ab(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:m,borderRadius:h}=c,k=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=m,k?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let C=n.endAngle;if(s){br(t,n,o,r,C,a);for(let w=0;w<s;++w)t.stroke();isNaN(l)||(C=i+(l%je||je))}k&&tb(t,n,C),c.selfJoin&&C-i>=Fe&&h===0&&u!=="miter"&&eb(t,n,C),s||(br(t,n,o,r,C,a),t.stroke())}class Eo extends Gt{constructor(o){super();de(this,"circumference");de(this,"endAngle");de(this,"fullCircles");de(this,"innerRadius");de(this,"outerRadius");de(this,"pixelMargin");de(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=ll(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,k=we(m,d-c),C=fo(i,c,d)&&c!==d,w=k>=je||C,p=Ht(l,u+h,f+h);return w&&p}getCenterPoint(o){const{x:r,y:a,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,f=(s+i)/2,m=(l+c+u+d)/2;return{x:r+Math.cos(f)*m,y:a+Math.sin(f)*m}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>je?Math.floor(a/je):0,a===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(Fe,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,rb(o,this,u,i,l),ab(o,this,u,i,l),o.restore()}}de(Eo,"id","arc"),de(Eo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),de(Eo,"defaultRoutes",{backgroundColor:"backgroundColor"}),de(Eo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Ac(t,n,o=n){t.lineCap=we(o.borderCapStyle,n.borderCapStyle),t.setLineDash(we(o.borderDash,n.borderDash)),t.lineDashOffset=we(o.borderDashOffset,n.borderDashOffset),t.lineJoin=we(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=we(o.borderWidth,n.borderWidth),t.strokeStyle=we(o.borderColor,n.borderColor)}function sb(t,n,o){t.lineTo(o.x,o.y)}function ib(t){return t.stepped?Np:t.tension||t.cubicInterpolationMode==="monotone"?Mp:sb}function Vc(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function lb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Vc(a,o,r),u=ib(s);let{move:f=!0,reverse:m}=r||{},h,k,C;for(h=0;h<=d;++h)k=a[(l+(m?d-h:h))%i],!k.skip&&(f?(t.moveTo(k.x,k.y),f=!1):u(t,C,k,m,s.stepped),C=k);return c&&(k=a[(l+(m?d:0))%i],u(t,C,k,m,s.stepped)),!!c}function cb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Vc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,m,h,k,C,w,p;const A=S=>(i+(d?l-S:S))%s,D=()=>{C!==w&&(t.lineTo(u,w),t.lineTo(u,C),t.lineTo(u,p))};for(c&&(h=a[A(0)],t.moveTo(h.x,h.y)),m=0;m<=l;++m){if(h=a[A(m)],h.skip)continue;const S=h.x,V=h.y,B=S|0;B===k?(V<C?C=V:V>w&&(w=V),u=(f*u+S)/++f):(D(),t.lineTo(S,V),k=B,f=0,C=w=V),p=V}D()}function ns(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?cb:lb}function db(t){return t.stepped?cg:t.tension||t.cubicInterpolationMode==="monotone"?dg:Sn}function ub(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Ac(t,n.options),t.stroke(a)}function fb(t,n,o,r){const{segments:a,options:s}=n,i=ns(n);for(const l of a)Ac(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const mb=typeof Path2D=="function";function hb(t,n,o,r){mb&&!n.options.segment?ub(t,n,o,r):fb(t,n,o,r)}class ln extends Gt{constructor(n){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,n&&Object.assign(this,n)}updateControlPoints(n,o){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;tg(this._points,r,n,a,o),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=gg(this,this.options.segment))}first(){const n=this.segments,o=this.points;return n.length&&o[n[0].start]}last(){const n=this.segments,o=this.points,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=zl(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=db(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:m}=i[d],h=s[f],k=s[m];if(h===k){l.push(h);continue}const C=Math.abs((a-h[o])/(k[o]-h[o])),w=c(h,k,C,r.stepped);w[o]=n[o],l.push(w)}return l.length===1?l[0]:l}pathSegment(n,o,r){return ns(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=ns(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),hb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}de(ln,"id","line"),de(ln,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),de(ln,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),de(ln,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function Dc(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class yr extends Gt{constructor(o){super();de(this,"parsed");de(this,"skip");de(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return Dc(this,o,"x",r)}inYRange(o,r){return Dc(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!po(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,Ra(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}de(yr,"id","point"),de(yr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),de(yr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Nc(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-f,u=r+f):(f=s/2,l=o-f,c=o+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function cn(t,n,o,r){return t?0:tt(n,o,r)}function pb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Cl(r);return{t:cn(a.top,s.top,0,o),r:cn(a.right,s.right,0,n),b:cn(a.bottom,s.bottom,0,o),l:cn(a.left,s.left,0,n)}}function gb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=Rn(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Se(a);return{topLeft:cn(!c||l.top||l.left,s.topLeft,0,i),topRight:cn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:cn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:cn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function bb(t){const n=Nc(t),o=n.right-n.left,r=n.bottom-n.top,a=pb(t,o/2,r/2),s=gb(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function os(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&Nc(t,r);return l&&(a||Ht(n,l.left,l.right))&&(s||Ht(o,l.top,l.bottom))}function yb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function xb(t,n){t.rect(n.x,n.y,n.w,n.h)}function rs(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class xr extends Gt{constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){const{inflateAmount:o,options:{borderColor:r,backgroundColor:a}}=this,{inner:s,outer:i}=bb(this),l=yb(i.radius)?tr:xb;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,rs(i,o,s)),n.clip(),l(n,rs(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,rs(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return os(this,n,o,r)}inXRange(n,o){return os(this,n,null,o)}inYRange(n,o){return os(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}de(xr,"id","bar"),de(xr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),de(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function kb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=kr(c,d,a);const u=as(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=zl(n,u);for(const m of f){const h=as(o,s[m.start],s[m.end],m.loop),k=Fl(l,a,h);for(const C of k)i.push({source:C,target:m,start:{[o]:Mc(u,h,"start",Math.max)},end:{[o]:Mc(u,h,"end",Math.min)}})}}return i}function as(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=ft(a),s=ft(s)),{property:t,start:a,end:s}}function wb(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=kr(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function kr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function Mc(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function Pc(t,n){let o=[],r=!1;return Xe(t)?(r=!0,o=t):o=wb(t,n),o.length?new ln({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function Tc(t){return t&&t.fill!==!1}function Cb(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!et(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Bb(t,n,o){const r=Ab(t);if(Se(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return et(a)&&Math.floor(a)===a?Eb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Eb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function _b(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Se(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Sb(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Se(t)?r=t.value:r=n.getBaseValue(),r}function Ab(t){const n=t.options,o=n.fill;let r=we(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Vb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Db(n,o);l.push(Pc({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Nb(a,i[u],l)}return new ln({points:a,options:{}})}function Db(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function Nb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Mb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Mb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],m=i[u.end][o];if(Ht(a,f,m)){l=a===f,c=a===m;break}}return{first:l,last:c,point:r}}class vc{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:je},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Pb(t){const{chart:n,fill:o,line:r}=t;if(et(o))return Tb(n,o);if(o==="stack")return Vb(t);if(o==="shape")return!0;const a=vb(t);return a instanceof vc?a:Pc(a,r)}function Tb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function vb(t){return(t.scale||{}).getPointPositionForValue?Fb(t):Ob(t)}function Ob(t){const{scale:n={},fill:o}=t,r=_b(o,n);if(et(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Fb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Sb(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new vc({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function ss(t,n,o){const r=Pb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:m=f,below:h=f}=u||{},k=a.getDatasetMeta(s),C=Ll(a,k);r&&i.points.length&&(Zo(t,o),zb(t,{line:i,target:r,above:m,below:h,area:o,scale:l,axis:c,clip:C}),er(t))}function zb(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(Oc(t,r,i.top),is(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),Oc(t,r,i.bottom)):d==="y"&&(Fc(t,r,i.left),is(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Fc(t,r,i.right),u=a)),is(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function Oc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[kr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function Fc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[kr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,f.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function is(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=kb(o,r,a);for(const{source:d,target:u,start:f,end:m}of c){const{style:{backgroundColor:h=s}={}}=d,k=r!==!0;t.save(),t.fillStyle=h,Rb(t,i,l,k&&as(a,f,m)),t.beginPath();const C=!!o.pathSegment(t,d);let w;if(k){C?t.closePath():zc(t,r,m,a);const p=!!r.pathSegment(t,u,{move:C,reverse:!0});w=C&&p,w||zc(t,r,f,a)}t.closePath(),t.fill(w?"evenodd":"nonzero"),t.restore()}}function Rb(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),f=Math.min(f,o.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function zc(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var Ib={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof ln&&(c={visible:t.isDatasetVisible(i),index:i,fill:Bb(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Cb(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&ss(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;Tc(s)&&ss(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!Tc(r)||o.drawTime!=="beforeDatasetDraw"||ss(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Rc=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},Lb=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class Ic extends Gt{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const n=this.options.labels||{};let o=$e(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:n,ctx:o}=this;if(!n.display){this.width=this.height=0;return}const r=n.labels,a=ot(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Rc(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=n;s.textAlign="left",s.textBaseline="middle";let m=-1,h=-u;return this.legendItems.forEach((k,C)=>{const w=r+o/2+s.measureText(k.text).width;(C===0||d[d.length-1]+w+2*l>i)&&(f+=u,d[d.length-(C>0?0:1)]=0,h+=u,m++),c[C]={left:0,top:h,row:m,width:w,height:a},d[d.length-1]+=w+l}),f}_fitCols(n,o,r,a){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-n;let f=l,m=0,h=0,k=0,C=0;return this.legendItems.forEach((w,p)=>{const{itemWidth:A,itemHeight:D}=$b(r,o,s,w,a);p>0&&h+D+2*l>u&&(f+=m+l,d.push({width:m,height:h}),k+=m+l,C++,m=h=0),c[p]={left:k,top:h,col:C,width:A,height:D},m=Math.max(m,A),h+=D+l}),f+=m,d.push({width:m,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=$n(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=nt(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=nt(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=nt(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=nt(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;Zo(n,this),this._draw(),er(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=Ge.color,c=$n(n.rtl,this.left,this.width),d=ot(i.font),{padding:u}=i,f=d.size,m=f/2;let h;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:k,boxHeight:C,itemHeight:w}=Rc(i,f),p=function(B,g,b){if(isNaN(k)||k<=0||isNaN(C)||C<0)return;a.save();const _=we(b.lineWidth,1);if(a.fillStyle=we(b.fillStyle,l),a.lineCap=we(b.lineCap,"butt"),a.lineDashOffset=we(b.lineDashOffset,0),a.lineJoin=we(b.lineJoin,"miter"),a.lineWidth=_,a.strokeStyle=we(b.strokeStyle,l),a.setLineDash(we(b.lineDash,[])),i.usePointStyle){const y={radius:C*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:_},x=c.xPlus(B,k/2),E=g+m;wl(a,y,x,E,i.pointStyleWidth&&k)}else{const y=g+Math.max((f-C)/2,0),x=c.leftForLtr(B,k),E=Rn(b.borderRadius);a.beginPath(),Object.values(E).some(M=>M!==0)?tr(a,{x,y,w:k,h:C,radius:E}):a.rect(x,y,k,C),a.fill(),_!==0&&a.stroke()}a.restore()},A=function(B,g,b){go(a,b.text,B,g+w/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},D=this.isHorizontal(),S=this._computeTitleHeight();D?h={x:nt(s,this.left+u,this.right-r[0]),y:this.top+u+S,line:0}:h={x:this.left+u,y:nt(s,this.top+S+u,this.bottom-o[0].height),line:0},Pl(this.ctx,n.textDirection);const V=w+u;this.legendItems.forEach((B,g)=>{a.strokeStyle=B.fontColor,a.fillStyle=B.fontColor;const b=a.measureText(B.text).width,_=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),y=k+m+b;let x=h.x,E=h.y;c.setWidth(this.width),D?g>0&&x+y+u>this.right&&(E=h.y+=V,h.line++,x=h.x=nt(s,this.left+u,this.right-r[h.line])):g>0&&E+V>this.bottom&&(x=h.x=x+o[h.line].width+u,h.line++,E=h.y=nt(s,this.top+S+u,this.bottom-o[h.line].height));const M=c.x(x);if(p(M,E,B),x=bp(_,x+k+m,D?x+y:this.right,n.rtl),A(c.x(x),E,B),D)h.x+=y+u;else if(typeof B.text!="string"){const T=d.lineHeight;h.y+=Lc(B,T)+u}else h.y+=V}),Tl(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=ot(o.font),a=yt(o.padding);if(!o.display)return;const s=$n(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,f=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),u=this.top+d,f=nt(n.align,f,this.right-m);else{const k=this.columnSizes.reduce((C,w)=>Math.max(C,w.height),0);u=d+nt(n.align,this.top,this.bottom-k-n.labels.padding-this._computeTitleHeight())}const h=nt(l,f,f+m);i.textAlign=s.textAlign(Pa(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,go(i,o.text,h,u,r)}_computeTitleHeight(){const n=this.options.title,o=ot(n.font),r=yt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(Ht(n,this.left,this.right)&&Ht(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],Ht(n,a.left,a.left+a.width)&&Ht(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!Wb(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=Lb(a,r);a&&!s&&$e(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&$e(o.onHover,[n,r,this],this)}else r&&$e(o.onClick,[n,r,this],this)}}function $b(t,n,o,r,a){const s=jb(r,t,n,o),i=Ub(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function jb(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function Ub(t,n,o){let r=t;return typeof n.text!="string"&&(r=Lc(n,o)),r}function Lc(t,n){const o=t.text?t.text.length:0;return n*o}function Wb(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var Hb={id:"legend",_element:Ic,start(t,n,o){const r=t.legend=new Ic({ctx:t.ctx,options:o,chart:t});xt.configure(t,r,o),xt.addBox(t,r)},stop(t){xt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;xt.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=yt(d.borderWidth);return{text:n[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class $c extends Gt{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=Xe(r.text)?r.text.length:1;this._padding=yt(r.padding);const s=a*ot(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){const{top:o,left:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=nt(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=nt(l,a,o),c=Fe*-.5):(u=s-n,f=nt(l,o,a),c=Fe*.5),d=a-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=ot(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);go(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:Pa(o.align),textBaseline:"middle",translation:[i,l]})}}function qb(t,n){const o=new $c({ctx:t.ctx,options:n,chart:t});xt.configure(t,o,n),xt.addBox(t,o),t.titleBlock=o}var Gb={id:"title",_element:$c,start(t,n,o){qb(t,o)},stop(t){const n=t.titleBlock;xt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;xt.configure(t,r,o),r.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const _o={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Na(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function Tt(t,n){return n&&(Xe(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function Xt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
16
|
+
*/class wg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=fl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}add(n,o){!o||!o.length||this._getAnims(n).items.push(...o)}has(n){return this._getAnims(n).items.length>0}start(n){const o=this._charts.get(n);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(n){if(!this._running)return!1;const o=this._charts.get(n);return!(!o||!o.running||!o.items.length)}stop(n){const o=this._charts.get(n);if(!o||!o.items.length)return;const r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var qt=new wg;const $l="transparent",Cg={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=gl(t||$l),a=r.valid&&gl(n||$l);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Bg{constructor(n,o,r,a){const s=o[r];a=nr([n.to,a,s,n.from]);const i=nr([n.from,s,a]);this._active=!0,this._fn=n.fn||Cg[n.type||typeof i],this._easing=mo[n.easing]||mo.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=o,this._prop=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=nr([n.to,o,a,n.from]),this._from=nr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class jl{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Se(n))return;const o=Object.keys(Ge.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Se(s))return;const i={};for(const l of o)i[l]=s[l];(Xe(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=_g(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Eg(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],s=n.$animations||(n.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const m=r.get(d);if(f)if(m&&f.active()){f.update(m,u,l);continue}else f.cancel();if(!m||!m.duration){n[d]=u;continue}s[d]=f=new Bg(m,n,d,u),a.push(f)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return qt.add(this._chart,r),!0}}function Eg(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function _g(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Ul(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function Sg(t,n,o){if(o===!1)return!1;const r=Ul(t,o),a=Ul(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Ag(t){let n,o,r,a;return Se(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function Wl(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function Hl(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],et(d)&&(s||n===0||Pt(n)===Pt(d))&&(n+=d)}return!u&&!r.all?0:n}function Vg(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function Ha(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Dg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Ng(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function Mg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function ql(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function Gl(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Dg(s,i,r),f=n.length;let m;for(let h=0;h<f;++h){const x=n[h],{[c]:C,[d]:y}=x,p=x._stacks||(x._stacks={});m=p[d]=Mg(a,u,C),m[l]=y,m._top=ql(m,i,!0,r.type),m._bottom=ql(m,i,!1,r.type);const S=m._visualValues||(m._visualValues={});S[l]=y}}function qa(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Pg(t,n){return Bn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Tg(t,n,o){return Bn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function bo(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const Ga=t=>t==="reset"||t==="none",Kl=(t,n)=>n?t:Object.assign({},t),vg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:Wl(o,!0),values:null};class An{constructor(n,o){this.chart=n,this._ctx=n.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=Ha(n.vScale,n),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(n){this.index!==n&&bo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,m,h,x)=>f==="x"?m:f==="r"?x:h,s=o.xAxisID=we(r.xAxisID,qa(n,"x")),i=o.yAxisID=we(r.yAxisID,qa(n,"y")),l=o.rAxisID=we(r.rAxisID,qa(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const o=this._cachedMeta;return n===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&dl(this._data,this),n._stacked&&bo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Se(o)){const a=this._cachedMeta;this._data=Vg(o,a)}else if(r!==o){if(r){dl(r,this);const a=this._cachedMeta;bo(a),a._parsed=[]}o&&Object.isExtensible(o)&&gp(o,this),this._syncList=[],this._data=o}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const o=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=Ha(o.vScale,o),o.stack!==r.stack&&(a=!0,bo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(Gl(this,o._parsed),o._stacked=Ha(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,f,m;if(this._parsing===!1)r._parsed=a,r._sorted=!0,m=a;else{Xe(a[n])?m=this.parseArrayData(r,a,n,o):Se(a[n])?m=this.parseObjectData(r,a,n,o):m=this.parsePrimitiveData(r,a,n,o);const h=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=m[u],c&&(h()&&(c=!1),d=f);r._sorted=c}i&&Gl(this,m)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let m,h,x;for(m=0,h=a;m<h;++m)x=m+r,f[m]={[l]:u||s.parse(d[x],x),[c]:i.parse(o[x],x)};return f}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,m,h;for(u=0,f=a;u<f;++u)m=u+r,h=o[m],d[u]={x:s.parse(yn(h,l),m),y:i.parse(yn(h,c),m)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:Wl(a,!0),values:o._stacks[n.axis]._visualValues};return Hl(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=Hl(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=vg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Ng(l);let m,h;function x(){h=a[m];const C=h[l.axis];return!et(h[n.axis])||u>C||f<C}for(m=0;m<i&&!(!x()&&(this.updateRangeFromParsed(d,n,h,c),s));++m);if(s){for(m=i-1;m>=0;--m)if(!x()){this.updateRangeFromParsed(d,n,h,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],et(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=Ag(we(this.options.clip,Sg(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=a[u];f.hidden||(f.active&&d?i.push(f):f.draw(n,s))}for(u=0;u<i.length;++u)i[u].draw(n,s)}getStyle(n,o){const r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Tg(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Pg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,s}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,o){return this._resolveElementOptions(this.dataElementType.id,o,n)}_resolveElementOptions(n,o="default",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&lo(r);if(l)return Kl(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],m=d.getOptionScopes(this.getDataset(),u),h=Object.keys(Ge.elements[n]),x=()=>this.getContext(r,a,o),C=d.resolveNamedOptions(m,h,x,f);return C.$shared&&(C.$shared=c,s[i]=Object.freeze(Kl(C,c))),C}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),m=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(m,this.getContext(n,r,o))}const d=new jl(a,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,o){return!o||Ga(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){Ga(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!Ga(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const o=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.data,i=n+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=n;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&bo(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,o){o&&this._sync(["_removeElements",n,o]);const r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}de(An,"defaults",{}),de(An,"datasetElementType",null),de(An,"dataElementType",null);function Og(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=ul(r.sort((a,s)=>a-s))}return t._cache.$bar}function Fg(t){const n=t.iScale,o=Og(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(lo(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function zg(t,n,o,r){const a=o.barThickness;let s,i;return ve(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function Ig(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?n.end-n.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/r,ratio:o.barPercentage,start:d}}function Rg(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),n[o.axis]=d,n._custom={barStart:c,barEnd:d,start:a,end:s,min:i,max:l}}function Xl(t,n,o,r){return Xe(t)?Rg(t,n,o,r):n[o.axis]=o.parse(t,r),n}function Yl(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,m;for(d=o,u=o+r;d<u;++d)m=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(Xl(m,f,s,d));return c}function Ka(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Lg(t,n,o){return t!==0?Pt(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function $g(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function jg(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=$g(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[Jl(u,i,l,c)]=!0,a=d)),s[Jl(a,i,l,c)]=!0,t.borderSkipped=s}function Jl(t,n,o,r){return r?(t=Ug(t,n,o),t=Ql(t,o,n)):t=Ql(t,n,o),t}function Ug(t,n,o){return t===n?o:t===o?n:t}function Ql(t,n,o){return t==="start"?n:t==="end"?o:t}function Wg(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class ir extends An{parsePrimitiveData(n,o,r,a){return Yl(n,o,r,a)}parseArrayData(n,o,r,a){return Yl(n,o,r,a)}parseObjectData(n,o,r,a){const{iScale:s,vScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let m,h,x,C;for(m=r,h=r+a;m<h;++m)C=o[m],x={},x[s.axis]=s.parse(yn(C,d),m),f.push(Xl(yn(C,u),x,i,m));return f}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._custom;s&&o===this._cachedMeta.vScale&&(n.min=Math.min(n.min,s.min),n.max=Math.max(n.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const o=this._cachedMeta,{iScale:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=Ka(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,n)}updateElements(n,o,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:m}=this._getSharedOptions(o,a);for(let h=o;h<o+r;h++){const x=this.getParsed(h),C=s||ve(x[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),y=this._calculateBarIndexPixels(h,u),p=(x._stacks||{})[l.axis],S={horizontal:d,base:C.base,enableBorderRadius:!p||Ka(x._custom)||i===p._top||i===p._bottom,x:d?C.head:y.center,y:d?y.center:C.head,height:d?y.size:Math.abs(C.size),width:d?Math.abs(C.size):y.size};m&&(S.options=f||this.resolveDataElementOptions(h,n[h].active?"active":a));const V=S.options||n[h].options;jg(S,V,p,i),Wg(S,V,u.ratio),this.updateElement(n[h],h,S,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(h=>h[r.axis]===c),m=f&&f[u.vScale.axis];if(ve(m)||isNaN(m))return!0};for(const u of a)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===n))break;return i.length||i.push(void 0),i}_getStackCount(n){return this._getStacks(void 0,n).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const n=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(n).filter(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[we(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||Fg(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=Ka(d);let f=c[o.axis],m=0,h=r?this.applyStack(o,c,r):f,x,C;h!==f&&(m=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Pt(f)!==Pt(d.barEnd)&&(m=0),m+=f);const y=!ve(s)&&!u?s:m;let p=o.getPixelForValue(y);if(this.chart.getDataVisibility(n)?x=o.getPixelForValue(m+h):x=p,C=x-p,Math.abs(C)<i){C=Lg(C,o,l)*i,f===l&&(p-=C/2);const S=o.getPixelForDecimal(0),V=o.getPixelForDecimal(1),E=Math.min(S,V),A=Math.max(S,V);p=Math.max(Math.min(p,A),E),x=p+C,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(x)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const S=Pt(C)*o.getLineWidthForValue(l)/2;p+=S,C-=S}return{size:C,base:p,head:x,center:x+C/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=we(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=a.barThickness==="flex"?Ig(n,o,a,u*d):zg(n,o,a,u*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(we(m,this.getFirstScaleIdForIndexAxis())),x=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+h;l=f.start+f.chunk*x+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.axis],n),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const n=this._cachedMeta,o=n.vScale,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}de(ir,"id","bar"),de(ir,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),de(ir,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Hg(t,n,o){let r=1,a=1,s=0,i=0;if(n<je){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),m=Math.sin(c),h=(V,E,A)=>fo(V,l,c,!0)?1:Math.max(E,E*o,A,A*o),x=(V,E,A)=>fo(V,l,c,!0)?-1:Math.min(E,E*o,A,A*o),C=h(0,d,f),y=h(Je,u,m),p=x(Fe,d,f),S=x(Fe+Je,u,m);r=(C-p)/2,a=(y-S)/2,s=-(C+p)/2,i=-(y+S)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class $n extends An{constructor(n,o){super(n,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,o){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Se(r[n])){const{key:c="value"}=this._parsing;s=d=>+yn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return Wt(this.options.rotation-90)}_getCircumference(){return Wt(this.options.circumference)}_getRotationExtents(){let n=je,o=-je;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._getCircumference();n=Math.min(n,s),o=Math.max(o,s+i)}return{rotation:n,circumference:o-n}}update(n){const o=this.chart,{chartArea:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(Zh(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:m,ratioY:h,offsetX:x,offsetY:C}=Hg(f,u,c),y=(r.width-i)/m,p=(r.height-i)/h,S=Math.max(Math.min(y,p)/2,0),V=el(this.options.radius,S),E=Math.max(V*c,0),A=(V-E)/this._getVisibleDatasetWeightTotal();this.offsetX=x*V,this.offsetY=C*V,a.total=this.calculateTotal(),this.outerRadius=V-A*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-A*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/je)}updateElements(n,o,r,a){const s=a==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,m=s&&d.animateScale,h=m?0:this.innerRadius,x=m?0:this.outerRadius,{sharedOptions:C,includeOptions:y}=this._getSharedOptions(o,a);let p=this._getRotation(),S;for(S=0;S<o;++S)p+=this._circumference(S,s);for(S=o;S<o+r;++S){const V=this._circumference(S,s),E=n[S],A={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+V,circumference:V,outerRadius:x,innerRadius:h};y&&(A.options=C||this.resolveDataElementOptions(S,E.active?"active":a)),p+=V,this.updateElement(E,S,A,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?je*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=Oa(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(we(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}de($n,"id","doughnut"),de($n,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),de($n,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),de($n,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=n.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=n.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!n.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class lr extends An{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=xp(o,a,i);this._drawStart=l,this._drawCount=c,kp(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,a),m=i.axis,h=l.axis,{spanGaps:x,segment:C}=this.options,y=uo(x)?x:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",S=o+r,V=n.length;let E=o>0&&this.getParsed(o-1);for(let A=0;A<V;++A){const k=n[A],g=p?k:{};if(A<o||A>=S){g.skip=!0;continue}const b=this.getParsed(A),M=ve(b[h]),w=g[m]=i.getPixelForValue(b[m],A),_=g[h]=s||M?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[h],A);g.skip=isNaN(w)||isNaN(_)||M,g.stop=A>0&&Math.abs(b[m]-E[m])>y,C&&(g.parsed=b,g.raw=d.data[A]),f&&(g.options=u||this.resolveDataElementOptions(A,k.active?"active":a)),p||this.updateElement(k,A,g,a),E=b}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}de(lr,"id","line"),de(lr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),de(lr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Xa extends $n{}de(Xa,"id","pie"),de(Xa,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Vn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ya{constructor(n){de(this,"options");this.options=n||{}}static override(n){Object.assign(Ya.prototype,n)}init(){}formats(){return Vn()}parse(){return Vn()}format(){return Vn()}add(){return Vn()}diff(){return Vn()}startOf(){return Vn()}endOf(){return Vn()}}var qg={_date:Ya};function Gg(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?hp:kn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const m=d(s,n,o-f),h=d(s,n,o+f);return{lo:m.lo,hi:h.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:m}=t,h=m.slice(0,u.lo+1).reverse().findIndex(C=>!ve(C[f.axis]));u.lo-=Math.max(0,h);const x=m.slice(u.hi).findIndex(C=>!ve(C[f.axis]));u.hi+=Math.max(0,x)}return u}}return{lo:0,hi:s.length-1}}function cr(t,n,o,r,a){const s=t.getSortedVisibleDatasetMetas(),i=o[n];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:m}=Gg(s[l],n,i,a);for(let h=f;h<=m;++h){const x=u[h];x.skip||r(x,d,h)}}}function Kg(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Ja(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||cr(t,o,n,function(l,c,d){!a&&!po(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function Xg(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=ll(i,{x:n.x,y:n.y});fo(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return cr(t,o,n,s),a}function Yg(t,n,o,r,a,s){let i=[];const l=Kg(o);let c=Number.POSITIVE_INFINITY;function d(u,f,m){const h=u.inRange(n.x,n.y,a);if(r&&!h)return;const x=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(x))&&!h)return;const y=l(n,x);y<c?(i=[{element:u,datasetIndex:f,index:m}],c=y):y===c&&i.push({element:u,datasetIndex:f,index:m})}return cr(t,o,n,d),i}function Qa(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?Xg(t,n,o,a):Yg(t,n,o,r,a,s)}function Zl(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return cr(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var Jg={modes:{index(t,n,o,r){const a=_n(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Ja(t,a,s,r,i):Qa(t,a,s,!1,r,i),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,n,o,r){const a=_n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Ja(t,a,s,r,i):Qa(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=_n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Ja(t,a,s,r,i)},nearest(t,n,o,r){const a=_n(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Qa(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=_n(n,t);return Zl(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=_n(n,t);return Zl(t,a,"y",o.intersect,r)}}};const ec=["left","top","right","bottom"];function yo(t,n){return t.filter(o=>o.pos===n)}function tc(t,n){return t.filter(o=>ec.indexOf(o.pos)===-1&&o.box.axis===n)}function xo(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function Qg(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function Zg(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!ec.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function e0(t,n){const o=Zg(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function t0(t){const n=Qg(t),o=xo(n.filter(d=>d.box.fullSize),!0),r=xo(yo(n,"left"),!0),a=xo(yo(n,"right")),s=xo(yo(n,"top"),!0),i=xo(yo(n,"bottom")),l=tc(n,"x"),c=tc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:yo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function nc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function oc(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function n0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Se(a)){o.size&&(t[a]-=o.size);const f=r[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,t[a]+=o.size}s.getPadding&&oc(i,s.getPadding());const l=Math.max(0,n.outerWidth-nc(i,t,"left","right")),c=Math.max(0,n.outerHeight-nc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function o0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function r0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function ko(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,r0(l.horizontal,n));const{same:f,other:m}=n0(n,o,l,r);d|=f&&a.length,u=u||m,c.fullSize||a.push(l)}return d&&ko(a,n,o,r)||u}function dr(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function rc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=n.w*u,m=d.size||c.height;lo(d.start)&&(i=d.start),c.fullSize?dr(c,a.left,i,o.outerWidth-a.right-a.left,m):dr(c,n.left+d.placed,i,f,m),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,m=d.size||c.width;lo(d.start)&&(s=d.start),c.fullSize?dr(c,s,a.top,m,o.outerHeight-a.bottom-a.top):dr(c,s,n.top+d.placed,m,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var kt={addBox(t,n){t.boxes||(t.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(o){n.draw(o)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=xt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=t0(t.boxes),c=l.vertical,d=l.horizontal;Oe(t.boxes,C=>{typeof C.beforeLayout=="function"&&C.beforeLayout()});const u=c.reduce((C,y)=>y.box.options&&y.box.options.display===!1?C:C+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),m=Object.assign({},a);oc(m,xt(r));const h=Object.assign({maxPadding:m,w:s,h:i,x:a.left,y:a.top},a),x=e0(c.concat(d),f);ko(l.fullSize,h,f,x),ko(c,h,f,x),ko(d,h,f,x)&&ko(c,h,f,x),o0(h),rc(l.leftAndTop,h,f,x),h.x+=h.w,h.y+=h.h,rc(l.rightAndBottom,h,f,x),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Oe(l.chartArea,C=>{const y=C.box;Object.assign(y,t.chartArea),y.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class ac{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class a0 extends ac{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const ur="$chartjs",s0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},sc=t=>t===null||t==="";function i0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[ur]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",sc(a)){const s=Ml(t,"width");s!==void 0&&(t.width=s)}if(sc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=Ml(t,"height");s!==void 0&&(t.height=s)}return t}const ic=cg?{passive:!0}:!1;function l0(t,n,o){t&&t.addEventListener(n,o,ic)}function c0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,ic)}function d0(t,n){const o=s0[t.type]||t.type,{x:r,y:a}=_n(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function fr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function u0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||fr(l.addedNodes,r),i=i&&!fr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function f0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||fr(l.removedNodes,r),i=i&&!fr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const wo=new Map;let lc=0;function cc(){const t=window.devicePixelRatio;t!==lc&&(lc=t,wo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function m0(t,n){wo.size||window.addEventListener("resize",cc),wo.set(t,n)}function h0(t){wo.delete(t),wo.size||window.removeEventListener("resize",cc)}function p0(t,n,o){const r=t.canvas,a=r&&Wa(r);if(!a)return;const s=ml((l,c)=>{const d=a.clientWidth;o(l,c),d<a.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(a),m0(t,s),i}function Za(t,n,o){o&&o.disconnect(),n==="resize"&&h0(t)}function g0(t,n,o){const r=t.canvas,a=ml(s=>{t.ctx!==null&&o(d0(s,t))},t);return l0(r,n,a),a}class b0 extends ac{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(i0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[ur])return!1;const r=o[ur].initial;["height","width"].forEach(s=>{const i=r[s];ve(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[ur],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:u0,detach:f0,resize:p0}[o]||g0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:Za,detach:Za,resize:Za}[o]||c0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return lg(n,o,r,a)}isAttached(n){const o=n&&Wa(n);return!!(o&&o.isConnected)}}function y0(t){return!Ua()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?a0:b0}let Gt=(Hr=class{constructor(){de(this,"x");de(this,"y");de(this,"active",!1);de(this,"options");de(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return uo(this.x)&&uo(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},de(Hr,"defaults",{}),de(Hr,"defaultRoutes"),Hr);function x0(t,n){const o=t.options.ticks,r=k0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?C0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return B0(n,d,s,i/a),d;const u=w0(s,n,a);if(i>0){let f,m;const h=i>1?Math.round((c-l)/(i-1)):null;for(mr(n,d,u,ve(h)?0:l-h,l),f=0,m=i-1;f<m;f++)mr(n,d,u,s[f],s[f+1]);return mr(n,d,u,c,ve(h)?n.length:c+h),d}return mr(n,d,u),d}function k0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function w0(t,n,o){const r=E0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=ip(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function C0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function B0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function mr(t,n,o,r,a){const s=we(r,0),i=Math.min(we(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(n.push(t[d]),l++,u=Math.round(s+l*o))}function E0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const _0=t=>t==="left"?"right":t==="right"?"left":t,dc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,uc=(t,n)=>Math.min(n||t,t);function fc(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function S0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function A0(t,n){Oe(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Co(t){return t.drawTicks?t.tickLength:0}function mc(t,n){if(!t.display)return 0;const o=ot(t.font,n),r=xt(t.padding);return(Xe(t.text)?t.text.length:1)*o.lineHeight+r.height}function V0(t,n){return Bn(t,{scale:n,type:"scale"})}function D0(t,n,o){return Bn(t,{tick:o,index:n,type:"tick"})}function N0(t,n,o){let r=Pa(t);return(o&&n!=="right"||!o&&n==="right")&&(r=_0(r)),r}function M0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,m,h,x;const C=i-a,y=l-s;if(t.isHorizontal()){if(h=nt(r,s,l),Se(o)){const p=Object.keys(o)[0],S=o[p];x=u[p].getPixelForValue(S)+C-n}else o==="center"?x=(d.bottom+d.top)/2+C-n:x=dc(t,o,n);m=l-s}else{if(Se(o)){const p=Object.keys(o)[0],S=o[p];h=u[p].getPixelForValue(S)-y+n}else o==="center"?h=(d.left+d.right)/2-y+n:h=dc(t,o,n);x=nt(r,i,a),f=o==="left"?-Je:Je}return{titleX:h,titleY:x,maxWidth:m,rotation:f}}class jn extends Gt{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,o){return n}getUserBounds(){let{_userMin:n,_userMax:o,_suggestedMin:r,_suggestedMax:a}=this;return n=Mt(n,Number.POSITIVE_INFINITY),o=Mt(o,Number.NEGATIVE_INFINITY),r=Mt(r,Number.POSITIVE_INFINITY),a=Mt(a,Number.NEGATIVE_INFINITY),{min:Mt(n,r),max:Mt(o,a),minDefined:et(n),maxDefined:et(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:Mt(o,Mt(r,o)),max:Mt(r,Mt(o,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){$e(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Lp(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?fc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=x0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,o,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){$e(this.options.afterUpdate,[this])}beforeSetDimensions(){$e(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){$e(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),$e(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){$e(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=$e(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){$e(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){$e(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=uc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,m=u.highest.height,h=tt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:h/(r-1),f+6>l&&(l=h/(r-(n.offset?.5:1)),c=this.maxHeight-Co(n.grid)-o.padding-mc(n.title,this.chart.options.font),d=Math.sqrt(f*f+m*m),i=up(Math.min(Math.asin(tt((u.highest.height+6)/l,-1,1)),Math.asin(tt(c/d,-1,1))-Math.asin(tt(m/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){$e(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){$e(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=mc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Co(s)+c):(n.height=this.maxHeight,n.width=Co(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:m}=this._getLabelSizes(),h=r.padding*2,x=Wt(this.labelRotation),C=Math.cos(x),y=Math.sin(x);if(l){const p=r.mirror?0:y*f.width+C*m.height;n.height=Math.min(this.maxHeight,n.height+p+h)}else{const p=r.mirror?0:C*f.width+y*m.height;n.width=Math.min(this.maxWidth,n.width+p+h)}this._calculatePadding(d,u,y,C)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,o,r,a){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,h=0;c?d?(m=a*n.width,h=r*o.height):(m=r*n.height,h=a*o.width):s==="start"?h=o.width:s==="end"?m=n.width:s!=="inner"&&(m=n.width/2,h=o.width/2),this.paddingLeft=Math.max((m-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=n.height/2;s==="start"?(u=0,f=n.height):s==="end"&&(u=o.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){$e(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:o}=this.options;return o==="top"||o==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let o,r;for(o=0,r=n.length;o<r;o++)ve(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=fc(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/uc(o,r));let d=0,u=0,f,m,h,x,C,y,p,S,V,E,A;for(f=0;f<o;f+=c){if(x=n[f].label,C=this._resolveTickFontOptions(f),a.font=y=C.string,p=s[y]=s[y]||{data:{},gc:[]},S=C.lineHeight,V=E=0,!ve(x)&&!Xe(x))V=xl(a,p.data,p.gc,V,x),E=S;else if(Xe(x))for(m=0,h=x.length;m<h;++m)A=x[m],!ve(A)&&!Xe(A)&&(V=xl(a,p.data,p.gc,V,A),E+=S);i.push(V),l.push(E),d=Math.max(V,d),u=Math.max(E,u)}A0(s,o);const k=i.indexOf(d),g=l.indexOf(u),b=M=>({width:i[M]||0,height:l[M]||0});return{first:b(0),last:b(o-1),widest:b(k),highest:b(g),widths:i,heights:l}}getLabelForValue(n){return n}getPixelForValue(n,o){return NaN}getValueForPixel(n){}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const o=this._startPixel+n*this._length;return mp(this._alignToPixels?Cn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const r=o[n];return r.$context||(r.$context=D0(this.getContext(),n,r))}return this.$context||(this.$context=V0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=Wt(this.labelRotation),r=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=n.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),m=Co(s),h=[],x=l.setContext(this.getContext()),C=x.display?x.width:0,y=C/2,p=function(v){return Cn(r,v,C)};let S,V,E,A,k,g,b,M,w,_,B,D;if(i==="top")S=p(this.bottom),g=this.bottom-m,M=S-y,_=p(n.top)+y,D=n.bottom;else if(i==="bottom")S=p(this.top),_=n.top,D=p(n.bottom)-y,g=S+y,M=this.top+m;else if(i==="left")S=p(this.right),k=this.right-m,b=S-y,w=p(n.left)+y,B=n.right;else if(i==="right")S=p(this.left),w=n.left,B=p(n.right)-y,k=S+y,b=this.left+m;else if(o==="x"){if(i==="center")S=p((n.top+n.bottom)/2+.5);else if(Se(i)){const v=Object.keys(i)[0],L=i[v];S=p(this.chart.scales[v].getPixelForValue(L))}_=n.top,D=n.bottom,g=S+y,M=g+m}else if(o==="y"){if(i==="center")S=p((n.left+n.right)/2);else if(Se(i)){const v=Object.keys(i)[0],L=i[v];S=p(this.chart.scales[v].getPixelForValue(L))}k=S-y,b=k-m,w=n.left,B=n.right}const N=we(a.ticks.maxTicksLimit,f),O=Math.max(1,Math.ceil(f/N));for(V=0;V<f;V+=O){const v=this.getContext(V),L=s.setContext(v),$=l.setContext(v),U=L.lineWidth,P=L.color,F=$.dash||[],X=$.dashOffset,q=L.tickWidth,W=L.tickColor,Z=L.tickBorderDash||[],ne=L.tickBorderDashOffset;E=S0(this,V,c),E!==void 0&&(A=Cn(r,E,U),d?k=b=w=B=A:g=M=_=D=A,h.push({tx1:k,ty1:g,tx2:b,ty2:M,x1:w,y1:_,x2:B,y2:D,width:U,color:P,borderDash:F,borderDashOffset:X,tickWidth:q,tickColor:W,tickBorderDash:Z,tickBorderDashOffset:ne}))}return this._ticksLength=f,this._borderValue=S,h}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,m=Co(r.grid),h=m+u,x=f?-u:h,C=-Wt(this.labelRotation),y=[];let p,S,V,E,A,k,g,b,M,w,_,B,D="middle";if(a==="top")k=this.bottom-x,g=this._getXAxisLabelAlignment();else if(a==="bottom")k=this.top+x,g=this._getXAxisLabelAlignment();else if(a==="left"){const O=this._getYAxisLabelAlignment(m);g=O.textAlign,A=O.x}else if(a==="right"){const O=this._getYAxisLabelAlignment(m);g=O.textAlign,A=O.x}else if(o==="x"){if(a==="center")k=(n.top+n.bottom)/2+h;else if(Se(a)){const O=Object.keys(a)[0],v=a[O];k=this.chart.scales[O].getPixelForValue(v)+h}g=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")A=(n.left+n.right)/2-h;else if(Se(a)){const O=Object.keys(a)[0],v=a[O];A=this.chart.scales[O].getPixelForValue(v)}g=this._getYAxisLabelAlignment(m).textAlign}o==="y"&&(c==="start"?D="top":c==="end"&&(D="bottom"));const N=this._getLabelSizes();for(p=0,S=l.length;p<S;++p){V=l[p],E=V.label;const O=s.setContext(this.getContext(p));b=this.getPixelForTick(p)+s.labelOffset,M=this._resolveTickFontOptions(p),w=M.lineHeight,_=Xe(E)?E.length:1;const v=_/2,L=O.color,$=O.textStrokeColor,U=O.textStrokeWidth;let P=g;i?(A=b,g==="inner"&&(p===S-1?P=this.options.reverse?"left":"right":p===0?P=this.options.reverse?"right":"left":P="center"),a==="top"?d==="near"||C!==0?B=-_*w+w/2:d==="center"?B=-N.highest.height/2-v*w+w:B=-N.highest.height+w/2:d==="near"||C!==0?B=w/2:d==="center"?B=N.highest.height/2-v*w:B=N.highest.height-_*w,f&&(B*=-1),C!==0&&!O.showLabelBackdrop&&(A+=w/2*Math.sin(C))):(k=b,B=(1-_)*w/2);let F;if(O.showLabelBackdrop){const X=xt(O.backdropPadding),q=N.heights[p],W=N.widths[p];let Z=B-X.top,ne=0-X.left;switch(D){case"middle":Z-=q/2;break;case"bottom":Z-=q;break}switch(g){case"center":ne-=W/2;break;case"right":ne-=W;break;case"inner":p===S-1?ne-=W:p>0&&(ne-=W/2);break}F={left:ne,top:Z,width:W+X.width,height:q+X.height,color:O.backdropColor}}y.push({label:E,font:M,textOffset:B,options:{rotation:C,color:L,strokeColor:$,strokeWidth:U,textAlign:P,textBaseline:D,translation:[A,k],backdrop:F}})}return y}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-Wt(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:o},left:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:o,options:{border:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,m;this.isHorizontal()?(d=Cn(n,this.left,i)-i/2,u=Cn(n,this.right,l)+l/2,f=m=c):(f=Cn(n,this.top,i)-i/2,m=Cn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,m),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Zo(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;go(r,d,0,u,c,l)}a&&er(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=ot(r.font),i=xt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Se(o)?(c+=i.bottom,Xe(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:m}=M0(this,c,o,l);go(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:m,textAlign:N0(l,o,a),textBaseline:"middle",translation:[d,u]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,o=n.ticks&&n.ticks.z||0,r=we(n.grid&&n.grid.z,-1),a=we(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==jn.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return ot(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class hr{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const o=Object.getPrototypeOf(n);let r;v0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,P0(n,i,r),this.override&&Ge.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in Ge[a]&&(delete Ge[a][r],this.override&&delete wn[r])}}function P0(t,n,o){const r=so(Object.create(null),[o?Ge.get(o):{},Ge.get(n),t.defaults]);Ge.set(n,r),t.defaultRoutes&&T0(n,t.defaultRoutes),t.descriptors&&Ge.describe(n,t.descriptors)}function T0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");Ge.route(s,a,c,l)})}function v0(t){return"id"in t&&"defaults"in t}class O0{constructor(){this.controllers=new hr(An,"datasets",!0),this.elements=new hr(Gt,"elements"),this.plugins=new hr(Object,"plugins"),this.scales=new hr(jn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,o,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):Oe(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=Da(n);$e(r["before"+a],[],r),o[n](r),$e(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var Tt=new O0;class F0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if($e(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){ve(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),o}_createDescriptors(n,o){const r=n&&n.config,a=we(r.options&&r.options.plugins,{}),s=z0(r);return a===!1&&!o?[]:R0(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function z0(t){const n={},o=[],r=Object.keys(Tt.plugins.items);for(let s=0;s<r.length;s++)o.push(Tt.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function I0(t,n){return!n&&t===!1?null:t===!0?{}:t}function R0(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=I0(r[c],a);d!==null&&s.push({plugin:l,options:L0(t.config,{plugin:l,local:o[c]},d,i)})}return s}function L0(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function es(t,n){const o=Ge.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function $0(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function j0(t,n){return t===n?"_index_":"_value_"}function hc(t){if(t==="x"||t==="y"||t==="r")return t}function U0(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function ts(t,...n){if(hc(t))return t;for(const o of n){const r=o.axis||U0(o.position)||t.length>1&&hc(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function pc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function W0(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return pc(t,"x",o[0])||pc(t,"y",o[0])}return{}}function H0(t,n){const o=wn[t.type]||{scales:{}},r=n.scales||{},a=es(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Se(l))return console.error(`Invalid scale configuration for scale: ${i}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${i}`);const c=ts(i,l,W0(i,t),Ge.scales[l.type]),d=j0(c,a),u=o.scales||{};s[i]=io(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||es(l,n),u=(wn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const m=$0(f,c),h=i[m+"AxisID"]||m;s[h]=s[h]||Object.create(null),io(s[h],[{axis:m},r[h],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];io(l,[Ge.scales[l.type],Ge.scale])}),s}function gc(t){const n=t.options||(t.options={});n.plugins=we(n.plugins,{}),n.scales=H0(t,n)}function bc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function q0(t){return t=t||{},t.data=bc(t.data),gc(t),t}const yc=new Map,xc=new Set;function pr(t,n){let o=yc.get(t);return o||(o=n(),yc.set(t,o),xc.add(o)),o}const Bo=(t,n,o)=>{const r=yn(n,o);r!==void 0&&t.add(r)};class G0{constructor(n){this._config=q0(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=bc(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),gc(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return pr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return pr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return pr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return pr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>Bo(c,n,f))),u.forEach(f=>Bo(c,a,f)),u.forEach(f=>Bo(c,wn[s]||{},f)),u.forEach(f=>Bo(c,Ge,f)),u.forEach(f=>Bo(c,Fa,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),xc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,wn[o]||{},Ge.datasets[o]||{},{type:o},Ge,Fa]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=kc(this._resolverCache,n,a);let c=i;if(X0(i,o)){s.$shared=!1,r=an(r)?r():r;const d=this.createResolver(n,r,l);c=In(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=kc(this._resolverCache,n,r);return Se(o)?In(s,o,void 0,a):s}}function kc(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:La(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const K0=t=>Se(t)&&Object.getOwnPropertyNames(t).some(n=>an(t[n]));function X0(t,n){const{isScriptable:o,isIndexable:r}=Bl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(an(l)||K0(l))||i&&Xe(l))return!0}return!1}var Y0="4.5.1";const J0=["top","bottom","left","right","chartArea"];function wc(t,n){return t==="top"||t==="bottom"||J0.indexOf(t)===-1&&n==="x"}function Cc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Bc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),$e(o&&o.onComplete,[t],n)}function Q0(t){const n=t.chart,o=n.options.animation;$e(o&&o.onProgress,[t],n)}function Ec(t){return Ua()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const gr={},_c=t=>{const n=Ec(t);return Object.values(gr).filter(o=>o.canvas===n).pop()};function Z0(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function eb(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class Kt{static register(...n){Tt.add(...n),Sc()}static unregister(...n){Tt.remove(...n),Sc()}constructor(n,o){const r=this.config=new G0(o),a=Ec(n),s=_c(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||y0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Qh(),this.ctx=l,this.canvas=c,this.width=u,this.height=d,this._options=i,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new F0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=bp(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],gr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}qt.listen(this,"complete",Bc),qt.listen(this,"progress",Q0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return ve(n)?o&&s?s:a?r/a:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}get registry(){return Tt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return kl(this.canvas,this.ctx),this}stop(){return qt.stop(this),this}resize(n,o){qt.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Nl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),$e(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Oe(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=ts(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Oe(s,i=>{const l=i.options,c=l.id,d=ts(c,l),u=we(l.type,i.dtype);(l.position===void 0||wc(l.position,d)!==wc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const m=Tt.getScale(u);f=new m({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Oe(a,(i,l)=>{i||delete r[l]}),Oe(r,i=>{kt.configure(this,i,i.options),kt.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Cc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||es(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=Tt.getController(l),{datasetElementType:d,dataElementType:u}=Ge.datasets[l];Object.assign(c,{dataElementType:Tt.getElement(u),datasetElementType:d&&Tt.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Oe(this.data.datasets,(n,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const o=this.config;o.update();const r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),m=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(m),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Oe(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Cc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Oe(this.scales,n=>{kt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!ol(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;Z0(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!ol(a,r(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;kt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Oe(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,an(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(qt.has(this)?this.attached&&!qt.running(this)&&qt.start(this):(this.draw(),Bc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(n=0;n<o.length&&o[n].z<=0;++n)o[n].draw(this.chartArea);for(this._drawDatasets();n<o.length;++n)o[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const o=this._sortedMetasets,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o)this._drawDataset(n[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const o=this.ctx,r={meta:n,index:n.index,cancelable:!0},a=Ll(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Zo(o,a),n.controller.draw(),a&&er(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return po(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=Jg.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:n,_dataset:o,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=Bn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);lo(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a:void 0))}hide(n,o){this._updateVisibility(n,o,!1)}show(n,o){this._updateVisibility(n,o,!0)}_destroyDatasetMeta(n){const o=this._metasets[n];o&&o.controller&&o.controller._destroy(),delete this._metasets[n]}_stop(){let n,o;for(this.stop(),qt.remove(this),n=0,o=this.data.datasets.length;n<o;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:o}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),kl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete gr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,o=this.platform,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Oe(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(c,d)=>{n[c]&&(o.removeEventListener(this,c,d),delete n[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Oe(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Oe(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=n.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!Xo(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,n),l=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=rp(n),d=eb(n,this._lastEvent,r,c);r&&(this._lastEvent=null,$e(s.onHover,[n,l,this],this),c&&$e(s.onClick,[n,l,this],this));const u=!Xo(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}de(Kt,"defaults",Ge),de(Kt,"instances",gr),de(Kt,"overrides",wn),de(Kt,"registry",Tt),de(Kt,"version",Y0),de(Kt,"getChart",_c);function Sc(){return Oe(Kt.instances,t=>t._plugins.invalidate())}function tb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,ft(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const m=Math.min(d/l,ft(r-o));t.arc(a,s,l+d/2,o-m/2,r+m/2,!0)}else{const m=Math.min(d/2,i*ft(r-o));if(u==="round")t.arc(a,s,m,o-Fe/2,r+Fe/2,!0);else if(u==="bevel"){const h=2*m*m,x=-h*Math.cos(o+Fe/2)+a,C=-h*Math.sin(o+Fe/2)+s,y=h*Math.cos(r+Fe/2)+a,p=h*Math.sin(r+Fe/2)+s;t.lineTo(x,C),t.lineTo(y,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function nb(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+Je,r-Je),t.closePath(),t.clip()}function ob(t){return Ra(t,["outerStart","outerEnd","innerStart","innerEnd"])}function rb(t,n,o,r){const a=ob(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return tt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:tt(a.innerStart,0,i),innerEnd:tt(a.innerEnd,0,i)}}function Un(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function br(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+r+o-d,0),m=u>0?u+r+o+d:0;let h=0;const x=a-c;if(r){const O=u>0?u-r:0,v=f>0?f-r:0,L=(O+v)/2,$=L!==0?x*L/(L+r):x;h=(x-$)/2}const C=Math.max(.001,x*f-o/Fe)/f,y=(x-C)/2,p=c+y+h,S=a-y-h,{outerStart:V,outerEnd:E,innerStart:A,innerEnd:k}=rb(n,m,f,S-p),g=f-V,b=f-E,M=p+V/g,w=S-E/b,_=m+A,B=m+k,D=p+A/_,N=S-k/B;if(t.beginPath(),s){const O=(M+w)/2;if(t.arc(i,l,f,M,O),t.arc(i,l,f,O,w),E>0){const U=Un(b,w,i,l);t.arc(U.x,U.y,E,w,S+Je)}const v=Un(B,S,i,l);if(t.lineTo(v.x,v.y),k>0){const U=Un(B,N,i,l);t.arc(U.x,U.y,k,S+Je,N+Math.PI)}const L=(S-k/m+(p+A/m))/2;if(t.arc(i,l,m,S-k/m,L,!0),t.arc(i,l,m,L,p+A/m,!0),A>0){const U=Un(_,D,i,l);t.arc(U.x,U.y,A,D+Math.PI,p-Je)}const $=Un(g,p,i,l);if(t.lineTo($.x,$.y),V>0){const U=Un(g,M,i,l);t.arc(U.x,U.y,V,p-Je,M)}}else{t.moveTo(i,l);const O=Math.cos(M)*f+i,v=Math.sin(M)*f+l;t.lineTo(O,v);const L=Math.cos(w)*f+i,$=Math.sin(w)*f+l;t.lineTo(L,$)}t.closePath()}function ab(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){br(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%je||je))}return br(t,n,o,r,c,a),t.fill(),c}function sb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:m,borderRadius:h}=c,x=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=m,x?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let C=n.endAngle;if(s){br(t,n,o,r,C,a);for(let y=0;y<s;++y)t.stroke();isNaN(l)||(C=i+(l%je||je))}x&&nb(t,n,C),c.selfJoin&&C-i>=Fe&&h===0&&u!=="miter"&&tb(t,n,C),s||(br(t,n,o,r,C,a),t.stroke())}class Eo extends Gt{constructor(o){super();de(this,"circumference");de(this,"endAngle");de(this,"fullCircles");de(this,"innerRadius");de(this,"outerRadius");de(this,"pixelMargin");de(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=ll(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,x=we(m,d-c),C=fo(i,c,d)&&c!==d,y=x>=je||C,p=Ht(l,u+h,f+h);return y&&p}getCenterPoint(o){const{x:r,y:a,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,f=(s+i)/2,m=(l+c+u+d)/2;return{x:r+Math.cos(f)*m,y:a+Math.sin(f)*m}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>je?Math.floor(a/je):0,a===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(Fe,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,ab(o,this,u,i,l),sb(o,this,u,i,l),o.restore()}}de(Eo,"id","arc"),de(Eo,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),de(Eo,"defaultRoutes",{backgroundColor:"backgroundColor"}),de(Eo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Ac(t,n,o=n){t.lineCap=we(o.borderCapStyle,n.borderCapStyle),t.setLineDash(we(o.borderDash,n.borderDash)),t.lineDashOffset=we(o.borderDashOffset,n.borderDashOffset),t.lineJoin=we(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=we(o.borderWidth,n.borderWidth),t.strokeStyle=we(o.borderColor,n.borderColor)}function ib(t,n,o){t.lineTo(o.x,o.y)}function lb(t){return t.stepped?Mp:t.tension||t.cubicInterpolationMode==="monotone"?Pp:ib}function Vc(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function cb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Vc(a,o,r),u=lb(s);let{move:f=!0,reverse:m}=r||{},h,x,C;for(h=0;h<=d;++h)x=a[(l+(m?d-h:h))%i],!x.skip&&(f?(t.moveTo(x.x,x.y),f=!1):u(t,C,x,m,s.stepped),C=x);return c&&(x=a[(l+(m?d:0))%i],u(t,C,x,m,s.stepped)),!!c}function db(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Vc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,m,h,x,C,y,p;const S=E=>(i+(d?l-E:E))%s,V=()=>{C!==y&&(t.lineTo(u,y),t.lineTo(u,C),t.lineTo(u,p))};for(c&&(h=a[S(0)],t.moveTo(h.x,h.y)),m=0;m<=l;++m){if(h=a[S(m)],h.skip)continue;const E=h.x,A=h.y,k=E|0;k===x?(A<C?C=A:A>y&&(y=A),u=(f*u+E)/++f):(V(),t.lineTo(E,A),x=k,f=0,C=y=A),p=A}V()}function ns(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?db:cb}function ub(t){return t.stepped?dg:t.tension||t.cubicInterpolationMode==="monotone"?ug:Sn}function fb(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Ac(t,n.options),t.stroke(a)}function mb(t,n,o,r){const{segments:a,options:s}=n,i=ns(n);for(const l of a)Ac(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const hb=typeof Path2D=="function";function pb(t,n,o,r){hb&&!n.options.segment?fb(t,n,o,r):mb(t,n,o,r)}class ln extends Gt{constructor(n){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,n&&Object.assign(this,n)}updateControlPoints(n,o){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;ng(this._points,r,n,a,o),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=bg(this,this.options.segment))}first(){const n=this.segments,o=this.points;return n.length&&o[n[0].start]}last(){const n=this.segments,o=this.points,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=zl(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=ub(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:m}=i[d],h=s[f],x=s[m];if(h===x){l.push(h);continue}const C=Math.abs((a-h[o])/(x[o]-h[o])),y=c(h,x,C,r.stepped);y[o]=n[o],l.push(y)}return l.length===1?l[0]:l}pathSegment(n,o,r){return ns(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=ns(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),pb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}de(ln,"id","line"),de(ln,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),de(ln,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),de(ln,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function Dc(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class yr extends Gt{constructor(o){super();de(this,"parsed");de(this,"skip");de(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return Dc(this,o,"x",r)}inYRange(o,r){return Dc(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!po(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,Ia(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}de(yr,"id","point"),de(yr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),de(yr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Nc(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-f,u=r+f):(f=s/2,l=o-f,c=o+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function cn(t,n,o,r){return t?0:tt(n,o,r)}function gb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Cl(r);return{t:cn(a.top,s.top,0,o),r:cn(a.right,s.right,0,n),b:cn(a.bottom,s.bottom,0,o),l:cn(a.left,s.left,0,n)}}function bb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=zn(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Se(a);return{topLeft:cn(!c||l.top||l.left,s.topLeft,0,i),topRight:cn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:cn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:cn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function yb(t){const n=Nc(t),o=n.right-n.left,r=n.bottom-n.top,a=gb(t,o/2,r/2),s=bb(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function os(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&Nc(t,r);return l&&(a||Ht(n,l.left,l.right))&&(s||Ht(o,l.top,l.bottom))}function xb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function kb(t,n){t.rect(n.x,n.y,n.w,n.h)}function rs(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class xr extends Gt{constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){const{inflateAmount:o,options:{borderColor:r,backgroundColor:a}}=this,{inner:s,outer:i}=yb(this),l=xb(i.radius)?tr:kb;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,rs(i,o,s)),n.clip(),l(n,rs(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,rs(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return os(this,n,o,r)}inXRange(n,o){return os(this,n,null,o)}inYRange(n,o){return os(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}de(xr,"id","bar"),de(xr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),de(xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function wb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=kr(c,d,a);const u=as(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=zl(n,u);for(const m of f){const h=as(o,s[m.start],s[m.end],m.loop),x=Fl(l,a,h);for(const C of x)i.push({source:C,target:m,start:{[o]:Mc(u,h,"start",Math.max)},end:{[o]:Mc(u,h,"end",Math.min)}})}}return i}function as(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=ft(a),s=ft(s)),{property:t,start:a,end:s}}function Cb(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=kr(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function kr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function Mc(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function Pc(t,n){let o=[],r=!1;return Xe(t)?(r=!0,o=t):o=Cb(t,n),o.length?new ln({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function Tc(t){return t&&t.fill!==!1}function Bb(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!et(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Eb(t,n,o){const r=Vb(t);if(Se(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return et(a)&&Math.floor(a)===a?_b(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function _b(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function Sb(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Se(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Ab(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Se(t)?r=t.value:r=n.getBaseValue(),r}function Vb(t){const n=t.options,o=n.fill;let r=we(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Db(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Nb(n,o);l.push(Pc({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Mb(a,i[u],l)}return new ln({points:a,options:{}})}function Nb(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function Mb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Pb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Pb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],m=i[u.end][o];if(Ht(a,f,m)){l=a===f,c=a===m;break}}return{first:l,last:c,point:r}}class vc{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:je},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Tb(t){const{chart:n,fill:o,line:r}=t;if(et(o))return vb(n,o);if(o==="stack")return Db(t);if(o==="shape")return!0;const a=Ob(t);return a instanceof vc?a:Pc(a,r)}function vb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Ob(t){return(t.scale||{}).getPointPositionForValue?zb(t):Fb(t)}function Fb(t){const{scale:n={},fill:o}=t,r=Sb(o,n);if(et(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function zb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Ab(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new vc({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function ss(t,n,o){const r=Tb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:m=f,below:h=f}=u||{},x=a.getDatasetMeta(s),C=Ll(a,x);r&&i.points.length&&(Zo(t,o),Ib(t,{line:i,target:r,above:m,below:h,area:o,scale:l,axis:c,clip:C}),er(t))}function Ib(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(Oc(t,r,i.top),is(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),Oc(t,r,i.bottom)):d==="y"&&(Fc(t,r,i.left),is(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Fc(t,r,i.right),u=a)),is(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function Oc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[kr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function Fc(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[kr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,f.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function is(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=wb(o,r,a);for(const{source:d,target:u,start:f,end:m}of c){const{style:{backgroundColor:h=s}={}}=d,x=r!==!0;t.save(),t.fillStyle=h,Rb(t,i,l,x&&as(a,f,m)),t.beginPath();const C=!!o.pathSegment(t,d);let y;if(x){C?t.closePath():zc(t,r,m,a);const p=!!r.pathSegment(t,u,{move:C,reverse:!0});y=C&&p,y||zc(t,r,f,a)}t.closePath(),t.fill(y?"evenodd":"nonzero"),t.restore()}}function Rb(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),f=Math.min(f,o.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function zc(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var Lb={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof ln&&(c={visible:t.isDatasetVisible(i),index:i,fill:Eb(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Bb(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&ss(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;Tc(s)&&ss(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!Tc(r)||o.drawTime!=="beforeDatasetDraw"||ss(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ic=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},$b=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class Rc extends Gt{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const n=this.options.labels||{};let o=$e(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:n,ctx:o}=this;if(!n.display){this.width=this.height=0;return}const r=n.labels,a=ot(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Ic(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=n;s.textAlign="left",s.textBaseline="middle";let m=-1,h=-u;return this.legendItems.forEach((x,C)=>{const y=r+o/2+s.measureText(x.text).width;(C===0||d[d.length-1]+y+2*l>i)&&(f+=u,d[d.length-(C>0?0:1)]=0,h+=u,m++),c[C]={left:0,top:h,row:m,width:y,height:a},d[d.length-1]+=y+l}),f}_fitCols(n,o,r,a){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-n;let f=l,m=0,h=0,x=0,C=0;return this.legendItems.forEach((y,p)=>{const{itemWidth:S,itemHeight:V}=jb(r,o,s,y,a);p>0&&h+V+2*l>u&&(f+=m+l,d.push({width:m,height:h}),x+=m+l,C++,m=h=0),c[p]={left:x,top:h,col:C,width:S,height:V},m=Math.max(m,S),h+=V+l}),f+=m,d.push({width:m,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=Ln(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=nt(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=nt(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=nt(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=nt(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;Zo(n,this),this._draw(),er(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=Ge.color,c=Ln(n.rtl,this.left,this.width),d=ot(i.font),{padding:u}=i,f=d.size,m=f/2;let h;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:x,boxHeight:C,itemHeight:y}=Ic(i,f),p=function(k,g,b){if(isNaN(x)||x<=0||isNaN(C)||C<0)return;a.save();const M=we(b.lineWidth,1);if(a.fillStyle=we(b.fillStyle,l),a.lineCap=we(b.lineCap,"butt"),a.lineDashOffset=we(b.lineDashOffset,0),a.lineJoin=we(b.lineJoin,"miter"),a.lineWidth=M,a.strokeStyle=we(b.strokeStyle,l),a.setLineDash(we(b.lineDash,[])),i.usePointStyle){const w={radius:C*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:M},_=c.xPlus(k,x/2),B=g+m;wl(a,w,_,B,i.pointStyleWidth&&x)}else{const w=g+Math.max((f-C)/2,0),_=c.leftForLtr(k,x),B=zn(b.borderRadius);a.beginPath(),Object.values(B).some(D=>D!==0)?tr(a,{x:_,y:w,w:x,h:C,radius:B}):a.rect(_,w,x,C),a.fill(),M!==0&&a.stroke()}a.restore()},S=function(k,g,b){go(a,b.text,k,g+y/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},V=this.isHorizontal(),E=this._computeTitleHeight();V?h={x:nt(s,this.left+u,this.right-r[0]),y:this.top+u+E,line:0}:h={x:this.left+u,y:nt(s,this.top+E+u,this.bottom-o[0].height),line:0},Pl(this.ctx,n.textDirection);const A=y+u;this.legendItems.forEach((k,g)=>{a.strokeStyle=k.fontColor,a.fillStyle=k.fontColor;const b=a.measureText(k.text).width,M=c.textAlign(k.textAlign||(k.textAlign=i.textAlign)),w=x+m+b;let _=h.x,B=h.y;c.setWidth(this.width),V?g>0&&_+w+u>this.right&&(B=h.y+=A,h.line++,_=h.x=nt(s,this.left+u,this.right-r[h.line])):g>0&&B+A>this.bottom&&(_=h.x=_+o[h.line].width+u,h.line++,B=h.y=nt(s,this.top+E+u,this.bottom-o[h.line].height));const D=c.x(_);if(p(D,B,k),_=yp(M,_+x+m,V?_+w:this.right,n.rtl),S(c.x(_),B,k),V)h.x+=w+u;else if(typeof k.text!="string"){const N=d.lineHeight;h.y+=Lc(k,N)+u}else h.y+=A}),Tl(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=ot(o.font),a=xt(o.padding);if(!o.display)return;const s=Ln(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,f=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),u=this.top+d,f=nt(n.align,f,this.right-m);else{const x=this.columnSizes.reduce((C,y)=>Math.max(C,y.height),0);u=d+nt(n.align,this.top,this.bottom-x-n.labels.padding-this._computeTitleHeight())}const h=nt(l,f,f+m);i.textAlign=s.textAlign(Pa(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,go(i,o.text,h,u,r)}_computeTitleHeight(){const n=this.options.title,o=ot(n.font),r=xt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(Ht(n,this.left,this.right)&&Ht(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],Ht(n,a.left,a.left+a.width)&&Ht(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!Hb(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=$b(a,r);a&&!s&&$e(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&$e(o.onHover,[n,r,this],this)}else r&&$e(o.onClick,[n,r,this],this)}}function jb(t,n,o,r,a){const s=Ub(r,t,n,o),i=Wb(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function Ub(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function Wb(t,n,o){let r=t;return typeof n.text!="string"&&(r=Lc(n,o)),r}function Lc(t,n){const o=t.text?t.text.length:0;return n*o}function Hb(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var qb={id:"legend",_element:Rc,start(t,n,o){const r=t.legend=new Rc({ctx:t.ctx,options:o,chart:t});kt.configure(t,r,o),kt.addBox(t,r)},stop(t){kt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;kt.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=xt(d.borderWidth);return{text:n[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class $c extends Gt{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=Xe(r.text)?r.text.length:1;this._padding=xt(r.padding);const s=a*ot(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){const{top:o,left:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=nt(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=nt(l,a,o),c=Fe*-.5):(u=s-n,f=nt(l,o,a),c=Fe*.5),d=a-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=ot(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);go(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:Pa(o.align),textBaseline:"middle",translation:[i,l]})}}function Gb(t,n){const o=new $c({ctx:t.ctx,options:n,chart:t});kt.configure(t,o,n),kt.addBox(t,o),t.titleBlock=o}var Kb={id:"title",_element:$c,start(t,n,o){Gb(t,o)},stop(t){const n=t.titleBlock;kt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;kt.configure(t,r,o),r.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const _o={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Na(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function vt(t,n){return n&&(Xe(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function Xt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
17
17
|
`)>-1?t.split(`
|
|
18
|
-
`):t}function Kb(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function jc(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=ot(n.bodyFont),d=ot(n.titleFont),u=ot(n.footerFont),f=s.length,m=a.length,h=r.length,k=yt(n.padding);let C=k.height,w=0,p=r.reduce((S,V)=>S+V.before.length+V.lines.length+V.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(C+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const S=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;C+=h*S+(p-h)*c.lineHeight+(p-1)*n.bodySpacing}m&&(C+=n.footerMarginTop+m*u.lineHeight+(m-1)*n.footerSpacing);let A=0;const D=function(S){w=Math.max(w,o.measureText(S).width+A)};return o.save(),o.font=d.string,Oe(t.title,D),o.font=c.string,Oe(t.beforeBody.concat(t.afterBody),D),A=n.displayColors?i+2+n.boxPadding:0,Oe(r,S=>{Oe(S.before,D),Oe(S.lines,D),Oe(S.after,D)}),A=0,o.font=u.string,Oe(t.footer,D),o.restore(),w+=k.width,{width:w,height:C}}function Xb(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function Yb(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function Jb(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),Yb(d,t,n,o)&&(d="center"),d}function Uc(t,n,o){const r=o.yAlign||n.yAlign||Xb(t,o);return{xAlign:o.xAlign||n.xAlign||Jb(t,n,o,r),yAlign:r}}function Qb(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function Zb(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function Wc(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:f,bottomLeft:m,bottomRight:h}=Rn(i);let k=Qb(n,l);const C=Zb(n,c,d);return c==="center"?l==="left"?k+=d:l==="right"&&(k-=d):l==="left"?k-=Math.max(u,m)+a:l==="right"&&(k+=Math.max(f,h)+a),{x:tt(k,0,r.width-n.width),y:tt(C,0,r.height-n.height)}}function wr(t,n,o){const r=yt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function Hc(t){return Tt([],Xt(t))}function ey(t,n,o){return Bn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function qc(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const Gc={beforeTitle:Ut,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:Ut,beforeBody:Ut,beforeLabel:Ut,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return ve(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Ut,afterBody:Ut,beforeFooter:Ut,footer:Ut,afterFooter:Ut};function it(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?Gc[n].call(o,r):a}class ls extends Gt{constructor(n){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=n.chart,this.options=n.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const o=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new jl(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ey(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=it(r,"beforeTitle",this,n),s=it(r,"title",this,n),i=it(r,"afterTitle",this,n);let l=[];return l=Tt(l,Xt(a)),l=Tt(l,Xt(s)),l=Tt(l,Xt(i)),l}getBeforeBody(n,o){return Hc(it(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Oe(n,s=>{const i={before:[],lines:[],after:[]},l=qc(r,s);Tt(i.before,Xt(it(l,"beforeLabel",this,s))),Tt(i.lines,it(l,"label",this,s)),Tt(i.after,Xt(it(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return Hc(it(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=it(r,"beforeFooter",this,n),s=it(r,"footer",this,n),i=it(r,"afterFooter",this,n);let l=[];return l=Tt(l,Xt(a)),l=Tt(l,Xt(s)),l=Tt(l,Xt(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(Kb(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,m)=>n.filter(u,f,m,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Oe(l,u=>{const f=qc(n.callbacks,u);a.push(it(f,"labelColor",this,u)),s.push(it(f,"labelPointStyle",this,u)),i.push(it(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=_o[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=jc(this,r),d=Object.assign({},l,c),u=Uc(this.chart,r,d),f=Wc(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=Rn(l),{x:m,y:h}=n,{width:k,height:C}=o;let w,p,A,D,S,V;return s==="center"?(S=h+C/2,a==="left"?(w=m,p=w-i,D=S+i,V=S-i):(w=m+k,p=w+i,D=S-i,V=S+i),A=w):(a==="left"?p=m+Math.max(c,u)+i:a==="right"?p=m+k-Math.max(d,f)-i:p=this.caretX,s==="top"?(D=h,S=D-i,w=p-i,A=p+i):(D=h+C,S=D+i,w=p+i,A=p-i),V=D),{x1:w,x2:p,x3:A,y1:D,y2:S,y3:V}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=$n(r.rtl,this.x,this.width);for(n.x=wr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=ot(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=ot(s.bodyFont),f=wr(this,"left",s),m=a.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,k=o.y+h;if(s.usePointStyle){const C={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},w=a.leftForLtr(m,d)+d/2,p=k+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,Ra(n,C,w,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,Ra(n,C,w,p)}else{n.lineWidth=Se(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const C=a.leftForLtr(m,d),w=a.leftForLtr(a.xPlus(m,1),d-2),p=Rn(i.borderRadius);Object.values(p).some(A=>A!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,tr(n,{x:C,y:k,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),tr(n,{x:w,y:k+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(C,k,d,c),n.strokeRect(C,k,d,c),n.fillStyle=i.backgroundColor,n.fillRect(w,k+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=ot(r.bodyFont);let m=f.lineHeight,h=0;const k=$n(r.rtl,this.x,this.width),C=function(b){o.fillText(b,k.x(n.x+h),n.y+m/2),n.y+=m+s},w=k.textAlign(i);let p,A,D,S,V,B,g;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=wr(this,w,r),o.fillStyle=r.bodyColor,Oe(this.beforeBody,C),h=l&&w!=="right"?i==="center"?d/2+u:d+2+u:0,S=0,B=a.length;S<B;++S){for(p=a[S],A=this.labelTextColors[S],o.fillStyle=A,Oe(p.before,C),D=p.lines,l&&D.length&&(this._drawColorBox(o,n,S,k,r),m=Math.max(f.lineHeight,c)),V=0,g=D.length;V<g;++V)C(D[V]),m=f.lineHeight;Oe(p.after,C)}h=0,m=f.lineHeight,Oe(this.afterBody,C),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=$n(r.rtl,this.x,this.width);for(n.x=wr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=ot(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:f,topRight:m,bottomLeft:h,bottomRight:k}=Rn(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-m,c),o.quadraticCurveTo(l+d,c,l+d,c+m),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-k),o.quadraticCurveTo(l+d,c+u,l+d-k,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+h,c+u),o.quadraticCurveTo(l,c+u,l,c+u-h),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=_o[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=jc(this,n),c=Object.assign({},i,this._size),d=Uc(o,n,c),u=Wc(n,c,d,o);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(n){const o=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=yt(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(n.save(),n.globalAlpha=r,this.drawBackground(s,n,a,o),Pl(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),Tl(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=n.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!Xo(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!Xo(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(n,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=_o[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}de(ls,"positioners",_o);var ty={id:"tooltip",_element:ls,positioners:_o,afterInit(t,n,o){o&&(t.tooltip=new ls({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.tooltip.handleEvent(n.event,o,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,n)=>n.bodyFont.size,boxWidth:(t,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Gc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const ny=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function oy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return ny(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const ry=(t,n)=>t===null?null:tt(Math.round(t),0,n);function Kc(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class cs extends Un{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(ve(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:oy(r,n,we(o,n),this._addedLabels),ry(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return Kc.call(this,n)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}de(cs,"id","category"),de(cs,"defaults",{ticks:{callback:Kc}});function ay(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:m}=t,h=s||1,k=u-1,{min:C,max:w}=n,p=!ve(i),A=!ve(l),D=!ve(d),S=(w-C)/(f+1);let V=sl((w-C)/k/h)*h,B,g,b,_;if(V<1e-14&&!p&&!A)return[{value:C},{value:w}];_=Math.ceil(w/V)-Math.floor(C/V),_>k&&(V=sl(_*V/k/h)*h),ve(c)||(B=Math.pow(10,c),V=Math.ceil(V*B)/B),a==="ticks"?(g=Math.floor(C/V)*V,b=Math.ceil(w/V)*V):(g=C,b=w),p&&A&&s&&lp((l-i)/s,V/1e3)?(_=Math.round(Math.min((l-i)/V,u)),V=(l-i)/_,g=i,b=l):D?(g=p?i:g,b=A?l:b,_=d-1,V=(b-g)/_):(_=(b-g)/V,co(_,Math.round(_),V/1e3)?_=Math.round(_):_=Math.ceil(_));const y=Math.max(il(V),il(g));B=Math.pow(10,ve(c)?y:c),g=Math.round(g*B)/B,b=Math.round(b*B)/B;let x=0;for(p&&(m&&g!==i?(o.push({value:i}),g<i&&x++,co(Math.round((g+x*V)*B)/B,i,Xc(i,S,t))&&x++):g<i&&x++);x<_;++x){const E=Math.round((g+x*V)*B)/B;if(A&&E>l)break;o.push({value:E})}return A&&m&&b!==l?o.length&&co(o[o.length-1].value,l,Xc(l,S,t))?o[o.length-1].value=l:o.push({value:l}):(!A||b===l)&&o.push({value:b}),o}function Xc(t,n,{horizontal:o,minRotation:r}){const a=Wt(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class sy extends Un{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,o){return ve(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=Mt(a),d=Mt(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:n.bounds,min:n.min,max:n.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=ay(a,s);return n.bounds==="ticks"&&cp(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const n=this.ticks;let o=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return Oa(n,this.chart.options.locale,this.options.ticks.format)}}class ds extends sy{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=et(n)?n:0,this.max=et(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=Wt(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}de(ds,"id","linear"),de(ds,"defaults",{ticks:{callback:yl.formatters.numeric}});const Cr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},lt=Object.keys(Cr);function Yc(t,n){return t-n}function Jc(t,n){if(ve(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),et(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(uo(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function Qc(t,n,o,r){const a=lt.length;for(let s=lt.indexOf(t);s<a-1;++s){const i=Cr[lt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return lt[s]}return lt[a-1]}function iy(t,n,o,r,a){for(let s=lt.length-1;s>=lt.indexOf(o);s--){const i=lt[s];if(Cr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return lt[o?lt.indexOf(o):0]}function ly(t){for(let n=lt.indexOf(t)+1,o=lt.length;n<o;++n)if(Cr[lt[n]].common)return lt[n]}function Zc(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=Ma(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function cy(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function ed(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:cy(t,r,a,o)}class Br extends Un{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,o={}){const r=n.time||(n.time={}),a=this._adapter=new Hg._date(n.adapters.date);a.init(o),io(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:Jc(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=et(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=et(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=hp(a,s,i);return this._unit=o.unit||(r.autoSkip?Qc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):iy(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:ly(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),ed(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=tt(o,0,i),r=tt(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||Qc(s.minUnit,o,r,this._getLabelCapacity(o)),l=we(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=uo(c)||c===!0,u={};let f=o,m,h;if(d&&(f=+n.startOf(f,"isoWeek",c)),f=+n.startOf(f,d?"day":i),n.diff(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const k=a.ticks.source==="data"&&this.getDataTimestamps();for(m=f,h=0;m<r;m=+n.add(m,l,i),h++)Zc(u,m,k);return(m===r||a.bounds==="ticks"||h===1)&&Zc(u,m,k),Object.keys(u).sort(Yc).map(C=>+C)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return $e(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],m=r[o],h=d&&f&&m&&m.major;return this._adapter.format(n,a||(h?f:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=Wt(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,ed(this,[n],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let n=this._cache.data||[],o,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(Jc(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return ul(n.sort(Yc))}}de(Br,"id","time"),de(Br,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Er(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=kn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=kn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class td extends Br{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=Er(o,this.min),this._tableRange=Er(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const n=this.min,o=this.max;let r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(Er(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return Er(this._table,r*this._tableRange+this._minPos,!0)}}de(td,"id","timeseries"),de(td,"defaults",Br.defaults);const dy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},uy={key:0,class:"text-red-500 ml-1"},fy={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},my={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},hy={class:"text-red-600 text-sm"},py={key:1,class:"mt-2 text-xs text-gray-500"},gy={key:0},nd=at(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:n,emit:o}){Kt.register(cs,ds,yr,ln,xr,Eo,Gb,ty,Hb,Ib,lr,ir,Xa,jn);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const m=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:h=>{let k=0;return h.type==="data"&&h.mode==="default"&&(k=h.dataIndex*100+h.datasetIndex*50),k},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:m?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:m?"#1F2937":"#FFFFFF",titleColor:m?"#F3F4F6":"#111827",bodyColor:m?"#D1D5DB":"#4B5563",borderColor:m?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}},y:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}}}:void 0}},u=m=>!m||!m.datasets?m:{...m,datasets:m.datasets.map((h,k)=>{const C=k%r.colors.length,w=r.colors[C];let p=h.backgroundColor,A=h.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?h.data&&(p=h.data.map((D,S)=>r.colors[S%r.colors.length]+"80"),A=h.data.map((D,S)=>r.colors[S%r.colors.length])):(p=p||w+"40",A=A||w),{...h,borderColor:A,backgroundColor:p,pointBackgroundColor:h.pointBackgroundColor||w,pointBorderColor:h.pointBorderColor||w,hoverBackgroundColor:h.hoverBackgroundColor||w+"60",hoverBorderColor:h.hoverBorderColor||w}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const m=r.data||r.modelValue;let h=m;if(Array.isArray(m))if(m.length>0&&typeof m[0]=="object"&&m[0]!==null){const C=Object.keys(m[0]),w=C.find(A=>["label","name","x","category","title"].includes(A.toLowerCase()))||C[0],p=C.find(A=>A!==w&&["value","y","count","amount","total","data"].includes(A.toLowerCase()))||C.find(A=>A!==w&&typeof m[0][A]=="number")||(C.length>1?C.find(A=>A!==w):C[0]);h={labels:m.map(A=>A[w||""]),datasets:[{label:r.label||"Data",data:m.map(A=>A[p||""])}]}}else m.length>0?h={labels:m.map((C,w)=>`Data ${w+1}`),datasets:[{label:r.label||"Data",data:m}]}:h={labels:[],datasets:[]};if(l.value=u(h),!l.value)return;const k={...d(),...r.options,onClick:(C,w)=>{a("click",C,w),r.onClick&&r.onClick(C,w)},onHover:(C,w)=>{a("hover",C,w),r.onHover&&r.onHover(C,w)}};i.value=new Kt(s.value,{type:r.type,data:l.value,options:k}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",dy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",uy,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",fy,[...h[0]||(h[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",my,[e.createElementVNode("div",hy,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",py,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",gy,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),So=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.Label),e.mergeProps(e.unref(o),{class:e.unref(_e)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),by={class:"grid gap-1.5"},yy={key:0,class:"ml-1 text-destructive"},xy=["aria-busy"],ky={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},wy={key:1,class:"flex items-center"},Cy=["id","checked","indeterminate","disabled","required"],Yt=at(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,m=>{d.value=!!m},{immediate:!0});const u=()=>{if(a.disabled)return;const m=!d.value;d.value=m,r("update:modelValue",m)},f=m=>{(m.key===" "||m.key==="Enter")&&(m.preventDefault(),u())};return(m,h)=>(e.openBlock(),e.createElementBlock("div",by,[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",yy,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",ky)):e.createCommentVNode("",!0),h[0]||(h[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",wy,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Cy),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(te.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(te.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,xy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),By={class:"w-full"},Ey={key:0,class:"mb-4"},_y={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Sy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Ay={key:0,class:"ml-1 text-destructive"},Vy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Dy={key:1,class:"flex flex-wrap gap-4"},Ny={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},My={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Py={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},us=at(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=Ke(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,V=>{if(!V){s.value=new Set;return}const B=V.map(g=>typeof g=="object"&&g!==null?g.id!==void 0?g.id:g.value:g);s.value=new Set(B)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var B,g;const V=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(!(!V&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const _=((g=a.endpoint)==null?void 0:g.apiMethod)||a.apiMethod||"GET",y={page:1,perPage:100,...a.apiParams};if(V)b=await o(V,_,y);else if(a.apiModule&&a.apiAction){const{DCodeApi:E}=Ke();b=await E(a.apiModule,a.apiAction,y)}let x=b;a.dataPath?x=a.dataPath.split(".").reduce((M,T)=>M&&M[T]!==void 0?M[T]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(x=b.data),Array.isArray(x)?i.value=x:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(b){console.error("DCodeCardCheckboxList fetch error:",b),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const m=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var V;((V=a.endpoint)!=null&&V.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),m(),typeof document<"u"&&(f=new MutationObserver(m),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const h=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),k=V=>{if(typeof V!="object"||V===null)return V;const B=a.itemValue||a.model||"id";return V[B]},C=V=>{if(typeof V!="object"||V===null)return String(V);const B=a.itemTitle||"name";return V[B]},w=V=>s.value.has(V),p=(V,B)=>{if(a.disabled)return;const g=new Set(s.value);B?g.add(V):g.delete(V),s.value=g;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},A=e.computed(()=>a.skeleton||l.value),D=e.computed(()=>!!a.error||!!c.value),S=e.computed(()=>a.error||c.value);return(V,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",By,[t.label||A.value?(e.openBlock(),e.createElementBlock("div",Ey,[A.value?(e.openBlock(),e.createElementBlock("div",_y)):(e.openBlock(),e.createElementBlock("h3",Sy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ay,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Vy,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),A.value?(e.openBlock(),e.createElementBlock("div",Dy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,g=>e.createElementVNode("div",{key:`skeleton-${g}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...B[1]||(B[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[h.value.length===0?(e.openBlock(),e.createElementBlock("div",Ny," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",My,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(g,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(Yt,{"model-value":w(k(g)),title:C(g),disabled:t.disabled,"onUpdate:modelValue":_=>p(k(g),_)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),D.value&&S.value?(e.openBlock(),e.createElementBlock("div",Py,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(S.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Ty=["aria-busy"],vy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Oy={key:1,class:"flex justify-end"},Fy=["for"],zy={key:0,class:"ml-1 text-destructive"},Ry={class:"relative w-full group"},Iy={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Ly={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},$y=["id","disabled","readonly","placeholder","maxlength"],jy={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},Uy={key:1,class:"flex items-center gap-1 text-xs text-destructive"},fs=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const x=o.required,E=o["aria-required"];return x===""||x===!0||x==="true"||(E==="true"||E===!0)}),c=e.computed(()=>{const x=o.maxlength??o.maxLength;let E=Number.NaN;return typeof x=="number"?E=x:typeof x=="string"&&(E=Number.parseInt(x,10)),Number.isFinite(E)&&E>0?E:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),m=x=>{const E=x.replaceAll(/\D/g,"");return E?Number(E):null},h=x=>f.value.format(x),k=e.ref(""),C=e.ref(null);e.watch(()=>a.modelValue,x=>{x==null?k.value="":m(k.value)!==x&&(k.value=h(x))},{immediate:!0});const w=(x,E)=>{let M=0;for(let T=0;T<E;T++)/\d/.test(x[T])&&M++;return M},p=(x,E)=>{let M=0;for(let T=0;T<x.length;T++)if(/\d/.test(x[T])&&(M++,M===E))return T+1;return x.length},A=x=>{const E=x.target,M=E.value,T=E.selectionStart??M.length,$=m(M);if($===null){k.value="",r("update:modelValue",null);return}const v=h($);if(M!==v){const I=w(M,T);k.value=v,e.nextTick(()=>{if(C.value){const j=p(v,I);C.value.setSelectionRange(j,j)}})}r("update:modelValue",$)},D=()=>{k.value="",r("update:modelValue",null),r("clear")},S=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?k.value.length>0:!0),V=e.computed(()=>!!a.error),B=e.computed(()=>{const{class:x,maxlength:E,maxLength:M,...T}=o;return T}),g=e.computed(()=>k.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),_=e.computed(()=>b.value&&g.value>0),y=e.computed(()=>`${g.value} / ${c.value}`);return(x,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",vy)):e.createCommentVNode("",!0),E[2]||(E[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(e.openBlock(),e.createElementBlock("div",Oy,[...E[1]||(E[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",zy,"*")):e.createCommentVNode("",!0)],8,Fy)):e.createCommentVNode("",!0),e.createElementVNode("div",Ry,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",V.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[e.createElementVNode("div",Iy,[e.createElementVNode("span",Ly,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:C,"onUpdate:modelValue":E[0]||(E[0]=M=>k.value=M),onInput:A,type:"text",inputmode:"numeric"},B.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",S.value?"pr-8":""]}),null,16,$y),[[e.vModelText,k.value]]),S.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:D},[e.createVNode(e.unref(te.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),_.value&&!V.value?(e.openBlock(),e.createElementBlock("p",jy,e.toDisplayString(y.value),1)):e.createCommentVNode("",!0)]),V.value?(e.openBlock(),e.createElementBlock("p",Uy,[e.createVNode(e.unref(te.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Ty))}}),Wy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hy=(t,n,o)=>{let r;const a=Wy[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function Hn(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const qy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ky={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xy={date:Hn({formats:qy,defaultWidth:"full"}),time:Hn({formats:Gy,defaultWidth:"full"}),dateTime:Hn({formats:Ky,defaultWidth:"full"})},Yy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Jy=(t,n,o,r)=>Yy[t];function vt(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const Qy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ex={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ox={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},rx={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:vt({values:Qy,defaultWidth:"wide"}),quarter:vt({values:Zy,defaultWidth:"wide",argumentCallback:t=>t-1}),month:vt({values:ex,defaultWidth:"wide"}),day:vt({values:tx,defaultWidth:"wide"}),dayPeriod:vt({values:nx,defaultWidth:"wide",formattingValues:ox,defaultFormattingWidth:"wide"})};function Ot(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?sx(l,f=>f.test(i)):ax(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function ax(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function sx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function od(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const ix=/^(\d+)(th|st|nd|rd)?/i,lx=/\d+/i,cx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},dx={any:[/^b/i,/^(a|c)/i]},ux={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fx={any:[/1/i,/2/i,/3/i,/4/i]},mx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},hx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},px={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xx={ordinalNumber:od({matchPattern:ix,parsePattern:lx,valueCallback:t=>parseInt(t,10)}),era:Ot({matchPatterns:cx,defaultMatchWidth:"wide",parsePatterns:dx,defaultParseWidth:"any"}),quarter:Ot({matchPatterns:ux,defaultMatchWidth:"wide",parsePatterns:fx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ot({matchPatterns:mx,defaultMatchWidth:"wide",parsePatterns:hx,defaultParseWidth:"any"}),day:Ot({matchPatterns:px,defaultMatchWidth:"wide",parsePatterns:gx,defaultParseWidth:"any"}),dayPeriod:Ot({matchPatterns:bx,defaultMatchWidth:"any",parsePatterns:yx,defaultParseWidth:"any"})},kx={code:"en-US",formatDistance:Hy,formatLong:Xy,formatRelative:Jy,localize:rx,match:xx,options:{weekStartsOn:0,firstWeekContainsDate:1}},wx={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},Cx=(t,n,o)=>{let r;const a=wx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},Bx={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},Ex={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},_x={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sx={date:Hn({formats:Bx,defaultWidth:"full"}),time:Hn({formats:Ex,defaultWidth:"full"}),dateTime:Hn({formats:_x,defaultWidth:"full"})},Ax={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},Vx=(t,n,o,r)=>Ax[t],Dx={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},Nx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},Mx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},Px={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},Tx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},vx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},Ox={ordinalNumber:(t,n)=>"ke-"+Number(t),era:vt({values:Dx,defaultWidth:"wide"}),quarter:vt({values:Nx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:vt({values:Mx,defaultWidth:"wide"}),day:vt({values:Px,defaultWidth:"wide"}),dayPeriod:vt({values:Tx,defaultWidth:"wide",formattingValues:vx,defaultFormattingWidth:"wide"})},Fx=/^ke-(\d+)?/i,zx=/\d+/i,Rx={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},Ix={any:[/^s/i,/^(m|e)/i]},Lx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},$x={any:[/1/i,/2/i,/3/i,/4/i]},jx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},Ux={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wx={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},Hx={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},qx={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Gx={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},Kx={ordinalNumber:od({matchPattern:Fx,parsePattern:zx,valueCallback:t=>parseInt(t,10)}),era:Ot({matchPatterns:Rx,defaultMatchWidth:"wide",parsePatterns:Ix,defaultParseWidth:"any"}),quarter:Ot({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ot({matchPatterns:jx,defaultMatchWidth:"wide",parsePatterns:Ux,defaultParseWidth:"any"}),day:Ot({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any"}),dayPeriod:Ot({matchPatterns:qx,defaultMatchWidth:"any",parsePatterns:Gx,defaultParseWidth:"any"})},Xx={code:"id",formatDistance:Cx,formatLong:Sx,formatRelative:Vx,localize:Ox,match:Kx,options:{weekStartsOn:1,firstWeekContainsDate:1}},rd={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},ad="dcode-dp-theme-forced";function Yx(t,n=ad){const o=rd[t]??rd.primary,r=`
|
|
18
|
+
`):t}function Xb(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function jc(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=ot(n.bodyFont),d=ot(n.titleFont),u=ot(n.footerFont),f=s.length,m=a.length,h=r.length,x=xt(n.padding);let C=x.height,y=0,p=r.reduce((E,A)=>E+A.before.length+A.lines.length+A.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(C+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const E=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;C+=h*E+(p-h)*c.lineHeight+(p-1)*n.bodySpacing}m&&(C+=n.footerMarginTop+m*u.lineHeight+(m-1)*n.footerSpacing);let S=0;const V=function(E){y=Math.max(y,o.measureText(E).width+S)};return o.save(),o.font=d.string,Oe(t.title,V),o.font=c.string,Oe(t.beforeBody.concat(t.afterBody),V),S=n.displayColors?i+2+n.boxPadding:0,Oe(r,E=>{Oe(E.before,V),Oe(E.lines,V),Oe(E.after,V)}),S=0,o.font=u.string,Oe(t.footer,V),o.restore(),y+=x.width,{width:y,height:C}}function Yb(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function Jb(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function Qb(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),Jb(d,t,n,o)&&(d="center"),d}function Uc(t,n,o){const r=o.yAlign||n.yAlign||Yb(t,o);return{xAlign:o.xAlign||n.xAlign||Qb(t,n,o,r),yAlign:r}}function Zb(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function ey(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function Wc(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:f,bottomLeft:m,bottomRight:h}=zn(i);let x=Zb(n,l);const C=ey(n,c,d);return c==="center"?l==="left"?x+=d:l==="right"&&(x-=d):l==="left"?x-=Math.max(u,m)+a:l==="right"&&(x+=Math.max(f,h)+a),{x:tt(x,0,r.width-n.width),y:tt(C,0,r.height-n.height)}}function wr(t,n,o){const r=xt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function Hc(t){return vt([],Xt(t))}function ty(t,n,o){return Bn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function qc(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const Gc={beforeTitle:Ut,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:Ut,beforeBody:Ut,beforeLabel:Ut,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return ve(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Ut,afterBody:Ut,beforeFooter:Ut,footer:Ut,afterFooter:Ut};function it(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?Gc[n].call(o,r):a}class ls extends Gt{constructor(n){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=n.chart,this.options=n.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const o=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new jl(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ty(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=it(r,"beforeTitle",this,n),s=it(r,"title",this,n),i=it(r,"afterTitle",this,n);let l=[];return l=vt(l,Xt(a)),l=vt(l,Xt(s)),l=vt(l,Xt(i)),l}getBeforeBody(n,o){return Hc(it(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Oe(n,s=>{const i={before:[],lines:[],after:[]},l=qc(r,s);vt(i.before,Xt(it(l,"beforeLabel",this,s))),vt(i.lines,it(l,"label",this,s)),vt(i.after,Xt(it(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return Hc(it(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=it(r,"beforeFooter",this,n),s=it(r,"footer",this,n),i=it(r,"afterFooter",this,n);let l=[];return l=vt(l,Xt(a)),l=vt(l,Xt(s)),l=vt(l,Xt(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(Xb(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,m)=>n.filter(u,f,m,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Oe(l,u=>{const f=qc(n.callbacks,u);a.push(it(f,"labelColor",this,u)),s.push(it(f,"labelPointStyle",this,u)),i.push(it(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=_o[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=jc(this,r),d=Object.assign({},l,c),u=Uc(this.chart,r,d),f=Wc(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=zn(l),{x:m,y:h}=n,{width:x,height:C}=o;let y,p,S,V,E,A;return s==="center"?(E=h+C/2,a==="left"?(y=m,p=y-i,V=E+i,A=E-i):(y=m+x,p=y+i,V=E-i,A=E+i),S=y):(a==="left"?p=m+Math.max(c,u)+i:a==="right"?p=m+x-Math.max(d,f)-i:p=this.caretX,s==="top"?(V=h,E=V-i,y=p-i,S=p+i):(V=h+C,E=V+i,y=p+i,S=p-i),A=V),{x1:y,x2:p,x3:S,y1:V,y2:E,y3:A}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=Ln(r.rtl,this.x,this.width);for(n.x=wr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=ot(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=ot(s.bodyFont),f=wr(this,"left",s),m=a.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,x=o.y+h;if(s.usePointStyle){const C={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=a.leftForLtr(m,d)+d/2,p=x+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,Ia(n,C,y,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,Ia(n,C,y,p)}else{n.lineWidth=Se(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const C=a.leftForLtr(m,d),y=a.leftForLtr(a.xPlus(m,1),d-2),p=zn(i.borderRadius);Object.values(p).some(S=>S!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,tr(n,{x:C,y:x,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),tr(n,{x:y,y:x+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(C,x,d,c),n.strokeRect(C,x,d,c),n.fillStyle=i.backgroundColor,n.fillRect(y,x+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=ot(r.bodyFont);let m=f.lineHeight,h=0;const x=Ln(r.rtl,this.x,this.width),C=function(b){o.fillText(b,x.x(n.x+h),n.y+m/2),n.y+=m+s},y=x.textAlign(i);let p,S,V,E,A,k,g;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=wr(this,y,r),o.fillStyle=r.bodyColor,Oe(this.beforeBody,C),h=l&&y!=="right"?i==="center"?d/2+u:d+2+u:0,E=0,k=a.length;E<k;++E){for(p=a[E],S=this.labelTextColors[E],o.fillStyle=S,Oe(p.before,C),V=p.lines,l&&V.length&&(this._drawColorBox(o,n,E,x,r),m=Math.max(f.lineHeight,c)),A=0,g=V.length;A<g;++A)C(V[A]),m=f.lineHeight;Oe(p.after,C)}h=0,m=f.lineHeight,Oe(this.afterBody,C),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=Ln(r.rtl,this.x,this.width);for(n.x=wr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=ot(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:f,topRight:m,bottomLeft:h,bottomRight:x}=zn(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-m,c),o.quadraticCurveTo(l+d,c,l+d,c+m),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-x),o.quadraticCurveTo(l+d,c+u,l+d-x,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+h,c+u),o.quadraticCurveTo(l,c+u,l,c+u-h),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=_o[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=jc(this,n),c=Object.assign({},i,this._size),d=Uc(o,n,c),u=Wc(n,c,d,o);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(n){const o=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=xt(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(n.save(),n.globalAlpha=r,this.drawBackground(s,n,a,o),Pl(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),Tl(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=n.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!Xo(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!Xo(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(n,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=_o[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}de(ls,"positioners",_o);var ny={id:"tooltip",_element:ls,positioners:_o,afterInit(t,n,o){o&&(t.tooltip=new ls({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.tooltip.handleEvent(n.event,o,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,n)=>n.bodyFont.size,boxWidth:(t,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Gc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:t=>t!=="filter"&&t!=="itemSort"&&t!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const oy=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function ry(t,n,o,r){const a=t.indexOf(n);if(a===-1)return oy(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const ay=(t,n)=>t===null?null:tt(Math.round(t),0,n);function Kc(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class cs extends jn{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(ve(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:ry(r,n,we(o,n),this._addedLabels),ay(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return Kc.call(this,n)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}de(cs,"id","category"),de(cs,"defaults",{ticks:{callback:Kc}});function sy(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:m}=t,h=s||1,x=u-1,{min:C,max:y}=n,p=!ve(i),S=!ve(l),V=!ve(d),E=(y-C)/(f+1);let A=sl((y-C)/x/h)*h,k,g,b,M;if(A<1e-14&&!p&&!S)return[{value:C},{value:y}];M=Math.ceil(y/A)-Math.floor(C/A),M>x&&(A=sl(M*A/x/h)*h),ve(c)||(k=Math.pow(10,c),A=Math.ceil(A*k)/k),a==="ticks"?(g=Math.floor(C/A)*A,b=Math.ceil(y/A)*A):(g=C,b=y),p&&S&&s&&cp((l-i)/s,A/1e3)?(M=Math.round(Math.min((l-i)/A,u)),A=(l-i)/M,g=i,b=l):V?(g=p?i:g,b=S?l:b,M=d-1,A=(b-g)/M):(M=(b-g)/A,co(M,Math.round(M),A/1e3)?M=Math.round(M):M=Math.ceil(M));const w=Math.max(il(A),il(g));k=Math.pow(10,ve(c)?w:c),g=Math.round(g*k)/k,b=Math.round(b*k)/k;let _=0;for(p&&(m&&g!==i?(o.push({value:i}),g<i&&_++,co(Math.round((g+_*A)*k)/k,i,Xc(i,E,t))&&_++):g<i&&_++);_<M;++_){const B=Math.round((g+_*A)*k)/k;if(S&&B>l)break;o.push({value:B})}return S&&m&&b!==l?o.length&&co(o[o.length-1].value,l,Xc(l,E,t))?o[o.length-1].value=l:o.push({value:l}):(!S||b===l)&&o.push({value:b}),o}function Xc(t,n,{horizontal:o,minRotation:r}){const a=Wt(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class iy extends jn{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,o){return ve(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=Pt(a),d=Pt(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:n.bounds,min:n.min,max:n.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=sy(a,s);return n.bounds==="ticks"&&dp(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const n=this.ticks;let o=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return Oa(n,this.chart.options.locale,this.options.ticks.format)}}class ds extends iy{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=et(n)?n:0,this.max=et(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=Wt(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}de(ds,"id","linear"),de(ds,"defaults",{ticks:{callback:yl.formatters.numeric}});const Cr={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},lt=Object.keys(Cr);function Yc(t,n){return t-n}function Jc(t,n){if(ve(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),et(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(uo(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function Qc(t,n,o,r){const a=lt.length;for(let s=lt.indexOf(t);s<a-1;++s){const i=Cr[lt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return lt[s]}return lt[a-1]}function ly(t,n,o,r,a){for(let s=lt.length-1;s>=lt.indexOf(o);s--){const i=lt[s];if(Cr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return lt[o?lt.indexOf(o):0]}function cy(t){for(let n=lt.indexOf(t)+1,o=lt.length;n<o;++n)if(Cr[lt[n]].common)return lt[n]}function Zc(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=Ma(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function dy(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function ed(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:dy(t,r,a,o)}class Br extends jn{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,o={}){const r=n.time||(n.time={}),a=this._adapter=new qg._date(n.adapters.date);a.init(o),io(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:Jc(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=et(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=et(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=pp(a,s,i);return this._unit=o.unit||(r.autoSkip?Qc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):ly(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:cy(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),ed(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=tt(o,0,i),r=tt(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||Qc(s.minUnit,o,r,this._getLabelCapacity(o)),l=we(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=uo(c)||c===!0,u={};let f=o,m,h;if(d&&(f=+n.startOf(f,"isoWeek",c)),f=+n.startOf(f,d?"day":i),n.diff(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const x=a.ticks.source==="data"&&this.getDataTimestamps();for(m=f,h=0;m<r;m=+n.add(m,l,i),h++)Zc(u,m,x);return(m===r||a.bounds==="ticks"||h===1)&&Zc(u,m,x),Object.keys(u).sort(Yc).map(C=>+C)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return $e(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],m=r[o],h=d&&f&&m&&m.major;return this._adapter.format(n,a||(h?f:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=Wt(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,ed(this,[n],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let n=this._cache.data||[],o,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(Jc(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return ul(n.sort(Yc))}}de(Br,"id","time"),de(Br,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Er(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=kn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=kn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class td extends Br{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=Er(o,this.min),this._tableRange=Er(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const n=this.min,o=this.max;let r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(Er(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return Er(this._table,r*this._tableRange+this._minPos,!0)}}de(td,"id","timeseries"),de(td,"defaults",Br.defaults);const uy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},fy={key:0,class:"text-red-500 ml-1"},my={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},hy={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},py={class:"text-red-600 text-sm"},gy={key:1,class:"mt-2 text-xs text-gray-500"},by={key:0},nd=at(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:n,emit:o}){Kt.register(cs,ds,yr,ln,xr,Eo,Kb,ny,qb,Lb,lr,ir,Xa,$n);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const m=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:h=>{let x=0;return h.type==="data"&&h.mode==="default"&&(x=h.dataIndex*100+h.datasetIndex*50),x},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:m?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:m?"#1F2937":"#FFFFFF",titleColor:m?"#F3F4F6":"#111827",bodyColor:m?"#D1D5DB":"#4B5563",borderColor:m?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}},y:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}}}:void 0}},u=m=>!m||!m.datasets?m:{...m,datasets:m.datasets.map((h,x)=>{const C=x%r.colors.length,y=r.colors[C];let p=h.backgroundColor,S=h.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?h.data&&(p=h.data.map((V,E)=>r.colors[E%r.colors.length]+"80"),S=h.data.map((V,E)=>r.colors[E%r.colors.length])):(p=p||y+"40",S=S||y),{...h,borderColor:S,backgroundColor:p,pointBackgroundColor:h.pointBackgroundColor||y,pointBorderColor:h.pointBorderColor||y,hoverBackgroundColor:h.hoverBackgroundColor||y+"60",hoverBorderColor:h.hoverBorderColor||y}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const m=r.data||r.modelValue;let h=m;if(Array.isArray(m))if(m.length>0&&typeof m[0]=="object"&&m[0]!==null){const C=Object.keys(m[0]),y=C.find(S=>["label","name","x","category","title"].includes(S.toLowerCase()))||C[0],p=C.find(S=>S!==y&&["value","y","count","amount","total","data"].includes(S.toLowerCase()))||C.find(S=>S!==y&&typeof m[0][S]=="number")||(C.length>1?C.find(S=>S!==y):C[0]);h={labels:m.map(S=>S[y||""]),datasets:[{label:r.label||"Data",data:m.map(S=>S[p||""])}]}}else m.length>0?h={labels:m.map((C,y)=>`Data ${y+1}`),datasets:[{label:r.label||"Data",data:m}]}:h={labels:[],datasets:[]};if(l.value=u(h),!l.value)return;const x={...d(),...r.options,onClick:(C,y)=>{a("click",C,y),r.onClick&&r.onClick(C,y)},onHover:(C,y)=>{a("hover",C,y),r.onHover&&r.onHover(C,y)}};i.value=new Kt(s.value,{type:r.type,data:l.value,options:x}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",uy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",fy,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",my,[...h[0]||(h[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",hy,[e.createElementVNode("div",py,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",gy,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",by,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),So=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(me.Label),e.mergeProps(e.unref(o),{class:e.unref(_e)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),yy={key:0,class:"ml-1 text-destructive"},xy=["aria-busy"],ky={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},wy={key:1,class:"flex items-center"},Cy=["id","checked","indeterminate","disabled","required"],Yt=at(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,m=>{d.value=!!m},{immediate:!0});const u=()=>{if(a.disabled||a.readonly)return;const m=!d.value;d.value=m,r("update:modelValue",m)},f=m=>{(m.key===" "||m.key==="Enter")&&(m.preventDefault(),u())};return(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-1.5",a.disabled?"cursor-not-allowed":""])},[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",yy,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",ky)):e.createCommentVNode("",!0),h[0]||(h[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",wy,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled&&!t.readonly,"opacity-50 cursor-not-allowed":t.disabled,"cursor-default opacity-80":t.readonly}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Cy),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":t.readonly?"cursor-default":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(te.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(te.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,xy),[[e.vShow,s.value]])],2))}}),[["__scopeId","data-v-0f459b64"]]),By={class:"w-full"},Ey={key:0,class:"mb-4"},_y={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Sy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Ay={key:0,class:"ml-1 text-destructive"},Vy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Dy={key:1,class:"flex flex-wrap gap-4"},Ny={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},My={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Py={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},us=at(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=Ke(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,A=>{if(!A){s.value=new Set;return}const k=A.map(g=>typeof g=="object"&&g!==null?g.id!==void 0?g.id:g.value:g);s.value=new Set(k)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var k,g;const A=((k=a.endpoint)==null?void 0:k.apiUrl)||a.apiUrl;if(!(!A&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const M=((g=a.endpoint)==null?void 0:g.apiMethod)||a.apiMethod||"GET",w={page:1,perPage:100,...a.apiParams};if(A)b=await o(A,M,w);else if(a.apiModule&&a.apiAction){const{DCodeApi:B}=Ke();b=await B(a.apiModule,a.apiAction,w)}let _=b;a.dataPath?_=a.dataPath.split(".").reduce((D,N)=>D&&D[N]!==void 0?D[N]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(_=b.data),Array.isArray(_)?i.value=_:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(b){console.error("DCodeCardCheckboxList fetch error:",b),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const m=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var A;((A=a.endpoint)!=null&&A.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),m(),typeof document<"u"&&(f=new MutationObserver(m),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const h=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),x=A=>{if(typeof A!="object"||A===null)return A;const k=a.itemValue||a.model||"id";return A[k]},C=A=>{if(typeof A!="object"||A===null)return String(A);const k=a.itemTitle||"name";return A[k]},y=A=>s.value.has(A),p=(A,k)=>{if(a.disabled)return;const g=new Set(s.value);k?g.add(A):g.delete(A),s.value=g;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},S=e.computed(()=>a.skeleton||l.value),V=e.computed(()=>!!a.error||!!c.value),E=e.computed(()=>a.error||c.value);return(A,k)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",By,[t.label||S.value?(e.openBlock(),e.createElementBlock("div",Ey,[S.value?(e.openBlock(),e.createElementBlock("div",_y)):(e.openBlock(),e.createElementBlock("h3",Sy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Ay,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Vy,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),k[0]||(k[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",Dy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,g=>e.createElementVNode("div",{key:`skeleton-${g}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...k[1]||(k[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[h.value.length===0?(e.openBlock(),e.createElementBlock("div",Ny," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",My,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(g,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(Yt,{"model-value":y(x(g)),title:C(g),disabled:t.disabled,"onUpdate:modelValue":M=>p(x(g),M)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),V.value&&E.value?(e.openBlock(),e.createElementBlock("div",Py,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Ty=["aria-busy"],vy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Oy={key:1,class:"flex justify-end"},Fy=["for"],zy={key:0,class:"ml-1 text-destructive"},Iy={class:"relative w-full group"},Ry={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Ly={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},$y=["id","disabled","readonly","placeholder","maxlength"],jy={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},Uy={key:1,class:"flex items-center gap-1 text-xs text-destructive"},fs=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const _=o.required,B=o["aria-required"];return _===""||_===!0||_==="true"||(B==="true"||B===!0)}),c=e.computed(()=>{const _=o.maxlength??o.maxLength;let B=Number.NaN;return typeof _=="number"?B=_:typeof _=="string"&&(B=Number.parseInt(_,10)),Number.isFinite(B)&&B>0?B:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),m=_=>{const B=_.replaceAll(/\D/g,"");return B?Number(B):null},h=_=>f.value.format(_),x=e.ref(""),C=e.ref(null);e.watch(()=>a.modelValue,_=>{_==null?x.value="":m(x.value)!==_&&(x.value=h(_))},{immediate:!0});const y=(_,B)=>{let D=0;for(let N=0;N<B;N++)/\d/.test(_[N])&&D++;return D},p=(_,B)=>{let D=0;for(let N=0;N<_.length;N++)if(/\d/.test(_[N])&&(D++,D===B))return N+1;return _.length},S=_=>{const B=_.target,D=B.value,N=B.selectionStart??D.length,O=m(D);if(O===null){x.value="",r("update:modelValue",null);return}const v=h(O);if(D!==v){const L=y(D,N);x.value=v,e.nextTick(()=>{if(C.value){const $=p(v,L);C.value.setSelectionRange($,$)}})}r("update:modelValue",O)},V=()=>{x.value="",r("update:modelValue",null),r("clear")},E=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?x.value.length>0:!0),A=e.computed(()=>!!a.error),k=e.computed(()=>{const{class:_,maxlength:B,maxLength:D,...N}=o;return N}),g=e.computed(()=>x.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),M=e.computed(()=>b.value&&g.value>0),w=e.computed(()=>`${g.value} / ${c.value}`);return(_,B)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",[e.unref(o).class,a.disabled?"cursor-not-allowed":""]]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",vy)):e.createCommentVNode("",!0),B[2]||(B[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(e.openBlock(),e.createElementBlock("div",Oy,[...B[1]||(B[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",zy,"*")):e.createCommentVNode("",!0)],8,Fy)):e.createCommentVNode("",!0),e.createElementVNode("div",Iy,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",A.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":"",a.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":""])},[e.createElementVNode("div",Ry,[e.createElementVNode("span",Ly,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:C,"onUpdate:modelValue":B[0]||(B[0]=D=>x.value=D),onInput:S,type:"text",inputmode:"numeric"},k.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",E.value?"pr-8":""]}),null,16,$y),[[e.vModelText,x.value]]),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:V},[e.createVNode(e.unref(te.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),M.value&&!A.value?(e.openBlock(),e.createElementBlock("p",jy,e.toDisplayString(w.value),1)):e.createCommentVNode("",!0)]),A.value?(e.openBlock(),e.createElementBlock("p",Uy,[e.createVNode(e.unref(te.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Ty))}}),Wy={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Hy=(t,n,o)=>{let r;const a=Wy[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function Wn(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const qy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ky={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xy={date:Wn({formats:qy,defaultWidth:"full"}),time:Wn({formats:Gy,defaultWidth:"full"}),dateTime:Wn({formats:Ky,defaultWidth:"full"})},Yy={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Jy=(t,n,o,r)=>Yy[t];function Ot(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const Qy={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Zy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ex={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},tx={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nx={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ox={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},rx={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:Ot({values:Qy,defaultWidth:"wide"}),quarter:Ot({values:Zy,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ot({values:ex,defaultWidth:"wide"}),day:Ot({values:tx,defaultWidth:"wide"}),dayPeriod:Ot({values:nx,defaultWidth:"wide",formattingValues:ox,defaultFormattingWidth:"wide"})};function Ft(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?sx(l,f=>f.test(i)):ax(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function ax(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function sx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function od(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const ix=/^(\d+)(th|st|nd|rd)?/i,lx=/\d+/i,cx={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},dx={any:[/^b/i,/^(a|c)/i]},ux={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fx={any:[/1/i,/2/i,/3/i,/4/i]},mx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},hx={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},px={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},gx={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bx={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},yx={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xx={ordinalNumber:od({matchPattern:ix,parsePattern:lx,valueCallback:t=>parseInt(t,10)}),era:Ft({matchPatterns:cx,defaultMatchWidth:"wide",parsePatterns:dx,defaultParseWidth:"any"}),quarter:Ft({matchPatterns:ux,defaultMatchWidth:"wide",parsePatterns:fx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ft({matchPatterns:mx,defaultMatchWidth:"wide",parsePatterns:hx,defaultParseWidth:"any"}),day:Ft({matchPatterns:px,defaultMatchWidth:"wide",parsePatterns:gx,defaultParseWidth:"any"}),dayPeriod:Ft({matchPatterns:bx,defaultMatchWidth:"any",parsePatterns:yx,defaultParseWidth:"any"})},kx={code:"en-US",formatDistance:Hy,formatLong:Xy,formatRelative:Jy,localize:rx,match:xx,options:{weekStartsOn:0,firstWeekContainsDate:1}},wx={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},Cx=(t,n,o)=>{let r;const a=wx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},Bx={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},Ex={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},_x={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Sx={date:Wn({formats:Bx,defaultWidth:"full"}),time:Wn({formats:Ex,defaultWidth:"full"}),dateTime:Wn({formats:_x,defaultWidth:"full"})},Ax={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},Vx=(t,n,o,r)=>Ax[t],Dx={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},Nx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},Mx={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agt","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},Px={narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},Tx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},vx={narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},Ox={ordinalNumber:(t,n)=>"ke-"+Number(t),era:Ot({values:Dx,defaultWidth:"wide"}),quarter:Ot({values:Nx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Ot({values:Mx,defaultWidth:"wide"}),day:Ot({values:Px,defaultWidth:"wide"}),dayPeriod:Ot({values:Tx,defaultWidth:"wide",formattingValues:vx,defaultFormattingWidth:"wide"})},Fx=/^ke-(\d+)?/i,zx=/\d+/i,Ix={narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},Rx={any:[/^s/i,/^(m|e)/i]},Lx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},$x={any:[/1/i,/2/i,/3/i,/4/i]},jx={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},Ux={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},Wx={narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},Hx={narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},qx={narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},Gx={any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},Kx={ordinalNumber:od({matchPattern:Fx,parsePattern:zx,valueCallback:t=>parseInt(t,10)}),era:Ft({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),quarter:Ft({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Ft({matchPatterns:jx,defaultMatchWidth:"wide",parsePatterns:Ux,defaultParseWidth:"any"}),day:Ft({matchPatterns:Wx,defaultMatchWidth:"wide",parsePatterns:Hx,defaultParseWidth:"any"}),dayPeriod:Ft({matchPatterns:qx,defaultMatchWidth:"any",parsePatterns:Gx,defaultParseWidth:"any"})},Xx={code:"id",formatDistance:Cx,formatLong:Sx,formatRelative:Vx,localize:Ox,match:Kx,options:{weekStartsOn:1,firstWeekContainsDate:1}},rd={primary:{light:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"#bfdbfe"},dark:{primary:"hsl(var(--primary))",text:"hsl(var(--primary-foreground))",hover:"hsl(var(--accent))",border:"hsl(var(--border))",range:"rgba(30, 58, 138, 0.3)"}},emerald:{light:{primary:"#16a34a",text:"#ffffff",hover:"#dcfce7",border:"#16a34a",range:"#ecfdf5"},dark:{primary:"#22c55e",text:"#0b1220",hover:"#14532d",border:"#22c55e",range:"rgba(6, 78, 59, 0.3)"}},amber:{light:{primary:"#d97706",text:"#ffffff",hover:"#fffbeb",border:"#d97706",range:"#fffbeb"},dark:{primary:"#f59e0b",text:"#0b1220",hover:"#78350f",border:"#f59e0b",range:"rgba(120, 53, 15, 0.3)"}},violet:{light:{primary:"#7c3aed",text:"#ffffff",hover:"#f5f3ff",border:"#7c3aed",range:"#f5f3ff"},dark:{primary:"#8b5cf6",text:"#0b1220",hover:"#2e1065",border:"#8b5cf6",range:"rgba(46, 16, 101, 0.3)"}},destructive:{light:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.10)",border:"hsl(var(--destructive))",range:"#fef2f2"},dark:{primary:"hsl(var(--destructive))",text:"hsl(var(--destructive-foreground))",hover:"hsl(var(--destructive) / 0.18)",border:"hsl(var(--destructive))",range:"rgba(127, 29, 29, 0.3)"}}},ad="dcode-dp-theme-forced";function Yx(t,n=ad){const o=rd[t]??rd.primary,r=`
|
|
19
19
|
.dp__theme_light {
|
|
20
20
|
--dp-primary-color: ${o.light.primary} !important;
|
|
21
21
|
--dp-primary-text-color: ${o.light.text} !important;
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
.dcode-datepicker-menu .dp__menu_inner {
|
|
64
64
|
padding: 0 !important;
|
|
65
65
|
}
|
|
66
|
-
`.trim();let a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Jx(t,n=ad){e.watch(t,o=>Yx(o,n),{immediate:!0})}const Qx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Zx=["for"],ek={key:0,class:"ml-1 text-destructive"},tk=["disabled","onClick"],nk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},ok=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],rk={class:"flex items-center justify-end gap-2 w-full p-2"},ak=["disabled","onClick"],sk={key:1,class:"text-xs text-destructive"},_r=e.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const x=o.required,E=o["aria-required"];return x===""||x===!0||x==="true"||E==="true"||E===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:x=>{a("update:modelValue",x),a("change",x)}}),u=e.computed(()=>r.locale==="en"?kx:Xx),f=e.computed(()=>r.range?2:!1),m=e.computed(()=>{if(!r.range)return!1;const x={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(x.maxRange=r.autoRangeDays,x.autoRange=r.autoRangeDays),x}),h=x=>{const E=new Date(x);return E.setHours(0,0,0,0),E},k=x=>{const E=new Date(x);return E.setHours(23,59,59,999),E},C=(x,E)=>{const M=new Date(x);return M.setDate(M.getDate()+E),M},w=e.computed(()=>{if(r.disablePast)return h(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return k(C(new Date,r.maxDaysAhead))}),A=e.ref(null),D=e.ref(null),S=x=>{D.value={month:x.month,year:x.year}},V=e.ref(!1);let B=null;e.onMounted(()=>{const x=document.documentElement,E=()=>V.value=x.classList.contains("dark");E(),B=new MutationObserver(E),B.observe(x,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Jx(e.toRef(r,"tone"));const g=x=>{const E=new Date(x),M=E.getDay(),T=E.getDate()-M+(M===0?-6:1);return E.setDate(T),h(E)},b=x=>{const E=g(x);return E.setDate(E.getDate()+6),k(E)},_=x=>{const E=new Date(x);return E.setDate(1),h(E)},y=x=>{const E=new Date(x);return E.setMonth(E.getMonth()+1),E.setDate(0),k(E)};return e.computed(()=>{if(!r.range)return[];const x=new Date,E=h(x),M=g(x),T=b(x),$=_(x),v=y(x),I=(j,U)=>{let P=j;r.disablePast&&P<E&&(P=E);let R=U;if(r.autoRangeDays&&r.autoRangeDays>0){const G=k(C(P,r.autoRangeDays-1));R>G&&(R=G)}return R<P&&(R=k(new Date(P))),[P,R]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:I(M,T)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:I($,v)}]}),(x,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Qx)):e.createCommentVNode("",!0),E[2]||(E[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",ek,"*")):e.createCommentVNode("",!0)],8,Zx)):e.createCommentVNode("",!0),e.createVNode(e.unref(Jd.VueDatePicker),{ref_key:"dpRef",ref:A,modelValue:d.value,"onUpdate:modelValue":E[1]||(E[1]=M=>d.value=M),dark:V.value,range:m.value,"multi-calendars":f.value,disabled:t.disabled,clearable:!1,"text-input":"","enable-time-picker":!1,"time-config":{enableTimePicker:!1},"auto-apply":!1,"action-row":{showPreview:!0,showNow:!1},locale:u.value,"model-type":t.modelType,formats:{input:t.displayFormat},"min-date":w.value,"max-date":p.value,floating:{placement:t.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:S},{"dp-input":e.withCtx(({value:M,onInput:T,onEnter:$,onTab:v,onBlur:I,onFocus:j,onKeypress:U,onPaste:P,toggleMenu:R})=>[e.createElementVNode("div",{class:e.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-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",t.disabled?"opacity-50 cursor-not-allowed":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.disabled,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none",onClick:G=>R()},[e.createVNode(e.unref(te.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,tk),E[4]||(E[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",nk,e.toDisplayString(t.prependInner),1),E[3]||(E[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:M,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.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",t.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:G=>R(),onFocus:G=>j(),onBlur:G=>I(),onInput:G=>T(G),onKeydown:[e.withKeys(G=>$(G),["enter"]),e.withKeys(G=>v(G),["tab"])],onKeypress:G=>U(G),onPaste:G=>P()},null,42,ok)],2)]),"action-buttons":e.withCtx(({selectDate:M,selectionDisabled:T})=>[e.createElementVNode("div",rk,[e.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:E[0]||(E[0]=$=>{var v;return(v=A.value)==null?void 0:v.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:T,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:$=>M()},e.toDisplayString(t.selectLabel),9,ak)])]),_:1},8,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",sk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),ik=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=fe.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),lk=e.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(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(fe.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"}),e.createVNode(e.unref(fe.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("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",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(fe.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:e.withCtx(()=>[e.createVNode(e.unref(te.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),ck=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(_e)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),dk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(_e)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),uk={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},fk={class:"flex items-center gap-3"},mk={class:"flex flex-col"},hk={key:0,class:"flex items-center gap-2"},pk={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"},gk={class:"flex justify-end gap-3 flex-wrap"},Jt=at(e.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?At[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(ik),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(lk),e.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",uk,[e.createElementVNode("div",fk,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",mk,[e.createVNode(e.unref(dk),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(ck),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",hk,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",pk,[e.createElementVNode("div",gk,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),Dn=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>bn(o.icon,At)),a=e.computed(()=>o.textSize?`text-${o.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"},i=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),bk={class:"flex flex-col gap-3 w-full"},yk={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"},xk={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"},kk={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"},wk={class:"text-sm font-medium text-slate-500"},Ck={class:"flex items-center justify-between gap-2"},Bk=["onClick"],Ek={key:0,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"},_k={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},Sk=["onClick"],Ak=["for","onDrop"],Vk={class:"text-xs text-slate-500 dark:text-slate-400"},Dk={key:2,class:"text-xs text-slate-400"},Nk=["id","disabled","accept","onChange"],Mk={class:"flex flex-col items-center justify-center min-h-[300px]"},Pk=["src","alt"],Tk=["src"],vk={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},Ok={class:"text-sm font-medium"},Fk=["href"],ms=e.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{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}},emits:["update:modelValue","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=gt.useI18n(),i=e.computed(()=>{const B=o.endpoint;if(!(B!=null&&B.apiUrl))return null;let g=B.apiUrl;if(!g.startsWith("http")&&o.baseUrl){const b=o.baseUrl.replace(/\/$/,""),_=g.startsWith("/")?g:`/${g}`;g=`${b}${_}`}return g}),l=e.computed(()=>{const B=c.value.length;return B<=1?"grid-cols-1":B===2?"grid-cols-1 md:grid-cols-2":B===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":B===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),f=e.ref(!0),m=e.ref(!1),h=e.ref(""),k=e.ref(""),C=e.ref(""),w=async()=>{var B;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((B=o.endpointReference)!=null&&B.apiUrl)){f.value=!1;return}try{const{apiUrl:g}=Ke(),b=await g(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let _=(b==null?void 0:b.data)||b;Array.isArray(_)||(_=[_]),c.value=_}catch(g){console.error("Failed to fetch dynamic document list",g)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),w()}),e.onBeforeUnmount(()=>{d.value.forEach(B=>{B._localPreviewUrl&&URL.revokeObjectURL(B._localPreviewUrl)})}),e.watch(()=>o.modelValue,B=>{if(Array.isArray(B)&&JSON.stringify(B)!==JSON.stringify(d.value)){const g=JSON.parse(JSON.stringify(B));g.forEach(b=>{const _=d.value.find(y=>y.typeDocument===b.typeDocument||y.idDocumentType===b.idDocumentType);_!=null&&_._localPreviewUrl&&(b._localPreviewUrl=_._localPreviewUrl)}),d.value=g}},{deep:!0}),e.watch(()=>{var B;return(B=o.endpointReference)==null?void 0:B.apiUrl},(B,g)=>{B!==g&&w()}),e.watch(()=>{var B;return(B=o.endpointReference)==null?void 0:B.apiMethod},(B,g)=>{B!==g&&w()}),e.watch(()=>o.items,B=>{c.value=B??[],f.value=!1},{deep:!0,immediate:!0});const p=B=>{const g=B[o.itemValue]||B.id||B.typeDocument;return d.value.find(b=>b.typeDocument===g||b.idDocumentType===g||b[o.itemValue]===g)||null},A=async(B,g,b)=>{var M,T,$,v;const _=b.target,y=(M=_.files)==null?void 0:M[0];if(!y)return;const x=B[o.itemValue]||B.id||B.typeDocument,E=URL.createObjectURL(y);if(!i.value){const I=[...d.value],j=I.findIndex(P=>P.typeDocument===x||P.idDocumentType===x);(T=I[j])!=null&&T._localPreviewUrl&&URL.revokeObjectURL(I[j]._localPreviewUrl);const U={id:null,idDocument:null,idDocumentType:x,filename:y.name,document:x,documentUrl:y.name,typeDocument:x,_localPreviewUrl:E,_fileType:y.type};j>-1?I[j]={...I[j],...U}:I.push(U),d.value=I,r("update:modelValue",I);return}u.value.add(g);try{const{apiUrl:I}=Ke(),j=new FormData;j.append("doc",y),j.append("typeDocument",String(x));const U=await I(i.value,(($=o.endpoint)==null?void 0:$.apiMethod)||"POST",j),P=Array.isArray(U==null?void 0:U.data)?U.data[0]:(U==null?void 0:U.data)||U,R=(P==null?void 0:P.url)||(P==null?void 0:P.document)||y.name,G=(P==null?void 0:P.id)||null,q=(P==null?void 0:P.filename)||(P==null?void 0:P.name)||y.name,W=[...d.value],Z=W.findIndex(ue=>ue.typeDocument===x||ue.idDocumentType===x);(v=W[Z])!=null&&v._localPreviewUrl&&URL.revokeObjectURL(W[Z]._localPreviewUrl);const ne={...P,id:G||(P==null?void 0:P.idDocument)||(P==null?void 0:P.id_document)||null,idDocument:(P==null?void 0:P.idDocument)||G||(P==null?void 0:P.id_document)||null,idDocumentType:x,filename:q,document:x,documentUrl:R,typeDocument:x,_localPreviewUrl:E,_fileType:y.type};Z>-1?W[Z]={...W[Z],...ne}:W.push(ne),d.value=W,r("update:modelValue",W),r("uploaded",P),r("success",P)}catch(I){console.error("Upload failed",I)}finally{u.value.delete(g),_.value=""}},D=B=>{const g=B[o.itemValue]||B.id||B.typeDocument,b=d.value.find(y=>y.typeDocument===g||y.idDocumentType===g);b!=null&&b._localPreviewUrl&&URL.revokeObjectURL(b._localPreviewUrl);const _=d.value.filter(y=>y.typeDocument!==g&&y.idDocumentType!==g);d.value=_,r("update:modelValue",_)},S=B=>{const g=p(B);if(!g)return;let b=g._localPreviewUrl;if(!b)if(g.server&&g.url){const x=g.server.replace(/\/+$/,""),E=g.url.replace(/^\/+/,"");b=`${x}/${E}`}else b=g.document||g.url;if(!b)return;const _=g.mime||g._fileType||"",y=_==="application/pdf"||b.toLowerCase().endsWith(".pdf");y&&!b.includes("#")&&(b+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),h.value=b,k.value=B[o.itemTitle]||B.name||g.filename||"Preview Document",C.value=_||(y?"application/pdf":"image/jpeg"),m.value=!0},V=(B,g,b)=>{var x,E;b.preventDefault();const _=(E=(x=b.dataTransfer)==null?void 0:x.files)==null?void 0:E[0];if(!_)return;A(B,g,{target:{files:[_],value:""}})};return(B,g)=>(e.openBlock(),e.createElementBlock("div",bk,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(Dn,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(e.openBlock(),e.createElementBlock("div",yk,[e.createVNode(Dn,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",xk,[e.createVNode(e.unref(te.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",kk,[e.createVNode(e.unref(te.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",wk,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,_)=>{var y;return e.openBlock(),e.createElementBlock("div",{key:_,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"},[e.createElementVNode("div",Ck,[e.createVNode(Dn,{text:b[t.itemTitle]||b.name||b.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),p(b)?(e.openBlock(),e.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:x=>S(b)},[e.createVNode(e.unref(te.Eye),{class:"w-4 h-4"})],8,Bk)):e.createCommentVNode("",!0)]),p(b)?(e.openBlock(),e.createElementBlock("div",Ek,[e.createVNode(e.unref(te.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",_k,e.toDisplayString(((y=p(b))==null?void 0:y.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:x=>D(b)},[e.createVNode(e.unref(te.X),{class:"w-4 h-4"})],8,Sk))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${_}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.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",u.value.has(_)?"pointer-events-none opacity-70":""]]),onDragover:g[0]||(g[0]=e.withModifiers(()=>{},["prevent"])),onDrop:x=>!t.disabled&&!u.value.has(_)&&V(b,_,x)},[u.value.has(_)?(e.openBlock(),e.createBlock(e.unref(te.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(te.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",Vk,e.toDisplayString(u.value.has(_)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",Dk,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${_}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(_),accept:t.typeFile,onChange:x=>A(b,_,x)},null,40,Nk)],42,Ak))])}),128))],2),e.createVNode(Jt,{modelValue:m.value,"onUpdate:modelValue":g[2]||(g[2]=b=>m.value=b),title:k.value,"max-width":C.value==="application/pdf"?"720":"500",class:e.normalizeClass(C.value==="application/pdf"?"max-w-[40vw]":""),"content-class":C.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:e.withCtx(()=>[e.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:g[1]||(g[1]=b=>m.value=!1)},e.toDisplayString(e.unref(a)("common.close")||"Close"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Mk,[C.value.startsWith("image/")?(e.openBlock(),e.createElementBlock("img",{key:0,src:h.value,alt:k.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,Pk)):C.value==="application/pdf"?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${h.value}${h.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,Tk)):(e.openBlock(),e.createElementBlock("div",vk,[e.createVNode(e.unref(te.FileText),{class:"w-16 h-16 stroke-1"}),e.createElementVNode("span",Ok,e.toDisplayString(e.unref(a)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),e.createElementVNode("a",{href:h.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"},e.toDisplayString(e.unref(a)("dynamicUploadList.viewOriginal")||"View Original"),9,Fk)]))])]),_:1},8,["modelValue","title","max-width","class","content-class"])]))}}),sd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>At[n.icon]??At.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(_t),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),zk=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)(e.unref(Ik)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Rk=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ik=Ho("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"}}),hs=e.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)(e.unref(Lk)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Lk=Ho("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"}}),ps=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),gs=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),bs=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),ys=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(_e)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),$k={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},jk={class:"flex flex-wrap items-center justify-center gap-2"},Uk=["accept","multiple"],Sr=at(e.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}},emits:["picked","picked:multiple","error"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var g;o.disabled||(g=a.value)==null||g.click()}function f(g){const b=g/1024,_=b/1024;return _>=1?`${_.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${g} B`}function m(g){var _;if(!g)return"File tidak valid";if((_=o.accept)!=null&&_.includes("image/")&&!g.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return g.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function h(g){l.value=g.name,c.value=g.size}function k(g){if(i.value=null,!g.length)return;if(o.mode==="single"){const _=g[0],y=m(_);if(y){i.value=y,r("error",y);return}o.showSelected&&h(_),r("picked",_);return}const b=[];for(const _ of g){const y=m(_);if(y){i.value=y,r("error",y);return}b.push(_)}b.length&&(o.showSelected&&h(b[0]),r("picked:multiple",b))}function C(g){const b=g.target,_=Array.from(b.files??[]);k(_),b.value=""}function w(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function A(){s.value=!1}function D(g){var y,x;if(o.disabled)return;s.value=!1;const b=Array.from(((y=g.dataTransfer)==null?void 0:y.files)??[]),_=(x=o.accept)!=null&&x.includes("image/")?b.filter(E=>E.type.startsWith("image/")):b;k(_)}const S=e.computed(()=>(o.accept||"file/*").split(",").map(g=>g.trim()).filter(Boolean).map(g=>g==="image/*"?"IMAGE":g.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const V=e.ref(!1),B=e.computed(()=>{if(o.disabled||!V.value)return{};const g=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:g?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:g?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(g,b)=>(e.openBlock(),e.createBlock(e.unref(ps),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(bs),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(ys),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(gs),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.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",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},B.value]),onClick:u,onDragenter:e.withModifiers(w,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(A,["prevent"]),onDrop:e.withModifiers(D,["prevent"]),onMouseenter:b[0]||(b[0]=_=>V.value=!0),onMouseleave:b[1]||(b[1]=_=>V.value=!1)},[e.createElementVNode("div",$k,[b[2]||(b[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",jk,[e.createVNode(e.unref(hs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(S.value),1)]),_:1}),e.createVNode(e.unref(hs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(e.unref(hs),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?f(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:C},null,40,Uk)],38),d.value?(e.openBlock(),e.createBlock(e.unref(zk),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Rk),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-d8943808"]]),Wk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Hk=["src"],qk={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"},Gk={class:"space-y-0.5"},Kk={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Xk={class:"text-xs opacity-70"},Yk=["disabled"],Jk={key:1},Qk=["disabled"],Zk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},ew={class:"flex gap-2"},tw={class:"font-medium truncate"},nw={class:"flex gap-2"},ow={class:"font-medium"},rw={class:"flex gap-2"},aw={class:"font-medium truncate"},xs=at(e.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},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(h){const k=h/1024,C=k/1024;return C>=1?`${C.toFixed(2)} MB`:k>=1?`${k.toFixed(1)} KB`:`${h} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{f(),typeof document<"u"&&(u=new MutationObserver(f),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const m=e.computed(()=>o.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(h,k)=>t.file?(e.openBlock(),e.createBlock(ps,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(bs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(ys,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",Wk,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(gs,{class:"pt-2"},{default:e.withCtx(()=>{var C,w,p,A,D;return[e.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:e.normalizeStyle([{height:`${t.previewHeight}px`},m.value]),onMouseenter:k[2]||(k[2]=S=>c.value=!0),onMouseleave:k[3]||(k[3]=S=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Hk)):(e.openBlock(),e.createElementBlock("div",qk,[e.createVNode(e.unref(te.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Gk,[e.createElementVNode("p",Kk,e.toDisplayString((C=l.value)==null?void 0:C.name),1),e.createElementVNode("p",Xk,e.toDisplayString((w=l.value)==null?void 0:w.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:k[0]||(k[0]=S=>r("edit"))},[e.createVNode(e.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,Yk)):(e.openBlock(),e.createElementBlock("div",Jk)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:k[1]||(k[1]=S=>r("remove"))},[e.createVNode(e.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Qk)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",Zk,[e.createElementVNode("div",ew,[k[4]||(k[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",tw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",nw,[k[5]||(k[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",ow,e.toDisplayString((A=l.value)==null?void 0:A.size),1)]),e.createElementVNode("div",rw,[k[6]||(k[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",aw,e.toDisplayString((D=l.value)==null?void 0:D.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function ks(){const t=s=>{var c;const i={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:i,bubbles:!0,composed:!0})),(i.type==="error"?console.error:i.type==="warning"?console.warn:console.log)(`[Toast][${(c=i.type)==null?void 0:c.toUpperCase()}]`,i.title||"",i.message)};return{show:t,success:(s,i)=>t({type:"success",message:s,title:i}),error:(s,i)=>t({type:"error",message:s,title:i}),warning:(s,i)=>t({type:"warning",message:s,title:i}),info:(s,i)=>t({type:"info",message:s,title:i})}}const sw={class:"space-y-3"},iw={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},id=e.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:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:B=>r("update:modelValue",B)}),s=e.ref(null),i=e.ref(null);function l(B){i.value=B,r("error",B)}function c(){i.value=null}const d=e.computed(()=>{const B=(o.allowedTypes??"").trim();return B?B.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(B){const g=B.lastIndexOf(".");return g>=0?B.slice(g).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const B=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...B].join(",")}return o.accept}),m=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function h(B){if(d.value.length){const g=(B.type||"").toLowerCase(),b=u(B.name);return d.value.some(_=>_.includes("/")?g===_:_.startsWith(".")?b===_:b===`.${_}`)}if(o.accept){if(o.accept==="*/*")return!0;const g=o.accept.split(",").map(y=>y.trim().toLowerCase()),b=(B.type||"").toLowerCase(),_=u(B.name);return g.some(y=>{if(y.endsWith("/*")){const x=y.slice(0,-2);return b.startsWith(x)}return y.startsWith(".")?_===y:b===y})}return!0}function k(B){return B*1024*1024}async function C(B){return B?h(B)?o.minSizeMb!=null&&B.size<k(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>k(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${m.value}`:"File tidak valid"}const{DCodeApi:w}=Ke(),p=ks(),A=e.ref(!1);async function D(B){var g;if(o.uploadFn){try{A.value=!0;const b=await o.uploadFn(B);a.value=B,r("uploaded",b)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{A.value=!1}return}if(!((g=o.endpoint)!=null&&g.apiUrl)){a.value=B;return}if(typeof w!="function"){l("useApi() must expose DCodeApi()");return}try{A.value=!0;const b=new FormData;b.append("doc",B);const _=(o.endpoint.apiMethod||"POST").toUpperCase(),y=o.endpoint.apiUrl,x=await w("","",b,{_url:y,_method:_,withCredentials:!0,transformRequest:[(M,T)=>(T&&(delete T["Content-Type"],delete T["content-type"]),M)]}),E=(x==null?void 0:x.data)??x;a.value=B,r("uploaded",E)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{A.value=!1}}async function S(B){var b;if(o.disabled)return;c();const g=await C(B);if(g){l(g);return}s.value=B,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await D(B):a.value=B}function V(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,B=>{B&&!s.value&&(s.value=B),B||(s.value=null)},{immediate:!0}),(B,g)=>(e.openBlock(),e.createElementBlock("div",sw,[a.value?A.value?(e.openBlock(),e.createElementBlock("div",iw,[...g[1]||(g[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(xs,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:V},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(Sr,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||A.value,onPicked:S,error:i.value,onError:g[0]||(g[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),lw=["for"],cw={key:0,class:"!ml-1 !text-destructive"},dw={class:"relative w-full block box-border"},uw={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},fw=["id","readonly","disabled","placeholder"],mw={class:"absolute inset-y-0 right-4 flex items-center z-10"},hw={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"},pw={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},gw={key:1,class:"text-sm text-muted-foreground text-center"},bw=["onClick","title"],yw={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},xw={class:"flex items-center justify-center flex-1"},kw={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},ww={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},ld=e.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=t,r=n,a=At,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),f=e.ref(""),m=e.ref(!1),h=e.ref(!1),k=e.ref(!1),C=e.shallowRef([]),w=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),A=async()=>{if(h.value||k.value)return;k.value=!0,await new Promise(R=>setTimeout(R,0));const P=Object.keys(a).filter(R=>!p.has(R)).filter(R=>/^[A-Z]/.test(R)).filter(R=>typeof a[R]=="function"||typeof a[R]=="object"&&a[R]).sort((R,G)=>R.localeCompare(G));C.value=P,h.value=!0,k.value=!1},D=e.computed(()=>u.value?bn(u.value,a):null),S=e.ref(u.value),V=e.computed(()=>!!u.value&&!d.value),B=e.computed(()=>{if(!h.value)return[];const P=(f.value??"").trim().toLowerCase();return P?C.value.filter(R=>R.toLowerCase().includes(P)):C.value}),g=e.computed(()=>B.value.slice(0,w.value)),b=e.computed(()=>{const P=o.columns;return P<=2?"grid-cols-2":P===3?"grid-cols-3":P===4?"grid-cols-4":P===5?"grid-cols-5":P>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>D.value&&!d.value?"!pl-12":"!pl-3");const _=async()=>{var P;await e.nextTick(),(P=i.value)==null||P.focus()},y=async P=>{if(o.disabled)return;const R=P!==!1;if(m.value){m.value=!1;return}d.value=!0,await A(),R&&(f.value="",S.value=""),w.value=o.pageSize,await _()},x=()=>{d.value=!1,f.value="",S.value=u.value,w.value=o.pageSize},E=async()=>{o.disabled||(d.value?x():await y())};let M=null;const T=async P=>{if(o.disabled)return;r("update:modelValue",null),d.value||await y(!1),M&&clearTimeout(M);const R=S.value;M=setTimeout(()=>{f.value=R},300)},$=P=>{o.disabled||(r("update:modelValue",P),x(),queueMicrotask(()=>{var R;return(R=i.value)==null?void 0:R.blur()}))},v=()=>{o.disabled||(r("update:modelValue",null),r("clear"),m.value=!0,x(),queueMicrotask(()=>{var P;return(P=i.value)==null?void 0:P.focus()}))},I=P=>{if(P.key==="Escape"){P.preventDefault(),x();return}if(P.key==="Enter"&&d.value){const R=B.value[0];R&&(P.preventDefault(),$(R))}},j=P=>{if(!d.value)return;const R=P.target;s.value&&!s.value.contains(R)&&x()},U=P=>{const R=P.target;R.scrollTop+R.clientHeight>=R.scrollHeight-24&&w.value<B.value.length&&(w.value=Math.min(w.value+o.pageSize,B.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",j),queueMicrotask(()=>{var P;i.value=((P=s.value)==null?void 0:P.querySelector("input"))??null}),u.value&&A()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",j),M&&clearTimeout(M)}),e.watch(u,P=>{d.value||(S.value=P)}),e.watch(()=>f.value,()=>{w.value=o.pageSize}),(P,R)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",cw,"*")):e.createCommentVNode("",!0)],8,lw)):e.createCommentVNode("",!0),e.createElementVNode("div",dw,[D.value&&!d.value?(e.openBlock(),e.createElementBlock("div",uw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(D.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":R[0]||(R[0]=G=>S.value=G),readonly:V.value,disabled:o.disabled,placeholder:o.placeholder,class:e.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",[D.value&&!d.value?"pl-10":"pl-4",V.value?"cursor-pointer select-none":""]]),onClick:y,onFocus:y,onInput:T,onKeydown:I},null,42,fw),[[e.vModelText,S.value]]),e.createElementVNode("div",mw,[o.clearable&&u.value?(e.openBlock(),e.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:R[1]||(R[1]=e.withModifiers(()=>{},["prevent"])),onClick:v,title:"Clear"},[e.createVNode(e.unref(te.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.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:R[2]||(R[2]=e.withModifiers(()=>{},["prevent"])),onClick:E,title:"Open"},[e.createVNode(e.unref(te.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",hw,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:U},[k.value?(e.openBlock(),e.createElementBlock("div",pw,[e.createVNode(e.unref(te.Loader2),{class:"h-4 w-4 animate-spin"}),R[3]||(R[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):h.value&&B.value.length===0?(e.openBlock(),e.createElementBlock("div",gw," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",b.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,G=>(e.openBlock(),e.createElementBlock("button",{key:G,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===G?"ring-1 ring-primary":""]),onClick:q=>$(G),title:G},[e.createElementVNode("div",yw,[e.createElementVNode("div",xw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[G]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",kw,e.toDisplayString(G),1)])],10,bw))),128))],2)),h.value&&B.value.length>0?(e.openBlock(),e.createElementBlock("div",ww," Showing "+e.toDisplayString(g.value.length)+" / "+e.toDisplayString(B.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),Cw={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Bw={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},Ew={class:"relative overflow-auto p-0"},ws=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:D=>r("update:modelValue",D)}),s=e.ref(null),i=e.ref(null);let l=null,c=!1,d=0,u=null;function f(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function m(D,S,V,B,g){const b=await new Promise((x,E)=>{const M=URL.createObjectURL(D),T=new Image;T.onload=()=>{URL.revokeObjectURL(M),x(T)},T.onerror=$=>{URL.revokeObjectURL(M),E($)},T.src=M}),_=document.createElement("canvas");_.width=S,_.height=V;const y=_.getContext("2d");return y?(y.drawImage(b,0,0,S,V),await new Promise(x=>{_.toBlob(E=>x(E||D),B,g)})):D}function h(){if(!l||!i.value)return;const D=l.getPlugin("Dashboard"),S=l.getFile(i.value);!D||!S||requestAnimationFrame(()=>{try{D.openFileEditor(S)}catch{try{D.openFileEditor(i.value)}catch{}}})}async function k(D){if(l){l.cancelAll(),i.value=null;try{const S=l.addFile({name:D.name,type:D.type,data:D,source:"Local",isRemote:!1});i.value=String(S)}catch{}}}function C(){if(!s.value)return;l&&f(),l=new Qd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const D=document.documentElement.classList.contains("dark");l.use(Us,{target:s.value,inline:!0,height:480,theme:D?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const S=document.documentElement.classList.contains("dark"),V=l.getPlugin("Dashboard");V&&V.setOptions({theme:S?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(Zd,{target:Us,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.value=!1}),l.on("file-added",S=>{i.value=(S==null?void 0:S.id)??null,o.autoOpenEditor&&setTimeout(()=>h(),80)}),l.on("file-editor:complete",async S=>{const V=++d;try{const B=S.data,g=B.type||S.type||"image/jpeg";let b=B;if(o.outputWidth&&o.outputHeight&&(b=await m(B,o.outputWidth,o.outputHeight,g,o.quality)),c||V!==d)return;const _=S.name||"edited-image.jpg",y=new File([b],_,{type:g});await w(y,"UPPY_EDITOR_COMPLETE"),r("done",y),a.value=!1}catch{}})}async function w(D,S="CROP_RESULT"){const V=URL.createObjectURL(D);try{const B=await new Promise((g,b)=>{const _=new Image;_.onload=()=>g(_),_.onerror=b,_.src=V});console.group(S),console.log("file:",D),console.table({name:D.name,type:D.type,sizeBytes:D.size,sizeMB:+(D.size/1024/1024).toFixed(3),width:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",V),console.groupEnd()}finally{URL.revokeObjectURL(V)}}e.watch(a,async D=>{c=!D,d++,D?(await e.nextTick(),C(),o.file&&await k(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async D=>{a.value&&D&&(await e.nextTick(),await k(D))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=D=>{D.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,D=>{D?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const A=e.ref(!1);return(D,S)=>a.value?(e.openBlock(),e.createElementBlock("div",Cw,[e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:S[0]||(S[0]=V=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.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:S[4]||(S[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bw,[S[6]||(S[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.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:e.normalizeStyle({opacity:A.value?1:.7}),onClick:S[1]||(S[1]=V=>a.value=!1),onMouseenter:S[2]||(S[2]=V=>A.value=!0),onMouseleave:S[3]||(S[3]=V=>A.value=!1)},[e.createVNode(e.unref(te.X),{class:"h-4 w-4"}),S[5]||(S[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",Ew,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),_w={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Sw=["src"],Aw=["disabled"],Vw=["disabled"],Dw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Nw={class:"flex gap-2"},Mw={class:"font-medium truncate"},Pw={class:"flex gap-2"},Tw={class:"font-medium"},vw={class:"flex gap-2"},Ow={class:"font-medium truncate"},Cs=at(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(m){const h=m/1024,k=h/1024;return k>=1?`${k.toFixed(2)} MB`:h>=1?`${h.toFixed(1)} KB`:`${m} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=e.computed(()=>o.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,h)=>t.file?(e.openBlock(),e.createBlock(ps,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(bs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(ys,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",_w,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(gs,{class:"pt-2"},{default:e.withCtx(()=>{var k,C,w;return[e.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:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:h[2]||(h[2]=p=>l.value=!0),onMouseleave:h[3]||(h[3]=p=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Sw)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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:h[0]||(h[0]=p=>r("edit"))},[e.createVNode(e.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,Aw)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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:h[1]||(h[1]=p=>r("remove"))},[e.createVNode(e.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Vw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",Dw,[e.createElementVNode("div",Nw,[h[4]||(h[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Mw,e.toDisplayString((k=i.value)==null?void 0:k.name),1)]),e.createElementVNode("div",Pw,[h[5]||(h[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Tw,e.toDisplayString((C=i.value)==null?void 0:C.size),1)]),e.createElementVNode("div",vw,[h[6]||(h[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Ow,e.toDisplayString((w=i.value)==null?void 0:w.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),Fw={class:"space-y-3"},Ar=e.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}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:v=>r("update:modelValue",v)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d(v){c.value=v,r("error",v)}function u(){c.value=null}const f=e.computed(()=>{const v=(o.allowedTypes??"").trim();return v?v.split(/[,\s;]+/g).map(j=>j.trim().toLowerCase()).filter(Boolean).map(j=>j.includes("/")||j.startsWith(".")?j:`.${j}`):[]});function m(v){const I=v.lastIndexOf(".");return I>=0?v.slice(I).toLowerCase():""}const h=e.computed(()=>{if(f.value.length){const v=f.value.filter(j=>j.startsWith("."));return[...f.value.filter(j=>j.includes("/")),...v].join(",")}return o.accept||"image/*"}),k=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function C(v){if(f.value.length){const j=(v.type||"").toLowerCase(),U=m(v.name);return f.value.some(P=>P.includes("/")?j===P:P.startsWith(".")?U===P:U===`.${P}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(v.type||"").toLowerCase().startsWith("image/"):!0}function w(v){return v*1024*1024}async function p(v){var I;return(I=v.type)!=null&&I.startsWith("image/")?await new Promise(j=>{const U=URL.createObjectURL(v),P=new Image;P.onload=()=>{URL.revokeObjectURL(U),j({w:P.naturalWidth,h:P.naturalHeight})},P.onerror=()=>{URL.revokeObjectURL(U),j(null)},P.src=U}):null}async function A(v){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const j=await p(v);return j?o.minWidth!=null&&j.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&j.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&j.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&j.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function D(v){return v?C(v)?o.minSizeMb!=null&&v.size<w(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&v.size>w(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await A(v):`only Allowed: ${k.value}`:"File tidak valid"}function S(v){o.disabled||(i.value=v,s.value=!0)}async function V(v){if(o.disabled)return;u();const I=await D(v);if(I){d(I);return}l.value=v,S(v)}const{DCodeApi:B}=Ke(),g=ks(),b=e.ref(!1);e.ref(null);function _(v,I){return!v||!I?null:v.replace(/\/+$/,"")+"/"+I.replace(/^\/+/,"")}function y(v){var P;const I=(v==null?void 0:v.data)??v,j=(P=I==null?void 0:I.data)==null?void 0:P[0];if(!j)return null;const U=_(j.server,j.url);return{...j,fullUrl:U?encodeURI(U):null}}async function x(v){var I;if(o.uploadFn){try{b.value=!0;const j=await o.uploadFn(v);a.value=v,r("uploaded",j)}catch(j){console.error("Upload Error",j),g.error("Upload Failed",(j==null?void 0:j.message)||"Unknown error"),d((j==null?void 0:j.message)||"Upload Failed")}finally{b.value=!1}return}if(!((I=o.endpoint)!=null&&I.apiUrl)){a.value=v;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const j=new FormData;j.append("doc",v);const U=(o.endpoint.apiMethod||"POST").toUpperCase(),P=o.endpoint.apiUrl,R=await B("","",j,{_url:P,_method:U,withCredentials:!0,transformRequest:[(q,W)=>(W&&(delete W["Content-Type"],delete W["content-type"]),q)]}),G=(R==null?void 0:R.data)??R;y(G),a.value=v,r("uploaded",G)}catch(j){console.error("Upload Error",j),g.error("Upload Failed",(j==null?void 0:j.message)||"Unknown error"),d((j==null?void 0:j.message)||"Upload Failed")}finally{b.value=!1}}async function E(v){var I;u(),o.uploadFn||(I=o.endpoint)!=null&&I.apiUrl?await x(v):a.value=v,s.value=!1,i.value=null}function M(){s.value=!1,i.value=null}async function T(){if(!a.value)return;u();const v=o.editUseOriginal?l.value??a.value:a.value,I=await D(v);if(I){d(I);return}S(v)}function $(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,v=>{v&&!l.value&&(l.value=v),v||(l.value=null)},{immediate:!0}),(v,I)=>(e.openBlock(),e.createElementBlock("div",Fw,[a.value?(e.openBlock(),e.createBlock(Cs,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:T,onRemove:$,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(Sr,{key:0,label:t.label,hint:t.hint,accept:h.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:V,error:c.value,onError:I[0]||(I[0]=j=>d(j))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(ws,{modelValue:s.value,"onUpdate:modelValue":I[1]||(I[1]=j=>s.value=j),file:i.value,title:t.title,description:t.description,"auto-open-editor":t.autoOpenEditor,"aspect-ratio":t.aspectRatio,"output-width":t.outputWidth,"output-height":t.outputHeight,quality:t.quality,onDone:E,onCancel:M},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),zw=["aria-busy"],Rw={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Iw=["for"],Lw={key:0,class:"ml-1 text-destructive"},$w=["id","disabled"],jw={class:"min-w-0 flex-1 text-left"},Uw={key:0,class:"flex flex-wrap gap-1.5"},Ww={class:"max-w-[220px] truncate"},Hw=["onClick"],qw={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"},Gw={key:1,class:"text-muted-foreground truncate"},Kw={class:"flex items-center gap-2 shrink-0"},Xw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},Yw=["placeholder","onKeydown"],Jw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},Qw=["disabled","onClick"],Zw={class:"truncate"},e1={key:0,class:"text-primary-600 dark:text-primary-400"},t1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},n1={key:0},o1={key:1},r1={key:1,class:"text-xs text-destructive"},Bs=e.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},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},error:{default:null},required:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const Q=o.required,oe=o["aria-required"];return Q===""||Q===!0||Q==="true"||(oe==="true"||oe===!0)}),u=e.computed(()=>!!a.error);function f(Q){return Q?typeof a.itemTitle=="function"?a.itemTitle(Q)??"":String((Q==null?void 0:Q[a.itemTitle])??""):""}function m(Q){return Q?typeof a.itemValue=="function"?a.itemValue(Q):Q==null?void 0:Q[a.itemValue]:null}function h(Q,oe){return m(Q)??oe}const k=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),C=e.computed(()=>{var Q;return!!((Q=a.endpoint)!=null&&Q.apiUrl)||!!a.fetchItems}),w=e.ref([]),p=e.ref(!1),A=e.ref(!1),D=e.computed(()=>{var oe;const Q=(oe=a.endpoint)==null?void 0:oe.apiOptions;if(Q)return typeof Q=="function"?Q():Q}),S=e.computed(()=>{var xe,He;const Q=((xe=a.endpoint)==null?void 0:xe.apiUrl)??"",oe=(((He=a.endpoint)==null?void 0:He.apiMethod)??"GET").toUpperCase(),se=JSON.stringify(D.value??null);return`${oe} ${Q} :: ${se}`}),V=e.computed(()=>C.value?w.value:a.items||[]);async function B(){var Q;if(C.value&&!(!((Q=a.endpoint)!=null&&Q.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let oe;if(a.fetchItems){const se=await a.fetchItems(),xe=(se==null?void 0:se.data)??se;oe=(xe==null?void 0:xe.data)??xe}else{const{DCodeApi:se}=Ke();if(typeof se!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const xe={page:1,perPage:100,...D.value||{}},He=await se("","",xe,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),zt=(He==null?void 0:He.data)??He;oe=(zt==null?void 0:zt.data)??zt}w.value=Array.isArray(oe)?oe:[],A.value=!0}catch(oe){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",oe),w.value=[]}finally{p.value=!1}}}e.watch(()=>S.value,()=>{w.value=[],A.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&C.value&&B()});const g=e.computed(()=>{const Q=k.value;if(a.returnObject)return Q;const oe=new Map;for(const se of V.value)oe.set(m(se),se);return Q.map(se=>oe.get(se)??{[a.itemValue]:se,[a.itemTitle]:String(se)})}),b=e.computed(()=>a.maxChips===null?g.value:g.value.slice(0,a.maxChips));function _(Q){const oe=k.value;if(a.returnObject){const se=m(Q);return oe.some(xe=>m(xe)===se)}return oe.includes(m(Q))}const y=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const Q=Number(a.maxSelected);return Number.isFinite(Q)&&Q>0?Q:null}),x=e.computed(()=>{const Q=y.value;return Q===null?!1:k.value.length>=Q});function E(Q){return!_(Q)&&x.value}const M=e.computed(()=>{const Q=k.value,oe=new Set;if(a.returnObject)for(const se of Q)oe.add(m(se));else for(const se of Q)oe.add(se);return oe}),T=e.computed(()=>{const Q=M.value;return(V.value||[]).filter(oe=>!Q.has(m(oe)))}),$=e.computed(()=>V.value.length===0?!1:T.value.length===0),v=e.ref(null),I=e.ref(null),j=e.ref(null),U=e.ref(!1),P=e.ref(""),R=e.ref(0),G=e.ref(0),{floatingStyles:q}=ha(v,I,{whileElementsMounted:ca,placement:"bottom-start",middleware:[da(8),fa(),ua({padding:8}),ma({apply({rects:Q,elements:oe}){Object.assign(oe.floating.style,{width:`${Q.reference.width}px`,"--floating-width":`${Q.reference.width}px`})}})]}),W=e.computed(()=>q.value),Z=e.computed(()=>{const Q=Number(a.maxRows);return Number.isFinite(Q)&&Q>0?Q:5});async function ne(){a.disabled||(U.value=!0,G.value=0,requestAnimationFrame(()=>{j.value&&(j.value.scrollTop=0),R.value=0}),C.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!A.value)&&!p.value&&await B())}function ue(){U.value=!1}function ke(){U.value?ue():ne()}function me(Q){var se,xe;if(!U.value)return;const oe=Q.target;(se=v.value)!=null&&se.contains(oe)||(xe=I.value)!=null&&xe.contains(oe)||ue()}e.onMounted(()=>document.addEventListener("mousedown",me)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",me));function X(Q){if(a.disabled)return;if(E(Q)){r("max");return}const oe=[...k.value];if(a.returnObject){const se=m(Q);if(oe.some(He=>m(He)===se))return;r("update:modelValue",[...oe,Q])}else{const se=m(Q);if(oe.includes(se))return;r("update:modelValue",[...oe,se])}P.value="",G.value=0,requestAnimationFrame(()=>{j.value&&(j.value.scrollTop=0),R.value=0})}function O(Q){if(a.disabled)return;const oe=[...k.value];if(a.returnObject){const se=m(Q);r("update:modelValue",oe.filter(xe=>m(xe)!==se))}else{const se=m(Q);r("update:modelValue",oe.filter(xe=>xe!==se))}}function K(){a.disabled||(r("update:modelValue",[]),r("clear"),ue())}const ee=e.computed(()=>{const Q=P.value.trim().toLowerCase(),oe=T.value;return Q?oe.filter(se=>f(se).toLowerCase().includes(Q)):oe}),he=e.computed(()=>ee.value.length);e.watch(U,Q=>{Q||(P.value="")});const Ve=e.computed(()=>{if($.value)return a.itemHeight;const Q=he.value;return(Q<=0?1:Math.min(Q,Z.value))*a.itemHeight}),Ne=e.computed(()=>a.virtual?he.value*a.itemHeight:0),ze=e.computed(()=>a.virtual?Math.ceil(Ve.value/a.itemHeight)+a.overscan:he.value),Re=e.computed(()=>{if(!a.virtual)return 0;const Q=Math.floor(R.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,Q)}),Ue=e.computed(()=>a.virtual?Math.min(he.value,Re.value+ze.value):he.value),Me=e.computed(()=>a.virtual?Re.value*a.itemHeight:0),Ze=e.computed(()=>{const Q=ee.value;return a.virtual?Q.slice(Re.value,Ue.value):Q});function ct(Q){const oe=Q.target;R.value=oe.scrollTop}function St(Q){return Q===G.value}function H(Q){const oe=j.value;if(!oe||!a.virtual)return;const se=Q*a.itemHeight,xe=se+a.itemHeight,He=oe.scrollTop,zt=oe.scrollTop+oe.clientHeight;se<He?oe.scrollTop=se:xe>zt&&(oe.scrollTop=xe-oe.clientHeight)}function re(Q){const oe=Math.max(0,he.value-1);G.value=Math.min(oe,Math.max(0,G.value+Q)),H(G.value)}function pe(){const Q=ee.value[G.value];Q&&X(Q)}const Ie=e.computed(()=>a.clearable&&!a.disabled&&g.value.length>0),Ee=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":U.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(Q,oe)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",Rw)):e.createCommentVNode("",!0),oe[3]||(oe[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",Lw,"*")):e.createCommentVNode("",!0)],8,Iw)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:v,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.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",Ee.value]]),disabled:a.disabled,onClick:ke},[e.createElementVNode("div",jw,[g.value.length?(e.openBlock(),e.createElementBlock("div",Uw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(se,xe)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${h(se,xe)}`,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"},[e.createElementVNode("span",Ww,e.toDisplayString(f(se)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(He=>O(se),["stop"]),"aria-label":"Remove"}," ✕ ",8,Hw))]))),128)),a.maxChips!==null&&g.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",qw," +"+e.toDisplayString(g.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Gw,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",Kw,[Ie.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(K,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(te.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,$w),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:I,class:"-mt-1 z-[9999] 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:e.normalizeStyle(W.value)},[a.searchable&&!$.value?(e.openBlock(),e.createElementBlock("div",Xw,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":oe[0]||(oe[0]=se=>P.value=se),placeholder:a.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:[oe[1]||(oe[1]=e.withKeys(e.withModifiers(se=>re(1),["prevent"]),["down"])),oe[2]||(oe[2]=e.withKeys(e.withModifiers(se=>re(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(pe,["prevent"]),["enter"]),e.withKeys(e.withModifiers(ue,["prevent"]),["esc"])]},null,40,Yw),[[e.vModelText,P.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:j,class:"relative overflow-auto",style:e.normalizeStyle({height:Ve.value+"px"}),onScroll:ct},[$.value?(e.openBlock(),e.createElementBlock("div",Jw," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:Ne.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${Me.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,(se,xe)=>(e.openBlock(),e.createElementBlock("button",{key:String(h(se,Re.value+xe)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[E(se)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",St(Re.value+xe)?"bg-neutral-50 dark:bg-neutral-800/60":"",_(se)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||E(se),onClick:He=>X(se)},[e.createElementVNode("span",Zw,e.toDisplayString(f(se)),1),_(se)?(e.openBlock(),e.createElementBlock("span",e1,"✓")):e.createCommentVNode("",!0)],14,Qw))),128))],6),he.value===0?(e.openBlock(),e.createElementBlock("div",t1,[p.value?(e.openBlock(),e.createElementBlock("span",n1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",o1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",r1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,zw)),[[e.vShow,i.value]])}}),a1={class:"space-y-4"},s1={key:0,class:"flex flex-col gap-0.5"},i1=["for"],l1=["for"],c1={class:"text-[11px] text-gray-500 dark:text-gray-400"},d1={class:"flex items-center gap-2 flex-nowrap"},u1=["id","value","disabled","onKeydown","onInput","onPaste"],Vr=e.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=Ke(),f=ks(),m=e.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),h=()=>{c.value=Array.from({length:m.value},(B,g)=>{var b;return((b=s.default)==null?void 0:b[g])??""}),i("updateOtp",c.value.join(""))};h(),e.watch(()=>[s.totalInput,s.default],()=>h());const k=B=>{B<0||B>=m.value||e.nextTick(()=>{var g;return(g=l.value[B])==null?void 0:g.focus()})},C=B=>B.match(/[a-zA-Z0-9]/)?B.match(/[a-zA-Z0-9]/)[0]:"";async function w(B){var g;if(i("complete",B),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(B);i("success",b)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((g=s.endpoint)!=null&&g.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const b=(s.endpoint.apiMethod||"POST").toUpperCase(),_=s.endpoint.apiUrl,y=await u("","",{otp:B},{_url:_,_method:b,withCredentials:!0}),x=(y==null?void 0:y.data)??y;i("success",x)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const p=(B,g)=>{c.value[B]=C(g);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===m.value&&w(b)},A=(B,g)=>{const b=B.key,_=/^\d$/.test(b),y=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(B.preventDefault(),c.value[g]){p(g,"");return}g>0&&(p(g-1,""),k(g-1));return}if(b==="ArrowLeft"){B.preventDefault(),k(g-1);return}if(b==="ArrowRight"){B.preventDefault(),k(g+1);return}if(_||y){B.preventDefault(),p(g,b),g<m.value-1&&k(g+1);return}b.length===1&&B.preventDefault()},D=(B,g)=>{const b=B.target,_=b.value??"",y=C(_);b.value=y,p(g,y),y&&g<m.value-1&&k(g+1)},S=(B,g)=>{var E;B.preventDefault();const _=(((E=B.clipboardData)==null?void 0:E.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!_)return;let y=g;for(const M of _){if(y>=m.value)break;c.value[y]=M,y++}const x=c.value.join("");i("updateOtp",x),i("update:modelValue",x),x.length===m.value&&w(x),k(Math.min(y,m.value-1))},V=B=>g=>{l.value[B]=(g==null?void 0:g.$el)??g};return(B,g)=>(e.openBlock(),e.createElementBlock("div",a1,[s.label||m.value?(e.openBlock(),e.createElementBlock("div",s1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,i1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,l1)),e.createElementVNode("p",c1," Ketik "+e.toDisplayString(m.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",d1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:V(b-1),value:c.value[b-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:e.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",c.value[b-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"]),onKeydown:_=>A(_,b-1),onInput:_=>D(_,b-1),onPaste:_=>S(_,b-1)},null,42,u1))),128))])]))}}),f1={class:"w-full"},m1={key:0,class:"flex items-center justify-between mb-2"},h1={key:0,class:"text-sm font-medium text-gray-700"},p1={key:1,class:"text-sm text-gray-600"},g1={name:"DCodeProgress"},cd=e.defineComponent({...g1,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(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.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[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",f1,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",m1,[t.label?(e.openBlock(),e.createElementBlock("span",h1,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",p1,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),b1={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},dd=at(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",b1,[e.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:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),y1={class:"grid gap-3"},x1={key:0,class:"ml-1 text-destructive"},k1={class:"flex flex-col"},w1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},C1={class:"relative flex-shrink-0 mt-0.5"},B1=["id","name","value","checked","disabled","required","onChange"],E1=["onClick"],_1=["for"],S1={key:0,class:"ml-1 text-red-500"},A1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Es=e.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},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:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=Ke(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var S,V;const D=((S=a.endpoint)==null?void 0:S.apiUrl)||a.apiUrl;if(D){i.value=!0,l.value=null;try{const B={page:1,perPage:100},g=((V=a.endpoint)==null?void 0:V.apiMethod)||a.apiMethod,b=await o(D,g,B);let _=b;a.dataPath?_=a.dataPath.split(".").reduce((x,E)=>x&&x[E]!=="undefined"?x[E]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(_=b.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(B){console.error("DCodeRadio fetch error:",B),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var D;((D=a.endpoint)!=null&&D.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const D=a.itemValue||a.model||"id",S=a.itemTitle||(a.label===""?"name":a.label);return S&&a.label!==""?[{[D]:D,[S]:S}]:[]}),u=D=>{if(typeof D!="object")return D;const S=a.itemValue||a.model||"id";return D[S]},f=D=>{if(typeof D!="object")return String(D);const S=a.itemTitle||"name";return D[S]},m=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),h=e.computed(()=>!!a.error||!!l.value),k=e.computed(()=>a.error||l.value),C=D=>D==null?a.modelValue===D:String(a.modelValue)===String(D),w=e.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"}})[a.size]),p=(D,S)=>{S.target.checked&&(r("update:modelValue",D),r("change",D))},A=D=>{!a.disabled&&!C(D)&&(r("update:modelValue",D),r("change",D))};return(D,S)=>(e.openBlock(),e.createElementBlock("div",y1,[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",x1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",k1,[i.value?(e.openBlock(),e.createElementBlock("div",w1,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),S[0]||(S[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(V,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["flex items-start",w.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",C1,[e.createElementVNode("input",{id:t.id?`${t.id}-${B}`:`${m.value}-${B}`,name:m.value,type:"radio",value:u(V),checked:C(u(V)),disabled:t.disabled,required:t.required&&B===0,onChange:g=>p(u(V),g),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,B1)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:g=>A(u(V))},[e.createElementVNode("label",{for:t.id?`${t.id}-${B}`:`${m.value}-${B}`,class:e.normalizeClass([w.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled?"cursor-not-allowed opacity-50":""])},[e.createTextVNode(e.toDisplayString(f(V))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",S1,"*")):e.createCommentVNode("",!0)],10,_1)],8,E1)],2))),128))],2),h.value&&k.value?(e.openBlock(),e.createElementBlock("div",A1,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(k.value),1)])):e.createCommentVNode("",!0)])]))}}),V1={class:"grid gap-3"},D1={key:0,class:"ml-1 text-destructive"},N1={class:"flex flex-col"},M1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},P1=["onClick"],T1=["id","name","value","checked","disabled","required","onChange"],v1={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},O1=["for"],F1={key:0,class:"ml-1 text-red-500"},z1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},_s=e.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:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=Ke(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,y=>{s.value=y},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=e.computed(()=>a.disabled||l.value||!!c.value),u=async()=>{var x,E;const y=((x=a.endpoint)==null?void 0:x.apiUrl)||a.apiUrl;if(y){l.value=!0,c.value=null;try{const M={page:1,perPage:100},T=((E=a.endpoint)==null?void 0:E.apiMethod)||a.apiMethod,$=await o(y,T,M);let v=$;a.dataPath?v=a.dataPath.split(".").reduce((j,U)=>j&&j[U]!=="undefined"?j[U]:void 0,$):typeof $=="object"&&!Array.isArray($)&&$.data&&(v=$.data),Array.isArray(v)?i.value=v:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(M){console.error("DCodeRadioCustom fetch error:",M),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},f=e.ref(!1);let m=null;const h=()=>{typeof document<"u"&&(f.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var y;((y=a.endpoint)!=null&&y.apiUrl||a.apiUrl)&&u(),h(),typeof document<"u"&&(m=new MutationObserver(h),m.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),m.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{m&&m.disconnect()});const k=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const y=a.itemValue||a.model||"id",x=a.itemTitle||(a.label===""?"name":a.label);return x&&a.label!==""?[{[y]:y,[x]:x}]:[]}),C=y=>{if(typeof y!="object")return y;const x=a.itemValue||a.model||"id";return y[x]},w=y=>{if(typeof y!="object")return String(y);const x=a.itemTitle||"name";return y[x]},p=Math.random().toString(36).slice(2,7),A=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${p}`),D=e.computed(()=>!!a.error||!!c.value),S=e.computed(()=>a.error||c.value),V=y=>{const x=s.value;return y==null?x===y:String(x)===String(y)},B=e.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"}})[a.size]),g=y=>{const x=(y==null?void 0:y.icon)||a.icon;return bn(x,At)},b=(y,x)=>{x.target.checked&&(s.value=y,r("update:modelValue",y),r("change",y))},_=y=>{a.disabled||V(y)||(s.value=y,r("update:modelValue",y),r("change",y))};return(y,x)=>(e.openBlock(),e.createElementBlock("div",V1,[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",D1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",N1,[l.value?(e.openBlock(),e.createElementBlock("div",M1,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),x[0]||(x[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,(E,M)=>(e.openBlock(),e.createElementBlock("div",{key:M,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",V(C(E))?f.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":f.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:T=>!d.value&&_(C(E))},[e.createElementVNode("input",{id:t.id?`${t.id}-${M}`:`${A.value}-${M}`,name:A.value,type:"radio",value:C(E),checked:V(C(E)),disabled:d.value,required:t.required&&M===0,onChange:T=>b(C(E),T),class:"sr-only",tabindex:"-1"},null,40,T1),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",V(C(E))?f.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":f.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[g(E)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g(E)),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",v1,[...x[1]||(x[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${M}`:`${A.value}-${M}`,class:e.normalizeClass([B.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",V(C(E))?f.value?"text-primary-400":"text-primary-700":f.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(w(E))+" ",1),t.required&&k.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",F1,"*")):e.createCommentVNode("",!0)],10,O1)],10,P1))),128))],2),D.value&&S.value?(e.openBlock(),e.createElementBlock("div",z1,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(S.value),1)])):e.createCommentVNode("",!0)])]))}}),R1={key:0,class:"ml-1 text-destructive"},I1={class:"relative w-full"},L1={key:0,class:"mb-2 flex items-center justify-between"},$1={class:"text-sm text-muted-foreground"},j1={class:"text-sm font-medium text-foreground"},U1={class:"text-sm text-muted-foreground"},W1={class:"relative"},H1=["id","value","min","max","step","disabled","placeholder"],q1={key:1,class:"relative mt-2"},G1={class:"text-xs text-muted-foreground mt-1"},K1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},X1={name:"DCodeSlider"},Dr=e.defineComponent({...X1,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),f=e.computed(()=>{const V={sm:"h-2",md:"h-2.5",lg:"h-3"},B={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",V[a.size],B[a.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),m=e.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),h=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),k=e.computed(()=>{const V=a.max-a.min;return(a.modelValue-a.min)/V*100}),C=V=>{const B=V.target,g=parseFloat(B.value);r("update:modelValue",g),r("input",g)},w=V=>{const B=V.target,g=parseFloat(B.value);r("change",g)},p=()=>{i.value=!0},A=()=>{i.value=!1},D=V=>{const B=a.max-a.min;return(V-a.min)/B*100},S=e.computed(()=>{const V={sm:16,md:20,lg:24};return`
|
|
66
|
+
`.trim();let a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Jx(t,n=ad){e.watch(t,o=>Yx(o,n),{immediate:!0})}const Qx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Zx=["for"],ek={key:0,class:"ml-1 text-destructive"},tk=["disabled","onClick"],nk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},ok=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],rk={class:"flex items-center justify-end gap-2 w-full p-2"},ak=["disabled","onClick"],sk={key:1,class:"text-xs text-destructive"},_r=e.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const w=o.required,_=o["aria-required"];return w===""||w===!0||w==="true"||_==="true"||_===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:w=>{a("update:modelValue",w),a("change",w)}}),u=e.computed(()=>r.locale==="en"?kx:Xx),f=e.computed(()=>r.range?2:!1),m=w=>{const _=new Date(w);return _.setHours(0,0,0,0),_},h=w=>{const _=new Date(w);return _.setHours(23,59,59,999),_},x=(w,_)=>{const B=new Date(w);return B.setDate(B.getDate()+_),B},C=e.computed(()=>{if(r.disablePast)return m(new Date)}),y=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return h(x(new Date,r.maxDaysAhead))}),p=e.ref(null),S=e.ref(null),V=w=>{S.value={month:w.month,year:w.year}},E=e.ref(!1);let A=null;e.onMounted(()=>{const w=document.documentElement,_=()=>E.value=w.classList.contains("dark");_(),A=new MutationObserver(_),A.observe(w,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{A==null||A.disconnect(),A=null}),Jx(e.toRef(r,"tone"));const k=w=>{const _=new Date(w),B=_.getDay(),D=_.getDate()-B+(B===0?-6:1);return _.setDate(D),m(_)},g=w=>{const _=k(w);return _.setDate(_.getDate()+6),h(_)},b=w=>{const _=new Date(w);return _.setDate(1),m(_)},M=w=>{const _=new Date(w);return _.setMonth(_.getMonth()+1),_.setDate(0),h(_)};return e.computed(()=>{if(!r.range)return[];const w=new Date,_=m(w),B=k(w),D=g(w),N=b(w),O=M(w),v=(L,$)=>{let U=L;r.disablePast&&U<_&&(U=_);let P=$;if(r.autoRangeDays&&r.autoRangeDays>0){const F=h(x(U,r.autoRangeDays-1));P>F&&(P=F)}return P<U&&(P=h(new Date(U))),[U,P]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:v(B,D)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:v(N,O)}]}),(w,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",[e.unref(o).class,r.disabled?"cursor-not-allowed":""]])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Qx)):e.createCommentVNode("",!0),_[2]||(_[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",ek,"*")):e.createCommentVNode("",!0)],8,Zx)):e.createCommentVNode("",!0),e.createVNode(e.unref(Qd.VueDatePicker),{ref_key:"dpRef",ref:p,modelValue:d.value,"onUpdate:modelValue":_[1]||(_[1]=B=>d.value=B),dark:E.value,range:t.range,"multi-calendars":f.value,"auto-range":t.autoRangeDays,"max-range":t.autoRangeDays,"partial-range":!1,disabled:t.disabled,clearable:!1,"text-input":"","enable-time-picker":!1,"time-config":{enableTimePicker:!1},"auto-apply":!1,"action-row":{showPreview:!0,showNow:!1},locale:u.value,"model-type":t.modelType,formats:{input:t.displayFormat},"min-date":C.value,"max-date":y.value,floating:{placement:t.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:V},{"dp-input":e.withCtx(({value:B,onInput:D,onEnter:N,onTab:O,onBlur:v,onFocus:L,onKeypress:$,onPaste:U,toggleMenu:P})=>[e.createElementVNode("div",{class:e.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-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",t.disabled?"opacity-50 cursor-not-allowed":"",t.readonly?"bg-neutral-50/50 dark:bg-neutral-900/30":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.disabled||t.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",onClick:F=>!t.disabled&&!t.readonly&&P()},[e.createVNode(e.unref(te.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,tk),_[4]||(_[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",nk,e.toDisplayString(t.prependInner),1),_[3]||(_[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:B,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.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",t.disabled?"cursor-not-allowed":t.readonly?"cursor-default":"cursor-pointer"]),onClick:F=>!t.disabled&&!t.readonly&&P(),onFocus:F=>L(),onBlur:F=>v(),onInput:F=>D(F),onKeydown:[e.withKeys(F=>N(F),["enter"]),e.withKeys(F=>O(F),["tab"])],onKeypress:F=>$(F),onPaste:F=>U()},null,42,ok)],2)]),"action-buttons":e.withCtx(({selectDate:B,selectionDisabled:D})=>[e.createElementVNode("div",rk,[e.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:_[0]||(_[0]=N=>{var O;return(O=p.value)==null?void 0:O.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:D,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:N=>B()},e.toDisplayString(t.selectLabel),9,ak)])]),_:1},8,["modelValue","dark","range","multi-calendars","auto-range","max-range","disabled","locale","model-type","formats","min-date","max-date","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",sk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),ik=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=me.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(me.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),lk=e.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(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=me.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(me.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me.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"}),e.createVNode(e.unref(me.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("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",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(me.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:e.withCtx(()=>[e.createVNode(e.unref(te.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),ck=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(_e)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),dk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(_e)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),uk={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},fk={class:"flex items-center gap-3"},mk={class:"flex flex-col"},hk={key:0,class:"flex items-center gap-2"},pk={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"},gk={class:"flex justify-end gap-3 flex-wrap"},Jt=at(e.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?Vt[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(ik),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(lk),e.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",uk,[e.createElementVNode("div",fk,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",mk,[e.createVNode(e.unref(dk),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(ck),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",hk,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",pk,[e.createElementVNode("div",gk,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),Dn=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>bn(o.icon,Vt)),a=e.computed(()=>o.textSize?`text-${o.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"},i=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),bk={class:"flex flex-col gap-3 w-full"},yk={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"},xk={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"},kk={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"},wk={class:"text-sm font-medium text-slate-500"},Ck={class:"flex items-center justify-between gap-2"},Bk=["onClick"],Ek={key:0,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"},_k={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},Sk=["onClick"],Ak=["for","onDrop"],Vk={class:"text-xs text-slate-500 dark:text-slate-400"},Dk={key:2,class:"text-xs text-slate-400"},Nk=["id","disabled","accept","onChange"],Mk={class:"flex flex-col items-center justify-center min-h-[300px]"},Pk=["src","alt"],Tk=["src"],vk={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},Ok={class:"text-sm font-medium"},Fk=["href"],ms=e.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{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}},emits:["update:modelValue","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=bt.useI18n(),i=e.computed(()=>{const k=o.endpoint;if(!(k!=null&&k.apiUrl))return null;let g=k.apiUrl;if(!g.startsWith("http")&&o.baseUrl){const b=o.baseUrl.replace(/\/$/,""),M=g.startsWith("/")?g:`/${g}`;g=`${b}${M}`}return g}),l=e.computed(()=>{const k=c.value.length;return k<=1?"grid-cols-1":k===2?"grid-cols-1 md:grid-cols-2":k===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":k===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),f=e.ref(!0),m=e.ref(!1),h=e.ref(""),x=e.ref(""),C=e.ref(""),y=async()=>{var k;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((k=o.endpointReference)!=null&&k.apiUrl)){f.value=!1;return}try{const{apiUrl:g}=Ke(),b=await g(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let M=(b==null?void 0:b.data)||b;Array.isArray(M)||(M=[M]),c.value=M}catch(g){console.error("Failed to fetch dynamic document list",g)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),y()}),e.onBeforeUnmount(()=>{d.value.forEach(k=>{k._localPreviewUrl&&URL.revokeObjectURL(k._localPreviewUrl)})}),e.watch(()=>o.modelValue,k=>{if(Array.isArray(k)&&JSON.stringify(k)!==JSON.stringify(d.value)){const g=JSON.parse(JSON.stringify(k));g.forEach(b=>{const M=d.value.find(w=>w.typeDocument===b.typeDocument||w.idDocumentType===b.idDocumentType);M!=null&&M._localPreviewUrl&&(b._localPreviewUrl=M._localPreviewUrl)}),d.value=g}},{deep:!0}),e.watch(()=>{var k;return(k=o.endpointReference)==null?void 0:k.apiUrl},(k,g)=>{k!==g&&y()}),e.watch(()=>{var k;return(k=o.endpointReference)==null?void 0:k.apiMethod},(k,g)=>{k!==g&&y()}),e.watch(()=>o.items,k=>{c.value=k??[],f.value=!1},{deep:!0,immediate:!0});const p=k=>{const g=k[o.itemValue]||k.id||k.typeDocument;return d.value.find(b=>b.typeDocument===g||b.idDocumentType===g||b[o.itemValue]===g)||null},S=async(k,g,b)=>{var D,N,O,v;const M=b.target,w=(D=M.files)==null?void 0:D[0];if(!w)return;const _=k[o.itemValue]||k.id||k.typeDocument,B=URL.createObjectURL(w);if(!i.value){const L=[...d.value],$=L.findIndex(P=>P.typeDocument===_||P.idDocumentType===_);(N=L[$])!=null&&N._localPreviewUrl&&URL.revokeObjectURL(L[$]._localPreviewUrl);const U={id:null,idDocument:null,idDocumentType:_,filename:w.name,document:_,documentUrl:w.name,typeDocument:_,_localPreviewUrl:B,_fileType:w.type};$>-1?L[$]={...L[$],...U}:L.push(U),d.value=L,r("update:modelValue",L);return}u.value.add(g);try{const{apiUrl:L}=Ke(),$=new FormData;$.append("doc",w),$.append("typeDocument",String(_));const U=await L(i.value,((O=o.endpoint)==null?void 0:O.apiMethod)||"POST",$),P=Array.isArray(U==null?void 0:U.data)?U.data[0]:(U==null?void 0:U.data)||U,F=(P==null?void 0:P.url)||(P==null?void 0:P.document)||w.name,X=(P==null?void 0:P.id)||null,q=(P==null?void 0:P.filename)||(P==null?void 0:P.name)||w.name,W=[...d.value],Z=W.findIndex(ue=>ue.typeDocument===_||ue.idDocumentType===_);(v=W[Z])!=null&&v._localPreviewUrl&&URL.revokeObjectURL(W[Z]._localPreviewUrl);const ne={...P,id:X||(P==null?void 0:P.idDocument)||(P==null?void 0:P.id_document)||null,idDocument:(P==null?void 0:P.idDocument)||X||(P==null?void 0:P.id_document)||null,idDocumentType:_,filename:q,document:_,documentUrl:F,typeDocument:_,_localPreviewUrl:B,_fileType:w.type};Z>-1?W[Z]={...W[Z],...ne}:W.push(ne),d.value=W,r("update:modelValue",W),r("uploaded",P),r("success",P)}catch(L){console.error("Upload failed",L)}finally{u.value.delete(g),M.value=""}},V=k=>{const g=k[o.itemValue]||k.id||k.typeDocument,b=d.value.find(w=>w.typeDocument===g||w.idDocumentType===g);b!=null&&b._localPreviewUrl&&URL.revokeObjectURL(b._localPreviewUrl);const M=d.value.filter(w=>w.typeDocument!==g&&w.idDocumentType!==g);d.value=M,r("update:modelValue",M)},E=k=>{const g=p(k);if(!g)return;let b=g._localPreviewUrl;if(!b)if(g.server&&g.url){const _=g.server.replace(/\/+$/,""),B=g.url.replace(/^\/+/,"");b=`${_}/${B}`}else b=g.document||g.url;if(!b)return;const M=g.mime||g._fileType||"",w=M==="application/pdf"||b.toLowerCase().endsWith(".pdf");w&&!b.includes("#")&&(b+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),h.value=b,x.value=k[o.itemTitle]||k.name||g.filename||"Preview Document",C.value=M||(w?"application/pdf":"image/jpeg"),m.value=!0},A=(k,g,b)=>{var _,B;b.preventDefault();const M=(B=(_=b.dataTransfer)==null?void 0:_.files)==null?void 0:B[0];if(!M)return;S(k,g,{target:{files:[M],value:""}})};return(k,g)=>(e.openBlock(),e.createElementBlock("div",bk,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(Dn,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(e.openBlock(),e.createElementBlock("div",yk,[e.createVNode(Dn,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",xk,[e.createVNode(e.unref(te.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",kk,[e.createVNode(e.unref(te.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",wk,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,M)=>{var w;return e.openBlock(),e.createElementBlock("div",{key:M,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"},[e.createElementVNode("div",Ck,[e.createVNode(Dn,{text:b[t.itemTitle]||b.name||b.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),p(b)?(e.openBlock(),e.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:_=>E(b)},[e.createVNode(e.unref(te.Eye),{class:"w-4 h-4"})],8,Bk)):e.createCommentVNode("",!0)]),p(b)?(e.openBlock(),e.createElementBlock("div",Ek,[e.createVNode(e.unref(te.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",_k,e.toDisplayString(((w=p(b))==null?void 0:w.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:_=>V(b)},[e.createVNode(e.unref(te.X),{class:"w-4 h-4"})],8,Sk))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${M}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.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",u.value.has(M)?"pointer-events-none opacity-70":""]]),onDragover:g[0]||(g[0]=e.withModifiers(()=>{},["prevent"])),onDrop:_=>!t.disabled&&!u.value.has(M)&&A(b,M,_)},[u.value.has(M)?(e.openBlock(),e.createBlock(e.unref(te.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(te.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",Vk,e.toDisplayString(u.value.has(M)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",Dk,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${M}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(M),accept:t.typeFile,onChange:_=>S(b,M,_)},null,40,Nk)],42,Ak))])}),128))],2),e.createVNode(Jt,{modelValue:m.value,"onUpdate:modelValue":g[2]||(g[2]=b=>m.value=b),title:x.value,"max-width":C.value==="application/pdf"?"720":"500",class:e.normalizeClass(C.value==="application/pdf"?"max-w-[40vw]":""),"content-class":C.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:e.withCtx(()=>[e.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:g[1]||(g[1]=b=>m.value=!1)},e.toDisplayString(e.unref(a)("common.close")||"Close"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Mk,[C.value.startsWith("image/")?(e.openBlock(),e.createElementBlock("img",{key:0,src:h.value,alt:x.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,Pk)):C.value==="application/pdf"?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${h.value}${h.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,Tk)):(e.openBlock(),e.createElementBlock("div",vk,[e.createVNode(e.unref(te.FileText),{class:"w-16 h-16 stroke-1"}),e.createElementVNode("span",Ok,e.toDisplayString(e.unref(a)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),e.createElementVNode("a",{href:h.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"},e.toDisplayString(e.unref(a)("dynamicUploadList.viewOriginal")||"View Original"),9,Fk)]))])]),_:1},8,["modelValue","title","max-width","class","content-class"])]))}}),sd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>Vt[n.icon]??Vt.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(St),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),zk=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)(e.unref(Rk)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Ik=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Rk=Ho("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"}}),hs=e.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)(e.unref(Lk)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Lk=Ho("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"}}),ps=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),gs=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),bs=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(_e)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),ys=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(_e)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),$k={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},jk={class:"flex flex-wrap items-center justify-center gap-2"},Uk=["accept","multiple"],Sr=at(e.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}},emits:["picked","picked:multiple","error"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var g;o.disabled||(g=a.value)==null||g.click()}function f(g){const b=g/1024,M=b/1024;return M>=1?`${M.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${g} B`}function m(g){var M;if(!g)return"File tidak valid";if((M=o.accept)!=null&&M.includes("image/")&&!g.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return g.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function h(g){l.value=g.name,c.value=g.size}function x(g){if(i.value=null,!g.length)return;if(o.mode==="single"){const M=g[0],w=m(M);if(w){i.value=w,r("error",w);return}o.showSelected&&h(M),r("picked",M);return}const b=[];for(const M of g){const w=m(M);if(w){i.value=w,r("error",w);return}b.push(M)}b.length&&(o.showSelected&&h(b[0]),r("picked:multiple",b))}function C(g){const b=g.target,M=Array.from(b.files??[]);x(M),b.value=""}function y(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function S(){s.value=!1}function V(g){var w,_;if(o.disabled)return;s.value=!1;const b=Array.from(((w=g.dataTransfer)==null?void 0:w.files)??[]),M=(_=o.accept)!=null&&_.includes("image/")?b.filter(B=>B.type.startsWith("image/")):b;x(M)}const E=e.computed(()=>(o.accept||"file/*").split(",").map(g=>g.trim()).filter(Boolean).map(g=>g==="image/*"?"IMAGE":g.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const A=e.ref(!1),k=e.computed(()=>{if(o.disabled||!A.value)return{};const g=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:g?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:g?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(g,b)=>(e.openBlock(),e.createBlock(e.unref(ps),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(bs),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(ys),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(gs),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.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",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},k.value]),onClick:u,onDragenter:e.withModifiers(y,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(S,["prevent"]),onDrop:e.withModifiers(V,["prevent"]),onMouseenter:b[0]||(b[0]=M=>A.value=!0),onMouseleave:b[1]||(b[1]=M=>A.value=!1)},[e.createElementVNode("div",$k,[b[2]||(b[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",jk,[e.createVNode(e.unref(hs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(E.value),1)]),_:1}),e.createVNode(e.unref(hs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(e.unref(hs),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?f(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:C},null,40,Uk)],38),d.value?(e.openBlock(),e.createBlock(e.unref(zk),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ik),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-d8943808"]]),Wk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Hk=["src"],qk={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"},Gk={class:"space-y-0.5"},Kk={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Xk={class:"text-xs opacity-70"},Yk=["disabled"],Jk={key:1},Qk=["disabled"],Zk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},ew={class:"flex gap-2"},tw={class:"font-medium truncate"},nw={class:"flex gap-2"},ow={class:"font-medium"},rw={class:"flex gap-2"},aw={class:"font-medium truncate"},xs=at(e.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},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(h){const x=h/1024,C=x/1024;return C>=1?`${C.toFixed(2)} MB`:x>=1?`${x.toFixed(1)} KB`:`${h} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{f(),typeof document<"u"&&(u=new MutationObserver(f),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const m=e.computed(()=>o.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(h,x)=>t.file?(e.openBlock(),e.createBlock(ps,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(bs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(ys,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",Wk,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(gs,{class:"pt-2"},{default:e.withCtx(()=>{var C,y,p,S,V;return[e.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:e.normalizeStyle([{height:`${t.previewHeight}px`},m.value]),onMouseenter:x[2]||(x[2]=E=>c.value=!0),onMouseleave:x[3]||(x[3]=E=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Hk)):(e.openBlock(),e.createElementBlock("div",qk,[e.createVNode(e.unref(te.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Gk,[e.createElementVNode("p",Kk,e.toDisplayString((C=l.value)==null?void 0:C.name),1),e.createElementVNode("p",Xk,e.toDisplayString((y=l.value)==null?void 0:y.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:x[0]||(x[0]=E=>r("edit"))},[e.createVNode(e.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,Yk)):(e.openBlock(),e.createElementBlock("div",Jk)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:x[1]||(x[1]=E=>r("remove"))},[e.createVNode(e.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Qk)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",Zk,[e.createElementVNode("div",ew,[x[4]||(x[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",tw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",nw,[x[5]||(x[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",ow,e.toDisplayString((S=l.value)==null?void 0:S.size),1)]),e.createElementVNode("div",rw,[x[6]||(x[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",aw,e.toDisplayString((V=l.value)==null?void 0:V.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function ks(){const t=s=>{var c;const i={type:s.type||"info",title:s.title,message:s.message,duration:s.duration??3e3};typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:toast",{detail:i,bubbles:!0,composed:!0})),(i.type==="error"?console.error:i.type==="warning"?console.warn:console.log)(`[Toast][${(c=i.type)==null?void 0:c.toUpperCase()}]`,i.title||"",i.message)};return{show:t,success:(s,i)=>t({type:"success",message:s,title:i}),error:(s,i)=>t({type:"error",message:s,title:i}),warning:(s,i)=>t({type:"warning",message:s,title:i}),info:(s,i)=>t({type:"info",message:s,title:i})}}const sw={class:"space-y-3"},iw={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},id=e.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:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:k=>r("update:modelValue",k)}),s=e.ref(null),i=e.ref(null);function l(k){i.value=k,r("error",k)}function c(){i.value=null}const d=e.computed(()=>{const k=(o.allowedTypes??"").trim();return k?k.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(k){const g=k.lastIndexOf(".");return g>=0?k.slice(g).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const k=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...k].join(",")}return o.accept}),m=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function h(k){if(d.value.length){const g=(k.type||"").toLowerCase(),b=u(k.name);return d.value.some(M=>M.includes("/")?g===M:M.startsWith(".")?b===M:b===`.${M}`)}if(o.accept){if(o.accept==="*/*")return!0;const g=o.accept.split(",").map(w=>w.trim().toLowerCase()),b=(k.type||"").toLowerCase(),M=u(k.name);return g.some(w=>{if(w.endsWith("/*")){const _=w.slice(0,-2);return b.startsWith(_)}return w.startsWith(".")?M===w:b===w})}return!0}function x(k){return k*1024*1024}async function C(k){return k?h(k)?o.minSizeMb!=null&&k.size<x(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&k.size>x(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${m.value}`:"File tidak valid"}const{DCodeApi:y}=Ke(),p=ks(),S=e.ref(!1);async function V(k){var g;if(o.uploadFn){try{S.value=!0;const b=await o.uploadFn(k);a.value=k,r("uploaded",b)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{S.value=!1}return}if(!((g=o.endpoint)!=null&&g.apiUrl)){a.value=k;return}if(typeof y!="function"){l("useApi() must expose DCodeApi()");return}try{S.value=!0;const b=new FormData;b.append("doc",k);const M=(o.endpoint.apiMethod||"POST").toUpperCase(),w=o.endpoint.apiUrl,_=await y("","",b,{_url:w,_method:M,withCredentials:!0,transformRequest:[(D,N)=>(N&&(delete N["Content-Type"],delete N["content-type"]),D)]}),B=(_==null?void 0:_.data)??_;a.value=k,r("uploaded",B)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{S.value=!1}}async function E(k){var b;if(o.disabled)return;c();const g=await C(k);if(g){l(g);return}s.value=k,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await V(k):a.value=k}function A(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,k=>{k&&!s.value&&(s.value=k),k||(s.value=null)},{immediate:!0}),(k,g)=>(e.openBlock(),e.createElementBlock("div",sw,[a.value?S.value?(e.openBlock(),e.createElementBlock("div",iw,[...g[1]||(g[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(xs,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:A},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(Sr,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||S.value,onPicked:E,error:i.value,onError:g[0]||(g[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),lw=["for"],cw={key:0,class:"!ml-1 !text-destructive"},dw={class:"relative w-full block box-border"},uw={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},fw=["id","readonly","disabled","placeholder"],mw={class:"absolute inset-y-0 right-4 flex items-center z-10"},hw={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"},pw={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},gw={key:1,class:"text-sm text-muted-foreground text-center"},bw=["onClick","title"],yw={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},xw={class:"flex items-center justify-center flex-1"},kw={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},ww={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},ld=e.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=t,r=n,a=Vt,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),f=e.ref(""),m=e.ref(!1),h=e.ref(!1),x=e.ref(!1),C=e.shallowRef([]),y=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),S=async()=>{if(h.value||x.value)return;x.value=!0,await new Promise(F=>setTimeout(F,0));const P=Object.keys(a).filter(F=>!p.has(F)).filter(F=>/^[A-Z]/.test(F)).filter(F=>typeof a[F]=="function"||typeof a[F]=="object"&&a[F]).sort((F,X)=>F.localeCompare(X));C.value=P,h.value=!0,x.value=!1},V=e.computed(()=>u.value?bn(u.value,a):null),E=e.ref(u.value),A=e.computed(()=>!!u.value&&!d.value),k=e.computed(()=>{if(!h.value)return[];const P=(f.value??"").trim().toLowerCase();return P?C.value.filter(F=>F.toLowerCase().includes(P)):C.value}),g=e.computed(()=>k.value.slice(0,y.value)),b=e.computed(()=>{const P=o.columns;return P<=2?"grid-cols-2":P===3?"grid-cols-3":P===4?"grid-cols-4":P===5?"grid-cols-5":P>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>V.value&&!d.value?"!pl-12":"!pl-3");const M=async()=>{var P;await e.nextTick(),(P=i.value)==null||P.focus()},w=async P=>{if(o.disabled)return;const F=P!==!1;if(m.value){m.value=!1;return}d.value=!0,await S(),F&&(f.value="",E.value=""),y.value=o.pageSize,await M()},_=()=>{d.value=!1,f.value="",E.value=u.value,y.value=o.pageSize},B=async()=>{o.disabled||(d.value?_():await w())};let D=null;const N=async P=>{if(o.disabled)return;r("update:modelValue",null),d.value||await w(!1),D&&clearTimeout(D);const F=E.value;D=setTimeout(()=>{f.value=F},300)},O=P=>{o.disabled||(r("update:modelValue",P),_(),queueMicrotask(()=>{var F;return(F=i.value)==null?void 0:F.blur()}))},v=()=>{o.disabled||(r("update:modelValue",null),r("clear"),m.value=!0,_(),queueMicrotask(()=>{var P;return(P=i.value)==null?void 0:P.focus()}))},L=P=>{if(P.key==="Escape"){P.preventDefault(),_();return}if(P.key==="Enter"&&d.value){const F=k.value[0];F&&(P.preventDefault(),O(F))}},$=P=>{if(!d.value)return;const F=P.target;s.value&&!s.value.contains(F)&&_()},U=P=>{const F=P.target;F.scrollTop+F.clientHeight>=F.scrollHeight-24&&y.value<k.value.length&&(y.value=Math.min(y.value+o.pageSize,k.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",$),queueMicrotask(()=>{var P;i.value=((P=s.value)==null?void 0:P.querySelector("input"))??null}),u.value&&S()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",$),D&&clearTimeout(D)}),e.watch(u,P=>{d.value||(E.value=P)}),e.watch(()=>f.value,()=>{y.value=o.pageSize}),(P,F)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",cw,"*")):e.createCommentVNode("",!0)],8,lw)):e.createCommentVNode("",!0),e.createElementVNode("div",dw,[V.value&&!d.value?(e.openBlock(),e.createElementBlock("div",uw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(V.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":F[0]||(F[0]=X=>E.value=X),readonly:A.value,disabled:o.disabled,placeholder:o.placeholder,class:e.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",[V.value&&!d.value?"pl-10":"pl-4",A.value?"cursor-pointer select-none":""]]),onClick:w,onFocus:w,onInput:N,onKeydown:L},null,42,fw),[[e.vModelText,E.value]]),e.createElementVNode("div",mw,[o.clearable&&u.value?(e.openBlock(),e.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:F[1]||(F[1]=e.withModifiers(()=>{},["prevent"])),onClick:v,title:"Clear"},[e.createVNode(e.unref(te.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.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:F[2]||(F[2]=e.withModifiers(()=>{},["prevent"])),onClick:B,title:"Open"},[e.createVNode(e.unref(te.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",hw,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:U},[x.value?(e.openBlock(),e.createElementBlock("div",pw,[e.createVNode(e.unref(te.Loader2),{class:"h-4 w-4 animate-spin"}),F[3]||(F[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):h.value&&k.value.length===0?(e.openBlock(),e.createElementBlock("div",gw," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",b.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,X=>(e.openBlock(),e.createElementBlock("button",{key:X,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===X?"ring-1 ring-primary":""]),onClick:q=>O(X),title:X},[e.createElementVNode("div",yw,[e.createElementVNode("div",xw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[X]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",kw,e.toDisplayString(X),1)])],10,bw))),128))],2)),h.value&&k.value.length>0?(e.openBlock(),e.createElementBlock("div",ww," Showing "+e.toDisplayString(g.value.length)+" / "+e.toDisplayString(k.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),Cw={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Bw={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},Ew={class:"relative overflow-auto p-0"},ws=e.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(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:V=>r("update:modelValue",V)}),s=e.ref(null),i=e.ref(null);let l=null,c=!1,d=0,u=null;function f(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function m(V,E,A,k,g){const b=await new Promise((_,B)=>{const D=URL.createObjectURL(V),N=new Image;N.onload=()=>{URL.revokeObjectURL(D),_(N)},N.onerror=O=>{URL.revokeObjectURL(D),B(O)},N.src=D}),M=document.createElement("canvas");M.width=E,M.height=A;const w=M.getContext("2d");return w?(w.drawImage(b,0,0,E,A),await new Promise(_=>{M.toBlob(B=>_(B||V),k,g)})):V}function h(){if(!l||!i.value)return;const V=l.getPlugin("Dashboard"),E=l.getFile(i.value);!V||!E||requestAnimationFrame(()=>{try{V.openFileEditor(E)}catch{try{V.openFileEditor(i.value)}catch{}}})}async function x(V){if(l){l.cancelAll(),i.value=null;try{const E=l.addFile({name:V.name,type:V.type,data:V,source:"Local",isRemote:!1});i.value=String(E)}catch{}}}function C(){if(!s.value)return;l&&f(),l=new Zd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const V=document.documentElement.classList.contains("dark");l.use(Us,{target:s.value,inline:!0,height:480,theme:V?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const E=document.documentElement.classList.contains("dark"),A=l.getPlugin("Dashboard");A&&A.setOptions({theme:E?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(eu,{target:Us,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.value=!1}),l.on("file-added",E=>{i.value=(E==null?void 0:E.id)??null,o.autoOpenEditor&&setTimeout(()=>h(),80)}),l.on("file-editor:complete",async E=>{const A=++d;try{const k=E.data,g=k.type||E.type||"image/jpeg";let b=k;if(o.outputWidth&&o.outputHeight&&(b=await m(k,o.outputWidth,o.outputHeight,g,o.quality)),c||A!==d)return;const M=E.name||"edited-image.jpg",w=new File([b],M,{type:g});await y(w,"UPPY_EDITOR_COMPLETE"),r("done",w),a.value=!1}catch{}})}async function y(V,E="CROP_RESULT"){const A=URL.createObjectURL(V);try{const k=await new Promise((g,b)=>{const M=new Image;M.onload=()=>g(M),M.onerror=b,M.src=A});console.group(E),console.log("file:",V),console.table({name:V.name,type:V.type,sizeBytes:V.size,sizeMB:+(V.size/1024/1024).toFixed(3),width:k.naturalWidth,height:k.naturalHeight,ratio:+(k.naturalWidth/k.naturalHeight).toFixed(4)}),console.log("previewUrl:",A),console.groupEnd()}finally{URL.revokeObjectURL(A)}}e.watch(a,async V=>{c=!V,d++,V?(await e.nextTick(),C(),o.file&&await x(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async V=>{a.value&&V&&(await e.nextTick(),await x(V))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=V=>{V.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,V=>{V?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const S=e.ref(!1);return(V,E)=>a.value?(e.openBlock(),e.createElementBlock("div",Cw,[e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:E[0]||(E[0]=A=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.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:e.withCtx(()=>[a.value?(e.openBlock(),e.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:E[4]||(E[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Bw,[E[6]||(E[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.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:e.normalizeStyle({opacity:S.value?1:.7}),onClick:E[1]||(E[1]=A=>a.value=!1),onMouseenter:E[2]||(E[2]=A=>S.value=!0),onMouseleave:E[3]||(E[3]=A=>S.value=!1)},[e.createVNode(e.unref(te.X),{class:"h-4 w-4"}),E[5]||(E[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",Ew,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),_w={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Sw=["src"],Aw=["disabled"],Vw=["disabled"],Dw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Nw={class:"flex gap-2"},Mw={class:"font-medium truncate"},Pw={class:"flex gap-2"},Tw={class:"font-medium"},vw={class:"flex gap-2"},Ow={class:"font-medium truncate"},Cs=at(e.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(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(m){const h=m/1024,x=h/1024;return x>=1?`${x.toFixed(2)} MB`:h>=1?`${h.toFixed(1)} KB`:`${m} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=e.computed(()=>o.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,h)=>t.file?(e.openBlock(),e.createBlock(ps,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(bs,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(ys,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",_w,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(gs,{class:"pt-2"},{default:e.withCtx(()=>{var x,C,y;return[e.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:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:h[2]||(h[2]=p=>l.value=!0),onMouseleave:h[3]||(h[3]=p=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Sw)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.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"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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:h[0]||(h[0]=p=>r("edit"))},[e.createVNode(e.unref(te.Pencil),{style:{width:"16px",height:"16px"}})],12,Aw)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.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:t.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:h[1]||(h[1]=p=>r("remove"))},[e.createVNode(e.unref(te.Trash2),{style:{width:"16px",height:"16px"}})],12,Vw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.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"})},[e.createElementVNode("div",Dw,[e.createElementVNode("div",Nw,[h[4]||(h[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Mw,e.toDisplayString((x=i.value)==null?void 0:x.name),1)]),e.createElementVNode("div",Pw,[h[5]||(h[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Tw,e.toDisplayString((C=i.value)==null?void 0:C.size),1)]),e.createElementVNode("div",vw,[h[6]||(h[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Ow,e.toDisplayString((y=i.value)==null?void 0:y.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),Fw={class:"space-y-3"},Ar=e.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}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:v=>r("update:modelValue",v)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d(v){c.value=v,r("error",v)}function u(){c.value=null}const f=e.computed(()=>{const v=(o.allowedTypes??"").trim();return v?v.split(/[,\s;]+/g).map($=>$.trim().toLowerCase()).filter(Boolean).map($=>$.includes("/")||$.startsWith(".")?$:`.${$}`):[]});function m(v){const L=v.lastIndexOf(".");return L>=0?v.slice(L).toLowerCase():""}const h=e.computed(()=>{if(f.value.length){const v=f.value.filter($=>$.startsWith("."));return[...f.value.filter($=>$.includes("/")),...v].join(",")}return o.accept||"image/*"}),x=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function C(v){if(f.value.length){const $=(v.type||"").toLowerCase(),U=m(v.name);return f.value.some(P=>P.includes("/")?$===P:P.startsWith(".")?U===P:U===`.${P}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(v.type||"").toLowerCase().startsWith("image/"):!0}function y(v){return v*1024*1024}async function p(v){var L;return(L=v.type)!=null&&L.startsWith("image/")?await new Promise($=>{const U=URL.createObjectURL(v),P=new Image;P.onload=()=>{URL.revokeObjectURL(U),$({w:P.naturalWidth,h:P.naturalHeight})},P.onerror=()=>{URL.revokeObjectURL(U),$(null)},P.src=U}):null}async function S(v){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const $=await p(v);return $?o.minWidth!=null&&$.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&$.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&$.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&$.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function V(v){return v?C(v)?o.minSizeMb!=null&&v.size<y(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&v.size>y(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await S(v):`only Allowed: ${x.value}`:"File tidak valid"}function E(v){o.disabled||(i.value=v,s.value=!0)}async function A(v){if(o.disabled)return;u();const L=await V(v);if(L){d(L);return}l.value=v,E(v)}const{DCodeApi:k}=Ke(),g=ks(),b=e.ref(!1);e.ref(null);function M(v,L){return!v||!L?null:v.replace(/\/+$/,"")+"/"+L.replace(/^\/+/,"")}function w(v){var P;const L=(v==null?void 0:v.data)??v,$=(P=L==null?void 0:L.data)==null?void 0:P[0];if(!$)return null;const U=M($.server,$.url);return{...$,fullUrl:U?encodeURI(U):null}}async function _(v){var L;if(o.uploadFn){try{b.value=!0;const $=await o.uploadFn(v);a.value=v,r("uploaded",$)}catch($){console.error("Upload Error",$),g.error("Upload Failed",($==null?void 0:$.message)||"Unknown error"),d(($==null?void 0:$.message)||"Upload Failed")}finally{b.value=!1}return}if(!((L=o.endpoint)!=null&&L.apiUrl)){a.value=v;return}if(typeof k!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const $=new FormData;$.append("doc",v);const U=(o.endpoint.apiMethod||"POST").toUpperCase(),P=o.endpoint.apiUrl,F=await k("","",$,{_url:P,_method:U,withCredentials:!0,transformRequest:[(q,W)=>(W&&(delete W["Content-Type"],delete W["content-type"]),q)]}),X=(F==null?void 0:F.data)??F;w(X),a.value=v,r("uploaded",X)}catch($){console.error("Upload Error",$),g.error("Upload Failed",($==null?void 0:$.message)||"Unknown error"),d(($==null?void 0:$.message)||"Upload Failed")}finally{b.value=!1}}async function B(v){var L;u(),o.uploadFn||(L=o.endpoint)!=null&&L.apiUrl?await _(v):a.value=v,s.value=!1,i.value=null}function D(){s.value=!1,i.value=null}async function N(){if(!a.value)return;u();const v=o.editUseOriginal?l.value??a.value:a.value,L=await V(v);if(L){d(L);return}E(v)}function O(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,v=>{v&&!l.value&&(l.value=v),v||(l.value=null)},{immediate:!0}),(v,L)=>(e.openBlock(),e.createElementBlock("div",Fw,[a.value?(e.openBlock(),e.createBlock(Cs,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:N,onRemove:O,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(Sr,{key:0,label:t.label,hint:t.hint,accept:h.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:A,error:c.value,onError:L[0]||(L[0]=$=>d($))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(ws,{modelValue:s.value,"onUpdate:modelValue":L[1]||(L[1]=$=>s.value=$),file:i.value,title:t.title,description:t.description,"auto-open-editor":t.autoOpenEditor,"aspect-ratio":t.aspectRatio,"output-width":t.outputWidth,"output-height":t.outputHeight,quality:t.quality,onDone:B,onCancel:D},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),zw=["aria-busy"],Iw={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Rw=["for"],Lw={key:0,class:"ml-1 text-destructive"},$w=["id","disabled"],jw={class:"min-w-0 flex-1 text-left"},Uw={key:0,class:"flex flex-wrap gap-1.5"},Ww={class:"max-w-[220px] truncate"},Hw=["onClick"],qw={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"},Gw={key:1,class:"text-muted-foreground truncate"},Kw={class:"flex items-center gap-2 shrink-0"},Xw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},Yw=["placeholder","onKeydown"],Jw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},Qw=["disabled","onClick"],Zw={class:"truncate"},e1={key:0,class:"text-primary-600 dark:text-primary-400"},t1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},n1={key:0},o1={key:1},r1={key:1,class:"text-xs text-destructive"},Bs=e.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},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},error:{default:null},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const Q=o.required,oe=o["aria-required"];return Q===""||Q===!0||Q==="true"||(oe==="true"||oe===!0)}),u=e.computed(()=>!!a.error);function f(Q){return Q?typeof a.itemTitle=="function"?a.itemTitle(Q)??"":String((Q==null?void 0:Q[a.itemTitle])??""):""}function m(Q){return Q?typeof a.itemValue=="function"?a.itemValue(Q):Q==null?void 0:Q[a.itemValue]:null}function h(Q,oe){return m(Q)??oe}const x=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),C=e.computed(()=>{var Q;return!!((Q=a.endpoint)!=null&&Q.apiUrl)||!!a.fetchItems}),y=e.ref([]),p=e.ref(!1),S=e.ref(!1),V=e.computed(()=>{var oe;const Q=(oe=a.endpoint)==null?void 0:oe.apiOptions;if(Q)return typeof Q=="function"?Q():Q}),E=e.computed(()=>{var xe,He;const Q=((xe=a.endpoint)==null?void 0:xe.apiUrl)??"",oe=(((He=a.endpoint)==null?void 0:He.apiMethod)??"GET").toUpperCase(),se=JSON.stringify(V.value??null);return`${oe} ${Q} :: ${se}`}),A=e.computed(()=>C.value?y.value:a.items||[]);async function k(){var Q;if(C.value&&!(!((Q=a.endpoint)!=null&&Q.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let oe;if(a.fetchItems){const se=await a.fetchItems(),xe=(se==null?void 0:se.data)??se;oe=(xe==null?void 0:xe.data)??xe}else{const{DCodeApi:se}=Ke();if(typeof se!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const xe={page:1,perPage:100,...V.value||{}},He=await se("","",xe,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),zt=(He==null?void 0:He.data)??He;oe=(zt==null?void 0:zt.data)??zt}y.value=Array.isArray(oe)?oe:[],S.value=!0}catch(oe){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",oe),y.value=[]}finally{p.value=!1}}}e.watch(()=>E.value,()=>{y.value=[],S.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&C.value&&k()});const g=e.computed(()=>{const Q=x.value;if(a.returnObject)return Q;const oe=new Map;for(const se of A.value)oe.set(m(se),se);return Q.map(se=>oe.get(se)??{[a.itemValue]:se,[a.itemTitle]:String(se)})}),b=e.computed(()=>a.maxChips===null?g.value:g.value.slice(0,a.maxChips));function M(Q){const oe=x.value;if(a.returnObject){const se=m(Q);return oe.some(xe=>m(xe)===se)}return oe.includes(m(Q))}const w=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const Q=Number(a.maxSelected);return Number.isFinite(Q)&&Q>0?Q:null}),_=e.computed(()=>{const Q=w.value;return Q===null?!1:x.value.length>=Q});function B(Q){return!M(Q)&&_.value}const D=e.computed(()=>{const Q=x.value,oe=new Set;if(a.returnObject)for(const se of Q)oe.add(m(se));else for(const se of Q)oe.add(se);return oe}),N=e.computed(()=>{const Q=D.value;return(A.value||[]).filter(oe=>!Q.has(m(oe)))}),O=e.computed(()=>A.value.length===0?!1:N.value.length===0),v=e.ref(null),L=e.ref(null),$=e.ref(null),U=e.ref(!1),P=e.ref(""),F=e.ref(0),X=e.ref(0),{floatingStyles:q}=ha(v,L,{whileElementsMounted:ca,placement:"bottom-start",middleware:[da(8),fa(),ua({padding:8}),ma({apply({rects:Q,elements:oe}){Object.assign(oe.floating.style,{width:`${Q.reference.width}px`,"--floating-width":`${Q.reference.width}px`})}})]}),W=e.computed(()=>q.value),Z=e.computed(()=>{const Q=Number(a.maxRows);return Number.isFinite(Q)&&Q>0?Q:5});async function ne(){a.disabled||a.readonly||(U.value=!0,X.value=0,requestAnimationFrame(()=>{$.value&&($.value.scrollTop=0),F.value=0}),C.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!S.value)&&!p.value&&await k())}function ue(){U.value=!1}function ke(){U.value?ue():ne()}function fe(Q){var se,xe;if(!U.value)return;const oe=Q.target;(se=v.value)!=null&&se.contains(oe)||(xe=L.value)!=null&&xe.contains(oe)||ue()}e.onMounted(()=>document.addEventListener("mousedown",fe)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",fe));function K(Q){if(a.disabled||a.readonly)return;if(B(Q)){r("max");return}const oe=[...x.value];if(a.returnObject){const se=m(Q);if(oe.some(He=>m(He)===se))return;r("update:modelValue",[...oe,Q])}else{const se=m(Q);if(oe.includes(se))return;r("update:modelValue",[...oe,se])}P.value="",X.value=0,requestAnimationFrame(()=>{$.value&&($.value.scrollTop=0),F.value=0})}function z(Q){if(a.disabled||a.readonly)return;const oe=[...x.value];if(a.returnObject){const se=m(Q);r("update:modelValue",oe.filter(xe=>m(xe)!==se))}else{const se=m(Q);r("update:modelValue",oe.filter(xe=>xe!==se))}}function G(){a.disabled||a.readonly||(r("update:modelValue",[]),r("clear"),ue())}const ee=e.computed(()=>{const Q=P.value.trim().toLowerCase(),oe=N.value;return Q?oe.filter(se=>f(se).toLowerCase().includes(Q)):oe}),he=e.computed(()=>ee.value.length);e.watch(U,Q=>{Q||(P.value="")});const De=e.computed(()=>{if(O.value)return a.itemHeight;const Q=he.value;return(Q<=0?1:Math.min(Q,Z.value))*a.itemHeight}),Ae=e.computed(()=>a.virtual?he.value*a.itemHeight:0),ze=e.computed(()=>a.virtual?Math.ceil(De.value/a.itemHeight)+a.overscan:he.value),Ie=e.computed(()=>{if(!a.virtual)return 0;const Q=Math.floor(F.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,Q)}),Ue=e.computed(()=>a.virtual?Math.min(he.value,Ie.value+ze.value):he.value),Me=e.computed(()=>a.virtual?Ie.value*a.itemHeight:0),Ze=e.computed(()=>{const Q=ee.value;return a.virtual?Q.slice(Ie.value,Ue.value):Q});function ct(Q){const oe=Q.target;F.value=oe.scrollTop}function At(Q){return Q===X.value}function H(Q){const oe=$.value;if(!oe||!a.virtual)return;const se=Q*a.itemHeight,xe=se+a.itemHeight,He=oe.scrollTop,zt=oe.scrollTop+oe.clientHeight;se<He?oe.scrollTop=se:xe>zt&&(oe.scrollTop=xe-oe.clientHeight)}function re(Q){const oe=Math.max(0,he.value-1);X.value=Math.min(oe,Math.max(0,X.value+Q)),H(X.value)}function pe(){const Q=ee.value[X.value];Q&&K(Q)}const Re=e.computed(()=>a.clearable&&!a.disabled&&!a.readonly&&g.value.length>0),Ee=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":U.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(Q,oe)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",[e.unref(o).class,a.disabled?"cursor-not-allowed":""]]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",Iw)):e.createCommentVNode("",!0),oe[3]||(oe[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",Lw,"*")):e.createCommentVNode("",!0)],8,Rw)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:v,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.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",a.disabled?"cursor-not-allowed opacity-50":a.readonly?"cursor-default bg-neutral-50/50 dark:bg-neutral-900/30":"",Ee.value]]),disabled:a.disabled||a.readonly,onClick:ke},[e.createElementVNode("div",jw,[g.value.length?(e.openBlock(),e.createElementBlock("div",Uw,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(se,xe)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${h(se,xe)}`,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"},[e.createElementVNode("span",Ww,e.toDisplayString(f(se)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(He=>z(se),["stop"]),"aria-label":"Remove"}," ✕ ",8,Hw))]))),128)),a.maxChips!==null&&g.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",qw," +"+e.toDisplayString(g.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",Gw,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",Kw,[Re.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(G,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(te.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,$w),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[U.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:L,class:"-mt-1 z-[9999] 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:e.normalizeStyle(W.value)},[a.searchable&&!O.value?(e.openBlock(),e.createElementBlock("div",Xw,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":oe[0]||(oe[0]=se=>P.value=se),placeholder:a.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:[oe[1]||(oe[1]=e.withKeys(e.withModifiers(se=>re(1),["prevent"]),["down"])),oe[2]||(oe[2]=e.withKeys(e.withModifiers(se=>re(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(pe,["prevent"]),["enter"]),e.withKeys(e.withModifiers(ue,["prevent"]),["esc"])]},null,40,Yw),[[e.vModelText,P.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:$,class:"relative overflow-auto",style:e.normalizeStyle({height:De.value+"px"}),onScroll:ct},[O.value?(e.openBlock(),e.createElementBlock("div",Jw," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:Ae.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${Me.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,(se,xe)=>(e.openBlock(),e.createElementBlock("button",{key:String(h(se,Ie.value+xe)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[B(se)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",At(Ie.value+xe)?"bg-neutral-50 dark:bg-neutral-800/60":"",M(se)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||B(se),onClick:He=>K(se)},[e.createElementVNode("span",Zw,e.toDisplayString(f(se)),1),M(se)?(e.openBlock(),e.createElementBlock("span",e1,"✓")):e.createCommentVNode("",!0)],14,Qw))),128))],6),he.value===0?(e.openBlock(),e.createElementBlock("div",t1,[p.value?(e.openBlock(),e.createElementBlock("span",n1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",o1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",r1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,zw)),[[e.vShow,i.value]])}}),a1={class:"space-y-4"},s1={key:0,class:"flex flex-col gap-0.5"},i1=["for"],l1=["for"],c1={class:"text-[11px] text-gray-500 dark:text-gray-400"},d1={class:"flex items-center gap-2 flex-nowrap"},u1=["id","value","disabled","onKeydown","onInput","onPaste"],Vr=e.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=Ke(),f=ks(),m=e.computed(()=>{const k=Number(s.totalInput);return k&&k>0?k:6}),h=()=>{c.value=Array.from({length:m.value},(k,g)=>{var b;return((b=s.default)==null?void 0:b[g])??""}),i("updateOtp",c.value.join(""))};h(),e.watch(()=>[s.totalInput,s.default],()=>h());const x=k=>{k<0||k>=m.value||e.nextTick(()=>{var g;return(g=l.value[k])==null?void 0:g.focus()})},C=k=>k.match(/[a-zA-Z0-9]/)?k.match(/[a-zA-Z0-9]/)[0]:"";async function y(k){var g;if(i("complete",k),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(k);i("success",b)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((g=s.endpoint)!=null&&g.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const b=(s.endpoint.apiMethod||"POST").toUpperCase(),M=s.endpoint.apiUrl,w=await u("","",{otp:k},{_url:M,_method:b,withCredentials:!0}),_=(w==null?void 0:w.data)??w;i("success",_)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const p=(k,g)=>{c.value[k]=C(g);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===m.value&&y(b)},S=(k,g)=>{const b=k.key,M=/^\d$/.test(b),w=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(k.preventDefault(),c.value[g]){p(g,"");return}g>0&&(p(g-1,""),x(g-1));return}if(b==="ArrowLeft"){k.preventDefault(),x(g-1);return}if(b==="ArrowRight"){k.preventDefault(),x(g+1);return}if(M||w){k.preventDefault(),p(g,b),g<m.value-1&&x(g+1);return}b.length===1&&k.preventDefault()},V=(k,g)=>{const b=k.target,M=b.value??"",w=C(M);b.value=w,p(g,w),w&&g<m.value-1&&x(g+1)},E=(k,g)=>{var B;k.preventDefault();const M=(((B=k.clipboardData)==null?void 0:B.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!M)return;let w=g;for(const D of M){if(w>=m.value)break;c.value[w]=D,w++}const _=c.value.join("");i("updateOtp",_),i("update:modelValue",_),_.length===m.value&&y(_),x(Math.min(w,m.value-1))},A=k=>g=>{l.value[k]=(g==null?void 0:g.$el)??g};return(k,g)=>(e.openBlock(),e.createElementBlock("div",a1,[s.label||m.value?(e.openBlock(),e.createElementBlock("div",s1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,i1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,l1)),e.createElementVNode("p",c1," Ketik "+e.toDisplayString(m.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",d1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:A(b-1),value:c.value[b-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:e.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",c.value[b-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"]),onKeydown:M=>S(M,b-1),onInput:M=>V(M,b-1),onPaste:M=>E(M,b-1)},null,42,u1))),128))])]))}}),f1={class:"w-full"},m1={key:0,class:"flex items-center justify-between mb-2"},h1={key:0,class:"text-sm font-medium text-gray-700"},p1={key:1,class:"text-sm text-gray-600"},g1={name:"DCodeProgress"},cd=e.defineComponent({...g1,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(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.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[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",f1,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",m1,[t.label?(e.openBlock(),e.createElementBlock("span",h1,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",p1,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),b1={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},dd=at(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",b1,[e.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:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),y1={key:0,class:"ml-1 text-destructive"},x1={class:"flex flex-col"},k1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},w1={class:"relative flex-shrink-0 mt-0.5"},C1=["id","name","value","checked","disabled","required","onChange"],B1=["onClick"],E1=["for"],_1={key:0,class:"ml-1 text-red-500"},S1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Es=e.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=Ke(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var E,A;const V=((E=a.endpoint)==null?void 0:E.apiUrl)||a.apiUrl;if(V){i.value=!0,l.value=null;try{const k={page:1,perPage:100},g=((A=a.endpoint)==null?void 0:A.apiMethod)||a.apiMethod,b=await o(V,g,k);let M=b;a.dataPath?M=a.dataPath.split(".").reduce((_,B)=>_&&_[B]!=="undefined"?_[B]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(M=b.data),Array.isArray(M)?s.value=M:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(k){console.error("DCodeRadio fetch error:",k),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var V;((V=a.endpoint)!=null&&V.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const V=a.itemValue||a.model||"id",E=a.itemTitle||(a.label===""?"name":a.label);return E&&a.label!==""?[{[V]:V,[E]:E}]:[]}),u=V=>{if(typeof V!="object")return V;const E=a.itemValue||a.model||"id";return V[E]},f=V=>{if(typeof V!="object")return String(V);const E=a.itemTitle||"name";return V[E]},m=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),h=e.computed(()=>!!a.error||!!l.value),x=e.computed(()=>a.error||l.value),C=V=>V==null?a.modelValue===V:String(a.modelValue)===String(V),y=e.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"}})[a.size]),p=(V,E)=>{if(a.disabled||a.readonly){E.preventDefault();return}E.target.checked&&(r("update:modelValue",V),r("change",V))},S=V=>{!a.disabled&&!a.readonly&&!C(V)&&(r("update:modelValue",V),r("change",V))};return(V,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-3",t.disabled||t.readonly?"cursor-not-allowed":""])},[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",y1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",x1,[i.value?(e.openBlock(),e.createElementBlock("div",k1,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),E[0]||(E[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(A,k)=>(e.openBlock(),e.createElementBlock("div",{key:k,class:e.normalizeClass(["flex items-start",y.value.container,t.disabled||t.readonly?"opacity-60 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",w1,[e.createElementVNode("input",{id:t.id?`${t.id}-${k}`:`${m.value}-${k}`,name:m.value,type:"radio",value:u(A),checked:C(u(A)),disabled:t.disabled||t.readonly,required:t.required&&k===0,onChange:g=>p(u(A),g),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,C1)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:g=>S(u(A))},[e.createElementVNode("label",{for:t.id?`${t.id}-${k}`:`${m.value}-${k}`,class:e.normalizeClass([y.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled||t.readonly?"cursor-not-allowed opacity-60":""])},[e.createTextVNode(e.toDisplayString(f(A))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",_1,"*")):e.createCommentVNode("",!0)],10,E1)],8,B1)],2))),128))],2),h.value&&x.value?(e.openBlock(),e.createElementBlock("div",S1,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)])],2))}}),A1={class:"grid gap-3"},V1={key:0,class:"ml-1 text-destructive"},D1={class:"flex flex-col"},N1={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},M1=["onClick"],P1=["id","name","value","checked","disabled","required","onChange"],T1={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},v1=["for"],O1={key:0,class:"ml-1 text-red-500"},F1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},_s=e.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:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=Ke(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,w=>{s.value=w},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=e.computed(()=>a.disabled||l.value||!!c.value),u=async()=>{var _,B;const w=((_=a.endpoint)==null?void 0:_.apiUrl)||a.apiUrl;if(w){l.value=!0,c.value=null;try{const D={page:1,perPage:100},N=((B=a.endpoint)==null?void 0:B.apiMethod)||a.apiMethod,O=await o(w,N,D);let v=O;a.dataPath?v=a.dataPath.split(".").reduce(($,U)=>$&&$[U]!=="undefined"?$[U]:void 0,O):typeof O=="object"&&!Array.isArray(O)&&O.data&&(v=O.data),Array.isArray(v)?i.value=v:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(D){console.error("DCodeRadioCustom fetch error:",D),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},f=e.ref(!1);let m=null;const h=()=>{typeof document<"u"&&(f.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var w;((w=a.endpoint)!=null&&w.apiUrl||a.apiUrl)&&u(),h(),typeof document<"u"&&(m=new MutationObserver(h),m.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),m.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{m&&m.disconnect()});const x=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const w=a.itemValue||a.model||"id",_=a.itemTitle||(a.label===""?"name":a.label);return _&&a.label!==""?[{[w]:w,[_]:_}]:[]}),C=w=>{if(typeof w!="object")return w;const _=a.itemValue||a.model||"id";return w[_]},y=w=>{if(typeof w!="object")return String(w);const _=a.itemTitle||"name";return w[_]},p=Math.random().toString(36).slice(2,7),S=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${p}`),V=e.computed(()=>!!a.error||!!c.value),E=e.computed(()=>a.error||c.value),A=w=>{const _=s.value;return w==null?_===w:String(_)===String(w)},k=e.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"}})[a.size]),g=w=>{const _=(w==null?void 0:w.icon)||a.icon;return bn(_,Vt)},b=(w,_)=>{_.target.checked&&(s.value=w,r("update:modelValue",w),r("change",w))},M=w=>{a.disabled||A(w)||(s.value=w,r("update:modelValue",w),r("change",w))};return(w,_)=>(e.openBlock(),e.createElementBlock("div",A1,[t.label?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",V1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",D1,[l.value?(e.openBlock(),e.createElementBlock("div",N1,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),_[0]||(_[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(B,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",A(C(B))?f.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":f.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:N=>!d.value&&M(C(B))},[e.createElementVNode("input",{id:t.id?`${t.id}-${D}`:`${S.value}-${D}`,name:S.value,type:"radio",value:C(B),checked:A(C(B)),disabled:d.value,required:t.required&&D===0,onChange:N=>b(C(B),N),class:"sr-only",tabindex:"-1"},null,40,P1),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",A(C(B))?f.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":f.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[g(B)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g(B)),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",T1,[..._[1]||(_[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${D}`:`${S.value}-${D}`,class:e.normalizeClass([k.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",A(C(B))?f.value?"text-primary-400":"text-primary-700":f.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(y(B))+" ",1),t.required&&x.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",O1,"*")):e.createCommentVNode("",!0)],10,v1)],10,M1))),128))],2),V.value&&E.value?(e.openBlock(),e.createElementBlock("div",F1,[e.createVNode(e.unref(te.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])]))}}),z1={key:0,class:"ml-1 text-destructive"},I1={class:"relative w-full"},R1={key:0,class:"mb-2 flex items-center justify-between"},L1={class:"text-sm text-muted-foreground"},$1={class:"text-sm font-medium text-foreground"},j1={class:"text-sm text-muted-foreground"},U1={class:"relative"},W1=["id","value","min","max","step","disabled","placeholder"],H1={key:1,class:"relative mt-2"},q1={class:"text-xs text-muted-foreground mt-1"},G1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},K1={name:"DCodeSlider"},Dr=e.defineComponent({...K1,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),f=e.computed(()=>{const A={sm:"h-2",md:"h-2.5",lg:"h-3"},k={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",A[a.size],k[a.color]||k.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),m=e.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),h=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),x=e.computed(()=>{const A=a.max-a.min;return(a.modelValue-a.min)/A*100}),C=A=>{const k=A.target,g=parseFloat(k.value);r("update:modelValue",g),r("input",g)},y=A=>{const k=A.target,g=parseFloat(k.value);r("change",g)},p=()=>{i.value=!0},S=()=>{i.value=!1},V=A=>{const k=a.max-a.min;return(A-a.min)/k*100},E=e.computed(()=>{const A={sm:16,md:20,lg:24};return`
|
|
67
67
|
input[type="range"]::-webkit-slider-thumb {
|
|
68
68
|
${m.value}
|
|
69
|
-
width: ${
|
|
70
|
-
height: ${
|
|
69
|
+
width: ${A[a.size]}px;
|
|
70
|
+
height: ${A[a.size]}px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
input[type="range"]::-moz-range-thumb {
|
|
74
74
|
${m.value}
|
|
75
|
-
width: ${
|
|
76
|
-
height: ${
|
|
75
|
+
width: ${A[a.size]}px;
|
|
76
|
+
height: ${A[a.size]}px;
|
|
77
77
|
border-width: 2px;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
input[type="range"]:focus::-moz-range-thumb {
|
|
93
93
|
transform: scale(1.1);
|
|
94
94
|
}
|
|
95
|
-
`});return(V,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(So),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",R1,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",I1,[t.showValue?(e.openBlock(),e.createElementBlock("div",L1,[e.createElementVNode("span",$1,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",j1,e.toDisplayString(h.value),1),e.createElementVNode("span",U1,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",W1,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${k.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(f.value),onInput:C,onChange:w,onMousedown:p,onMouseup:A,onTouchstart:p,onTouchend:A},null,42,H1)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,g=>(e.openBlock(),e.createElementBlock("div",{key:g.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${D(g.value)}%`,transform:"translateX(-50%)"})},[B[0]||(B[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",G1,e.toDisplayString(g.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",K1,[B[1]||(B[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.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)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(S.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),Y1={class:"grid gap-3"},J1={key:0,class:"ml-1 text-destructive"},Q1={class:"inline-flex items-center gap-3"},Z1=["id","name","aria-checked","aria-label","disabled"],eC={key:0,class:"absolute inset-0 flex items-center justify-center"},tC={class:"relative z-10 flex items-center gap-2"},nC=["id","name","aria-checked","aria-label","disabled"],oC={key:0,class:"absolute inset-0 flex items-center justify-center"},rC={name:"DCodeSwitch"},Nr=e.defineComponent({...rC,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(r("update:modelValue",f),r("change",f))}}),s=e.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=e.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(!a.value)return"bg-gray-200";switch(o.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=()=>{a.value=!a.value},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,m)=>(e.openBlock(),e.createElementBlock("div",Y1,[t.title?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",J1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",Q1,[e.createVNode(e.unref(Wi),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(ji),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(Hi),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",eC,[...m[0]||(m[0]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,Z1)]),_:1}),e.createVNode(e.unref(Ui),{side:"top","side-offset":8,class:e.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",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",tC,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",oC,[...m[1]||(m[1]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,nC))]),_:1})])]))}}),aC=["aria-busy"],sC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},iC=["for"],lC={key:0,class:"ml-1 text-destructive"},cC={class:"relative w-full group"},dC=["id","value"],uC={key:0,class:"absolute top-1 right-2"},fC={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"},mC={key:1,class:"text-xs text-destructive"},qn=e.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const X=o.required,O=o["aria-required"];return X===""||X===!0||X==="true"||(O==="true"||O===!0)}),u=e.computed(()=>{const{label:X,class:O,id:K,required:ee,"aria-required":he,...Ve}=o;return Ve}),f=e.computed(()=>{const X=o.maxlength;let O=Number.NaN;return typeof X=="number"?O=X:typeof X=="string"&&(O=Number.parseInt(X,10)),Number.isFinite(O)&&O>0?O:-1}),m=X=>f.value>0?X.slice(0,f.value):X,h=e.computed(()=>{const X=a.modelValue;return X==null||String(X).length===0}),k=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!h.value:!0:!1),C=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,X=>{const O=String(X??"");O!==C.value&&(C.value=O)});const w=e.ref(!1),p=e.ref(!1),A=X=>X.split(/(\s+)/).map(O=>{if(O.trim()==="")return O;const K=O.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}).join(""),D=X=>{const O=X.toLowerCase(),K=O.search(new RegExp("\\p{L}","u"));return K<0?O:O.slice(0,K)+O.charAt(K).toUpperCase()+O.slice(K+1)},S=X=>{switch(a.textCase){case"uppercase":return X.toUpperCase();case"lowercase":return X.toLowerCase();case"titlecase":return A(X);case"sentencecase":return D(X);case"none":default:return X}},V=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=X=>{if(!X)return null;const O=Array.isArray(X)?X.join(""):X;return O?new Set(O):null},g=e.computed(()=>B(a.allowChars)),b=(X,O)=>(X.lastIndex=0,X.test(O)),_=X=>{if(X===`
|
|
96
|
-
`)return a.valueType!=="number";if(a.valueType==="free")return!0;const
|
|
97
|
-
`,""),K=Number(O);return Number.isFinite(K)?K:null}return X},T=X=>{C.value=X,r("update:modelValue",M(X))},$=(X,O)=>{const K=m(O);p.value=!0,X.value=K,T(K),queueMicrotask(()=>p.value=!1)},v=(X,O)=>{const K=X.selectionStart??X.value.length,ee=X.selectionEnd??X.value.length;if(f.value>0){const he=X.value.length-(ee-K),Ve=f.value-he;if(Ve<=0)return;O=O.slice(0,Ve)}X.setRangeText(O,K,ee,"end"),$(X,x(X.value))},I=X=>{var ee;if(!E||w.value||p.value||!((ee=X.inputType)!=null&&ee.startsWith("insert")))return;const O=X.data;if(O==null)return;const K=x(O);K!==O&&(X.preventDefault(),K.length>0&&v(E,K))},j=X=>{var ee;if(!E||w.value||p.value)return;const O=((ee=X.clipboardData)==null?void 0:ee.getData("text"))??"",K=x(O);K!==O&&(X.preventDefault(),K.length>0&&v(E,K))},U=async X=>{if(!E||w.value||p.value)return;const O=X.target,K=O.value??"",ee=x(K);if(ee===K){const he=O.selectionStart??ee.length,Ve=O.selectionEnd??ee.length;$(O,ee),await e.nextTick();try{O.setSelectionRange(he,Ve)}catch{}T(ee)}else{const he=O.selectionStart??ee.length,Ve=O.selectionEnd??ee.length;$(O,ee),await e.nextTick();try{O.setSelectionRange(he,Ve)}catch{}}},P=()=>w.value=!0,R=()=>{if(w.value=!1,!E)return;const X=E.value??"",O=x(X);O===X?T(O):$(E,O)};e.onMounted(()=>{if(E=document.getElementById(c.value),!E)return;E.addEventListener("beforeinput",I),E.addEventListener("paste",j),E.addEventListener("input",U),E.addEventListener("compositionstart",P),E.addEventListener("compositionend",R);const X=E.value??"",O=x(X);O===X?T(O):$(E,O)}),e.onBeforeUnmount(()=>{E&&(E.removeEventListener("beforeinput",I),E.removeEventListener("paste",j),E.removeEventListener("input",U),E.removeEventListener("compositionstart",P),E.removeEventListener("compositionend",R),E=null)});const G=()=>{C.value="",E&&(E.value=""),r("update:modelValue",null),r("clear")},q=e.computed(()=>C.value.length),W=e.computed(()=>a.showCharCount?f.value>0:!1),Z=e.computed(()=>W.value&&q.value>0),ne=e.computed(()=>`${q.value} / ${f.value}`),ue=e.computed(()=>!!a.error),ke=e.computed(()=>{const X=o.rows,O=typeof X=="number"?X:Number.parseInt(String(X??""),10);return Number.isFinite(O)&&O>0?O:3}),me=e.computed(()=>({height:`${ke.value*24+16}px`}));return(X,O)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",sC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(me.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",lC,"*")):e.createCommentVNode("",!0)],8,iC)):e.createCommentVNode("",!0),e.createElementVNode("div",cC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:C.value},u.value,{style:`text-transform: ${V.value}; padding-right: ${k.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",ue.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,dC),k.value?(e.openBlock(),e.createElementBlock("div",uC,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:G}," ✕ ")])):e.createCommentVNode("",!0),Z.value&&!ue.value?(e.openBlock(),e.createElementBlock("p",fC,e.toDisplayString(ne.value),1)):e.createCommentVNode("",!0)]),ue.value?(e.openBlock(),e.createElementBlock("p",mC,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,aC)),[[e.vShow,i.value]])}}),ud=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.AvatarRoot),{class:e.normalizeClass(e.unref(_e)(e.unref(hC)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),fd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),md=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),hC=Ho("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"}}}),Mr=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.Separator),e.mergeProps(e.unref(o),{class:e.unref(_e)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),pC={class:"bg-card text-card-foreground"},gC={class:"pb-6 px-3"},bC={key:0,class:"flex justify-center p-8"},yC={key:1,class:"p-8 text-center text-red-500"},xC={key:2,class:"relative"},kC={class:"space-y-6"},wC={class:"rounded-xl border bg-card text-card-foreground shadow"},CC={class:"p-4"},BC={class:"flex items-center justify-between gap-3"},EC={class:"font-medium"},_C={class:"text-xs text-muted-foreground"},SC={class:"mt-1 text-sm text-muted-foreground"},AC={class:"text-foreground"},VC={class:"text-foreground"},DC={class:"mt-1 text-xs text-muted-foreground"},NC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},MC={class:"flex items-center justify-between gap-3"},PC={class:"font-medium"},TC={class:"text-xs text-muted-foreground"},vC={class:"mt-2 text-sm text-muted-foreground"},OC={class:"flex flex-wrap items-center justify-between gap-3"},FC={class:"flex items-center gap-3"},zC={class:"leading-tight"},RC={class:"text-sm font-medium"},IC={class:"text-xs text-muted-foreground"},LC={class:"flex items-center gap-2"},$C={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},jC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},UC=["src"],WC={class:"flex-1"},HC={class:"flex items-center justify-between gap-3"},qC={class:"font-medium"},GC={class:"text-xs text-muted-foreground"},KC={class:"mt-1 text-sm text-muted-foreground"},XC={class:"text-left sm:text-center"},YC={class:"text-xs text-muted-foreground"},JC={class:"text-left sm:text-center"},QC={class:"text-xs text-muted-foreground"},ZC={class:"text-left sm:text-center"},eB={class:"text-xs text-muted-foreground"},tB={class:"flex items-center justify-between gap-3"},nB={class:"font-medium"},oB={class:"text-xs text-muted-foreground"},rB={class:"mt-2 text-sm text-muted-foreground"},aB={class:"mt-3 flex items-center gap-3"},sB={class:"text-sm font-medium"},iB={class:"flex items-start justify-between gap-3"},lB={class:"font-medium"},cB={class:"mt-3 grid gap-2 text-sm"},dB={class:"flex items-center justify-between gap-3"},uB={class:"flex items-center gap-2 text-muted-foreground"},fB={class:"font-medium"},mB={class:"flex items-center justify-between gap-3"},hB={class:"flex items-center gap-2 text-muted-foreground"},pB={class:"font-medium"},gB={class:"flex items-center justify-between gap-3"},bB={class:"flex items-center gap-2 text-muted-foreground"},yB={class:"font-medium"},xB={class:"flex items-center justify-between"},kB={class:"flex items-center gap-2"},wB={class:"flex items-start justify-between gap-3"},CB={class:"flex items-center gap-2"},BB={class:"font-medium"},EB={class:"mt-2 text-sm text-muted-foreground"},_B={key:0,class:"mt-1 text-sm text-muted-foreground"},SB={class:"flex flex-wrap items-center justify-between gap-3"},AB={class:"flex items-center gap-2"},VB={class:"text-xs text-muted-foreground"},hd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=We.useBreakpoints(We.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const f=await fetch(r.apiUrl,{method:r.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const m=await f.json();Array.isArray(m)?i.value=m:m.data&&Array.isArray(m.data)?i.value=m.data:m.items&&Array.isArray(m.items)?i.value=m.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:te.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:te.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:te.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:te.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:te.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:te.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:te.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(m=>{var h;return(h=m[0])==null?void 0:h.toUpperCase()}).join("");return(f,m)=>{const h=e.resolveComponent("ShoppingCart"),k=e.resolveComponent("DCodeBadge"),C=e.resolveComponent("RefreshCcw"),w=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",pC,[m[8]||(m[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",gC,[a.value?(e.openBlock(),e.createElementBlock("div",bC,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",yC,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",xC,[m[7]||(m[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",kC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,A)=>(e.openBlock(),e.createElementBlock("div",{key:A,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",wC,[e.createElementVNode("div",CC,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",BC,[e.createElementVNode("p",EC,e.toDisplayString(p.title),1),e.createElementVNode("p",_C,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",SC,[e.createElementVNode("span",AC,e.toDisplayString(p.from),1),e.createVNode(e.unref(te.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",VC,e.toDisplayString(p.to),1)]),e.createElementVNode("p",DC,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",NC,[e.createVNode(e.unref(te.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(p.fileName),1)])):e.createCommentVNode("",!0)],64)):p.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",MC,[e.createElementVNode("p",PC,e.toDisplayString(p.title),1),e.createElementVNode("p",TC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",vC,e.toDisplayString(p.desc),1),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",OC,[e.createElementVNode("div",FC,[e.createVNode(e.unref(ud),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(md),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(fd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",zC,[e.createElementVNode("p",RC,e.toDisplayString(p.personName),1),e.createElementVNode("p",IC,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",LC,[e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",$C,[e.createElementVNode("div",jC,[p.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,UC)):(e.openBlock(),e.createBlock(h,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",WC,[e.createElementVNode("div",HC,[e.createElementVNode("p",qC,e.toDisplayString(p.title),1),e.createElementVNode("p",GC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",KC,e.toDisplayString(p.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",XC,[m[1]||(m[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",YC,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",JC,[m[2]||(m[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",QC,e.toDisplayString(p.price),1)]),e.createElementVNode("div",ZC,[m[3]||(m[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",eB,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",tB,[e.createElementVNode("p",nB,e.toDisplayString(p.title),1),e.createElementVNode("p",oB,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",rB,e.toDisplayString(p.desc),1),e.createElementVNode("div",aB,[e.createVNode(e.unref(ud),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(md),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(fd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",sB,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",iB,[e.createElementVNode("p",lB,e.toDisplayString(p.title),1),e.createVNode(k,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",cB,[e.createElementVNode("div",dB,[e.createElementVNode("div",uB,[e.createVNode(e.unref(te.Globe),{class:"h-4 w-4"}),m[4]||(m[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",fB,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",mB,[e.createElementVNode("div",hB,[e.createVNode(e.unref(te.Cpu),{class:"h-4 w-4"}),m[5]||(m[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",pB,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",gB,[e.createElementVNode("div",bB,[e.createVNode(e.unref(te.CpuIcon),{class:"h-4 w-4"}),m[6]||(m[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",yB,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",xB,[e.createElementVNode("div",kB,[e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(C,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",wB,[e.createElementVNode("div",CB,[e.createVNode(w,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",BB,e.toDisplayString(p.title),1)]),e.createVNode(k,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",EB,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",_B,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",SB,[e.createElementVNode("div",AB,[e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(_t),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",VB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),DB={class:"dcode-upload-file"},NB={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"},MB={key:0,class:"text-xs text-gray-500 mt-1"},PB=["accept"],TB={key:1,class:"text-xs text-red-600 mt-1"},pd=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",DB,[t.label?(e.openBlock(),e.createBlock(Dn,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",NB,[e.createVNode(e.unref(te.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",MB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,PB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",TB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),vB=["onClick"],OB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},FB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},zB={key:1},RB={key:0,class:"text-white"},IB={key:1},LB={key:2},$B=["disabled","onClick"],jB={key:1,class:"mr-2 text-sm font-bold opacity-70"},UB={class:"whitespace-normal text-sm text-center leading-tight"},WB={class:"flex flex-col flex-1 min-w-0"},HB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},qB={class:"text-sm text-muted-foreground"},GB={class:"px-1"},KB=["disabled"],XB=["type"],YB=["disabled"],Ss=at(e.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}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:n}){const o=t,r=n,a=Ke(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var g;if(typeof o.modelValue=="string"){const b=(g=o.tabs)==null?void 0:g.findIndex(_=>_.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(g){var b;if(i.value=g,typeof o.modelValue=="string"){const _=(b=o.tabs)==null?void 0:b[g];_?r("update:modelValue",_.key):r("update:modelValue",g)}else r("update:modelValue",g)}}),c=e.computed(()=>{var g;return((g=o.tabs)==null?void 0:g.length)??0}),d=e.computed(()=>{var g;return(g=o.tabs)==null?void 0:g[l.value]});function u(g){return c.value<=0?0:Math.min(Math.max(g,0),c.value-1)}function f(g){return g?typeof g=="string"?bn(g,At):g:null}const m=e.reactive({});function h(g){return m[g.key]||(m[g.key]={loaded:!1,loading:!1,data:null,error:null}),m[g.key]}function k(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function C(g){const b=g.endpoint||{};return{apiModule:g.apiModule||b.apiModule,apiAction:g.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:g.apiParams}}function w(g){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[g];return!(!b||b.disabled)}async function p(g){if(typeof g.tab.fetchData=="function"){const T=await g.tab.fetchData(),$=(T==null?void 0:T.data)??T;return($==null?void 0:$.data)??$}const b=C(g.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const y=k();let x;if(b.apiUrl)x=await s("","",y,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const T={...y,...b.apiParams};x=await s(b.apiModule,b.apiAction,T)}const E=(x==null?void 0:x.data)??x;return(E==null?void 0:E.data)??E}async function A(g,{force:b=!1}={}){const _=u(g),y=o.tabs[_];if(!y)return;const x=h(y);if(!(o.cache&&x.loaded&&!b)&&!x.loading){x.loading=!0,x.error=null;try{const E=await p({tabIndex:_,tab:y});x.data=E,x.loaded=!0,r("loaded",{tabIndex:_,tab:y,data:E})}catch(E){const M=typeof(E==null?void 0:E.message)=="string"&&E.message||typeof E=="string"&&E||"Failed to load tab data.";x.error=M,r("error",{tabIndex:_,tab:y,message:M})}finally{x.loading=!1}}}function D(g){const b=u(g);w(b)&&b!==l.value&&(l.value=b)}function S(g=l.value){return A(g,{force:!0})}function V(){const g=u(l.value-1);g!==l.value&&(l.value=g)}function B(){const g=u(l.value+1);g!==l.value&&(l.value=g)}return e.watch(()=>o.tabs,g=>{for(const b of g??[])h(b)},{immediate:!0}),e.watch(()=>l.value,async g=>{var _;const b=(_=o.tabs)==null?void 0:_[g];b&&r("change",{tabIndex:g,tab:b}),await A(g)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async g=>{g&&await A(l.value)},{immediate:!0}),(g,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(_,y)=>(e.openBlock(),e.createElementBlock("div",{key:_.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[y<l.value?"border-[#2563eb] bg-[#2563eb] text-white dark:border-[#1e3a8a] dark:bg-[#1e3a8a]":y===l.value?"border-[#2563eb] text-[#2563eb] shadow-[0_0_0_2px_rgba(37,99,235,0.2)] dark:border-[#1e3a8a] dark:text-[#3b82f6] dark:shadow-[0_0_0_2px_rgba(30,58,138,0.2)]":"border-[#e2e8f0] text-[#94a3b8] dark:border-[#3f3f46] dark:text-[#71717a]"]])},[t.typeWizard==="icon"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!_.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",zB,[y<l.value?(e.openBlock(),e.createElementBlock("span",RB,"✓")):(e.openBlock(),e.createElementBlock("span",IB,e.toDisplayString(y+1),1))])):(e.openBlock(),e.createElementBlock("span",LB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",y===l.value?"text-[#2563eb] dark:text-[#3b82f6]":"text-[#64748b] dark:text-[#a1a1aa]"])},e.toDisplayString(_.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(_,y)=>(e.openBlock(),e.createElementBlock("div",{key:_.key,onClick:x=>D(y),style:e.normalizeStyle({zIndex:t.tabs.length-y}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[y>0?"pl-8":"",y===l.value?"bg-[#2563eb] text-white dark:bg-[#1e3a8a]":y<l.value?"bg-[#eff6ff] text-[#2563eb] hover:bg-[#dbeafe] dark:bg-[#191d2c] dark:text-[#3b82f6] dark:hover:bg-[#1e263d]":"bg-[#f8fafc] text-[#64748b] hover:bg-[#f1f5f9] hover:text-[#334155] dark:bg-[#18181b] dark:text-[#a1a1aa] dark:hover:bg-[#27272a] dark:hover:text-[#d4d4d8]"]])},[t.typeWizard==="icon"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",OB,e.toDisplayString(y+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",FB,e.toDisplayString(_.title),1)],2),y<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[y===l.value?"fill-[#2563eb] text-[#2563eb] dark:fill-[#1e3a8a] dark:text-[#1e3a8a]":y<l.value?"fill-[#eff6ff] text-[#eff6ff] group-hover:fill-[#dbeafe] group-hover:text-[#dbeafe] dark:fill-[#191d2c] dark:text-[#191d2c] dark:group-hover:fill-[#1e263d] dark:group-hover:text-[#1e263d]":"fill-[#f8fafc] text-[#f8fafc] group-hover:fill-[#f1f5f9] group-hover:text-[#f1f5f9] dark:fill-[#18181b] dark:text-[#18181b] dark:group-hover:fill-[#27272a] dark:group-hover:text-[#27272a]"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,vB))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(_,y)=>(e.openBlock(),e.createElementBlock("button",{key:_.key,type:"button",disabled:!w(y),onClick:x=>D(y),class:e.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-[#e2e8f0] dark:border-[#3f3f46]",e.unref(_e)("border-b border-r",!t.isVertical&&y===t.tabs.length-1&&"border-r-0",y===l.value?"bg-[#2563eb]/[0.08] text-[#2563eb] font-semibold dark:bg-[#191d2c] dark:text-[#3b82f6]":"bg-transparent text-[#64748b] hover:bg-[#f1f5f9] hover:text-[#334155] dark:text-[#a1a1aa] dark:hover:bg-[#27272a] dark:hover:text-[#f4f4f5]",!w(y)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&_.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(_.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",jB,e.toDisplayString(y+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",UB,e.toDisplayString(_.title),1)],10,$B))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Mr),{key:0})),e.createElementVNode("div",WB,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var _,y,x,E;return[(e.openBlock(),e.createElementBlock("div",{key:((_=d.value)==null?void 0:_.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(y=m[d.value.key])!=null&&y.loading?e.renderSlot(g.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",HB,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(g.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(x=m[d.value.key])==null?void 0:x.data,loaded:(E=m[d.value.key])==null?void 0:E.loaded,reload:S},()=>[e.createElementVNode("div",qB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",GB,"tab-"+e.toDisplayString(d.value.key),1),b[3]||(b[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:V,disabled:l.value<=0,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-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,KB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:B,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,XB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#1e3a8a] dark:hover:bg-[#1e40af] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(te.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,YB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-3330e7b3"]]),JB={class:"permission-menu w-full space-y-4"},QB={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"},ZB={class:"flex items-center justify-between"},eE={class:"flex items-center gap-3 flex-1"},tE=["onClick"],nE={key:1,class:"w-7"},oE={key:2,class:"flex-shrink-0"},rE={class:"text-lg font-semibold flex-1"},aE={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},sE={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},iE={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},lE=["checked","disabled","onChange"],cE={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},dE={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},uE={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},fE={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"},mE={class:"flex items-center justify-between"},hE={class:"flex items-center gap-3 flex-1"},pE={key:0,class:"flex-shrink-0"},gE={class:"text-base font-semibold flex-1"},bE={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},yE={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},xE=["checked","onChange"],kE={class:"text-xs font-medium"},wE={key:0,class:"p-3"},CE={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},BE=["checked","disabled","onChange"],EE={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},As=at(e.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(t,{expose:n,emit:o}){const{t:r}=gt.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(y=!0)=>{(E=>{E.forEach(M=>{M.permission.forEach(T=>{const $=`${M.id}-${T.id}-parent`,v=T.code==="VIEW"||T.name.toUpperCase()==="VIEW";l.value.has($)||l.value.set($,v||(y?M.checked??!1:!1))}),M.detail&&M.detail.length>0&&M.detail.forEach(T=>{T.permission.forEach($=>{const v=`${T.id}-${$.id}-child`,I=$.code==="VIEW"||$.name.toUpperCase()==="VIEW";l.value.has(v)||l.value.set(v,I||(y?T.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(y=>{const x=y.menuId,E=y.actionsIds;i.value.forEach(M=>{M.id===x&&E.forEach(T=>{const $=`${x}-${T}-parent`;l.value.set($,!0)}),M.detail&&M.detail.length>0&&M.detail.forEach(T=>{T.id===x&&E.forEach($=>{const v=`${x}-${$}-child`;l.value.set(v,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(y,x)=>{x===0&&y>0&&u()});const f=y=>y.detail&&y.detail.length>0,m=y=>{c.value.has(y)?c.value.delete(y):c.value.add(y)},h=y=>c.value.has(y),k=(y,x,E=!1)=>{const M=`${y}-${x}-${E?"child":"parent"}`;return l.value.get(M)??!1},C=()=>{const y=B();s("update:modelValue",y.permissions)},w=(y,x,E,M=!1)=>{const T=E.target.checked,$=`${y}-${x}-${M?"child":"parent"}`;l.value.set($,T),s("permission-change",y,x,T,!M),C()},p=y=>y.permission.filter(A),A=y=>y.code==="VIEW"||y.name.toUpperCase()==="VIEW",D=(y,x,E)=>{const M=E.target.checked;x.permission.forEach(T=>{if(A(T)){const v=`${x.id}-${T.id}-child`;l.value.set(v,!0);return}const $=`${x.id}-${T.id}-child`;l.value.set($,M)}),l.value=new Map(l.value),s("menu-check",x.id,M),C()},S=(y,x=!1)=>{const E=x?y.permission:p(y);return!E||E.length===0?!1:E.every(M=>{const T=`${y.id}-${M.id}-${x?"child":"parent"}`;return l.value.get(T)??!1})},V=()=>{const y={};return i.value.forEach(x=>{var E;y[x.id]={name:x.name,parentPermissions:x.permission.map(M=>({id:M.id,name:M.name,checked:k(x.id,M.id,!1)})),children:((E=x.detail)==null?void 0:E.map(M=>({id:M.id,name:M.name,permissions:M.permission.map(T=>({id:T.id,name:T.name,checked:k(M.id,T.id,!0)}))})))||[]}}),y},B=()=>{const y=[],x=(E,M=!1)=>{const T=[];E.permission.forEach($=>{const v=`${E.id}-${$.id}-${M?"child":"parent"}`;(l.value.get(v)??!1)&&T.push($.id)}),T.length>0&&y.push({menuId:E.id,actionsIds:T})};return i.value.forEach(E=>{x(E,!1),E.detail&&E.detail.length>0&&E.detail.forEach(M=>{x(M,!0)})}),{permissions:y}};return n({getCurrentStates:V,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const y=[],x=(E,M=!1)=>{const T=E.permission.map(v=>{const I=`${E.id}-${v.id}-${M?"child":"parent"}`,j=l.value.get(I)??!1;return{id:v.id,name:v.name,checked:j}}),$=T.filter(v=>v.checked).map(v=>v.id);y.push({menuId:E.id,menuName:E.name,actionsIds:$,actions:T})};return i.value.forEach(E=>{x(E,!1),E.detail&&E.detail.length>0&&E.detail.forEach(M=>{x(M,!0)})}),{permissions:y}},permissionStates:l,expandAll:()=>{i.value.forEach(y=>{f(y)&&c.value.add(y.id)})},collapseAll:()=>{c.value.clear()}}),(y,x)=>(e.openBlock(),e.createElementBlock("div",JB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,E=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(E)}])},[e.createElementVNode("div",QB,[e.createElementVNode("div",ZB,[e.createElementVNode("div",eE,[f(E)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:M=>m(E.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[h(E.id)?(e.openBlock(),e.createBlock(e.unref(te.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(te.ChevronRight),{key:1,class:"w-5 h-5"}))],8,tE)):(e.openBlock(),e.createElementBlock("div",nE)),t.showIcons&&E.icon?(e.openBlock(),e.createElementBlock("span",oE,[e.createElementVNode("i",{class:e.normalizeClass([E.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",rE,e.toDisplayString(E.name),1)])])]),E.permission&&E.permission.length>0&&!f(E)?(e.openBlock(),e.createElementBlock("div",aE,[e.createElementVNode("h4",sE,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",iE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(E),M=>(e.openBlock(),e.createElementBlock("label",{key:M.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"},[e.createElementVNode("input",{type:"checkbox",checked:A(M)||k(E.id,M.id,!1),disabled:A(M),onChange:T=>w(E.id,M.id,T,!1),class:e.normalizeClass(["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",A(M)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,lE),e.createElementVNode("span",cE,e.toDisplayString(M.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[f(E)&&h(E.id)?(e.openBlock(),e.createElementBlock("div",dE,[e.createElementVNode("h4",uE,[x[0]||(x[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.detail,M=>(e.openBlock(),e.createElementBlock("div",{key:M.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"},[e.createElementVNode("div",fE,[e.createElementVNode("div",mE,[e.createElementVNode("div",hE,[t.showIcons&&M.icon?(e.openBlock(),e.createElementBlock("span",pE,[e.createElementVNode("i",{class:e.normalizeClass([M.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",gE,e.toDisplayString(M.name),1),M.path?(e.openBlock(),e.createElementBlock("span",bE,e.toDisplayString(M.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",yE,[e.createElementVNode("input",{type:"checkbox",checked:S(M,!0),onChange:T=>D(E,M,T),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,xE),e.createElementVNode("span",kE,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),M.permission&&M.permission.length>0?(e.openBlock(),e.createElementBlock("div",wE,[e.createElementVNode("div",CE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.permission,T=>(e.openBlock(),e.createElementBlock("label",{key:T.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"},[e.createElementVNode("input",{type:"checkbox",checked:A(T)||k(M.id,T.id,!0),disabled:A(T),onChange:$=>w(M.id,T.id,$,!0),class:e.normalizeClass(["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",A(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,BE),e.createElementVNode("span",EE,e.toDisplayString(T.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),_E={class:"space-y-4"},SE={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},AE={key:0,class:"text-danger-500"},VE={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},DE={class:"text-neutral-600 dark:text-neutral-400"},NE={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},ME={class:"text-neutral-500 dark:text-neutral-400"},PE={key:3,class:"space-y-3"},TE={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},vE={class:"flex items-center gap-3"},OE={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},FE={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},zE={class:"flex items-center gap-2 text-sm font-medium"},RE={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},IE={class:"p-4"},LE={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},$E={class:"ml-2 flex-1 min-w-0"},jE=["for"],UE={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},WE={key:4,class:"mt-1 text-xs text-danger-600"},Vs=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=gt.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=p=>{if(console.log(p),!p)return[];if(Array.isArray(p)&&p.length>0&&p[0].module&&Array.isArray(p[0].permissions))return p.map(A=>({menuId:A.menuId,module:A.module,label:A.label||A.module,permissions:A.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const A={};return p.forEach(D=>{const S=D.key,V=S&&S.includes(".")?S.split(".")[0]:"other";A[V]||(A[V]={menuId:0,module:V,label:V,permissions:[]}),A[V].permissions.push({id:D.id,key:D.key,label:D.label,description:D.description})}),Object.values(A)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const A=[],D=(S,V="")=>{const B=V?`${V}.${S.name}`:S.name,g=B.toLowerCase().replace(/\s+/g,"_"),b=[];if(S.detail&&Array.isArray(S.detail)&&S.detail.forEach(_=>{b.push(_.id)}),S.permission&&S.permission.length>0){const _=S.permission.map(y=>({id:y.id,key:`${g}.${y.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${y.name} ${S.name}`,description:`Permission to ${y.name.toLowerCase()} ${S.name.toLowerCase()}`}));A.push({menuId:S.id,module:g,label:S.name,permissions:_,subMenuIds:b.length>0?b:void 0})}S.detail&&Array.isArray(S.detail)&&S.detail.forEach(_=>{D(_,B)})};return p.forEach(S=>D(S)),A}return p.data?u(p.data):[]},f=async()=>{s.value=!0;try{let p;o.treeData&&o.treeData.length>0?p=o.treeData:p=[];const A=u(p);i.value=A;const D={},S=[],V={};A.forEach(g=>{g.permissions.forEach(b=>{const _=typeof b.id=="string"?parseInt(b.id):b.id;V[_]=g.menuId})});const B=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(g=>{S.push(g.menuId),g.actionsIds&&Array.isArray(g.actionsIds)&&g.actionsIds.forEach(b=>B.add(b))}),A.forEach(g=>g.permissions.forEach(b=>{const _=typeof b.id=="string"?parseInt(b.id):b.id;D[_]=B.has(_)})),l.value=D,c.value=S,d.value=V}catch{i.value=[]}finally{s.value=!1}},m=p=>p.permissions.filter(A=>{const D=typeof A.id=="string"?parseInt(A.id):A.id;return l.value[D]}).length,h=p=>p.permissions.every(A=>{const D=typeof A.id=="string"?parseInt(A.id):A.id;return l.value[D]}),k=p=>{const A=m(p);return A>0&&A<p.permissions.length},C=e.ref(!1),w=(p,A)=>{C.value=!0,p.permissions.map(V=>typeof V.id=="string"?parseInt(V.id):V.id),p.permissions.forEach(V=>{const B=typeof V.id=="string"?parseInt(V.id):V.id;l.value[B]=A});let D=o.modelValue?[...o.modelValue]:[],S=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(S=[...S,...p.subMenuIds],p.subMenuIds.forEach(V=>{const B=i.value.find(g=>g.menuId===V);B&&B.permissions.forEach(g=>{const b=typeof g.id=="string"?parseInt(g.id):g.id;l.value[b]=A})})),A?S.forEach(V=>{const B=i.value.find(g=>g.menuId===V);if(B){const g=B.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),b=D.findIndex(_=>_.menuId===V);b!==-1?D[b]={menuId:V,actionsIds:g}:D.push({menuId:V,actionsIds:g})}}):D=D.filter(V=>!S.includes(V.menuId)),c.value=D.map(V=>V.menuId),console.log("Full Result:",JSON.stringify(D,null,2)),r("update:modelValue",D),setTimeout(()=>{C.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const A=new Set,D=[];p.forEach(S=>{D.push(S.menuId),S.actionsIds&&Array.isArray(S.actionsIds)&&S.actionsIds.forEach(V=>A.add(V))}),Object.keys(l.value).forEach(S=>{const V=parseInt(S);l.value[V]=A.has(V)}),c.value=D}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,A)=>{if(C.value)return;if(Object.keys(p).map(S=>parseInt(S)).filter(S=>p[S]!==(A==null?void 0:A[S])).length>0){let S=o.modelValue?[...o.modelValue]:[];const V={};Object.keys(p).forEach(B=>{const g=parseInt(B);if(p[g]){const b=d.value[g];console.log(`Permission ${g} belongs to Menu ${b}`),b!==void 0&&(V[b]||(V[b]=[]),V[b].push(g))}}),Object.keys(V).forEach(B=>{const g=parseInt(B),b=V[g],_=S.findIndex(y=>y.menuId===g);_!==-1?S[_]={menuId:g,actionsIds:b}:S.push({menuId:g,actionsIds:b})}),S=S.filter(B=>V[B.menuId]&&V[B.menuId].length>0),c.value=S.map(B=>B.menuId),console.log("Result:",JSON.stringify(S,null,2)),r("update:modelValue",S)}},{deep:!0}),e.onMounted(f),(p,A)=>(e.openBlock(),e.createElementBlock("div",_E,[t.label?(e.openBlock(),e.createElementBlock("label",SE,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",AE,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",VE,[e.createVNode(e.unref(te.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",DE,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",NE,[e.createElementVNode("p",ME,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",PE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,D=>(e.openBlock(),e.createElementBlock("div",{key:D.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"},[e.createElementVNode("div",TE,[e.createElementVNode("div",vE,[e.createVNode(Yt,{modelValue:h(D),indeterminate:k(D),"onUpdate:modelValue":S=>w(D,!!S),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",OE,e.toDisplayString(D.label||D.module),1),e.createElementVNode("div",FE,e.toDisplayString(m(D))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(D.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",zE,[e.createElementVNode("div",RE,e.toDisplayString(m(D))+"/"+e.toDisplayString(D.permissions.length),1)])]),e.createElementVNode("div",IE,[e.createElementVNode("div",LE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.permissions,S=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(Yt,{modelValue:l.value[typeof S.id=="string"?parseInt(S.id):S.id],"onUpdate:modelValue":V=>l.value[typeof S.id=="string"?parseInt(S.id):S.id]=V,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",$E,[e.createElementVNode("label",{for:`perm-${S.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(S.label||S.key),9,jE),S.description?(e.openBlock(),e.createElementBlock("p",UE,e.toDisplayString(S.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",WE,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),HE={key:0,class:"fixed inset-0 z-[100] flex justify-end"},qE={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"},GE={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},KE={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},XE={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},YE={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},JE={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},QE=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(Le,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",HE,[e.createVNode(e.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:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.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:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",qE,[e.createElementVNode("div",GE,[e.createElementVNode("div",null,[e.createElementVNode("h3",KE,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",XE,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Le,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",YE,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",JE,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),ZE={key:0},e_=["value","name"],gd=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=gt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:Fn,DCodeAutoComplete:Lo,DCodeDatePicker:_r,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:Yt,DCodeSwitch:Nr,DCodeOtpInput:Vr,DCodeImageField:Ar,DCodeSlider:Dr},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(f.required=u.required),u.disabled!==void 0&&(f.disabled=u.disabled),u.readonly!==void 0&&(f.readonly=u.readonly),u.valueType&&(f.type=u.valueType),u.minLength!==void 0&&(f.minlength=u.minLength),u.maxLength!==void 0&&(f.maxlength=u.maxLength),u.min!==void 0&&(f.min=u.min),u.max!==void 0&&(f.max=u.max),u.options&&(f.options=u.options),u.endpoint&&(f.endpoint=u.endpoint),u.itemTitle&&(f.itemTitle=u.itemTitle),u.itemValue&&(f.itemValue=u.itemValue),u.returnObject!==void 0&&(f.returnObject=u.returnObject),u.clearable!==void 0&&(f.clearable=u.clearable),Object.keys(u).forEach(m=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(m)&&!f.hasOwnProperty(m)&&(f[m]=u[m])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",ZE,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,e_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=m=>s.value=m),d]}),null,16,["modelValue"]))}}),t_=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=We.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(_e)("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",o.class))},null,2)),[[e.vModelText,e.unref(a)]])}}),n_=e.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(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),o_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(_e)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),r_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(_e)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(te.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),a_=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(_e)(e.unref(On)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),s_=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(_e)(e.unref(On)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),i_=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(_e)(e.unref(On)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),l_=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(_e)(e.unref(On)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),c_=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(_e)(e.unref(On)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),d_=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const o=t,r=n,a=fe.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),u_=e.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},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:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=fe.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(fe.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("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",t.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",o.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(p_)),e.createVNode(e.unref(fe.SelectViewport),{class:e.normalizeClass(e.unref(_e)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(h_))]),_:3},16,["class"])]),_:3}))}}),f_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},m_=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(_e)("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",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",f_,[e.createVNode(e.unref(fe.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(te.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(fe.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),h_=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(_e)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronDown))])]),_:3},16,["class"]))}}),p_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(_e)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronUp))])]),_:3},16,["class"]))}}),g_=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=fe.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(_e)("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",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(fe.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),b_=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(fe.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Ao={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Gn={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},st={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},y_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},x_={dangerouslyHTMLString:!1,multiple:!0,position:Ao.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},k_={rtl:!1,newestOnTop:!1,toastClassName:""},bd={...x_,...k_};st.DEFAULT;var Ae=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(Ae||{}),Ds=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(Ds||{});const w_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},C_={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},B_={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},E_={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},yd="Toastify--animate Toastify__none-enter";function xd(t,n=!1){var o;let r=w_;if(!t||typeof t=="string")switch(t){case"flip":r=E_;break;case"zoom":r=B_;break;case"slide":r=C_;break}else r=t;if(n)r.enter=yd;else if(r.enter===yd){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function __(t){return t.containerId||String(t.position)}const Pr="will-unmount";function S_(t=Ao.TOP_RIGHT){return!!document.querySelector(`.${Ae.CSS_NAMESPACE}__toast-container--${t}`)}function A_(t=Ao.TOP_RIGHT){return`${Ae.CSS_NAMESPACE}__toast-container--${t}`}function V_(t,n,o=!1){const r=[`${Ae.CSS_NAMESPACE}__toast-container`,`${Ae.CSS_NAMESPACE}__toast-container--${t}`,o?`${Ae.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Xn(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function D_(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=Ae.CSS_NAMESPACE,l=A_(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(Pr)),f=c||document.createElement("div"),m=document.createElement("div");m.className=V_(o,r,a),m.dataset.testid=`${Ae.CSS_NAMESPACE}__toast-container--${o}`,m.id=__(t);for(const h in s)if(Object.prototype.hasOwnProperty.call(s,h)){const k=s[h];m.style[h]=k}return c||(f.className=Ae.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(m),m}function Ns(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",Ns,!1);try{Vo[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete Vo[a],delete Qe[a]}catch{}}const Vo=e.reactive({});function N_(t,n){const o=document.getElementById(String(n));o&&(Vo[o.id]=t)}function Ms(t,n=!0){const o=String(t);if(!Vo[o])return;const r=document.getElementById(o);r&&r.classList.add(Pr),n?(P_(t),r&&r.addEventListener("animationend",Ns,!1)):Ns(o),kt.items=kt.items.filter(a=>a.containerId!==t)}function M_(t){for(const n in Vo)Ms(n,t);kt.items=[]}function kd(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...xd(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function P_(t){for(const n in Qe)if(n===t)for(const o of Qe[n]||[])kd(o)}function T_(t){const n=Kn().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function Ps(t){return document.getElementById(t)}function v_(t){const n=Ps(t.containerId);return n&&n.classList.contains(Pr)}function wd(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function O_(t){return t?kt.items.filter(n=>n.containerId===t).length>0:kt.items.length>0}function F_(){if(kt.items.length>0){const t=kt.items.shift();Tr(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const Qe=e.reactive({}),kt=e.reactive({items:[]});function Kn(){const t=e.toRaw(Qe);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function z_(t){return Kn().find(n=>n.toastId===t)}function Tr(t,n={}){if(v_(n)){const o=Ps(n.containerId);o&&o.addEventListener("animationend",Ts.bind(null,t,n),!1)}else Ts(t,n)}function Ts(t,n={}){const o=Ps(n.containerId);o&&o.removeEventListener("animationend",Ts.bind(null,t,n),!1);const r=Qe[n.containerId]||[],a=r.length>0;if(!a&&!S_(n.position)){const s=D_(n),i=e.createApp(i2,n);n.useHandler&&n.useHandler(i),i.mount(s),N_(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?mt.update(n):mt.add(t,n)})}const mt={add(t,n){const{containerId:o=""}=n;o&&(Qe[o]=Qe[o]||[],Qe[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=Qe[o])==null||r.unshift(n):(a=Qe[o])==null||a.push(n),n.onOpen&&n.onOpen(wd(n))},n.delay||0))},remove(t){if(t){const n=T_(t);if(n){const o=Qe[n];let r=o.find(a=>a.toastId===t);Qe[n]=o.filter(a=>a.toastId!==t),!Qe[n].length&&!O_(n)&&Ms(n,!1),F_(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(wd(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){Qe[n]=Qe[n]||[];const o=Qe[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};mt.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{Pe(a.content,a)},t.delay||0)}},clear(t,n=!0){t?Ms(t,n):M_(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",mt.dismissCallback,!1),setTimeout(()=>{mt.remove(o)}))},dismiss(t){if(t){const n=Kn();for(const o of n)if(o.toastId===t){kd(o,r=>{r.addEventListener("animationend",mt.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=Kn();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",mt.dismissCallback,!1),mt.remove(t));break}}}},R_=e.reactive({useHandler:void 0}),Cd=e.reactive({}),vr=e.reactive({});function Bd(){return Math.random().toString(36).substring(2,9)}function I_(t){return typeof t=="number"&&!isNaN(t)}function vs(t){return typeof t=="string"}function Xn(t){return typeof t=="function"}function Or(...t){return e.mergeProps(...t)}function Fr(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function L_(t={}){Cd[`${Ae.CSS_NAMESPACE}-default-options`]=t}function Ed(){return Cd[`${Ae.CSS_NAMESPACE}-default-options`]||bd}function $_(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var zr=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(zr||{});const _d={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:Ao.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:Gn.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:st.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}},j_={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:st.DEFAULT},theme:{type:String,required:!1,default:Gn.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}},U_=e.defineComponent({name:"ProgressBar",props:j_,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${Ae.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${Ae.CSS_NAMESPACE}__progress-bar--controlled`:`${Ae.CSS_NAMESPACE}__progress-bar--animated`,`${Ae.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${Ae.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${Ae.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),W_=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Gn.AUTO},type:{type:String,required:!1,default:Gn.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${Ae.CSS_NAMESPACE}__close-button ${Ae.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.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)])])}}),Rr=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function H_(t){return e.createVNode(Rr,e.mergeProps(t,{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 q_(t){return e.createVNode(Rr,e.mergeProps(t,{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 G_(t){return e.createVNode(Rr,e.mergeProps(t,{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 K_(t){return e.createVNode(Rr,e.mergeProps(t,{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 X_(){return e.createVNode("div",{class:`${Ae.CSS_NAMESPACE}__spinner`},null)}const Ir={info:q_,warning:H_,success:G_,error:K_,spinner:X_},Y_=t=>t in Ir;function J_({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return Ir.spinner();if(r!==!1){if(Fr(r))a=e.toRaw(r);else if(Xn(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?Ir.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):vs(r)||I_(r)?a=r:Y_(n)&&(a=Ir[n](i));return a}}const Q_=()=>{};function Z_(t,n,o=Ae.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function e2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(zr.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||Ae.COLLAPSE_DURATION}),i=s.done||Q_,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:w,onMouseleave:C}:{});function u(){const A=l.value.split(" ");m().addEventListener(Ds.ENTRANCE_ANIMATION_END,C,{once:!0});const D=V=>{const B=m();V.target===B&&(B.dispatchEvent(new Event(Ds.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",D),B.removeEventListener("animationcancel",D),a.value===zr.Enter&&V.type!=="animationcancel"&&B.classList.remove(...A))},S=()=>{const V=m();V.classList.add(...A),V.addEventListener("animationend",D),V.addEventListener("animationcancel",D)};t.pauseOnFocusLoss&&h(),S()}function f(){if(!m())return;const A=()=>{const S=m();S.removeEventListener("animationend",A),s.collapse?Z_(S,i,s.collapseDuration):i()},D=()=>{const S=m();a.value=zr.Exit,S&&(S.className+=` ${c.value}`,S.addEventListener("animationend",A))};o.value||(r.value?A():setTimeout(D))}function m(){return t.toastRef.value}function h(){document.hasFocus()||w(),window.addEventListener("focus",C),window.addEventListener("blur",w)}function k(){window.removeEventListener("focus",C),window.removeEventListener("blur",w)}function C(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function w(){n.value=!1}function p(A){A&&(A.stopPropagation(),A.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const A=Kn();o.value=A.findIndex(D=>D.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?w():C())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&k()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function t2(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const n2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:_d,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>J_(t)),s=e.computed(()=>[`${Ae.CSS_NAMESPACE}__toast`,`${Ae.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${Ae.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${Ae.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=e2({toastRef:n,loading:o,done:()=>{mt.remove(t.toastId)},...xd(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(t2(f)){const m=[];return f.title!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${Ae.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${Ae.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ae.CSS_NAMESPACE}__toast-text`},[m])}return Fr(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):Xn(f)?f({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:f}):f}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:f=>{t.closeOnClick&&c(),t.onClick&&t.onClick(f)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${Ae.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${Ae.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${Ae.CSS_NAMESPACE}--animate-icon ${Ae.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Fr(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):Xn(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(W_,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Fr(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):Xn(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(U_,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),Lr="vue3-toastify:url-change";let $r=0,Do;function o2(){if(!(typeof window>"u")&&vr.lastUrl!==window.location.href){vr.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Ed().clearOnUrlChange!==!1,n=Object.values(Qe).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&mt.dismiss(o.toastId);kt.items=kt.items.filter(o=>!t(o.toastProps))}}function r2(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(Lr)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(Lr)),a},()=>{t.pushState=n,t.replaceState=o}}function a2(){if(typeof window>"u"||Do)return;const t=r2(),n=()=>o2();window.addEventListener(Lr,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),Do=()=>{t(),window.removeEventListener(Lr,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),Do=void 0}}function s2(){Do&&(Do(),vr.lastUrl="")}const i2=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:_d,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>Qe[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&($r+=1,a2())}),e.onUnmounted(()=>{typeof window<"u"&&$r>0&&($r-=1,$r===0&&s2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(n2,e.mergeProps({key:s},a),null)})])}});let Os=!1;const Sd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Ad(){const t=[];return Kn().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(Pr)&&t.push(n)}),t}function l2(t){const n=Ad().length,o=t??0;return o>0&&n+kt.items.length>=o}function c2(t){l2(t.limit)&&!t.updateId&&kt.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function dn(t,n,o={}){if(Os)return;o=Or(Ed(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Bd()),o={...o,...o.type==="loading"?Sd:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=$_()),c2(o),vr.lastUrl=window.location.href,o.multiple?kt.items.length?o.updateId&&Tr(t,o):Tr(t,o):(Os=!0,Pe.clearAll(void 0,!1),setTimeout(()=>{Tr(t,o)},0),setTimeout(()=>{Os=!1},390)),o.toastId}const Pe=(t,n)=>dn(t,st.DEFAULT,n);Pe.info=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.INFO}),Pe.error=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.ERROR}),Pe.warning=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.WARNING}),Pe.warn=Pe.warning,Pe.success=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.SUCCESS}),Pe.loading=(t,n)=>dn(t,st.DEFAULT,Or(n,Sd)),Pe.dark=(t,n)=>dn(t,st.DEFAULT,Or(n,{theme:Gn.DARK})),Pe.remove=t=>{t?mt.dismiss(t):mt.clear()},Pe.clearAll=(t,n)=>{e.nextTick(()=>{mt.clear(t,n)})},Pe.isActive=t=>{let n=!1;return n=Ad().findIndex(o=>o.toastId===t)>-1,n},Pe.update=(t,n={})=>{setTimeout(()=>{const o=z_(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:Bd()},i=s.render||a;delete s.render,dn(i,s.type,s)}},0)},Pe.done=t=>{Pe.update(t,{isLoading:!1,progress:1})},Pe.promise=d2;function d2(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=vs(n)?Pe.loading(n,d):Pe.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(h,k,C)=>{if(k==null){Pe.remove(c);return}const w={type:h,...u,...a,data:C},p=vs(k)?{render:k}:k;return c?Pe.update(c,{...w,...p,isLoading:!1}):Pe(p.render,{...w,...p,isLoading:!1}),C},m=Xn(t)?t():t;return m.then(h=>{f("success",r,h)}).catch(h=>{f("error",o,h)}),m}Pe.POSITION=Ao,Pe.THEME=Gn,Pe.TYPE=st,Pe.TRANSITIONS=y_;const u2={install(t,n={}){R_.useHandler=n.useHandler||(()=>{}),f2(n)}};typeof window<"u"&&(window.Vue3Toastify=u2);function f2(t={}){const n=Or(bd,t);L_(n)}const m2={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:[]},h2={key:0,class:"inline-block"},Fs=at(e.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(t){const n=t,o=e.computed(()=>bn(n.icon,At)),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const f={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 f[n.size]||f.sm}),s=e.computed(()=>{const f={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 f[n.size]||f.sm}),i=e.computed(()=>{const f={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return f[n.size]||f.sm}),l=e.computed(()=>{const f={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",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",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",outline:"bg-transparent border-border text-foreground",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",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",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"};return f[n.variant]||f.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return _e(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>_e("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",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(f,m)=>r.value?(e.openBlock(),e.createElementBlock("div",h2,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-1e8e809d"]]);var jr={exports:{}},p2=jr.exports,Vd;function g2(){return Vd||(Vd=1,(function(t,n){(function(o,r){t.exports=r()})(p2,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},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,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(w){return r.apply(w,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,m,h;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.filter(function(w){return r.truthy(r.apply(f,w))}):[];if(l==="map")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.map(function(w){return r.apply(f,w)}):[];if(l==="reduce")return m=r.apply(c[0],i),f=c[1],h=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(m)?m.reduce(function(w,p){return r.apply(f,{current:p,accumulator:w})},h):h;if(l==="all"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="none"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="some"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!0;return!1}}if(c=c.map(function(w){return r.apply(w,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var k=String(l).split("."),C=a;for(d=0;d<k.length;d++){if(!C.hasOwnProperty(k[d]))throw new Error("Unrecognized operation "+l+" (failed at "+k.slice(0,d+1).join(".")+")");C=C[k[d]]}return C.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(jr)),jr.exports}var b2=g2();const Ft=Oi(b2),y2={class:"dcode-card animate-slide-up"},x2={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"},k2={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between items-start gap-4"},w2={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]"},C2={class:"relative w-full sm:w-64"},B2={key:0,class:"relative"},E2={class:"flex flex-col h-full"},_2={key:0,class:"flex-1 overflow-y-auto py-4"},S2={class:"grid grid-cols-1 gap-4 px-1"},A2={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},V2={class:"flex justify-end gap-2 w-full"},D2={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},N2={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},M2={class:"dcode-table w-full"},P2={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},T2=["onClick"],v2={key:0,class:"flex items-center justify-center w-full"},O2={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},F2={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},z2={key:0,class:"px-3 py-0.5"},R2={key:1},I2=["colspan"],L2={class:"flex flex-col items-center gap-2"},$2={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},j2={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},U2={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},W2={key:0,class:"flex items-center justify-center"},H2={key:0,class:"px-3 py-0.5 !text-center"},q2={key:0,class:"flex items-center justify-center gap-1.5"},G2={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},K2=["colspan"],X2={key:0,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"},Y2={class:"flex items-center gap-4"},J2={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},Q2={class:"text-neutral-900 dark:text-neutral-100 font-medium"},Z2={class:"text-neutral-900 dark:text-neutral-100 font-medium"},eS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},tS={class:"flex-shrink-0"},nS={class:"space-y-4"},oS={class:"text-gray-600 dark:text-gray-400"},rS={class:"grid grid-cols-1 gap-4 py-4 px-1"},aS={key:0,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"},sS={class:"p-1.5 bg-amber-100 dark:bg-amber-900/40 rounded-md text-amber-600 dark:text-amber-400"},iS={class:"flex flex-col gap-0.5"},lS={class:"text-[10px] font-bold uppercase tracking-wider text-amber-500/70 dark:text-amber-400/50"},cS={class:"text-xs text-amber-700 dark:text-amber-300 leading-relaxed font-medium transition-all"},dS={class:"flex items-end gap-2"},Yn=e.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{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}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var Hd,qd,Gd,Kd,Xd,Yd;Ft.add_operation("length",N=>N==null?0:typeof N=="string"||Array.isArray(N)?N.length:typeof N=="number"?String(N).length:typeof N=="object"?Object.keys(N).length:0),Ft.add_operation("==",(N,z)=>N!==null&&typeof N=="object"&&"_isLogicValue"in N?N.id==z||N.code==z:z!==null&&typeof z=="object"&&"_isLogicValue"in z?z.id==N||z.code==N:N==z),Ft.add_operation("!=",(N,z)=>N!==null&&typeof N=="object"&&"_isLogicValue"in N?!(N.id==z||N.code==z):z!==null&&typeof z=="object"&&"_isLogicValue"in z?!(z.id==N||z.code==N):N!=z);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=Ke(),{locale:l}=gt.useI18n();let c={query:{},params:{},path:""};try{const N=un.useRoute();N?c=N:(Gd=(qd=(Hd=s==null?void 0:s.appContext)==null?void 0:Hd.config)==null?void 0:qd.globalProperties)!=null&&Gd.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:N=>{console.warn("Router push() logic called from fallback:",N),typeof N=="string"&&N.startsWith("/")&&(window.location.href=N)}};try{const N=un.useRouter();N?d=N:(Yd=(Xd=(Kd=s==null?void 0:s.appContext)==null?void 0:Kd.config)==null?void 0:Xd.globalProperties)!=null&&Yd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),m=e.ref(r.perPage),h=e.ref({key:"",direction:"asc"}),k=e.ref([]),C=e.ref(!1),w=e.ref(0),p=e.ref({}),A=e.ref([]),D=e.ref(null),S=e.ref(!0),V=e.ref([]),B=e.ref([]),g=e.ref([]),b=e.ref(!1),_=e.ref(!1),y=e.ref({}),x=e.ref(null),E=e.ref(null),M=e.ref(null),T=e.ref([]),$=e.computed(()=>{if(H.value.length===0)return!1;const N=H.value.map(z=>{const Y=X.value.find(L=>L.type==="CHECKBOX"),F=(Y==null?void 0:Y.keyCheckbox)||"id";return z[F]}).filter(z=>z!=null);return N.length===0?!1:N.every(z=>T.value.includes(z))}),v=e.computed(()=>{if(H.value.length===0)return!1;const N=X.value.find(L=>L.type==="CHECKBOX"),z=(N==null?void 0:N.keyCheckbox)||"id",Y=H.value.map(L=>L[z]).filter(L=>L!=null),F=Y.filter(L=>T.value.includes(L)).length;return F>0&&F<Y.length}),I=N=>{const z=X.value.find(L=>L.type==="CHECKBOX"),Y=(z==null?void 0:z.keyCheckbox)||"id",F=N[Y];return F!==void 0&&T.value.includes(F)},j=N=>{const z=X.value.find(L=>L.type==="CHECKBOX"),Y=(z==null?void 0:z.keyCheckbox)||"id",F=H.value.map(L=>L[Y]).filter(L=>L!=null);if(N){const L=new Set([...T.value,...F]);T.value=Array.from(L)}else T.value=T.value.filter(L=>!F.includes(L))},U=(N,z)=>{const Y=X.value.find(J=>J.type==="CHECKBOX"),F=(Y==null?void 0:Y.keyCheckbox)||"id",L=N[F];L!=null&&(z?T.value.includes(L)||T.value.push(L):T.value=T.value.filter(J=>J!==L))};e.watch(T,N=>{var Y;a("update:selection",N);const z=$.value||N.length>1;(Y=B.value)!=null&&Y.length&&B.value.forEach(F=>{var L;(L=F.fieldActionGlobal)!=null&&L.length&&F.fieldActionGlobal.forEach(J=>{var ye,Te;const ie=F.endpoint||((ye=F.propsActionGlobal)==null?void 0:ye.endpointPropAction)||F.propsActionGlobal,ge=(Te=ie==null?void 0:ie.keyParam)==null?void 0:Te[0];(ge&&J.model===ge||!ge&&/^(id|ids|idAuditTrail)/i.test(J.model))&&z&&J.model&&(y.value[J.model]=N)})})},{deep:!0});const P=N=>Array.from({length:N}).map((z,Y)=>{const F={id:Y+1,no:Y+1};return X.value.forEach(L=>{L.key!=="no"&&L.key!=="action"&&L.type!=="ACTION"&&L.type!=="action"&&(L.type==="CHECKBOX"?F[L.keyCheckbox||"id"]=Y+1:L.type==="BADGE"||L.type==="badge"||L.condition?F[L.key]=L.condition&&L.condition.length>0?L.condition[0].value:"Active":F[L.key]=`Data ${L.label} ${Y+1}`)}),F}),R=N=>N&&typeof N=="string"&&N.trim()?N:void 0,G=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiModule)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiModule)||r.apiModule}),q=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiAction)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiAction)||r.apiAction}),W=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiMethod)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiMethod)||r.apiMethod||"POST"}),Z=e.computed(()=>{var N,z,Y,F;return R((z=(N=D.value)==null?void 0:N.endpoint)==null?void 0:z.apiUrl)||R((F=(Y=D.value)==null?void 0:Y.endpointGlobal)==null?void 0:F.apiUrl)||r.apiUrl}),ne=e.computed(()=>r.permissionBase||""),ue=e.computed(()=>!g.value||g.value.length===0?[]:[...g.value].sort((N,z)=>(N.seq||0)-(z.seq||0))),ke=N=>{var J,ie,ge;const z=(N==null?void 0:N.column)||((J=N==null?void 0:N.props)==null?void 0:J.column)||((ie=N==null?void 0:N.propsFieldGlobal)==null?void 0:ie.column)||((ge=N==null?void 0:N.propsFieldCustom)==null?void 0:ge.column);if(!z)return"col-span-1";const Y=z.toLowerCase(),L={full:"col-span-1 md:col-span-2",half:"col-span-1",third:"col-span-1","two-thirds":"col-span-1 md:col-span-2",two_thirds:"col-span-1 md:col-span-2"}[Y]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${N==null?void 0:N.model}: type=${z}, returned=${L}`),L},me=()=>{let N=null;if(r.tableConfig&&(N=r.tableConfig),N){D.value=N,V.value=[],B.value=[],N.headers&&(A.value=N.headers.map(F=>{var ie,ge,be,ye,Te,Be,De,ht,Rt,Qr;if(F.key==="action"||((ie=F.custom)==null?void 0:ie.type)==="ACTION"||((ge=F.custom)==null?void 0:ge.type)==="action"){const pt=((be=F.custom)==null?void 0:be.actionCustom)||((ye=F.custom)==null?void 0:ye.action);if(pt){const DA=pt.map(wt=>{const qe=wt.propsActionCustom||wt.props||{},Zr=wt.propCustomMessage||{};return{permission:wt.permission,label:l.value==="id"?qe.labelID:qe.labelEN,tooltip:l.value==="id"?qe.tooltipID||qe.labelID:qe.tooltipEN||qe.labelEN,icon:qe.icon,variant:qe.variant||"ghost",bgColor:qe.bgColor,action:qe.actionType||qe.key,route:qe.route,path:qe.path,endpoint:qe.endpointPropAction,requiredCondition:wt.requiredCondition||!1,propCustomCondition:wt.propCustomCondition||[],fieldMapping:wt.fieldMapping||qe.fieldMapping||null,openDialog:wt.openDialog||!1,fieldActionCustom:(wt.fieldActionCustom||[]).map(ea=>{const js=ea.propsFieldCustom||ea.propsFieldGlobal||ea.props||{};return{...ea,props:{...js,endpoint:js.endpointComponent||js.endpoint}}}),condition:wt.visibleRule||wt.propCustomCondition||qe.visibleRule||qe.propCustomCondition||null,requireConfirm:wt.requireConfirm||qe.requireConfirm||!1,confirmTitle:l.value==="id"?Zr.titleID||qe.confirmTitleID||"Konfirmasi":Zr.titleEN||qe.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Zr.messageID||qe.confirmMessageID||"Apakah Anda yakin?":Zr.messageEN||qe.confirmMessageEN||"Are you sure?"}});V.value.push(...DA)}return null}let L;const J=((Te=F.custom)==null?void 0:Te.conditionBadge)||((Be=F.custom)==null?void 0:Be.condition);return(((De=F.custom)==null?void 0:De.type)==="BADGE"||((ht=F.custom)==null?void 0:ht.type)==="badge")&&J&&(L=J.map(pt=>({value:pt.value,label:l.value==="id"?pt.labelID:pt.labelEN,labelID:pt.labelID,labelEN:pt.labelEN,color:pt.color||pt.bgColor,variant:pt.variant,logic:pt.logic||pt.conditionRule||null}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(Rt=F.custom)==null?void 0:Rt.type,condition:L,keyCheckbox:(Qr=F.custom)==null?void 0:Qr.keyCheckbox}}).filter(F=>F!==null));const z=N.filters||N.filter;z&&Array.isArray(z)&&(g.value=z.map(F=>({...F,props:F.propsFilters||F.props||{}})),g.value.forEach(F=>{p.value[F.model]=""}));const Y=N.actionTableGlobal||N.actionGlobal||N.action;console.log("[DEBUG] loadConfig rawActions:",Y),Y&&Array.isArray(Y)?(B.value=Y.map(F=>{const L=F.propsActionGlobal||F.props||{};return{key:L.key,permission:F.permission,label:l.value==="id"?L.labelID||"Action":L.labelEN||"Action",tooltip:l.value==="id"?L.tooltipID||L.labelID:L.tooltipEN||L.labelEN,icon:L.icon,variant:L.variant||"default",bgColor:L.bgColor,textColor:L.textColor,route:L.route,path:L.path,endpoint:L.endpointPropAction||F.endpoint,fieldMapping:F.fieldMapping||L.fieldMapping||null,visibleRule:F.visibleRule||L.visibleRule||F.propCustomCondition||L.propCustomCondition||null,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(J=>{const ie=J.propsFieldGlobal||J.props||{};return{...J,props:{...ie,endpoint:ie.endpointComponent||ie.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),N.pagination!==void 0&&(S.value=N.pagination)}};e.watch(()=>r.tableConfig,()=>{me()},{deep:!0,immediate:!0});const X=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?A.value:r.columns||[]),O=e.computed(()=>r.hasActions||V.value.length>0),K=e.computed(()=>r.dummyMode?!1:G.value||Z.value?C.value:r.loading),ee=e.computed(()=>!!G.value||!!Z.value),he=e.computed(()=>[]),Ve=N=>{if(console.log("[DEBUG] hasAction called:",{actionCode:N,permissionChecker:!!r.permissionChecker,effectivePath:ne.value}),r.menuPermissions&&r.menuPermissions.length>0){const z=c.path,Y=r.menuPermissions.find(F=>z.startsWith(F.path));if(Y&&Y.actions){const F=Y.actions.find(L=>L.code===N.toUpperCase());return F?F.checked:!1}return!1}if(r.permissionChecker){const z=r.permissionChecker(ne.value,N);return console.log("[DEBUG] permissionChecker result:",z),z}return he.value.some(z=>z.code===N)},Ne=(N,z)=>{if(N.condition)try{return Ft.apply(N.condition,z)}catch(ie){return console.warn("Row action jsonLogic error:",ie),!1}if(!N.visibilityCondition)return!0;const{field:Y,operator:F,value:L}=N.visibilityCondition,J=Ee(z,Y);switch(F){case"equals":return J===L;case"notEquals":return J!==L;case"in":return Array.isArray(L)&&L.includes(J);case"notIn":return Array.isArray(L)&&!L.includes(J);case"greaterThan":return J>L;case"lessThan":return J<L;case"contains":return String(J).includes(String(L));default:return!0}},ze=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:r.ignorePermissions}),B.value.length===0)return B.value;const N=B.value.filter(z=>{if(z.visibleRule)try{const F=H.value[0]||{};if(!Ft.apply(z.visibleRule,F))return!1}catch(F){console.warn("Header action visibility logic error:",F)}if(r.ignorePermissions||r.dummyMode)return!0;if(!z.permission)return console.log("[DEBUG] Action no permission, showing:",z.label),!0;if(r.checkPermission){const F=r.checkPermission(z.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(r.permissions){const F=r.permissions.includes(z.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const Y=Ve(z.permission);return console.log("[DEBUG] Internal permission check:",{label:z.label,permission:z.permission,hasPerm:Y}),Y});return console.log("[DEBUG] Filtered header actions:",N.length),N}),Re=e.computed(()=>V.value.length===0?V.value:V.value.filter(N=>r.ignorePermissions||r.dummyMode||!N.permission?!0:r.checkPermission?r.checkPermission(N.permission):r.permissions?r.permissions.includes(N.permission):Ve(N.permission))),Ue=N=>Re.value.filter(z=>Ne(z,N)),Me=(N,z)=>{var L,J;if(N.requiredCondition&&((L=N.propCustomCondition)==null?void 0:L.length)>0){const ie=Ee(z,"status"),ge=N.propCustomCondition.find(be=>be.value===ie);if(ge)return ge.bgColor||N.bgColor||"primary"}if(!N.dynamicColor||!N.colorCondition)return N.bgColor||"primary";const Y=Ee(z,N.colorCondition.field),F=(J=N.colorCondition.conditions)==null?void 0:J.find(ie=>ie.value===Y);return(F==null?void 0:F.bgColor)||N.bgColor||"primary"},Ze=N=>{const z=(N||"left").toLowerCase();return z==="center"?"justify-center":z==="right"?"justify-end":"justify-start"},ct={ToggleLeft:te.ToggleLeft,SquarePen:te.SquarePen,Trash2:te.Trash2,Eye:te.Eye,CheckCircle:te.CheckCircle,Plus:te.Plus,Download:te.Download,RefreshCw:te.RefreshCw,Search:te.Search,SlidersHorizontal:te.SlidersHorizontal},St=N=>N&&(bn(N,At)||ct[N])||null,H=e.computed(()=>r.dummyMode?X.value.length>0?P(10):[]:ee.value?k.value.map((N,z)=>({...N,no:(f.value-1)*m.value+z+1})):se.value),re=e.computed(()=>r.dummyMode?10:ee.value?w.value:Q.value.length),pe=e.computed(()=>re.value===0?0:(f.value-1)*m.value+1),Ie=e.computed(()=>{const N=f.value*m.value;return N>re.value?re.value:N}),Ee=(N,z)=>{if(!(!N||!z))return z in N?N[z]:z.split(".").reduce((Y,F)=>Y&&Y[F],N)},Q=e.computed(()=>{if(ee.value)return[];if(!u.value)return r.data;const N=u.value.toLowerCase();return r.data.filter(z=>X.value.some(Y=>{const F=Ee(z,Y.key);return F==null?!1:String(F).toLowerCase().includes(N)}))}),oe=e.computed(()=>ee.value?[]:h.value.key?[...Q.value].sort((z,Y)=>{const F=Ee(z,h.value.key),L=Ee(Y,h.value.key);if(F===L)return 0;let J=0;return typeof F=="number"&&typeof L=="number"?J=F-L:J=String(F).localeCompare(String(L)),h.value.direction==="asc"?J:-J}):Q.value),se=e.computed(()=>{if(ee.value)return[];const N=(f.value-1)*m.value,z=N+m.value;return oe.value.slice(N,z).map((Y,F)=>({...Y,no:N+F+1}))}),xe=e.computed(()=>ee.value?Object.values(p.value).some(N=>!!N):!!u.value),He=[10,25,50,100],zt=()=>{ee.value&&(p.value={...p.value,keyword:u.value},f.value=1,rt())};let qr;const Fd=()=>{r.enableQuickSearch&&(clearTimeout(qr),qr=setTimeout(()=>{zt()},500))};let Gr;const zd=()=>{clearTimeout(Gr),Gr=setTimeout(()=>{ee.value&&rt()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&ee.value&&Fd()});const rt=async()=>{if(!r.dummyMode&&ee.value&&!(!G.value&&!Z.value))try{C.value=!0;const N={page:f.value,perPage:m.value,...p.value,...r.apiParams};u.value&&(N.keyword=u.value),Object.keys(N).forEach(Y=>{(N[Y]===""||N[Y]===null||N[Y]===void 0)&&delete N[Y]});let z;if(G.value)z=await i(G.value,q.value,N);else if(Z.value){let Y=Z.value;if(r.baseUrl&&typeof Y=="string"&&!Y.startsWith("http")){const F=r.baseUrl.replace(/\/$/,""),L=Y.startsWith("/")?Y:`/${Y}`;Y=`${F}${L}`}z=await i(Y,W.value,N)}Rd(z)}catch(N){console.error("DataTable fetch error",N),C.value=!1}},Rd=N=>{console.log("DataTable handleResponseData:",N),N&&(r.dynamicColumns&&N.columns&&Array.isArray(N.columns)&&(A.value=N.columns.map(z=>({key:z.key||z.field||z.name,label:z.label||z.header||z.name,width:z.width,align:z.align||"LEFT",sortable:z.sortable!==!1,type:z.type,condition:z.condition,format:z.format}))),N.data&&Array.isArray(N.data)?(k.value=N.data,N.totalData?w.value=N.totalData:N.maxPage?w.value=N.maxPage*m.value:w.value=N.data.length*(N.maxPage||1)):Array.isArray(N)?(k.value=N,w.value=N.length):N.users?(k.value=N.users,w.value=N.users.length):N.items&&Array.isArray(N.items)?(k.value=N.items,w.value=N.total||N.totalItems||N.items.length):N.list&&Array.isArray(N.list)?(k.value=N.list,w.value=N.total||N.list.length):N.rows&&Array.isArray(N.rows)?(k.value=N.rows,w.value=N.count||N.total||N.rows.length):N.result&&Array.isArray(N.result)?(k.value=N.result,w.value=N.total||N.count||N.result.length):(console.warn("DataTable: Unknown response format",N),k.value=[],w.value=0)),C.value=!1};e.onUnmounted(()=>{clearTimeout(qr),clearTimeout(Gr)});const Kr=()=>{Object.keys(p.value).forEach(N=>{p.value[N]=""}),u.value="",f.value=1,rt()},Id=()=>{f.value=1,rt()},Xr=(N,z)=>{const Y=Ee(N,z.key);let F={variant:"secondary",class:"",label:Y};if(z.condition){const L=z.condition.find(J=>{if(J.logic||typeof J.value=="object"&&J.value!==null)try{const ge=J.logic||J.value;return Ft.apply(ge,N)}catch(ge){return console.warn("Badge logic error:",ge),!1}const ie=(ge,be)=>ge==null||be===void 0||be===null?!1:typeof ge=="string"&&typeof be=="string"?ge.toLowerCase().trim()===be.toLowerCase().trim():ge==be;if(ie(J.value,Y)||typeof Y=="object"&&Y!==null&&(ie(J.value,Y.code)||ie(J.value,Y.id)))return!0;if(z.key.includes(".")){const be=z.key.split(".").slice(0,-1).join("."),ye=Ee(N,be);if(ye&&typeof ye=="object"&&(ie(J.value,ye.code)||ie(J.value,ye.id)))return!0}return!1});if(L){L.variant&&(F.variant=L.variant);const ie=(l.value||"en")==="id"?L.labelID:L.labelEN;if(F.label=ie||L.label||(typeof Y=="object"?Y.name||Y.code:Y),L.color||L.bgColor){const ge=(L.color||L.bgColor||"").toLowerCase(),be=F.variant==="outline",ye={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow",primary:"bg-primary-600 hover:bg-primary-700 border-transparent text-white shadow",secondary:"bg-neutral-500 hover:bg-neutral-600 border-transparent text-white shadow",danger:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow",destructive:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow"},Te={success:"text-green-600 border-green-600 hover:bg-green-50",warning:"text-yellow-600 border-yellow-600 hover:bg-yellow-50",info:"text-blue-600 border-blue-600 hover:bg-blue-50",danger:"text-red-600 border-red-600 hover:bg-red-50",destructive:"text-red-600 border-red-600 hover:bg-red-50",primary:"text-primary-600 border-primary-600 hover:bg-primary-50",secondary:"text-neutral-600 border-neutral-600 hover:bg-zinc-50"},Be={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};be?Te[ge]&&(F.class=Te[ge]):Be[ge]?F.variant=Be[ge]:ye[ge]&&(F.class=ye[ge])}}else F.label=typeof Y=="object"?(Y==null?void 0:Y.name)||(Y==null?void 0:Y.code)||"-":Y}else F.label=typeof Y=="object"?(Y==null?void 0:Y.name)||(Y==null?void 0:Y.code)||"-":Y;return F},Ld=N=>{h.value.key===N?h.value.direction=h.value.direction==="asc"?"desc":"asc":(h.value.key=N,h.value.direction="asc"),a("update:sort",h.value)},$s=N=>{N!==f.value&&(f.value=N,ee.value&&rt(),a("update:page",N))},$d=N=>{m.value=N,f.value=1,ee.value&&rt()},jd=N=>{const z=Math.random()*15+75;if(N.width){const Y=parseInt(String(N.width));return Y<100?`${Math.floor(Y*(Math.random()*.2+.7))}px`:`${z}%`}return`${z}%`},Yr=()=>{u.value="",p.value={},f.value=1,rt()},wA=N=>{var z;if(console.log("[DEBUG] handleHeaderAction called:",N),N.route&&!r.dummyMode){if(N.path){const Y=N.route.startsWith("/")?N.route:"/"+N.route;sessionStorage.setItem(`layout_${Y}`,N.path)}d==null||d.push(N.route)}else if(N.openDialog||r.dummyMode&&N.route){E.value=N,M.value=null,y.value={};const Y=N.fieldActionGlobal||N.field||[];Y.length&&Y.forEach(F=>{var ie;const L=N.endpoint||((ie=N.propsActionGlobal)==null?void 0:ie.endpointPropAction)||N.propsActionGlobal,J=L!=null&&L.keyParam&&L.keyParam.length>0?L.keyParam[0]:null;J&&F.model===J||!J&&/^(id|ids|idAuditTrail)/i.test(F.model)?y.value[F.model]=T.value:y.value[F.model]||(y.value[F.model]="")}),_.value=!0}else a("action",{action:((z=N.propsActionCustom)==null?void 0:z.key)||N.key||"create",row:null,selection:T.value})},CA=async(N,z)=>{var Y,F,L,J;if(N.requireConfirm){x.value={button:N,row:z},b.value=!0;return}if(N.openDialog){E.value=N,M.value=z,y.value={};const ie=X.value.find(ye=>ye.type==="CHECKBOX"),ge=(ie==null?void 0:ie.keyCheckbox)||"id";N.fieldActionCustom&&N.fieldActionCustom.forEach(ye=>{/^(id|ids|idAuditTrail)/i.test(ye.model)?y.value[ye.model]=[z[ge]]:N.action==="showToken"&&ye.model==="token"?y.value[ye.model]=z.token!==void 0?z.token:"":z[ye.model]!==void 0?y.value[ye.model]=z[ye.model]:y.value[ye.model]=""});const be=N.endpoint||((Y=N.propsActionGlobal)==null?void 0:Y.endpointPropAction)||((F=N.propsActionCustom)==null?void 0:F.endpointPropAction)||((L=N.props)==null?void 0:L.endpointPropAction);if(((J=be==null?void 0:be.apiMethod)==null?void 0:J.toUpperCase())==="GET"&&be.apiUrl){C.value=!0;const{apiUrl:ye}=Ke(),Te={};be.keyParam&&Array.isArray(be.keyParam)&&be.keyParam.forEach((Be,De)=>{const ht=be.model&&De===0?be.model:Be;z[Be]!==void 0&&(Te[ht]=z[Be])}),Object.keys(Te).length===0&&z.id&&(Te.id=z.id),ye(be.apiUrl,"GET",Te).then(Be=>{let De=Be;if(Be&&Be.data!==void 0?De=Be.data:Be&&Be.result!==void 0&&(De=Be.result),De!=null){if(typeof De=="string")y.value.hasOwnProperty("token")&&(y.value.token=De);else if(typeof De=="object"&&(De.item&&(De=De.item),Array.isArray(De)&&(De=De[0]||{}),Object.keys(De).forEach(ht=>{y.value[ht]=De[ht]}),!y.value.token)){const ht=Object.keys(De).find(Rt=>Rt.toLowerCase().includes("token"));if(ht)y.value.token=De[ht];else{const Rt=Object.values(De).filter(Qr=>typeof Qr=="string");Rt.length===1&&(y.value.token=Rt[0])}}}_.value=!0}).catch(Be=>{console.error("Fetch Data Failed",Be)}).finally(()=>{C.value=!1});return}_.value=!0;return}Ud(N,z)},Ud=(N,z)=>{if(N.route){if(N.path){const L=N.route.startsWith("/")?N.route:"/"+N.route;sessionStorage.setItem(`layout_${L}`,N.path)}let Y=N.route;Y.includes(":")?Y=Y.replaceAll(/:([a-zA-Z0-9_]+)/g,(L,J)=>z[J]||z.id||J):z.id&&(Y=`${Y.replace(/\/$/,"")}/${z.id}`);const F={};N.path&&(F.code=N.path),d==null||d.push({path:Y,query:F})}else if(N.endpoint&&N.endpoint.apiUrl){C.value=!0;const{apiUrl:Y}=Ke(),F=N.endpoint.apiUrl,L=N.endpoint.apiMethod||"POST",J={},ie=N.fieldMapping;if(ie&&typeof ie=="object"){const{locale:ge}=gt.useI18n(),be=ge.value||"en",ye=[];if(Object.entries(ie).forEach(([Te,Be])=>{if(typeof Be=="string"){const De=Ee(z,Te);De!==void 0?J[Be]=De:(console.warn(`[MAPPING-DEBUG] No matching source found for '${Te}'`),ye.push(Te))}}),ye.length>0){const Te=be==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Be=be==="id"?`Terdapat ketidaksesuaian skema pada field: ${ye.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${ye.join(", ")}. Please contact the development team.`;Pe.warning(`${Te}: ${Be}`,{autoClose:5e3,position:"top-right"})}}if(Object.keys(J).length===0){const ge=N.endpoint;ge.model&&ge.keyParam&&Array.isArray(ge.keyParam)?ge.keyParam.forEach(be=>{const ye=Ee(z,be);ye!==void 0&&(J[ge.model]=ye)}):z.id&&(J.id=z.id)}Y(F,L,J).then(()=>{rt(),a("action",{action:N.action||"success",row:z})}).catch(ge=>{console.error("Action Failed",ge)}).finally(()=>{C.value=!1})}else a("action",{action:N.action,row:z})},BA=()=>{x.value&&(Ud(x.value.button,x.value.row),Wd())},EA=()=>{var N,z,Y;if(E.value){const F=E.value,L=F.endpoint||((N=F.propsActionGlobal)==null?void 0:N.endpointPropAction)||F.propsActionGlobal;let J=(L==null?void 0:L.model)||(L!=null&&L.keyParam&&L.keyParam.length>0?L.keyParam[0]:null);if(!J){const ye=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(Te=>/^(id|ids|idAuditTrail)/i.test(Te.model));J=ye?ye.model:"ids"}let ie=null,ge=!1;if(M.value){const be=X.value.find(Be=>Be.type==="CHECKBOX"),ye=(be==null?void 0:be.keyCheckbox)||"id",Te=M.value[ye];if(L!=null&&L.apiUrl){ie={...y.value};const Be=F.fieldMapping;Be&&typeof Be=="object"&&Object.entries(Be).forEach(([De,ht])=>{if(typeof ht=="string"){const Rt=Ee(M.value,De);Rt!==void 0&&(ie[ht]=Rt)}}),ie[J]||(ie[J]=L!=null&&L.model?Te:[Te]),ge=!0}}else L!=null&&L.apiUrl&&(ie={...y.value},ie[J]||(ie[J]=T.value||[]),ge=!0);if(ge&&ie&&(L!=null&&L.apiUrl)){if(((z=L==null?void 0:L.apiMethod)==null?void 0:z.toUpperCase())==="GET"){_.value=!1,M.value||(T.value=[]);return}const{apiUrl:be}=Ke(),ye=L.apiUrl,Te=L.apiMethod||"POST";be(ye,Te,ie).then(()=>{_.value=!1,M.value||(T.value=[]),rt(),a("action",{action:"success",row:null})}).catch(Be=>{console.error("Action Failed",Be)})}else if(M.value){const be=X.value.find(De=>De.type==="CHECKBOX"),ye=(be==null?void 0:be.keyCheckbox)||"id",Te=M.value[ye],Be={...y.value};Be[J]||(Be[J]=[Te]),a("action",{action:E.value.action,row:Be}),_.value=!1}else{const be={...y.value};be[J]||(be[J]=T.value);const ye={action:((Y=E.value.propsActionGlobal)==null?void 0:Y.key)||E.value.key,row:be,selection:T.value};a("action",ye),_.value=!1}}},_A=N=>{const z=y.value[N];z&&Nm(String(z)).then(()=>{Pe.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(Y=>{console.error("Failed to copy",Y)})},Wd=()=>{b.value=!1,x.value=null},SA=e.computed(()=>x.value?x.value.button.confirmTitle||"Confirm":""),AA=e.computed(()=>x.value?x.value.button.confirmMessage||"Confirm":"");n({fetchData:rt,filters:p,resetFilters:Kr,handleRefresh:Yr});const Jr=e.ref(""),VA=N=>{if(!N)return"";const z=N.endpoint||N.endpointGlobal||{};return JSON.stringify({url:z.apiUrl||N.apiUrl,module:z.apiModule||N.apiModule,action:z.apiAction||N.apiAction,method:z.apiMethod||N.apiMethod,params:N.apiParams,socket:z.socket||N.socketEndpoint,socketParams:N.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){me();const N=VA(r.tableConfig);N!==Jr.value&&(!Jr.value&&ee.value?(Jr.value=N,rt()):(Jr.value=N,ee.value&&zd()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{ee.value&&rt()}),e.watch(()=>r.apiParams,()=>{ee.value&&rt()},{deep:!0}),e.watch(()=>B.value,N=>{console.log("[DEBUG] headerActions changed:",N.length,"items");const z=ze.value;console.log("[DEBUG] visibleHeaderActions evaluated:",z.length,"items")},{deep:!0}),e.onMounted(()=>{me(),ee.value&&(r.tableConfig||(C.value=!0,rt()))}),(N,z)=>{var Y;return e.openBlock(),e.createElementBlock("div",y2,[e.createElementVNode("div",x2,[e.createElementVNode("div",k2,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",w2,[e.createElementVNode("div",C2,[e.createVNode(e.unref(te.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(t_),{modelValue:u.value,"onUpdate:modelValue":z[0]||(z[0]=F=>u.value=F),placeholder:"Search...",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:e.withKeys(zt,["enter"])},null,8,["modelValue"])]),g.value.length>0?(e.openBlock(),e.createElementBlock("div",B2,[e.createVNode(QE,null,{trigger:e.withCtx(()=>[e.createVNode(Le,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",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"})]),footer:e.withCtx(()=>[e.createElementVNode("div",V2,[e.renderSlot(N.$slots,"filter-footer",{fetch:rt,reset:Kr})])]),default:e.withCtx(()=>[z[9]||(z[9]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",E2,[e.renderSlot(N.$slots,"filter-form",{filters:p.value},()=>[g.value.length>0?(e.openBlock(),e.createElementBlock("div",_2,[e.createElementVNode("div",S2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value,(F,L)=>(e.openBlock(),e.createElementBlock("div",{key:L,class:e.normalizeClass(ke(F))},[e.createVNode(gd,{field:F,modelValue:p.value[F.model],"onUpdate:modelValue":J=>p.value[F.model]=J},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),g.value.length>0?(e.openBlock(),e.createElementBlock("div",A2,[e.createVNode(Le,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Kr,disabled:K.value},null,8,["disabled"]),e.createVNode(Le,{onClick:Id,disabled:K.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",D2)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Le,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"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:Yr,disabled:K.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(te.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":K.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(F,L)=>(e.openBlock(),e.createBlock(Le,{key:L,icon:F.icon,text:F.label,tooltip:F.tooltip,variant:F.variant,"bg-color":F.bgColor,"text-color":F.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:J=>wA(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(N.$slots,"header-actions")],2)])]),e.createElementVNode("div",N2,[e.createElementVNode("table",M2,[e.createElementVNode("thead",P2,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,F=>(e.openBlock(),e.createElementBlock("th",{key:F.key,class:e.normalizeClass([F.align?`text-${F.align.toLowerCase()}`:"text-left",F.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:e.normalizeStyle(F.width?{width:F.width}:{}),onClick:L=>F.sortable&&Ld(F.key)},[F.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",v2,[e.createVNode(Yt,{"model-value":$.value,indeterminate:v.value,"onUpdate:modelValue":z[1]||(z[1]=L=>j(!!L)),onClick:z[2]||(z[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",Ze(F.align)])},[e.createElementVNode("span",null,e.toDisplayString(F.label),1)],2))],14,T2))),128)),O.value?(e.openBlock(),e.createElementBlock("th",O2,[...z[10]||(z[10]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",F2,[K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,F=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${F}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,L=>{var J,ie;return e.openBlock(),e.createElementBlock("td",{key:L.key,class:e.normalizeClass([L.align?`text-${L.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes(L.type??"")||L.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((J=L.align)==null?void 0:J.toLowerCase())==="center"?"mx-auto":"",((ie=L.align)==null?void 0:ie.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(L.type??"")||L.condition?void 0:jd(L),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",z2,[...z[11]||(z[11]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):H.value.length===0?(e.openBlock(),e.createElementBlock("tr",R2,[e.createElementVNode("td",{colspan:X.value.length+(O.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",L2,[e.createVNode(e.unref(eu.Vue3Lottie),{animationData:e.unref(m2),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",$2,e.toDisplayString(xe.value?"No search results":"No data"),1),e.createElementVNode("p",j2,e.toDisplayString(xe.value?"Try changing keywords":"No data added"),1)])])],8,I2)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H.value,(F,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:L},[e.createElementVNode("tr",U2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,J=>(e.openBlock(),e.createElementBlock("td",{key:J.key,class:e.normalizeClass([J.align?`text-${J.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(N.$slots,`cell-${J.key}`,{row:F,value:Ee(F,J.key)},()=>[J.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",W2,[e.createVNode(Yt,{"model-value":I(F),"onUpdate:modelValue":ie=>U(F,!!ie),onClick:z[3]||(z[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):J.type==="badge"||J.type==="BADGE"||J.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[J.align?`justify-${J.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(Fs,{variant:Xr(F,J).variant,class:e.normalizeClass([Xr(F,J).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Xr(F,J).label),1)]),_:2},1032,["variant","class"])],2)):J.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*m.value+L+1),1)],64)):J.type==="date"||J.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Ee(F,J.key)?e.unref(Vm)(Ee(F,J.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(J.format?J.format(Ee(F,J.key)):Ee(F,J.key)),1)],64))])],2))),128)),O.value?(e.openBlock(),e.createElementBlock("td",H2,[e.renderSlot(N.$slots,"actions",{row:F,buttons:Ue(F),getButtonColor:Me,getIconComponent:St},()=>[Ue(F).length>0?(e.openBlock(),e.createElementBlock("div",q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue(F),(J,ie)=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:"group relative"},[e.createVNode(Le,{tooltip:J.tooltip||J.label,icon:J.icon,text:J.icon?"":J.label||(e.unref(l)==="id"?"Aksi":"Action"),size:J.icon?"icon":"sm",rounded:J.rounded||"sm",borderStyle:J.borderStyle||"none",variant:J.variant||"ghost","bg-color":Me(J,F),onClick:ge=>CA(J,F)},null,8,["tooltip","icon","text","size","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),N.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",G2,[e.createElementVNode("td",{colspan:X.value.length+(O.value?1:0),class:"px-0 py-0"},[e.renderSlot(N.$slots,"expanded-row",{row:F,index:L})],8,K2)])):e.createCommentVNode("",!0)],64))),128))])])]),!K.value&&H.value.length>0&&t.showPagination&&S.value?(e.openBlock(),e.createElementBlock("div",X2,[e.createElementVNode("div",Y2,[e.createVNode(e.unref(d_),{"model-value":String(m.value),"onUpdate:modelValue":z[4]||(z[4]=F=>$d(Number(F)))},{default:e.withCtx(()=>[e.createVNode(e.unref(g_),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(b_),{placeholder:String(m.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(u_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(He,F=>e.createVNode(e.unref(m_),{key:F,value:String(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),z[16]||(z[16]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",J2,[z[12]||(z[12]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",Q2,e.toDisplayString(pe.value),1),z[13]||(z[13]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",Z2,e.toDisplayString(Ie.value),1),z[14]||(z[14]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",eS,e.toDisplayString(re.value),1),z[15]||(z[15]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",tS,[e.createVNode(e.unref(n_),{total:re.value,"items-per-page":m.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":$s,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(o_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:F})=>[e.createVNode(e.unref(a_),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(c_),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,(L,J)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[L.type==="page"?(e.openBlock(),e.createBlock(e.unref(s_),{key:J,value:L.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(_t),{class:"w-8 h-8 p-0 text-sm",variant:L.value===f.value?"default":"outline",disabled:L.value===f.value,onClick:ie=>$s(L.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(L.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(r_),{key:L.type,index:J},null,8,["index"]))],64))),256)),e.createVNode(e.unref(l_),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(i_),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(Jt,{modelValue:b.value,"onUpdate:modelValue":z[5]||(z[5]=F=>b.value=F),title:SA.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",onClick:Wd,text:"Cancel"}),e.createVNode(Le,{variant:"default",onClick:BA,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",nS,[e.createElementVNode("p",oS,e.toDisplayString(AA.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(Jt,{modelValue:_.value,"onUpdate:modelValue":z[8]||(z[8]=F=>_.value=F),title:((Y=E.value)==null?void 0:Y.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>{var F;return[e.createVNode(Le,{variant:"outline",onClick:z[6]||(z[6]=L=>_.value=!1),text:"Cancel"}),t.dummyMode&&((F=E.value)!=null&&F.route)?(e.openBlock(),e.createBlock(Le,{key:1,variant:"default",onClick:z[7]||(z[7]=L=>_.value=!1),text:e.unref(l)==="id"?"Tutup":"Close"},null,8,["text"])):(e.openBlock(),e.createBlock(Le,{key:0,variant:"default",onClick:EA,text:"Save"}))]}),default:e.withCtx(()=>{var F,L,J;return[e.createElementVNode("div",rS,[t.dummyMode&&((F=E.value)!=null&&F.route)?(e.openBlock(),e.createElementBlock("div",aS,[e.createElementVNode("div",sS,[e.createVNode(e.unref(te.Search),{class:"w-4 h-4"})]),e.createElementVNode("div",iS,[e.createElementVNode("span",lS,e.toDisplayString(e.unref(l)==="id"?"Info Navigasi":"Navigation Info"),1),e.createElementVNode("p",cS,e.toDisplayString(e.unref(l)==="id"?`Aksi ini akan mengarah ke rute: ${E.value.route}`:`This action will navigate to: ${E.value.route}`),1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((L=E.value)==null?void 0:L.fieldActionCustom)||((J=E.value)==null?void 0:J.fieldActionGlobal)||[],(ie,ge)=>{var be,ye,Te,Be;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ge},[!ie.isHidden&&!(t.dummyMode&&((be=E.value)!=null&&be.route))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(ke(ie))},[e.createElementVNode("div",dS,[e.createVNode(gd,{class:"flex-1 w-full",field:ie,modelValue:y.value[ie.model],"onUpdate:modelValue":De=>y.value[ie.model]=De},null,8,["field","modelValue","onUpdate:modelValue"]),ie.isCopyable||(ye=ie.props)!=null&&ye.isCopyable||((Te=E.value)==null?void 0:Te.action)==="showToken"||((Be=E.value)==null?void 0:Be.action)==="copyToken"?(e.openBlock(),e.createBlock(Le,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:De=>_A(ie.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)],64)}),128))])]}),_:1},8,["modelValue","title"])])}}}),uS={class:"flex items-center gap-2 shrink-0"},fS={class:"flex-1 text-right overflow-hidden"},mS=["title"],No=at(e.defineComponent({name:"DCodeStaticLabel",__name:"DCodeStaticLabel",props:{label:{},value:{},icon:{},color:{}},setup(t){const n=t,o=e.computed(()=>{const a=n.color||"secondary",s={primary:"border-blue-200 text-blue-700",success:"border-green-200 text-green-700",warning:"border-yellow-200 text-yellow-700",danger:"border-red-200 text-red-700",info:"border-cyan-200 text-cyan-700",secondary:"border-slate-200 text-slate-700 dark:border-slate-700/50",dark:"border-b border-gray-300 text-gray-900 dark:text-gray-100"};return s[a]||s.secondary}),r=a=>a==null||a===""?"-":typeof a=="boolean"?a?"Yes":"No":String(a);return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row justify-between items-center gap-4 py-3 px-0 border-b transition-all duration-300 rounded-none bg-transparent",o.value])},[e.createElementVNode("div",uS,[e.createVNode(Dn,{label:t.label,icon:t.icon,class:"text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider"},null,8,["label","icon"])]),e.createElementVNode("div",fS,[e.renderSlot(a.$slots,"value",{},()=>[e.createElementVNode("span",{class:"text-sm font-medium truncate block",title:r(t.value)},e.toDisplayString(r(t.value)),9,mS)],!0)])],2))}}),[["__scopeId","data-v-19682b84"]]),hS={class:"space-y-2 group"},pS=["onClick"],gS=["src","alt"],bS={key:0,class:"absolute inset-0 bg-black/0 group-hover/item:bg-black/20 flex items-center justify-center opacity-0 group-hover/item:opacity-100 transition-all duration-300"},yS={class:"bg-white/90 dark:bg-neutral-800/90 p-1.5 rounded-full shadow-sm"},xS={key:0,class:"flex flex-col h-full"},kS={class:"flex flex-col items-center justify-center p-8 bg-neutral-50 dark:bg-neutral-950/50"},wS=["src","alt"],CS={class:"px-8 py-4 bg-white dark:bg-neutral-900 border-t border-neutral-200 dark:border-neutral-700/50"},BS={class:"flex flex-col space-y-0.5"},Dd=at(e.defineComponent({name:"DCodeStaticImage",__name:"DCodeStaticImage",props:{items:{},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"}},setup(t){const n=t,o=e.computed(()=>Array.isArray(n.items)?n.items.map(d=>typeof d=="string"?{src:d,alt:n.alt}:{...d,alt:d.alt||n.alt}):[]),r=e.ref(null),a=e.ref(!1),s=d=>{n.allowPreview&&(r.value=d,a.value=!0)},i=()=>{r.value=null,a.value=!1},l=e.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${n.columns}, minmax(0, 1fr))`,gap:n.gap,width:n.width||"100%"})),c=e.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(" "));return e.onMounted(()=>{window.addEventListener("keydown",d=>{r.value!==null&&d.key==="Escape"&&i()})}),(d,u)=>(e.openBlock(),e.createElementBlock("div",hS,[e.createElementVNode("div",{style:e.normalizeStyle(l.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(f,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"flex flex-col space-y-1 group/item"},[e.createElementVNode("div",{class:e.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",[t.rounded?"rounded-xl":"rounded-none",t.allowPreview?"cursor-zoom-in":""]]),style:e.normalizeStyle({aspectRatio:t.aspectRatio}),onClick:h=>s(m)},[e.createElementVNode("img",{src:f.src,alt:f.alt,class:e.normalizeClass(c.value),loading:"lazy"},null,10,gS),t.allowPreview?(e.openBlock(),e.createElementBlock("div",bS,[e.createElementVNode("div",yS,[e.createVNode(e.unref(te.Maximize2),{class:"w-3.5 h-3.5 text-neutral-700 dark:text-neutral-200"})])])):e.createCommentVNode("",!0)],14,pS)]))),128))],4),e.createVNode(Jt,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=f=>a.value=f),title:(r.value!==null?o.value[r.value].label:null)||t.label||"Preview Image","max-width":"1200",persistent:!1,onClose:i},{"header-append":e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"p-2 hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-full text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 transition-colors",onClick:i},[e.createVNode(e.unref(te.X),{class:"w-5 h-5"})])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-5 py-2 text-sm font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-700 dark:text-neutral-200 rounded-md hover:bg-neutral-200 dark:hover:bg-neutral-700 transition-colors",onClick:i}," Close Preview ")]),default:e.withCtx(()=>[r.value!==null?(e.openBlock(),e.createElementBlock("div",xS,[e.createElementVNode("div",kS,[e.createElementVNode("img",{src:o.value[r.value].src,alt:o.value[r.value].alt||t.alt,class:"max-w-full max-h-[60vh] object-contain shadow-2xl rounded-sm border border-neutral-200 dark:border-white/10"},null,8,wS)]),e.createElementVNode("div",CS,[e.createElementVNode("div",BS,[e.createVNode(No,{label:"File Name",value:o.value[r.value].src.split("/").pop()||"Untitled"},null,8,["value"]),o.value[r.value].label?(e.openBlock(),e.createBlock(No,{key:0,label:"Item Label",value:o.value[r.value].label},null,8,["value"])):e.createCommentVNode("",!0),t.label?(e.openBlock(),e.createBlock(No,{key:1,label:"Gallery Label",value:t.label},null,8,["value"])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])]))}}),[["__scopeId","data-v-ac931980"]]);function ES(){const t=e.reactive({}),n=e.reactive({}),o=e.reactive({}),r=e.reactive({}),a=e.reactive({}),s=e.ref(!1),i=e.ref(null),l=e.reactive({}),c=e.reactive({visible:!1,title:"",message:"",action:null});return{formData:t,errors:n,fieldErrors:o,wizardState:r,inlineState:a,isSubmitting:s,internalSchema:i,rawItemsCache:l,confirmDialog:c}}const Ur=t=>{var n,o,r;return((n=t.propsForm)==null?void 0:n.key)||((o=t.propsTable)==null?void 0:o.key)||((r=t.propsWizard)==null?void 0:r.key)||t.id},Nn=(t,n)=>n?n.split(".").reduce((o,r)=>o==null?void 0:o[r],t):void 0,Nd=(t,n,o)=>{if(!n)return;const r=n.split(".");let a=t;for(let s=0;s<r.length-1;s++){const i=r[s];(a[i]===void 0||a[i]===null||typeof a[i]!="object")&&(a[i]={}),a=a[i]}a[r[r.length-1]]=o},Mn=t=>{const n=e.toRaw(t);if(Array.isArray(n))return n.map(o=>Mn(o));if(n&&typeof n=="object"){const o={};return Object.keys(n).forEach(r=>o[r]=Mn(n[r])),o}return n},Wr=t=>{if(!t||typeof t!="object")return[];if("var"in t)return[t.var];let n=[];return Object.values(t).forEach(o=>{Array.isArray(o)?o.forEach(r=>{n=n.concat(Wr(r))}):typeof o=="object"&&(n=n.concat(Wr(o)))}),n},_S=t=>t?[...t].sort((n,o)=>(n.seq||0)-(o.seq||0)):[],zs=(t,n)=>{if(!t||typeof t!="string"||t.startsWith("http")||!n)return t;const o=n.replace(/\/$/,""),r=t.startsWith("/")?t:`/${t}`;return`${o}${r}`};function SS({formData:t,errors:n,fieldMap:o,rawItemsCache:r,activeSchema:a,locale:s}){const i=(_,y)=>{if(y==null||typeof y=="object"&&y._isLogicValue)return y;const x=o.value.get(_);if(!x)return y;const E=x.field,M=r[E.key];if(!M||!Array.isArray(M))return y;const $=(E.props||{}).itemValue||"id",v=M.find(I=>String(I[$])===String(y)||String(I.id)===String(y)||String(I.code)===String(y));return v!=null&&v.code?{id:y,code:v.code,_isLogicValue:!0}:y},l=_=>{const y=(x,E)=>{if(x==null||typeof x=="object"&&x._isLogicValue)return x;if(typeof x=="boolean")return String(x);if(typeof x=="number"||typeof x=="string")return E?i(E,x):x;if(typeof x=="object"&&!Array.isArray(x)){const M=(x==null?void 0:x.id)??(x==null?void 0:x.code)??(x==null?void 0:x.value)??(x==null?void 0:x.key)??x;return E&&(typeof M=="string"||typeof M=="number")?i(E,M):M}return x};return new Proxy(_,{get(x,E){if(typeof E!="string")return x[E];const M=o.value.get(E);if(M){const T=Nn(x,M.path);if(T!=null)return y(T,E)}return y(x[E],E)}})},c=e.computed(()=>l(t)),d=(_,y,x="LOGIC")=>{if(_==null||typeof _=="object"&&Object.keys(_).length===0)return!0;if(typeof _=="boolean")return _;if(typeof _=="object")try{return Ft.apply(_,y)}catch(E){return console.error(`[${x}] JsonLogic error:`,E),!1}return!1},u=(_,y,x)=>_==null?null:Array.isArray(_)?_.find(E=>!E.condition||d(E.condition,y))||null:_,f=(_,y)=>{var T;if(_.isHidden)return!0;const x=y?l(y):c.value,E=(T=_.logic)==null?void 0:T.visibleRule;if(E==null)return!0;const M=u(E,x,`VISIBLE-${_.model}`);return M===null?!0:typeof M=="object"?!!d(M,x,`VISIBLE-${_.model}`):!!M},m=(_,y)=>{var T,$,v;const x=y?l(y):c.value,E=(T=_.logic)==null?void 0:T.requiredRule;if(E==null)return(($=_.props)==null?void 0:$.required)||!1;const M=u(E,x,`REQUIRED-${_.model}`);return M===null?((v=_.props)==null?void 0:v.required)||!1:typeof M=="object"?"required"in M?!!M.required:!!d(M,x):!!M},h=(_,y)=>{var T,$,v;const x=y?l(y):c.value,E=(T=_.logic)==null?void 0:T.disabledRule;if(E==null)return(($=_.props)==null?void 0:$.disabled)||!1;const M=u(E,x,`DISABLED-${_.model}`);return M===null?((v=_.props)==null?void 0:v.disabled)||!1:typeof M=="object"?"disabled"in M?!!M.disabled:!!d(M,x):!!M},k=_=>{var T;const y=_.propsForm||_.propsTable||_.propsWizard||_.props||{};let x=s.value==="id"?y.titleID||_.titleID||_.labelID:y.titleEN||_.titleEN||_.labelEN,E=s.value==="id"?y.descriptionID||_.descriptionID:y.descriptionEN||_.descriptionEN;const M=u((T=_.logic||y.logic)==null?void 0:T.labelingRule,c.value);return M&&(x=s.value==="id"?M.labelID||M.titleID||M.title:M.labelEN||M.titleEN||M.title,E=s.value==="id"?M.descriptionID:M.descriptionEN),{title:x,description:E}},C=(_,y)=>{var $,v;if(!_)return!0;const x=_.propsForm||_.propsTable||_.propsWizard||_.props||{},E=($=_.logic||x.logic)==null?void 0:$.visibleRule,M=y?l(y):c.value;if(E!=null){const I=u(E,M);return I===null?!0:typeof I=="object"?!!d(I,M,"VISIBLE-SEC"):!!I}if(_.type==="TABLE"&&((v=x.headers)!=null&&v.length))return!0;const T=x.fields||_.fields||[];return T.length===0||T.some(I=>f(I,y))},w=(_,y)=>{var M;const x=y?l(y):c.value;return u((M=_.logic)==null?void 0:M.labelingRule,x,`LABEL-${_.model}`)||null},p=(_,y)=>{var M;const x=y?l(y):c.value;return u((M=_.logic)==null?void 0:M.lengthRule,x,`LENGTH-${_.model}`)||null},A=(_,y)=>{var I;const x=_.props||{},E=r[_.key]||x.items||x.options||[];if(!((I=_.logic)!=null&&I.optionsFilterRule))return E;const M=y?l(y):c.value,T=u(_.logic.optionsFilterRule,M,`FILTER-${_.model}`);if(!(T!=null&&T.values))return E;const $=new Set((T.values||[]).map(String)),v=x.itemValue||"id";return E.filter(j=>j==null?!1:typeof j!="object"?$.has(String(j)):[v,"code","id","value","key"].some(U=>{const P=j[U];return P!=null&&$.has(String(P))}))},D=_=>{var x;return(((x=_.propsWizard)==null?void 0:x.propsSteps)||[]).filter(E=>C(E)).map((E,M)=>{var v;let T=[];if(Array.isArray(E.sectionsWizard))T=E.sectionsWizard;else if(E.sectionsWizard&&typeof E.sectionsWizard=="object"){const I=E.sectionsWizard;let j=I.type;j||(I.fields?j="FORM":I.isDataTable?j="TABLE":j="UNKNOWN"),T=[{type:j,...I}]}const $=k(E);return{key:E.key||`step-${M}`,title:$.title,description:$.description,icon:E.icon||void 0,sections:T,actions:((v=E.propsComponent)==null?void 0:v.actionComponent)||E.actionComponent||[]}})},S=()=>{var _;if((_=a.value)!=null&&_.sections)for(let y=0;y<3;y++){let x=!1;if(a.value.sections.forEach(E=>{var M;(((M=E.propsForm)==null?void 0:M.fields)||E.fields||[]).forEach(T=>{var v;const $=(v=T.logic)==null?void 0:v.calculateRule;if($&&typeof $=="object"){const I=Object.keys($)[0],j=d($[I],c.value,`CALC-${I}`);j!==void 0&&t[I]!==j&&(t[I]=j,x=!0)}})}),!x)break}},V=_=>{if(!f(_)||!m(_))return!1;const y=t[_.model];return Array.isArray(y)?y.length===0:y==null||y===""},B=_=>_.sections.flatMap(x=>x.fields||[]).some(V),g=_=>{var x;return(((x=_.propsForm)==null?void 0:x.fields)||_.fields||[]).some(V)?!0:_.type==="WIZARD"?D(_).some(B):!1},b=e.computed(()=>{var _;return(_=a.value)!=null&&_.sections?Object.keys(n).length>0?!0:a.value.sections.some(g):!1});return{normalizedData:c,getNormalizedData:l,evaluateLogic:d,resolveActiveRule:u,resolveValueIdentifier:i,getFilteredItems:A,isFieldVisible:f,isFieldRequired:m,isFieldDisabled:h,resolveSectionLabels:k,isSectionVisible:C,resolveFieldLabels:w,resolveFieldLength:p,getWizardTabs:D,applyCalculations:S,isSubmitDisabled:b,resolveSectionGridClass:_=>{switch(_){case"FULL":return"grid-cols-1";case"HALF":return"grid-cols-1 md:grid-cols-2";case"THIRD":return"grid-cols-1 md:grid-cols-3";case"QUARTED":return"grid-cols-1 md:grid-cols-4";case"TWO-THIRD":return"grid-cols-2 md:grid-cols-3";case"THREE-QUARTER":return"grid-cols-3 md:grid-cols-4";default:return"grid-cols-1"}},resolveFieldColumnClass:(_,y="")=>{var E;const x=(E=_.props)==null?void 0:E.colSpan;return x==="FULL"?"col-span-1 md:col-span-full":x==="HALF"?"col-span-1 md:col-span-1":"col-span-1"}}}function AS({formData:t,locale:n,errors:o,fieldMap:r,activeSchema:a,isSectionVisible:s,isFieldVisible:i,isFieldRequired:l,resolveFieldLength:c}){const d=(f,m,h)=>{const k=f.props||f.propsFieldGlobal||{},C=m==null?"":String(m).trim();if(l(f,h)&&C==="")return n.value==="id"?"Wajib diisi":"Required";if(C==="")return null;const w=c==null?void 0:c(f,h),p=Number((w==null?void 0:w.minLength)??k.minLength),A=Number((w==null?void 0:w.maxLength)??k.maxLength);if(!Number.isNaN(p)&&p>0&&C.length<p)return n.value==="id"?`Minimal ${p} karakter`:`Minimum ${p} characters`;if(!Number.isNaN(A)&&A>0&&C.length>A)return n.value==="id"?`Maksimal ${A} karakter`:`Maximum ${A} characters`;if(k.regex)try{if(!new RegExp(k.regex).test(C))return k.regexMessage||(n.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${f.model}:`,k.regex)}return null};return{validateField:d,validateAll:()=>{var m,h;let f=!0;return(h=(m=a.value)==null?void 0:m.sections)==null||h.forEach(k=>{var C;s(k)&&(((C=k.propsForm)==null?void 0:C.fields)||k.fields||[]).forEach(w=>{if(w.model&&i(w)){const p=r.value.get(w.model),A=p?Nn(t,p.path):t[w.model],D=d(w,A);D&&(o[w.model]=D,f=!1)}})}),f}}}function VS({formData:t,activeSchema:n,isSectionVisible:o,isFieldVisible:r,getWizardTabs:a}){const s=()=>{var f;const d=[],u=m=>{m==null||m.forEach(h=>{var C;if(h.type==="TABLE"||h.propsTable){const w=h.propsTable||h;w.modelDatatable&&d.push({key:w.modelDatatable,subFields:(w.headers||[]).map(p=>p.key)})}(((C=h.propsForm)==null?void 0:C.fields)||h.fields||[]).forEach(w=>{var A,D;const p=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(w.component);if(w.model&&((A=w.props)!=null&&A.multiple||((D=w.props)==null?void 0:D.valueType)==="array"||p)){const S=w.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];d.push({key:w.model,subFields:S})}}),h.type==="WIZARD"&&a(h).forEach(w=>u(w.sections))})};return u((f=n.value)==null?void 0:f.sections),d};return{getCleanPayload:()=>{var f;if(!((f=n.value)!=null&&f.sections))return{...t};const d={},u=new Set;return n.value.sections.forEach(m=>{var C,w;if(!o(m))return;const h=Ur(m),k=(p,A)=>{if(p.model)if(r(p)){const D=Nn(t,A?`${A}.${p.model}`:p.model)??t[p.model];d[p.model]=Mn(D)??null,u.add(p.model)}else t[p.model]!==void 0&&(d[p.model]=null)};if((((C=m.propsForm)==null?void 0:C.fields)||m.fields||[]).forEach(p=>{var A;return k(p,h||((A=m.propsForm)==null?void 0:A.key))}),m.type==="WIZARD"&&a(m).forEach(p=>p.sections.forEach(A=>(A.fields||[]).forEach(D=>k(D,p.key)))),(w=m.propsTable)!=null&&w.modelDatatable){const p=m.propsTable.modelDatatable;d[p]=Mn(Nn(t,h?`${h}.${p}`:p)??t[p]),u.add(p)}}),["id","_id"].forEach(m=>{t[m]!==void 0&&!u.has(m)&&(d[m]=Mn(t[m]))}),d},applyFieldMapping:(d,u)=>{const f={},m=h=>h&&typeof h=="object"?h._isLogicValue?h.id:h.id??h.code??h.value??h:h;return Object.entries(u).forEach(([h,k])=>{if(typeof k=="string"){const C=d[h]??Nn(t,h)??t[h];C!==void 0&&(f[k]=m(C))}else if(Array.isArray(k)&&k[0]){const C=k[0],w=Object.keys(C);let p=d[h]??Nn(t,h)??t[h];if(!Array.isArray(p)||p.length===0){const A=s().find(D=>w.some(S=>D.subFields.includes(S)));if(A){const D=d[A.key]??Nn(t,A.key)??t[A.key];Array.isArray(D)&&D.length>0&&(p=D)}}Array.isArray(p)&&(console.log(`[DynamicForm][MAPPING-SOURCE] ${h}:`,Mn(p)),f[h]=p.map((A,D)=>{const S={},V=Mn(A);return Object.entries(C).forEach(([B,g])=>{const b=V[B]??V[g]??A[B]??A[g]??null;S[g]=m(b)}),S}))}}),console.log("[DynamicForm][MAPPING-RESULT]",f),f},handleResponseMapping:(d,u)=>{const f=(d==null?void 0:d.data)!==void 0?d.data:d,m=Array.isArray(f)?f[0]:f;m&&Object.entries(u).forEach(([h,k])=>{const C=m[k]??m[h];C!==void 0&&Nd(t,h,C)})},getFormArrayModels:s}}function DS({state:t,props:n,emit:o,apiUrl:r,router:a,locale:s,mapping:i,validation:l,fieldMap:c,activeSchema:d,resolvedBaseUrl:u}){const f=A=>!A.permission||(n.isEditMode?A.permission!=="CREATE":A.permission!=="UPDATE"),m=A=>{var D,S,V,B;A.requireConfirm?(t.confirmDialog.title=s.value==="id"?((D=A.propCustomMessage)==null?void 0:D.titleID)||"Konfirmasi":((S=A.propCustomMessage)==null?void 0:S.titleEN)||"Confirm",t.confirmDialog.message=s.value==="id"?((V=A.propCustomMessage)==null?void 0:V.messageID)||"Lanjutkan?":((B=A.propCustomMessage)==null?void 0:B.messageEN)||"Continue?",t.confirmDialog.action=A,t.confirmDialog.visible=!0):k(A)},h=()=>{t.confirmDialog.visible=!1,t.confirmDialog.action&&k(t.confirmDialog.action)},k=async A=>{var B,g;const D=A.propsActionGlobal||A.props||{},S=i.applyFieldMapping(i.getCleanPayload(),D.fieldMapping||A.fieldMapping||{});o("action",A,S);const V=D.endpointPropAction||A.endpointPropAction||D.endpoint||A.endpoint;if((D.type==="SUBMIT"||D.type==="ACTION")&&(V!=null&&V.apiUrl)){const b=Pe.loading(s.value==="id"?"Memproses...":"Processing..."),_=zs(V.apiUrl,u.value);try{const y=await r(_,V.apiMethod||"POST",S),x=(y==null?void 0:y.status)===!0||(y==null?void 0:y.success)===!0,E=(y==null?void 0:y.message)||(x?s.value==="id"?"Sukses":"Success":s.value==="id"?"Gagal":"Failed");Pe.update(b,{render:E,type:x?"success":"error",isLoading:!1,autoClose:x?3e3:5e3}),x?((D.fieldMapping||A.fieldMapping)&&i.handleResponseMapping(y,D.fieldMapping||A.fieldMapping),o("success",y)):o("error",y)}catch(y){const x=((g=(B=y.response)==null?void 0:B.data)==null?void 0:g.message)||y.message||(s.value==="id"?"Terjadi kesalahan":"An error occurred");Pe.update(b,{render:`Gagal: ${x}`,type:"error",isLoading:!1,autoClose:5e3}),o("error",y)}}else D.type==="SUBMIT"&&o("submit",S);D.keyRedirect&&D.route&&a&&a.push(D.route)};return{isActionVisible:f,handleGlobalButtonClick:m,confirmAction:h,performAction:k,handleSubmit:async()=>{var A,D;if(l.validateAll()){t.isSubmitting.value=!0;try{const S=i.getCleanPayload(),V=(((A=d.value)==null?void 0:A.actions)||[]).find(g=>{var b;return g.type==="SUBMIT"||g.key==="SUBMIT"||((b=g.propsActionGlobal)==null?void 0:b.type)==="SUBMIT"}),B=(V==null?void 0:V.fieldMapping)||((D=V==null?void 0:V.propsActionGlobal)==null?void 0:D.fieldMapping);o("submit",B?i.applyFieldMapping(S,B):S)}finally{t.isSubmitting.value=!1}}},handleCancel:()=>o("cancel"),handleFieldUpdate:(A,D,S)=>{var B;t.formData[A]=D;const V=(B=c.value.get(A))==null?void 0:B.field;if(V){const g=l.validateField(V,D);g?t.errors[A]=g:delete t.errors[A]}}}}function NS({formData:t,validation:n,locale:o,emit:r,mapping:a}){const s=e.ref(!1),i=e.ref(""),l=e.ref("Plus"),c=e.ref([]),d=e.reactive({}),u=e.reactive({}),f=e.ref(""),m=e.ref(null),h=e.ref(!1),k=e.ref(null),C=e.ref(!1),w=y=>{var x;return!(y!=null&&y.apiUrl)&&!((x=y==null?void 0:y.endpointTable)!=null&&x.apiUrl)},p=y=>{if(!y)return!1;const x=(y.key||"").toLowerCase(),E=(y.permission||"").toUpperCase();return x==="detail"||x.includes("view")||E==="VIEW"},A=y=>Array.isArray(t[y.modelDatatable])?t[y.modelDatatable]:[],D=y=>{var E,M;if((E=y.fields)!=null&&E.length)return y.fields;const x=(y.actionTableGlobal||[]).find(T=>T.permission==="CREATE"||(T.key||"").toLowerCase().includes("add"));return(M=x==null?void 0:x.fieldActionGlobal)!=null&&M.length?x.fieldActionGlobal:(y.headers||[]).filter(T=>T.key&&T.key!=="no").map(T=>({key:T.key,model:T.key,component:"DCodeTextField"}))},S=(y,x)=>{k.value={propsTable:y,row:x},C.value=!0},V=()=>{if(!k.value)return;const{propsTable:y,row:x}=k.value;C.value=!1;const E=t[y.modelDatatable];if(Array.isArray(E)){const M=E.indexOf(x);if(M!==-1)E.splice(M,1);else{const T=JSON.stringify(x,(v,I)=>["no","_index"].includes(v)?void 0:I),$=E.findIndex(v=>JSON.stringify(v,(I,j)=>["no","_index"].includes(I)?void 0:j)===T);$!==-1&&E.splice($,1)}r("update:model",a.getCleanPayload())}},B=(y,x)=>{d[y]=x;const E=c.value.find(M=>M.model===y);if(E){const M=n.validateField(E,x);M?u[y]=M:delete u[y]}},g=(y,x,E)=>{f.value=y.modelDatatable||"",h.value=p(x),m.value=null,i.value=o.value==="id"?x.labelID||"Tambah Data":x.labelEN||"Add Data",l.value=x.icon||"Plus";const M=D(y);c.value=M,Object.keys(d).forEach(T=>delete d[T]),Object.keys(u).forEach(T=>delete u[T]),M.forEach(T=>d[T.model]=E?E[T.model]??null:null),s.value=!0};return{tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,tableRowFormData:d,tableRowErrors:u,activeTableKey:f,editingRowIndex:m,tableDialogViewOnly:h,confirmDeletePending:k,confirmDeleteOpen:C,isTemporaryTable:w,isActionViewOnly:p,tableRows:A,resolveTableFields:D,confirmTableDelete:S,executeTableDelete:V,handleTableRowUpdate:B,openTableRowDialog:g,handleDataTableAction:(y,x)=>{const{action:E,row:M}=x;if(/delete|trash/i.test(E)){const j=t[y.modelDatatable];if(Array.isArray(j)){const U=j.indexOf(M);if(U!==-1)j.splice(U,1);else{const P=JSON.stringify(M,(G,q)=>["no","_index"].includes(G)?void 0:q),R=j.findIndex(G=>JSON.stringify(G,(q,W)=>["no","_index"].includes(q)?void 0:W)===P);R!==-1&&j.splice(R,1)}}return}if(/detail|view/i.test(E)){g(y,{key:"detail",permission:"VIEW"},M);return}const T=y.modelDatatable||"";f.value=T,h.value=!1,i.value=o.value==="id"?"Ubah Data":"Edit Data",l.value="SquarePen";const $=t[T];let v=Array.isArray($)?$.indexOf(M):-1;if(v===-1&&Array.isArray($)){const j=JSON.stringify(M,(U,P)=>["no","_index"].includes(U)?void 0:P);v=$.findIndex(U=>JSON.stringify(U,(P,R)=>["no","_index"].includes(P)?void 0:R)===j)}m.value=v!==-1?v:null;const I=D(y);c.value=I,Object.keys(d).forEach(j=>delete d[j]),I.forEach(j=>d[j.model]=M[j.model]??null),s.value=!0},saveTableRow:()=>{let y=!0;if(c.value.forEach(E=>{const M=n.validateField(E,d[E.model]);M&&(u[E.model]=M,y=!1)}),!y)return;const x=f.value;x&&(t[x]=t[x]||[],m.value!==null?t[x].splice(m.value,1,{...d}):t[x].push({...d}),s.value=!1,r("update:model",a.getCleanPayload()))}}}function MS(t){const{state:n,props:o,emit:r,logic:a,mapping:s,activeSchema:i,fieldMap:l,prefetchFieldItems:c}=t;let d="";const u=new Map,f=new Map,m=(h,k)=>{var V;const C=(V=i.value)==null?void 0:V.sections;if(!C)return;a.applyCalculations();const w=a.getNormalizedData(h),p=(B,g,b,_)=>{const y=B.model,x=a.isFieldVisible(B,b)&&g,E=u.get(y),M=n.formData[y];return u.set(y,x),_&&E===!0&&x===!1&&M!=null&&(console.log(`[DynamicForm][DEBUG][RESET-VISIBLE] ${y} became hidden. Clearing value:`,M),n.formData[y]=Array.isArray(M)?[]:null),x},A=(B,g,b,_)=>{var I,j,U,P,R,G;const y=B.model,x=B.logic,E=Array.isArray((j=(I=B.props)==null?void 0:I.endpoint)==null?void 0:j.keyParam)||Array.isArray((P=(U=B.props)==null?void 0:U.endpointReference)==null?void 0:P.keyParam);if(!x&&!E)return;const M={};let T=!1;["lengthRule","optionsFilterRule","visibleRule","disabledRule"].forEach(q=>{const W=x==null?void 0:x[q];if(!W)return;const Z=a.resolveActiveRule(W,b,`${q}-${y}`),ne=JSON.stringify(Z);M[q]=ne;const ue=f.get(y);(ue==null?void 0:ue[q])!==void 0&&ue[q]!==ne&&(T=!0,console.log(`[DynamicForm][DEBUG][CONTEXT-CHANGE] ${y} rule ${q} changed while tracking.`))});const v=((R=B.props)==null?void 0:R.endpoint)||((G=B.props)==null?void 0:G.endpointReference);Array.isArray(v==null?void 0:v.keyParam)&&v.keyParam.forEach(q=>{const W=b[q],Z=JSON.stringify(W);M[`kp-${q}`]=Z;const ne=f.get(y);(ne==null?void 0:ne[`kp-${q}`])!==void 0&&ne[`kp-${q}`]!==Z&&(T=!0,console.log(`[DynamicForm][DEBUG][CASCADE] ${y} dependency ${q} changed while tracking.`),_&&g&&c(B,!0))}),_&&T&&n.formData[y]!=null&&(console.log(`[DynamicForm][DEBUG][RESET-LOGIC] Context changed for ${y}. Clearing value.`),n.formData[y]=Array.isArray(n.formData[y])?[]:null),f.set(y,M)},D=(B,g,b)=>{var y;if(B.type!=="WIZARD")return;(((y=B.propsWizard)==null?void 0:y.propsSteps)||[]).forEach(x=>{const M=a.isSectionVisible(x,b)&&g;Array.isArray(x.sectionsWizard)?S(x.sectionsWizard,M):x.sectionsWizard&&S([x.sectionsWizard],M)})},S=(B,g=!0)=>{var b;for(const _ of B){const x=a.isSectionVisible(_,h)&&g,E=((b=_.propsForm)==null?void 0:b.fields)||_.fields||[];for(const M of E){if(!M.model)continue;const T=p(M,x,h,k);A(M,T,w,k)}D(_,x,h)}};S(C,!0)};return e.watch(()=>i.value,h=>{var C,w,p,A,D;if(!(h!=null&&h.sections))return;const k=S=>{if(!S)return;const V=["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule"];for(const B of V){const g=S[B];if(Array.isArray(g))for(const b of g)b.condition&&Wr(b.condition);else g&&Wr(g)}};for(const S of h.sections){if(k(S.logic||((C=S.propsForm)==null?void 0:C.logic)),S.type==="WIZARD")for(const B of((w=S.propsWizard)==null?void 0:w.propsSteps)||[])k(B.logic);const V=((p=S.propsForm)==null?void 0:p.fields)||S.fields||[];for(const B of V)k(B.logic),(A=B.logic)!=null&&A.optionsFilterRule&&c(B);if(S.type==="TABLE"&&((D=S.propsTable)!=null&&D.modelDatatable)&&(n.formData[S.propsTable.modelDatatable]=n.formData[S.propsTable.modelDatatable]||[]),S.type==="WIZARD"){const B=Ur(S);n.wizardState[B]===void 0&&(n.wizardState[B]=0)}}m(n.formData,!1)},{immediate:!0}),e.watch(n.formData,h=>{m(h,!0);const k=s.getCleanPayload()||{},C=JSON.stringify(k);C!==d&&(console.log("[DynamicForm][DEBUG][EMIT] Sending updated model to parent:",k),d=C,r("update:model",k))},{deep:!0}),e.watch(()=>o.model,h=>{h&&Object.keys(h).length>0&&JSON.stringify(h)!==d&&Object.entries(h).forEach(([C,w])=>{if(u.get(C)===!1)return;const p=l.value.get(C),A=(p==null?void 0:p.path)||C;Nd(n.formData,A,w)})},{immediate:!0,deep:!0}),{lastEmittedPayload:()=>d}}Ft.add_operation("length",t=>t==null?0:typeof t=="string"||Array.isArray(t)?t.length:typeof t=="number"?String(t).length:typeof t=="object"?Object.keys(t).length:0),Ft.add_operation("==",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null?n==null:n==null?t==null:o(t)&&o(n)?String(t.id)===String(n.id)||String(t.code)===String(n.code):o(t)?String(t.code)===String(n)||String(t.id)===String(n):o(n)?String(n.code)===String(t)||String(n.id)===String(t):typeof t=="boolean"&&typeof n=="string"?String(t)===n:typeof n=="boolean"&&typeof t=="string"?String(n)===t:String(t)===String(n)}),Ft.add_operation("!=",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null&&n==null?!1:t==null||n===null||n===void 0?!0:o(t)&&o(n)?!(String(t.id)===String(n.id)||String(t.code)===String(n.code)):o(t)?!(String(t.code)===String(n)||String(t.id)===String(n)):o(n)?!(String(n.code)===String(t)||String(n.id)===String(t)):String(t)!==String(n)});function PS(t,n){const{t:o,locale:r}=gt.useI18n(),a=e.computed(()=>r.value),{apiUrl:s}=Ke(),i=un.useRouter(),l=ES(),c=e.computed(()=>t.schema||l.internalSchema.value),d=e.computed(()=>{var S;if((S=t.selectedTokenCore)!=null&&S.address)return t.selectedTokenCore.address;if(t.baseUrl)return t.baseUrl}),u=(S,V,B)=>{V.model&&S.set(V.model,{field:V,path:V.model})},f=(S,V)=>{V.key||V.id;const B=Array.isArray(V.sectionsWizard)?V.sectionsWizard:[V.sectionsWizard].filter(Boolean);for(const g of B)if(g.fields)for(const b of g.fields)u(S,b)},m=e.computed(()=>{var B,g,b;const S=new Map,V=(B=c.value)==null?void 0:B.sections;if(!V)return S;for(const _ of V){const y=_.propsForm||_.propsTable||_.props||{};Ur(_);const x=y.fields||_.fields||[];for(const E of x)u(S,E);if(((g=_.type)==null?void 0:g.toUpperCase())==="WIZARD"&&((b=_.propsWizard)!=null&&b.propsSteps))for(const E of _.propsWizard.propsSteps)f(S,E)}return S}),h=SS({formData:l.formData,errors:l.errors,fieldMap:m,rawItemsCache:l.rawItemsCache,activeSchema:c,locale:a}),k=AS({formData:l.formData,locale:a,errors:l.errors,fieldMap:m,activeSchema:c,isSectionVisible:h.isSectionVisible,isFieldVisible:h.isFieldVisible,isFieldRequired:h.isFieldRequired,resolveFieldLength:h.resolveFieldLength}),C=VS({formData:l.formData,activeSchema:c,isSectionVisible:h.isSectionVisible,isFieldVisible:h.isFieldVisible,getWizardTabs:h.getWizardTabs}),w=DS({state:l,props:t,emit:n,apiUrl:s,router:i,locale:a,mapping:C,validation:k,fieldMap:m,activeSchema:c,resolvedBaseUrl:d}),p=NS({formData:l.formData,validation:k,locale:a,emit:n,mapping:C}),A=async(S,V=!1)=>{const B=S.props||{},g=B.endpointReference||B.endpoint;if(g!=null&&g.apiUrl&&!(!V&&l.rawItemsCache[S.key]))try{const b=zs(g.apiUrl,d.value),_={page:1,perPage:100};if(Array.isArray(g.keyParam)){let M=!1;if(g.keyParam.forEach(T=>{const $=h.getNormalizedData(l.formData)[T];$==null||$===""?M=!0:_[T]=$&&typeof $=="object"&&$._isLogicValue?$.id:$}),M){l.rawItemsCache[S.key]=[];return}}const y=await s(b,g.apiMethod||"GET",_),x=(y==null?void 0:y.data)||y;let E=[];Array.isArray(x)?E=x:x&&(E=[x]),l.rawItemsCache[S.key]=E}catch(b){console.error(`[prefetchFieldItems] Error fetching items for ${S.key}:`,b),l.rawItemsCache[S.key]=[]}};MS({state:l,props:t,emit:n,logic:h,mapping:C,fieldMap:m,activeSchema:c,prefetchFieldItems:A});const D=e.computed(()=>{const S={},V=c.value;return V!=null&&V.sections&&V.sections.forEach(B=>{var b,_,y;(((b=B.propsForm)==null?void 0:b.fields)||((_=B.propsTable)==null?void 0:_.fields)||((y=B.props)==null?void 0:y.fields)||[]).forEach(x=>{var E,M,T,$,v,I,j,U,P,R,G;if(x.component==="DCodeRadioCustom"){const q=((E=x.props)==null?void 0:E.name)||"default-group";S[q]||(S[q]=[]);let W=((T=(M=x.props)==null?void 0:M.endpoint)==null?void 0:T.apiUrl)||(($=x.props)==null?void 0:$.apiUrl);W=zs(W,d.value),S[q].push({key:x.key,value:(v=x.props)==null?void 0:v.value,label:((I=x.props)==null?void 0:I.labelID)||((j=x.props)==null?void 0:j.labelEN)||x.key,model:x.model||x.key,apiUrl:W,apiMethod:((P=(U=x.props)==null?void 0:U.endpoint)==null?void 0:P.apiMethod)||((R=x.props)==null?void 0:R.apiMethod),icon:(G=x.props)==null?void 0:G.icon,name:q})}})}),S});return{t:o,locale:a,i18nLocale:r,apiUrl:s,router:i,isSubmitting:l.isSubmitting,internalSchema:l.internalSchema,activeSchema:c,resolvedBaseUrl:d,radioGroups:D,confirmDialog:l.confirmDialog,fieldMap:m,rawItemsCache:l.rawItemsCache,formData:l.formData,errors:l.errors,fieldErrors:l.fieldErrors,inlineState:l.inlineState,wizardState:l.wizardState,getSectionKey:Ur,sortedFields:_S,prefetchFieldItems:A,...h,...C,...w,...p}}const TS={key:0},vS=["value","name"],OS={key:1,class:"flex flex-col gap-1"},FS={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},zS=["src"],RS={key:1,class:"text-sm text-neutral-400 italic"},IS={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},LS={key:3,class:"text-xs text-neutral-400 italic"},Mo=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=gt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,w=>{s.value=w});const i={DCodeTextField:Fn,DCodeAutoComplete:Lo,DCodeDatePicker:_r,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:Yt,DCodeSwitch:Nr,DCodeOtpInput:Vr,DCodeImageField:Ar,DCodeSlider:Dr,DCodeRadio:Es,DCodeRadioCustom:_s,DCodeDynamicUploadList:ms,DCodeMultiSelect:Bs,DCodeCurrencyField:fs,DCodePermissionMenu:As,DCodeTreePermissions:Vs,DCodeCardCheckboxList:us,DCodeBeforeAfter:Ca,DCodeListLabels:Ba},l=e.computed(()=>{const w=r.field.component;return i[w]||null}),c=e.computed(()=>{var p;const w=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return w.includes("image")||w.includes("upload")}),d=e.computed(()=>{var p;const w=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return w.includes("switch")||w.includes("checkbox")}),u=e.computed(()=>{var D,S;const w=r.field.props||r.field.propsFieldGlobal||{},p=((D=r.dynamicLabels)==null?void 0:D.labelID)||w.labelID,A=((S=r.dynamicLabels)==null?void 0:S.labelEN)||w.labelEN;return o.value==="id"?p||A||r.field.model:A||p||r.field.model}),f=e.computed(()=>{const w=r.modelValue;return w==null||w===""?null:Array.isArray(w)?w.map(p=>typeof p=="object"&&p!==null?p.label||p.name||p.code||p.value||JSON.stringify(p):String(p)).join(", "):typeof w=="object"?w.label||w.name||w.code||w.value||w.id||JSON.stringify(w):String(w)}),m=(w,p)=>{const A={label:"",placeholder:""},D=(p==null?void 0:p.labelID)||w.labelID,S=(p==null?void 0:p.labelEN)||w.labelEN;(D||S)&&(A.label=o.value==="id"?D:S);const V=(p==null?void 0:p.placeholderID)||w.placeholderID,B=(p==null?void 0:p.placeholderEN)||w.placeholderEN;return(V||B)&&(A.placeholder=o.value==="id"?V:B),A},h=(w,p)=>{const A=w.endpoint||{};if(!A.apiUrl)return{};const D={};let S=!0;if(Array.isArray(A.keyParam)&&A.keyParam.length>0&&A.keyParam.forEach(B=>{const g=p?p[B]:null;g!=null&&g!==""?D[B]=g:S=!1}),!S)return{};let V=A.apiUrl;if(r.baseUrl&&typeof V=="string"&&!V.startsWith("http")){const B=r.baseUrl.replace(/\/$/,""),g=V.startsWith("/")?V:`/${V}`;V=`${B}${g}`}return{endpoint:{apiUrl:V,apiMethod:A.apiMethod||"GET"},...Object.keys(D).length?{apiParams:D}:{}}},k=e.computed(()=>{var S,V,B;const w=r.field.props||r.field.propsFieldGlobal||{},p={},A=m(w,r.dynamicLabels);if(A.label&&(p.label=A.label),A.placeholder&&(p.placeholder=A.placeholder),p.required=r.required!==void 0?r.required:w.required??!1,["disabled","readonly","clearable","icon","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(g=>{w[g]!==void 0&&w[g]!==null&&(p[g]=w[g])}),p.minLength=((S=r.dynamicLength)==null?void 0:S.minLength)??w.minLength,p.maxLength=((V=r.dynamicLength)==null?void 0:V.maxLength)??w.maxLength,w.valueType&&(p.type=w.valueType),r.error&&(p.error=r.error),Object.assign(p,h(w,r.formData)),(B=w.endpointReference)!=null&&B.apiUrl){let g=w.endpointReference.apiUrl;if(r.baseUrl&&typeof g=="string"&&!g.startsWith("http")){const b=r.baseUrl.replace(/\/$/,""),_=g.startsWith("/")?g:`/${g}`;g=`${b}${_}`}p.endpointReference={...w.endpointReference,apiUrl:g}}return r.options&&r.options.length>0&&(p.items=r.options,p.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete p.endpoint,delete p.apiParams,delete p.apiUrl)),r.baseUrl&&(p.baseUrl=r.baseUrl),p}),C=w=>{s.value=w,a("update:modelValue",w)};return(w,p)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",TS,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,vS)])):t.viewOnly?(e.openBlock(),e.createElementBlock("div",OS,[e.createElementVNode("span",FS,e.toDisplayString(u.value),1),c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:f.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,zS)):(e.openBlock(),e.createElementBlock("span",RS,"-"))],64)):d.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",f.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},e.toDisplayString(f.value?"✓ Ya":"✗ Tidak"),3)):(e.openBlock(),e.createElementBlock("span",IS,e.toDisplayString(f.value||"-"),1))])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:2},k.value,{modelValue:s.value,"onUpdate:modelValue":[p[0]||(p[0]=A=>s.value=A),C]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",LS," Unknown field: "+e.toDisplayString(t.field.component),1))}}),$S={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},jS={key:0,class:"px-4 py-3"},US={class:"text-sm font-semibold text-white"},WS={class:"px-4 py-3 flex items-center gap-2"},HS=e.defineComponent({__name:"DynamicFormSection",props:{section:{},sIdx:{}},setup(t){const n=e.computed(()=>{var b,_;switch((_=(b=t.section)==null?void 0:b.propsForm)==null?void 0:_.layoutColumns){case"FULL":return"grid-cols-1";case"HALF":return"grid-cols-1 md:grid-cols-2";case"THIRD":return"grid-cols-1 md:grid-cols-3";case"QUARTED":return"grid-cols-1 md:grid-cols-4";case"TWO-THIRD":return"grid-cols-2 md:grid-cols-3";case"THREE-QUARTER":return"grid-cols-3 md:grid-cols-4";default:return"grid-cols-1"}}),o=e.inject("dynamicFormContext",{}),{resolveSectionLabels:r,isActionVisible:a,handleGlobalButtonClick:s,locale:i,t:l,handleCancel:c,sortedFields:d,isFieldVisible:u,getDeepValue:f,formData:m,getSectionKey:h,isFieldRequired:k,isFieldDisabled:C,getFilteredItems:w,errors:p,resolveFieldLabels:A,resolveFieldLength:D,resolvedBaseUrl:S,handleFieldUpdate:V}=o,B=g=>typeof d!="function"?[]:d(g||[]);return(g,b)=>{var _,y,x,E,M,T,$,v,I,j;return e.openBlock(),e.createElementBlock("div",$S,[((y=(_=t.section)==null?void 0:_.type)==null?void 0:y.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between mb-2",(x=e.unref(r)(t.section))!=null&&x.title?"bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30":""])},[(E=e.unref(r)(t.section))!=null&&E.title?(e.openBlock(),e.createElementBlock("div",jS,[e.createElementVNode("h3",US,e.toDisplayString(e.unref(r)(t.section).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",WS,[($=(T=(M=t.section)==null?void 0:M.propsForm)==null?void 0:T.actionSection)!=null&&$.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.section.propsForm.actionSection,(U,P)=>{var R,G,q,W,Z,ne,ue,ke;return e.openBlock(),e.createElementBlock(e.Fragment,{key:P},[(R=e.unref(a))!=null&&R(U)?(e.openBlock(),e.createBlock(Le,{key:0,icon:U.icon||((G=U.propsActionGlobal)==null?void 0:G.icon),text:e.unref(i)==="id"?U.labelID||((q=U.propsActionGlobal)==null?void 0:q.labelID):U.labelEN||((W=U.propsActionGlobal)==null?void 0:W.labelEN),"bg-color":((ne=U.bgColor||((Z=U.propsActionGlobal)==null?void 0:Z.bgColor))==null?void 0:ne.toLowerCase())||"primary",variant:((ke=U.variant||((ue=U.propsActionGlobal)==null?void 0:ue.variant))==null?void 0:ke.toLowerCase())||"outline",size:"sm",onClick:me=>{var X;return(X=e.unref(s))==null?void 0:X(U)}},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),t.sIdx===0?(e.openBlock(),e.createBlock(Le,{key:1,size:"sm",icon:"List",text:(v=e.unref(l))==null?void 0:v("common.back"),variant:"outline",onClick:b[0]||(b[0]=U=>{var P;return(P=e.unref(c))==null?void 0:P()})},null,8,["text"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",n.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B((j=(I=t.section)==null?void 0:I.propsForm)==null?void 0:j.fields),U=>{var P,R,G,q,W,Z,ne,ue;return e.openBlock(),e.createElementBlock(e.Fragment,{key:U==null?void 0:U.key},[(P=e.unref(u))!=null&&P(U)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.value)},[e.createVNode(Mo,{field:U,"model-value":(R=e.unref(m))==null?void 0:R[U.model],"form-data":e.unref(m),required:(G=e.unref(k))==null?void 0:G(U),disabled:(q=e.unref(C))==null?void 0:q(U),options:(W=e.unref(w))==null?void 0:W(U),error:(Z=e.unref(p))==null?void 0:Z[U.model],"dynamic-labels":(ne=e.unref(A))==null?void 0:ne(U),"dynamic-length":(ue=e.unref(D))==null?void 0:ue(U),"base-url":e.unref(S),"onUpdate:modelValue":ke=>e.unref(V)(U.model,ke)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64)}),128))],2)])}}}),qS={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},GS=e.defineComponent({__name:"DynamicTableSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{tableRows:o,isTemporaryTable:r,handleDataTableAction:a,locale:s,openTableRowDialog:i,resolveTableFields:l,confirmTableDelete:c,resolvedBaseUrl:d}=n;return(u,f)=>(e.openBlock(),e.createElementBlock("div",qS,[e.createVNode(Yn,{"table-config":t.section.propsTable,data:e.unref(o)(t.section.propsTable),nested:!0,"show-pagination":t.section.propsTable.pagination??!0,"has-actions":e.unref(r)(t.section.propsTable),"base-url":e.unref(d),"dummy-mode":t.dummyMode,onAction:f[0]||(f[0]=m=>e.unref(a)(t.section.propsTable,m))},null,8,["table-config","data","show-pagination","has-actions","base-url","dummy-mode"])]))}}),KS={class:"w-full"},XS={class:"space-y-6 mt-4"},YS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},JS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},QS=e.defineComponent({__name:"DynamicWizardSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{getWizardTabs:o,wizardState:r,getSectionKey:a,isSubmitting:s,isActionVisible:i,locale:l,handleGlobalButtonClick:c,isSectionVisible:d,sortedFields:u,isFieldVisible:f,getDeepValue:m,formData:h,isFieldRequired:k,isFieldDisabled:C,getFilteredItems:w,errors:p,resolveFieldLabels:A,resolveFieldLength:D,resolvedBaseUrl:S,handleFieldUpdate:V,tableRows:B,handleDataTableAction:g,resolveSectionGridClass:b,resolveFieldColumnClass:_}=n;return(y,x)=>{var E;return e.openBlock(),e.createElementBlock("div",KS,[e.createVNode(Ss,{tabs:e.unref(o)(t.section),modelValue:e.unref(r)[e.unref(a)(t.section)],"onUpdate:modelValue":x[0]||(x[0]=M=>e.unref(r)[e.unref(a)(t.section)]=M),"is-vertical":t.section.propsWizard.isVertical,"is-wizard":t.section.propsWizard.isWizard,"type-wizard":((E=t.section.propsWizard.typeWizard)==null?void 0:E.toLowerCase())||"icon",loading:e.unref(s)},e.createSlots({_:2},[e.renderList(e.unref(o)(t.section),M=>({name:`tab-${M.key}`,fn:e.withCtx(()=>[e.createElementVNode("div",XS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.sections,(T,$)=>{var v,I,j;return e.openBlock(),e.createElementBlock(e.Fragment,{key:$},[e.unref(d)(T)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((v=T.type)==null?void 0:v.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",e.unref(b)(T.layoutColumns)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u)(T.fields),U=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:U.key},[e.unref(f)(U)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(_)(U,T.layoutColumns))},[e.createVNode(Mo,{field:U,"model-value":e.unref(h)[U.model],"form-data":e.unref(h),required:e.unref(k)(U),disabled:e.unref(C)(U),options:e.unref(w)(U),error:e.unref(p)[U.model],"dynamic-labels":e.unref(A)(U),"dynamic-length":e.unref(D)(U),"base-url":e.unref(S),"onUpdate:modelValue":P=>e.unref(V)(U.model,P)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((I=T.type)==null?void 0:I.toUpperCase())==="TABLE"||T.isDataTable?(e.openBlock(),e.createElementBlock("div",YS,[e.createVNode(Yn,{"dummy-mode":t.dummyMode,"table-config":T.propsDataTableWizard||T.propsTable,data:e.unref(B)(T.propsDataTableWizard||T.propsTable),nested:!0,"show-pagination":((j=T.propsDataTableWizard||T.propsTable)==null?void 0:j.pagination)??!0,onAction:U=>e.unref(g)(T.propsDataTableWizard||T.propsTable,U)},null,8,["dummy-mode","table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",JS," Unknown section type: "+e.toDisplayString(T.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])])}))]),1032,["tabs","modelValue","is-vertical","is-wizard","type-wizard","loading"])])}}}),ZS={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},eA={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},tA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},nA=e.defineComponent({__name:"DynamicFormDialogs",setup(t){const n=e.inject("dynamicFormContext"),{confirmDialog:o,t:r,confirmAction:a,tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,isFieldVisible:d,tableRowFormData:u,tableDialogViewOnly:f,isFieldRequired:m,isFieldDisabled:h,getFilteredItems:k,tableRowErrors:C,resolveFieldLabels:w,resolveFieldLength:p,resolvedBaseUrl:A,handleTableRowUpdate:D,locale:S,saveTableRow:V,confirmDeleteOpen:B,executeTableDelete:g}=n;return(b,_)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(Jt,{modelValue:e.unref(o).visible,"onUpdate:modelValue":_[1]||(_[1]=y=>e.unref(o).visible=y),title:e.unref(o).title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(r)("common.cancel"),onClick:_[0]||(_[0]=y=>e.unref(o).visible=!1)},null,8,["text"]),e.createVNode(Le,{text:e.unref(r)("common.confirm"),onClick:e.unref(a)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",ZS,e.toDisplayString(e.unref(o).message),1)]),_:1},8,["modelValue","title"]),e.createVNode(Jt,{modelValue:e.unref(s),"onUpdate:modelValue":_[3]||(_[3]=y=>e.isRef(s)?s.value=y:null),title:e.unref(i),icon:e.unref(l),"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(f)?e.unref(S)==="id"?"Tutup":"Close":e.unref(S)==="id"?"Batal":"Cancel",onClick:_[2]||(_[2]=y=>s.value=!1)},null,8,["text"]),e.unref(f)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Le,{key:0,text:"Save",onClick:e.unref(V)},null,8,["onClick"]))]),default:e.withCtx(()=>[e.unref(c).length?(e.openBlock(),e.createElementBlock("div",eA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),y=>(e.openBlock(),e.createElementBlock("div",{key:y.key,class:e.normalizeClass(y.column==="FULL"?"md:col-span-2":"col-span-1")},[e.unref(d)(y,e.unref(u))?(e.openBlock(),e.createBlock(Mo,{key:0,field:y,"model-value":e.unref(u)[y.model],"form-data":e.unref(u),required:e.unref(f)?!1:e.unref(m)(y,e.unref(u)),disabled:e.unref(f)||e.unref(h)(y,e.unref(u)),"view-only":e.unref(f),options:e.unref(k)(y,e.unref(u)),error:e.unref(f)?void 0:e.unref(C)[y.model],"dynamic-labels":e.unref(w)(y,e.unref(u)),"dynamic-length":e.unref(p)(y,e.unref(u)),"base-url":e.unref(A),"onUpdate:modelValue":x=>e.unref(D)(y.model,x)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"]),e.createVNode(Jt,{modelValue:e.unref(B),"onUpdate:modelValue":_[5]||(_[5]=y=>e.isRef(B)?B.value=y:null),title:e.unref(S)==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(S)==="id"?"Batal":"Cancel",onClick:_[4]||(_[4]=y=>B.value=!1)},null,8,["text"]),e.createVNode(Le,{variant:"default","bg-color":"danger",icon:"Trash2",text:e.unref(S)==="id"?"Hapus":"Delete",onClick:e.unref(g)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",tA,e.toDisplayString(e.unref(S)==="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"])]))}}),oA={class:"w-full space-y-6"},Rs=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0},selectedTokenCore:{default:null},dummyMode:{type:Boolean,default:!1}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){const o=t,a=PS(o,n);e.provide("dynamicFormContext",a);const{activeSchema:s,isSectionVisible:i,inlineState:l,isActionVisible:c,locale:d,isSubmitting:u,isSubmitDisabled:f,handleGlobalButtonClick:m,handleSubmit:h}=a;return(k,C)=>{var w,p,A,D,S,V;return e.openBlock(),e.createElementBlock("div",oA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((w=e.unref(s))==null?void 0:w.sections,(B,g)=>{var b,_,y;return e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[((b=B.type)==null?void 0:b.toUpperCase())==="FORM"&&B.propsForm&&e.unref(i)(B)?(e.openBlock(),e.createBlock(HS,{key:0,"dummy-mode":o.dummyMode,section:B,sIdx:Number(g)},null,8,["dummy-mode","section","sIdx"])):((_=B.type)==null?void 0:_.toUpperCase())==="TABLE"&&B.propsTable&&e.unref(i)(B)?(e.openBlock(),e.createBlock(GS,{key:1,"dummy-mode":o.dummyMode,section:B},null,8,["dummy-mode","section"])):((y=B.type)==null?void 0:y.toUpperCase())==="WIZARD"&&B.propsWizard&&e.unref(i)(B)?(e.openBlock(),e.createBlock(QS,{key:2,"dummy-mode":o.dummyMode,section:B},null,8,["dummy-mode","section"])):e.createCommentVNode("",!0)],64)}),128)),(p=e.unref(l))!=null&&p.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((D=(A=e.unref(s))==null?void 0:A.ui)==null?void 0:D.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(V=(S=e.unref(s))==null?void 0:S.actionGlobal)!=null&&V.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(s).actionGlobal,(B,g)=>{var b,_,y;return e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[B.propsActionGlobal&&e.unref(c)(B)?(e.openBlock(),e.createBlock(Le,{key:0,icon:B.propsActionGlobal.icon,text:e.unref(d)==="id"?B.propsActionGlobal.labelID:B.propsActionGlobal.labelEN,"bg-color":((b=B.propsActionGlobal.bgColor)==null?void 0:b.toLowerCase())||"primary",variant:((_=B.propsActionGlobal.variant)==null?void 0:_.toLowerCase())||"default",loading:e.unref(u),disabled:e.unref(f)&&(B.permission==="CREATE"||B.permission==="UPDATE"||((y=B.propsActionGlobal)==null?void 0:y.key)==="submit"),onClick:x=>e.unref(m)(B)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0)],2)),e.createVNode(nA)])}}}),rA={"aria-label":"Breadcrumb"},aA={class:"flex flex-wrap items-center text-sm md:text-base"},sA={class:"truncate max-w-[100px] sm:max-w-[150px] md:max-w-none"},Md=e.defineComponent({__name:"Breadcrumb",props:{items:{},showHomeIcon:{type:Boolean,default:!0},iconSize:{default:18},separatorSize:{default:16},separatorType:{default:"chevron"},strokeWidth:{default:2}},setup(t){const n=t,o=te.Home,r=n.separatorType==="slash"?te.Slash:te.ChevronRight;return(a,s)=>(e.openBlock(),e.createElementBlock("nav",rA,[e.createElementVNode("ol",aA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(i,l)=>(e.openBlock(),e.createElementBlock("li",{key:l,class:"flex items-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.to?"router-link":"span"),{to:i.to,class:e.normalizeClass(["inline-flex items-center gap-1.5 transition-all duration-200 rounded-lg font-medium",i.to?"text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/20 cursor-pointer":"dark:text-gray-100 bg-primary-50 dark:bg-primary-900/30 text-primary-700"])},{default:e.withCtx(()=>[i.icon||l===0&&t.showHomeIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.icon||e.unref(o)),{key:0,size:t.iconSize,class:e.normalizeClass(["flex-shrink-0",i.to?"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-400":"text-primary-600 dark:text-primary-400",i.iconClass||""]),"stroke-width":t.strokeWidth},null,8,["size","class","stroke-width"])):e.createCommentVNode("",!0),e.createElementVNode("span",sA,e.toDisplayString(i.label),1)]),_:2},1032,["to","class"])),l<t.items.length-1?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{key:0,size:t.separatorSize,class:"mx-1.5 text-gray-300 dark:text-gray-700 flex-shrink-0"},null,8,["size"])):e.createCommentVNode("",!0)]))),128))])]))}});function Pd(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const iA={class:"w-full space-y-6 animate-pulse"},lA={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},cA=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",iA,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",lA,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),dA={class:"w-full"},uA={class:"relative mx-auto min-h-[37.5rem]"},fA={key:"content",class:"w-full"},mA={class:"mb-6"},hA={class:"text-neutral-500 dark:text-neutral-400"},pA={key:"skeleton",class:"w-full"},gA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Is=at(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{},selectedTokenCore:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var E,M,T,$,v,I,j,U;const o=t,r=n,a=(M=(E=e.getCurrentInstance())==null?void 0:E.appContext)==null?void 0:M.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const P=un.useRoute();if(P&&Object.keys(P).length>0)s=P;else{const R=e.getCurrentInstance();(v=($=(T=R==null?void 0:R.appContext)==null?void 0:T.config)==null?void 0:$.globalProperties)!=null&&v.$route&&(s=R.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:P=>{typeof window<"u"&&(typeof P=="string"?window.location.href=P:P&&P.path&&(window.location.href=P.path))},__isFallback:!0};try{const P=un.useRouter();if(P)i=P;else{const R=e.getCurrentInstance();(U=(j=(I=R==null?void 0:R.appContext)==null?void 0:I.config)==null?void 0:j.globalProperties)!=null&&U.$router&&(i=R.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=Ke();let d;try{d=gt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=Pd(),f=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const m=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const P=s.path.match(/\/edit\/([^\/]+)$/);return P?P[1]:null}),h=e.ref({}),k=e.ref(null),C=e.ref(!0),w=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",A="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",D=e.ref(o.layoutCode),S=e.computed(()=>{var G;if(!k.value)return"";const P=((G=d==null?void 0:d.value)==null?void 0:G.toLowerCase())||"en";return(P==="en"||P.startsWith("en-")?k.value.titleEN:k.value.titleID)||k.value.title||o.layoutCode});e.watch(S,P=>{P&&u(P)},{immediate:!0});const V=(P,R="")=>{const G={};return!P||typeof P!="object"||Object.keys(P).forEach(q=>{const W=P[q],Z=R?`${R}.${q}`:q;W&&typeof W=="object"&&!Array.isArray(W)&&!(W instanceof Date)&&Object.assign(G,V(W,Z)),G[Z]=W}),G},B=P=>{var W;if(!P||typeof P!="string"||P.startsWith("http"))return P;const R=(W=o.selectedTokenCore)==null?void 0:W.address;if(!R)return P;const G=R.replace(/\/$/,""),q=P.startsWith("/")?P:`/${P}`;return`${G}${q}`},g=async()=>{var P,R,G,q,W,Z;C.value=!0;try{let ne=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(ne=s.query.code||o.layoutCode);const ue="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",ke=ue?{Authorization:`Bearer ${ue}`}:{},me=B(`${p}${ne}`);let X=await l(me,"GET",null,ke);if(!X.status||!X.data||Array.isArray(X.data)&&X.data.length===0)try{const O=B(`${A}${ne}`),K=await l(O,"GET",null,ke);if(K.status){const ee=Array.isArray(K.data)?K.data[0]:K.data;ee&&ee.code&&(ne=ee.code,D.value=ne,X=await l(B(`${p}${ne}`),"GET",null,ke))}}catch(O){console.warn("Failed to resolve layout code via datatable",O)}if(X.status){k.value=Array.isArray(X.data)?X.data[0]:X.data;const O={};if((P=k.value)!=null&&P.sections&&k.value.sections.forEach(K=>{((K.propsForm||K.props||{}).fields||K.fields||[]).forEach(Ve=>{var ze;const Ne=Ve.model||((ze=Ve.props)==null?void 0:ze.model)||Ve.key;Ne&&(O[Ne]=null)})}),h.value=O,C.value=!1,f.value&&m.value){w.value=!0;try{const K=(q=(G=(R=k.value.sections)==null?void 0:R[0])==null?void 0:G.propsForm)==null?void 0:q.endpointForm,ee=k.value.endpointForm,he=K||ee;if(he!=null&&he.apiUrl){const Ve=he.apiUrl,Ne=he.apiMethod||"GET",ze=he.keyParam||[],Re={};ze.length>0?ze.forEach(Me=>{Re[Me]=m.value}):Re.id=m.value;const Ue=await c(B(Ve),Ne,Re);if(console.log(`[AutoLayoutForm] API Result for ${Ve}:`,Ue),Ue.status){let Me=Array.isArray(Ue.data)?Ue.data[0]:Ue.data;Ue.payload&&(Me={...Me,...Ue.payload}),console.log("[AutoLayoutForm] Successfully fetched record:",Me);const Ze=V(Me);h.value={...h.value,...Me,...Ze},console.log("[AutoLayoutForm] Updated initialData:",h.value)}else console.warn("[AutoLayoutForm] Record API returned status: false",Ue)}else if((W=k.value.endpointGlobal)!=null&&W.apiUrl){const Ve=k.value.endpointGlobal.apiUrl,Ne=k.value.endpointGlobal.apiMethod||"GET",ze={id:m.value},Re=await c(B(Ve),Ne,ze);if(Re.status){const Ue=Array.isArray(Re.data)?Re.data[0]:Re.data,Me=V(Ue);h.value={...h.value,...Ue,...Me}}}else{const Ve=((Z=k.value.endpoint)==null?void 0:Z.detailUrl)||`/api/${D.value}/detail/${m.value}`,Ne=await l(B(Ve),"GET");if(Ne.status){let ze=Array.isArray(Ne.data)?Ne.data[0]:Ne.data;if(Ne.payload){const Me={...Ne.payload};if(Object.keys(Me).forEach(Ze=>{ze[Ze]!==void 0&&ze[Ze]!==null&&(Me[Ze]=ze[Ze])}),!("id"in Me)&&ze.id){const Ze=Object.keys(Me).find(ct=>ct.startsWith("id")&&ct.length>2&&!Me[ct]);Ze&&(Me[Ze]=ze.id)}ze=Me}const Re={...ze};Object.keys(h.value).forEach(Me=>{if(Re[Me]===void 0||Re[Me]===null){if(Me.toLowerCase().startsWith("id")&&Me.length>2){const ct=Me.substring(2).toLowerCase(),St=Array.isArray(Ne.data)?Ne.data[0]:Ne.data,H=Object.keys(St).find(re=>re.toLowerCase()===ct);H&&St[H]&&typeof St[H]=="object"&&"id"in St[H]&&(Re[Me]=St[H].id)}if(Me==="idSupervisor"){const ct=Array.isArray(Ne.data)?Ne.data[0]:Ne.data;ct.supervisorId&&(Re[Me]=ct.supervisorId)}}});const Ue=V(Re);h.value={...h.value,...Re,...Ue}}}}catch(K){console.error("Failed to fetch record data:",K)}finally{w.value=!1}}}}catch(ne){console.error("Failed to load form layout:",ne),C.value=!1}},b=P=>{const R=Object.keys(h.value||{}).filter(q=>h.value[q]!==null&&h.value[q]!==void 0),G=Object.keys(P||{}).filter(q=>P[q]!==null&&P[q]!==void 0);if(R.length>3&&G.length<R.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:R.length,incomingCount:G.length,data:P});return}console.log("[AutoLayoutForm] Allowing model update:",P),h.value=P,r("update:model",P)},_=async P=>{var R,G,q;try{const W=(q=(G=(R=k.value.sections)==null?void 0:R[0])==null?void 0:G.propsForm)==null?void 0:q.endpointForm,Z=k.value.endpointGlobal||k.value.endpoint,ne=(W==null?void 0:W.submitUrl)||(Z==null?void 0:Z.submitUrl)||`/api/generic/${o.layoutCode}`,ue=(W==null?void 0:W.submitMethod)||(Z==null?void 0:Z.submitMethod)||(f.value?"PUT":"POST"),ke=Object.values(P).some(X=>X instanceof File||X instanceof Blob);let me;ke?(me=new FormData,Object.keys(P).forEach(X=>{const O=P[X];O!=null&&(Array.isArray(O)?O.forEach(K=>me.append(`${X}[]`,K)):me.append(X,O))})):(me={...P},f.value&&m.value&&!me.id&&(me.id=m.value)),await l(B(ne),ue,me),r("submit-success",me),i.back()}catch(W){console.error("Submit failed:",W)}},y=async(P,R,G)=>{if(P==="cancel"){x();return}const q=R.endpointPropAction||R.propsActionGlobal&&R.propsActionGlobal.endpointPropAction;if(q)try{C.value=!0;const W=G?{...G}:{...h.value};f.value&&R.model&&m.value&&(W[R.model]=m.value);const Z=q.apiUrl,ne=q.apiMethod||"POST";(await c(B(Z),ne,W)).status&&(r("action-success",P,R,W),i.back())}catch(W){console.error("Action failed:",W)}finally{C.value=!1}},x=()=>{r("cancel"),i.back()};return e.onMounted(()=>{g()}),e.watch(()=>o.model,P=>{P&&Object.keys(P).length>0&&(h.value={...h.value,...P})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(P,R)=>(e.openBlock(),e.createElementBlock("div",dA,[e.createElementVNode("div",uA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!C.value&&k.value?(e.openBlock(),e.createElementBlock("div",fA,[e.createElementVNode("div",mA,[e.createElementVNode("p",hA,e.toDisplayString(k.value.description),1)]),e.createVNode(Rs,{schema:k.value,model:h.value,"is-edit-mode":f.value,loading:w.value,"selected-token-core":o.selectedTokenCore,"onUpdate:model":R[0]||(R[0]=G=>b(G)),onSubmit:_,onCancel:x,onAction:y,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core"])])):C.value?(e.openBlock(),e.createElementBlock("div",pA,[e.createVNode(cA)])):(e.openBlock(),e.createElementBlock("div",gA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-3c619a9c"]]),bA={class:"h-full flex flex-col"},yA={key:1,class:"flex-1 flex items-center justify-center"},xA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Ls=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var V,B,g,b,_,y;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=Ke();let i={query:{},params:{},path:""};try{const x=un.useRoute();x?i=x:(g=(B=(V=a==null?void 0:a.appContext)==null?void 0:V.config)==null?void 0:B.globalProperties)!=null&&g.$route&&(i=a.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:x=>{typeof window<"u"&&(typeof x=="string"?window.location.href=x:x&&x.path&&(window.location.href=x.path))}};try{const x=un.useRouter();x?l=x:(y=(_=(b=a==null?void 0:a.appContext)==null?void 0:b.config)==null?void 0:_.globalProperties)!=null&&y.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),f=e.ref(!0),m=e.ref(null),h="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",k=e.computed(()=>`${h}${o.layoutCode}`),{setPageTitle:C}=Pd();let w;try{w=gt.useI18n().locale}catch{w=e.ref("en")}const p=()=>{if(u.value){const E=(w.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";C(E)}};e.watch(w,()=>{p()});const A=async()=>{f.value=!0;try{const x="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",E=x?{Authorization:`Bearer ${x}`}:{},M=await s(k.value,"GET",null,E);M.status&&(u.value=Array.isArray(M.data)?M.data[0]:M.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(x){console.error("Gagal Menampilkan Datatable:",x)}finally{f.value=!1}},D=x=>{x.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",x.action,x)},S=x=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",x);let E=x.route;const M=x.path;if(!E&&M){const $=((i==null?void 0:i.path)||"").split("/");$.length>=2&&(E=`/${$[1]}/create`)}if(E||M){const T={...x.query||{},code:M||void 0};Object.keys(T).forEach($=>T[$]===void 0&&delete T[$]),console.log("[DEBUG] Emitting navigate to parent:",{route:E,query:T}),r("navigate",{route:E||"/form",query:T}),l&&!l.__isFallback&&l.push({path:E||"/form",query:T})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{A()}),(x,E)=>(e.openBlock(),e.createElementBlock("div",bA,[!f.value&&u.value?(e.openBlock(),e.createBlock(Yn,{key:0,ref_key:"dtRef",ref:m,"api-url":k.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:D,onNavigate:S},{"header-actions":e.withCtx(()=>[...E[0]||(E[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",yA,[...E[1]||(E[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",xA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),Td=e.defineCustomElement(Is),vd=e.defineCustomElement(Ls);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",Td),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",vd));const kA=[Lo,fi,Le,qi,Ca,Ba,nd,Yt,us,fs,_r,Jt,sd,Sr,id,xs,ms,ld,ws,Ar,Cs,Dn,Bs,Vr,cd,dd,Es,_s,Dr,Nr,Fn,qn,hd,pd,Ss,As,Vs,Fs,No,Dd,Yn,Is,Ls,Rs,Md,Mo],Od={install(t,n={}){n&&Object.keys(n).length>0&&Ws(n),kA.forEach(o=>{o.name&&t.component(o.name,o)})}};ae.AutoLayoutDatatable=Ls,ae.AutoLayoutForm=Is,ae.Breadcrumb=Md,ae.DCodeAutoComplete=Lo,ae.DCodeBadge=Fs,ae.DCodeBeforeAfter=Ca,ae.DCodeButton=Le,ae.DCodeCard=qi,ae.DCodeCardCheckboxList=us,ae.DCodeChart=nd,ae.DCodeCheckbox=Yt,ae.DCodeCurrencyField=fs,ae.DCodeDatePicker=_r,ae.DCodeDialog=Jt,ae.DCodeDialogCloseBtn=sd,ae.DCodeDropzone=Sr,ae.DCodeDynamicUploadList=ms,ae.DCodeFileField=id,ae.DCodeFileResult=xs,ae.DCodeIconDropdown=ld,ae.DCodeImageCropperDialog=ws,ae.DCodeImageField=Ar,ae.DCodeImageResult=Cs,ae.DCodeInfiniteAutoComplete=fi,ae.DCodeLabel=Dn,ae.DCodeListLabels=Ba,ae.DCodeMultiSelect=Bs,ae.DCodeOtpInput=Vr,ae.DCodePermissionMenu=As,ae.DCodeProgress=cd,ae.DCodeProgressBar=dd,ae.DCodeRadio=Es,ae.DCodeRadioCustom=_s,ae.DCodeSlider=Dr,ae.DCodeStaticImage=Dd,ae.DCodeStaticLabel=No,ae.DCodeSwitch=Nr,ae.DCodeTextField=Fn,ae.DCodeTextarea=qn,ae.DCodeTimelineWithIcons=hd,ae.DCodeTreePermissions=Vs,ae.DCodeUploadFile=pd,ae.DCodeWizard=Ss,ae.DataTable=Yn,ae.DataTableComponent=Yn,ae.DynamicForm=Rs,ae.DynamicFormField=Mo,ae.DynamicUI=Od,ae.MicroDynamicDatatable=vd,ae.MicroDynamicForm=Td,ae.cn=_e,ae.default=Od,ae.setApiConfig=Ws,Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
95
|
+
`});return(A,k)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(So),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",z1,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",I1,[t.showValue?(e.openBlock(),e.createElementBlock("div",R1,[e.createElementVNode("span",L1,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",$1,e.toDisplayString(h.value),1),e.createElementVNode("span",j1,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",U1,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${x.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(f.value),onInput:C,onChange:y,onMousedown:p,onMouseup:S,onTouchstart:p,onTouchend:S},null,42,W1)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",H1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,g=>(e.openBlock(),e.createElementBlock("div",{key:g.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${V(g.value)}%`,transform:"translateX(-50%)"})},[k[0]||(k[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",q1,e.toDisplayString(g.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",G1,[k[1]||(k[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.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)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),X1={key:0,class:"ml-1 text-destructive"},Y1={class:"inline-flex items-center gap-3"},J1=["id","name","aria-checked","aria-label","disabled"],Q1={key:0,class:"absolute inset-0 flex items-center justify-center"},Z1={class:"relative z-10 flex items-center gap-2"},eC=["id","name","aria-checked","aria-label","disabled"],tC={key:0,class:"absolute inset-0 flex items-center justify-center"},nC={name:"DCodeSwitch"},Nr=e.defineComponent({...nC,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(r("update:modelValue",f),r("change",f))}}),s=e.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=e.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(o.readonly)return a.value?"bg-blue-400 opacity-80":"bg-gray-200 opacity-80";if(!a.value)return"bg-gray-200";switch(o.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=()=>{o.disabled||o.readonly||o.loading||(a.value=!a.value)},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["grid gap-3",o.disabled?"cursor-not-allowed":""])},[t.title?(e.openBlock(),e.createBlock(So,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",X1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",Y1,[e.createVNode(e.unref(Wi),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(ji),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(Hi),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-default opacity-80":t.readonly&&!t.loading,"cursor-pointer":!t.disabled&&!t.loading&&!t.readonly}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",Q1,[...m[0]||(m[0]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,J1)]),_:1}),e.createVNode(e.unref(Ui),{side:"top","side-offset":8,class:e.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",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",Z1,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.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":t.disabled,"cursor-wait":t.loading,"cursor-default opacity-80":t.readonly&&!t.loading,"cursor-pointer":!t.disabled&&!t.loading&&!t.readonly}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.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"])},[t.loading?(e.openBlock(),e.createElementBlock("span",tC,[...m[1]||(m[1]=[e.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"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.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)])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(te.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,eC))]),_:1})])],2))}}),oC=["aria-busy"],rC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},aC=["for"],sC={key:0,class:"ml-1 text-destructive"},iC={class:"relative w-full group"},lC=["id","value"],cC={key:0,class:"absolute top-1 right-2"},dC={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"},uC={key:1,class:"text-xs text-destructive"},Hn=e.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const K=o.required,z=o["aria-required"];return K===""||K===!0||K==="true"||(z==="true"||z===!0)}),u=e.computed(()=>{const{label:K,class:z,id:G,required:ee,"aria-required":he,...De}=o,Ae={...De};return a.disabled&&(Ae.disabled=!0),a.readonly&&(Ae.readonly=!0),Ae}),f=e.computed(()=>{const K=o.maxlength;let z=Number.NaN;return typeof K=="number"?z=K:typeof K=="string"&&(z=Number.parseInt(K,10)),Number.isFinite(z)&&z>0?z:-1}),m=K=>f.value>0?K.slice(0,f.value):K,h=e.computed(()=>{const K=a.modelValue;return K==null||String(K).length===0}),x=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!h.value:!0:!1),C=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,K=>{const z=String(K??"");z!==C.value&&(C.value=z)});const y=e.ref(!1),p=e.ref(!1),S=K=>K.split(/(\s+)/).map(z=>{if(z.trim()==="")return z;const G=z.toLowerCase();return G.charAt(0).toUpperCase()+G.slice(1)}).join(""),V=K=>{const z=K.toLowerCase(),G=z.search(new RegExp("\\p{L}","u"));return G<0?z:z.slice(0,G)+z.charAt(G).toUpperCase()+z.slice(G+1)},E=K=>{switch(a.textCase){case"uppercase":return K.toUpperCase();case"lowercase":return K.toLowerCase();case"titlecase":return S(K);case"sentencecase":return V(K);case"none":default:return K}},A=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),k=K=>{if(!K)return null;const z=Array.isArray(K)?K.join(""):K;return z?new Set(z):null},g=e.computed(()=>k(a.allowChars)),b=(K,z)=>(K.lastIndex=0,K.test(z)),M=K=>{if(K===`
|
|
96
|
+
`)return a.valueType!=="number";if(a.valueType==="free")return!0;const z=K===" ",G=/\d/.test(K),ee=new RegExp("\\p{L}","u").test(K),he=new RegExp("\\p{N}","u").test(K);return a.valueType==="number"?G:a.valueType==="letter"?ee||a.allowSpaces&&z:a.valueType==="letternumber"?ee||he||a.allowSpaces&&z:!0},w=K=>{let z="";for(const G of K){const ee=!!g.value&&g.value.has(G);a.pattern&&!ee&&!b(a.pattern,G)||!ee&&!M(G)||(z+=G)}return z},_=K=>{const z=w(K),G=a.applyTextCaseToValue?E(z):z;return m(G)};let B=null;const D=K=>{if(K==="")return null;if(a.valueType==="number"&&a.returnNumber){const z=K.replaceAll(`
|
|
97
|
+
`,""),G=Number(z);return Number.isFinite(G)?G:null}return K},N=K=>{C.value=K,r("update:modelValue",D(K))},O=(K,z)=>{const G=m(z);p.value=!0,K.value=G,N(G),queueMicrotask(()=>p.value=!1)},v=(K,z)=>{const G=K.selectionStart??K.value.length,ee=K.selectionEnd??K.value.length;if(f.value>0){const he=K.value.length-(ee-G),De=f.value-he;if(De<=0)return;z=z.slice(0,De)}K.setRangeText(z,G,ee,"end"),O(K,_(K.value))},L=K=>{var ee;if(!B||y.value||p.value||!((ee=K.inputType)!=null&&ee.startsWith("insert")))return;const z=K.data;if(z==null)return;const G=_(z);G!==z&&(K.preventDefault(),G.length>0&&v(B,G))},$=K=>{var ee;if(!B||y.value||p.value)return;const z=((ee=K.clipboardData)==null?void 0:ee.getData("text"))??"",G=_(z);G!==z&&(K.preventDefault(),G.length>0&&v(B,G))},U=async K=>{if(!B||y.value||p.value)return;const z=K.target,G=z.value??"",ee=_(G);if(ee===G){const he=z.selectionStart??ee.length,De=z.selectionEnd??ee.length;O(z,ee),await e.nextTick();try{z.setSelectionRange(he,De)}catch{}N(ee)}else{const he=z.selectionStart??ee.length,De=z.selectionEnd??ee.length;O(z,ee),await e.nextTick();try{z.setSelectionRange(he,De)}catch{}}},P=()=>y.value=!0,F=()=>{if(y.value=!1,!B)return;const K=B.value??"",z=_(K);z===K?N(z):O(B,z)};e.onMounted(()=>{if(B=document.getElementById(c.value),!B)return;B.addEventListener("beforeinput",L),B.addEventListener("paste",$),B.addEventListener("input",U),B.addEventListener("compositionstart",P),B.addEventListener("compositionend",F);const K=B.value??"",z=_(K);z===K?N(z):O(B,z)}),e.onBeforeUnmount(()=>{B&&(B.removeEventListener("beforeinput",L),B.removeEventListener("paste",$),B.removeEventListener("input",U),B.removeEventListener("compositionstart",P),B.removeEventListener("compositionend",F),B=null)});const X=()=>{C.value="",B&&(B.value=""),r("update:modelValue",null),r("clear")},q=e.computed(()=>C.value.length),W=e.computed(()=>a.showCharCount?f.value>0:!1),Z=e.computed(()=>W.value&&q.value>0),ne=e.computed(()=>`${q.value} / ${f.value}`),ue=e.computed(()=>!!a.error),ke=e.computed(()=>{const K=o.rows,z=typeof K=="number"?K:Number.parseInt(String(K??""),10);return Number.isFinite(z)&&z>0?z:3}),fe=e.computed(()=>({height:`${ke.value*24+16}px`}));return(K,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",[e.unref(o).class,a.disabled?"cursor-not-allowed":""]]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",rC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(fe.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",sC,"*")):e.createCommentVNode("",!0)],8,aC)):e.createCommentVNode("",!0),e.createElementVNode("div",iC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:C.value},u.value,{style:`text-transform: ${A.value}; padding-right: ${x.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",ue.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,lC),x.value?(e.openBlock(),e.createElementBlock("div",cC,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:X}," ✕ ")])):e.createCommentVNode("",!0),Z.value&&!ue.value?(e.openBlock(),e.createElementBlock("p",dC,e.toDisplayString(ne.value),1)):e.createCommentVNode("",!0)]),ue.value?(e.openBlock(),e.createElementBlock("p",uC,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,oC)),[[e.vShow,i.value]])}}),ud=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(me.AvatarRoot),{class:e.normalizeClass(e.unref(_e)(e.unref(fC)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),fd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(me.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),md=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(me.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),fC=Ho("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"}}}),Mr=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(me.Separator),e.mergeProps(e.unref(o),{class:e.unref(_e)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),mC={class:"bg-card text-card-foreground"},hC={class:"pb-6 px-3"},pC={key:0,class:"flex justify-center p-8"},gC={key:1,class:"p-8 text-center text-red-500"},bC={key:2,class:"relative"},yC={class:"space-y-6"},xC={class:"rounded-xl border bg-card text-card-foreground shadow"},kC={class:"p-4"},wC={class:"flex items-center justify-between gap-3"},CC={class:"font-medium"},BC={class:"text-xs text-muted-foreground"},EC={class:"mt-1 text-sm text-muted-foreground"},_C={class:"text-foreground"},SC={class:"text-foreground"},AC={class:"mt-1 text-xs text-muted-foreground"},VC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},DC={class:"flex items-center justify-between gap-3"},NC={class:"font-medium"},MC={class:"text-xs text-muted-foreground"},PC={class:"mt-2 text-sm text-muted-foreground"},TC={class:"flex flex-wrap items-center justify-between gap-3"},vC={class:"flex items-center gap-3"},OC={class:"leading-tight"},FC={class:"text-sm font-medium"},zC={class:"text-xs text-muted-foreground"},IC={class:"flex items-center gap-2"},RC={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},LC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},$C=["src"],jC={class:"flex-1"},UC={class:"flex items-center justify-between gap-3"},WC={class:"font-medium"},HC={class:"text-xs text-muted-foreground"},qC={class:"mt-1 text-sm text-muted-foreground"},GC={class:"text-left sm:text-center"},KC={class:"text-xs text-muted-foreground"},XC={class:"text-left sm:text-center"},YC={class:"text-xs text-muted-foreground"},JC={class:"text-left sm:text-center"},QC={class:"text-xs text-muted-foreground"},ZC={class:"flex items-center justify-between gap-3"},eB={class:"font-medium"},tB={class:"text-xs text-muted-foreground"},nB={class:"mt-2 text-sm text-muted-foreground"},oB={class:"mt-3 flex items-center gap-3"},rB={class:"text-sm font-medium"},aB={class:"flex items-start justify-between gap-3"},sB={class:"font-medium"},iB={class:"mt-3 grid gap-2 text-sm"},lB={class:"flex items-center justify-between gap-3"},cB={class:"flex items-center gap-2 text-muted-foreground"},dB={class:"font-medium"},uB={class:"flex items-center justify-between gap-3"},fB={class:"flex items-center gap-2 text-muted-foreground"},mB={class:"font-medium"},hB={class:"flex items-center justify-between gap-3"},pB={class:"flex items-center gap-2 text-muted-foreground"},gB={class:"font-medium"},bB={class:"flex items-center justify-between"},yB={class:"flex items-center gap-2"},xB={class:"flex items-start justify-between gap-3"},kB={class:"flex items-center gap-2"},wB={class:"font-medium"},CB={class:"mt-2 text-sm text-muted-foreground"},BB={key:0,class:"mt-1 text-sm text-muted-foreground"},EB={class:"flex flex-wrap items-center justify-between gap-3"},_B={class:"flex items-center gap-2"},SB={class:"text-xs text-muted-foreground"},hd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=We.useBreakpoints(We.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const f=await fetch(r.apiUrl,{method:r.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const m=await f.json();Array.isArray(m)?i.value=m:m.data&&Array.isArray(m.data)?i.value=m.data:m.items&&Array.isArray(m.items)?i.value=m.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:te.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:te.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:te.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:te.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:te.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:te.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:te.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(m=>{var h;return(h=m[0])==null?void 0:h.toUpperCase()}).join("");return(f,m)=>{const h=e.resolveComponent("ShoppingCart"),x=e.resolveComponent("DCodeBadge"),C=e.resolveComponent("RefreshCcw"),y=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",mC,[m[8]||(m[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",hC,[a.value?(e.openBlock(),e.createElementBlock("div",pC,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",gC,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",bC,[m[7]||(m[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",yC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",xC,[e.createElementVNode("div",kC,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",wC,[e.createElementVNode("p",CC,e.toDisplayString(p.title),1),e.createElementVNode("p",BC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",EC,[e.createElementVNode("span",_C,e.toDisplayString(p.from),1),e.createVNode(e.unref(te.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",SC,e.toDisplayString(p.to),1)]),e.createElementVNode("p",AC,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",VC,[e.createVNode(e.unref(te.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(p.fileName),1)])):e.createCommentVNode("",!0)],64)):p.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",DC,[e.createElementVNode("p",NC,e.toDisplayString(p.title),1),e.createElementVNode("p",MC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",PC,e.toDisplayString(p.desc),1),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",TC,[e.createElementVNode("div",vC,[e.createVNode(e.unref(ud),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(md),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(fd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",OC,[e.createElementVNode("p",FC,e.toDisplayString(p.personName),1),e.createElementVNode("p",zC,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",IC,[e.createVNode(e.unref(St),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(St),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",RC,[e.createElementVNode("div",LC,[p.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,$C)):(e.openBlock(),e.createBlock(h,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",jC,[e.createElementVNode("div",UC,[e.createElementVNode("p",WC,e.toDisplayString(p.title),1),e.createElementVNode("p",HC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",qC,e.toDisplayString(p.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",GC,[m[1]||(m[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",KC,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",XC,[m[2]||(m[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",YC,e.toDisplayString(p.price),1)]),e.createElementVNode("div",JC,[m[3]||(m[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",QC,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",ZC,[e.createElementVNode("p",eB,e.toDisplayString(p.title),1),e.createElementVNode("p",tB,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",nB,e.toDisplayString(p.desc),1),e.createElementVNode("div",oB,[e.createVNode(e.unref(ud),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(md),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(fd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",rB,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",aB,[e.createElementVNode("p",sB,e.toDisplayString(p.title),1),e.createVNode(x,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",iB,[e.createElementVNode("div",lB,[e.createElementVNode("div",cB,[e.createVNode(e.unref(te.Globe),{class:"h-4 w-4"}),m[4]||(m[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",dB,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",uB,[e.createElementVNode("div",fB,[e.createVNode(e.unref(te.Cpu),{class:"h-4 w-4"}),m[5]||(m[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",mB,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",hB,[e.createElementVNode("div",pB,[e.createVNode(e.unref(te.CpuIcon),{class:"h-4 w-4"}),m[6]||(m[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",gB,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",bB,[e.createElementVNode("div",yB,[e.createVNode(e.unref(St),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(St),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(C,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",xB,[e.createElementVNode("div",kB,[e.createVNode(y,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",wB,e.toDisplayString(p.title),1)]),e.createVNode(x,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",CB,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",BB,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(Mr),{class:"my-4"}),e.createElementVNode("div",EB,[e.createElementVNode("div",_B,[e.createVNode(e.unref(St),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(St),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(St),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(te.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",SB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),AB={class:"dcode-upload-file"},VB={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"},DB={key:0,class:"text-xs text-gray-500 mt-1"},NB=["accept"],MB={key:1,class:"text-xs text-red-600 mt-1"},pd=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",AB,[t.label?(e.openBlock(),e.createBlock(Dn,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",VB,[e.createVNode(e.unref(te.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",DB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,NB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",MB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),PB=["onClick"],TB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},vB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},OB={key:1},FB={key:0,class:"text-white"},zB={key:1},IB={key:2},RB=["disabled","onClick"],LB={key:1,class:"mr-2 text-sm font-bold opacity-70"},$B={class:"whitespace-normal text-sm text-center leading-tight"},jB={class:"flex flex-col flex-1 min-w-0"},UB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},WB={class:"text-sm text-muted-foreground"},HB={class:"px-1"},qB=["disabled"],GB=["type"],KB=["disabled"],Ss=at(e.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}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:n}){const o=t,r=n,a=Ke(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var g;if(typeof o.modelValue=="string"){const b=(g=o.tabs)==null?void 0:g.findIndex(M=>M.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(g){var b;if(i.value=g,typeof o.modelValue=="string"){const M=(b=o.tabs)==null?void 0:b[g];M?r("update:modelValue",M.key):r("update:modelValue",g)}else r("update:modelValue",g)}}),c=e.computed(()=>{var g;return((g=o.tabs)==null?void 0:g.length)??0}),d=e.computed(()=>{var g;return(g=o.tabs)==null?void 0:g[l.value]});function u(g){return c.value<=0?0:Math.min(Math.max(g,0),c.value-1)}function f(g){return g?typeof g=="string"?bn(g,Vt):g:null}const m=e.reactive({});function h(g){return m[g.key]||(m[g.key]={loaded:!1,loading:!1,data:null,error:null}),m[g.key]}function x(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function C(g){const b=g.endpoint||{};return{apiModule:g.apiModule||b.apiModule,apiAction:g.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:g.apiParams}}function y(g){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[g];return!(!b||b.disabled)}async function p(g){if(typeof g.tab.fetchData=="function"){const N=await g.tab.fetchData(),O=(N==null?void 0:N.data)??N;return(O==null?void 0:O.data)??O}const b=C(g.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const w=x();let _;if(b.apiUrl)_=await s("","",w,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const N={...w,...b.apiParams};_=await s(b.apiModule,b.apiAction,N)}const B=(_==null?void 0:_.data)??_;return(B==null?void 0:B.data)??B}async function S(g,{force:b=!1}={}){const M=u(g),w=o.tabs[M];if(!w)return;const _=h(w);if(!(o.cache&&_.loaded&&!b)&&!_.loading){_.loading=!0,_.error=null;try{const B=await p({tabIndex:M,tab:w});_.data=B,_.loaded=!0,r("loaded",{tabIndex:M,tab:w,data:B})}catch(B){const D=typeof(B==null?void 0:B.message)=="string"&&B.message||typeof B=="string"&&B||"Failed to load tab data.";_.error=D,r("error",{tabIndex:M,tab:w,message:D})}finally{_.loading=!1}}}function V(g){const b=u(g);y(b)&&b!==l.value&&(l.value=b)}function E(g=l.value){return S(g,{force:!0})}function A(){const g=u(l.value-1);g!==l.value&&(l.value=g)}function k(){const g=u(l.value+1);g!==l.value&&(l.value=g)}return e.watch(()=>o.tabs,g=>{for(const b of g??[])h(b)},{immediate:!0}),e.watch(()=>l.value,async g=>{var M;const b=(M=o.tabs)==null?void 0:M[g];b&&r("change",{tabIndex:g,tab:b}),await S(g)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async g=>{g&&await S(l.value)},{immediate:!0}),(g,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(M,w)=>(e.openBlock(),e.createElementBlock("div",{key:M.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[w<l.value?"border-[#2563eb] bg-[#2563eb] text-white dark:border-[#1e3a8a] dark:bg-[#1e3a8a]":w===l.value?"border-[#2563eb] text-[#2563eb] shadow-[0_0_0_2px_rgba(37,99,235,0.2)] dark:border-[#1e3a8a] dark:text-[#3b82f6] dark:shadow-[0_0_0_2px_rgba(30,58,138,0.2)]":"border-[#e2e8f0] text-[#94a3b8] dark:border-[#3f3f46] dark:text-[#71717a]"]])},[t.typeWizard==="icon"&&M.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(M.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!M.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",OB,[w<l.value?(e.openBlock(),e.createElementBlock("span",FB,"✓")):(e.openBlock(),e.createElementBlock("span",zB,e.toDisplayString(w+1),1))])):(e.openBlock(),e.createElementBlock("span",IB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",w===l.value?"text-[#2563eb] dark:text-[#3b82f6]":"text-[#64748b] dark:text-[#a1a1aa]"])},e.toDisplayString(M.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(M,w)=>(e.openBlock(),e.createElementBlock("div",{key:M.key,onClick:_=>V(w),style:e.normalizeStyle({zIndex:t.tabs.length-w}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[w>0?"pl-8":"",w===l.value?"bg-[#2563eb] text-white dark:bg-[#1e3a8a]":w<l.value?"bg-[#eff6ff] text-[#2563eb] hover:bg-[#dbeafe] dark:bg-[#191d2c] dark:text-[#3b82f6] dark:hover:bg-[#1e263d]":"bg-[#f8fafc] text-[#64748b] hover:bg-[#f1f5f9] hover:text-[#334155] dark:bg-[#18181b] dark:text-[#a1a1aa] dark:hover:bg-[#27272a] dark:hover:text-[#d4d4d8]"]])},[t.typeWizard==="icon"&&M.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(M.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",TB,e.toDisplayString(w+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",vB,e.toDisplayString(M.title),1)],2),w<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[w===l.value?"fill-[#2563eb] text-[#2563eb] dark:fill-[#1e3a8a] dark:text-[#1e3a8a]":w<l.value?"fill-[#eff6ff] text-[#eff6ff] group-hover:fill-[#dbeafe] group-hover:text-[#dbeafe] dark:fill-[#191d2c] dark:text-[#191d2c] dark:group-hover:fill-[#1e263d] dark:group-hover:text-[#1e263d]":"fill-[#f8fafc] text-[#f8fafc] group-hover:fill-[#f1f5f9] group-hover:text-[#f1f5f9] dark:fill-[#18181b] dark:text-[#18181b] dark:group-hover:fill-[#27272a] dark:group-hover:text-[#27272a]"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,PB))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(M,w)=>(e.openBlock(),e.createElementBlock("button",{key:M.key,type:"button",disabled:!y(w),onClick:_=>V(w),class:e.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-[#e2e8f0] dark:border-[#3f3f46]",e.unref(_e)("border-b border-r",!t.isVertical&&w===t.tabs.length-1&&"border-r-0",w===l.value?"bg-[#2563eb]/[0.08] text-[#2563eb] font-semibold dark:bg-[#191d2c] dark:text-[#3b82f6]":"bg-transparent text-[#64748b] hover:bg-[#f1f5f9] hover:text-[#334155] dark:text-[#a1a1aa] dark:hover:bg-[#27272a] dark:hover:text-[#f4f4f5]",!y(w)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&M.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(M.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",LB,e.toDisplayString(w+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",$B,e.toDisplayString(M.title),1)],10,RB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Mr),{key:0})),e.createElementVNode("div",jB,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var M,w,_,B;return[(e.openBlock(),e.createElementBlock("div",{key:((M=d.value)==null?void 0:M.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(w=m[d.value.key])!=null&&w.loading?e.renderSlot(g.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",UB,[e.createVNode(e.unref(te.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(g.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(_=m[d.value.key])==null?void 0:_.data,loaded:(B=m[d.value.key])==null?void 0:B.loaded,reload:E},()=>[e.createElementVNode("div",WB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",HB,"tab-"+e.toDisplayString(d.value.key),1),b[3]||(b[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:A,disabled:l.value<=0,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-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,qB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:k,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,GB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#1e3a8a] dark:hover:bg-[#1e40af] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(te.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,KB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-3330e7b3"]]),XB={class:"permission-menu w-full space-y-4"},YB={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"},JB={class:"flex items-center justify-between"},QB={class:"flex items-center gap-3 flex-1"},ZB=["onClick"],eE={key:1,class:"w-7"},tE={key:2,class:"flex-shrink-0"},nE={class:"text-lg font-semibold flex-1"},oE={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},rE={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},aE={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},sE=["checked","disabled","onChange"],iE={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},lE={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},cE={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},dE={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"},uE={class:"flex items-center justify-between"},fE={class:"flex items-center gap-3 flex-1"},mE={key:0,class:"flex-shrink-0"},hE={class:"text-base font-semibold flex-1"},pE={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},gE={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},bE=["checked","onChange"],yE={class:"text-xs font-medium"},xE={key:0,class:"p-3"},kE={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},wE=["checked","disabled","onChange"],CE={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},As=at(e.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(t,{expose:n,emit:o}){const{t:r}=bt.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(w=!0)=>{(B=>{B.forEach(D=>{D.permission.forEach(N=>{const O=`${D.id}-${N.id}-parent`,v=N.code==="VIEW"||N.name.toUpperCase()==="VIEW";l.value.has(O)||l.value.set(O,v||(w?D.checked??!1:!1))}),D.detail&&D.detail.length>0&&D.detail.forEach(N=>{N.permission.forEach(O=>{const v=`${N.id}-${O.id}-child`,L=O.code==="VIEW"||O.name.toUpperCase()==="VIEW";l.value.has(v)||l.value.set(v,L||(w?N.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(w=>{const _=w.menuId,B=w.actionsIds;i.value.forEach(D=>{D.id===_&&B.forEach(N=>{const O=`${_}-${N}-parent`;l.value.set(O,!0)}),D.detail&&D.detail.length>0&&D.detail.forEach(N=>{N.id===_&&B.forEach(O=>{const v=`${_}-${O}-child`;l.value.set(v,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(w,_)=>{_===0&&w>0&&u()});const f=w=>w.detail&&w.detail.length>0,m=w=>{c.value.has(w)?c.value.delete(w):c.value.add(w)},h=w=>c.value.has(w),x=(w,_,B=!1)=>{const D=`${w}-${_}-${B?"child":"parent"}`;return l.value.get(D)??!1},C=()=>{const w=k();s("update:modelValue",w.permissions)},y=(w,_,B,D=!1)=>{const N=B.target.checked,O=`${w}-${_}-${D?"child":"parent"}`;l.value.set(O,N),s("permission-change",w,_,N,!D),C()},p=w=>w.permission.filter(S),S=w=>w.code==="VIEW"||w.name.toUpperCase()==="VIEW",V=(w,_,B)=>{const D=B.target.checked;_.permission.forEach(N=>{if(S(N)){const v=`${_.id}-${N.id}-child`;l.value.set(v,!0);return}const O=`${_.id}-${N.id}-child`;l.value.set(O,D)}),l.value=new Map(l.value),s("menu-check",_.id,D),C()},E=(w,_=!1)=>{const B=_?w.permission:p(w);return!B||B.length===0?!1:B.every(D=>{const N=`${w.id}-${D.id}-${_?"child":"parent"}`;return l.value.get(N)??!1})},A=()=>{const w={};return i.value.forEach(_=>{var B;w[_.id]={name:_.name,parentPermissions:_.permission.map(D=>({id:D.id,name:D.name,checked:x(_.id,D.id,!1)})),children:((B=_.detail)==null?void 0:B.map(D=>({id:D.id,name:D.name,permissions:D.permission.map(N=>({id:N.id,name:N.name,checked:x(D.id,N.id,!0)}))})))||[]}}),w},k=()=>{const w=[],_=(B,D=!1)=>{const N=[];B.permission.forEach(O=>{const v=`${B.id}-${O.id}-${D?"child":"parent"}`;(l.value.get(v)??!1)&&N.push(O.id)}),N.length>0&&w.push({menuId:B.id,actionsIds:N})};return i.value.forEach(B=>{_(B,!1),B.detail&&B.detail.length>0&&B.detail.forEach(D=>{_(D,!0)})}),{permissions:w}};return n({getCurrentStates:A,getPermissionsForDatabase:k,getAllPermissionsWithStatus:()=>{const w=[],_=(B,D=!1)=>{const N=B.permission.map(v=>{const L=`${B.id}-${v.id}-${D?"child":"parent"}`,$=l.value.get(L)??!1;return{id:v.id,name:v.name,checked:$}}),O=N.filter(v=>v.checked).map(v=>v.id);w.push({menuId:B.id,menuName:B.name,actionsIds:O,actions:N})};return i.value.forEach(B=>{_(B,!1),B.detail&&B.detail.length>0&&B.detail.forEach(D=>{_(D,!0)})}),{permissions:w}},permissionStates:l,expandAll:()=>{i.value.forEach(w=>{f(w)&&c.value.add(w.id)})},collapseAll:()=>{c.value.clear()}}),(w,_)=>(e.openBlock(),e.createElementBlock("div",XB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,B=>(e.openBlock(),e.createElementBlock("div",{key:B.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(B)}])},[e.createElementVNode("div",YB,[e.createElementVNode("div",JB,[e.createElementVNode("div",QB,[f(B)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D=>m(B.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[h(B.id)?(e.openBlock(),e.createBlock(e.unref(te.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(te.ChevronRight),{key:1,class:"w-5 h-5"}))],8,ZB)):(e.openBlock(),e.createElementBlock("div",eE)),t.showIcons&&B.icon?(e.openBlock(),e.createElementBlock("span",tE,[e.createElementVNode("i",{class:e.normalizeClass([B.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",nE,e.toDisplayString(B.name),1)])])]),B.permission&&B.permission.length>0&&!f(B)?(e.openBlock(),e.createElementBlock("div",oE,[e.createElementVNode("h4",rE,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",aE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(B),D=>(e.openBlock(),e.createElementBlock("label",{key:D.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"},[e.createElementVNode("input",{type:"checkbox",checked:S(D)||x(B.id,D.id,!1),disabled:S(D),onChange:N=>y(B.id,D.id,N,!1),class:e.normalizeClass(["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",S(D)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,sE),e.createElementVNode("span",iE,e.toDisplayString(D.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.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:e.withCtx(()=>[f(B)&&h(B.id)?(e.openBlock(),e.createElementBlock("div",lE,[e.createElementVNode("h4",cE,[_[0]||(_[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.detail,D=>(e.openBlock(),e.createElementBlock("div",{key:D.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"},[e.createElementVNode("div",dE,[e.createElementVNode("div",uE,[e.createElementVNode("div",fE,[t.showIcons&&D.icon?(e.openBlock(),e.createElementBlock("span",mE,[e.createElementVNode("i",{class:e.normalizeClass([D.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",hE,e.toDisplayString(D.name),1),D.path?(e.openBlock(),e.createElementBlock("span",pE,e.toDisplayString(D.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",gE,[e.createElementVNode("input",{type:"checkbox",checked:E(D,!0),onChange:N=>V(B,D,N),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,bE),e.createElementVNode("span",yE,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),D.permission&&D.permission.length>0?(e.openBlock(),e.createElementBlock("div",xE,[e.createElementVNode("div",kE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.permission,N=>(e.openBlock(),e.createElementBlock("label",{key:N.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"},[e.createElementVNode("input",{type:"checkbox",checked:S(N)||x(D.id,N.id,!0),disabled:S(N),onChange:O=>y(D.id,N.id,O,!0),class:e.normalizeClass(["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",S(N)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,wE),e.createElementVNode("span",CE,e.toDisplayString(N.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),BE={class:"space-y-4"},EE={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},_E={key:0,class:"text-danger-500"},SE={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},AE={class:"text-neutral-600 dark:text-neutral-400"},VE={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},DE={class:"text-neutral-500 dark:text-neutral-400"},NE={key:3,class:"space-y-3"},ME={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},PE={class:"flex items-center gap-3"},TE={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},vE={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},OE={class:"flex items-center gap-2 text-sm font-medium"},FE={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},zE={class:"p-4"},IE={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},RE={class:"ml-2 flex-1 min-w-0"},LE=["for"],$E={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},jE={key:4,class:"mt-1 text-xs text-danger-600"},Vs=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=bt.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=p=>{if(console.log(p),!p)return[];if(Array.isArray(p)&&p.length>0&&p[0].module&&Array.isArray(p[0].permissions))return p.map(S=>({menuId:S.menuId,module:S.module,label:S.label||S.module,permissions:S.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const S={};return p.forEach(V=>{const E=V.key,A=E&&E.includes(".")?E.split(".")[0]:"other";S[A]||(S[A]={menuId:0,module:A,label:A,permissions:[]}),S[A].permissions.push({id:V.id,key:V.key,label:V.label,description:V.description})}),Object.values(S)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const S=[],V=(E,A="")=>{const k=A?`${A}.${E.name}`:E.name,g=k.toLowerCase().replace(/\s+/g,"_"),b=[];if(E.detail&&Array.isArray(E.detail)&&E.detail.forEach(M=>{b.push(M.id)}),E.permission&&E.permission.length>0){const M=E.permission.map(w=>({id:w.id,key:`${g}.${w.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${w.name} ${E.name}`,description:`Permission to ${w.name.toLowerCase()} ${E.name.toLowerCase()}`}));S.push({menuId:E.id,module:g,label:E.name,permissions:M,subMenuIds:b.length>0?b:void 0})}E.detail&&Array.isArray(E.detail)&&E.detail.forEach(M=>{V(M,k)})};return p.forEach(E=>V(E)),S}return p.data?u(p.data):[]},f=async()=>{s.value=!0;try{let p;o.treeData&&o.treeData.length>0?p=o.treeData:p=[];const S=u(p);i.value=S;const V={},E=[],A={};S.forEach(g=>{g.permissions.forEach(b=>{const M=typeof b.id=="string"?parseInt(b.id):b.id;A[M]=g.menuId})});const k=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(g=>{E.push(g.menuId),g.actionsIds&&Array.isArray(g.actionsIds)&&g.actionsIds.forEach(b=>k.add(b))}),S.forEach(g=>g.permissions.forEach(b=>{const M=typeof b.id=="string"?parseInt(b.id):b.id;V[M]=k.has(M)})),l.value=V,c.value=E,d.value=A}catch{i.value=[]}finally{s.value=!1}},m=p=>p.permissions.filter(S=>{const V=typeof S.id=="string"?parseInt(S.id):S.id;return l.value[V]}).length,h=p=>p.permissions.every(S=>{const V=typeof S.id=="string"?parseInt(S.id):S.id;return l.value[V]}),x=p=>{const S=m(p);return S>0&&S<p.permissions.length},C=e.ref(!1),y=(p,S)=>{C.value=!0,p.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),p.permissions.forEach(A=>{const k=typeof A.id=="string"?parseInt(A.id):A.id;l.value[k]=S});let V=o.modelValue?[...o.modelValue]:[],E=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(E=[...E,...p.subMenuIds],p.subMenuIds.forEach(A=>{const k=i.value.find(g=>g.menuId===A);k&&k.permissions.forEach(g=>{const b=typeof g.id=="string"?parseInt(g.id):g.id;l.value[b]=S})})),S?E.forEach(A=>{const k=i.value.find(g=>g.menuId===A);if(k){const g=k.permissions.map(M=>typeof M.id=="string"?parseInt(M.id):M.id),b=V.findIndex(M=>M.menuId===A);b!==-1?V[b]={menuId:A,actionsIds:g}:V.push({menuId:A,actionsIds:g})}}):V=V.filter(A=>!E.includes(A.menuId)),c.value=V.map(A=>A.menuId),console.log("Full Result:",JSON.stringify(V,null,2)),r("update:modelValue",V),setTimeout(()=>{C.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const S=new Set,V=[];p.forEach(E=>{V.push(E.menuId),E.actionsIds&&Array.isArray(E.actionsIds)&&E.actionsIds.forEach(A=>S.add(A))}),Object.keys(l.value).forEach(E=>{const A=parseInt(E);l.value[A]=S.has(A)}),c.value=V}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,S)=>{if(C.value)return;if(Object.keys(p).map(E=>parseInt(E)).filter(E=>p[E]!==(S==null?void 0:S[E])).length>0){let E=o.modelValue?[...o.modelValue]:[];const A={};Object.keys(p).forEach(k=>{const g=parseInt(k);if(p[g]){const b=d.value[g];console.log(`Permission ${g} belongs to Menu ${b}`),b!==void 0&&(A[b]||(A[b]=[]),A[b].push(g))}}),Object.keys(A).forEach(k=>{const g=parseInt(k),b=A[g],M=E.findIndex(w=>w.menuId===g);M!==-1?E[M]={menuId:g,actionsIds:b}:E.push({menuId:g,actionsIds:b})}),E=E.filter(k=>A[k.menuId]&&A[k.menuId].length>0),c.value=E.map(k=>k.menuId),console.log("Result:",JSON.stringify(E,null,2)),r("update:modelValue",E)}},{deep:!0}),e.onMounted(f),(p,S)=>(e.openBlock(),e.createElementBlock("div",BE,[t.label?(e.openBlock(),e.createElementBlock("label",EE,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",_E,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",SE,[e.createVNode(e.unref(te.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",AE,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",VE,[e.createElementVNode("p",DE,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",NE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,V=>(e.openBlock(),e.createElementBlock("div",{key:V.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"},[e.createElementVNode("div",ME,[e.createElementVNode("div",PE,[e.createVNode(Yt,{modelValue:h(V),indeterminate:x(V),"onUpdate:modelValue":E=>y(V,!!E),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",TE,e.toDisplayString(V.label||V.module),1),e.createElementVNode("div",vE,e.toDisplayString(m(V))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(V.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",OE,[e.createElementVNode("div",FE,e.toDisplayString(m(V))+"/"+e.toDisplayString(V.permissions.length),1)])]),e.createElementVNode("div",zE,[e.createElementVNode("div",IE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.permissions,E=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(Yt,{modelValue:l.value[typeof E.id=="string"?parseInt(E.id):E.id],"onUpdate:modelValue":A=>l.value[typeof E.id=="string"?parseInt(E.id):E.id]=A,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",RE,[e.createElementVNode("label",{for:`perm-${E.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(E.label||E.key),9,LE),E.description?(e.openBlock(),e.createElementBlock("p",$E,e.toDisplayString(E.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",jE,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),UE={key:0,class:"fixed inset-0 z-[100] flex justify-end"},WE={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"},HE={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},qE={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},GE={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},KE={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},XE={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},YE=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(Le,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",UE,[e.createVNode(e.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:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.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:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",WE,[e.createElementVNode("div",HE,[e.createElementVNode("div",null,[e.createElementVNode("h3",qE,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",GE,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Le,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",KE,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",XE,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),JE={key:0},QE=["value","name"],gd=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=bt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:On,DCodeAutoComplete:Lo,DCodeDatePicker:_r,DCodeTextarea:Hn,DCodeTextArea:Hn,DCodeCheckbox:Yt,DCodeSwitch:Nr,DCodeOtpInput:Vr,DCodeImageField:Ar,DCodeSlider:Dr},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(f.required=u.required),u.disabled!==void 0&&(f.disabled=u.disabled),u.readonly!==void 0&&(f.readonly=u.readonly),u.valueType&&(f.type=u.valueType),u.minLength!==void 0&&(f.minlength=u.minLength),u.maxLength!==void 0&&(f.maxlength=u.maxLength),u.min!==void 0&&(f.min=u.min),u.max!==void 0&&(f.max=u.max),u.options&&(f.options=u.options),u.endpoint&&(f.endpoint=u.endpoint),u.itemTitle&&(f.itemTitle=u.itemTitle),u.itemValue&&(f.itemValue=u.itemValue),u.returnObject!==void 0&&(f.returnObject=u.returnObject),u.clearable!==void 0&&(f.clearable=u.clearable),Object.keys(u).forEach(m=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(m)&&!f.hasOwnProperty(m)&&(f[m]=u[m])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",JE,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,QE)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=m=>s.value=m),d]}),null,16,["modelValue"]))}}),ZE=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=We.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(_e)("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",o.class))},null,2)),[[e.vModelText,e.unref(a)]])}}),e2=e.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(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=me.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),t2=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(_e)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),n2=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(_e)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(te.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),o2=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(_e)(e.unref(vn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),r2=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(_e)(e.unref(vn)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),a2=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(_e)(e.unref(vn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),s2=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(_e)(e.unref(vn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(te.ChevronRightIcon))])]),_:3},16,["class"]))}}),i2=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class","size"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(_e)(e.unref(vn)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),l2=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const o=t,r=n,a=me.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(me.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),c2=e.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},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:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=We.reactiveOmit(o,"class"),s=me.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(me.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(me.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(_e)("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",t.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",o.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(m2)),e.createVNode(e.unref(me.SelectViewport),{class:e.normalizeClass(e.unref(_e)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(f2))]),_:3},16,["class"])]),_:3}))}}),d2={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},u2=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(_e)("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",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",d2,[e.createVNode(e.unref(me.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(te.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(me.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),f2=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(_e)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronDown))])]),_:3},16,["class"]))}}),m2=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(_e)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(te.ChevronUp))])]),_:3},16,["class"]))}}),h2=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=We.reactiveOmit(n,"class"),r=me.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(me.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(_e)("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",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(me.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),p2=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(me.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Ao={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},qn={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},st={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},g2={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},b2={dangerouslyHTMLString:!1,multiple:!0,position:Ao.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},y2={rtl:!1,newestOnTop:!1,toastClassName:""},bd={...b2,...y2};st.DEFAULT;var Ve=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(Ve||{}),Ds=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(Ds||{});const x2={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},k2={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},w2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},C2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},yd="Toastify--animate Toastify__none-enter";function xd(t,n=!1){var o;let r=x2;if(!t||typeof t=="string")switch(t){case"flip":r=C2;break;case"zoom":r=w2;break;case"slide":r=k2;break}else r=t;if(n)r.enter=yd;else if(r.enter===yd){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function B2(t){return t.containerId||String(t.position)}const Pr="will-unmount";function E2(t=Ao.TOP_RIGHT){return!!document.querySelector(`.${Ve.CSS_NAMESPACE}__toast-container--${t}`)}function _2(t=Ao.TOP_RIGHT){return`${Ve.CSS_NAMESPACE}__toast-container--${t}`}function S2(t,n,o=!1){const r=[`${Ve.CSS_NAMESPACE}__toast-container`,`${Ve.CSS_NAMESPACE}__toast-container--${t}`,o?`${Ve.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Kn(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function A2(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=Ve.CSS_NAMESPACE,l=_2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(Pr)),f=c||document.createElement("div"),m=document.createElement("div");m.className=S2(o,r,a),m.dataset.testid=`${Ve.CSS_NAMESPACE}__toast-container--${o}`,m.id=B2(t);for(const h in s)if(Object.prototype.hasOwnProperty.call(s,h)){const x=s[h];m.style[h]=x}return c||(f.className=Ve.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(m),m}function Ns(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",Ns,!1);try{Vo[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete Vo[a],delete Qe[a]}catch{}}const Vo=e.reactive({});function V2(t,n){const o=document.getElementById(String(n));o&&(Vo[o.id]=t)}function Ms(t,n=!0){const o=String(t);if(!Vo[o])return;const r=document.getElementById(o);r&&r.classList.add(Pr),n?(N2(t),r&&r.addEventListener("animationend",Ns,!1)):Ns(o),wt.items=wt.items.filter(a=>a.containerId!==t)}function D2(t){for(const n in Vo)Ms(n,t);wt.items=[]}function kd(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...xd(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function N2(t){for(const n in Qe)if(n===t)for(const o of Qe[n]||[])kd(o)}function M2(t){const n=Gn().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function Ps(t){return document.getElementById(t)}function P2(t){const n=Ps(t.containerId);return n&&n.classList.contains(Pr)}function wd(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function T2(t){return t?wt.items.filter(n=>n.containerId===t).length>0:wt.items.length>0}function v2(){if(wt.items.length>0){const t=wt.items.shift();Tr(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const Qe=e.reactive({}),wt=e.reactive({items:[]});function Gn(){const t=e.toRaw(Qe);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function O2(t){return Gn().find(n=>n.toastId===t)}function Tr(t,n={}){if(P2(n)){const o=Ps(n.containerId);o&&o.addEventListener("animationend",Ts.bind(null,t,n),!1)}else Ts(t,n)}function Ts(t,n={}){const o=Ps(n.containerId);o&&o.removeEventListener("animationend",Ts.bind(null,t,n),!1);const r=Qe[n.containerId]||[],a=r.length>0;if(!a&&!E2(n.position)){const s=A2(n),i=e.createApp(a_,n);n.useHandler&&n.useHandler(i),i.mount(s),V2(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?mt.update(n):mt.add(t,n)})}const mt={add(t,n){const{containerId:o=""}=n;o&&(Qe[o]=Qe[o]||[],Qe[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=Qe[o])==null||r.unshift(n):(a=Qe[o])==null||a.push(n),n.onOpen&&n.onOpen(wd(n))},n.delay||0))},remove(t){if(t){const n=M2(t);if(n){const o=Qe[n];let r=o.find(a=>a.toastId===t);Qe[n]=o.filter(a=>a.toastId!==t),!Qe[n].length&&!T2(n)&&Ms(n,!1),v2(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(wd(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){Qe[n]=Qe[n]||[];const o=Qe[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};mt.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{Pe(a.content,a)},t.delay||0)}},clear(t,n=!0){t?Ms(t,n):D2(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",mt.dismissCallback,!1),setTimeout(()=>{mt.remove(o)}))},dismiss(t){if(t){const n=Gn();for(const o of n)if(o.toastId===t){kd(o,r=>{r.addEventListener("animationend",mt.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=Gn();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",mt.dismissCallback,!1),mt.remove(t));break}}}},F2=e.reactive({useHandler:void 0}),Cd=e.reactive({}),vr=e.reactive({});function Bd(){return Math.random().toString(36).substring(2,9)}function z2(t){return typeof t=="number"&&!isNaN(t)}function vs(t){return typeof t=="string"}function Kn(t){return typeof t=="function"}function Or(...t){return e.mergeProps(...t)}function Fr(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function I2(t={}){Cd[`${Ve.CSS_NAMESPACE}-default-options`]=t}function Ed(){return Cd[`${Ve.CSS_NAMESPACE}-default-options`]||bd}function R2(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var zr=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(zr||{});const _d={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:Ao.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:qn.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:st.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}},L2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:st.DEFAULT},theme:{type:String,required:!1,default:qn.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}},$2=e.defineComponent({name:"ProgressBar",props:L2,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${Ve.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${Ve.CSS_NAMESPACE}__progress-bar--controlled`:`${Ve.CSS_NAMESPACE}__progress-bar--animated`,`${Ve.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${Ve.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${Ve.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),j2=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:qn.AUTO},type:{type:String,required:!1,default:qn.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${Ve.CSS_NAMESPACE}__close-button ${Ve.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.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)])])}}),Ir=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function U2(t){return e.createVNode(Ir,e.mergeProps(t,{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 W2(t){return e.createVNode(Ir,e.mergeProps(t,{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 H2(t){return e.createVNode(Ir,e.mergeProps(t,{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 q2(t){return e.createVNode(Ir,e.mergeProps(t,{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 G2(){return e.createVNode("div",{class:`${Ve.CSS_NAMESPACE}__spinner`},null)}const Rr={info:W2,warning:U2,success:H2,error:q2,spinner:G2},K2=t=>t in Rr;function X2({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return Rr.spinner();if(r!==!1){if(Fr(r))a=e.toRaw(r);else if(Kn(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?Rr.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):vs(r)||z2(r)?a=r:K2(n)&&(a=Rr[n](i));return a}}const Y2=()=>{};function J2(t,n,o=Ve.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function Q2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(zr.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||Ve.COLLAPSE_DURATION}),i=s.done||Y2,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:y,onMouseleave:C}:{});function u(){const S=l.value.split(" ");m().addEventListener(Ds.ENTRANCE_ANIMATION_END,C,{once:!0});const V=A=>{const k=m();A.target===k&&(k.dispatchEvent(new Event(Ds.ENTRANCE_ANIMATION_END)),k.removeEventListener("animationend",V),k.removeEventListener("animationcancel",V),a.value===zr.Enter&&A.type!=="animationcancel"&&k.classList.remove(...S))},E=()=>{const A=m();A.classList.add(...S),A.addEventListener("animationend",V),A.addEventListener("animationcancel",V)};t.pauseOnFocusLoss&&h(),E()}function f(){if(!m())return;const S=()=>{const E=m();E.removeEventListener("animationend",S),s.collapse?J2(E,i,s.collapseDuration):i()},V=()=>{const E=m();a.value=zr.Exit,E&&(E.className+=` ${c.value}`,E.addEventListener("animationend",S))};o.value||(r.value?S():setTimeout(V))}function m(){return t.toastRef.value}function h(){document.hasFocus()||y(),window.addEventListener("focus",C),window.addEventListener("blur",y)}function x(){window.removeEventListener("focus",C),window.removeEventListener("blur",y)}function C(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function y(){n.value=!1}function p(S){S&&(S.stopPropagation(),S.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const S=Gn();o.value=S.findIndex(V=>V.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?y():C())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&x()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function Z2(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const e_=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:_d,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>X2(t)),s=e.computed(()=>[`${Ve.CSS_NAMESPACE}__toast`,`${Ve.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${Ve.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${Ve.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=Q2({toastRef:n,loading:o,done:()=>{mt.remove(t.toastId)},...xd(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(Z2(f)){const m=[];return f.title!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${Ve.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${Ve.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ve.CSS_NAMESPACE}__toast-text`},[m])}return Fr(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):Kn(f)?f({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:f}):f}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:f=>{t.closeOnClick&&c(),t.onClick&&t.onClick(f)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${Ve.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${Ve.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${Ve.CSS_NAMESPACE}--animate-icon ${Ve.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Fr(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):Kn(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(j2,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Fr(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):Kn(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode($2,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),Lr="vue3-toastify:url-change";let $r=0,Do;function t_(){if(!(typeof window>"u")&&vr.lastUrl!==window.location.href){vr.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:Ed().clearOnUrlChange!==!1,n=Object.values(Qe).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&mt.dismiss(o.toastId);wt.items=wt.items.filter(o=>!t(o.toastProps))}}function n_(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(Lr)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(Lr)),a},()=>{t.pushState=n,t.replaceState=o}}function o_(){if(typeof window>"u"||Do)return;const t=n_(),n=()=>t_();window.addEventListener(Lr,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),Do=()=>{t(),window.removeEventListener(Lr,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),Do=void 0}}function r_(){Do&&(Do(),vr.lastUrl="")}const a_=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:_d,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>Qe[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&($r+=1,o_())}),e.onUnmounted(()=>{typeof window<"u"&&$r>0&&($r-=1,$r===0&&r_())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(e_,e.mergeProps({key:s},a),null)})])}});let Os=!1;const Sd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Ad(){const t=[];return Gn().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(Pr)&&t.push(n)}),t}function s_(t){const n=Ad().length,o=t??0;return o>0&&n+wt.items.length>=o}function i_(t){s_(t.limit)&&!t.updateId&&wt.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function dn(t,n,o={}){if(Os)return;o=Or(Ed(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Bd()),o={...o,...o.type==="loading"?Sd:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=R2()),i_(o),vr.lastUrl=window.location.href,o.multiple?wt.items.length?o.updateId&&Tr(t,o):Tr(t,o):(Os=!0,Pe.clearAll(void 0,!1),setTimeout(()=>{Tr(t,o)},0),setTimeout(()=>{Os=!1},390)),o.toastId}const Pe=(t,n)=>dn(t,st.DEFAULT,n);Pe.info=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.INFO}),Pe.error=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.ERROR}),Pe.warning=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.WARNING}),Pe.warn=Pe.warning,Pe.success=(t,n)=>dn(t,st.DEFAULT,{...n,type:st.SUCCESS}),Pe.loading=(t,n)=>dn(t,st.DEFAULT,Or(n,Sd)),Pe.dark=(t,n)=>dn(t,st.DEFAULT,Or(n,{theme:qn.DARK})),Pe.remove=t=>{t?mt.dismiss(t):mt.clear()},Pe.clearAll=(t,n)=>{e.nextTick(()=>{mt.clear(t,n)})},Pe.isActive=t=>{let n=!1;return n=Ad().findIndex(o=>o.toastId===t)>-1,n},Pe.update=(t,n={})=>{setTimeout(()=>{const o=O2(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:Bd()},i=s.render||a;delete s.render,dn(i,s.type,s)}},0)},Pe.done=t=>{Pe.update(t,{isLoading:!1,progress:1})},Pe.promise=l_;function l_(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=vs(n)?Pe.loading(n,d):Pe.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(h,x,C)=>{if(x==null){Pe.remove(c);return}const y={type:h,...u,...a,data:C},p=vs(x)?{render:x}:x;return c?Pe.update(c,{...y,...p,isLoading:!1}):Pe(p.render,{...y,...p,isLoading:!1}),C},m=Kn(t)?t():t;return m.then(h=>{f("success",r,h)}).catch(h=>{f("error",o,h)}),m}Pe.POSITION=Ao,Pe.THEME=qn,Pe.TYPE=st,Pe.TRANSITIONS=g2;const c_={install(t,n={}){F2.useHandler=n.useHandler||(()=>{}),d_(n)}};typeof window<"u"&&(window.Vue3Toastify=c_);function d_(t={}){const n=Or(bd,t);I2(n)}const u_={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:[]},f_={key:0,class:"inline-block"},Fs=at(e.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(t){const n=t,o=e.computed(()=>bn(n.icon,Vt)),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const f={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 f[n.size]||f.sm}),s=e.computed(()=>{const f={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 f[n.size]||f.sm}),i=e.computed(()=>{const f={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return f[n.size]||f.sm}),l=e.computed(()=>{const f={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",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",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",outline:"bg-transparent border-border text-foreground",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",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",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"};return f[n.variant]||f.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return _e(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>_e("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",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(f,m)=>r.value?(e.openBlock(),e.createElementBlock("div",f_,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-1e8e809d"]]);var jr={exports:{}},m_=jr.exports,Vd;function h_(){return Vd||(Vd=1,(function(t,n){(function(o,r){t.exports=r()})(m_,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},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,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(y){return r.apply(y,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,m,h;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.filter(function(y){return r.truthy(r.apply(f,y))}):[];if(l==="map")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.map(function(y){return r.apply(f,y)}):[];if(l==="reduce")return m=r.apply(c[0],i),f=c[1],h=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(m)?m.reduce(function(y,p){return r.apply(f,{current:p,accumulator:y})},h):h;if(l==="all"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="none"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="some"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!0;return!1}}if(c=c.map(function(y){return r.apply(y,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var x=String(l).split("."),C=a;for(d=0;d<x.length;d++){if(!C.hasOwnProperty(x[d]))throw new Error("Unrecognized operation "+l+" (failed at "+x.slice(0,d+1).join(".")+")");C=C[x[d]]}return C.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(jr)),jr.exports}var p_=h_();const ht=Oi(p_),g_={class:"dcode-card animate-slide-up"},b_={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"},y_={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between items-start gap-4"},x_={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]"},k_={class:"relative w-full sm:w-64"},w_={key:0,class:"relative"},C_={class:"flex flex-col h-full"},B_={key:0,class:"flex-1 overflow-y-auto py-4"},E_={class:"grid grid-cols-1 gap-4 px-1"},__={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},S_={class:"flex justify-end gap-2 w-full"},A_={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},V_={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},D_={class:"dcode-table w-full"},N_={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},M_=["onClick"],P_={key:0,class:"flex items-center justify-center w-full"},T_={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},v_={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},O_={key:0,class:"px-3 py-0.5"},F_={key:1},z_=["colspan"],I_={class:"flex flex-col items-center gap-2"},R_={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},L_={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},$_={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},j_={key:0,class:"flex items-center justify-center"},U_={key:0,class:"px-3 py-0.5 !text-center"},W_={key:0,class:"flex items-center justify-center gap-1.5"},H_={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},q_=["colspan"],G_={key:0,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"},K_={class:"flex items-center gap-4"},X_={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},Y_={class:"text-neutral-900 dark:text-neutral-100 font-medium"},J_={class:"text-neutral-900 dark:text-neutral-100 font-medium"},Q_={class:"text-neutral-900 dark:text-neutral-100 font-medium"},Z_={class:"flex-shrink-0"},eS={class:"space-y-4"},tS={class:"text-gray-600 dark:text-gray-400"},nS={class:"grid grid-cols-1 gap-4 py-4 px-1"},oS={key:0,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"},rS={class:"p-1.5 bg-amber-100 dark:bg-amber-900/40 rounded-md text-amber-600 dark:text-amber-400"},aS={class:"flex flex-col gap-0.5"},sS={class:"text-[10px] font-bold uppercase tracking-wider text-amber-500/70 dark:text-amber-400/50"},iS={class:"text-xs text-amber-700 dark:text-amber-300 leading-relaxed font-medium transition-all"},lS={class:"flex items-end gap-2"},Xn=e.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{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}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var qd,Gd,Kd,Xd,Yd,Jd;ht.add_operation("length",T=>T==null?0:typeof T=="string"||Array.isArray(T)?T.length:typeof T=="number"?String(T).length:typeof T=="object"?Object.keys(T).length:0),ht.add_operation("==",(T,R)=>T!==null&&typeof T=="object"&&"_isLogicValue"in T?T.id==R||T.code==R:R!==null&&typeof R=="object"&&"_isLogicValue"in R?R.id==T||R.code==T:T==R),ht.add_operation("!=",(T,R)=>T!==null&&typeof T=="object"&&"_isLogicValue"in T?!(T.id==R||T.code==R):R!==null&&typeof R=="object"&&"_isLogicValue"in R?!(R.id==T||R.code==T):T!=R);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=Ke(),{locale:l}=bt.useI18n();let c={query:{},params:{},path:""};try{const T=un.useRoute();T?c=T:(Kd=(Gd=(qd=s==null?void 0:s.appContext)==null?void 0:qd.config)==null?void 0:Gd.globalProperties)!=null&&Kd.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:T=>{console.warn("Router push() logic called from fallback:",T),typeof T=="string"&&T.startsWith("/")&&(window.location.href=T)}};try{const T=un.useRouter();T?d=T:(Jd=(Yd=(Xd=s==null?void 0:s.appContext)==null?void 0:Xd.config)==null?void 0:Yd.globalProperties)!=null&&Jd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),m=e.ref(r.perPage),h=e.ref({key:"",direction:"asc"}),x=e.ref([]),C=e.ref(!1),y=e.ref(0),p=e.ref({}),S=e.ref([]),V=e.ref(null),E=e.ref(!0),A=e.ref([]),k=e.ref([]),g=e.ref([]),b=e.ref(!1),M=e.ref(!1),w=e.ref({}),_=e.ref(null),B=e.ref(null),D=e.ref(null),N=e.ref([]),O=e.computed(()=>{if(H.value.length===0)return!1;const T=H.value.map(R=>{const Y=K.value.find(j=>j.type==="CHECKBOX"),I=(Y==null?void 0:Y.keyCheckbox)||"id";return R[I]}).filter(R=>R!=null);return T.length===0?!1:T.every(R=>N.value.includes(R))}),v=e.computed(()=>{if(H.value.length===0)return!1;const T=K.value.find(j=>j.type==="CHECKBOX"),R=(T==null?void 0:T.keyCheckbox)||"id",Y=H.value.map(j=>j[R]).filter(j=>j!=null),I=Y.filter(j=>N.value.includes(j)).length;return I>0&&I<Y.length}),L=T=>{const R=K.value.find(j=>j.type==="CHECKBOX"),Y=(R==null?void 0:R.keyCheckbox)||"id",I=T[Y];return I!==void 0&&N.value.includes(I)},$=T=>{const R=K.value.find(j=>j.type==="CHECKBOX"),Y=(R==null?void 0:R.keyCheckbox)||"id",I=H.value.map(j=>j[Y]).filter(j=>j!=null);if(T){const j=new Set([...N.value,...I]);N.value=Array.from(j)}else N.value=N.value.filter(j=>!I.includes(j))},U=(T,R)=>{const Y=K.value.find(J=>J.type==="CHECKBOX"),I=(Y==null?void 0:Y.keyCheckbox)||"id",j=T[I];j!=null&&(R?N.value.includes(j)||N.value.push(j):N.value=N.value.filter(J=>J!==j))};e.watch(N,T=>{var Y;a("update:selection",T);const R=O.value||T.length>1;(Y=k.value)!=null&&Y.length&&k.value.forEach(I=>{var j;(j=I.fieldActionGlobal)!=null&&j.length&&I.fieldActionGlobal.forEach(J=>{var ye,Te;const ie=I.endpoint||((ye=I.propsActionGlobal)==null?void 0:ye.endpointPropAction)||I.propsActionGlobal,ge=(Te=ie==null?void 0:ie.keyParam)==null?void 0:Te[0];(ge&&J.model===ge||!ge&&/^(id|ids|idAuditTrail)/i.test(J.model))&&R&&J.model&&(w.value[J.model]=T)})})},{deep:!0});const P=T=>Array.from({length:T}).map((R,Y)=>{const I={id:Y+1,no:Y+1};return K.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?I[j.keyCheckbox||"id"]=Y+1:j.type==="BADGE"||j.type==="badge"||j.condition?I[j.key]=j.condition&&j.condition.length>0?j.condition[0].value:"Active":I[j.key]=`Data ${j.label} ${Y+1}`)}),I}),F=T=>T&&typeof T=="string"&&T.trim()?T:void 0,X=e.computed(()=>{var T,R,Y,I;return F((R=(T=V.value)==null?void 0:T.endpoint)==null?void 0:R.apiModule)||F((I=(Y=V.value)==null?void 0:Y.endpointGlobal)==null?void 0:I.apiModule)||r.apiModule}),q=e.computed(()=>{var T,R,Y,I;return F((R=(T=V.value)==null?void 0:T.endpoint)==null?void 0:R.apiAction)||F((I=(Y=V.value)==null?void 0:Y.endpointGlobal)==null?void 0:I.apiAction)||r.apiAction}),W=e.computed(()=>{var T,R,Y,I;return F((R=(T=V.value)==null?void 0:T.endpoint)==null?void 0:R.apiMethod)||F((I=(Y=V.value)==null?void 0:Y.endpointGlobal)==null?void 0:I.apiMethod)||r.apiMethod||"POST"}),Z=e.computed(()=>{var T,R,Y,I;return F((R=(T=V.value)==null?void 0:T.endpoint)==null?void 0:R.apiUrl)||F((I=(Y=V.value)==null?void 0:Y.endpointGlobal)==null?void 0:I.apiUrl)||r.apiUrl}),ne=e.computed(()=>r.permissionBase||""),ue=e.computed(()=>!g.value||g.value.length===0?[]:[...g.value].sort((T,R)=>(T.seq||0)-(R.seq||0))),ke=T=>{var J,ie,ge;const R=(T==null?void 0:T.column)||((J=T==null?void 0:T.props)==null?void 0:J.column)||((ie=T==null?void 0:T.propsFieldGlobal)==null?void 0:ie.column)||((ge=T==null?void 0:T.propsFieldCustom)==null?void 0:ge.column);if(!R)return"col-span-1";const Y=R.toLowerCase(),j={full:"col-span-1 md:col-span-2",half:"col-span-1",third:"col-span-1","two-thirds":"col-span-1 md:col-span-2",two_thirds:"col-span-1 md:col-span-2"}[Y]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${T==null?void 0:T.model}: type=${R}, returned=${j}`),j},fe=()=>{let T=null;if(r.tableConfig&&(T=r.tableConfig),T){V.value=T,A.value=[],k.value=[],T.headers&&(S.value=T.headers.map(I=>{var ie,ge,be,ye,Te,Be,Ne,pt,It,Qr;if(I.key==="action"||((ie=I.custom)==null?void 0:ie.type)==="ACTION"||((ge=I.custom)==null?void 0:ge.type)==="action"){const gt=((be=I.custom)==null?void 0:be.actionCustom)||((ye=I.custom)==null?void 0:ye.action);if(gt){const AA=gt.map(Ct=>{const qe=Ct.propsActionCustom||Ct.props||{},Zr=Ct.propCustomMessage||{};return{permission:Ct.permission,label:l.value==="id"?qe.labelID:qe.labelEN,tooltip:l.value==="id"?qe.tooltipID||qe.labelID:qe.tooltipEN||qe.labelEN,icon:qe.icon,variant:qe.variant||"ghost",bgColor:qe.bgColor,action:qe.actionType||qe.key,route:qe.route,path:qe.path,endpoint:qe.endpointPropAction,requiredCondition:Ct.requiredCondition||!1,propCustomCondition:Ct.propCustomCondition||[],fieldMapping:Ct.fieldMapping||qe.fieldMapping||null,openDialog:Ct.openDialog||!1,fieldActionCustom:(Ct.fieldActionCustom||[]).map(ea=>{const js=ea.propsFieldCustom||ea.propsFieldGlobal||ea.props||{};return{...ea,props:{...js,endpoint:js.endpointComponent||js.endpoint}}}),condition:Ct.visibleRule||Ct.propCustomCondition||qe.visibleRule||qe.propCustomCondition||null,requireConfirm:Ct.requireConfirm||qe.requireConfirm||!1,confirmTitle:l.value==="id"?Zr.titleID||qe.confirmTitleID||"Konfirmasi":Zr.titleEN||qe.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Zr.messageID||qe.confirmMessageID||"Apakah Anda yakin?":Zr.messageEN||qe.confirmMessageEN||"Are you sure?"}});A.value.push(...AA)}return null}let j;const J=((Te=I.custom)==null?void 0:Te.conditionBadge)||((Be=I.custom)==null?void 0:Be.condition);return(((Ne=I.custom)==null?void 0:Ne.type)==="BADGE"||((pt=I.custom)==null?void 0:pt.type)==="badge")&&J&&(j=J.map(gt=>({value:gt.value,label:l.value==="id"?gt.labelID:gt.labelEN,labelID:gt.labelID,labelEN:gt.labelEN,color:gt.color||gt.bgColor,variant:gt.variant,logic:gt.logic||gt.conditionRule||null}))),{key:I.key,label:l.value==="id"?I.labelID:I.labelEN,width:I.width,align:I.align,sortable:!0,type:(It=I.custom)==null?void 0:It.type,condition:j,keyCheckbox:(Qr=I.custom)==null?void 0:Qr.keyCheckbox}}).filter(I=>I!==null));const R=T.filters||T.filter;R&&Array.isArray(R)&&(g.value=R.map(I=>({...I,props:I.propsFilters||I.props||{}})),g.value.forEach(I=>{p.value[I.model]=""}));const Y=T.actionTableGlobal||T.actionGlobal||T.action;console.log("[DEBUG] loadConfig rawActions:",Y),Y&&Array.isArray(Y)?(k.value=Y.map(I=>{const j=I.propsActionGlobal||I.props||{};return{key:j.key,permission:I.permission,label:l.value==="id"?j.labelID||"Action":j.labelEN||"Action",tooltip:l.value==="id"?j.tooltipID||j.labelID:j.tooltipEN||j.labelEN,icon:j.icon,variant:j.variant||"default",bgColor:j.bgColor,textColor:j.textColor,route:j.route,path:j.path,endpoint:j.endpointPropAction||I.endpoint,fieldMapping:I.fieldMapping||j.fieldMapping||null,visibleRule:I.visibleRule||j.visibleRule||I.propCustomCondition||j.propCustomCondition||null,openDialog:I.openDialog||!1,fieldActionGlobal:(I.fieldActionGlobal||I.field||[]).map(J=>{const ie=J.propsFieldGlobal||J.props||{};return{...J,props:{...ie,endpoint:ie.endpointComponent||ie.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",k.value)):console.log("[DEBUG] loadConfig no rawActions found"),T.pagination!==void 0&&(E.value=T.pagination)}};e.watch(()=>r.tableConfig,()=>{fe()},{deep:!0,immediate:!0});const K=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?S.value:r.columns||[]),z=e.computed(()=>r.hasActions||A.value.length>0),G=e.computed(()=>r.dummyMode?!1:X.value||Z.value?C.value:r.loading),ee=e.computed(()=>!!X.value||!!Z.value),he=e.computed(()=>[]),De=T=>{if(console.log("[DEBUG] hasAction called:",{actionCode:T,permissionChecker:!!r.permissionChecker,effectivePath:ne.value}),r.menuPermissions&&r.menuPermissions.length>0){const R=c.path,Y=r.menuPermissions.find(I=>R.startsWith(I.path));if(Y&&Y.actions){const I=Y.actions.find(j=>j.code===T.toUpperCase());return I?I.checked:!1}return!1}if(r.permissionChecker){const R=r.permissionChecker(ne.value,T);return console.log("[DEBUG] permissionChecker result:",R),R}return he.value.some(R=>R.code===T)},Ae=(T,R)=>{if(T.condition)try{return ht.apply(T.condition,R)}catch(ie){return console.warn("Row action jsonLogic error:",ie),!1}if(!T.visibilityCondition)return!0;const{field:Y,operator:I,value:j}=T.visibilityCondition,J=Ee(R,Y);switch(I){case"equals":return J===j;case"notEquals":return J!==j;case"in":return Array.isArray(j)&&j.includes(J);case"notIn":return Array.isArray(j)&&!j.includes(J);case"greaterThan":return J>j;case"lessThan":return J<j;case"contains":return String(J).includes(String(j));default:return!0}},ze=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:k.value,ignorePermissions:r.ignorePermissions}),k.value.length===0)return k.value;const T=k.value.filter(R=>{if(R.visibleRule)try{const I=H.value[0]||{};if(!ht.apply(R.visibleRule,I))return!1}catch(I){console.warn("Header action visibility logic error:",I)}if(r.ignorePermissions||r.dummyMode)return!0;if(!R.permission)return console.log("[DEBUG] Action no permission, showing:",R.label),!0;if(r.checkPermission){const I=r.checkPermission(R.permission);return console.log("[DEBUG] Parent checkPermission result:",I),I}if(r.permissions){const I=r.permissions.includes(R.permission);return console.log("[DEBUG] Parent permissions check result:",I),I}const Y=De(R.permission);return console.log("[DEBUG] Internal permission check:",{label:R.label,permission:R.permission,hasPerm:Y}),Y});return console.log("[DEBUG] Filtered header actions:",T.length),T}),Ie=e.computed(()=>A.value.length===0?A.value:A.value.filter(T=>r.ignorePermissions||r.dummyMode||!T.permission?!0:r.checkPermission?r.checkPermission(T.permission):r.permissions?r.permissions.includes(T.permission):De(T.permission))),Ue=T=>Ie.value.filter(R=>Ae(R,T)),Me=(T,R)=>{var j,J;if(T.requiredCondition&&((j=T.propCustomCondition)==null?void 0:j.length)>0){const ie=Ee(R,"status"),ge=T.propCustomCondition.find(be=>be.value===ie);if(ge)return ge.bgColor||T.bgColor||"primary"}if(!T.dynamicColor||!T.colorCondition)return T.bgColor||"primary";const Y=Ee(R,T.colorCondition.field),I=(J=T.colorCondition.conditions)==null?void 0:J.find(ie=>ie.value===Y);return(I==null?void 0:I.bgColor)||T.bgColor||"primary"},Ze=T=>{const R=(T||"left").toLowerCase();return R==="center"?"justify-center":R==="right"?"justify-end":"justify-start"},ct={ToggleLeft:te.ToggleLeft,SquarePen:te.SquarePen,Trash2:te.Trash2,Eye:te.Eye,CheckCircle:te.CheckCircle,Plus:te.Plus,Download:te.Download,RefreshCw:te.RefreshCw,Search:te.Search,SlidersHorizontal:te.SlidersHorizontal},At=T=>T&&(bn(T,Vt)||ct[T])||null,H=e.computed(()=>r.dummyMode?K.value.length>0?P(10):[]:ee.value?x.value.map((T,R)=>({...T,no:(f.value-1)*m.value+R+1})):se.value),re=e.computed(()=>r.dummyMode?10:ee.value?y.value:Q.value.length),pe=e.computed(()=>re.value===0?0:(f.value-1)*m.value+1),Re=e.computed(()=>{const T=f.value*m.value;return T>re.value?re.value:T}),Ee=(T,R)=>{if(!(!T||!R))return R in T?T[R]:R.split(".").reduce((Y,I)=>Y&&Y[I],T)},Q=e.computed(()=>{if(ee.value)return[];if(!u.value)return r.data;const T=u.value.toLowerCase();return r.data.filter(R=>K.value.some(Y=>{const I=Ee(R,Y.key);return I==null?!1:String(I).toLowerCase().includes(T)}))}),oe=e.computed(()=>ee.value?[]:h.value.key?[...Q.value].sort((R,Y)=>{const I=Ee(R,h.value.key),j=Ee(Y,h.value.key);if(I===j)return 0;let J=0;return typeof I=="number"&&typeof j=="number"?J=I-j:J=String(I).localeCompare(String(j)),h.value.direction==="asc"?J:-J}):Q.value),se=e.computed(()=>{if(ee.value)return[];const T=(f.value-1)*m.value,R=T+m.value;return oe.value.slice(T,R).map((Y,I)=>({...Y,no:T+I+1}))}),xe=e.computed(()=>ee.value?Object.values(p.value).some(T=>!!T):!!u.value),He=[10,25,50,100],zt=()=>{ee.value&&(p.value={...p.value,keyword:u.value},f.value=1,rt())};let qr;const zd=()=>{r.enableQuickSearch&&(clearTimeout(qr),qr=setTimeout(()=>{zt()},500))};let Gr;const Id=()=>{clearTimeout(Gr),Gr=setTimeout(()=>{ee.value&&rt()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&ee.value&&zd()});const rt=async()=>{if(!r.dummyMode&&ee.value&&!(!X.value&&!Z.value))try{C.value=!0;const T={page:f.value,perPage:m.value,...p.value,...r.apiParams};u.value&&(T.keyword=u.value),Object.keys(T).forEach(Y=>{(T[Y]===""||T[Y]===null||T[Y]===void 0)&&delete T[Y]});let R;if(X.value)R=await i(X.value,q.value,T);else if(Z.value){let Y=Z.value;if(r.baseUrl&&typeof Y=="string"&&!Y.startsWith("http")){const I=r.baseUrl.replace(/\/$/,""),j=Y.startsWith("/")?Y:`/${Y}`;Y=`${I}${j}`}R=await i(Y,W.value,T)}Rd(R)}catch(T){console.error("DataTable fetch error",T),C.value=!1}},Rd=T=>{console.log("DataTable handleResponseData:",T),T&&(r.dynamicColumns&&T.columns&&Array.isArray(T.columns)&&(S.value=T.columns.map(R=>({key:R.key||R.field||R.name,label:R.label||R.header||R.name,width:R.width,align:R.align||"LEFT",sortable:R.sortable!==!1,type:R.type,condition:R.condition,format:R.format}))),T.data&&Array.isArray(T.data)?(x.value=T.data,T.totalData?y.value=T.totalData:T.maxPage?y.value=T.maxPage*m.value:y.value=T.data.length*(T.maxPage||1)):Array.isArray(T)?(x.value=T,y.value=T.length):T.users?(x.value=T.users,y.value=T.users.length):T.items&&Array.isArray(T.items)?(x.value=T.items,y.value=T.total||T.totalItems||T.items.length):T.list&&Array.isArray(T.list)?(x.value=T.list,y.value=T.total||T.list.length):T.rows&&Array.isArray(T.rows)?(x.value=T.rows,y.value=T.count||T.total||T.rows.length):T.result&&Array.isArray(T.result)?(x.value=T.result,y.value=T.total||T.count||T.result.length):(console.warn("DataTable: Unknown response format",T),x.value=[],y.value=0)),C.value=!1};e.onUnmounted(()=>{clearTimeout(qr),clearTimeout(Gr)});const Kr=()=>{Object.keys(p.value).forEach(T=>{p.value[T]=""}),u.value="",f.value=1,rt()},Ld=()=>{f.value=1,rt()},Xr=(T,R)=>{const Y=Ee(T,R.key);let I={variant:"secondary",class:"",label:Y};if(R.condition){const j=R.condition.find(J=>{if(J.logic||typeof J.value=="object"&&J.value!==null)try{const ge=J.logic||J.value;return ht.apply(ge,T)}catch(ge){return console.warn("Badge logic error:",ge),!1}const ie=(ge,be)=>ge==null||be===void 0||be===null?!1:typeof ge=="string"&&typeof be=="string"?ge.toLowerCase().trim()===be.toLowerCase().trim():ge==be;if(ie(J.value,Y)||typeof Y=="object"&&Y!==null&&(ie(J.value,Y.code)||ie(J.value,Y.id)))return!0;if(R.key.includes(".")){const be=R.key.split(".").slice(0,-1).join("."),ye=Ee(T,be);if(ye&&typeof ye=="object"&&(ie(J.value,ye.code)||ie(J.value,ye.id)))return!0}return!1});if(j){j.variant&&(I.variant=j.variant);const ie=(l.value||"en")==="id"?j.labelID:j.labelEN;if(I.label=ie||j.label||(typeof Y=="object"?Y.name||Y.code:Y),j.color||j.bgColor){const ge=(j.color||j.bgColor||"").toLowerCase(),be=I.variant==="outline",ye={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow",primary:"bg-primary-600 hover:bg-primary-700 border-transparent text-white shadow",secondary:"bg-neutral-500 hover:bg-neutral-600 border-transparent text-white shadow",danger:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow",destructive:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow"},Te={success:"text-green-600 border-green-600 hover:bg-green-50",warning:"text-yellow-600 border-yellow-600 hover:bg-yellow-50",info:"text-blue-600 border-blue-600 hover:bg-blue-50",danger:"text-red-600 border-red-600 hover:bg-red-50",destructive:"text-red-600 border-red-600 hover:bg-red-50",primary:"text-primary-600 border-primary-600 hover:bg-primary-50",secondary:"text-neutral-600 border-neutral-600 hover:bg-zinc-50"},Be={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};be?Te[ge]&&(I.class=Te[ge]):Be[ge]?I.variant=Be[ge]:ye[ge]&&(I.class=ye[ge])}}else I.label=typeof Y=="object"?(Y==null?void 0:Y.name)||(Y==null?void 0:Y.code)||"-":Y}else I.label=typeof Y=="object"?(Y==null?void 0:Y.name)||(Y==null?void 0:Y.code)||"-":Y;return I},$d=T=>{h.value.key===T?h.value.direction=h.value.direction==="asc"?"desc":"asc":(h.value.key=T,h.value.direction="asc"),a("update:sort",h.value)},$s=T=>{T!==f.value&&(f.value=T,ee.value&&rt(),a("update:page",T))},jd=T=>{m.value=T,f.value=1,ee.value&&rt()},Ud=T=>{const R=Math.random()*15+75;if(T.width){const Y=parseInt(String(T.width));return Y<100?`${Math.floor(Y*(Math.random()*.2+.7))}px`:`${R}%`}return`${R}%`},Yr=()=>{u.value="",p.value={},f.value=1,rt()},xA=T=>{var R;if(console.log("[DEBUG] handleHeaderAction called:",T),T.route&&!r.dummyMode){if(T.path){const Y=T.route.startsWith("/")?T.route:"/"+T.route;sessionStorage.setItem(`layout_${Y}`,T.path)}d==null||d.push(T.route)}else if(T.openDialog||r.dummyMode&&T.route){B.value=T,D.value=null,w.value={};const Y=T.fieldActionGlobal||T.field||[];Y.length&&Y.forEach(I=>{var ie;const j=T.endpoint||((ie=T.propsActionGlobal)==null?void 0:ie.endpointPropAction)||T.propsActionGlobal,J=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;J&&I.model===J||!J&&/^(id|ids|idAuditTrail)/i.test(I.model)?w.value[I.model]=N.value:w.value[I.model]||(w.value[I.model]="")}),M.value=!0}else a("action",{action:((R=T.propsActionCustom)==null?void 0:R.key)||T.key||"create",row:null,selection:N.value})},kA=async(T,R)=>{var Y,I,j,J;if(T.requireConfirm){_.value={button:T,row:R},b.value=!0;return}if(T.openDialog){B.value=T,D.value=R,w.value={};const ie=K.value.find(ye=>ye.type==="CHECKBOX"),ge=(ie==null?void 0:ie.keyCheckbox)||"id";T.fieldActionCustom&&T.fieldActionCustom.forEach(ye=>{/^(id|ids|idAuditTrail)/i.test(ye.model)?w.value[ye.model]=[R[ge]]:T.action==="showToken"&&ye.model==="token"?w.value[ye.model]=R.token!==void 0?R.token:"":R[ye.model]!==void 0?w.value[ye.model]=R[ye.model]:w.value[ye.model]=""});const be=T.endpoint||((Y=T.propsActionGlobal)==null?void 0:Y.endpointPropAction)||((I=T.propsActionCustom)==null?void 0:I.endpointPropAction)||((j=T.props)==null?void 0:j.endpointPropAction);if(((J=be==null?void 0:be.apiMethod)==null?void 0:J.toUpperCase())==="GET"&&be.apiUrl){C.value=!0;const{apiUrl:ye}=Ke(),Te={};be.keyParam&&Array.isArray(be.keyParam)&&be.keyParam.forEach((Be,Ne)=>{const pt=be.model&&Ne===0?be.model:Be;R[Be]!==void 0&&(Te[pt]=R[Be])}),Object.keys(Te).length===0&&R.id&&(Te.id=R.id),ye(be.apiUrl,"GET",Te).then(Be=>{let Ne=Be;if(Be&&Be.data!==void 0?Ne=Be.data:Be&&Be.result!==void 0&&(Ne=Be.result),Ne!=null){if(typeof Ne=="string")w.value.hasOwnProperty("token")&&(w.value.token=Ne);else if(typeof Ne=="object"&&(Ne.item&&(Ne=Ne.item),Array.isArray(Ne)&&(Ne=Ne[0]||{}),Object.keys(Ne).forEach(pt=>{w.value[pt]=Ne[pt]}),!w.value.token)){const pt=Object.keys(Ne).find(It=>It.toLowerCase().includes("token"));if(pt)w.value.token=Ne[pt];else{const It=Object.values(Ne).filter(Qr=>typeof Qr=="string");It.length===1&&(w.value.token=It[0])}}}M.value=!0}).catch(Be=>{console.error("Fetch Data Failed",Be)}).finally(()=>{C.value=!1});return}M.value=!0;return}Wd(T,R)},Wd=(T,R)=>{if(T.route){if(T.path){const j=T.route.startsWith("/")?T.route:"/"+T.route;sessionStorage.setItem(`layout_${j}`,T.path)}let Y=T.route;Y.includes(":")?Y=Y.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,J)=>R[J]||R.id||J):R.id&&(Y=`${Y.replace(/\/$/,"")}/${R.id}`);const I={};T.path&&(I.code=T.path),d==null||d.push({path:Y,query:I})}else if(T.endpoint&&T.endpoint.apiUrl){C.value=!0;const{apiUrl:Y}=Ke(),I=T.endpoint.apiUrl,j=T.endpoint.apiMethod||"POST",J={},ie=T.fieldMapping;if(ie&&typeof ie=="object"){const{locale:ge}=bt.useI18n(),be=ge.value||"en",ye=[];if(Object.entries(ie).forEach(([Te,Be])=>{if(typeof Be=="string"){const Ne=Ee(R,Te);Ne!==void 0?J[Be]=Ne:(console.warn(`[MAPPING-DEBUG] No matching source found for '${Te}'`),ye.push(Te))}}),ye.length>0){const Te=be==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Be=be==="id"?`Terdapat ketidaksesuaian skema pada field: ${ye.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${ye.join(", ")}. Please contact the development team.`;Pe.warning(`${Te}: ${Be}`,{autoClose:5e3,position:"top-right"})}}if(Object.keys(J).length===0){const ge=T.endpoint;ge.model&&ge.keyParam&&Array.isArray(ge.keyParam)?ge.keyParam.forEach(be=>{const ye=Ee(R,be);ye!==void 0&&(J[ge.model]=ye)}):R.id&&(J.id=R.id)}Y(I,j,J).then(()=>{rt(),a("action",{action:T.action||"success",row:R})}).catch(ge=>{console.error("Action Failed",ge)}).finally(()=>{C.value=!1})}else a("action",{action:T.action,row:R})},wA=()=>{_.value&&(Wd(_.value.button,_.value.row),Hd())},CA=()=>{var T,R,Y;if(B.value){const I=B.value,j=I.endpoint||((T=I.propsActionGlobal)==null?void 0:T.endpointPropAction)||I.propsActionGlobal;let J=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!J){const ye=(I.fieldActionGlobal||I.fieldActionCustom||I.field||[]).find(Te=>/^(id|ids|idAuditTrail)/i.test(Te.model));J=ye?ye.model:"ids"}let ie=null,ge=!1;if(D.value){const be=K.value.find(Be=>Be.type==="CHECKBOX"),ye=(be==null?void 0:be.keyCheckbox)||"id",Te=D.value[ye];if(j!=null&&j.apiUrl){ie={...w.value};const Be=I.fieldMapping;Be&&typeof Be=="object"&&Object.entries(Be).forEach(([Ne,pt])=>{if(typeof pt=="string"){const It=Ee(D.value,Ne);It!==void 0&&(ie[pt]=It)}}),ie[J]||(ie[J]=j!=null&&j.model?Te:[Te]),ge=!0}}else j!=null&&j.apiUrl&&(ie={...w.value},ie[J]||(ie[J]=N.value||[]),ge=!0);if(ge&&ie&&(j!=null&&j.apiUrl)){if(((R=j==null?void 0:j.apiMethod)==null?void 0:R.toUpperCase())==="GET"){M.value=!1,D.value||(N.value=[]);return}const{apiUrl:be}=Ke(),ye=j.apiUrl,Te=j.apiMethod||"POST";be(ye,Te,ie).then(()=>{M.value=!1,D.value||(N.value=[]),rt(),a("action",{action:"success",row:null})}).catch(Be=>{console.error("Action Failed",Be)})}else if(D.value){const be=K.value.find(Ne=>Ne.type==="CHECKBOX"),ye=(be==null?void 0:be.keyCheckbox)||"id",Te=D.value[ye],Be={...w.value};Be[J]||(Be[J]=[Te]),a("action",{action:B.value.action,row:Be}),M.value=!1}else{const be={...w.value};be[J]||(be[J]=N.value);const ye={action:((Y=B.value.propsActionGlobal)==null?void 0:Y.key)||B.value.key,row:be,selection:N.value};a("action",ye),M.value=!1}}},BA=T=>{const R=w.value[T];R&&Mm(String(R)).then(()=>{Pe.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(Y=>{console.error("Failed to copy",Y)})},Hd=()=>{b.value=!1,_.value=null},EA=e.computed(()=>_.value?_.value.button.confirmTitle||"Confirm":""),_A=e.computed(()=>_.value?_.value.button.confirmMessage||"Confirm":"");n({fetchData:rt,filters:p,resetFilters:Kr,handleRefresh:Yr});const Jr=e.ref(""),SA=T=>{if(!T)return"";const R=T.endpoint||T.endpointGlobal||{};return JSON.stringify({url:R.apiUrl||T.apiUrl,module:R.apiModule||T.apiModule,action:R.apiAction||T.apiAction,method:R.apiMethod||T.apiMethod,params:T.apiParams,socket:R.socket||T.socketEndpoint,socketParams:T.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){fe();const T=SA(r.tableConfig);T!==Jr.value&&(!Jr.value&&ee.value?(Jr.value=T,rt()):(Jr.value=T,ee.value&&Id()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{ee.value&&rt()}),e.watch(()=>r.apiParams,()=>{ee.value&&rt()},{deep:!0}),e.watch(()=>k.value,T=>{console.log("[DEBUG] headerActions changed:",T.length,"items");const R=ze.value;console.log("[DEBUG] visibleHeaderActions evaluated:",R.length,"items")},{deep:!0}),e.onMounted(()=>{fe(),ee.value&&(r.tableConfig||(C.value=!0,rt()))}),(T,R)=>{var Y;return e.openBlock(),e.createElementBlock("div",g_,[e.createElementVNode("div",b_,[e.createElementVNode("div",y_,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",x_,[e.createElementVNode("div",k_,[e.createVNode(e.unref(te.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(ZE),{modelValue:u.value,"onUpdate:modelValue":R[0]||(R[0]=I=>u.value=I),placeholder:"Search...",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:e.withKeys(zt,["enter"])},null,8,["modelValue"])]),g.value.length>0?(e.openBlock(),e.createElementBlock("div",w_,[e.createVNode(YE,null,{trigger:e.withCtx(()=>[e.createVNode(Le,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",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"})]),footer:e.withCtx(()=>[e.createElementVNode("div",S_,[e.renderSlot(T.$slots,"filter-footer",{fetch:rt,reset:Kr})])]),default:e.withCtx(()=>[R[9]||(R[9]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",C_,[e.renderSlot(T.$slots,"filter-form",{filters:p.value},()=>[g.value.length>0?(e.openBlock(),e.createElementBlock("div",B_,[e.createElementVNode("div",E_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ue.value,(I,j)=>(e.openBlock(),e.createElementBlock("div",{key:j,class:e.normalizeClass(ke(I))},[e.createVNode(gd,{field:I,modelValue:p.value[I.model],"onUpdate:modelValue":J=>p.value[I.model]=J},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),g.value.length>0?(e.openBlock(),e.createElementBlock("div",__,[e.createVNode(Le,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Kr,disabled:G.value},null,8,["disabled"]),e.createVNode(Le,{onClick:Ld,disabled:G.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",A_)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Le,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"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:Yr,disabled:G.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(te.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":G.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,(I,j)=>(e.openBlock(),e.createBlock(Le,{key:j,icon:I.icon,text:I.label,tooltip:I.tooltip,variant:I.variant,"bg-color":I.bgColor,"text-color":I.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:J=>xA(I)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(T.$slots,"header-actions")],2)])]),e.createElementVNode("div",V_,[e.createElementVNode("table",D_,[e.createElementVNode("thead",N_,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,I=>(e.openBlock(),e.createElementBlock("th",{key:I.key,class:e.normalizeClass([I.align?`text-${I.align.toLowerCase()}`:"text-left",I.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:e.normalizeStyle(I.width?{width:I.width}:{}),onClick:j=>I.sortable&&$d(I.key)},[I.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",P_,[e.createVNode(Yt,{"model-value":O.value,indeterminate:v.value,"onUpdate:modelValue":R[1]||(R[1]=j=>$(!!j)),onClick:R[2]||(R[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",Ze(I.align)])},[e.createElementVNode("span",null,e.toDisplayString(I.label),1)],2))],14,M_))),128)),z.value?(e.openBlock(),e.createElementBlock("th",T_,[...R[10]||(R[10]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",v_,[G.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,I=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${I}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,j=>{var J,ie;return e.openBlock(),e.createElementBlock("td",{key:j.key,class:e.normalizeClass([j.align?`text-${j.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes(j.type??"")||j.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((J=j.align)==null?void 0:J.toLowerCase())==="center"?"mx-auto":"",((ie=j.align)==null?void 0:ie.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:Ud(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",O_,[...R[11]||(R[11]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):H.value.length===0?(e.openBlock(),e.createElementBlock("tr",F_,[e.createElementVNode("td",{colspan:K.value.length+(z.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",I_,[e.createVNode(e.unref(tu.Vue3Lottie),{animationData:e.unref(u_),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",R_,e.toDisplayString(xe.value?"No search results":"No data"),1),e.createElementVNode("p",L_,e.toDisplayString(xe.value?"Try changing keywords":"No data added"),1)])])],8,z_)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(H.value,(I,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:j},[e.createElementVNode("tr",$_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,J=>(e.openBlock(),e.createElementBlock("td",{key:J.key,class:e.normalizeClass([J.align?`text-${J.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(T.$slots,`cell-${J.key}`,{row:I,value:Ee(I,J.key)},()=>[J.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",j_,[e.createVNode(Yt,{"model-value":L(I),"onUpdate:modelValue":ie=>U(I,!!ie),onClick:R[3]||(R[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):J.type==="badge"||J.type==="BADGE"||J.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[J.align?`justify-${J.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(Fs,{variant:Xr(I,J).variant,class:e.normalizeClass([Xr(I,J).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Xr(I,J).label),1)]),_:2},1032,["variant","class"])],2)):J.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*m.value+j+1),1)],64)):J.type==="date"||J.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Ee(I,J.key)?e.unref(Dm)(Ee(I,J.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(J.format?J.format(Ee(I,J.key)):Ee(I,J.key)),1)],64))])],2))),128)),z.value?(e.openBlock(),e.createElementBlock("td",U_,[e.renderSlot(T.$slots,"actions",{row:I,buttons:Ue(I),getButtonColor:Me,getIconComponent:At},()=>[Ue(I).length>0?(e.openBlock(),e.createElementBlock("div",W_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue(I),(J,ie)=>(e.openBlock(),e.createElementBlock("div",{key:ie,class:"group relative"},[e.createVNode(Le,{tooltip:J.tooltip||J.label,icon:J.icon,text:J.icon?"":J.label||(e.unref(l)==="id"?"Aksi":"Action"),size:J.icon?"icon":"sm",rounded:J.rounded||"sm",borderStyle:J.borderStyle||"none",variant:J.variant||"ghost","bg-color":Me(J,I),onClick:ge=>kA(J,I)},null,8,["tooltip","icon","text","size","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),T.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",H_,[e.createElementVNode("td",{colspan:K.value.length+(z.value?1:0),class:"px-0 py-0"},[e.renderSlot(T.$slots,"expanded-row",{row:I,index:j})],8,q_)])):e.createCommentVNode("",!0)],64))),128))])])]),!G.value&&H.value.length>0&&t.showPagination&&E.value?(e.openBlock(),e.createElementBlock("div",G_,[e.createElementVNode("div",K_,[e.createVNode(e.unref(l2),{"model-value":String(m.value),"onUpdate:modelValue":R[4]||(R[4]=I=>jd(Number(I)))},{default:e.withCtx(()=>[e.createVNode(e.unref(h2),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(p2),{placeholder:String(m.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(c2),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(He,I=>e.createVNode(e.unref(u2),{key:I,value:String(I)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(I),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),R[16]||(R[16]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",X_,[R[12]||(R[12]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",Y_,e.toDisplayString(pe.value),1),R[13]||(R[13]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",J_,e.toDisplayString(Re.value),1),R[14]||(R[14]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",Q_,e.toDisplayString(re.value),1),R[15]||(R[15]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",Z_,[e.createVNode(e.unref(e2),{total:re.value,"items-per-page":m.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":$s,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(t2),{class:"flex items-center gap-1"},{default:e.withCtx(({items:I})=>[e.createVNode(e.unref(o2),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(i2),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(I,(j,J)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[j.type==="page"?(e.openBlock(),e.createBlock(e.unref(r2),{key:J,value:j.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(St),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:ie=>$s(j.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(n2),{key:j.type,index:J},null,8,["index"]))],64))),256)),e.createVNode(e.unref(s2),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(a2),{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:e.withCtx(()=>[e.createVNode(e.unref(te.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(Jt,{modelValue:b.value,"onUpdate:modelValue":R[5]||(R[5]=I=>b.value=I),title:EA.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",onClick:Hd,text:"Cancel"}),e.createVNode(Le,{variant:"default",onClick:wA,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",eS,[e.createElementVNode("p",tS,e.toDisplayString(_A.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(Jt,{modelValue:M.value,"onUpdate:modelValue":R[8]||(R[8]=I=>M.value=I),title:((Y=B.value)==null?void 0:Y.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>{var I;return[e.createVNode(Le,{variant:"outline",onClick:R[6]||(R[6]=j=>M.value=!1),text:"Cancel"}),t.dummyMode&&((I=B.value)!=null&&I.route)?(e.openBlock(),e.createBlock(Le,{key:1,variant:"default",onClick:R[7]||(R[7]=j=>M.value=!1),text:e.unref(l)==="id"?"Tutup":"Close"},null,8,["text"])):(e.openBlock(),e.createBlock(Le,{key:0,variant:"default",onClick:CA,text:"Save"}))]}),default:e.withCtx(()=>{var I,j,J;return[e.createElementVNode("div",nS,[t.dummyMode&&((I=B.value)!=null&&I.route)?(e.openBlock(),e.createElementBlock("div",oS,[e.createElementVNode("div",rS,[e.createVNode(e.unref(te.Search),{class:"w-4 h-4"})]),e.createElementVNode("div",aS,[e.createElementVNode("span",sS,e.toDisplayString(e.unref(l)==="id"?"Info Navigasi":"Navigation Info"),1),e.createElementVNode("p",iS,e.toDisplayString(e.unref(l)==="id"?`Aksi ini akan mengarah ke rute: ${B.value.route}`:`This action will navigate to: ${B.value.route}`),1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((j=B.value)==null?void 0:j.fieldActionCustom)||((J=B.value)==null?void 0:J.fieldActionGlobal)||[],(ie,ge)=>{var be,ye,Te,Be;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ge},[!ie.isHidden&&!(t.dummyMode&&((be=B.value)!=null&&be.route))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(ke(ie))},[e.createElementVNode("div",lS,[e.createVNode(gd,{class:"flex-1 w-full",field:ie,modelValue:w.value[ie.model],"onUpdate:modelValue":Ne=>w.value[ie.model]=Ne},null,8,["field","modelValue","onUpdate:modelValue"]),ie.isCopyable||(ye=ie.props)!=null&&ye.isCopyable||((Te=B.value)==null?void 0:Te.action)==="showToken"||((Be=B.value)==null?void 0:Be.action)==="copyToken"?(e.openBlock(),e.createBlock(Le,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:Ne=>BA(ie.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)],64)}),128))])]}),_:1},8,["modelValue","title"])])}}}),cS={class:"flex items-center gap-2 shrink-0"},dS={class:"flex-1 text-right overflow-hidden"},uS=["title"],No=at(e.defineComponent({name:"DCodeStaticLabel",__name:"DCodeStaticLabel",props:{label:{},value:{},icon:{},color:{}},setup(t){const n=t,o=e.computed(()=>{const a=n.color||"secondary",s={primary:"border-blue-200 text-blue-700",success:"border-green-200 text-green-700",warning:"border-yellow-200 text-yellow-700",danger:"border-red-200 text-red-700",info:"border-cyan-200 text-cyan-700",secondary:"border-slate-200 text-slate-700 dark:border-slate-700/50",dark:"border-b border-gray-300 text-gray-900 dark:text-gray-100"};return s[a]||s.secondary}),r=a=>a==null||a===""?"-":typeof a=="boolean"?a?"Yes":"No":String(a);return(a,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-row justify-between items-center gap-4 py-3 px-0 border-b transition-all duration-300 rounded-none bg-transparent",o.value])},[e.createElementVNode("div",cS,[e.createVNode(Dn,{label:t.label,icon:t.icon,class:"text-xs font-semibold text-neutral-500 dark:text-neutral-400 uppercase tracking-wider"},null,8,["label","icon"])]),e.createElementVNode("div",dS,[e.renderSlot(a.$slots,"value",{},()=>[e.createElementVNode("span",{class:"text-sm font-medium truncate block",title:r(t.value)},e.toDisplayString(r(t.value)),9,uS)],!0)])],2))}}),[["__scopeId","data-v-19682b84"]]),fS={class:"space-y-2 group"},mS=["onClick"],hS=["src","alt"],pS={key:0,class:"absolute inset-0 bg-black/0 group-hover/item:bg-black/20 flex items-center justify-center opacity-0 group-hover/item:opacity-100 transition-all duration-300"},gS={class:"bg-white/90 dark:bg-neutral-800/90 p-1.5 rounded-full shadow-sm"},bS={key:0,class:"flex flex-col h-full"},yS={class:"flex flex-col items-center justify-center p-8 bg-neutral-50 dark:bg-neutral-950/50"},xS=["src","alt"],kS={class:"px-8 py-4 bg-white dark:bg-neutral-900 border-t border-neutral-200 dark:border-neutral-700/50"},wS={class:"flex flex-col space-y-0.5"},Dd=at(e.defineComponent({name:"DCodeStaticImage",__name:"DCodeStaticImage",props:{items:{},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"}},setup(t){const n=t,o=e.computed(()=>Array.isArray(n.items)?n.items.map(d=>typeof d=="string"?{src:d,alt:n.alt}:{...d,alt:d.alt||n.alt}):[]),r=e.ref(null),a=e.ref(!1),s=d=>{n.allowPreview&&(r.value=d,a.value=!0)},i=()=>{r.value=null,a.value=!1},l=e.computed(()=>({display:"grid",gridTemplateColumns:`repeat(${n.columns}, minmax(0, 1fr))`,gap:n.gap,width:n.width||"100%"})),c=e.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(" "));return e.onMounted(()=>{window.addEventListener("keydown",d=>{r.value!==null&&d.key==="Escape"&&i()})}),(d,u)=>(e.openBlock(),e.createElementBlock("div",fS,[e.createElementVNode("div",{style:e.normalizeStyle(l.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(f,m)=>(e.openBlock(),e.createElementBlock("div",{key:m,class:"flex flex-col space-y-1 group/item"},[e.createElementVNode("div",{class:e.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",[t.rounded?"rounded-xl":"rounded-none",t.allowPreview?"cursor-zoom-in":""]]),style:e.normalizeStyle({aspectRatio:t.aspectRatio}),onClick:h=>s(m)},[e.createElementVNode("img",{src:f.src,alt:f.alt,class:e.normalizeClass(c.value),loading:"lazy"},null,10,hS),t.allowPreview?(e.openBlock(),e.createElementBlock("div",pS,[e.createElementVNode("div",gS,[e.createVNode(e.unref(te.Maximize2),{class:"w-3.5 h-3.5 text-neutral-700 dark:text-neutral-200"})])])):e.createCommentVNode("",!0)],14,mS)]))),128))],4),e.createVNode(Jt,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=f=>a.value=f),title:(r.value!==null?o.value[r.value].label:null)||t.label||"Preview Image","max-width":"1200",persistent:!1,onClose:i},{"header-append":e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"p-2 hover:bg-neutral-100 dark:hover:bg-neutral-800 rounded-full text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-200 transition-colors",onClick:i},[e.createVNode(e.unref(te.X),{class:"w-5 h-5"})])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-5 py-2 text-sm font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-700 dark:text-neutral-200 rounded-md hover:bg-neutral-200 dark:hover:bg-neutral-700 transition-colors",onClick:i}," Close Preview ")]),default:e.withCtx(()=>[r.value!==null?(e.openBlock(),e.createElementBlock("div",bS,[e.createElementVNode("div",yS,[e.createElementVNode("img",{src:o.value[r.value].src,alt:o.value[r.value].alt||t.alt,class:"max-w-full max-h-[60vh] object-contain shadow-2xl rounded-sm border border-neutral-200 dark:border-white/10"},null,8,xS)]),e.createElementVNode("div",kS,[e.createElementVNode("div",wS,[e.createVNode(No,{label:"File Name",value:o.value[r.value].src.split("/").pop()||"Untitled"},null,8,["value"]),o.value[r.value].label?(e.openBlock(),e.createBlock(No,{key:0,label:"Item Label",value:o.value[r.value].label},null,8,["value"])):e.createCommentVNode("",!0),t.label?(e.openBlock(),e.createBlock(No,{key:1,label:"Gallery Label",value:t.label},null,8,["value"])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])]))}}),[["__scopeId","data-v-ac931980"]]);function CS(){const t=e.reactive({}),n=e.reactive({}),o=e.reactive({}),r=e.reactive({}),a=e.reactive({}),s=e.ref(!1),i=e.ref(null),l=e.reactive({}),c=e.reactive({visible:!1,title:"",message:"",action:null});return{formData:t,errors:n,fieldErrors:o,wizardState:r,inlineState:a,isSubmitting:s,internalSchema:i,rawItemsCache:l,confirmDialog:c}}const Ur=t=>{var n,o,r;return((n=t.propsForm)==null?void 0:n.key)||((o=t.propsTable)==null?void 0:o.key)||((r=t.propsWizard)==null?void 0:r.key)||t.id},Yn=(t,n)=>n?n.split(".").reduce((o,r)=>o==null?void 0:o[r],t):void 0,Nd=(t,n,o)=>{if(!n)return;const r=n.split(".");let a=t;for(let s=0;s<r.length-1;s++){const i=r[s];(a[i]===void 0||a[i]===null||typeof a[i]!="object")&&(a[i]={}),a=a[i]}a[r[r.length-1]]=o},Nn=t=>{const n=e.toRaw(t);if(Array.isArray(n))return n.map(o=>Nn(o));if(n&&typeof n=="object"){const o={};return Object.keys(n).forEach(r=>o[r]=Nn(n[r])),o}return n},Wr=t=>{if(!t||typeof t!="object")return[];if("var"in t)return[t.var];let n=[];return Object.values(t).forEach(o=>{Array.isArray(o)?o.forEach(r=>{n=n.concat(Wr(r))}):typeof o=="object"&&(n=n.concat(Wr(o)))}),n},BS=t=>t?[...t].sort((n,o)=>(n.seq||0)-(o.seq||0)):[],Md=(t,n={})=>(!t||typeof t!="object"||Object.keys(t).forEach(o=>{const r=t[o];r&&typeof r=="object"&&!Array.isArray(r)&&!r._isLogicValue?Md(r,n):n[o]=r}),n),zs=(t,n)=>{if(!t||typeof t!="string"||t.startsWith("http")||!n)return t;const o=n.replace(/\/$/,""),r=t.startsWith("/")?t:`/${t}`;return`${o}${r}`};function ES({formData:t,errors:n,fieldMap:o,rawItemsCache:r,activeSchema:a,locale:s}){const i=(B,D)=>{if(D==null||typeof D=="object"&&D._isLogicValue)return D;const N=o.value.get(B);if(!N)return D;const O=N.field,v=r[O.key];if(!v||!Array.isArray(v))return D;const $=(O.props||{}).itemValue||"id",U=v.find(P=>String(P[$])===String(D)||String(P.id)===String(D)||String(P.code)===String(D));return U!=null&&U.code?{id:D,code:U.code,_isLogicValue:!0}:D},l=B=>{const D=(N,O)=>{if(N==null||typeof N=="object"&&N._isLogicValue)return N;if(typeof N=="boolean")return String(N);if(typeof N=="number"||typeof N=="string")return O?i(O,N):N;if(typeof N=="object"&&!Array.isArray(N)){const v=(N==null?void 0:N.id)??(N==null?void 0:N.code)??(N==null?void 0:N.value)??(N==null?void 0:N.key)??N;return O&&(typeof v=="string"||typeof v=="number")?i(O,v):v}return N};return new Proxy(B,{get(N,O){if(typeof O!="string")return N[O];const v=o.value.get(O);if(v){const L=Yn(N,v.path);if(L!=null)return D(L,O)}return D(N[O],O)}})},c=e.computed(()=>{const B={};for(const D of Object.keys(t))B[D]=t[D];return B}),d=e.computed(()=>l(c.value)),u=()=>{const B=D=>D&&typeof D=="object"&&D._isLogicValue;ht.add_operation("length",D=>D==null?0:B(D)?Object.keys(D).length:typeof D=="string"?D.length:typeof D=="number"?String(D).length:Array.isArray(D)?D.length:typeof D=="object"?Object.keys(D).length:0),ht.add_operation("==",(D,N)=>D==null?N==null:N==null?D==null:B(D)&&B(N)?String(D.id)===String(N.id)||String(D.code)===String(N.code):B(D)?String(D.code)===String(N)||String(D.id)===String(N):B(N)?String(N.code)===String(D)||String(N.id)===String(D):typeof D=="boolean"&&typeof N=="string"?String(D)===N:typeof N=="boolean"&&typeof D=="string"?String(N)===D:String(D)===String(N)),ht.add_operation("!=",(D,N)=>{const O=v=>v&&typeof v=="object"&&v._isLogicValue;return D==null&&N==null?!1:D==null||N==null?!0:O(D)&&O(N)?String(D.id)!==String(N.id)&&String(D.code)!==String(N.code):O(D)?String(D.code)!==String(N)&&String(D.id)!==String(N):O(N)?String(N.code)!==String(D)&&String(N.id)!==String(D):String(D)!==String(N)})},f=(B,D,N="LOGIC")=>{if(B==null||typeof B=="object"&&Object.keys(B).length===0)return!0;if(typeof B=="boolean")return B;if(typeof B=="object")try{return u(),ht.apply(B,D)}catch(O){return console.error(`[${N}] JsonLogic error:`,O),!1}return!1},m=(B,D,N)=>B==null?null:Array.isArray(B)?B.find(O=>!O.condition||f(O.condition,D))||null:B,h=(B,D)=>{var L;if(B.isHidden)return!0;const N=D?l(D):d.value,O=(L=B.logic)==null?void 0:L.visibleRule;if(O==null)return!0;const v=m(O,N,`VISIBLE-${B.model}`);return v===null?!0:typeof v=="object"?!!f(v,N,`VISIBLE-${B.model}`):!!v},x=(B,D)=>{var L,$,U;const N=D?l(D):d.value,O=(L=B.logic)==null?void 0:L.requiredRule;if(O==null)return(($=B.props)==null?void 0:$.required)||!1;const v=m(O,N,`REQUIRED-${B.model}`);return v===null?((U=B.props)==null?void 0:U.required)||!1:typeof v=="object"?"required"in v?!!v.required:!!f(v,N):!!v},C=(B,D)=>{var L,$,U;const N=D?l(D):d.value,O=(L=B.logic)==null?void 0:L.disabledRule;if(O==null)return(($=B.props)==null?void 0:$.disabled)||!1;const v=m(O,N,`DISABLED-${B.model}`);return v===null?((U=B.props)==null?void 0:U.disabled)||!1:typeof v=="object"?"disabled"in v?!!v.disabled:!!f(v,N):!!v},y=(B,D)=>{var L,$,U;const N=D?l(D):d.value,O=(L=B.logic)==null?void 0:L.disabledRule;return O===!1?!0:O==null?(($=B.props)==null?void 0:$.readonly)||!1:m(O,N,`READONLY-${B.model}`)===!1?!0:((U=B.props)==null?void 0:U.readonly)||!1},p=B=>{var L;const D=B.propsForm||B.propsTable||B.propsWizard||B.props||{};let N=s.value==="id"?D.titleID||B.titleID||B.labelID:D.titleEN||B.titleEN||B.labelEN,O=s.value==="id"?D.descriptionID||B.descriptionID:D.descriptionEN||B.descriptionEN;const v=m((L=B.logic||D.logic)==null?void 0:L.labelingRule,d.value);return v&&(N=s.value==="id"?v.labelID||v.titleID||v.title:v.labelEN||v.titleEN||v.title,O=s.value==="id"?v.descriptionID:v.descriptionEN),{title:N,description:O}},S=(B,D)=>{var $,U;if(!B)return!0;const N=B.propsForm||B.propsTable||B.propsWizard||B.props||{},O=($=B.logic||N.logic)==null?void 0:$.visibleRule,v=D?l(D):d.value;if(O!=null){const P=m(O,v);return P===null?!0:typeof P=="object"?!!f(P,v,"VISIBLE-SEC"):!!P}if(B.type==="TABLE"&&((U=N.headers)!=null&&U.length))return!0;const L=N.fields||B.fields||[];return L.length===0||L.some(P=>h(P,D))},V=(B,D)=>{var v;const N=D?l(D):d.value;return m((v=B.logic)==null?void 0:v.labelingRule,N,`LABEL-${B.model}`)||null},E=(B,D)=>{var v;const N=D?l(D):d.value;return m((v=B.logic)==null?void 0:v.lengthRule,N,`LENGTH-${B.model}`)||null},A=(B,D)=>{var P;const N=B.props||{},O=r[B.key]||N.items||N.options||[];if(!((P=B.logic)!=null&&P.optionsFilterRule))return O;const v=D?l(D):d.value,L=m(B.logic.optionsFilterRule,v,`FILTER-${B.model}`);if(!(L!=null&&L.values))return O;const $=new Set((L.values||[]).map(String)),U=N.itemValue||"id";return O.filter(F=>F==null?!1:typeof F!="object"?$.has(String(F)):[U,"code","id","value","key"].some(X=>{const q=F[X];return q!=null&&$.has(String(q))}))},k=B=>{var N;return(((N=B.propsWizard)==null?void 0:N.propsSteps)||[]).filter(O=>S(O)).map((O,v)=>{var U;let L=[];if(Array.isArray(O.sectionsWizard))L=O.sectionsWizard;else if(O.sectionsWizard&&typeof O.sectionsWizard=="object"){const P=O.sectionsWizard;let F=P.type;F||(P.fields?F="FORM":P.isDataTable?F="TABLE":F="UNKNOWN"),L=[{type:F,...P}]}const $=p(O);return{key:O.key||`step-${v}`,title:$.title,description:$.description,icon:O.icon||void 0,sections:L,actions:((U=O.propsComponent)==null?void 0:U.actionComponent)||O.actionComponent||[]}})},g=()=>{var B;if((B=a.value)!=null&&B.sections)for(let D=0;D<3;D++){let N=!1;if(a.value.sections.forEach(O=>{var v;(((v=O.propsForm)==null?void 0:v.fields)||O.fields||[]).forEach(L=>{var U;const $=(U=L.logic)==null?void 0:U.calculateRule;if($&&typeof $=="object"){const P=Object.keys($)[0],F=f($[P],d.value,`CALC-${P}`);F!==void 0&&t[P]!==F&&(t[P]=F,N=!0)}})}),!N)break}},b=B=>{if(!h(B)||!x(B))return!1;const D=t[B.model];return Array.isArray(D)?D.length===0:D==null||D===""},M=B=>B.sections.flatMap(N=>N.fields||[]).some(b),w=B=>{var N;return(((N=B.propsForm)==null?void 0:N.fields)||B.fields||[]).some(b)?!0:B.type==="WIZARD"?k(B).some(M):!1},_=e.computed(()=>{var B;return(B=a.value)!=null&&B.sections?Object.keys(n).length>0?!0:a.value.sections.some(w):!1});return{normalizedData:d,getNormalizedData:l,evaluateLogic:f,resolveActiveRule:m,resolveValueIdentifier:i,getFilteredItems:A,isFieldVisible:h,isFieldRequired:x,isFieldDisabled:C,isFieldReadonly:y,resolveSectionLabels:p,isSectionVisible:S,resolveFieldLabels:V,resolveFieldLength:E,getWizardTabs:k,applyCalculations:g,isSubmitDisabled:_,resolveSectionGridClass:B=>{switch(B){case"FULL":return"grid-cols-1";case"HALF":return"grid-cols-1 md:grid-cols-2";case"THIRD":return"grid-cols-1 md:grid-cols-3";case"QUARTED":return"grid-cols-1 md:grid-cols-4";case"TWO-THIRD":return"grid-cols-2 md:grid-cols-3";case"THREE-QUARTER":return"grid-cols-3 md:grid-cols-4";default:return"grid-cols-1"}},resolveFieldColumnClass:(B,D="")=>{var O;const N=(O=B.props)==null?void 0:O.colSpan;return N==="FULL"?"col-span-1 md:col-span-full":N==="HALF"?"col-span-1 md:col-span-1":"col-span-1"}}}function _S({formData:t,locale:n,errors:o,fieldMap:r,activeSchema:a,isSectionVisible:s,isFieldVisible:i,isFieldRequired:l,resolveFieldLength:c}){const d=(f,m,h)=>{const x=f.props||f.propsFieldGlobal||{},C=m==null?"":String(m).trim();if(l(f,h)&&C==="")return n.value==="id"?"Wajib diisi":"Required";if(C==="")return null;const y=c==null?void 0:c(f,h),p=Number((y==null?void 0:y.minLength)??x.minLength),S=Number((y==null?void 0:y.maxLength)??x.maxLength);if(!Number.isNaN(p)&&p>0&&C.length<p)return n.value==="id"?`Minimal ${p} karakter`:`Minimum ${p} characters`;if(!Number.isNaN(S)&&S>0&&C.length>S)return n.value==="id"?`Maksimal ${S} karakter`:`Maximum ${S} characters`;if(x.regex)try{if(!new RegExp(x.regex).test(C))return x.regexMessage||(n.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${f.model}:`,x.regex)}return null};return{validateField:d,validateAll:()=>{var m,h;let f=!0;return(h=(m=a.value)==null?void 0:m.sections)==null||h.forEach(x=>{var C;s(x)&&(((C=x.propsForm)==null?void 0:C.fields)||x.fields||[]).forEach(y=>{if(y.model&&i(y)){const p=r.value.get(y.model),S=p?Yn(t,p.path):t[y.model],V=d(y,S);V&&(o[y.model]=V,f=!1)}})}),f}}}function SS({formData:t,activeSchema:n,isSectionVisible:o,isFieldVisible:r,getWizardTabs:a}){const s=()=>{var f;const d=[],u=m=>{m==null||m.forEach(h=>{var C;if(h.type==="TABLE"||h.propsTable){const y=h.propsTable||h;y.modelDatatable&&d.push({key:y.modelDatatable,subFields:(y.headers||[]).map(p=>p.key)})}(((C=h.propsForm)==null?void 0:C.fields)||h.fields||[]).forEach(y=>{var S,V;const p=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(y.component);if(y.model&&((S=y.props)!=null&&S.multiple||((V=y.props)==null?void 0:V.valueType)==="array"||p)){const E=y.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];d.push({key:y.model,subFields:E})}}),h.type==="WIZARD"&&a(h).forEach(y=>u(y.sections))})};return u((f=n.value)==null?void 0:f.sections),d};return{getCleanPayload:()=>{var f;if(!((f=n.value)!=null&&f.sections))return{...t};const d={},u=new Set;return n.value.sections.forEach(m=>{var y,p;if(!o(m))return;const x=Ur(m),C=(S,V)=>{if(S.model&&r(S)){const E=Yn(t,V?`${V}.${S.model}`:S.model)??t[S.model];d[S.model]=Nn(E)??null,u.add(S.model)}};if((((y=m.propsForm)==null?void 0:y.fields)||m.fields||[]).forEach(S=>{var V;return C(S,x||((V=m.propsForm)==null?void 0:V.key))}),m.type==="WIZARD"&&a(m).forEach(S=>S.sections.forEach(V=>(V.fields||[]).forEach(E=>C(E,S.key)))),(p=m.propsTable)!=null&&p.modelDatatable){const S=m.propsTable.modelDatatable;d[S]=Nn(t[S]||[]),u.add(S)}}),["id","_id"].forEach(m=>{t[m]!==void 0&&!u.has(m)&&(d[m]=Nn(t[m]))}),d},applyFieldMapping:(d,u)=>{const f={},m=h=>h&&typeof h=="object"?h._isLogicValue?h.id:h.id??h.code??h.value??h:h;return Object.entries(u).forEach(([h,x])=>{if(typeof x=="string"){const C=d[h]??Yn(t,h)??t[h];C!==void 0&&(f[x]=m(C))}else if(Array.isArray(x)&&x[0]){const C=x[0],y=Object.keys(C);let p=d[h]??Yn(t,h)??t[h];if(!Array.isArray(p)||p.length===0){const S=s().find(V=>y.some(E=>V.subFields.includes(E)));if(S){const V=d[S.key]??Yn(t,S.key)??t[S.key];Array.isArray(V)&&V.length>0&&(p=V)}}Array.isArray(p)&&(console.log(`[DynamicForm][MAPPING-SOURCE] ${h}:`,Nn(p)),f[h]=p.map((S,V)=>{const E={},A=Nn(S);return Object.entries(C).forEach(([k,g])=>{const b=A[k]??A[g]??S[k]??S[g]??null;E[g]=m(b)}),E}))}}),console.log("[DynamicForm][MAPPING-RESULT]",f),f},handleResponseMapping:(d,u)=>{const f=(d==null?void 0:d.data)!==void 0?d.data:d,m=Array.isArray(f)?f[0]:f;m&&Object.entries(u).forEach(([h,x])=>{const C=m[x]??m[h];C!==void 0&&Nd(t,h,C)})},getFormArrayModels:s}}function AS({state:t,props:n,emit:o,apiUrl:r,router:a,locale:s,mapping:i,validation:l,fieldMap:c,activeSchema:d,resolvedBaseUrl:u}){const f=S=>!S.permission||(n.isEditMode?S.permission!=="CREATE":S.permission!=="UPDATE"),m=S=>{var V,E,A,k;S.requireConfirm?(t.confirmDialog.title=s.value==="id"?((V=S.propCustomMessage)==null?void 0:V.titleID)||"Konfirmasi":((E=S.propCustomMessage)==null?void 0:E.titleEN)||"Confirm",t.confirmDialog.message=s.value==="id"?((A=S.propCustomMessage)==null?void 0:A.messageID)||"Lanjutkan?":((k=S.propCustomMessage)==null?void 0:k.messageEN)||"Continue?",t.confirmDialog.action=S,t.confirmDialog.visible=!0):x(S)},h=()=>{t.confirmDialog.visible=!1,t.confirmDialog.action&&x(t.confirmDialog.action)},x=async S=>{var k,g;const V=S.propsActionGlobal||S.props||{},E=i.applyFieldMapping(i.getCleanPayload(),V.fieldMapping||S.fieldMapping||{});o("action",S,E);const A=V.endpointPropAction||S.endpointPropAction||V.endpoint||S.endpoint;if((V.type==="SUBMIT"||V.type==="ACTION")&&(A!=null&&A.apiUrl)){const b=Pe.loading(s.value==="id"?"Memproses...":"Processing..."),M=zs(A.apiUrl,u.value);try{const w=await r(M,A.apiMethod||"POST",E),_=(w==null?void 0:w.status)===!0||(w==null?void 0:w.success)===!0,B=(w==null?void 0:w.message)||(_?s.value==="id"?"Sukses":"Success":s.value==="id"?"Gagal":"Failed");Pe.update(b,{render:B,type:_?"success":"error",isLoading:!1,autoClose:_?3e3:5e3}),_?((V.fieldMapping||S.fieldMapping)&&i.handleResponseMapping(w,V.fieldMapping||S.fieldMapping),o("success",w)):o("error",w)}catch(w){const _=((g=(k=w.response)==null?void 0:k.data)==null?void 0:g.message)||w.message||(s.value==="id"?"Terjadi kesalahan":"An error occurred");Pe.update(b,{render:`Gagal: ${_}`,type:"error",isLoading:!1,autoClose:5e3}),o("error",w)}}else V.type==="SUBMIT"&&o("submit",E);V.keyRedirect&&V.route&&a&&a.push(V.route)};return{isActionVisible:f,handleGlobalButtonClick:m,confirmAction:h,performAction:x,handleSubmit:async()=>{var S,V;if(l.validateAll()){t.isSubmitting.value=!0;try{const E=i.getCleanPayload(),A=(((S=d.value)==null?void 0:S.actions)||[]).find(g=>{var b;return g.type==="SUBMIT"||g.key==="SUBMIT"||((b=g.propsActionGlobal)==null?void 0:b.type)==="SUBMIT"}),k=(A==null?void 0:A.fieldMapping)||((V=A==null?void 0:A.propsActionGlobal)==null?void 0:V.fieldMapping);o("submit",k?i.applyFieldMapping(E,k):E)}finally{t.isSubmitting.value=!1}}},handleCancel:()=>o("cancel"),handleFieldUpdate:(S,V,E)=>{var k;t.formData[S]=V;const A=(k=c.value.get(S))==null?void 0:k.field;if(A){const g=l.validateField(A,V);g?t.errors[S]=g:delete t.errors[S]}}}}function VS({formData:t,validation:n,locale:o,emit:r,mapping:a}){const s=e.ref(!1),i=e.ref(""),l=e.ref("Plus"),c=e.ref([]),d=e.reactive({}),u=e.reactive({}),f=e.ref(""),m=e.ref(null),h=e.ref(!1),x=e.ref(null),C=e.ref(!1),y=w=>{var _;return!(w!=null&&w.apiUrl)&&!((_=w==null?void 0:w.endpointTable)!=null&&_.apiUrl)},p=w=>{if(!w)return!1;const _=(w.key||"").toLowerCase(),B=(w.permission||"").toUpperCase();return _==="detail"||_.includes("view")||B==="VIEW"},S=w=>Array.isArray(t[w.modelDatatable])?t[w.modelDatatable]:[],V=w=>{var B,D;if((B=w.fields)!=null&&B.length)return w.fields;const _=(w.actionTableGlobal||[]).find(N=>N.permission==="CREATE"||(N.key||"").toLowerCase().includes("add"));return(D=_==null?void 0:_.fieldActionGlobal)!=null&&D.length?_.fieldActionGlobal:(w.headers||[]).filter(N=>N.key&&N.key!=="no").map(N=>({key:N.key,model:N.key,component:"DCodeTextField"}))},E=(w,_)=>{x.value={propsTable:w,row:_},C.value=!0},A=()=>{if(!x.value)return;const{propsTable:w,row:_}=x.value;C.value=!1;const B=t[w.modelDatatable];if(Array.isArray(B)){const D=B.indexOf(_);if(D!==-1)B.splice(D,1);else{const N=JSON.stringify(_,(v,L)=>["no","_index"].includes(v)?void 0:L),O=B.findIndex(v=>JSON.stringify(v,(L,$)=>["no","_index"].includes(L)?void 0:$)===N);O!==-1&&B.splice(O,1)}r("update:model",a.getCleanPayload())}},k=(w,_)=>{d[w]=_;const B=c.value.find(D=>D.model===w);if(B){const D=n.validateField(B,_);D?u[w]=D:delete u[w]}},g=(w,_,B)=>{f.value=w.modelDatatable||"",h.value=p(_),m.value=null,i.value=o.value==="id"?_.labelID||"Tambah Data":_.labelEN||"Add Data",l.value=_.icon||"Plus";const D=V(w);c.value=D,Object.keys(d).forEach(N=>delete d[N]),Object.keys(u).forEach(N=>delete u[N]),D.forEach(N=>d[N.model]=B?B[N.model]??null:null),s.value=!0};return{tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,tableRowFormData:d,tableRowErrors:u,activeTableKey:f,editingRowIndex:m,tableDialogViewOnly:h,confirmDeletePending:x,confirmDeleteOpen:C,isTemporaryTable:y,isActionViewOnly:p,tableRows:S,resolveTableFields:V,confirmTableDelete:E,executeTableDelete:A,handleTableRowUpdate:k,openTableRowDialog:g,handleDataTableAction:(w,_)=>{const{action:B,row:D}=_;if(/delete|trash/i.test(B)){const $=t[w.modelDatatable];if(Array.isArray($)){const U=$.indexOf(D);if(U!==-1)$.splice(U,1);else{const P=JSON.stringify(D,(X,q)=>["no","_index"].includes(X)?void 0:q),F=$.findIndex(X=>JSON.stringify(X,(q,W)=>["no","_index"].includes(q)?void 0:W)===P);F!==-1&&$.splice(F,1)}}return}if(/detail|view/i.test(B)){g(w,{key:"detail",permission:"VIEW"},D);return}const N=w.modelDatatable||"";f.value=N,h.value=!1,i.value=o.value==="id"?"Ubah Data":"Edit Data",l.value="SquarePen";const O=t[N];let v=Array.isArray(O)?O.indexOf(D):-1;if(v===-1&&Array.isArray(O)){const $=JSON.stringify(D,(U,P)=>["no","_index"].includes(U)?void 0:P);v=O.findIndex(U=>JSON.stringify(U,(P,F)=>["no","_index"].includes(P)?void 0:F)===$)}m.value=v!==-1?v:null;const L=V(w);c.value=L,Object.keys(d).forEach($=>delete d[$]),L.forEach($=>d[$.model]=D[$.model]??null),s.value=!0},saveTableRow:()=>{let w=!0;if(c.value.forEach(B=>{const D=n.validateField(B,d[B.model]);D&&(u[B.model]=D,w=!1)}),!w)return;const _=f.value;_&&(t[_]=t[_]||[],m.value!==null?t[_].splice(m.value,1,{...d}):t[_].push({...d}),s.value=!1,r("update:model",a.getCleanPayload()))}}}function DS(t){const{state:n,props:o,emit:r,logic:a,mapping:s,activeSchema:i,fieldMap:l,prefetchFieldItems:c}=t;let d="";const u=new Map,f=new Map,m=(h,x)=>{var A;const C=(A=i.value)==null?void 0:A.sections;if(!C)return;a.applyCalculations();const y=a.getNormalizedData(h),p=(k,g,b,M)=>{const w=k.model,_=a.isFieldVisible(k,b)&&g,B=u.get(w),D=n.formData[w];return u.set(w,_),M&&B===!0&&_===!1&&D!=null&&(console.log(`[DynamicForm][DEBUG][RESET-VISIBLE] ${w} became hidden. Clearing value:`,D),n.formData[w]=Array.isArray(D)?[]:null),_},S=(k,g,b,M)=>{var L,$,U,P,F,X;const w=k.model,_=k.logic,B=Array.isArray(($=(L=k.props)==null?void 0:L.endpoint)==null?void 0:$.keyParam)||Array.isArray((P=(U=k.props)==null?void 0:U.endpointReference)==null?void 0:P.keyParam);if(!_&&!B)return;const D={};let N=!1;["lengthRule","optionsFilterRule","visibleRule","disabledRule"].forEach(q=>{const W=_==null?void 0:_[q];if(!W)return;const Z=a.resolveActiveRule(W,b,`${q}-${w}`),ne=JSON.stringify(Z);D[q]=ne;const ue=f.get(w);(ue==null?void 0:ue[q])!==void 0&&ue[q]!==ne&&(N=!0,console.log(`[DynamicForm][DEBUG][CONTEXT-CHANGE] ${w} rule ${q} changed while tracking.`))});const v=((F=k.props)==null?void 0:F.endpoint)||((X=k.props)==null?void 0:X.endpointReference);Array.isArray(v==null?void 0:v.keyParam)&&v.keyParam.forEach(q=>{const W=b[q],Z=JSON.stringify(W);D[`kp-${q}`]=Z;const ne=f.get(w);(ne==null?void 0:ne[`kp-${q}`])!==void 0&&ne[`kp-${q}`]!==Z&&(N=!0,console.log(`[DynamicForm][DEBUG][CASCADE] ${w} dependency ${q} changed while tracking.`),M&&g&&c(k,!0))}),M&&N&&n.formData[w]!=null&&(console.log(`[DynamicForm][DEBUG][RESET-LOGIC] Context changed for ${w}. Clearing value.`),n.formData[w]=Array.isArray(n.formData[w])?[]:null),f.set(w,D)},V=(k,g,b)=>{var w;if(k.type!=="WIZARD")return;(((w=k.propsWizard)==null?void 0:w.propsSteps)||[]).forEach(_=>{const D=a.isSectionVisible(_,b)&&g;Array.isArray(_.sectionsWizard)?E(_.sectionsWizard,D):_.sectionsWizard&&E([_.sectionsWizard],D)})},E=(k,g=!0)=>{var b;for(const M of k){const _=a.isSectionVisible(M,h)&&g,B=((b=M.propsForm)==null?void 0:b.fields)||M.fields||[];for(const D of B){if(!D.model)continue;const N=p(D,_,h,x);S(D,N,y,x)}V(M,_,h)}};E(C,!0)};return e.watch(()=>i.value,h=>{var C,y,p,S,V;if(!(h!=null&&h.sections))return;const x=E=>{if(!E)return;const A=["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule"];for(const k of A){const g=E[k];if(Array.isArray(g))for(const b of g)b.condition&&Wr(b.condition);else g&&Wr(g)}};for(const E of h.sections){if(x(E.logic||((C=E.propsForm)==null?void 0:C.logic)),E.type==="WIZARD")for(const k of((y=E.propsWizard)==null?void 0:y.propsSteps)||[])x(k.logic);const A=((p=E.propsForm)==null?void 0:p.fields)||E.fields||[];for(const k of A)x(k.logic),(S=k.logic)!=null&&S.optionsFilterRule&&c(k);if(E.type==="TABLE"&&((V=E.propsTable)!=null&&V.modelDatatable)&&(n.formData[E.propsTable.modelDatatable]=n.formData[E.propsTable.modelDatatable]||[]),E.type==="WIZARD"){const k=Ur(E);n.wizardState[k]===void 0&&(n.wizardState[k]=0)}}m(n.formData,!1)},{immediate:!0}),e.watch(n.formData,h=>{m(h,!0);const x=s.getCleanPayload()||{},C=JSON.stringify(x);C!==d&&(console.log("[DynamicForm][DEBUG][EMIT] Sending updated model to parent:",x),d=C,r("update:model",x))},{deep:!0}),e.watch(()=>o.model,h=>{h&&Object.keys(h).length>0&&JSON.stringify(h)!==d&&Object.entries(h).forEach(([C,y])=>{if(u.get(C)===!1)return;if(y==null&&u.get(C)===!0){const V=n.formData[C];if(V!=null)return}const p=l.value.get(C),S=(p==null?void 0:p.path)||C;Nd(n.formData,S,y)})},{immediate:!0,deep:!0}),{lastEmittedPayload:()=>d}}ht.add_operation("length",t=>t==null?0:typeof t=="string"||Array.isArray(t)?t.length:typeof t=="number"?String(t).length:typeof t=="object"?Object.keys(t).length:0),ht.add_operation("==",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null?n==null:n==null?t==null:o(t)&&o(n)?String(t.id)===String(n.id)||String(t.code)===String(n.code):o(t)?String(t.code)===String(n)||String(t.id)===String(n):o(n)?String(n.code)===String(t)||String(n.id)===String(t):typeof t=="boolean"&&typeof n=="string"?String(t)===n:typeof n=="boolean"&&typeof t=="string"?String(n)===t:String(t)===String(n)}),ht.add_operation("!=",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null&&n==null?!1:t==null||n===null||n===void 0?!0:o(t)&&o(n)?!(String(t.id)===String(n.id)||String(t.code)===String(n.code)):o(t)?!(String(t.code)===String(n)||String(t.id)===String(n)):o(n)?!(String(n.code)===String(t)||String(n.id)===String(t)):String(t)!==String(n)});function NS(t,n){const{t:o,locale:r}=bt.useI18n(),a=e.computed(()=>r.value),{apiUrl:s}=Ke(),i=un.useRouter(),l=CS(),c=e.computed(()=>t.schema||l.internalSchema.value),d=e.computed(()=>{var E;if((E=t.selectedTokenCore)!=null&&E.address)return t.selectedTokenCore.address;if(t.baseUrl)return t.baseUrl}),u=(E,A,k)=>{A.model&&E.set(A.model,{field:A,path:A.model})},f=(E,A)=>{A.key||A.id;const k=Array.isArray(A.sectionsWizard)?A.sectionsWizard:[A.sectionsWizard].filter(Boolean);for(const g of k)if(g.fields)for(const b of g.fields)u(E,b)},m=e.computed(()=>{var k,g,b;const E=new Map,A=(k=c.value)==null?void 0:k.sections;if(!A)return E;for(const M of A){const w=M.propsForm||M.propsTable||M.props||{};Ur(M);const _=w.fields||M.fields||[];for(const B of _)u(E,B);if(((g=M.type)==null?void 0:g.toUpperCase())==="WIZARD"&&((b=M.propsWizard)!=null&&b.propsSteps))for(const B of M.propsWizard.propsSteps)f(E,B)}return E}),h=ES({formData:l.formData,errors:l.errors,fieldMap:m,rawItemsCache:l.rawItemsCache,activeSchema:c,locale:a});e.watch(()=>c.value,E=>{if(E!=null&&E.payload){console.log("[DynamicForm][DEBUG] Initializing flat state from schema payload...");const A=Md(E.payload);Object.keys(A).forEach(k=>{(l.formData[k]===void 0||l.formData[k]===null)&&(l.formData[k]=A[k])})}},{immediate:!0});const x=_S({formData:l.formData,locale:a,errors:l.errors,fieldMap:m,activeSchema:c,isSectionVisible:h.isSectionVisible,isFieldVisible:h.isFieldVisible,isFieldRequired:h.isFieldRequired,resolveFieldLength:h.resolveFieldLength}),C=SS({formData:l.formData,activeSchema:c,isSectionVisible:h.isSectionVisible,isFieldVisible:h.isFieldVisible,getWizardTabs:h.getWizardTabs}),y=AS({state:l,props:t,emit:n,apiUrl:s,router:i,locale:a,mapping:C,validation:x,fieldMap:m,activeSchema:c,resolvedBaseUrl:d}),p=VS({formData:l.formData,validation:x,locale:a,emit:n,mapping:C}),S=async(E,A=!1)=>{const k=E.props||{},g=k.endpointReference||k.endpoint;if(g!=null&&g.apiUrl&&!(!A&&l.rawItemsCache[E.key]))try{const b=zs(g.apiUrl,d.value),M={page:1,perPage:100};if(Array.isArray(g.keyParam)){let D=!1;if(g.keyParam.forEach(N=>{const O=h.getNormalizedData(l.formData)[N];O==null||O===""?D=!0:M[N]=O&&typeof O=="object"&&O._isLogicValue?O.id:O}),D){l.rawItemsCache[E.key]=[];return}}const w=await s(b,g.apiMethod||"GET",M),_=(w==null?void 0:w.data)||w;let B=[];Array.isArray(_)?B=_:_&&(B=[_]),l.rawItemsCache[E.key]=B}catch(b){console.error(`[prefetchFieldItems] Error fetching items for ${E.key}:`,b),l.rawItemsCache[E.key]=[]}};DS({state:l,props:t,emit:n,logic:h,mapping:C,fieldMap:m,activeSchema:c,prefetchFieldItems:S});const V=e.computed(()=>{const E={},A=c.value;return A!=null&&A.sections&&A.sections.forEach(k=>{var b,M,w;(((b=k.propsForm)==null?void 0:b.fields)||((M=k.propsTable)==null?void 0:M.fields)||((w=k.props)==null?void 0:w.fields)||[]).forEach(_=>{var B,D,N,O,v,L,$,U,P,F,X;if(_.component==="DCodeRadioCustom"){const q=((B=_.props)==null?void 0:B.name)||"default-group";E[q]||(E[q]=[]);let W=((N=(D=_.props)==null?void 0:D.endpoint)==null?void 0:N.apiUrl)||((O=_.props)==null?void 0:O.apiUrl);W=zs(W,d.value),E[q].push({key:_.key,value:(v=_.props)==null?void 0:v.value,label:((L=_.props)==null?void 0:L.labelID)||(($=_.props)==null?void 0:$.labelEN)||_.key,model:_.model||_.key,apiUrl:W,apiMethod:((P=(U=_.props)==null?void 0:U.endpoint)==null?void 0:P.apiMethod)||((F=_.props)==null?void 0:F.apiMethod),icon:(X=_.props)==null?void 0:X.icon,name:q})}})}),E});return{t:o,locale:a,i18nLocale:r,apiUrl:s,router:i,isSubmitting:l.isSubmitting,internalSchema:l.internalSchema,activeSchema:c,resolvedBaseUrl:d,radioGroups:V,confirmDialog:l.confirmDialog,fieldMap:m,rawItemsCache:l.rawItemsCache,formData:l.formData,errors:l.errors,fieldErrors:l.fieldErrors,inlineState:l.inlineState,wizardState:l.wizardState,getSectionKey:Ur,sortedFields:BS,prefetchFieldItems:S,...h,...C,...y,...p}}const MS={key:0},PS=["value","name"],TS={key:1,class:"flex flex-col gap-1"},vS={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},OS=["src"],FS={key:1,class:"text-sm text-neutral-400 italic"},zS={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},IS={key:3,class:"text-xs text-neutral-400 italic"},Mo=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=bt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,y=>{s.value=y});const i={DCodeTextField:On,DCodeAutoComplete:Lo,DCodeDatePicker:_r,DCodeTextarea:Hn,DCodeTextArea:Hn,DCodeCheckbox:Yt,DCodeSwitch:Nr,DCodeOtpInput:Vr,DCodeImageField:Ar,DCodeSlider:Dr,DCodeRadio:Es,DCodeRadioCustom:_s,DCodeDynamicUploadList:ms,DCodeMultiSelect:Bs,DCodeCurrencyField:fs,DCodePermissionMenu:As,DCodeTreePermissions:Vs,DCodeCardCheckboxList:us,DCodeBeforeAfter:Ca,DCodeListLabels:Ba},l=e.computed(()=>{const y=r.field.component;return i[y]||null}),c=e.computed(()=>{var p;const y=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return y.includes("image")||y.includes("upload")}),d=e.computed(()=>{var p;const y=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return y.includes("switch")||y.includes("checkbox")}),u=e.computed(()=>{var V,E;const y=r.field.props||r.field.propsFieldGlobal||{},p=((V=r.dynamicLabels)==null?void 0:V.labelID)||y.labelID,S=((E=r.dynamicLabels)==null?void 0:E.labelEN)||y.labelEN;return o.value==="id"?p||S||r.field.model:S||p||r.field.model}),f=e.computed(()=>{const y=r.modelValue;return y==null||y===""?null:Array.isArray(y)?y.map(p=>typeof p=="object"&&p!==null?p.label||p.name||p.code||p.value||JSON.stringify(p):String(p)).join(", "):typeof y=="object"?y.label||y.name||y.code||y.value||y.id||JSON.stringify(y):String(y)}),m=(y,p)=>{const S={label:"",placeholder:""},V=(p==null?void 0:p.labelID)||y.labelID,E=(p==null?void 0:p.labelEN)||y.labelEN;(V||E)&&(S.label=o.value==="id"?V:E);const A=(p==null?void 0:p.placeholderID)||y.placeholderID,k=(p==null?void 0:p.placeholderEN)||y.placeholderEN;return(A||k)&&(S.placeholder=o.value==="id"?A:k),S},h=(y,p)=>{const S=y.endpoint||{};if(!S.apiUrl)return{};const V={};let E=!0;if(Array.isArray(S.keyParam)&&S.keyParam.length>0&&S.keyParam.forEach(k=>{const g=p?p[k]:null;g!=null&&g!==""?V[k]=g:E=!1}),!E)return{};let A=S.apiUrl;if(r.baseUrl&&typeof A=="string"&&!A.startsWith("http")){const k=r.baseUrl.replace(/\/$/,""),g=A.startsWith("/")?A:`/${A}`;A=`${k}${g}`}return{endpoint:{apiUrl:A,apiMethod:S.apiMethod||"GET"},...Object.keys(V).length?{apiParams:V}:{}}},x=e.computed(()=>{var E,A,k;const y=r.field.props||r.field.propsFieldGlobal||{},p={},S=m(y,r.dynamicLabels);if(S.label&&(p.label=S.label),S.placeholder&&(p.placeholder=S.placeholder),p.required=r.required!==void 0?r.required:y.required??!1,p.readonly=r.readonly!==void 0?r.readonly:y.readonly??!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"].forEach(g=>{y[g]!==void 0&&y[g]!==null&&(p[g]=y[g])}),p.minLength=((E=r.dynamicLength)==null?void 0:E.minLength)??y.minLength,p.maxLength=((A=r.dynamicLength)==null?void 0:A.maxLength)??y.maxLength,y.valueType&&(p.type=y.valueType),r.error&&(p.error=r.error),Object.assign(p,h(y,r.formData)),(k=y.endpointReference)!=null&&k.apiUrl){let g=y.endpointReference.apiUrl;if(r.baseUrl&&typeof g=="string"&&!g.startsWith("http")){const b=r.baseUrl.replace(/\/$/,""),M=g.startsWith("/")?g:`/${g}`;g=`${b}${M}`}p.endpointReference={...y.endpointReference,apiUrl:g}}return r.options&&r.options.length>0&&(p.items=r.options,p.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete p.endpoint,delete p.apiParams,delete p.apiUrl)),r.baseUrl&&(p.baseUrl=r.baseUrl),p}),C=y=>{s.value=y,a("update:modelValue",y)};return(y,p)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",MS,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,PS)])):t.viewOnly?(e.openBlock(),e.createElementBlock("div",TS,[e.createElementVNode("span",vS,e.toDisplayString(u.value),1),c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:f.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,OS)):(e.openBlock(),e.createElementBlock("span",FS,"-"))],64)):d.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",f.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},e.toDisplayString(f.value?"✓ Ya":"✗ Tidak"),3)):(e.openBlock(),e.createElementBlock("span",zS,e.toDisplayString(f.value||"-"),1))])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:2},x.value,{modelValue:s.value,"onUpdate:modelValue":[p[0]||(p[0]=S=>s.value=S),C]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",IS," Unknown field: "+e.toDisplayString(t.field.component),1))}}),RS={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},LS={key:0,class:"px-4 py-3"},$S={class:"text-sm font-semibold text-white"},jS={class:"px-4 py-3 flex items-center gap-2"},US=e.defineComponent({__name:"DynamicFormSection",props:{section:{},sIdx:{}},setup(t){const n=e.computed(()=>{var M,w;switch((w=(M=t.section)==null?void 0:M.propsForm)==null?void 0:w.layoutColumns){case"FULL":return"grid-cols-1";case"HALF":return"grid-cols-1 md:grid-cols-2";case"THIRD":return"grid-cols-1 md:grid-cols-3";case"QUARTED":return"grid-cols-1 md:grid-cols-4";case"TWO-THIRD":return"grid-cols-2 md:grid-cols-3";case"THREE-QUARTER":return"grid-cols-3 md:grid-cols-4";default:return"grid-cols-1"}}),o=e.inject("dynamicFormContext",{}),{resolveSectionLabels:r,isActionVisible:a,handleGlobalButtonClick:s,locale:i,t:l,handleCancel:c,sortedFields:d,isFieldVisible:u,getDeepValue:f,formData:m,getSectionKey:h,isFieldRequired:x,isFieldDisabled:C,isFieldReadonly:y,getFilteredItems:p,errors:S,resolveFieldLabels:V,resolveFieldLength:E,resolvedBaseUrl:A,handleFieldUpdate:k}=o,g=b=>typeof d!="function"?[]:d(b||[]);return(b,M)=>{var w,_,B,D,N,O,v,L,$,U;return e.openBlock(),e.createElementBlock("div",RS,[((_=(w=t.section)==null?void 0:w.type)==null?void 0:_.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between mb-2",(B=e.unref(r)(t.section))!=null&&B.title?"bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30":""])},[(D=e.unref(r)(t.section))!=null&&D.title?(e.openBlock(),e.createElementBlock("div",LS,[e.createElementVNode("h3",$S,e.toDisplayString(e.unref(r)(t.section).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",jS,[(v=(O=(N=t.section)==null?void 0:N.propsForm)==null?void 0:O.actionSection)!=null&&v.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.section.propsForm.actionSection,(P,F)=>{var X,q,W,Z,ne,ue,ke,fe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:F},[(X=e.unref(a))!=null&&X(P)?(e.openBlock(),e.createBlock(Le,{key:0,icon:P.icon||((q=P.propsActionGlobal)==null?void 0:q.icon),text:e.unref(i)==="id"?P.labelID||((W=P.propsActionGlobal)==null?void 0:W.labelID):P.labelEN||((Z=P.propsActionGlobal)==null?void 0:Z.labelEN),"bg-color":((ue=P.bgColor||((ne=P.propsActionGlobal)==null?void 0:ne.bgColor))==null?void 0:ue.toLowerCase())||"primary",variant:((fe=P.variant||((ke=P.propsActionGlobal)==null?void 0:ke.variant))==null?void 0:fe.toLowerCase())||"outline",size:"sm",onClick:K=>{var z;return(z=e.unref(s))==null?void 0:z(P)}},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),t.sIdx===0?(e.openBlock(),e.createBlock(Le,{key:1,size:"sm",icon:"List",text:(L=e.unref(l))==null?void 0:L("common.back"),variant:"outline",onClick:M[0]||(M[0]=P=>{var F;return(F=e.unref(c))==null?void 0:F()})},null,8,["text"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",n.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g((U=($=t.section)==null?void 0:$.propsForm)==null?void 0:U.fields),P=>{var F,X,q,W,Z,ne,ue,ke,fe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:P==null?void 0:P.key},[(F=e.unref(u))!=null&&F(P)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.value)},[e.createVNode(Mo,{field:P,"model-value":(X=e.unref(m))==null?void 0:X[P.model],"form-data":e.unref(m),required:(q=e.unref(x))==null?void 0:q(P),disabled:(W=e.unref(C))==null?void 0:W(P),readonly:(Z=e.unref(y))==null?void 0:Z(P),options:(ne=e.unref(p))==null?void 0:ne(P),error:(ue=e.unref(S))==null?void 0:ue[P.model],"dynamic-labels":(ke=e.unref(V))==null?void 0:ke(P),"dynamic-length":(fe=e.unref(E))==null?void 0:fe(P),"base-url":e.unref(A),"onUpdate:modelValue":K=>e.unref(k)(P.model,K)},null,8,["field","model-value","form-data","required","disabled","readonly","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64)}),128))],2)])}}}),WS={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},HS=e.defineComponent({__name:"DynamicTableSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{tableRows:o,isTemporaryTable:r,handleDataTableAction:a,locale:s,openTableRowDialog:i,resolveTableFields:l,confirmTableDelete:c,resolvedBaseUrl:d}=n;return(u,f)=>(e.openBlock(),e.createElementBlock("div",WS,[e.createVNode(Xn,{"table-config":t.section.propsTable,data:e.unref(o)(t.section.propsTable),nested:!0,"show-pagination":t.section.propsTable.pagination??!0,"has-actions":e.unref(r)(t.section.propsTable),"base-url":e.unref(d),"dummy-mode":t.dummyMode,onAction:f[0]||(f[0]=m=>e.unref(a)(t.section.propsTable,m))},null,8,["table-config","data","show-pagination","has-actions","base-url","dummy-mode"])]))}}),qS={class:"w-full"},GS={class:"space-y-6 mt-4"},KS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},XS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},YS=e.defineComponent({__name:"DynamicWizardSection",props:{section:{},dummyMode:{type:Boolean}},setup(t){const n=e.inject("dynamicFormContext"),{getWizardTabs:o,wizardState:r,getSectionKey:a,isSubmitting:s,isActionVisible:i,locale:l,handleGlobalButtonClick:c,isSectionVisible:d,sortedFields:u,isFieldVisible:f,getDeepValue:m,formData:h,isFieldRequired:x,isFieldDisabled:C,getFilteredItems:y,errors:p,resolveFieldLabels:S,resolveFieldLength:V,resolvedBaseUrl:E,handleFieldUpdate:A,tableRows:k,handleDataTableAction:g,resolveSectionGridClass:b,resolveFieldColumnClass:M}=n;return(w,_)=>{var B;return e.openBlock(),e.createElementBlock("div",qS,[e.createVNode(Ss,{tabs:e.unref(o)(t.section),modelValue:e.unref(r)[e.unref(a)(t.section)],"onUpdate:modelValue":_[0]||(_[0]=D=>e.unref(r)[e.unref(a)(t.section)]=D),"is-vertical":t.section.propsWizard.isVertical,"is-wizard":t.section.propsWizard.isWizard,"type-wizard":((B=t.section.propsWizard.typeWizard)==null?void 0:B.toLowerCase())||"icon",loading:e.unref(s)},e.createSlots({_:2},[e.renderList(e.unref(o)(t.section),D=>({name:`tab-${D.key}`,fn:e.withCtx(()=>[e.createElementVNode("div",GS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.sections,(N,O)=>{var v,L,$;return e.openBlock(),e.createElementBlock(e.Fragment,{key:O},[e.unref(d)(N)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((v=N.type)==null?void 0:v.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",e.unref(b)(N.layoutColumns)])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u)(N.fields),U=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:U.key},[e.unref(f)(U)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(M)(U,N.layoutColumns))},[e.createVNode(Mo,{field:U,"model-value":e.unref(h)[U.model],"form-data":e.unref(h),required:e.unref(x)(U),disabled:e.unref(C)(U),options:e.unref(y)(U),error:e.unref(p)[U.model],"dynamic-labels":e.unref(S)(U),"dynamic-length":e.unref(V)(U),"base-url":e.unref(E),"onUpdate:modelValue":P=>e.unref(A)(U.model,P)},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((L=N.type)==null?void 0:L.toUpperCase())==="TABLE"||N.isDataTable?(e.openBlock(),e.createElementBlock("div",KS,[e.createVNode(Xn,{"dummy-mode":t.dummyMode,"table-config":N.propsDataTableWizard||N.propsTable,data:e.unref(k)(N.propsDataTableWizard||N.propsTable),nested:!0,"show-pagination":(($=N.propsDataTableWizard||N.propsTable)==null?void 0:$.pagination)??!0,onAction:U=>e.unref(g)(N.propsDataTableWizard||N.propsTable,U)},null,8,["dummy-mode","table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",XS," Unknown section type: "+e.toDisplayString(N.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])])}))]),1032,["tabs","modelValue","is-vertical","is-wizard","type-wizard","loading"])])}}}),JS={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},QS={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},ZS={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},eA=e.defineComponent({__name:"DynamicFormDialogs",setup(t){const n=e.inject("dynamicFormContext"),{confirmDialog:o,t:r,confirmAction:a,tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,isFieldVisible:d,tableRowFormData:u,tableDialogViewOnly:f,isFieldRequired:m,isFieldDisabled:h,getFilteredItems:x,tableRowErrors:C,resolveFieldLabels:y,resolveFieldLength:p,resolvedBaseUrl:S,handleTableRowUpdate:V,locale:E,saveTableRow:A,confirmDeleteOpen:k,executeTableDelete:g}=n;return(b,M)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(Jt,{modelValue:e.unref(o).visible,"onUpdate:modelValue":M[1]||(M[1]=w=>e.unref(o).visible=w),title:e.unref(o).title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(r)("common.cancel"),onClick:M[0]||(M[0]=w=>e.unref(o).visible=!1)},null,8,["text"]),e.createVNode(Le,{text:e.unref(r)("common.confirm"),onClick:e.unref(a)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",JS,e.toDisplayString(e.unref(o).message),1)]),_:1},8,["modelValue","title"]),e.createVNode(Jt,{modelValue:e.unref(s),"onUpdate:modelValue":M[3]||(M[3]=w=>e.isRef(s)?s.value=w:null),title:e.unref(i),icon:e.unref(l),"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(f)?e.unref(E)==="id"?"Tutup":"Close":e.unref(E)==="id"?"Batal":"Cancel",onClick:M[2]||(M[2]=w=>s.value=!1)},null,8,["text"]),e.unref(f)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Le,{key:0,text:"Save",onClick:e.unref(A)},null,8,["onClick"]))]),default:e.withCtx(()=>[e.unref(c).length?(e.openBlock(),e.createElementBlock("div",QS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),w=>(e.openBlock(),e.createElementBlock("div",{key:w.key,class:e.normalizeClass(w.column==="FULL"?"md:col-span-2":"col-span-1")},[e.unref(d)(w,e.unref(u))?(e.openBlock(),e.createBlock(Mo,{key:0,field:w,"model-value":e.unref(u)[w.model],"form-data":e.unref(u),required:e.unref(f)?!1:e.unref(m)(w,e.unref(u)),disabled:e.unref(f)||e.unref(h)(w,e.unref(u)),"view-only":e.unref(f),options:e.unref(x)(w,e.unref(u)),error:e.unref(f)?void 0:e.unref(C)[w.model],"dynamic-labels":e.unref(y)(w,e.unref(u)),"dynamic-length":e.unref(p)(w,e.unref(u)),"base-url":e.unref(S),"onUpdate:modelValue":_=>e.unref(V)(w.model,_)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"]),e.createVNode(Jt,{modelValue:e.unref(k),"onUpdate:modelValue":M[5]||(M[5]=w=>e.isRef(k)?k.value=w:null),title:e.unref(E)==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:e.withCtx(()=>[e.createVNode(Le,{variant:"outline",text:e.unref(E)==="id"?"Batal":"Cancel",onClick:M[4]||(M[4]=w=>k.value=!1)},null,8,["text"]),e.createVNode(Le,{variant:"default","bg-color":"danger",icon:"Trash2",text:e.unref(E)==="id"?"Hapus":"Delete",onClick:e.unref(g)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",ZS,e.toDisplayString(e.unref(E)==="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"])]))}}),tA={class:"w-full space-y-6"},Is=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0},selectedTokenCore:{default:null},dummyMode:{type:Boolean,default:!1}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){const o=t,a=NS(o,n);e.provide("dynamicFormContext",a);const{activeSchema:s,isSectionVisible:i,inlineState:l,isActionVisible:c,locale:d,isSubmitting:u,isSubmitDisabled:f,handleGlobalButtonClick:m,handleSubmit:h}=a;return(x,C)=>{var y,p,S,V,E,A;return e.openBlock(),e.createElementBlock("div",tA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((y=e.unref(s))==null?void 0:y.sections,(k,g)=>{var b,M,w;return e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[((b=k.type)==null?void 0:b.toUpperCase())==="FORM"&&k.propsForm&&e.unref(i)(k)?(e.openBlock(),e.createBlock(US,{key:0,"dummy-mode":o.dummyMode,section:k,sIdx:Number(g)},null,8,["dummy-mode","section","sIdx"])):((M=k.type)==null?void 0:M.toUpperCase())==="TABLE"&&k.propsTable&&e.unref(i)(k)?(e.openBlock(),e.createBlock(HS,{key:1,"dummy-mode":o.dummyMode,section:k},null,8,["dummy-mode","section"])):((w=k.type)==null?void 0:w.toUpperCase())==="WIZARD"&&k.propsWizard&&e.unref(i)(k)?(e.openBlock(),e.createBlock(YS,{key:2,"dummy-mode":o.dummyMode,section:k},null,8,["dummy-mode","section"])):e.createCommentVNode("",!0)],64)}),128)),(p=e.unref(l))!=null&&p.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((V=(S=e.unref(s))==null?void 0:S.ui)==null?void 0:V.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(A=(E=e.unref(s))==null?void 0:E.actionGlobal)!=null&&A.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(s).actionGlobal,(k,g)=>{var b,M,w;return e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[k.propsActionGlobal&&e.unref(c)(k)?(e.openBlock(),e.createBlock(Le,{key:0,icon:k.propsActionGlobal.icon,text:e.unref(d)==="id"?k.propsActionGlobal.labelID:k.propsActionGlobal.labelEN,"bg-color":((b=k.propsActionGlobal.bgColor)==null?void 0:b.toLowerCase())||"primary",variant:((M=k.propsActionGlobal.variant)==null?void 0:M.toLowerCase())||"default",loading:e.unref(u),disabled:e.unref(f)&&(k.permission==="CREATE"||k.permission==="UPDATE"||((w=k.propsActionGlobal)==null?void 0:w.key)==="submit"),onClick:_=>e.unref(m)(k)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0)],2)),e.createVNode(eA)])}}}),nA={"aria-label":"Breadcrumb"},oA={class:"flex flex-wrap items-center text-sm md:text-base"},rA={class:"truncate max-w-[100px] sm:max-w-[150px] md:max-w-none"},Pd=e.defineComponent({__name:"Breadcrumb",props:{items:{},showHomeIcon:{type:Boolean,default:!0},iconSize:{default:18},separatorSize:{default:16},separatorType:{default:"chevron"},strokeWidth:{default:2}},setup(t){const n=t,o=te.Home,r=n.separatorType==="slash"?te.Slash:te.ChevronRight;return(a,s)=>(e.openBlock(),e.createElementBlock("nav",nA,[e.createElementVNode("ol",oA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(i,l)=>(e.openBlock(),e.createElementBlock("li",{key:l,class:"flex items-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.to?"router-link":"span"),{to:i.to,class:e.normalizeClass(["inline-flex items-center gap-1.5 transition-all duration-200 rounded-lg font-medium",i.to?"text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/20 cursor-pointer":"dark:text-gray-100 bg-primary-50 dark:bg-primary-900/30 text-primary-700"])},{default:e.withCtx(()=>[i.icon||l===0&&t.showHomeIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.icon||e.unref(o)),{key:0,size:t.iconSize,class:e.normalizeClass(["flex-shrink-0",i.to?"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-400":"text-primary-600 dark:text-primary-400",i.iconClass||""]),"stroke-width":t.strokeWidth},null,8,["size","class","stroke-width"])):e.createCommentVNode("",!0),e.createElementVNode("span",rA,e.toDisplayString(i.label),1)]),_:2},1032,["to","class"])),l<t.items.length-1?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{key:0,size:t.separatorSize,class:"mx-1.5 text-gray-300 dark:text-gray-700 flex-shrink-0"},null,8,["size"])):e.createCommentVNode("",!0)]))),128))])]))}});function Td(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const aA={class:"w-full space-y-6 animate-pulse"},sA={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},iA=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",aA,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",sA,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),lA={class:"w-full"},cA={class:"relative mx-auto min-h-[37.5rem]"},dA={key:"content",class:"w-full"},uA={class:"mb-6"},fA={class:"text-neutral-500 dark:text-neutral-400"},mA={key:"skeleton",class:"w-full"},hA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Rs=at(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{},selectedTokenCore:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var B,D,N,O,v,L,$,U;const o=t,r=n,a=(D=(B=e.getCurrentInstance())==null?void 0:B.appContext)==null?void 0:D.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const P=un.useRoute();if(P&&Object.keys(P).length>0)s=P;else{const F=e.getCurrentInstance();(v=(O=(N=F==null?void 0:F.appContext)==null?void 0:N.config)==null?void 0:O.globalProperties)!=null&&v.$route&&(s=F.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:P=>{typeof window<"u"&&(typeof P=="string"?window.location.href=P:P&&P.path&&(window.location.href=P.path))},__isFallback:!0};try{const P=un.useRouter();if(P)i=P;else{const F=e.getCurrentInstance();(U=($=(L=F==null?void 0:F.appContext)==null?void 0:L.config)==null?void 0:$.globalProperties)!=null&&U.$router&&(i=F.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=Ke();let d;try{d=bt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=Td(),f=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const m=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const P=s.path.match(/\/edit\/([^\/]+)$/);return P?P[1]:null}),h=e.ref({}),x=e.ref(null),C=e.ref(!0),y=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",S="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",V=e.ref(o.layoutCode),E=e.computed(()=>{var X;if(!x.value)return"";const P=((X=d==null?void 0:d.value)==null?void 0:X.toLowerCase())||"en";return(P==="en"||P.startsWith("en-")?x.value.titleEN:x.value.titleID)||x.value.title||o.layoutCode});e.watch(E,P=>{P&&u(P)},{immediate:!0});const A=(P,F="")=>{const X={};return!P||typeof P!="object"||Object.keys(P).forEach(q=>{const W=P[q],Z=F?`${F}.${q}`:q;W&&typeof W=="object"&&!Array.isArray(W)&&!(W instanceof Date)&&Object.assign(X,A(W,Z)),X[Z]=W}),X},k=P=>{var W;if(!P||typeof P!="string"||P.startsWith("http"))return P;const F=(W=o.selectedTokenCore)==null?void 0:W.address;if(!F)return P;const X=F.replace(/\/$/,""),q=P.startsWith("/")?P:`/${P}`;return`${X}${q}`},g=async()=>{var P,F,X,q,W,Z;C.value=!0;try{let ne=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(ne=s.query.code||o.layoutCode);const ue="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",ke=ue?{Authorization:`Bearer ${ue}`}:{},fe=k(`${p}${ne}`);let K=await l(fe,"GET",null,ke);if(!K.status||!K.data||Array.isArray(K.data)&&K.data.length===0)try{const z=k(`${S}${ne}`),G=await l(z,"GET",null,ke);if(G.status){const ee=Array.isArray(G.data)?G.data[0]:G.data;ee&&ee.code&&(ne=ee.code,V.value=ne,K=await l(k(`${p}${ne}`),"GET",null,ke))}}catch(z){console.warn("Failed to resolve layout code via datatable",z)}if(K.status){x.value=Array.isArray(K.data)?K.data[0]:K.data;const z={};if((P=x.value)!=null&&P.sections&&x.value.sections.forEach(G=>{((G.propsForm||G.props||{}).fields||G.fields||[]).forEach(De=>{var ze;const Ae=De.model||((ze=De.props)==null?void 0:ze.model)||De.key;Ae&&(z[Ae]=null)})}),h.value=z,C.value=!1,f.value&&m.value){y.value=!0;try{const G=(q=(X=(F=x.value.sections)==null?void 0:F[0])==null?void 0:X.propsForm)==null?void 0:q.endpointForm,ee=x.value.endpointForm,he=G||ee;if(he!=null&&he.apiUrl){const De=he.apiUrl,Ae=he.apiMethod||"GET",ze=he.keyParam||[],Ie={};ze.length>0?ze.forEach(Me=>{Ie[Me]=m.value}):Ie.id=m.value;const Ue=await c(k(De),Ae,Ie);if(console.log(`[AutoLayoutForm] API Result for ${De}:`,Ue),Ue.status){let Me=Array.isArray(Ue.data)?Ue.data[0]:Ue.data;Ue.payload&&(Me={...Me,...Ue.payload}),console.log("[AutoLayoutForm] Successfully fetched record:",Me);const Ze=A(Me);h.value={...h.value,...Me,...Ze},console.log("[AutoLayoutForm] Updated initialData:",h.value)}else console.warn("[AutoLayoutForm] Record API returned status: false",Ue)}else if((W=x.value.endpointGlobal)!=null&&W.apiUrl){const De=x.value.endpointGlobal.apiUrl,Ae=x.value.endpointGlobal.apiMethod||"GET",ze={id:m.value},Ie=await c(k(De),Ae,ze);if(Ie.status){const Ue=Array.isArray(Ie.data)?Ie.data[0]:Ie.data,Me=A(Ue);h.value={...h.value,...Ue,...Me}}}else{const De=((Z=x.value.endpoint)==null?void 0:Z.detailUrl)||`/api/${V.value}/detail/${m.value}`,Ae=await l(k(De),"GET");if(Ae.status){let ze=Array.isArray(Ae.data)?Ae.data[0]:Ae.data;if(Ae.payload){const Me={...Ae.payload};if(Object.keys(Me).forEach(Ze=>{ze[Ze]!==void 0&&ze[Ze]!==null&&(Me[Ze]=ze[Ze])}),!("id"in Me)&&ze.id){const Ze=Object.keys(Me).find(ct=>ct.startsWith("id")&&ct.length>2&&!Me[ct]);Ze&&(Me[Ze]=ze.id)}ze=Me}const Ie={...ze};Object.keys(h.value).forEach(Me=>{if(Ie[Me]===void 0||Ie[Me]===null){if(Me.toLowerCase().startsWith("id")&&Me.length>2){const ct=Me.substring(2).toLowerCase(),At=Array.isArray(Ae.data)?Ae.data[0]:Ae.data,H=Object.keys(At).find(re=>re.toLowerCase()===ct);H&&At[H]&&typeof At[H]=="object"&&"id"in At[H]&&(Ie[Me]=At[H].id)}if(Me==="idSupervisor"){const ct=Array.isArray(Ae.data)?Ae.data[0]:Ae.data;ct.supervisorId&&(Ie[Me]=ct.supervisorId)}}});const Ue=A(Ie);h.value={...h.value,...Ie,...Ue}}}}catch(G){console.error("Failed to fetch record data:",G)}finally{y.value=!1}}}}catch(ne){console.error("Failed to load form layout:",ne),C.value=!1}},b=P=>{const F=Object.keys(h.value||{}).filter(q=>h.value[q]!==null&&h.value[q]!==void 0),X=Object.keys(P||{}).filter(q=>P[q]!==null&&P[q]!==void 0);if(F.length>3&&X.length<F.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:F.length,incomingCount:X.length,data:P});return}console.log("[AutoLayoutForm] Allowing model update:",P),h.value=P,r("update:model",P)},M=async P=>{var F,X,q;try{const W=(q=(X=(F=x.value.sections)==null?void 0:F[0])==null?void 0:X.propsForm)==null?void 0:q.endpointForm,Z=x.value.endpointGlobal||x.value.endpoint,ne=(W==null?void 0:W.submitUrl)||(Z==null?void 0:Z.submitUrl)||`/api/generic/${o.layoutCode}`,ue=(W==null?void 0:W.submitMethod)||(Z==null?void 0:Z.submitMethod)||(f.value?"PUT":"POST"),ke=Object.values(P).some(K=>K instanceof File||K instanceof Blob);let fe;ke?(fe=new FormData,Object.keys(P).forEach(K=>{const z=P[K];z!=null&&(Array.isArray(z)?z.forEach(G=>fe.append(`${K}[]`,G)):fe.append(K,z))})):(fe={...P},f.value&&m.value&&!fe.id&&(fe.id=m.value)),await l(k(ne),ue,fe),r("submit-success",fe),i.back()}catch(W){console.error("Submit failed:",W)}},w=async(P,F,X)=>{if(P==="cancel"){_();return}const q=F.endpointPropAction||F.propsActionGlobal&&F.propsActionGlobal.endpointPropAction;if(q)try{C.value=!0;const W=X?{...X}:{...h.value};f.value&&F.model&&m.value&&(W[F.model]=m.value);const Z=q.apiUrl,ne=q.apiMethod||"POST";(await c(k(Z),ne,W)).status&&(r("action-success",P,F,W),i.back())}catch(W){console.error("Action failed:",W)}finally{C.value=!1}},_=()=>{r("cancel"),i.back()};return e.onMounted(()=>{g()}),e.watch(()=>o.model,P=>{P&&Object.keys(P).length>0&&(h.value={...h.value,...P})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(P,F)=>(e.openBlock(),e.createElementBlock("div",lA,[e.createElementVNode("div",cA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!C.value&&x.value?(e.openBlock(),e.createElementBlock("div",dA,[e.createElementVNode("div",uA,[e.createElementVNode("p",fA,e.toDisplayString(x.value.description),1)]),e.createVNode(Is,{schema:x.value,model:h.value,"is-edit-mode":f.value,loading:y.value,"selected-token-core":o.selectedTokenCore,"onUpdate:model":F[0]||(F[0]=X=>b(X)),onSubmit:M,onCancel:_,onAction:w,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core"])])):C.value?(e.openBlock(),e.createElementBlock("div",mA,[e.createVNode(iA)])):(e.openBlock(),e.createElementBlock("div",hA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-3c619a9c"]]),pA={class:"h-full flex flex-col"},gA={key:1,class:"flex-1 flex items-center justify-center"},bA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Ls=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var A,k,g,b,M,w;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=Ke();let i={query:{},params:{},path:""};try{const _=un.useRoute();_?i=_:(g=(k=(A=a==null?void 0:a.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)!=null&&g.$route&&(i=a.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:_=>{typeof window<"u"&&(typeof _=="string"?window.location.href=_:_&&_.path&&(window.location.href=_.path))}};try{const _=un.useRouter();_?l=_:(w=(M=(b=a==null?void 0:a.appContext)==null?void 0:b.config)==null?void 0:M.globalProperties)!=null&&w.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),f=e.ref(!0),m=e.ref(null),h="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",x=e.computed(()=>`${h}${o.layoutCode}`),{setPageTitle:C}=Td();let y;try{y=bt.useI18n().locale}catch{y=e.ref("en")}const p=()=>{if(u.value){const B=(y.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";C(B)}};e.watch(y,()=>{p()});const S=async()=>{f.value=!0;try{const _="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",B=_?{Authorization:`Bearer ${_}`}:{},D=await s(x.value,"GET",null,B);D.status&&(u.value=Array.isArray(D.data)?D.data[0]:D.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(_){console.error("Gagal Menampilkan Datatable:",_)}finally{f.value=!1}},V=_=>{_.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",_.action,_)},E=_=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",_);let B=_.route;const D=_.path;if(!B&&D){const O=((i==null?void 0:i.path)||"").split("/");O.length>=2&&(B=`/${O[1]}/create`)}if(B||D){const N={..._.query||{},code:D||void 0};Object.keys(N).forEach(O=>N[O]===void 0&&delete N[O]),console.log("[DEBUG] Emitting navigate to parent:",{route:B,query:N}),r("navigate",{route:B||"/form",query:N}),l&&!l.__isFallback&&l.push({path:B||"/form",query:N})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{S()}),(_,B)=>(e.openBlock(),e.createElementBlock("div",pA,[!f.value&&u.value?(e.openBlock(),e.createBlock(Xn,{key:0,ref_key:"dtRef",ref:m,"api-url":x.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:V,onNavigate:E},{"header-actions":e.withCtx(()=>[...B[0]||(B[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",gA,[...B[1]||(B[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",bA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),vd=e.defineCustomElement(Rs),Od=e.defineCustomElement(Ls);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",vd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Od));const yA=[Lo,fi,Le,qi,Ca,Ba,nd,Yt,us,fs,_r,Jt,sd,Sr,id,xs,ms,ld,ws,Ar,Cs,Dn,Bs,Vr,cd,dd,Es,_s,Dr,Nr,On,Hn,hd,pd,Ss,As,Vs,Fs,No,Dd,Xn,Rs,Ls,Is,Pd,Mo],Fd={install(t,n={}){n&&Object.keys(n).length>0&&Ws(n),yA.forEach(o=>{o.name&&t.component(o.name,o)})}};ae.AutoLayoutDatatable=Ls,ae.AutoLayoutForm=Rs,ae.Breadcrumb=Pd,ae.DCodeAutoComplete=Lo,ae.DCodeBadge=Fs,ae.DCodeBeforeAfter=Ca,ae.DCodeButton=Le,ae.DCodeCard=qi,ae.DCodeCardCheckboxList=us,ae.DCodeChart=nd,ae.DCodeCheckbox=Yt,ae.DCodeCurrencyField=fs,ae.DCodeDatePicker=_r,ae.DCodeDialog=Jt,ae.DCodeDialogCloseBtn=sd,ae.DCodeDropzone=Sr,ae.DCodeDynamicUploadList=ms,ae.DCodeFileField=id,ae.DCodeFileResult=xs,ae.DCodeIconDropdown=ld,ae.DCodeImageCropperDialog=ws,ae.DCodeImageField=Ar,ae.DCodeImageResult=Cs,ae.DCodeInfiniteAutoComplete=fi,ae.DCodeLabel=Dn,ae.DCodeListLabels=Ba,ae.DCodeMultiSelect=Bs,ae.DCodeOtpInput=Vr,ae.DCodePermissionMenu=As,ae.DCodeProgress=cd,ae.DCodeProgressBar=dd,ae.DCodeRadio=Es,ae.DCodeRadioCustom=_s,ae.DCodeSlider=Dr,ae.DCodeStaticImage=Dd,ae.DCodeStaticLabel=No,ae.DCodeSwitch=Nr,ae.DCodeTextField=On,ae.DCodeTextarea=Hn,ae.DCodeTimelineWithIcons=hd,ae.DCodeTreePermissions=Vs,ae.DCodeUploadFile=pd,ae.DCodeWizard=Ss,ae.DataTable=Xn,ae.DataTableComponent=Xn,ae.DynamicForm=Is,ae.DynamicFormField=Mo,ae.DynamicUI=Fd,ae.MicroDynamicDatatable=Od,ae.MicroDynamicForm=vd,ae.cn=_e,ae.default=Fd,ae.setApiConfig=Ws,Object.defineProperties(ae,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|