@gemafajarramadhan/dynamic-ui 1.2.43 → 1.2.45

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.
@@ -1,21 +1,21 @@
1
- (function(de,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-i18n"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-i18n","vue-router","vue3-lottie"],n):(de=typeof globalThis<"u"?globalThis:de||self,n(de.DynamicUI={},de.Vue,de.LucideIcons,de.rekaUi,de.core,de.VueDatePicker,de.Uppy,de.UppyDashboard,de.UppyImageEditor,de.VueI18n,de.VueRouter,de.Vue3Lottie))})(this,(function(de,n,ae,pe,We,eu,tu,Rs,nu,Yt,Mn,ou){"use strict";var TS=Object.defineProperty;var OS=(de,n,ae)=>n in de?TS(de,n,{enumerable:!0,configurable:!0,writable:!0,value:ae}):de[n]=ae;var me=(de,n,ae)=>OS(de,typeof n!="symbol"?n+"":n,ae);var Ua;function au(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const a=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,a.get?a:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const kt=au(ae);let wt={};function Is(e){wt={...wt,...e}}function ru(){return wt}function su(){return wt.apiBaseUrl?wt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function iu(){const e={"Content-Type":"application/json",Accept:"application/json"};let t=null;if(wt.getAuthToken?t=wt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?t=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(t=localStorage.getItem("token")||sessionStorage.getItem("token")),t&&(e.Authorization=`Bearer ${t}`),wt.getHeaders){const o=wt.getHeaders();return{...e,...o}}return e}function lu(){wt.onUnauthorized&&wt.onUnauthorized()}async function Ls(e,t,o,a){const r=ru();if(r.apiClient)return r.apiClient(e,t||"GET",o);if(!e||!e.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=(t||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${t}' tidak valid, fallback ke 'GET'.`);const c=su(),d=e.startsWith("http")?e:`${c}${e}`,u={method:l,headers:{...iu(),...a||{}}};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 g=new URLSearchParams;Object.entries(o).forEach(([k,p])=>{p!=null&&g.append(k,String(p))});const y=g.toString();y&&(f=`${d}${d.includes("?")?"&":"?"}${y}`)}const h=await fetch(f,u);if(h.status===401&&lu(),!h.ok){const g=await h.text();throw new Error(`HTTP ${h.status}: ${g}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function Xe(){return{apiUrl:(o,a,r,s)=>Ls(o,a,r,s),DCodeApi:(o,a,r,s)=>{let i=o,l=a,c=r;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&a&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(a.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${a}`,l="POST")),Ls(i,l,c,s==null?void 0:s.headers)}}}const Nn=Math.min,ut=Math.max,vo=Math.round,Po=Math.floor,St=e=>({x:e,y:e}),cu={left:"right",right:"left",bottom:"top",top:"bottom"};function $s(e,t,o){return ut(e,Nn(t,o))}function Jn(e,t){return typeof e=="function"?e(t):e}function Kt(e){return e.split("-")[0]}function Qn(e){return e.split("-")[1]}function Ws(e){return e==="x"?"y":"x"}function js(e){return e==="y"?"height":"width"}function zt(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Us(e){return Ws(zt(e))}function du(e,t,o){o===void 0&&(o=!1);const a=Qn(e),r=Us(e),s=js(r);let i=r==="x"?a===(o?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=To(i)),[i,To(i)]}function uu(e){const t=To(e);return[er(e),t,er(t)]}function er(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Hs=["left","right"],qs=["right","left"],fu=["top","bottom"],hu=["bottom","top"];function mu(e,t,o){switch(e){case"top":case"bottom":return o?t?qs:Hs:t?Hs:qs;case"left":case"right":return t?fu:hu;default:return[]}}function pu(e,t,o,a){const r=Qn(e);let s=mu(Kt(e),o==="start",a);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(er)))),s}function To(e){const t=Kt(e);return cu[t]+e.slice(t.length)}function gu(e){return{top:0,right:0,bottom:0,left:0,...e}}function bu(e){return typeof e!="number"?gu(e):{top:e,right:e,bottom:e,left:e}}function Oo(e){const{x:t,y:o,width:a,height:r}=e;return{width:a,height:r,top:o,left:t,right:t+a,bottom:o+r,x:t,y:o}}function Gs(e,t,o){let{reference:a,floating:r}=e;const s=zt(t),i=Us(t),l=js(i),c=Kt(t),d=s==="y",u=a.x+a.width/2-r.width/2,f=a.y+a.height/2-r.height/2,h=a[l]/2-r[l]/2;let m;switch(c){case"top":m={x:u,y:a.y-r.height};break;case"bottom":m={x:u,y:a.y+a.height};break;case"right":m={x:a.x+a.width,y:f};break;case"left":m={x:a.x-r.width,y:f};break;default:m={x:a.x,y:a.y}}switch(Qn(t)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function yu(e,t){var o;t===void 0&&(t={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Jn(t,e),g=bu(m),k=l[h?f==="floating"?"reference":"floating":f],p=Oo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(k)))==null||o?k:k.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),B=f==="floating"?{x:a,y:r,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},E=Oo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:B,offsetParent:C,strategy:c}):B);return{top:(p.top-E.top+g.top)/w.y,bottom:(E.bottom-p.bottom+g.bottom)/w.y,left:(p.left-E.left+g.left)/w.x,right:(E.right-p.right+g.right)/w.x}}const xu=50,ku=async(e,t,o)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:yu},c=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=Gs(d,a,c),h=a,m=0;const g={};for(let y=0;y<s.length;y++){const k=s[y];if(!k)continue;const{name:p,fn:B}=k,{x:C,y:w,data:E,reset:_}=await B({x:u,y:f,initialPlacement:a,placement:h,strategy:r,middlewareData:g,rects:d,platform:l,elements:{reference:e,floating:t}});u=C??u,f=w??f,g[p]={...g[p],...E},_&&m<xu&&(m++,typeof _=="object"&&(_.placement&&(h=_.placement),_.rects&&(d=_.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):_.rects),{x:u,y:f}=Gs(d,h,c)),y=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:g}},wu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var o,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...k}=Jn(e,t);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=Kt(r),B=zt(l),C=Kt(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),E=h||(C||!y?[To(l)]:uu(l)),_=g!=="none";!h&&_&&E.push(...pu(l,y,g,w));const x=[l,...E],b=await c.detectOverflow(t,k),A=[];let D=((a=s.flip)==null?void 0:a.overflows)||[];if(u&&A.push(b[p]),f){const T=du(r,i,w);A.push(b[T[0]],b[T[1]])}if(D=[...D,{placement:r,overflows:A}],!A.every(T=>T<=0)){var M,V;const T=(((M=s.flip)==null?void 0:M.index)||0)+1,Y=x[T];if(Y&&(!(f==="alignment"?B!==zt(Y):!1)||D.every($=>zt($.placement)===B?$.overflows[0]>0:!0)))return{data:{index:T,overflows:D},reset:{placement:Y}};let R=(V=D.filter(X=>X.overflows[0]<=0).sort((X,$)=>X.overflows[1]-$.overflows[1])[0])==null?void 0:V.placement;if(!R)switch(m){case"bestFit":{var N;const X=(N=D.filter($=>{if(_){const Q=zt($.placement);return Q===B||Q==="y"}return!0}).map($=>[$.placement,$.overflows.filter(Q=>Q>0).reduce((Q,L)=>Q+L,0)]).sort(($,Q)=>$[1]-Q[1])[0])==null?void 0:N[0];X&&(R=X);break}case"initialPlacement":R=l;break}if(r!==R)return{reset:{placement:R}}}return{}}}},Cu=new Set(["left","top"]);async function Bu(e,t){const{placement:o,platform:a,elements:r}=e,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=Kt(o),l=Qn(o),c=zt(o)==="y",d=Cu.has(i)?-1:1,u=s&&c?-1:1,f=Jn(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const Eu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var o,a;const{x:r,y:s,placement:i,middlewareData:l}=t,c=await Bu(t,e);return i===((o=l.offset)==null?void 0:o.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},_u=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:a,placement:r,platform:s}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:B,y:C}=p;return{x:B,y:C}}},...d}=Jn(e,t),u={x:o,y:a},f=await s.detectOverflow(t,d),h=zt(Kt(r)),m=Ws(h);let g=u[m],y=u[h];if(i){const p=m==="y"?"top":"left",B=m==="y"?"bottom":"right",C=g+f[p],w=g-f[B];g=$s(C,g,w)}if(l){const p=h==="y"?"top":"left",B=h==="y"?"bottom":"right",C=y+f[p],w=y-f[B];y=$s(C,y,w)}const k=c.fn({...t,[m]:g,[h]:y});return{...k,data:{x:k.x-o,y:k.y-a,enabled:{[m]:i,[h]:l}}}}}},Su=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var o,a;const{placement:r,rects:s,platform:i,elements:l}=t,{apply:c=()=>{},...d}=Jn(e,t),u=await i.detectOverflow(t,d),f=Kt(r),h=Qn(r),m=zt(r)==="y",{width:g,height:y}=s.floating;let k,p;f==="top"||f==="bottom"?(k=f,p=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,k=h==="end"?"top":"bottom");const B=y-u.top-u.bottom,C=g-u.left-u.right,w=Nn(y-u[k],B),E=Nn(g-u[p],C),_=!t.middlewareData.shift;let x=w,b=E;if((o=t.middlewareData.shift)!=null&&o.enabled.x&&(b=C),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(x=B),_&&!h){const D=ut(u.left,0),M=ut(u.right,0),V=ut(u.top,0),N=ut(u.bottom,0);m?b=g-2*(D!==0||M!==0?D+M:ut(u.left,u.right)):x=y-2*(V!==0||N!==0?V+N:ut(u.top,u.bottom))}await c({...t,availableWidth:b,availableHeight:x});const A=await i.getDimensions(l.floating);return g!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function zo(){return typeof window<"u"}function fn(e){return tr(e)?(e.nodeName||"").toLowerCase():"#document"}function ft(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(tr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function tr(e){return zo()?e instanceof Node||e instanceof ft(e).Node:!1}function Ct(e){return zo()?e instanceof Element||e instanceof ft(e).Element:!1}function Ft(e){return zo()?e instanceof HTMLElement||e instanceof ft(e).HTMLElement:!1}function Xs(e){return!zo()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ft(e).ShadowRoot}function Zn(e){const{overflow:t,overflowX:o,overflowY:a,display:r}=Bt(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+o)&&r!=="inline"&&r!=="contents"}function Au(e){return/^(table|td|th)$/.test(fn(e))}function Fo(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const Vu=/transform|translate|scale|rotate|perspective|filter/,Du=/paint|layout|strict|content/,hn=e=>!!e&&e!=="none";let nr;function or(e){const t=Ct(e)?Bt(e):e;return hn(t.transform)||hn(t.translate)||hn(t.scale)||hn(t.rotate)||hn(t.perspective)||!ar()&&(hn(t.backdropFilter)||hn(t.filter))||Vu.test(t.willChange||"")||Du.test(t.contain||"")}function Mu(e){let t=Jt(e);for(;Ft(t)&&!vn(t);){if(or(t))return t;if(Fo(t))return null;t=Jt(t)}return null}function ar(){return nr==null&&(nr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),nr}function vn(e){return/^(html|body|#document)$/.test(fn(e))}function Bt(e){return ft(e).getComputedStyle(e)}function Ro(e){return Ct(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jt(e){if(fn(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Xs(e)&&e.host||At(e);return Xs(t)?t.host:t}function Ys(e){const t=Jt(e);return vn(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ft(t)&&Zn(t)?t:Ys(t)}function eo(e,t,o){var a;t===void 0&&(t=[]),o===void 0&&(o=!0);const r=Ys(e),s=r===((a=e.ownerDocument)==null?void 0:a.body),i=ft(r);if(s){const l=rr(i);return t.concat(i,i.visualViewport||[],Zn(r)?r:[],l&&o?eo(l):[])}else return t.concat(r,eo(r,[],o))}function rr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ks(e){const t=Bt(e);let o=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const r=Ft(e),s=r?e.offsetWidth:o,i=r?e.offsetHeight:a,l=vo(o)!==s||vo(a)!==i;return l&&(o=s,a=i),{width:o,height:a,$:l}}function sr(e){return Ct(e)?e:e.contextElement}function Pn(e){const t=sr(e);if(!Ft(t))return St(1);const o=t.getBoundingClientRect(),{width:a,height:r,$:s}=Ks(t);let i=(s?vo(o.width):o.width)/a,l=(s?vo(o.height):o.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Nu=St(0);function Js(e){const t=ft(e);return!ar()||!t.visualViewport?Nu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function vu(e,t,o){return t===void 0&&(t=!1),!o||t&&o!==ft(e)?!1:t}function mn(e,t,o,a){t===void 0&&(t=!1),o===void 0&&(o=!1);const r=e.getBoundingClientRect(),s=sr(e);let i=St(1);t&&(a?Ct(a)&&(i=Pn(a)):i=Pn(e));const l=vu(s,o,a)?Js(s):St(0);let c=(r.left+l.x)/i.x,d=(r.top+l.y)/i.y,u=r.width/i.x,f=r.height/i.y;if(s){const h=ft(s),m=a&&Ct(a)?ft(a):a;let g=h,y=rr(g);for(;y&&a&&m!==g;){const k=Pn(y),p=y.getBoundingClientRect(),B=Bt(y),C=p.left+(y.clientLeft+parseFloat(B.paddingLeft))*k.x,w=p.top+(y.clientTop+parseFloat(B.paddingTop))*k.y;c*=k.x,d*=k.y,u*=k.x,f*=k.y,c+=C,d+=w,g=ft(y),y=rr(g)}}return Oo({width:u,height:f,x:c,y:d})}function Io(e,t){const o=Ro(e).scrollLeft;return t?t.left+o:mn(At(e)).left+o}function Qs(e,t){const o=e.getBoundingClientRect(),a=o.left+t.scrollLeft-Io(e,o),r=o.top+t.scrollTop;return{x:a,y:r}}function Pu(e){let{elements:t,rect:o,offsetParent:a,strategy:r}=e;const s=r==="fixed",i=At(a),l=t?Fo(t.floating):!1;if(a===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=St(1);const u=St(0),f=Ft(a);if((f||!f&&!s)&&((fn(a)!=="body"||Zn(i))&&(c=Ro(a)),f)){const m=mn(a);d=Pn(a),u.x=m.x+a.clientLeft,u.y=m.y+a.clientTop}const h=i&&!f&&!s?Qs(i,c):St(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:o.y*d.y-c.scrollTop*d.y+u.y+h.y}}function Tu(e){return Array.from(e.getClientRects())}function Ou(e){const t=At(e),o=Ro(e),a=e.ownerDocument.body,r=ut(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),s=ut(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let i=-o.scrollLeft+Io(e);const l=-o.scrollTop;return Bt(a).direction==="rtl"&&(i+=ut(t.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const Zs=25;function zu(e,t){const o=ft(e),a=At(e),r=o.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const u=ar();(!u||u&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Io(a);if(d<=0){const u=a.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(a.clientWidth-f.clientWidth-m);g<=Zs&&(s-=g)}else d<=Zs&&(s+=d);return{width:s,height:i,x:l,y:c}}function Fu(e,t){const o=mn(e,!0,t==="fixed"),a=o.top+e.clientTop,r=o.left+e.clientLeft,s=Ft(e)?Pn(e):St(1),i=e.clientWidth*s.x,l=e.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function ei(e,t,o){let a;if(t==="viewport")a=zu(e,o);else if(t==="document")a=Ou(At(e));else if(Ct(t))a=Fu(t,o);else{const r=Js(e);a={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Oo(a)}function ti(e,t){const o=Jt(e);return o===t||!Ct(o)||vn(o)?!1:Bt(o).position==="fixed"||ti(o,t)}function Ru(e,t){const o=t.get(e);if(o)return o;let a=eo(e,[],!1).filter(l=>Ct(l)&&fn(l)!=="body"),r=null;const s=Bt(e).position==="fixed";let i=s?Jt(e):e;for(;Ct(i)&&!vn(i);){const l=Bt(i),c=or(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Zn(i)&&!c&&ti(e,i))?a=a.filter(u=>u!==i):r=l,i=Jt(i)}return t.set(e,a),a}function Iu(e){let{element:t,boundary:o,rootBoundary:a,strategy:r}=e;const i=[...o==="clippingAncestors"?Fo(t)?[]:Ru(t,this._c):[].concat(o),a],l=ei(t,i[0],r);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const m=ei(t,i[h],r);c=ut(m.top,c),d=Nn(m.right,d),u=Nn(m.bottom,u),f=ut(m.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Lu(e){const{width:t,height:o}=Ks(e);return{width:t,height:o}}function $u(e,t,o){const a=Ft(t),r=At(t),s=o==="fixed",i=mn(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const c=St(0);function d(){c.x=Io(r)}if(a||!a&&!s)if((fn(t)!=="body"||Zn(r))&&(l=Ro(t)),a){const m=mn(t,!0,s,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else r&&d();s&&!a&&r&&d();const u=r&&!a&&!s?Qs(r,l):St(0),f=i.left+l.scrollLeft-c.x-u.x,h=i.top+l.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function ir(e){return Bt(e).position==="static"}function ni(e,t){if(!Ft(e)||Bt(e).position==="fixed")return null;if(t)return t(e);let o=e.offsetParent;return At(e)===o&&(o=o.ownerDocument.body),o}function oi(e,t){const o=ft(e);if(Fo(e))return o;if(!Ft(e)){let r=Jt(e);for(;r&&!vn(r);){if(Ct(r)&&!ir(r))return r;r=Jt(r)}return o}let a=ni(e,t);for(;a&&Au(a)&&ir(a);)a=ni(a,t);return a&&vn(a)&&ir(a)&&!or(a)?o:a||Mu(e)||o}const Wu=async function(e){const t=this.getOffsetParent||oi,o=this.getDimensions,a=await o(e.floating);return{reference:$u(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function ju(e){return Bt(e).direction==="rtl"}const Uu={convertOffsetParentRelativeRectToViewportRelativeRect:Pu,getDocumentElement:At,getClippingRect:Iu,getOffsetParent:oi,getElementRects:Wu,getClientRects:Tu,getDimensions:Lu,getScale:Pn,isElement:Ct,isRTL:ju};function ai(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hu(e,t){let o=null,a;const r=At(e);function s(){var l;clearTimeout(a),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=e.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||t(),!h||!m)return;const g=Po(f),y=Po(r.clientWidth-(u+h)),k=Po(r.clientHeight-(f+m)),p=Po(u),C={rootMargin:-g+"px "+-y+"px "+-k+"px "+-p+"px",threshold:ut(0,Nn(1,c))||1};let w=!0;function E(_){const x=_[0].intersectionRatio;if(x!==c){if(!w)return i();x?i(!1,x):a=setTimeout(()=>{i(!1,1e-7)},1e3)}x===1&&!ai(d,e.getBoundingClientRect())&&i(),w=!1}try{o=new IntersectionObserver(E,{...C,root:r.ownerDocument})}catch{o=new IntersectionObserver(E,C)}o.observe(e)}return i(!0),s}function lr(e,t,o,a){a===void 0&&(a={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=a,d=sr(e),u=r||s?[...d?eo(d):[],...t?eo(t):[]]:[];u.forEach(p=>{r&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?Hu(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[B]=p;B&&B.target===d&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(t)})),o()}),d&&!c&&m.observe(d),t&&m.observe(t));let g,y=c?mn(e):null;c&&k();function k(){const p=mn(e);y&&!ai(y,p)&&o(),y=p,g=requestAnimationFrame(k)}return o(),()=>{var p;u.forEach(B=>{r&&B.removeEventListener("scroll",o),s&&B.removeEventListener("resize",o)}),f==null||f(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const cr=Eu,dr=_u,ur=wu,fr=Su,qu=(e,t,o)=>{const a=new Map,r={platform:Uu,...o},s={...r.platform,_c:a};return ku(e,t,{...r,platform:s})};function Gu(e){return e!=null&&typeof e=="object"&&"$el"in e}function ri(e){if(Gu(e)){const t=e.$el;return tr(t)&&fn(t)==="#comment"?null:t}return e}function to(e){return typeof e=="function"?e():n.unref(e)}function si(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ii(e,t){const o=si(e);return Math.round(t*o)/o}function hr(e,t,o){o===void 0&&(o={});const a=o.whileElementsMounted,r=n.computed(()=>{var x;return(x=to(o.open))!=null?x:!0}),s=n.computed(()=>to(o.middleware)),i=n.computed(()=>{var x;return(x=to(o.placement))!=null?x:"bottom"}),l=n.computed(()=>{var x;return(x=to(o.strategy))!=null?x:"absolute"}),c=n.computed(()=>{var x;return(x=to(o.transform))!=null?x:!0}),d=n.computed(()=>ri(e.value)),u=n.computed(()=>ri(t.value)),f=n.ref(0),h=n.ref(0),m=n.ref(l.value),g=n.ref(i.value),y=n.shallowRef({}),k=n.ref(!1),p=n.computed(()=>{const x={position:m.value,left:"0",top:"0"};if(!u.value)return x;const b=ii(u.value,f.value),A=ii(u.value,h.value);return c.value?{...x,transform:"translate("+b+"px, "+A+"px)",...si(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:b+"px",top:A+"px"}});let B;function C(){if(d.value==null||u.value==null)return;const x=r.value;qu(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,h.value=b.y,m.value=b.strategy,g.value=b.placement,y.value=b.middlewareData,k.value=x!==!1})}function w(){typeof B=="function"&&(B(),B=void 0)}function E(){if(w(),a===void 0){C();return}if(d.value!=null&&u.value!=null){B=a(d.value,u.value,C);return}}function _(){r.value||(k.value=!1)}return n.watch([s,i,l,r],C,{flush:"sync"}),n.watch([d,u],E,{flush:"sync"}),n.watch(r,_,{flush:"sync"}),n.getCurrentScope()&&n.onScopeDispose(w),{x:n.shallowReadonly(f),y:n.shallowReadonly(h),strategy:n.shallowReadonly(m),placement:n.shallowReadonly(g),middlewareData:n.shallowReadonly(y),isPositioned:n.shallowReadonly(k),floatingStyles:p,update:C}}const Xu=["aria-busy"],Yu={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Ku=["for"],Ju={key:0,class:"ml-1 text-destructive"},Qu={class:"relative"},Zu={key:0,class:"flex items-center text-gray-500 gap-2"},ef=["id","placeholder","disabled","readonly","value"],tf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},nf=["disabled"],of={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},af=["onMouseenter","onClick"],rf={key:0},sf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},lf={key:0},cf={key:1},df={key:2},uf={key:1,class:"mt-1 text-xs text-red-600"},Lo=n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>r.label??void 0),i=G=>{const le=r[G];return le===""||le===!0||le==="true"||le===1||le==="1"},l=n.ref(!1),c=n.computed(()=>o.itemTitle||r["item-title"]||r.itemTitle||"name"),d=n.computed(()=>o.itemValue||r["item-value"]||r.itemValue||"id"),u=n.computed(()=>o.disabled),f=n.computed(()=>i("required")),h=n.computed(()=>i("readonly")),m=n.computed(()=>o.returnObject||i("return-object")||i("returnObject")),g=n.computed(()=>f.value||i("aria-required")),y=n.computed(()=>o.error||o.errorMessage||r["error-message"]),k=n.computed(()=>r.placeholder??""),p=n.computed(()=>{const G=r.minChars??r["min-chars"];if(G==null||G==="")return 0;const le=typeof G=="number"?G:Number.parseInt(String(G),10);return Number.isFinite(le)&&le>0?le:0}),B=n.computed(()=>{const G=r.rules;return Array.isArray(G)?G:[]}),C=n.computed(()=>{const G=r.id||r.label;return G?`app-autocomplete-${G}-${Math.random().toString(36).slice(2,7)}`:void 0}),w=n.ref(o.modelValue),E=n.ref([]),_=n.ref(!1),x=n.ref(!1),b=n.computed(()=>r.items),A=n.computed(()=>{const G=T.value;return G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems?E.value:b.value??[]}),D=n.computed(()=>!!r.loading),M=n.computed(()=>D.value||_.value),V=n.computed(()=>{const{label:G,items:le,loading:ye,rules:ze,"item-title":De,"item-value":te,itemTitle:re,itemValue:ce,minChars:ke,"min-chars":je,clearable:Tt,required:Ha,"aria-required":Id,disabled:qa,readonly:Ld,visible:it,"return-object":$d,returnObject:Ga,class:Wd,"fetch-items":Xa,fetchItems:jd,error:zs,errorMessage:Ud,"error-message":Hd,...Ya}=r||{};return Ya}),N=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},T=n.computed(()=>{const G=o.endpoint||{};return{apiModule:o.apiModule||G.apiModule,apiAction:o.apiAction||G.apiAction,apiUrl:G.apiUrl,apiMethod:G.apiMethod||"GET"}}),Y=n.ref(null),R=n.ref(null),X=n.ref(null),{floatingStyles:$}=hr(R,X,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:G,elements:le,availableHeight:ye}){Object.assign(le.floating.style,{width:`${G.reference.width}px`,maxHeight:`${ye}px`})}})]}),Q=n.ref(!1),L=n.ref(""),H=n.ref(-1),J=n.ref(null),v=n.computed(()=>!p.value||(L.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),O=G=>{if(G==null)return"";if(typeof G=="string"||typeof G=="number")return String(G);const le=c.value;return typeof le=="function"?le(G):(G==null?void 0:G[le])??(G==null?void 0:G.name)??(G==null?void 0:G.nama)??(G==null?void 0:G.label)??(G==null?void 0:G.title)??"-"},W=G=>{if(G==null)return null;if(typeof G=="string"||typeof G=="number")return G;const le=d.value;return typeof le=="function"?le(G):(G==null?void 0:G[le])??(G==null?void 0:G.id)??(G==null?void 0:G.value)??(G==null?void 0:G.code)??null},q=n.computed(()=>{const G=w.value;if(G==null||G==="")return"";if(Array.isArray(G))return G.length?G.map(ze=>{if(m.value&&typeof ze=="object"||typeof ze=="object")return O(ze);const De=A.value.find(te=>W(te)==ze);return De?O(De):String(ze)}).join(", "):"";if(typeof G=="object")return O(G);const le=A.value.find(ye=>W(ye)==G);return le?O(le):String(G)}),ne=n.computed(()=>{const G=A.value||[],le=(L.value||"").trim().toLowerCase(),ye=(q.value||"").toLowerCase(),ze=!le||le===ye;let De=G;if(ze||(De=G.filter(te=>O(te).toLowerCase().includes(le))),De.length>0){const te=re=>{const ce=W(re);return Array.isArray(w.value)?w.value.some(ke=>ke==ce):w.value==ce};De=[...De].sort((re,ce)=>{const ke=te(re),je=te(ce);return ke&&!je?-1:!ke&&je?1:0})}return De}),se=G=>Array.isArray(G)?G.length===0:G==null||G==="",ie=G=>{if(J.value=null,f.value&&se(G)&&!B.value.length)return J.value="This field is required",!1;for(const le of B.value){const ye=le(G);if(ye===!1)return J.value="Invalid value",!1;if(typeof ye=="string")return J.value=ye,!1}return!0},z=async()=>{if(u.value||h.value)return;Q.value=!0,H.value=ne.value.length?0:-1,L.value=q.value||"";const G=T.value,le=G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems;o.autoFetchOnOpen&&le&&!x.value&&(await ge(),H.value=ne.value.length?0:-1)},P=()=>{Q.value=!1,H.value=-1,L.value=q.value||""},U=G=>{const le=m.value?G:W(G);let ye=le;Array.isArray(w.value)&&(ye=[le]),w.value=ye,a("update:modelValue",ye),J.value=null,ie(ye),L.value=O(G),P()},K=()=>{E.value=[],x.value=!1,w.value=Array.isArray(w.value)?[]:null,a("update:modelValue",w.value),L.value="",J.value=null},oe=()=>{l.value=!0,K(),P(),setTimeout(()=>{l.value=!1},0)},xe=G=>{if(u.value||h.value)return;const le=G.target.value;L.value=le,J.value&&(J.value=null),Q.value||(Q.value=!0),H.value=ne.value.length?0:-1;const ye=T.value.apiModule&&T.value.apiAction||T.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&ye&&!M.value&&!x.value&&ge()},Ee=G=>{var ye;if(u.value||h.value)return;const le={ArrowDown:()=>{if(G.preventDefault(),!Q.value){z();return}ne.value.length&&(H.value=Math.min(H.value+1,ne.value.length-1))},ArrowUp:()=>{!Q.value||!ne.value.length||(G.preventDefault(),H.value=Math.max(H.value-1,0))},Enter:()=>{if(!Q.value)return;G.preventDefault();const ze=ne.value[H.value];ze&&U(ze)},Escape:()=>{G.preventDefault(),P()},Tab:()=>{P()}};(ye=le[G.key])==null||ye.call(le)},ge=async()=>{const G=T.value;if(G.apiModule&&G.apiAction||G.apiUrl||o.fetchItems){_.value=!0;try{let ye;if(o.fetchItems){const ze=N()||{},De={page:1,perPage:100,search:(L.value||"").trim(),...ze,...o.apiParams},te=await o.fetchItems(De),re=(te==null?void 0:te.data)??te;ye=(re==null?void 0:re.data)??re}else{const De=Xe().DCodeApi;if(typeof De!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const re={page:1,perPage:100,...N()||{},...o.apiParams};let ce;G.apiUrl?ce=await De("","",re,{_url:G.apiUrl,_method:G.apiMethod||"POST"}):ce=await De(G.apiModule,G.apiAction,re);const ke=(ce==null?void 0:ce.data)??ce;ye=(ke==null?void 0:ke.data)??ke}E.value=Array.isArray(ye)?ye:[],x.value=!0}catch(ye){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",ye),J.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(ye==null?void 0:ye.message)||(ye==null?void 0:ye.toString())||"Failed to load options"}`,E.value=[],x.value=!0}finally{_.value=!1}}},fe=G=>{const le=W(G);return m.value?w.value?Array.isArray(w.value)?w.value.some(ye=>W(ye)==le):W(w.value)==le:!1:Array.isArray(w.value)?w.value.some(ye=>ye==le):w.value==le};n.watch(()=>[N(),T.value,o.apiParams],([G,le,ye],[ze,De,te])=>{const re=T.value;if(!(re.apiModule&&re.apiAction||re.apiUrl||o.fetchItems)){K();return}const ke=JSON.stringify(G??null)===JSON.stringify(ze??null),je=JSON.stringify(ye??null)===JSON.stringify(te??null);ke&&je||(K(),je||ge())},{deep:!0}),n.watch(()=>o.modelValue,(G,le)=>{w.value=G,!l.value&&(G==null||G==="")&&le!=null&&o.apiModule&&o.apiAction&&(E.value=[],x.value=!1),L.value=q.value||""},{immediate:!0});const Me=T.value;(Me.apiModule&&Me.apiAction||Me.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!se(o.modelValue))&&ge();const Ze=G=>{const le=Y.value,ye=X.value,ze=G.target;le&&le.contains(ze)||ye&&ye.contains(ze)||Q.value&&P()},nt=n.computed(()=>{const G=o.modelValue;return G==null?!1:typeof G=="string"?G.trim().length>0:Array.isArray(G)?G.length>0:typeof G=="object"?Object.keys(G).length>0:!0}),Ke=n.computed(()=>!!o.clearable&&nt.value&&!o.disabled);return n.onMounted(()=>{document.addEventListener("mousedown",Ze)}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Ze)}),(G,le)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:Y,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",Yu)):n.createCommentVNode("",!0),le[6]||(le[6]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:C.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),g.value?(n.openBlock(),n.createElementBlock("span",Ju,"*")):n.createCommentVNode("",!0)],8,Ku)):n.createCommentVNode("",!0),n.createElementVNode("div",Qu,[n.createElementVNode("div",{ref_key:"reference",ref:R,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||h.value?"opacity-60 cursor-not-allowed":"",J.value||y.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||G.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",Zu,[n.renderSlot(G.$slots,"prepend-inner",{},()=>[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps(V.value,{id:C.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||h.value?"cursor-not-allowed":"cursor-text"],placeholder:k.value,disabled:u.value,readonly:h.value,value:Q.value?L.value:q.value||L.value,onFocus:le[0]||(le[0]=()=>{Q.value||z()}),onClick:le[1]||(le[1]=()=>{Q.value||z()}),onInput:xe,onKeydown:Ee,onBlur:le[2]||(le[2]=()=>ie(w.value))}),null,16,ef),M.value?(n.openBlock(),n.createElementBlock("svg",tf,[...le[7]||(le[7]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):Ke.value?(n.openBlock(),n.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:le[3]||(le[3]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(oe,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.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||h.value,onClick:le[4]||(le[4]=ye=>Q.value?P():z()),"aria-label":"Toggle"},[n.createVNode(n.unref(ae.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":Q.value}])},null,8,["class"])],8,nf))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[Q.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:X,style:n.normalizeStyle(n.unref($)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",of,[ne.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(ne.value,(ye,ze)=>(n.openBlock(),n.createElementBlock("button",{key:W(ye)??ze,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",ze===H.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:De=>H.value=ze,onMousedown:le[5]||(le[5]=n.withModifiers(()=>{},["prevent"])),onClick:De=>U(ye)},[n.createTextVNode(n.toDisplayString(O(ye))+" ",1),fe(ye)?(n.openBlock(),n.createElementBlock("span",rf," ✓ ")):n.createCommentVNode("",!0)],42,af))),128)):n.renderSlot(G.$slots,"no-data",{key:1},()=>[n.createElementVNode("div",sf,[M.value?(n.openBlock(),n.createElementBlock("span",lf,"Loading data…")):v.value?(n.openBlock(),n.createElementBlock("span",cf,n.toDisplayString(v.value),1)):(n.openBlock(),n.createElementBlock("span",df,"No data available"))])])])],4)):n.createCommentVNode("",!0)]))]),J.value||y.value?(n.openBlock(),n.createElementBlock("p",uf,n.toDisplayString(J.value||y.value),1)):n.createCommentVNode("",!0)],64))],10,Xu)),[[n.vShow,e.visible]])}}),ff=["aria-busy"],hf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},mf=["for"],pf={key:0,class:"ml-1 text-destructive"},gf={class:"relative"},bf={key:0,class:"flex items-center text-gray-500 gap-2"},yf=["id","placeholder","disabled","value"],xf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},kf=["disabled"],wf={key:0,class:"p-3 space-y-2"},Cf=["onMouseenter","onClick"],Bf={class:"flex items-center space-x-3"},Ef={class:"flex-1"},_f={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Sf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Af={key:0},Vf={key:2,class:"p-3 text-center"},Df={class:"inline-flex items-center space-x-2"},Mf={class:"text-sm text-gray-500"},Nf={key:3,class:"p-3 text-center"},vf={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"},Of={key:2,class:"mt-1 text-xs text-gray-500"},li=n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.ref(),i=n.ref(),l=n.ref(),c=n.ref(),d=n.ref(),u=n.computed(()=>{const H=o.label||o.placeholder;return H?`app-infinite-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=n.ref(""),h=n.ref([]),m=n.ref(!1),g=n.ref(!1),y=n.ref(-1),k=n.ref(1),p=n.ref(!0),B=n.ref(0),C=n.ref(),{floatingStyles:w}=hr(c,d,{placement:"bottom-start",whileElementsMounted:lr,middleware:[cr(4),ur(),dr(),fr({apply({rects:H,elements:J}){Object.assign(J.floating.style,{width:`${H.reference.width}px`})}})]});n.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const E=n.computed(()=>f.value?h.value.filter(H=>A(H).toLowerCase().includes(f.value.toLowerCase())):h.value),_=n.computed(()=>{if(g.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return A(o.modelValue);{const H=h.value.find(J=>D(J)===o.modelValue);return H?A(H):String(o.modelValue)}}return""}),x=()=>{g.value=!0},b=()=>{g.value=!1},A=H=>typeof o.itemTitle=="function"?o.itemTitle(H):H[o.itemTitle]||"",D=H=>typeof o.itemValue=="function"?o.itemValue(H):H[o.itemValue]||H,M=H=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(H):H[o.itemSubtitle]||"":"",V=H=>o.modelValue?o.returnObject?D(H)===D(o.modelValue):D(H)===o.modelValue:!1,N=H=>{var v;const J=o.returnObject?H:D(H);a("update:modelValue",J),a("select",H),g.value=!1,f.value="",(v=s.value)==null||v.blur()},T=()=>{var H;a("update:modelValue",null),f.value="",(H=s.value)==null||H.focus()},Y=H=>{g.value=!0,a("focus",H),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&L(!0)},R=H=>{setTimeout(()=>{g.value=!1,a("blur",H)},200)},X=H=>{const J=H.target;f.value=J.value,C.value&&clearTimeout(C.value),C.value=setTimeout(()=>{a("search",f.value),k.value=1,p.value=!0,L(!0)},o.debounceMs)},$=H=>{if(g.value)switch(H.key){case"ArrowDown":H.preventDefault(),y.value=Math.min(y.value+1,E.value.length-1);break;case"ArrowUp":H.preventDefault(),y.value=Math.max(y.value-1,0);break;case"Enter":H.preventDefault(),y.value>=0&&E.value[y.value]&&N(E.value[y.value]);break;case"Escape":g.value=!1;break}},Q=H=>{if(!p.value||m.value)return;const J=H.target,{scrollTop:v,scrollHeight:O,clientHeight:W}=J;v+W>=O-o.threshold&&L()},L=async(H=!1)=>{var J,v;if(!m.value){m.value=!0;try{let O=[];if(o.fetchItems)O=await o.fetchItems();else{const W=Xe(),q=((J=o.endpoint)==null?void 0:J.apiModule)||o.apiModule,ne=((v=o.endpoint)==null?void 0:v.apiAction)||o.apiAction;if(!q||!ne)throw new Error("API module and action are required");const se={page:H?1:k.value,pageSize:o.pageSize,search:f.value,...o.apiParams},ie=await W.apiUrl(`/${q}/${ne}`,"GET",se);O=ie.data||ie.items||ie||[],B.value=ie.total||ie.totalItems||O.length}H?(h.value=O,k.value=1):(h.value.push(...O),k.value++),p.value=O.length>=o.pageSize,p.value||a("end-of-results"),a("load-more",{items:O,page:k.value,hasMore:p.value,total:B.value})}catch(O){console.error("Error fetching items:",O),a("error",O)}finally{m.value=!1}}};return n.onMounted(()=>{o.autoFetchOnMount&&L()}),n.onUnmounted(()=>{C.value&&clearTimeout(C.value)}),n.watch(()=>o.modelValue,H=>{H||(f.value="")}),(H,J)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:l,class:n.normalizeClass(["w-full",n.unref(r).class]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",hf)):n.createCommentVNode("",!0),J[3]||(J[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",pf,"*")):n.createCommentVNode("",!0)],8,mf)):n.createCommentVNode("",!0),n.createElementVNode("div",gf,[n.createElementVNode("div",{ref_key:"reference",ref:c,class:n.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[e.disabled?"opacity-60 cursor-not-allowed":"",e.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(n.openBlock(),n.createElementBlock("div",bf,[o.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({ref_key:"inputRef",ref:s},H.$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",e.disabled?"cursor-not-allowed":"cursor-text"],placeholder:e.placeholder,disabled:e.disabled,value:_.value,onFocus:Y,onBlur:R,onInput:X,onKeydown:$}),null,16,yf),m.value?(n.openBlock(),n.createElementBlock("svg",xf,[...J[4]||(J[4]=[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),n.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):e.clearable&&e.modelValue?(n.openBlock(),n.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:J[0]||(J[0]=n.withModifiers(()=>{},["prevent"])),onClick:n.withModifiers(T,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(n.openBlock(),n.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:e.disabled,onClick:J[1]||(J[1]=v=>g.value?b():x()),"aria-label":"Toggle"},[n.createVNode(n.unref(ae.ChevronDown),{class:n.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":g.value}])},null,8,["class"])],8,kf))],2),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[g.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:n.normalizeStyle(n.unref(w)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[n.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:Q},[m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",wf,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(5,v=>n.createElementVNode("div",{key:v,class:"flex items-center space-x-3"},[...J[5]||(J[5]=[n.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),n.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):E.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(E.value,(v,O)=>(n.openBlock(),n.createElementBlock("button",{key:D(v)??O,type:"button",class:n.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",O===y.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:W=>y.value=O,onMousedown:J[2]||(J[2]=n.withModifiers(()=>{},["prevent"])),onClick:W=>N(v)},[n.renderSlot(H.$slots,"item",{item:v,index:O},()=>[n.createElementVNode("div",Bf,[n.createElementVNode("div",Ef,[n.createElementVNode("div",_f,n.toDisplayString(A(v)),1),e.itemSubtitle?(n.openBlock(),n.createElementBlock("div",Sf,n.toDisplayString(M(v)),1)):n.createCommentVNode("",!0)])])]),V(v)?(n.openBlock(),n.createElementBlock("span",Af," ✓ ")):n.createCommentVNode("",!0)],42,Cf))),128)):n.createCommentVNode("",!0),m.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Vf,[n.createElementVNode("div",Df,[J[6]||(J[6]=n.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),n.createElementVNode("span",Mf,n.toDisplayString(e.loadingText),1)])])):n.createCommentVNode("",!0),!p.value&&h.value.length>0?(n.openBlock(),n.createElementBlock("div",Nf,[n.createElementVNode("div",vf,n.toDisplayString(e.endOfResultsText),1)])):!m.value&&h.value.length===0?(n.openBlock(),n.createElementBlock("div",Pf,n.toDisplayString(e.noResultsText),1)):n.createCommentVNode("",!0)],544)],4)):n.createCommentVNode("",!0)]))]),e.error?(n.openBlock(),n.createElementBlock("p",Tf,n.toDisplayString(e.errorMessage||e.error),1)):e.helperText?(n.openBlock(),n.createElementBlock("p",Of,n.toDisplayString(e.helperText),1)):n.createCommentVNode("",!0)],64))],10,ff)),[[n.vShow,e.visible]])}});function ci(e){var t,o,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=ci(e[t]))&&(a&&(a+=" "),a+=o)}else for(o in e)e[o]&&(a&&(a+=" "),a+=o);return a}function di(){for(var e,t,o=0,a="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=ci(e))&&(a&&(a+=" "),a+=t);return a}const zf=(e,t)=>{const o=new Array(e.length+t.length);for(let a=0;a<e.length;a++)o[a]=e[a];for(let a=0;a<t.length;a++)o[e.length+a]=t[a];return o},Ff=(e,t)=>({classGroupId:e,validator:t}),ui=(e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),$o="-",fi=[],Rf="arbitrary..",If=e=>{const t=$f(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Lf(i);const l=i.split($o),c=l[0]===""&&l.length>1?1:0;return hi(l,c,t)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=o[i];return c?d?zf(d,c):c:d||fi}return o[i]||fi}}},hi=(e,t,o)=>{if(e.length-t===0)return o.classGroupId;const r=e[t],s=o.nextPart.get(r);if(s){const d=hi(e,t+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=t===0?e.join($o):e.slice(t).join($o),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Lf=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),o=t.indexOf(":"),a=t.slice(0,o);return a?Rf+a:void 0})(),$f=e=>{const{theme:t,classGroups:o}=e;return Wf(o,t)},Wf=(e,t)=>{const o=ui();for(const a in e){const r=e[a];mr(r,o,a,t)}return o},mr=(e,t,o,a)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];jf(i,t,o,a)}},jf=(e,t,o,a)=>{if(typeof e=="string"){Uf(e,t,o);return}if(typeof e=="function"){Hf(e,t,o,a);return}qf(e,t,o,a)},Uf=(e,t,o)=>{const a=e===""?t:mi(t,e);a.classGroupId=o},Hf=(e,t,o,a)=>{if(Gf(e)){mr(e(a),t,o,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Ff(o,e))},qf=(e,t,o,a)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];mr(c,mi(t,l),o,a)}},mi=(e,t)=>{let o=e;const a=t.split($o),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=o.nextPart.get(i);l||(l=ui(),o.nextPart.set(i,l)),o=l}return o},Gf=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Xf=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),a=Object.create(null);const r=(s,i)=>{o[s]=i,t++,t>e&&(t=0,a=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in o?o[s]=i:r(s,i)}}},pr="!",pi=":",Yf=[],gi=(e,t,o,a,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:a,isExternal:r}),Kf=e=>{const{prefix:t,experimentalParseClassName:o}=e;let a=r=>{const s=[];let i=0,l=0,c=0,d;const u=r.length;for(let y=0;y<u;y++){const k=r[y];if(i===0&&l===0){if(k===pi){s.push(r.slice(c,y)),c=y+1;continue}if(k==="/"){d=y;continue}}k==="["?i++:k==="]"?i--:k==="("?l++:k===")"&&l--}const f=s.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(pr)?(h=f.slice(0,-1),m=!0):f.startsWith(pr)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return gi(s,m,h,g)};if(t){const r=t+pi,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):gi(Yf,!1,i,void 0,!0)}if(o){const r=a;a=s=>o({className:s,parseClassName:r})}return a},Jf=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((o,a)=>{t.set(o,1e6+a)}),o=>{const a=[];let r=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=t.has(i);l||c?(r.length>0&&(r.sort(),a.push(...r),r=[]),a.push(i)):r.push(i)}return r.length>0&&(r.sort(),a.push(...r)),a}},Qf=e=>({cache:Xf(e.cacheSize),parseClassName:Kf(e),sortModifiers:Jf(e),...If(e)}),Zf=/\s+/,eh=(e,t)=>{const{parseClassName:o,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],l=e.trim().split(Zf);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let k=!!y,p=a(k?g.substring(0,y):g);if(!p){if(!k){c=u+(c.length>0?" "+c:c);continue}if(p=a(g),!p){c=u+(c.length>0?" "+c:c);continue}k=!1}const B=h.length===0?"":h.length===1?h[0]:s(h).join(":"),C=m?B+pr:B,w=C+p;if(i.indexOf(w)>-1)continue;i.push(w);const E=r(p,k);for(let _=0;_<E.length;++_){const x=E[_];i.push(C+x)}c=u+(c.length>0?" "+c:c)}return c},th=(...e)=>{let t=0,o,a,r="";for(;t<e.length;)(o=e[t++])&&(a=bi(o))&&(r&&(r+=" "),r+=a);return r},bi=e=>{if(typeof e=="string")return e;let t,o="";for(let a=0;a<e.length;a++)e[a]&&(t=bi(e[a]))&&(o&&(o+=" "),o+=t);return o},nh=(e,...t)=>{let o,a,r,s;const i=c=>{const d=t.reduce((u,f)=>f(u),e());return o=Qf(d),a=o.cache.get,r=o.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const u=eh(c,o);return r(c,u),u};return s=i,(...c)=>s(th(...c))},oh=[],Je=e=>{const t=o=>o[e]||oh;return t.isThemeGetter=!0,t},yi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ah=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,rh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sh=/\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$/,ih=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ch=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Qt=e=>ah.test(e),Be=e=>!!e&&!Number.isNaN(Number(e)),Zt=e=>!!e&&Number.isInteger(Number(e)),gr=e=>e.endsWith("%")&&Be(e.slice(0,-1)),Rt=e=>rh.test(e),ki=()=>!0,dh=e=>sh.test(e)&&!ih.test(e),br=()=>!1,uh=e=>lh.test(e),fh=e=>ch.test(e),hh=e=>!ue(e)&&!he(e),mh=e=>en(e,Si,br),ue=e=>yi.test(e),pn=e=>en(e,Ai,dh),wi=e=>en(e,Ch,Be),ph=e=>en(e,Di,ki),gh=e=>en(e,Vi,br),Ci=e=>en(e,Ei,br),bh=e=>en(e,_i,fh),Wo=e=>en(e,Mi,uh),he=e=>xi.test(e),no=e=>gn(e,Ai),yh=e=>gn(e,Vi),Bi=e=>gn(e,Ei),xh=e=>gn(e,Si),kh=e=>gn(e,_i),jo=e=>gn(e,Mi,!0),wh=e=>gn(e,Di,!0),en=(e,t,o)=>{const a=yi.exec(e);return a?a[1]?t(a[1]):o(a[2]):!1},gn=(e,t,o=!1)=>{const a=xi.exec(e);return a?a[1]?t(a[1]):o:!1},Ei=e=>e==="position"||e==="percentage",_i=e=>e==="image"||e==="url",Si=e=>e==="length"||e==="size"||e==="bg-size",Ai=e=>e==="length",Ch=e=>e==="number",Vi=e=>e==="family-name",Di=e=>e==="number"||e==="weight",Mi=e=>e==="shadow",Bh=nh(()=>{const e=Je("color"),t=Je("font"),o=Je("text"),a=Je("font-weight"),r=Je("tracking"),s=Je("leading"),i=Je("breakpoint"),l=Je("container"),c=Je("spacing"),d=Je("radius"),u=Je("shadow"),f=Je("inset-shadow"),h=Je("text-shadow"),m=Je("drop-shadow"),g=Je("blur"),y=Je("perspective"),k=Je("aspect"),p=Je("ease"),B=Je("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...w(),he,ue],_=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],b=()=>[he,ue,c],A=()=>[Qt,"full","auto",...b()],D=()=>[Zt,"none","subgrid",he,ue],M=()=>["auto",{span:["full",Zt,he,ue]},Zt,he,ue],V=()=>[Zt,"auto",he,ue],N=()=>["auto","min","max","fr",he,ue],T=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],R=()=>["auto",...b()],X=()=>[Qt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],$=()=>[Qt,"screen","full","dvw","lvw","svw","min","max","fit",...b()],Q=()=>[Qt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],L=()=>[e,he,ue],H=()=>[...w(),Bi,Ci,{position:[he,ue]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],v=()=>["auto","cover","contain",xh,mh,{size:[he,ue]}],O=()=>[gr,no,pn],W=()=>["","none","full",d,he,ue],q=()=>["",Be,no,pn],ne=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ie=()=>[Be,gr,Bi,Ci],z=()=>["","none",g,he,ue],P=()=>["none",Be,he,ue],U=()=>["none",Be,he,ue],K=()=>[Be,he,ue],oe=()=>[Qt,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Rt],breakpoint:[Rt],color:[ki],container:[Rt],"drop-shadow":[Rt],ease:["in","out","in-out"],font:[hh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Rt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Rt],shadow:[Rt],spacing:["px",Be],text:[Rt],"text-shadow":[Rt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Qt,ue,he,k]}],container:["container"],columns:[{columns:[Be,ue,he,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:E()}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Zt,"auto",he,ue]}],basis:[{basis:[Qt,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Be,Qt,"auto","initial","none",ue]}],grow:[{grow:["",Be,he,ue]}],shrink:[{shrink:["",Be,he,ue]}],order:[{order:[Zt,"first","last","none",he,ue]}],"grid-cols":[{"grid-cols":D()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":D()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...T(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...T()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":T()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],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:R()}],mx:[{mx:R()}],my:[{my:R()}],ms:[{ms:R()}],me:[{me:R()}],mbs:[{mbs:R()}],mbe:[{mbe:R()}],mt:[{mt:R()}],mr:[{mr:R()}],mb:[{mb:R()}],ml:[{ml:R()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...$()]}],"min-inline-size":[{"min-inline":["auto",...$()]}],"max-inline-size":[{"max-inline":["none",...$()]}],"block-size":[{block:["auto",...Q()]}],"min-block-size":[{"min-block":["auto",...Q()]}],"max-block-size":[{"max-block":["none",...Q()]}],w:[{w:[l,"screen",...X()]}],"min-w":[{"min-w":[l,"screen","none",...X()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",o,no,pn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,wh,ph]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gr,ue]}],"font-family":[{font:[yh,gh,t]}],"font-features":[{"font-features":[ue]}],"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:[r,he,ue]}],"line-clamp":[{"line-clamp":[Be,"none",he,wi]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",he,ue]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",he,ue]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ne(),"wavy"]}],"text-decoration-thickness":[{decoration:[Be,"from-font","auto",he,pn]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Be,"auto",he,ue]}],"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",he,ue]}],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",he,ue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:H()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:v()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zt,he,ue],radial:["",he,ue],conic:[Zt,he,ue]},kh,bh]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:O()}],"gradient-via-pos":[{via:O()}],"gradient-to-pos":[{to:O()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:q()}],"border-w-x":[{"border-x":q()}],"border-w-y":[{"border-y":q()}],"border-w-s":[{"border-s":q()}],"border-w-e":[{"border-e":q()}],"border-w-bs":[{"border-bs":q()}],"border-w-be":[{"border-be":q()}],"border-w-t":[{"border-t":q()}],"border-w-r":[{"border-r":q()}],"border-w-b":[{"border-b":q()}],"border-w-l":[{"border-l":q()}],"divide-x":[{"divide-x":q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ne(),"hidden","none"]}],"divide-style":[{divide:[...ne(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...ne(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Be,he,ue]}],"outline-w":[{outline:["",Be,no,pn]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",u,jo,Wo]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,jo,Wo]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Be,pn]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":q()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,jo,Wo]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Be,he,ue]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"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":[Be]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[he,ue]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[Be]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:H()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:v()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",he,ue]}],filter:[{filter:["","none",he,ue]}],blur:[{blur:z()}],brightness:[{brightness:[Be,he,ue]}],contrast:[{contrast:[Be,he,ue]}],"drop-shadow":[{"drop-shadow":["","none",m,jo,Wo]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Be,he,ue]}],"hue-rotate":[{"hue-rotate":[Be,he,ue]}],invert:[{invert:["",Be,he,ue]}],saturate:[{saturate:[Be,he,ue]}],sepia:[{sepia:["",Be,he,ue]}],"backdrop-filter":[{"backdrop-filter":["","none",he,ue]}],"backdrop-blur":[{"backdrop-blur":z()}],"backdrop-brightness":[{"backdrop-brightness":[Be,he,ue]}],"backdrop-contrast":[{"backdrop-contrast":[Be,he,ue]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Be,he,ue]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Be,he,ue]}],"backdrop-invert":[{"backdrop-invert":["",Be,he,ue]}],"backdrop-opacity":[{"backdrop-opacity":[Be,he,ue]}],"backdrop-saturate":[{"backdrop-saturate":[Be,he,ue]}],"backdrop-sepia":[{"backdrop-sepia":["",Be,he,ue]}],"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",he,ue]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Be,"initial",he,ue]}],ease:[{ease:["linear","initial",p,he,ue]}],delay:[{delay:[Be,he,ue]}],animate:[{animate:["none",B,he,ue]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,he,ue]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:P()}],"rotate-x":[{"rotate-x":P()}],"rotate-y":[{"rotate-y":P()}],"rotate-z":[{"rotate-z":P()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:K()}],"skew-x":[{"skew-x":K()}],"skew-y":[{"skew-y":K()}],transform:[{transform:[he,ue,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",he,ue]}],"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",he,ue]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Be,no,pn,wi]}],stroke:[{stroke:["none",...L()]}],"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 Se(...e){return Bh(di(e))}function Eh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yr={},xr={},Uo={exports:{}},Ni;function _h(){if(Ni)return Uo.exports;Ni=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e,blackBright:e,redBright:e,greenBright:e,yellowBright:e,blueBright:e,magentaBright:e,cyanBright:e,whiteBright:e,bgBlackBright:e,bgRedBright:e,bgGreenBright:e,bgYellowBright:e,bgBlueBright:e,bgMagentaBright:e,bgCyanBright:e,bgWhiteBright:e}};return Uo.exports=t(),Uo.exports.createColors=t,Uo.exports}var vi;function Sh(){return vi||(vi=1,(function(e){var t={};Object.defineProperty(e,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(e,{dim:function(){return l},default:function(){return c}});const a=r(_h());function r(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&t.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(h=>console.warn(d,"-",h)))}function l(d){return a.default.dim(d)}const c={info(d,u){i(a.default.bold(a.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(a.default.bold(a.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(a.default.bold(a.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(xr)),xr}var Pi;function Ah(){return Pi||(Pi=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});const t=o(Sh());function o(s){return s&&s.__esModule?s:{default:s}}function a({version:s,from:i,to:l}){t.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 r={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 a({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return a({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return a({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return a({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return a({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(yr)),yr}var kr,Ti;function Vh(){if(Ti)return kr;Ti=1;let e=Ah();return kr=(e.__esModule?e:{default:e}).default,kr}var Dh=Vh();const Mh=Eh(Dh),Oi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,zi=di,wr=(e,t)=>o=>{var a;if((t==null?void 0:t.variants)==null)return zi(e,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=Oi(u)||Oi(f);return r[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(g=>{let[y,k]=g;return Array.isArray(k)?k.includes({...s,...l}[y]):{...s,...l}[y]===k})?[...d,f,h]:d},[]);return zi(e,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},Et=n.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(pe.Primitive),{as:e.as,"as-child":e.asChild,class:n.normalizeClass(n.unref(Se)(n.unref(Tn)({variant:e.variant,size:e.size}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Tn=wr("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"}}),Fi=n.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(e,{emit:t}){const o=e,a=t,r=pe.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(pe.TooltipRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),Ri=n.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(e,{emit:t}){const o=e,a=t,r=We.reactiveOmit(o,"class"),s=pe.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(pe.TooltipPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(pe.TooltipContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(Se)("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:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Ii=n.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(pe.TooltipProvider),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Li=n.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(pe.TooltipTrigger),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Nh={class:"relative z-10"},vh="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] shadow-[0_3px_0_0_rgba(0,0,0,0.12),0_12px_22px_-10px_rgba(0,0,0,0.35)] hover:shadow-[0_6px_20px_-4px_rgba(0,0,0,0.3),0_10px_40px_-10px_rgba(0,0,0,0.2)] active:shadow-[0_1px_0_0_rgba(0,0,0,0.2),0_4px_8px_-4px_rgba(0,0,0,0.35)] 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",Ph=n.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(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&kt[o.icon]||null),r=n.computed(()=>!!o.tooltip),s=n.computed(()=>o.visible??!0),i=n.computed(()=>{const v=String(o.variant||"default").toLowerCase();return v==="tonal"?"secondary":v==="elevated"?"default":v}),l=n.computed(()=>String(o.bgColor||"").toLowerCase()),c=n.computed(()=>String(o.type||"button").toLowerCase()),d=n.computed(()=>{const{class:v,...O}=t;return O}),u=n.computed(()=>Se(t.class)),f=n.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=n.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=n.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),g=n.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}`:""),y=n.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"),k=n.computed(()=>Se("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",g.value,h.value,m.value,f.value)),p=n.computed(()=>{const O=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return O?O[0]:null}),B=n.computed(()=>{const O=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return O?O[0]:null}),C=n.computed(()=>!!p.value),w=n.computed(()=>/\bborder-/.test(u.value??"")),E=n.computed(()=>/\bhover:/.test(u.value??"")),_=n.computed(()=>{const v=u.value??"";return i.value!=="outline"?v:v.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),x=n.ref(null),b=v=>{const O=v.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return O?{r:Number(O[1]),g:Number(O[2]),b:Number(O[3]),a:O[4]?Number(O[4]):1}:null},A=(v,O)=>{const W=b(v);if(!W)return v;const q=ne=>Math.max(0,Math.min(255,Math.round(ne)));return`rgba(${q(W.r*(1-O))}, ${q(W.g*(1-O))}, ${q(W.b*(1-O))}, ${W.a})`},D=v=>{if(globalThis.window===void 0)return null;const O=document.createElement("div");O.className=v,O.style.position="absolute",O.style.visibility="hidden",O.style.pointerEvents="none",O.style.width="1px",O.style.height="1px",document.body.appendChild(O);const W=globalThis.getComputedStyle(O).backgroundColor;return O.remove(),!W||W==="transparent"||W==="rgba(0, 0, 0, 0)"?null:W},M=[50,100,200,300,400,500,600,700,800,900,950],V=v=>{const O=M.indexOf(v);return O===-1?v:M[Math.min(M.length-1,O+2)]},N=(v,O)=>{const W=Mh[v];if(!W)return null;if(typeof W=="string")return W;if(!O)return null;const q=W[O];return typeof q=="string"?q:null},T=(v,O=!1)=>{if(!v)return null;const W=O?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,q=v.match(W);return q?{colorName:q[1],shade:q[2]?Number.parseInt(q[2],10):null}:null},Y=()=>{const v=p.value;if(!v){x.value=null;return}const O=T(v),W=O==null?void 0:O.colorName,q=(O==null?void 0:O.shade)??null,ne=(W?N(W,q):null)??D(v);if(!ne){x.value=null;return}let se;const ie=T(B.value,!0),z=ie?N(ie.colorName,ie.shade??null):null;if(z)se=z;else if(W&&q){const P=V(q);se=N(W,P)??A(ne,.2)}else se=A(ne,.2);x.value={"--btn-color":ne,"--btn-color-hover":se}};n.onMounted(()=>{Y()}),n.watch([p,B],async()=>{await n.nextTick(),Y()});const R=n.computed(()=>{const v=/\bdark:bg-/.test(u.value??"");return!C.value||i.value==="outline"||v?"":x.value?"dcode-btn--fill dcode-btn--fill-hover":E.value?"":"hover:brightness-90"}),X=n.computed(()=>{if(!C.value||i.value!=="outline")return"";const v=["dcode-btn--outline","dcode-btn--outline-hover"];return w.value||v.push("border"),!x.value&&!E.value&&v.push("hover:brightness-90"),v.join(" ")}),$=n.computed(()=>x.value??void 0),Q={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"}},L={"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"}},H=n.computed(()=>{const v=[],O=l.value,W=String(o.borderColor||"").toLowerCase(),q=O?Q[O]:null,ne=O?L[O]:null,se=W?Q[W]:null;return O&&(q?se&&W!==O?(v.push(q.bg,se.hoverBg),o.textColor||v.push(q.text,se.hoverText)):(v.push(q.bg,q.hoverBg),o.textColor||v.push(q.text,q.hoverText)):ne?(v.push(ne.bg,ne.hover),o.textColor||v.push(ne.text)):O==="transparent"?se?(v.push("bg-transparent",se.hoverBg),o.textColor||v.push("text-inherit",se.hoverText)):v.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):v.push(O)),W?se?v.push(se.border,se.hoverBorder):v.push(W):q&&i.value!=="ghost"&&i.value!=="link"&&v.push(q.border,q.hoverBorder),o.textColor&&v.push(o.textColor),v.join(" ")}),J=n.computed(()=>Se(vh,g.value,y.value,_.value,R.value,X.value,H.value));return(v,O)=>s.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.skeleton?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(k.value),"aria-hidden":"true"},null,2)):(n.openBlock(),n.createBlock(n.unref(Ii),{key:1,"delay-duration":0},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createBlock(n.unref(Fi),{key:0},{default:n.withCtx(()=>[n.createVNode(n.unref(Li),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(Et),n.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:J.value,style:$.value},d.value),{default:n.withCtx(()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),n.createVNode(n.unref(Ri),{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:n.withCtx(()=>[n.createElementVNode("span",Nh,n.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(n.openBlock(),n.createBlock(n.unref(Et),n.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:J.value,style:$.value},d.value),{default:n.withCtx(()=>[n.renderSlot(v.$slots,"default",{},()=>[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:"h-[18px] w-[18px]"})):n.createCommentVNode("",!0),o.text?(n.openBlock(),n.createElementBlock("span",{key:1,class:n.normalizeClass(a.value?"ml-1":"")},n.toDisplayString(o.text),3)):n.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):n.createCommentVNode("",!0)}}),ht=(e,t)=>{const o=e.__vccOpts||e;for(const[a,r]of t)o[a]=r;return o},Ue=ht(Ph,[["__scopeId","data-v-d4cd902d"]]),Th={key:0,class:"flex items-center justify-between bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30 px-4 py-3"},Oh={class:"flex flex-col gap-1"},zh={key:0,class:"text-sm font-semibold text-white leading-tight"},Fh={key:1,class:"text-xs text-primary-100 dark:text-primary-200"},Rh={key:0,class:"flex items-center gap-2"},Ih={name:"DCodeCard"},$i=n.defineComponent({...Ih,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(e){const t=e,o=n.computed(()=>{switch(t.level){case 2:return"bg-neutral-50 dark:bg-neutral-800";case 3:return"bg-neutral-100 dark:bg-neutral-700";case 1:default:return"bg-white dark:bg-neutral-900"}});return(a,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":e.shadow},{"border-transparent":!e.border},{"border-neutral-200 dark:border-neutral-800":e.border&&e.level===1},{"border-neutral-300 dark:border-neutral-700":e.border&&e.level!==1},"overflow-hidden"]])},[e.title||a.$slots.header||a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Th,[n.createElementVNode("div",Oh,[n.renderSlot(a.$slots,"header",{},()=>[e.title?(n.openBlock(),n.createElementBlock("h3",zh,n.toDisplayString(e.title),1)):n.createCommentVNode("",!0),e.subtitle?(n.openBlock(),n.createElementBlock("p",Fh,n.toDisplayString(e.subtitle),1)):n.createCommentVNode("",!0)])]),a.$slots.actions?(n.openBlock(),n.createElementBlock("div",Rh,[n.renderSlot(a.$slots,"actions")])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["relative z-10",e.padding])},[n.renderSlot(a.$slots,"default")],2),a.$slots.footer?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800",e.padding])},[n.renderSlot(a.$slots,"footer")],2)):n.createCommentVNode("",!0)],2))}});/*!
1
+ (function(he,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):(he=typeof globalThis<"u"?globalThis:he||self,e(he.DynamicUI={},he.Vue,he.LucideIcons,he.rekaUi,he.core,he.VueI18n,he.VueDatePicker,he.Uppy,he.UppyDashboard,he.UppyImageEditor,he.VueRouter,he.Vue3Lottie))})(this,(function(he,e,ce,we,Qe,Vt,du,uu,Js,fu,_n,hu){"use strict";var SA=Object.defineProperty;var AA=(he,e,ce)=>e in he?SA(he,e,{enumerable:!0,configurable:!0,writable:!0,value:ce}):he[e]=ce;var ye=(he,e,ce)=>AA(he,typeof e!="symbol"?e+"":e,ce);var sa;function mu(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 Tt=mu(ce);let Ot={};function Qs(t){Ot={...Ot,...t}}function pu(){return Ot}function gu(){return Ot.apiBaseUrl?Ot.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function bu(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Ot.getAuthToken?n=Ot.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}`),Ot.getHeaders){const o=Ot.getHeaders();return{...t,...o}}return t}function yu(){Ot.onUnauthorized&&Ot.onUnauthorized()}async function Zs(t,n,o,r){const a=pu();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=gu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{...bu(),...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 g=new URLSearchParams;Object.entries(o).forEach(([x,p])=>{p!=null&&g.append(x,String(p))});const b=g.toString();b&&(f=`${d}${d.includes("?")?"&":"?"}${b}`)}const h=await fetch(f,u);if(h.status===401&&yu(),!h.ok){const g=await h.text();throw new Error(`HTTP ${h.status}: ${g}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function ot(){return{apiUrl:(o,r,a,s)=>Zs(o,r,a,s),DCodeApi:(o,r,a,s)=>{let i=o,l=r,c=a;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&r&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(r.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${r}`,l="POST")),Zs(i,l,c,s==null?void 0:s.headers)}}}const Un=Math.min,xt=Math.max,Go=Math.round,Xo=Math.floor,$t=t=>({x:t,y:t}),xu={left:"right",right:"left",bottom:"top",top:"bottom"};function ei(t,n,o){return xt(t,Un(n,o))}function ho(t,n){return typeof t=="function"?t(n):t}function dn(t){return t.split("-")[0]}function mo(t){return t.split("-")[1]}function ti(t){return t==="x"?"y":"x"}function ni(t){return t==="y"?"height":"width"}function Jt(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function oi(t){return ti(Jt(t))}function ku(t,n,o){o===void 0&&(o=!1);const r=mo(t),a=oi(t),s=ni(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=Ko(i)),[i,Ko(i)]}function wu(t){const n=Ko(t);return[ua(t),n,ua(n)]}function ua(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ri=["left","right"],ai=["right","left"],Cu=["top","bottom"],Eu=["bottom","top"];function Bu(t,n,o){switch(t){case"top":case"bottom":return o?n?ai:ri:n?ri:ai;case"left":case"right":return n?Cu:Eu;default:return[]}}function _u(t,n,o,r){const a=mo(t);let s=Bu(dn(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(ua)))),s}function Ko(t){const n=dn(t);return xu[n]+t.slice(n.length)}function Su(t){return{top:0,right:0,bottom:0,left:0,...t}}function Au(t){return typeof t!="number"?Su(t):{top:t,right:t,bottom:t,left:t}}function Yo(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 si(t,n,o){let{reference:r,floating:a}=t;const s=Jt(n),i=oi(n),l=ni(i),c=dn(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-a.width,y:f};break;default:m={x:r.x,y:r.y}}switch(mo(n)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function Vu(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:h=!1,padding:m=0}=ho(n,t),g=Au(m),x=l[h?f==="floating"?"reference":"floating":f],p=Yo(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(x)))==null||o?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),E=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),w=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},_=Yo(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:C,strategy:c}):E);return{top:(p.top-_.top+g.top)/w.y,bottom:(_.bottom-p.bottom+g.bottom)/w.y,left:(p.left-_.left+g.left)/w.x,right:(_.right-p.right+g.right)/w.x}}const Du=50,Nu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:Vu},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}=si(d,r,c),h=r,m=0;const g={};for(let b=0;b<s.length;b++){const x=s[b];if(!x)continue;const{name:p,fn:E}=x,{x:C,y:w,data:_,reset:B}=await E({x:u,y:f,initialPlacement:r,placement:h,strategy:a,middlewareData:g,rects:d,platform:l,elements:{reference:t,floating:n}});u=C??u,f=w??f,g[p]={...g[p],..._},B&&m<Du&&(m++,typeof B=="object"&&(B.placement&&(h=B.placement),B.rects&&(d=B.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):B.rects),{x:u,y:f}=si(d,h,c)),b=-1)}return{x:u,y:f,placement:h,strategy:a,middlewareData:g}},Mu=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:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...x}=ho(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=dn(a),E=Jt(l),C=dn(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=h||(C||!b?[Ko(l)]:wu(l)),B=g!=="none";!h&&B&&_.push(..._u(l,b,g,w));const k=[l,..._],y=await c.detectOverflow(n,x),V=[];let N=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&V.push(y[p]),f){const P=ku(a,i,w);V.push(y[P[0]],y[P[1]])}if(N=[...N,{placement:a,overflows:V}],!V.every(P=>P<=0)){var M,D;const P=(((M=s.flip)==null?void 0:M.index)||0)+1,H=k[P];if(H&&(!(f==="alignment"?E!==Jt(H):!1)||N.every(ee=>Jt(ee.placement)===E?ee.overflows[0]>0:!0)))return{data:{index:P,overflows:N},reset:{placement:H}};let $=(D=N.filter(q=>q.overflows[0]<=0).sort((q,ee)=>q.overflows[1]-ee.overflows[1])[0])==null?void 0:D.placement;if(!$)switch(m){case"bestFit":{var v;const q=(v=N.filter(ee=>{if(B){const G=Jt(ee.placement);return G===E||G==="y"}return!0}).map(ee=>[ee.placement,ee.overflows.filter(G=>G>0).reduce((G,L)=>G+L,0)]).sort((ee,G)=>ee[1]-G[1])[0])==null?void 0:v[0];q&&($=q);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}},vu=new Set(["left","top"]);async function Pu(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=dn(o),l=mo(o),c=Jt(o)==="y",d=vu.has(i)?-1:1,u=s&&c?-1:1,f=ho(n,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const Tu=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 Pu(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}}}}},Ou=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:E,y:C}=p;return{x:E,y:C}}},...d}=ho(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),h=Jt(dn(a)),m=ti(h);let g=u[m],b=u[h];if(i){const p=m==="y"?"top":"left",E=m==="y"?"bottom":"right",C=g+f[p],w=g-f[E];g=ei(C,g,w)}if(l){const p=h==="y"?"top":"left",E=h==="y"?"bottom":"right",C=b+f[p],w=b-f[E];b=ei(C,b,w)}const x=c.fn({...n,[m]:g,[h]:b});return{...x,data:{x:x.x-o,y:x.y-r,enabled:{[m]:i,[h]:l}}}}}},Fu=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}=ho(t,n),u=await i.detectOverflow(n,d),f=dn(a),h=mo(a),m=Jt(a)==="y",{width:g,height:b}=s.floating;let x,p;f==="top"||f==="bottom"?(x=f,p=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,x=h==="end"?"top":"bottom");const E=b-u.top-u.bottom,C=g-u.left-u.right,w=Un(b-u[x],E),_=Un(g-u[p],C),B=!n.middlewareData.shift;let k=w,y=_;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(y=C),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(k=E),B&&!h){const N=xt(u.left,0),M=xt(u.right,0),D=xt(u.top,0),v=xt(u.bottom,0);m?y=g-2*(N!==0||M!==0?N+M:xt(u.left,u.right)):k=b-2*(D!==0||v!==0?D+v:xt(u.top,u.bottom))}await c({...n,availableWidth:y,availableHeight:k});const V=await i.getDimensions(l.floating);return g!==V.width||b!==V.height?{reset:{rects:!0}}:{}}}};function Jo(){return typeof window<"u"}function Sn(t){return fa(t)?(t.nodeName||"").toLowerCase():"#document"}function kt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function jt(t){var n;return(n=(fa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function fa(t){return Jo()?t instanceof Node||t instanceof kt(t).Node:!1}function Ft(t){return Jo()?t instanceof Element||t instanceof kt(t).Element:!1}function Qt(t){return Jo()?t instanceof HTMLElement||t instanceof kt(t).HTMLElement:!1}function ii(t){return!Jo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof kt(t).ShadowRoot}function po(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=zt(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function zu(t){return/^(table|td|th)$/.test(Sn(t))}function Qo(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Iu=/transform|translate|scale|rotate|perspective|filter/,Ru=/paint|layout|strict|content/,An=t=>!!t&&t!=="none";let ha;function ma(t){const n=Ft(t)?zt(t):t;return An(n.transform)||An(n.translate)||An(n.scale)||An(n.rotate)||An(n.perspective)||!pa()&&(An(n.backdropFilter)||An(n.filter))||Iu.test(n.willChange||"")||Ru.test(n.contain||"")}function Lu(t){let n=un(t);for(;Qt(n)&&!Hn(n);){if(ma(n))return n;if(Qo(n))return null;n=un(n)}return null}function pa(){return ha==null&&(ha=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ha}function Hn(t){return/^(html|body|#document)$/.test(Sn(t))}function zt(t){return kt(t).getComputedStyle(t)}function Zo(t){return Ft(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function un(t){if(Sn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||ii(t)&&t.host||jt(t);return ii(n)?n.host:n}function li(t){const n=un(t);return Hn(n)?t.ownerDocument?t.ownerDocument.body:t.body:Qt(n)&&po(n)?n:li(n)}function go(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=li(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=kt(a);if(s){const l=ga(i);return n.concat(i,i.visualViewport||[],po(a)?a:[],l&&o?go(l):[])}else return n.concat(a,go(a,[],o))}function ga(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ci(t){const n=zt(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=Qt(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=Go(o)!==s||Go(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function ba(t){return Ft(t)?t:t.contextElement}function qn(t){const n=ba(t);if(!Qt(n))return $t(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=ci(n);let i=(s?Go(o.width):o.width)/r,l=(s?Go(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const $u=$t(0);function di(t){const n=kt(t);return!pa()||!n.visualViewport?$u:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function ju(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==kt(t)?!1:n}function Vn(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=ba(t);let i=$t(1);n&&(r?Ft(r)&&(i=qn(r)):i=qn(t));const l=ju(s,o,r)?di(s):$t(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 h=kt(s),m=r&&Ft(r)?kt(r):r;let g=h,b=ga(g);for(;b&&r&&m!==g;){const x=qn(b),p=b.getBoundingClientRect(),E=zt(b),C=p.left+(b.clientLeft+parseFloat(E.paddingLeft))*x.x,w=p.top+(b.clientTop+parseFloat(E.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,f*=x.y,c+=C,d+=w,g=kt(b),b=ga(g)}}return Yo({width:u,height:f,x:c,y:d})}function er(t,n){const o=Zo(t).scrollLeft;return n?n.left+o:Vn(jt(t)).left+o}function ui(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-er(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Wu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=jt(r),l=n?Qo(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=$t(1);const u=$t(0),f=Qt(r);if((f||!f&&!s)&&((Sn(r)!=="body"||po(i))&&(c=Zo(r)),f)){const m=Vn(r);d=qn(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const h=i&&!f&&!s?ui(i,c):$t(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:o.y*d.y-c.scrollTop*d.y+u.y+h.y}}function Uu(t){return Array.from(t.getClientRects())}function Hu(t){const n=jt(t),o=Zo(t),r=t.ownerDocument.body,a=xt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=xt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+er(t);const l=-o.scrollTop;return zt(r).direction==="rtl"&&(i+=xt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const fi=25;function qu(t,n){const o=kt(t),r=jt(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=pa();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=er(r);if(d<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=fi&&(s-=g)}else d<=fi&&(s+=d);return{width:s,height:i,x:l,y:c}}function Gu(t,n){const o=Vn(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=Qt(t)?qn(t):$t(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 hi(t,n,o){let r;if(n==="viewport")r=qu(t,o);else if(n==="document")r=Hu(jt(t));else if(Ft(n))r=Gu(n,o);else{const a=di(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return Yo(r)}function mi(t,n){const o=un(t);return o===n||!Ft(o)||Hn(o)?!1:zt(o).position==="fixed"||mi(o,n)}function Xu(t,n){const o=n.get(t);if(o)return o;let r=go(t,[],!1).filter(l=>Ft(l)&&Sn(l)!=="body"),a=null;const s=zt(t).position==="fixed";let i=s?un(t):t;for(;Ft(i)&&!Hn(i);){const l=zt(i),c=ma(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||po(i)&&!c&&mi(t,i))?r=r.filter(u=>u!==i):a=l,i=un(i)}return n.set(t,r),r}function Ku(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?Qo(n)?[]:Xu(n,this._c):[].concat(o),r],l=hi(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const m=hi(n,i[h],a);c=xt(m.top,c),d=Un(m.right,d),u=Un(m.bottom,u),f=xt(m.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function Yu(t){const{width:n,height:o}=ci(t);return{width:n,height:o}}function Ju(t,n,o){const r=Qt(n),a=jt(n),s=o==="fixed",i=Vn(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=$t(0);function d(){c.x=er(a)}if(r||!r&&!s)if((Sn(n)!=="body"||po(a))&&(l=Zo(n)),r){const m=Vn(n,!0,s,n);c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?ui(a,l):$t(0),f=i.left+l.scrollLeft-c.x-u.x,h=i.top+l.scrollTop-c.y-u.y;return{x:f,y:h,width:i.width,height:i.height}}function ya(t){return zt(t).position==="static"}function pi(t,n){if(!Qt(t)||zt(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return jt(t)===o&&(o=o.ownerDocument.body),o}function gi(t,n){const o=kt(t);if(Qo(t))return o;if(!Qt(t)){let a=un(t);for(;a&&!Hn(a);){if(Ft(a)&&!ya(a))return a;a=un(a)}return o}let r=pi(t,n);for(;r&&zu(r)&&ya(r);)r=pi(r,n);return r&&Hn(r)&&ya(r)&&!ma(r)?o:r||Lu(t)||o}const Qu=async function(t){const n=this.getOffsetParent||gi,o=this.getDimensions,r=await o(t.floating);return{reference:Ju(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Zu(t){return zt(t).direction==="rtl"}const ef={convertOffsetParentRelativeRectToViewportRelativeRect:Wu,getDocumentElement:jt,getClippingRect:Ku,getOffsetParent:gi,getElementRects:Qu,getClientRects:Uu,getDimensions:Yu,getScale:qn,isElement:Ft,isRTL:Zu};function bi(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function tf(t,n){let o=null,r;const a=jt(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:h,height:m}=d;if(l||n(),!h||!m)return;const g=Xo(f),b=Xo(a.clientWidth-(u+h)),x=Xo(a.clientHeight-(f+m)),p=Xo(u),C={rootMargin:-g+"px "+-b+"px "+-x+"px "+-p+"px",threshold:xt(0,Un(1,c))||1};let w=!0;function _(B){const k=B[0].intersectionRatio;if(k!==c){if(!w)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!bi(d,t.getBoundingClientRect())&&i(),w=!1}try{o=new IntersectionObserver(_,{...C,root:a.ownerDocument})}catch{o=new IntersectionObserver(_,C)}o.observe(t)}return i(!0),s}function xa(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=ba(t),u=a||s?[...d?go(d):[],...n?go(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?tf(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[E]=p;E&&E.target===d&&m&&n&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var C;(C=m)==null||C.observe(n)})),o()}),d&&!c&&m.observe(d),n&&m.observe(n));let g,b=c?Vn(t):null;c&&x();function x(){const p=Vn(t);b&&!bi(b,p)&&o(),b=p,g=requestAnimationFrame(x)}return o(),()=>{var p;u.forEach(E=>{a&&E.removeEventListener("scroll",o),s&&E.removeEventListener("resize",o)}),f==null||f(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const ka=Tu,wa=Ou,Ca=Mu,Ea=Fu,nf=(t,n,o)=>{const r=new Map,a={platform:ef,...o},s={...a.platform,_c:r};return Nu(t,n,{...a,platform:s})};function of(t){return t!=null&&typeof t=="object"&&"$el"in t}function yi(t){if(of(t)){const n=t.$el;return fa(n)&&Sn(n)==="#comment"?null:n}return t}function bo(t){return typeof t=="function"?t():e.unref(t)}function xi(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function ki(t,n){const o=xi(t);return Math.round(n*o)/o}function Ba(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var k;return(k=bo(o.open))!=null?k:!0}),s=e.computed(()=>bo(o.middleware)),i=e.computed(()=>{var k;return(k=bo(o.placement))!=null?k:"bottom"}),l=e.computed(()=>{var k;return(k=bo(o.strategy))!=null?k:"absolute"}),c=e.computed(()=>{var k;return(k=bo(o.transform))!=null?k:!0}),d=e.computed(()=>yi(t.value)),u=e.computed(()=>yi(n.value)),f=e.ref(0),h=e.ref(0),m=e.ref(l.value),g=e.ref(i.value),b=e.shallowRef({}),x=e.ref(!1),p=e.computed(()=>{const k={position:m.value,left:"0",top:"0"};if(!u.value)return k;const y=ki(u.value,f.value),V=ki(u.value,h.value);return c.value?{...k,transform:"translate("+y+"px, "+V+"px)",...xi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:y+"px",top:V+"px"}});let E;function C(){if(d.value==null||u.value==null)return;const k=a.value;nf(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(y=>{f.value=y.x,h.value=y.y,m.value=y.strategy,g.value=y.placement,b.value=y.middlewareData,x.value=k!==!1})}function w(){typeof E=="function"&&(E(),E=void 0)}function _(){if(w(),r===void 0){C();return}if(d.value!=null&&u.value!=null){E=r(d.value,u.value,C);return}}function B(){a.value||(x.value=!1)}return e.watch([s,i,l,a],C,{flush:"sync"}),e.watch([d,u],_,{flush:"sync"}),e.watch(a,B,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(w),{x:e.shallowReadonly(f),y:e.shallowReadonly(h),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(g),middlewareData:e.shallowReadonly(b),isPositioned:e.shallowReadonly(x),floatingStyles:p,update:C}}const rf=["aria-busy"],af={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},sf=["for"],lf={key:0,class:"ml-1 text-destructive"},cf={class:"relative"},df={key:0,class:"flex items-center text-gray-500 gap-2"},uf=["id","placeholder","disabled","readonly","value"],ff={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},hf=["disabled"],mf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},pf=["onMouseenter","onClick"],gf={key:0},bf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},yf={key:0},xf={key:1},kf={key:2},wf={key:1,class:"mt-1 text-xs text-red-600"},tr=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=A=>{const F=a[A];return F===""||F===!0||F==="true"||F===1||F==="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")),h=e.computed(()=>i("readonly")),m=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),g=e.computed(()=>f.value||i("aria-required")),b=e.computed(()=>o.error||o.errorMessage||a["error-message"]),x=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const A=a.minChars??a["min-chars"];if(A==null||A==="")return 0;const F=typeof A=="number"?A:Number.parseInt(String(A),10);return Number.isFinite(F)&&F>0?F:0}),E=e.computed(()=>{const A=a.rules;return Array.isArray(A)?A:[]}),C=e.computed(()=>{const A=a.id||a.label;return A?`app-autocomplete-${A}-${Math.random().toString(36).slice(2,7)}`:void 0}),w=e.ref(o.modelValue),_=e.ref([]),B=e.ref(!1),k=e.ref(!1),y=e.computed(()=>a.items),V=e.computed(()=>{const A=P.value;return A.apiModule&&A.apiAction||A.apiUrl||o.fetchItems?_.value:y.value??[]}),N=e.computed(()=>!!a.loading),M=e.computed(()=>N.value||B.value),D=e.computed(()=>{const{label:A,items:F,loading:X,rules:ie,"item-title":se,"item-value":T,itemTitle:Y,itemValue:ne,minChars:de,"min-chars":fe,clearable:Ve,required:Fe,"aria-required":nt,disabled:xe,readonly:at,visible:Xe,"return-object":Ne,returnObject:gt,class:Bt,"fetch-items":_t,fetchItems:Lt,error:Ze,errorMessage:Bn,"error-message":qo,...Wn}=a||{};return Wn}),v=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},P=e.computed(()=>{const A=o.endpoint||{};return{apiModule:o.apiModule||A.apiModule,apiAction:o.apiAction||A.apiAction,apiUrl:A.apiUrl,apiMethod:A.apiMethod||"GET"}}),H=e.ref(null),$=e.ref(null),q=e.ref(null),{floatingStyles:ee}=Ba($,q,{placement:"bottom-start",whileElementsMounted:xa,middleware:[ka(4),Ca(),wa(),Ea({apply({rects:A,elements:F,availableHeight:X}){Object.assign(F.floating.style,{width:`${A.reference.width}px`,maxHeight:`${X}px`})}})]}),G=e.ref(!1),L=e.ref(""),W=e.ref(-1),ae=e.ref(null),Z=e.computed(()=>!p.value||(L.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),J=A=>{if(A==null)return"";if(typeof A=="string"||typeof A=="number")return String(A);const F=c.value;return typeof F=="function"?F(A):(A==null?void 0:A[F])??(A==null?void 0:A.name)??(A==null?void 0:A.nama)??(A==null?void 0:A.label)??(A==null?void 0:A.title)??"-"},le=A=>{if(A==null)return null;if(typeof A=="string"||typeof A=="number")return A;const F=d.value;return typeof F=="function"?F(A):(A==null?void 0:A[F])??(A==null?void 0:A.id)??(A==null?void 0:A.value)??(A==null?void 0:A.code)??null},ue=e.computed(()=>{const A=w.value;if(A==null||A==="")return"";if(Array.isArray(A))return A.length?A.map(ie=>{if(m.value&&typeof ie=="object"||typeof ie=="object")return J(ie);const se=V.value.find(T=>le(T)==ie);return se?J(se):String(ie)}).join(", "):"";if(typeof A=="object")return J(A);const F=V.value.find(X=>le(X)==A);return F?J(F):String(A)}),Ce=e.computed(()=>{const A=V.value||[],F=(L.value||"").trim().toLowerCase(),X=(ue.value||"").toLowerCase(),ie=!F||F===X;let se=A;if(ie||(se=A.filter(T=>J(T).toLowerCase().includes(F))),se.length>0){const T=Y=>{const ne=le(Y);return Array.isArray(w.value)?w.value.some(de=>de==ne):w.value==ne};se=[...se].sort((Y,ne)=>{const de=T(Y),fe=T(ne);return de&&!fe?-1:!de&&fe?1:0})}return se}),_e=A=>Array.isArray(A)?A.length===0:A==null||A==="",me=A=>{if(ae.value=null,f.value&&_e(A)&&!E.value.length)return ae.value="This field is required",!1;for(const F of E.value){const X=F(A);if(X===!1)return ae.value="Invalid value",!1;if(typeof X=="string")return ae.value=X,!1}return!0},Q=async()=>{if(u.value||h.value)return;G.value=!0,W.value=Ce.value.length?0:-1,L.value=ue.value||"";const A=P.value,F=A.apiModule&&A.apiAction||A.apiUrl||o.fetchItems;o.autoFetchOnOpen&&F&&!k.value&&(await $e(),W.value=Ce.value.length?0:-1)},O=()=>{G.value=!1,W.value=-1,L.value=ue.value||""},K=A=>{const F=m.value?A:le(A);let X=F;Array.isArray(w.value)&&(X=[F]),w.value=X,r("update:modelValue",X),ae.value=null,me(X),L.value=J(A),O()},re=()=>{_.value=[],k.value=!1,w.value=Array.isArray(w.value)?[]:null,r("update:modelValue",w.value),L.value="",ae.value=null},be=()=>{l.value=!0,re(),O(),setTimeout(()=>{l.value=!1},0)},Be=A=>{if(u.value||h.value)return;const F=A.target.value;L.value=F,ae.value&&(ae.value=null),G.value||(G.value=!0),W.value=Ce.value.length?0:-1;const X=P.value.apiModule&&P.value.apiAction||P.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&X&&!M.value&&!k.value&&$e()},Ie=A=>{var X;if(u.value||h.value)return;const F={ArrowDown:()=>{if(A.preventDefault(),!G.value){Q();return}Ce.value.length&&(W.value=Math.min(W.value+1,Ce.value.length-1))},ArrowUp:()=>{!G.value||!Ce.value.length||(A.preventDefault(),W.value=Math.max(W.value-1,0))},Enter:()=>{if(!G.value)return;A.preventDefault();const ie=Ce.value[W.value];ie&&K(ie)},Escape:()=>{A.preventDefault(),O()},Tab:()=>{O()}};(X=F[A.key])==null||X.call(F)},$e=async()=>{const A=P.value;if(A.apiModule&&A.apiAction||A.apiUrl||o.fetchItems){B.value=!0;try{let X;if(o.fetchItems){const ie=v()||{},se={page:1,perPage:100,search:(L.value||"").trim(),...ie,...o.apiParams},T=await o.fetchItems(se),Y=(T==null?void 0:T.data)??T;X=(Y==null?void 0:Y.data)??Y}else{const se=ot().DCodeApi;if(typeof se!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const Y={page:1,perPage:100,...v()||{},...o.apiParams};let ne;A.apiUrl?ne=await se("","",Y,{_url:A.apiUrl,_method:A.apiMethod||"POST"}):ne=await se(A.apiModule,A.apiAction,Y);const de=(ne==null?void 0:ne.data)??ne;X=(de==null?void 0:de.data)??de}_.value=Array.isArray(X)?X:[],k.value=!0}catch(X){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",X),ae.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(X==null?void 0:X.message)||(X==null?void 0:X.toString())||"Failed to load options"}`,_.value=[],k.value=!0}finally{B.value=!1}}},Ge=A=>{const F=le(A);return m.value?w.value?Array.isArray(w.value)?w.value.some(X=>le(X)==F):le(w.value)==F:!1:Array.isArray(w.value)?w.value.some(X=>X==F):w.value==F};e.watch(()=>[v(),P.value,o.apiParams],([A,F,X],[ie,se,T])=>{const Y=P.value;if(!(Y.apiModule&&Y.apiAction||Y.apiUrl||o.fetchItems)){re();return}const de=JSON.stringify(A??null)===JSON.stringify(ie??null),fe=JSON.stringify(X??null)===JSON.stringify(T??null);de&&fe||(re(),fe||$e())},{deep:!0}),e.watch(()=>o.modelValue,(A,F)=>{w.value=A,!l.value&&(A==null||A==="")&&F!=null&&o.apiModule&&o.apiAction&&(_.value=[],k.value=!1),L.value=ue.value||""},{immediate:!0});const ve=P.value;(ve.apiModule&&ve.apiAction||ve.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!_e(o.modelValue))&&$e();const dt=A=>{const F=H.value,X=q.value,ie=A.target;F&&F.contains(ie)||X&&X.contains(ie)||G.value&&O()},R=e.computed(()=>{const A=o.modelValue;return A==null?!1:typeof A=="string"?A.trim().length>0:Array.isArray(A)?A.length>0:typeof A=="object"?Object.keys(A).length>0:!0}),U=e.computed(()=>!!o.clearable&&R.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",dt)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",dt)}),(A,F)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:H,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",af)):e.createCommentVNode("",!0),F[6]||(F[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:C.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),g.value?(e.openBlock(),e.createElementBlock("span",lf,"*")):e.createCommentVNode("",!0)],8,sf)):e.createCommentVNode("",!0),e.createElementVNode("div",cf,[e.createElementVNode("div",{ref_key:"reference",ref:$,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||h.value?"opacity-60 cursor-not-allowed":"",ae.value||b.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||A.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",df,[e.renderSlot(A.$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(D.value,{id:C.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||h.value?"cursor-not-allowed":"cursor-text"],placeholder:x.value,disabled:u.value,readonly:h.value,value:G.value?L.value:ue.value||L.value,onFocus:F[0]||(F[0]=()=>{G.value||Q()}),onClick:F[1]||(F[1]=()=>{G.value||Q()}),onInput:Be,onKeydown:Ie,onBlur:F[2]||(F[2]=()=>me(w.value))}),null,16,uf),M.value?(e.openBlock(),e.createElementBlock("svg",ff,[...F[7]||(F[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)])])):U.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:F[3]||(F[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(be,["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||h.value,onClick:F[4]||(F[4]=X=>G.value?O():Q()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":G.value}])},null,8,["class"])],8,hf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[G.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:q,style:e.normalizeStyle(e.unref(ee)),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",mf,[Ce.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ce.value,(X,ie)=>(e.openBlock(),e.createElementBlock("button",{key:le(X)??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===W.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:se=>W.value=ie,onMousedown:F[5]||(F[5]=e.withModifiers(()=>{},["prevent"])),onClick:se=>K(X)},[e.createTextVNode(e.toDisplayString(J(X))+" ",1),Ge(X)?(e.openBlock(),e.createElementBlock("span",gf," ✓ ")):e.createCommentVNode("",!0)],42,pf))),128)):e.renderSlot(A.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",bf,[M.value?(e.openBlock(),e.createElementBlock("span",yf,"Loading data…")):Z.value?(e.openBlock(),e.createElementBlock("span",xf,e.toDisplayString(Z.value),1)):(e.openBlock(),e.createElementBlock("span",kf,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),ae.value||b.value?(e.openBlock(),e.createElementBlock("p",wf,e.toDisplayString(ae.value||b.value),1)):e.createCommentVNode("",!0)],64))],10,rf)),[[e.vShow,t.visible]])}}),Cf=["aria-busy"],Ef={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Bf=["for"],_f={key:0,class:"ml-1 text-destructive"},Sf={class:"relative"},Af={key:0,class:"flex items-center text-gray-500 gap-2"},Vf=["id","placeholder","disabled","value"],Df={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},Nf=["disabled"],Mf={key:0,class:"p-3 space-y-2"},vf=["onMouseenter","onClick"],Pf={class:"flex items-center space-x-3"},Tf={class:"flex-1"},Of={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Ff={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},zf={key:0},If={key:2,class:"p-3 text-center"},Rf={class:"inline-flex items-center space-x-2"},Lf={class:"text-sm text-gray-500"},$f={key:3,class:"p-3 text-center"},jf={class:"text-xs text-gray-400"},Wf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Uf={key:1,class:"mt-1 text-xs text-red-600"},Hf={key:2,class:"mt-1 text-xs text-gray-500"},wi=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 W=o.label||o.placeholder;return W?`app-infinite-autocomplete-${W}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),h=e.ref([]),m=e.ref(!1),g=e.ref(!1),b=e.ref(-1),x=e.ref(1),p=e.ref(!0),E=e.ref(0),C=e.ref(),{floatingStyles:w}=Ba(c,d,{placement:"bottom-start",whileElementsMounted:xa,middleware:[ka(4),Ca(),wa(),Ea({apply({rects:W,elements:ae}){Object.assign(ae.floating.style,{width:`${W.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const _=e.computed(()=>f.value?h.value.filter(W=>V(W).toLowerCase().includes(f.value.toLowerCase())):h.value),B=e.computed(()=>{if(g.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return V(o.modelValue);{const W=h.value.find(ae=>N(ae)===o.modelValue);return W?V(W):String(o.modelValue)}}return""}),k=()=>{g.value=!0},y=()=>{g.value=!1},V=W=>typeof o.itemTitle=="function"?o.itemTitle(W):W[o.itemTitle]||"",N=W=>typeof o.itemValue=="function"?o.itemValue(W):W[o.itemValue]||W,M=W=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(W):W[o.itemSubtitle]||"":"",D=W=>o.modelValue?o.returnObject?N(W)===N(o.modelValue):N(W)===o.modelValue:!1,v=W=>{var Z;const ae=o.returnObject?W:N(W);r("update:modelValue",ae),r("select",W),g.value=!1,f.value="",(Z=s.value)==null||Z.blur()},P=()=>{var W;r("update:modelValue",null),f.value="",(W=s.value)==null||W.focus()},H=W=>{g.value=!0,r("focus",W),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&L(!0)},$=W=>{setTimeout(()=>{g.value=!1,r("blur",W)},200)},q=W=>{const ae=W.target;f.value=ae.value,C.value&&clearTimeout(C.value),C.value=setTimeout(()=>{r("search",f.value),x.value=1,p.value=!0,L(!0)},o.debounceMs)},ee=W=>{if(g.value)switch(W.key){case"ArrowDown":W.preventDefault(),b.value=Math.min(b.value+1,_.value.length-1);break;case"ArrowUp":W.preventDefault(),b.value=Math.max(b.value-1,0);break;case"Enter":W.preventDefault(),b.value>=0&&_.value[b.value]&&v(_.value[b.value]);break;case"Escape":g.value=!1;break}},G=W=>{if(!p.value||m.value)return;const ae=W.target,{scrollTop:Z,scrollHeight:J,clientHeight:le}=ae;Z+le>=J-o.threshold&&L()},L=async(W=!1)=>{var ae,Z;if(!m.value){m.value=!0;try{let J=[];if(o.fetchItems)J=await o.fetchItems();else{const le=ot(),ue=((ae=o.endpoint)==null?void 0:ae.apiModule)||o.apiModule,Ce=((Z=o.endpoint)==null?void 0:Z.apiAction)||o.apiAction;if(!ue||!Ce)throw new Error("API module and action are required");const _e={page:W?1:x.value,pageSize:o.pageSize,search:f.value,...o.apiParams},me=await le.apiUrl(`/${ue}/${Ce}`,"GET",_e);J=me.data||me.items||me||[],E.value=me.total||me.totalItems||J.length}W?(h.value=J,x.value=1):(h.value.push(...J),x.value++),p.value=J.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:J,page:x.value,hasMore:p.value,total:E.value})}catch(J){console.error("Error fetching items:",J),r("error",J)}finally{m.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&L()}),e.onUnmounted(()=>{C.value&&clearTimeout(C.value)}),e.watch(()=>o.modelValue,W=>{W||(f.value="")}),(W,ae)=>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",Ef)):e.createCommentVNode("",!0),ae[3]||(ae[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",_f,"*")):e.createCommentVNode("",!0)],8,Bf)):e.createCommentVNode("",!0),e.createElementVNode("div",Sf,[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",Af,[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},W.$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:H,onBlur:$,onInput:q,onKeydown:ee}),null,16,Vf),m.value?(e.openBlock(),e.createElementBlock("svg",Df,[...ae[4]||(ae[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:ae[0]||(ae[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(P,["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:ae[1]||(ae[1]=Z=>g.value?y():k()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":g.value}])},null,8,["class"])],8,Nf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(w)),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:G},[m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Mf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,Z=>e.createElementVNode("div",{key:Z,class:"flex items-center space-x-3"},[...ae[5]||(ae[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))])):_.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(_.value,(Z,J)=>(e.openBlock(),e.createElementBlock("button",{key:N(Z)??J,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",J===b.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:le=>b.value=J,onMousedown:ae[2]||(ae[2]=e.withModifiers(()=>{},["prevent"])),onClick:le=>v(Z)},[e.renderSlot(W.$slots,"item",{item:Z,index:J},()=>[e.createElementVNode("div",Pf,[e.createElementVNode("div",Tf,[e.createElementVNode("div",Of,e.toDisplayString(V(Z)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Ff,e.toDisplayString(M(Z)),1)):e.createCommentVNode("",!0)])])]),D(Z)?(e.openBlock(),e.createElementBlock("span",zf," ✓ ")):e.createCommentVNode("",!0)],42,vf))),128)):e.createCommentVNode("",!0),m.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",If,[e.createElementVNode("div",Rf,[ae[6]||(ae[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Lf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",$f,[e.createElementVNode("div",jf,e.toDisplayString(t.endOfResultsText),1)])):!m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Wf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Uf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",Hf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,Cf)),[[e.vShow,t.visible]])}});function Ci(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=Ci(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function Ei(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=Ci(t))&&(r&&(r+=" "),r+=n);return r}const qf=(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},Gf=(t,n)=>({classGroupId:t,validator:n}),Bi=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),nr="-",_i=[],Xf="arbitrary..",Kf=t=>{const n=Jf(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Yf(i);const l=i.split(nr),c=l[0]===""&&l.length>1?1:0;return Si(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?qf(d,c):c:d||_i}return o[i]||_i}}},Si=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=Si(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(nr):t.slice(n).join(nr),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Yf=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?Xf+r:void 0})(),Jf=t=>{const{theme:n,classGroups:o}=t;return Qf(o,n)},Qf=(t,n)=>{const o=Bi();for(const r in t){const a=t[r];_a(a,o,r,n)}return o},_a=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];Zf(i,n,o,r)}},Zf=(t,n,o,r)=>{if(typeof t=="string"){eh(t,n,o);return}if(typeof t=="function"){th(t,n,o,r);return}nh(t,n,o,r)},eh=(t,n,o)=>{const r=t===""?n:Ai(n,t);r.classGroupId=o},th=(t,n,o,r)=>{if(oh(t)){_a(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(Gf(o,t))},nh=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];_a(c,Ai(n,l),o,r)}},Ai=(t,n)=>{let o=t;const r=n.split(nr),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=Bi(),o.nextPart.set(i,l)),o=l}return o},oh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,rh=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)}}},Sa="!",Vi=":",ah=[],Di=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),sh=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 b=0;b<u;b++){const x=a[b];if(i===0&&l===0){if(x===Vi){s.push(a.slice(c,b)),c=b+1;continue}if(x==="/"){d=b;continue}}x==="["?i++:x==="]"?i--:x==="("?l++:x===")"&&l--}const f=s.length===0?a:a.slice(c);let h=f,m=!1;f.endsWith(Sa)?(h=f.slice(0,-1),m=!0):f.startsWith(Sa)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return Di(s,m,h,g)};if(n){const a=n+Vi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):Di(ah,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},ih=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}},lh=t=>({cache:rh(t.cacheSize),parseClassName:sh(t),sortModifiers:ih(t),...Kf(t)}),ch=/\s+/,dh=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(ch);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:b}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let x=!!b,p=r(x?g.substring(0,b):g);if(!p){if(!x){c=u+(c.length>0?" "+c:c);continue}if(p=r(g),!p){c=u+(c.length>0?" "+c:c);continue}x=!1}const E=h.length===0?"":h.length===1?h[0]:s(h).join(":"),C=m?E+Sa:E,w=C+p;if(i.indexOf(w)>-1)continue;i.push(w);const _=a(p,x);for(let B=0;B<_.length;++B){const k=_[B];i.push(C+k)}c=u+(c.length>0?" "+c:c)}return c},uh=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=Ni(o))&&(a&&(a+=" "),a+=r);return a},Ni=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=Ni(t[r]))&&(o&&(o+=" "),o+=n);return o},fh=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=lh(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=dh(c,o);return a(c,u),u};return s=i,(...c)=>s(uh(...c))},hh=[],st=t=>{const n=o=>o[t]||hh;return n.isThemeGetter=!0,n},Mi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,vi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,mh=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ph=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,gh=/\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$/,bh=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,yh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xh=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,fn=t=>mh.test(t),Me=t=>!!t&&!Number.isNaN(Number(t)),hn=t=>!!t&&Number.isInteger(Number(t)),Aa=t=>t.endsWith("%")&&Me(t.slice(0,-1)),Zt=t=>ph.test(t),Pi=()=>!0,kh=t=>gh.test(t)&&!bh.test(t),Va=()=>!1,wh=t=>yh.test(t),Ch=t=>xh.test(t),Eh=t=>!pe(t)&&!ge(t),Bh=t=>mn(t,Ri,Va),pe=t=>Mi.test(t),Dn=t=>mn(t,Li,kh),Ti=t=>mn(t,vh,Me),_h=t=>mn(t,ji,Pi),Sh=t=>mn(t,$i,Va),Oi=t=>mn(t,zi,Va),Ah=t=>mn(t,Ii,Ch),or=t=>mn(t,Wi,wh),ge=t=>vi.test(t),yo=t=>Nn(t,Li),Vh=t=>Nn(t,$i),Fi=t=>Nn(t,zi),Dh=t=>Nn(t,Ri),Nh=t=>Nn(t,Ii),rr=t=>Nn(t,Wi,!0),Mh=t=>Nn(t,ji,!0),mn=(t,n,o)=>{const r=Mi.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},Nn=(t,n,o=!1)=>{const r=vi.exec(t);return r?r[1]?n(r[1]):o:!1},zi=t=>t==="position"||t==="percentage",Ii=t=>t==="image"||t==="url",Ri=t=>t==="length"||t==="size"||t==="bg-size",Li=t=>t==="length",vh=t=>t==="number",$i=t=>t==="family-name",ji=t=>t==="number"||t==="weight",Wi=t=>t==="shadow",Ph=fh(()=>{const t=st("color"),n=st("font"),o=st("text"),r=st("font-weight"),a=st("tracking"),s=st("leading"),i=st("breakpoint"),l=st("container"),c=st("spacing"),d=st("radius"),u=st("shadow"),f=st("inset-shadow"),h=st("text-shadow"),m=st("drop-shadow"),g=st("blur"),b=st("perspective"),x=st("aspect"),p=st("ease"),E=st("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...w(),ge,pe],B=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],y=()=>[ge,pe,c],V=()=>[fn,"full","auto",...y()],N=()=>[hn,"none","subgrid",ge,pe],M=()=>["auto",{span:["full",hn,ge,pe]},hn,ge,pe],D=()=>[hn,"auto",ge,pe],v=()=>["auto","min","max","fr",ge,pe],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...y()],q=()=>[fn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],ee=()=>[fn,"screen","full","dvw","lvw","svw","min","max","fit",...y()],G=()=>[fn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...y()],L=()=>[t,ge,pe],W=()=>[...w(),Fi,Oi,{position:[ge,pe]}],ae=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",Dh,Bh,{size:[ge,pe]}],J=()=>[Aa,yo,Dn],le=()=>["","none","full",d,ge,pe],ue=()=>["",Me,yo,Dn],Ce=()=>["solid","dashed","dotted","double"],_e=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[Me,Aa,Fi,Oi],Q=()=>["","none",g,ge,pe],O=()=>["none",Me,ge,pe],K=()=>["none",Me,ge,pe],re=()=>[Me,ge,pe],be=()=>[fn,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zt],breakpoint:[Zt],color:[Pi],container:[Zt],"drop-shadow":[Zt],ease:["in","out","in-out"],font:[Eh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zt],shadow:[Zt],spacing:["px",Me],text:[Zt],"text-shadow":[Zt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",fn,pe,ge,x]}],container:["container"],columns:[{columns:[Me,pe,ge,l]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"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:_()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[hn,"auto",ge,pe]}],basis:[{basis:[fn,"full","auto",l,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,fn,"auto","initial","none",pe]}],grow:[{grow:["",Me,ge,pe]}],shrink:[{shrink:["",Me,ge,pe]}],order:[{order:[hn,"first","last","none",ge,pe]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:M()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:M()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":v()}],"auto-rows":[{"auto-rows":v()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pbs:[{pbs:y()}],pbe:[{pbe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],"inline-size":[{inline:["auto",...ee()]}],"min-inline-size":[{"min-inline":["auto",...ee()]}],"max-inline-size":[{"max-inline":["none",...ee()]}],"block-size":[{block:["auto",...G()]}],"min-block-size":[{"min-block":["auto",...G()]}],"max-block-size":[{"max-block":["none",...G()]}],w:[{w:[l,"screen",...q()]}],"min-w":[{"min-w":[l,"screen","none",...q()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",o,yo,Dn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Mh,_h]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Aa,pe]}],"font-family":[{font:[Vh,Sh,n]}],"font-features":[{"font-features":[pe]}],"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,ge,pe]}],"line-clamp":[{"line-clamp":[Me,"none",ge,Ti]}],leading:[{leading:[s,...y()]}],"list-image":[{"list-image":["none",ge,pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ge,pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:L()}],"text-color":[{text:L()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",ge,Dn]}],"text-decoration-color":[{decoration:L()}],"underline-offset":[{"underline-offset":[Me,"auto",ge,pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ge,pe]}],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",ge,pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:ae()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hn,ge,pe],radial:["",ge,pe],conic:[hn,ge,pe]},Nh,Ah]}],"bg-color":[{bg:L()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:L()}],"gradient-via":[{via:L()}],"gradient-to":[{to:L()}],rounded:[{rounded:le()}],"rounded-s":[{"rounded-s":le()}],"rounded-e":[{"rounded-e":le()}],"rounded-t":[{"rounded-t":le()}],"rounded-r":[{"rounded-r":le()}],"rounded-b":[{"rounded-b":le()}],"rounded-l":[{"rounded-l":le()}],"rounded-ss":[{"rounded-ss":le()}],"rounded-se":[{"rounded-se":le()}],"rounded-ee":[{"rounded-ee":le()}],"rounded-es":[{"rounded-es":le()}],"rounded-tl":[{"rounded-tl":le()}],"rounded-tr":[{"rounded-tr":le()}],"rounded-br":[{"rounded-br":le()}],"rounded-bl":[{"rounded-bl":le()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:L()}],"border-color-x":[{"border-x":L()}],"border-color-y":[{"border-y":L()}],"border-color-s":[{"border-s":L()}],"border-color-e":[{"border-e":L()}],"border-color-bs":[{"border-bs":L()}],"border-color-be":[{"border-be":L()}],"border-color-t":[{"border-t":L()}],"border-color-r":[{"border-r":L()}],"border-color-b":[{"border-b":L()}],"border-color-l":[{"border-l":L()}],"divide-color":[{divide:L()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Me,ge,pe]}],"outline-w":[{outline:["",Me,yo,Dn]}],"outline-color":[{outline:L()}],shadow:[{shadow:["","none",u,rr,or]}],"shadow-color":[{shadow:L()}],"inset-shadow":[{"inset-shadow":["none",f,rr,or]}],"inset-shadow-color":[{"inset-shadow":L()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:L()}],"ring-offset-w":[{"ring-offset":[Me,Dn]}],"ring-offset-color":[{"ring-offset":L()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":L()}],"text-shadow":[{"text-shadow":["none",h,rr,or]}],"text-shadow-color":[{"text-shadow":L()}],opacity:[{opacity:[Me,ge,pe]}],"mix-blend":[{"mix-blend":[..._e(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":_e()}],"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":[Me]}],"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":L()}],"mask-image-linear-to-color":[{"mask-linear-to":L()}],"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":L()}],"mask-image-t-to-color":[{"mask-t-to":L()}],"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":L()}],"mask-image-r-to-color":[{"mask-r-to":L()}],"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":L()}],"mask-image-b-to-color":[{"mask-b-to":L()}],"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":L()}],"mask-image-l-to-color":[{"mask-l-to":L()}],"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":L()}],"mask-image-x-to-color":[{"mask-x-to":L()}],"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":L()}],"mask-image-y-to-color":[{"mask-y-to":L()}],"mask-image-radial":[{"mask-radial":[ge,pe]}],"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":L()}],"mask-image-radial-to-color":[{"mask-radial-to":L()}],"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":w()}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"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":L()}],"mask-image-conic-to-color":[{"mask-conic-to":L()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:ae()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ge,pe]}],filter:[{filter:["","none",ge,pe]}],blur:[{blur:Q()}],brightness:[{brightness:[Me,ge,pe]}],contrast:[{contrast:[Me,ge,pe]}],"drop-shadow":[{"drop-shadow":["","none",m,rr,or]}],"drop-shadow-color":[{"drop-shadow":L()}],grayscale:[{grayscale:["",Me,ge,pe]}],"hue-rotate":[{"hue-rotate":[Me,ge,pe]}],invert:[{invert:["",Me,ge,pe]}],saturate:[{saturate:[Me,ge,pe]}],sepia:[{sepia:["",Me,ge,pe]}],"backdrop-filter":[{"backdrop-filter":["","none",ge,pe]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[Me,ge,pe]}],"backdrop-contrast":[{"backdrop-contrast":[Me,ge,pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,ge,pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,ge,pe]}],"backdrop-invert":[{"backdrop-invert":["",Me,ge,pe]}],"backdrop-opacity":[{"backdrop-opacity":[Me,ge,pe]}],"backdrop-saturate":[{"backdrop-saturate":[Me,ge,pe]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,ge,pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ge,pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",ge,pe]}],ease:[{ease:["linear","initial",p,ge,pe]}],delay:[{delay:[Me,ge,pe]}],animate:[{animate:["none",E,ge,pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,ge,pe]}],"perspective-origin":[{"perspective-origin":_()}],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:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[ge,pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":["translate-none"],accent:[{accent:L()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:L()}],"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",ge,pe]}],"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":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mbs":[{"scroll-mbs":y()}],"scroll-mbe":[{"scroll-mbe":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pbs":[{"scroll-pbs":y()}],"scroll-pbe":[{"scroll-pbe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"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",ge,pe]}],fill:[{fill:["none",...L()]}],"stroke-w":[{stroke:[Me,yo,Dn,Ti]}],stroke:[{stroke:["none",...L()]}],"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 Pe(...t){return Ph(Ei(t))}function Ui(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Da={},Na={},ar={exports:{}},Hi;function Th(){if(Hi)return ar.exports;Hi=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 ar.exports=n(),ar.exports.createColors=n,ar.exports}var qi;function Oh(){return qi||(qi=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(Th());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(h=>console.warn(d,"-",h)))}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])}}})(Na)),Na}var Gi;function Fh(){return Gi||(Gi=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Oh());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}}})(Da)),Da}var Ma,Xi;function zh(){if(Xi)return Ma;Xi=1;let t=Fh();return Ma=(t.__esModule?t:{default:t}).default,Ma}var Ih=zh();const Rh=Ui(Ih),Ki=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,Yi=Ei,sr=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return Yi(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 h=Ki(u)||Ki(f);return a[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(g=>{let[b,x]=g;return Array.isArray(x)?x.includes({...s,...l}[b]):{...s,...l}[b]===x})?[...d,f,h]:d},[]);return Yi(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},It=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(we.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(Pe)(e.unref(Gn)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),Gn=sr("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=we.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(we.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Qi=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=Qe.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(we.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Pe)("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}))}}),Zi=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(we.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),el=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Lh={class:"relative z-10"},$h="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",jh=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(()=>o.icon&&Tt[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const Z=String(o.variant||"default").toLowerCase();return Z==="tonal"?"secondary":Z==="elevated"?"default":Z}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:Z,...J}=n;return J}),u=e.computed(()=>Pe(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),g=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}`:""),b=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"),x=e.computed(()=>Pe("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",g.value,h.value,m.value,f.value)),p=e.computed(()=>{const J=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return J?J[0]:null}),E=e.computed(()=>{const J=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return J?J[0]:null}),C=e.computed(()=>!!p.value),w=e.computed(()=>/\bborder-/.test(u.value??"")),_=e.computed(()=>/\bhover:/.test(u.value??"")),B=e.computed(()=>{const Z=u.value??"";return i.value!=="outline"?Z:Z.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),k=e.ref(null),y=Z=>{const J=Z.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return J?{r:Number(J[1]),g:Number(J[2]),b:Number(J[3]),a:J[4]?Number(J[4]):1}:null},V=(Z,J)=>{const le=y(Z);if(!le)return Z;const ue=Ce=>Math.max(0,Math.min(255,Math.round(Ce)));return`rgba(${ue(le.r*(1-J))}, ${ue(le.g*(1-J))}, ${ue(le.b*(1-J))}, ${le.a})`},N=Z=>{if(globalThis.window===void 0)return null;const J=document.createElement("div");J.className=Z,J.style.position="absolute",J.style.visibility="hidden",J.style.pointerEvents="none",J.style.width="1px",J.style.height="1px",document.body.appendChild(J);const le=globalThis.getComputedStyle(J).backgroundColor;return J.remove(),!le||le==="transparent"||le==="rgba(0, 0, 0, 0)"?null:le},M=[50,100,200,300,400,500,600,700,800,900,950],D=Z=>{const J=M.indexOf(Z);return J===-1?Z:M[Math.min(M.length-1,J+2)]},v=(Z,J)=>{const le=Rh[Z];if(!le)return null;if(typeof le=="string")return le;if(!J)return null;const ue=le[J];return typeof ue=="string"?ue:null},P=(Z,J=!1)=>{if(!Z)return null;const le=J?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ue=Z.match(le);return ue?{colorName:ue[1],shade:ue[2]?Number.parseInt(ue[2],10):null}:null},H=()=>{const Z=p.value;if(!Z){k.value=null;return}const J=P(Z),le=J==null?void 0:J.colorName,ue=(J==null?void 0:J.shade)??null,Ce=(le?v(le,ue):null)??N(Z);if(!Ce){k.value=null;return}let _e;const me=P(E.value,!0),Q=me?v(me.colorName,me.shade??null):null;if(Q)_e=Q;else if(le&&ue){const O=D(ue);_e=v(le,O)??V(Ce,.2)}else _e=V(Ce,.2);k.value={"--btn-color":Ce,"--btn-color-hover":_e}};e.onMounted(()=>{H()}),e.watch([p,E],async()=>{await e.nextTick(),H()});const $=e.computed(()=>{const Z=/\bdark:bg-/.test(u.value??"");return!C.value||i.value==="outline"||Z?"":k.value?"dcode-btn--fill dcode-btn--fill-hover":_.value?"":"hover:brightness-90"}),q=e.computed(()=>{if(!C.value||i.value!=="outline")return"";const Z=["dcode-btn--outline","dcode-btn--outline-hover"];return w.value||Z.push("border"),!k.value&&!_.value&&Z.push("hover:brightness-90"),Z.join(" ")}),ee=e.computed(()=>k.value??void 0),G={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"}},L={"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"}},W=e.computed(()=>{const Z=[],J=l.value,le=String(o.borderColor||"").toLowerCase(),ue=J?G[J]:null,Ce=J?L[J]:null,_e=le?G[le]:null;return J&&(ue?_e&&le!==J?(Z.push(ue.bg,_e.hoverBg),o.textColor||Z.push(ue.text,_e.hoverText)):(Z.push(ue.bg,ue.hoverBg),o.textColor||Z.push(ue.text,ue.hoverText)):Ce?(Z.push(Ce.bg,Ce.hover),o.textColor||Z.push(Ce.text)):J==="transparent"?_e?(Z.push("bg-transparent",_e.hoverBg),o.textColor||Z.push("text-inherit",_e.hoverText)):Z.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):Z.push(J)),le?_e?Z.push(_e.border,_e.hoverBorder):Z.push(le):ue&&i.value!=="ghost"&&i.value!=="link"&&Z.push(ue.border,ue.hoverBorder),o.textColor&&Z.push(o.textColor),Z.join(" ")}),ae=e.computed(()=>Pe($h,g.value,b.value,B.value,$.value,q.value,W.value));return(Z,J)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(x.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(Zi),{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(el),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(It),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ae.value,style:ee.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(Qi),{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",Lh,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(It),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:ae.value,style:ee.value},d.value),{default:e.withCtx(()=>[e.renderSlot(Z.$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)}}),wt=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Ke=wt(jh,[["__scopeId","data-v-fed1b675"]]),Wh={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"},Uh={class:"flex flex-col gap-1"},Hh={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},qh={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},Gh={key:0,class:"flex items-center gap-2"},Xh={name:"DCodeCard"},tl=e.defineComponent({...Xh,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",Wh,[e.createElementVNode("div",Uh,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",Hh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",qh,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Gh,[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))}}),Kh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Yh={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},Jh={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},Qh={class:"flex items-center justify-between"},Zh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},em={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},tm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},nm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},om={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},rm={class:"flex items-center justify-between"},am={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},sm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},im={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},va=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}=Vt.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",Kh,[e.createElementVNode("div",Yh,[e.createElementVNode("div",Jh,[e.createElementVNode("div",Qh,[e.createElementVNode("h3",Zh,[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",em,[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",tm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",nm,[e.createElementVNode("div",om,[e.createElementVNode("div",rm,[e.createElementVNode("h3",am,[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",sm,[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",im,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),lm=["aria-busy"],cm={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},dm={key:1,class:"flex justify-end"},um=["for"],fm={key:0,class:"ml-1 text-destructive"},hm={class:"relative w-full group"},mm={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},pm={key:1},gm=["id","value","placeholder"],bm={key:1,class:"absolute inset-y-0 right-4 flex items-center"},ym={key:2,class:"absolute inset-y-0 right-4 flex items-center"},xm={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"},km={key:1,class:"text-xs text-destructive"},Xn=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)}),h=e.computed(()=>{const{label:O,class:K,id:re,required:be,"aria-required":Be,...Ie}=o;return Ie}),m=e.computed(()=>{var K,re;const O={...h.value};return((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&(O.type="text",O.inputmode="numeric",O.pattern="[0-9]*"),((re=l.valueType)==null?void 0:re.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}),g=e.computed(()=>{const O=l.modelValue;return O==null||String(O).length===0}),b=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!g.value:!0:!1),x=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 E=e.ref(!1),C=e.ref(!1),w=O=>O.split(/(\s+)/).map(K=>{if(K.trim()==="")return K;const re=K.toLowerCase();return re.charAt(0).toUpperCase()+re.slice(1)}).join(""),_=O=>{const K=O.toLowerCase(),re=K.search(new RegExp("\\p{L}","u"));return re<0?K:K.slice(0,re)+K.charAt(re).toUpperCase()+K.slice(re+1)},B=O=>{switch(l.textCase){case"uppercase":return O.toUpperCase();case"lowercase":return O.toLowerCase();case"titlecase":return w(O);case"sentencecase":return _(O);case"none":default:return O}},k=O=>{if(!O)return null;const K=Array.isArray(O)?O.join(""):O;return K?new Set(K):null},y=e.computed(()=>k(l.allowChars)),V=(O,K)=>(O.lastIndex=0,O.test(K)),N=O=>{var Ge;const K=(Ge=l.valueType)==null?void 0:Ge.toLowerCase();if(K==="free"||K==="email"||K==="password")return!0;const re=O===" ",be=/\d/.test(O),Be=new RegExp("\\p{L}","u").test(O),Ie=new RegExp("\\p{N}","u").test(O),$e=/[\/\-_.,]/.test(O);return K==="number"?be:K==="letter"?Be||$e||l.allowSpaces&&re:K==="letternumber"?Be||Ie||$e||l.allowSpaces&&re:!0},M=O=>{let K="";for(const re of O){const be=!!y.value&&y.value.has(re);l.pattern&&!be&&!V(l.pattern,re)||!be&&!N(re)||(K+=re)}return K},D=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}),v=e.computed(()=>p.value.length),P=e.computed(()=>l.showCharCount?D.value>0:!1),H=O=>D.value>0?O.slice(0,D.value):O,$=O=>{const K=M(O),re=l.applyTextCaseToValue?B(K):K;return H(re)};let q=null;const ee=O=>{var K;if(O==="")return null;if(((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&l.returnNumber){const re=Number(O);return Number.isFinite(re)?re:null}return O},G=O=>{p.value=O,i("update:modelValue",ee(O))},L=(O,K)=>{const re=H(K);C.value=!0,O.value=re,G(re),queueMicrotask(()=>C.value=!1)},W=(O,K)=>{const re=O.selectionStart??O.value.length,be=O.selectionEnd??O.value.length;if(D.value>0){const Be=O.value.length-(be-re),Ie=D.value-Be;if(Ie<=0)return;K=K.slice(0,Ie)}O.setRangeText(K,re,be,"end"),L(O,$(O.value))},ae=O=>{var be;if(!q||E.value||C.value||!((be=O.inputType)!=null&&be.startsWith("insert")))return;const K=O.data;if(K==null)return;const re=$(K);re!==K&&(O.preventDefault(),re.length>0&&W(q,re))},Z=O=>{var be;if(!q||E.value||C.value)return;const K=((be=O.clipboardData)==null?void 0:be.getData("text"))??"",re=$(K);re!==K&&(O.preventDefault(),re.length>0&&W(q,re))},J=O=>{if(!q||E.value||C.value)return;const K=O.target,re=K.value??"",be=$(re);be===re?G(be):L(K,be)},le=()=>E.value=!0,ue=()=>{if(E.value=!1,!q)return;const O=q.value??"",K=$(O);K===O?G(K):L(q,K)};e.onMounted(()=>{if(q=document.getElementById(u.value),!q)return;q.addEventListener("beforeinput",ae),q.addEventListener("paste",Z),q.addEventListener("input",J),q.addEventListener("compositionstart",le),q.addEventListener("compositionend",ue);const O=q.value??"",K=$(O);K===O?G(K):L(q,K)}),e.onBeforeUnmount(()=>{q&&(q.removeEventListener("beforeinput",ae),q.removeEventListener("paste",Z),q.removeEventListener("input",J),q.removeEventListener("compositionstart",le),q.removeEventListener("compositionend",ue),q=null)});const Ce=()=>{p.value="",q&&(q.value=""),i("update:modelValue",null),i("clear")},_e=e.computed(()=>P.value&&v.value>0),me=e.computed(()=>`${v.value} / ${D.value}`),Q=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",cm)):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)),P.value?(e.openBlock(),e.createElementBlock("div",dm,[...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",fm,"*")):e.createCommentVNode("",!0)],8,um)):e.createCommentVNode("",!0),e.createElementVNode("div",hm,[l.icon||l.prependInner||O.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",mm,[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",pm,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${x.value}; padding-left: ${l.icon||l.prependInner||O.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${b.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",Q.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,gm),r.value?(e.openBlock(),e.createElementBlock("div",bm,[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(ce.Eye):e.unref(ce.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),b.value&&!r.value?(e.openBlock(),e.createElementBlock("div",ym,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:Ce}," ✕ ")])):e.createCommentVNode("",!0),_e.value&&!Q.value?(e.openBlock(),e.createElementBlock("p",xm,e.toDisplayString(me.value),1)):e.createCommentVNode("",!0)]),Q.value?(e.openBlock(),e.createElementBlock("p",km,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,lm)),[[e.vShow,t.visible]])}}),wm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Cm={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"},Em={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Bm={class:"flex items-center justify-between"},_m={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Sm={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"},Am={class:"p-6 flex-1"},Vm={class:"flex flex-col gap-4"},Dm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Nm={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"},Mm={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},vm={class:"flex items-center justify-between"},Pm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Tm={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"},Om={class:"p-6 flex-1"},Fm={class:"flex flex-col gap-4"},zm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Pa=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=Vt.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",wm,[e.createElementVNode("div",Cm,[e.createElementVNode("div",Em,[e.createElementVNode("div",Bm,[e.createElementVNode("h3",_m,[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",Sm,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Am,[e.createElementVNode("div",Vm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(Xn,{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",Dm)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Nm,[e.createElementVNode("div",Mm,[e.createElementVNode("div",vm,[e.createElementVNode("h3",Pm,[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",Tm,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Om,[e.createElementVNode("div",Fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(Xn,{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",zm,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(e){return e+.5|0}const tn=(e,t,o)=>Math.max(Math.min(e,o),t);function ao(e){return tn(oo(e*2.55),0,255)}function nn(e){return tn(oo(e*255),0,255)}function It(e){return tn(oo(e/2.55)/100,0,1)}function Wi(e){return tn(oo(e*100),0,100)}const gt={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},Cr=[..."0123456789ABCDEF"],Lh=e=>Cr[e&15],$h=e=>Cr[(e&240)>>4]+Cr[e&15],Ho=e=>(e&240)>>4===(e&15),Wh=e=>Ho(e.r)&&Ho(e.g)&&Ho(e.b)&&Ho(e.a);function jh(e){var t=e.length,o;return e[0]==="#"&&(t===4||t===5?o={r:255&gt[e[1]]*17,g:255&gt[e[2]]*17,b:255&gt[e[3]]*17,a:t===5?gt[e[4]]*17:255}:(t===7||t===9)&&(o={r:gt[e[1]]<<4|gt[e[2]],g:gt[e[3]]<<4|gt[e[4]],b:gt[e[5]]<<4|gt[e[6]],a:t===9?gt[e[7]]<<4|gt[e[8]]:255})),o}const Uh=(e,t)=>e<255?t(e):"";function Hh(e){var t=Wh(e)?Lh:$h;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Uh(e.a,t):void 0}const qh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ji(e,t,o){const a=t*Math.min(o,1-o),r=(s,i=(s+e/30)%12)=>o-a*Math.max(Math.min(i-3,9-i,1),-1);return[r(0),r(8),r(4)]}function Gh(e,t,o){const a=(r,s=(r+e/60)%6)=>o-o*t*Math.max(Math.min(s,4-s,1),0);return[a(5),a(3),a(1)]}function Xh(e,t,o){const a=ji(e,1,.5);let r;for(t+o>1&&(r=1/(t+o),t*=r,o*=r),r=0;r<3;r++)a[r]*=1-t-o,a[r]+=t;return a}function Yh(e,t,o,a,r){return e===r?(t-o)/a+(t<o?6:0):t===r?(o-e)/a+2:(e-t)/a+4}function Br(e){const o=e.r/255,a=e.g/255,r=e.b/255,s=Math.max(o,a,r),i=Math.min(o,a,r),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=Yh(o,a,r,u,s),c=c*60+.5),[c|0,d||0,l]}function Er(e,t,o,a){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,o,a)).map(nn)}function _r(e,t,o){return Er(ji,e,t,o)}function Kh(e,t,o){return Er(Xh,e,t,o)}function Jh(e,t,o){return Er(Gh,e,t,o)}function Ui(e){return(e%360+360)%360}function Qh(e){const t=qh.exec(e);let o=255,a;if(!t)return;t[5]!==a&&(o=t[6]?ao(+t[5]):nn(+t[5]));const r=Ui(+t[2]),s=+t[3]/100,i=+t[4]/100;return t[1]==="hwb"?a=Kh(r,s,i):t[1]==="hsv"?a=Jh(r,s,i):a=_r(r,s,i),{r:a[0],g:a[1],b:a[2],a:o}}function Zh(e,t){var o=Br(e);o[0]=Ui(o[0]+t),o=_r(o),e.r=o[0],e.g=o[1],e.b=o[2]}function em(e){if(!e)return;const t=Br(e),o=t[0],a=Wi(t[1]),r=Wi(t[2]);return e.a<255?`hsla(${o}, ${a}%, ${r}%, ${It(e.a)})`:`hsl(${o}, ${a}%, ${r}%)`}const Hi={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"},qi={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 tm(){const e={},t=Object.keys(qi),o=Object.keys(Hi);let a,r,s,i,l;for(a=0;a<t.length;a++){for(i=l=t[a],r=0;r<o.length;r++)s=o[r],l=l.replace(s,Hi[s]);s=parseInt(qi[i],16),e[l]=[s>>16&255,s>>8&255,s&255]}return e}let qo;function nm(e){qo||(qo=tm(),qo.transparent=[0,0,0,0]);const t=qo[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const om=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function am(e){const t=om.exec(e);let o=255,a,r,s;if(t){if(t[7]!==a){const i=+t[7];o=t[8]?ao(i):tn(i*255,0,255)}return a=+t[1],r=+t[3],s=+t[5],a=255&(t[2]?ao(a):tn(a,0,255)),r=255&(t[4]?ao(r):tn(r,0,255)),s=255&(t[6]?ao(s):tn(s,0,255)),{r:a,g:r,b:s,a:o}}}function rm(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${It(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const Sr=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,On=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function sm(e,t,o){const a=On(It(e.r)),r=On(It(e.g)),s=On(It(e.b));return{r:nn(Sr(a+o*(On(It(t.r))-a))),g:nn(Sr(r+o*(On(It(t.g))-r))),b:nn(Sr(s+o*(On(It(t.b))-s))),a:e.a+o*(t.a-e.a)}}function Go(e,t,o){if(e){let a=Br(e);a[t]=Math.max(0,Math.min(a[t]+a[t]*o,t===0?360:1)),a=_r(a),e.r=a[0],e.g=a[1],e.b=a[2]}}function Gi(e,t){return e&&Object.assign(t||{},e)}function Xi(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=nn(e[3]))):(t=Gi(e,{r:0,g:0,b:0,a:1}),t.a=nn(t.a)),t}function im(e){return e.charAt(0)==="r"?am(e):Qh(e)}class ro{constructor(t){if(t instanceof ro)return t;const o=typeof t;let a;o==="object"?a=Xi(t):o==="string"&&(a=jh(t)||nm(t)||im(t)),this._rgb=a,this._valid=!!a}get valid(){return this._valid}get rgb(){var t=Gi(this._rgb);return t&&(t.a=It(t.a)),t}set rgb(t){this._rgb=Xi(t)}rgbString(){return this._valid?rm(this._rgb):void 0}hexString(){return this._valid?Hh(this._rgb):void 0}hslString(){return this._valid?em(this._rgb):void 0}mix(t,o){if(t){const a=this.rgb,r=t.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=a.a-r.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,a.r=255&d*a.r+s*r.r+.5,a.g=255&d*a.g+s*r.g+.5,a.b=255&d*a.b+s*r.b+.5,a.a=i*a.a+(1-i)*r.a,this.rgb=a}return this}interpolate(t,o){return t&&(this._rgb=sm(this._rgb,t._rgb,o)),this}clone(){return new ro(this.rgb)}alpha(t){return this._rgb.a=nn(t),this}clearer(t){const o=this._rgb;return o.a*=1-t,this}greyscale(){const t=this._rgb,o=oo(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=o,this}opaquer(t){const o=this._rgb;return o.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return Go(this._rgb,2,t),this}darken(t){return Go(this._rgb,2,-t),this}saturate(t){return Go(this._rgb,1,t),this}desaturate(t){return Go(this._rgb,1,-t),this}rotate(t){return Zh(this._rgb,t),this}}/*!
6
+ */function xo(t){return t+.5|0}const pn=(t,n,o)=>Math.max(Math.min(t,o),n);function ko(t){return pn(xo(t*2.55),0,255)}function gn(t){return pn(xo(t*255),0,255)}function en(t){return pn(xo(t/2.55)/100,0,1)}function nl(t){return pn(xo(t*100),0,100)}const Dt={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},Ta=[..."0123456789ABCDEF"],Im=t=>Ta[t&15],Rm=t=>Ta[(t&240)>>4]+Ta[t&15],ir=t=>(t&240)>>4===(t&15),Lm=t=>ir(t.r)&&ir(t.g)&&ir(t.b)&&ir(t.a);function $m(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&Dt[t[1]]*17,g:255&Dt[t[2]]*17,b:255&Dt[t[3]]*17,a:n===5?Dt[t[4]]*17:255}:(n===7||n===9)&&(o={r:Dt[t[1]]<<4|Dt[t[2]],g:Dt[t[3]]<<4|Dt[t[4]],b:Dt[t[5]]<<4|Dt[t[6]],a:n===9?Dt[t[7]]<<4|Dt[t[8]]:255})),o}const jm=(t,n)=>t<255?n(t):"";function Wm(t){var n=Lm(t)?Im:Rm;return t?"#"+n(t.r)+n(t.g)+n(t.b)+jm(t.a,n):void 0}const Um=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ol(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 Hm(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 qm(t,n,o){const r=ol(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 Gm(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 Oa(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=Gm(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Fa(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(gn)}function za(t,n,o){return Fa(ol,t,n,o)}function Xm(t,n,o){return Fa(qm,t,n,o)}function Km(t,n,o){return Fa(Hm,t,n,o)}function rl(t){return(t%360+360)%360}function Ym(t){const n=Um.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?ko(+n[5]):gn(+n[5]));const a=rl(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=Xm(a,s,i):n[1]==="hsv"?r=Km(a,s,i):r=za(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function Jm(t,n){var o=Oa(t);o[0]=rl(o[0]+n),o=za(o),t.r=o[0],t.g=o[1],t.b=o[2]}function Qm(t){if(!t)return;const n=Oa(t),o=n[0],r=nl(n[1]),a=nl(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${en(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const al={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"},sl={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 Zm(){const t={},n=Object.keys(sl),o=Object.keys(al);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,al[s]);s=parseInt(sl[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let lr;function ep(t){lr||(lr=Zm(),lr.transparent=[0,0,0,0]);const n=lr[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const tp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function np(t){const n=tp.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?ko(i):pn(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?ko(r):pn(r,0,255)),a=255&(n[4]?ko(a):pn(a,0,255)),s=255&(n[6]?ko(s):pn(s,0,255)),{r,g:a,b:s,a:o}}}function op(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${en(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const Ia=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,Kn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function rp(t,n,o){const r=Kn(en(t.r)),a=Kn(en(t.g)),s=Kn(en(t.b));return{r:gn(Ia(r+o*(Kn(en(n.r))-r))),g:gn(Ia(a+o*(Kn(en(n.g))-a))),b:gn(Ia(s+o*(Kn(en(n.b))-s))),a:t.a+o*(n.a-t.a)}}function cr(t,n,o){if(t){let r=Oa(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=za(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function il(t,n){return t&&Object.assign(n||{},t)}function ll(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=gn(t[3]))):(n=il(t,{r:0,g:0,b:0,a:1}),n.a=gn(n.a)),n}function ap(t){return t.charAt(0)==="r"?np(t):Ym(t)}class wo{constructor(n){if(n instanceof wo)return n;const o=typeof n;let r;o==="object"?r=ll(n):o==="string"&&(r=$m(n)||ep(n)||ap(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=il(this._rgb);return n&&(n.a=en(n.a)),n}set rgb(n){this._rgb=ll(n)}rgbString(){return this._valid?op(this._rgb):void 0}hexString(){return this._valid?Wm(this._rgb):void 0}hslString(){return this._valid?Qm(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=rp(this._rgb,n._rgb,o)),this}clone(){return new wo(this.rgb)}alpha(n){return this._rgb.a=gn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=xo(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 cr(this._rgb,2,n),this}darken(n){return cr(this._rgb,2,-n),this}saturate(n){return cr(this._rgb,1,n),this}desaturate(n){return cr(this._rgb,1,-n),this}rotate(n){return Jm(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 Lt(){}const lm=(()=>{let e=0;return()=>e++})();function ve(e){return e==null}function Ye(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function _e(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ot(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Vt(e,t){return ot(e)?e:t}function Ce(e,t){return typeof e>"u"?t:e}const cm=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Yi=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Re(e,t,o){if(e&&typeof e.call=="function")return e.apply(o,t)}function Pe(e,t,o,a){let r,s,i;if(Ye(e))for(s=e.length,r=0;r<s;r++)t.call(o,e[r],r);else if(_e(e))for(i=Object.keys(e),s=i.length,r=0;r<s;r++)t.call(o,e[i[r]],i[r])}function Xo(e,t){let o,a,r,s;if(!e||!t||e.length!==t.length)return!1;for(o=0,a=e.length;o<a;++o)if(r=e[o],s=t[o],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Yo(e){if(Ye(e))return e.map(Yo);if(_e(e)){const t=Object.create(null),o=Object.keys(e),a=o.length;let r=0;for(;r<a;++r)t[o[r]]=Yo(e[o[r]]);return t}return e}function Ki(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function dm(e,t,o,a){if(!Ki(e))return;const r=t[e],s=o[e];_e(r)&&_e(s)?so(r,s,a):t[e]=Yo(s)}function so(e,t,o){const a=Ye(t)?t:[t],r=a.length;if(!_e(e))return e;o=o||{};const s=o.merger||dm;let i;for(let l=0;l<r;++l){if(i=a[l],!_e(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],e,i,o)}return e}function io(e,t){return so(e,t,{merger:um})}function um(e,t,o){if(!Ki(e))return;const a=t[e],r=o[e];_e(a)&&_e(r)?io(a,r):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Yo(r))}const Ji={"":e=>e,x:e=>e.x,y:e=>e.y};function fm(e){const t=e.split("."),o=[];let a="";for(const r of t)a+=r,a.endsWith("\\")?a=a.slice(0,-1)+".":(o.push(a),a="");return o}function hm(e){const t=fm(e);return o=>{for(const a of t){if(a==="")break;o=o&&o[a]}return o}}function bn(e,t){return(Ji[t]||(Ji[t]=hm(t)))(e)}function Ar(e){return e.charAt(0).toUpperCase()+e.slice(1)}const lo=e=>typeof e<"u",on=e=>typeof e=="function",Qi=(e,t)=>{if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0};function mm(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Te=Math.PI,$e=2*Te,pm=$e+Te,Ko=Number.POSITIVE_INFINITY,gm=Te/180,Qe=Te/2,yn=Te/4,Zi=Te*2/3,el=Math.log10,Dt=Math.sign;function co(e,t,o){return Math.abs(e-t)<o}function tl(e){const t=Math.round(e);e=co(e,t,e/1e3)?t:e;const o=Math.pow(10,Math.floor(el(e))),a=e/o;return(a<=1?1:a<=2?2:a<=5?5:10)*o}function bm(e){const t=[],o=Math.sqrt(e);let a;for(a=1;a<o;a++)e%a===0&&(t.push(a),t.push(e/a));return o===(o|0)&&t.push(o),t.sort((r,s)=>r-s).pop(),t}function ym(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function uo(e){return!ym(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function xm(e,t){const o=Math.round(e);return o-t<=e&&o+t>=e}function km(e,t,o){let a,r,s;for(a=0,r=e.length;a<r;a++)s=e[a][o],isNaN(s)||(t.min=Math.min(t.min,s),t.max=Math.max(t.max,s))}function $t(e){return e*(Te/180)}function wm(e){return e*(180/Te)}function nl(e){if(!ot(e))return;let t=1,o=0;for(;Math.round(e*t)/t!==e;)t*=10,o++;return o}function ol(e,t){const o=t.x-e.x,a=t.y-e.y,r=Math.sqrt(o*o+a*a);let s=Math.atan2(a,o);return s<-.5*Te&&(s+=$e),{angle:s,distance:r}}function Vr(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Cm(e,t){return(e-t+pm)%$e-Te}function mt(e){return(e%$e+$e)%$e}function fo(e,t,o,a){const r=mt(e),s=mt(t),i=mt(o),l=mt(s-r),c=mt(i-r),d=mt(r-s),u=mt(r-i);return r===s||r===i||a&&s===i||l>c&&d<u}function at(e,t,o){return Math.max(t,Math.min(o,e))}function Bm(e){return at(e,-32768,32767)}function Wt(e,t,o,a=1e-6){return e>=Math.min(t,o)-a&&e<=Math.max(t,o)+a}function Dr(e,t,o){o=o||(i=>e[i]<t);let a=e.length-1,r=0,s;for(;a-r>1;)s=r+a>>1,o(s)?r=s:a=s;return{lo:r,hi:a}}const xn=(e,t,o,a)=>Dr(e,o,a?r=>{const s=e[r][t];return s<o||s===o&&e[r+1][t]===o}:r=>e[r][t]<o),Em=(e,t,o)=>Dr(e,o,a=>e[a][t]>=o);function _m(e,t,o){let a=0,r=e.length;for(;a<r&&e[a]<t;)a++;for(;r>a&&e[r-1]>o;)r--;return a>0||r<e.length?e.slice(a,r):e}const al=["push","pop","shift","splice","unshift"];function Sm(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),al.forEach(o=>{const a="_onData"+Ar(o),r=e[o];Object.defineProperty(e,o,{configurable:!0,enumerable:!1,value(...s){const i=r.apply(this,s);return e._chartjs.listeners.forEach(l=>{typeof l[a]=="function"&&l[a](...s)}),i}})})}function rl(e,t){const o=e._chartjs;if(!o)return;const a=o.listeners,r=a.indexOf(t);r!==-1&&a.splice(r,1),!(a.length>0)&&(al.forEach(s=>{delete e[s]}),delete e._chartjs)}function sl(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const il=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function ll(e,t){let o=[],a=!1;return function(...r){o=r,a||(a=!0,il.call(window,()=>{a=!1,e.apply(t,o)}))}}function Am(e,t){let o;return function(...a){return t?(clearTimeout(o),o=setTimeout(e,t,a)):e.apply(this,a),t}}const Mr=e=>e==="start"?"left":e==="end"?"right":"center",rt=(e,t,o)=>e==="start"?t:e==="end"?o:(t+o)/2,Vm=(e,t,o,a)=>e===(a?"left":"right")?o:e==="center"?(t+o)/2:t;function Dm(e,t,o){const a=t.length;let r=0,s=a;if(e._sorted){const{iScale:i,vScale:l,_parsed:c}=e,d=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:g}=i.getUserBounds();if(m){if(r=Math.min(xn(c,u,f).lo,o?a:xn(t,u,i.getPixelForValue(f)).lo),d){const y=c.slice(0,r+1).reverse().findIndex(k=>!ve(k[l.axis]));r-=Math.max(0,y)}r=at(r,0,a-1)}if(g){let y=Math.max(xn(c,i.axis,h,!0).hi+1,o?0:xn(t,u,i.getPixelForValue(h),!0).hi+1);if(d){const k=c.slice(y-1).findIndex(p=>!ve(p[l.axis]));y+=Math.max(0,k)}s=at(y,r,a)-r}else s=a-r}return{start:r,count:s}}function Mm(e){const{xScale:t,yScale:o,_scaleRanges:a}=e,r={xmin:t.min,xmax:t.max,ymin:o.min,ymax:o.max};if(!a)return e._scaleRanges=r,!0;const s=a.xmin!==t.min||a.xmax!==t.max||a.ymin!==o.min||a.ymax!==o.max;return Object.assign(a,r),s}const Jo=e=>e===0||e===1,cl=(e,t,o)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*$e/o)),dl=(e,t,o)=>Math.pow(2,-10*e)*Math.sin((e-t)*$e/o)+1,ho={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*Qe)+1,easeOutSine:e=>Math.sin(e*Qe),easeInOutSine:e=>-.5*(Math.cos(Te*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Jo(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Jo(e)?e:cl(e,.075,.3),easeOutElastic:e=>Jo(e)?e:dl(e,.075,.3),easeInOutElastic(e){return Jo(e)?e:e<.5?.5*cl(e*2,.1125,.45):.5+.5*dl(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-ho.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?ho.easeInBounce(e*2)*.5:ho.easeOutBounce(e*2-1)*.5+.5};function Nr(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ul(e){return Nr(e)?e:new ro(e)}function vr(e){return Nr(e)?e:new ro(e).saturate(.5).darken(.1).hexString()}const Nm=["x","y","borderWidth","radius","tension"],vm=["color","borderColor","backgroundColor"];function Pm(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:vm},numbers:{type:"number",properties:Nm}}),e.describe("animations",{_fallback:"animation"}),e.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:t=>t|0}}}})}function Tm(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const fl=new Map;function Om(e,t){t=t||{};const o=e+JSON.stringify(t);let a=fl.get(o);return a||(a=new Intl.NumberFormat(e,t),fl.set(o,a)),a}function Pr(e,t,o){return Om(t,o).format(e)}const zm={values(e){return Ye(e)?e:""+e},numeric(e,t,o){if(e===0)return"0";const a=this.chart.options.locale;let r,s=e;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)&&(r="scientific"),s=Fm(e,o)}const i=el(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:r,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Pr(e,a,c)}};function Fm(e,t){let o=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(o)>=1&&e!==Math.floor(e)&&(o=e-Math.floor(e)),o}var hl={formatters:zm};function Rm(e){e.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:(t,o)=>o.lineWidth,tickColor:(t,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:hl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const kn=Object.create(null),Tr=Object.create(null);function mo(e,t){if(!t)return e;const o=t.split(".");for(let a=0,r=o.length;a<r;++a){const s=o[a];e=e[s]||(e[s]=Object.create(null))}return e}function Or(e,t,o){return typeof t=="string"?so(mo(e,t),o):so(mo(e,""),t)}class Im{constructor(t,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=a=>a.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=(a,r)=>vr(r.backgroundColor),this.hoverBorderColor=(a,r)=>vr(r.borderColor),this.hoverColor=(a,r)=>vr(r.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(t),this.apply(o)}set(t,o){return Or(this,t,o)}get(t){return mo(this,t)}describe(t,o){return Or(Tr,t,o)}override(t,o){return Or(kn,t,o)}route(t,o,a,r){const s=mo(this,t),i=mo(this,a),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[r];return _e(c)?Object.assign({},d,c):Ce(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(o=>o(this))}}var He=new Im({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Pm,Tm,Rm]);function Lm(e){return!e||ve(e.size)||ve(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function ml(e,t,o,a,r){let s=t[r];return s||(s=t[r]=e.measureText(r).width,o.push(r)),s>a&&(a=s),a}function wn(e,t,o){const a=e.currentDevicePixelRatio,r=o!==0?Math.max(o/2,.5):0;return Math.round((t-r)*a)/a+r}function pl(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function zr(e,t,o,a){gl(e,t,o,a,null)}function gl(e,t,o,a,r){let s,i,l,c,d,u,f,h;const m=t.pointStyle,g=t.rotation,y=t.radius;let k=(g||0)*gm;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){e.save(),e.translate(o,a),e.rotate(k),e.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),e.restore();return}if(!(isNaN(y)||y<=0)){switch(e.beginPath(),m){default:r?e.ellipse(o,a,r/2,y,0,0,$e):e.arc(o,a,y,0,$e),e.closePath();break;case"triangle":u=r?r/2:y,e.moveTo(o+Math.sin(k)*u,a-Math.cos(k)*y),k+=Zi,e.lineTo(o+Math.sin(k)*u,a-Math.cos(k)*y),k+=Zi,e.lineTo(o+Math.sin(k)*u,a-Math.cos(k)*y),e.closePath();break;case"rectRounded":d=y*.516,c=y-d,i=Math.cos(k+yn)*c,f=Math.cos(k+yn)*(r?r/2-d:c),l=Math.sin(k+yn)*c,h=Math.sin(k+yn)*(r?r/2-d:c),e.arc(o-f,a-l,d,k-Te,k-Qe),e.arc(o+h,a-i,d,k-Qe,k),e.arc(o+f,a+l,d,k,k+Qe),e.arc(o-h,a+i,d,k+Qe,k+Te),e.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*y,u=r?r/2:c,e.rect(o-u,a-c,2*u,2*c);break}k+=yn;case"rectRot":f=Math.cos(k)*(r?r/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(r?r/2:y),e.moveTo(o-f,a-l),e.lineTo(o+h,a-i),e.lineTo(o+f,a+l),e.lineTo(o-h,a+i),e.closePath();break;case"crossRot":k+=yn;case"cross":f=Math.cos(k)*(r?r/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(r?r/2:y),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"star":f=Math.cos(k)*(r?r/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(r?r/2:y),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i),k+=yn,f=Math.cos(k)*(r?r/2:y),i=Math.cos(k)*y,l=Math.sin(k)*y,h=Math.sin(k)*(r?r/2:y),e.moveTo(o-f,a-l),e.lineTo(o+f,a+l),e.moveTo(o+h,a-i),e.lineTo(o-h,a+i);break;case"line":i=r?r/2:Math.cos(k)*y,l=Math.sin(k)*y,e.moveTo(o-i,a-l),e.lineTo(o+i,a+l);break;case"dash":e.moveTo(o,a),e.lineTo(o+Math.cos(k)*(r?r/2:y),a+Math.sin(k)*y);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function po(e,t,o){return o=o||.5,!t||e&&e.x>t.left-o&&e.x<t.right+o&&e.y>t.top-o&&e.y<t.bottom+o}function Qo(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function Zo(e){e.restore()}function $m(e,t,o,a,r){if(!t)return e.lineTo(o.x,o.y);if(r==="middle"){const s=(t.x+o.x)/2;e.lineTo(s,t.y),e.lineTo(s,o.y)}else r==="after"!=!!a?e.lineTo(t.x,o.y):e.lineTo(o.x,t.y);e.lineTo(o.x,o.y)}function Wm(e,t,o,a){if(!t)return e.lineTo(o.x,o.y);e.bezierCurveTo(a?t.cp1x:t.cp2x,a?t.cp1y:t.cp2y,a?o.cp2x:o.cp1x,a?o.cp2y:o.cp1y,o.x,o.y)}function jm(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ve(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Um(e,t,o,a,r){if(r.strikethrough||r.underline){const s=e.measureText(a),i=t-s.actualBoundingBoxLeft,l=t+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=r.strikethrough?(c+d)/2:d;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=r.decorationWidth||2,e.moveTo(i,u),e.lineTo(l,u),e.stroke()}}function Hm(e,t){const o=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=o}function go(e,t,o,a,r,s={}){const i=Ye(t)?t:[t],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(e.save(),e.font=r.string,jm(e,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Hm(e,s.backdrop),l&&(s.strokeColor&&(e.strokeStyle=s.strokeColor),ve(s.strokeWidth)||(e.lineWidth=s.strokeWidth),e.strokeText(d,o,a,s.maxWidth)),e.fillText(d,o,a,s.maxWidth),Um(e,o,a,d,s),a+=Number(r.lineHeight);e.restore()}function ea(e,t){const{x:o,y:a,w:r,h:s,radius:i}=t;e.arc(o+i.topLeft,a+i.topLeft,i.topLeft,1.5*Te,Te,!0),e.lineTo(o,a+s-i.bottomLeft),e.arc(o+i.bottomLeft,a+s-i.bottomLeft,i.bottomLeft,Te,Qe,!0),e.lineTo(o+r-i.bottomRight,a+s),e.arc(o+r-i.bottomRight,a+s-i.bottomRight,i.bottomRight,Qe,0,!0),e.lineTo(o+r,a+i.topRight),e.arc(o+r-i.topRight,a+i.topRight,i.topRight,0,-Qe,!0),e.lineTo(o+i.topLeft,a)}const qm=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Gm=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Xm(e,t){const o=(""+e).match(qm);if(!o||o[1]==="normal")return t*1.2;switch(e=+o[2],o[3]){case"px":return e;case"%":e/=100;break}return t*e}const Ym=e=>+e||0;function Fr(e,t){const o={},a=_e(t),r=a?Object.keys(t):t,s=_e(e)?a?i=>Ce(e[i],e[t[i]]):i=>e[i]:()=>e;for(const i of r)o[i]=Ym(s(i));return o}function bl(e){return Fr(e,{top:"y",right:"x",bottom:"y",left:"x"})}function zn(e){return Fr(e,["topLeft","topRight","bottomLeft","bottomRight"])}function bt(e){const t=bl(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function st(e,t){e=e||{},t=t||He.font;let o=Ce(e.size,t.size);typeof o=="string"&&(o=parseInt(o,10));let a=Ce(e.style,t.style);a&&!(""+a).match(Gm)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const r={family:Ce(e.family,t.family),lineHeight:Xm(Ce(e.lineHeight,t.lineHeight),o),size:o,style:a,weight:Ce(e.weight,t.weight),string:""};return r.string=Lm(r),r}function ta(e,t,o,a){let r,s,i;for(r=0,s=e.length;r<s;++r)if(i=e[r],i!==void 0&&i!==void 0)return i}function Km(e,t,o){const{min:a,max:r}=e,s=Yi(t,(r-a)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(a,-Math.abs(s)),max:i(r,s)}}function Cn(e,t){return Object.assign(Object.create(e),t)}function Rr(e,t=[""],o,a,r=()=>e[0]){const s=o||e;typeof a>"u"&&(a=Cl("_fallback",e));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:s,_fallback:a,_getTarget:r,override:l=>Rr([l,...e],t,s,a)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete e[0][c],!0},get(l,c){return xl(l,c,()=>ap(c,t,e,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(l,c){return Bl(l).includes(c)},ownKeys(l){return Bl(l)},set(l,c,d){const u=l._storage||(l._storage=r());return l[c]=u[c]=d,delete l._keys,!0}})}function Fn(e,t,o,a){const r={_cacheable:!1,_proxy:e,_context:t,_subProxy:o,_stack:new Set,_descriptors:yl(e,a),setContext:s=>Fn(e,s,o,a),override:s=>Fn(e.override(s),t,o,a)};return new Proxy(r,{deleteProperty(s,i){return delete s[i],delete e[i],!0},get(s,i,l){return xl(s,i,()=>Qm(s,i,l))},getOwnPropertyDescriptor(s,i){return s._descriptors.allKeys?Reflect.has(e,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,i)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(s,i){return Reflect.has(e,i)},ownKeys(){return Reflect.ownKeys(e)},set(s,i,l){return e[i]=l,delete s[i],!0}})}function yl(e,t={scriptable:!0,indexable:!0}){const{_scriptable:o=t.scriptable,_indexable:a=t.indexable,_allKeys:r=t.allKeys}=e;return{allKeys:r,scriptable:o,indexable:a,isScriptable:on(o)?o:()=>o,isIndexable:on(a)?a:()=>a}}const Jm=(e,t)=>e?e+Ar(t):t,Ir=(e,t)=>_e(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function xl(e,t,o){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const a=o();return e[t]=a,a}function Qm(e,t,o){const{_proxy:a,_context:r,_subProxy:s,_descriptors:i}=e;let l=a[t];return on(l)&&i.isScriptable(t)&&(l=Zm(t,l,e,o)),Ye(l)&&l.length&&(l=ep(t,l,e,i.isIndexable)),Ir(t,l)&&(l=Fn(l,r,s&&s[t],i)),l}function Zm(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_stack:l}=o;if(l.has(e))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+e);l.add(e);let c=t(s,i||a);return l.delete(e),Ir(e,c)&&(c=Lr(r._scopes,r,e,c)),c}function ep(e,t,o,a){const{_proxy:r,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&a(e))return t[s.index%t.length];if(_e(t[0])){const c=t,d=r._scopes.filter(u=>u!==c);t=[];for(const u of c){const f=Lr(d,r,e,u);t.push(Fn(f,s,i&&i[e],l))}}return t}function kl(e,t,o){return on(e)?e(t,o):e}const tp=(e,t)=>e===!0?t:typeof e=="string"?bn(t,e):void 0;function np(e,t,o,a,r){for(const s of t){const i=tp(o,s);if(i){e.add(i);const l=kl(i._fallback,o,r);if(typeof l<"u"&&l!==o&&l!==a)return l}else if(i===!1&&typeof a<"u"&&o!==a)return null}return!1}function Lr(e,t,o,a){const r=t._rootScopes,s=kl(t._fallback,o,a),i=[...e,...r],l=new Set;l.add(a);let c=wl(l,i,o,s||o,a);return c===null||typeof s<"u"&&s!==o&&(c=wl(l,i,s,c,a),c===null)?!1:Rr(Array.from(l),[""],r,s,()=>op(t,o,a))}function wl(e,t,o,a,r){for(;o;)o=np(e,t,o,a,r);return o}function op(e,t,o){const a=e._getTarget();t in a||(a[t]={});const r=a[t];return Ye(r)&&_e(o)?o:r||{}}function ap(e,t,o,a){let r;for(const s of t)if(r=Cl(Jm(s,e),o),typeof r<"u")return Ir(e,r)?Lr(o,a,e,r):r}function Cl(e,t){for(const o of t){if(!o)continue;const a=o[e];if(typeof a<"u")return a}}function Bl(e){let t=e._keys;return t||(t=e._keys=rp(e._scopes)),t}function rp(e){const t=new Set;for(const o of e)for(const a of Object.keys(o).filter(r=>!r.startsWith("_")))t.add(a);return Array.from(t)}const sp=Number.EPSILON||1e-14,Rn=(e,t)=>t<e.length&&!e[t].skip&&e[t],El=e=>e==="x"?"y":"x";function ip(e,t,o,a){const r=e.skip?t:e,s=t,i=o.skip?t:o,l=Vr(s,r),c=Vr(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=a*d,h=a*u;return{previous:{x:s.x-f*(i.x-r.x),y:s.y-f*(i.y-r.y)},next:{x:s.x+h*(i.x-r.x),y:s.y+h*(i.y-r.y)}}}function lp(e,t,o){const a=e.length;let r,s,i,l,c,d=Rn(e,0);for(let u=0;u<a-1;++u)if(c=d,d=Rn(e,u+1),!(!c||!d)){if(co(t[u],0,sp)){o[u]=o[u+1]=0;continue}r=o[u]/t[u],s=o[u+1]/t[u],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=r*i*t[u],o[u+1]=s*i*t[u])}}function cp(e,t,o="x"){const a=El(o),r=e.length;let s,i,l,c=Rn(e,0);for(let d=0;d<r;++d){if(i=l,l=c,c=Rn(e,d+1),!l)continue;const u=l[o],f=l[a];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${a}`]=f-s*t[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${a}`]=f+s*t[d])}}function dp(e,t="x"){const o=El(t),a=e.length,r=Array(a).fill(0),s=Array(a);let i,l,c,d=Rn(e,0);for(i=0;i<a;++i)if(l=c,c=d,d=Rn(e,i+1),!!c){if(d){const u=d[t]-c[t];r[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?Dt(r[i-1])!==Dt(r[i])?0:(r[i-1]+r[i])/2:r[i-1]:r[i]}lp(e,r,s),cp(e,s,t)}function na(e,t,o){return Math.max(Math.min(e,o),t)}function up(e,t){let o,a,r,s,i,l=po(e[0],t);for(o=0,a=e.length;o<a;++o)i=s,s=l,l=o<a-1&&po(e[o+1],t),s&&(r=e[o],i&&(r.cp1x=na(r.cp1x,t.left,t.right),r.cp1y=na(r.cp1y,t.top,t.bottom)),l&&(r.cp2x=na(r.cp2x,t.left,t.right),r.cp2y=na(r.cp2y,t.top,t.bottom)))}function fp(e,t,o,a,r){let s,i,l,c;if(t.spanGaps&&(e=e.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")dp(e,r);else{let d=a?e[e.length-1]:e[0];for(s=0,i=e.length;s<i;++s)l=e[s],c=ip(d,l,e[Math.min(s+1,i-(a?0:1))%i],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&up(e,o)}function $r(){return typeof window<"u"&&typeof document<"u"}function Wr(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function oa(e,t,o){let a;return typeof e=="string"?(a=parseInt(e,10),e.indexOf("%")!==-1&&(a=a/100*t.parentNode[o])):a=e,a}const aa=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function hp(e,t){return aa(e).getPropertyValue(t)}const mp=["top","right","bottom","left"];function Bn(e,t,o){const a={};o=o?"-"+o:"";for(let r=0;r<4;r++){const s=mp[r];a[s]=parseFloat(e[t+"-"+s+o])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const pp=(e,t,o)=>(e>0||t>0)&&(!o||!o.shadowRoot);function gp(e,t){const o=e.touches,a=o&&o.length?o[0]:e,{offsetX:r,offsetY:s}=a;let i=!1,l,c;if(pp(r,s,e.target))l=r,c=s;else{const d=t.getBoundingClientRect();l=a.clientX-d.left,c=a.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function En(e,t){if("native"in e)return e;const{canvas:o,currentDevicePixelRatio:a}=t,r=aa(o),s=r.boxSizing==="border-box",i=Bn(r,"padding"),l=Bn(r,"border","width"),{x:c,y:d,box:u}=gp(e,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:g}=t;return s&&(m-=i.width+l.width,g-=i.height+l.height),{x:Math.round((c-f)/m*o.width/a),y:Math.round((d-h)/g*o.height/a)}}function bp(e,t,o){let a,r;if(t===void 0||o===void 0){const s=e&&Wr(e);if(!s)t=e.clientWidth,o=e.clientHeight;else{const i=s.getBoundingClientRect(),l=aa(s),c=Bn(l,"border","width"),d=Bn(l,"padding");t=i.width-d.width-c.width,o=i.height-d.height-c.height,a=oa(l.maxWidth,s,"clientWidth"),r=oa(l.maxHeight,s,"clientHeight")}}return{width:t,height:o,maxWidth:a||Ko,maxHeight:r||Ko}}const an=e=>Math.round(e*10)/10;function yp(e,t,o,a){const r=aa(e),s=Bn(r,"margin"),i=oa(r.maxWidth,e,"clientWidth")||Ko,l=oa(r.maxHeight,e,"clientHeight")||Ko,c=bp(e,t,o);let{width:d,height:u}=c;if(r.boxSizing==="content-box"){const h=Bn(r,"border","width"),m=Bn(r,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,a?d/a:u-s.height),d=an(Math.min(d,i,c.maxWidth)),u=an(Math.min(u,l,c.maxHeight)),d&&!u&&(u=an(d/2)),(t!==void 0||o!==void 0)&&a&&c.height&&u>c.height&&(u=c.height,d=an(Math.floor(u*a))),{width:d,height:u}}function _l(e,t,o){const a=t||1,r=an(e.height*a),s=an(e.width*a);e.height=an(e.height),e.width=an(e.width);const i=e.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${e.height}px`,i.style.width=`${e.width}px`),e.currentDevicePixelRatio!==a||i.height!==r||i.width!==s?(e.currentDevicePixelRatio=a,i.height=r,i.width=s,e.ctx.setTransform(a,0,0,a,0,0),!0):!1}const xp=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};$r()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Sl(e,t){const o=hp(e,t),a=o&&o.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function _n(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:e.y+o*(t.y-e.y)}}function kp(e,t,o,a){return{x:e.x+o*(t.x-e.x),y:a==="middle"?o<.5?e.y:t.y:a==="after"?o<1?e.y:t.y:o>0?t.y:e.y}}function wp(e,t,o,a){const r={x:e.cp2x,y:e.cp2y},s={x:t.cp1x,y:t.cp1y},i=_n(e,r,o),l=_n(r,s,o),c=_n(s,t,o),d=_n(i,l,o),u=_n(l,c,o);return _n(d,u,o)}const Cp=function(e,t){return{x(o){return e+e+t-o},setWidth(o){t=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,a){return o-a},leftForLtr(o,a){return o-a}}},Bp=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function In(e,t,o){return e?Cp(t,o):Bp()}function Al(e,t){let o,a;(t==="ltr"||t==="rtl")&&(o=e.canvas.style,a=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",t,"important"),e.prevTextDirection=a)}function Vl(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function Dl(e){return e==="angle"?{between:fo,compare:Cm,normalize:mt}:{between:Wt,compare:(t,o)=>t-o,normalize:t=>t}}function Ml({start:e,end:t,count:o,loop:a,style:r}){return{start:e%o,end:t%o,loop:a&&(t-e+1)%o===0,style:r}}function Ep(e,t,o){const{property:a,start:r,end:s}=o,{between:i,normalize:l}=Dl(a),c=t.length;let{start:d,end:u,loop:f}=e,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(t[d%c][a]),r,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:e.style}}function Nl(e,t,o){if(!o)return[e];const{property:a,start:r,end:s}=o,i=t.length,{compare:l,between:c,normalize:d}=Dl(a),{start:u,end:f,loop:h,style:m}=Ep(e,t,o),g=[];let y=!1,k=null,p,B,C;const w=()=>c(r,C,p)&&l(r,C)!==0,E=()=>l(s,p)===0||c(s,C,p),_=()=>y||w(),x=()=>!y||E();for(let b=u,A=u;b<=f;++b)B=t[b%i],!B.skip&&(p=d(B[a]),p!==C&&(y=c(p,r,s),k===null&&_()&&(k=l(p,r)===0?b:A),k!==null&&x()&&(g.push(Ml({start:k,end:b,loop:h,count:i,style:m})),k=null),A=b,C=p));return k!==null&&g.push(Ml({start:k,end:f,loop:h,count:i,style:m})),g}function vl(e,t){const o=[],a=e.segments;for(let r=0;r<a.length;r++){const s=Nl(a[r],e.points,t);s.length&&o.push(...s)}return o}function _p(e,t,o,a){let r=0,s=t-1;if(o&&!a)for(;r<t&&!e[r].skip;)r++;for(;r<t&&e[r].skip;)r++;for(r%=t,o&&(s+=r);s>r&&e[s%t].skip;)s--;return s%=t,{start:r,end:s}}function Sp(e,t,o,a){const r=e.length,s=[];let i=t,l=e[t],c;for(c=t+1;c<=o;++c){const d=e[c%r];d.skip||d.stop?l.skip||(a=!1,s.push({start:t%r,end:(c-1)%r,loop:a}),t=i=d.stop?c:null):(i=c,l.skip&&(t=c)),l=d}return i!==null&&s.push({start:t%r,end:i%r,loop:a}),s}function Ap(e,t){const o=e.points,a=e.options.spanGaps,r=o.length;if(!r)return[];const s=!!e._loop,{start:i,end:l}=_p(o,r,s,a);if(a===!0)return Pl(e,[{start:i,end:l,loop:s}],o,t);const c=l<i?l+r:l,d=!!e._fullLoop&&i===0&&l===r-1;return Pl(e,Sp(o,i,c,d),o,t)}function Pl(e,t,o,a){return!a||!a.setContext||!o?t:Vp(e,t,o,a)}function Vp(e,t,o,a){const r=e._chart.getContext(),s=Tl(e.options),{_datasetIndex:i,options:{spanGaps:l}}=e,c=o.length,d=[];let u=s,f=t[0].start,h=f;function m(g,y,k,p){const B=l?-1:1;if(g!==y){for(g+=c;o[g%c].skip;)g-=B;for(;o[y%c].skip;)y+=B;g%c!==y%c&&(d.push({start:g%c,end:y%c,loop:k,style:p}),u=p,f=y%c)}}for(const g of t){f=l?f:g.start;let y=o[f%c],k;for(h=f+1;h<=g.end;h++){const p=o[h%c];k=Tl(a.setContext(Cn(r,{type:"segment",p0:y,p1:p,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Dp(k,u)&&m(f,h-1,g.loop,u),y=p,u=k}f<h-1&&m(f,h-1,g.loop,u)}return d}function Tl(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Dp(e,t){if(!t)return!1;const o=[],a=function(r,s){return Nr(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(e,a)!==JSON.stringify(t,a)}function ra(e,t,o){return e.options.clip?e[o]:t[o]}function Mp(e,t){const{xScale:o,yScale:a}=e;return o&&a?{left:ra(o,t,"left"),right:ra(o,t,"right"),top:ra(a,t,"top"),bottom:ra(a,t,"bottom")}:t}function Ol(e,t){const o=t._clip;if(o.disabled)return!1;const a=Mp(t,e.chartArea);return{left:o.left===!1?0:a.left-(o.left===!0?0:o.left),right:o.right===!1?e.width:a.right+(o.right===!0?0:o.right),top:o.top===!1?0:a.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?e.height:a.bottom+(o.bottom===!0?0:o.bottom)}}/*!
11
+ */function tn(){}const sp=(()=>{let t=0;return()=>t++})();function Re(t){return t==null}function rt(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 Te(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function ut(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Wt(t,n){return ut(t)?t:n}function De(t,n){return typeof t>"u"?n:t}const ip=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,cl=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function Ye(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Ue(t,n,o,r){let a,s,i;if(rt(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Te(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function dr(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 ur(t){if(rt(t))return t.map(ur);if(Te(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=ur(t[o[a]]);return n}return t}function dl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function lp(t,n,o,r){if(!dl(t))return;const a=n[t],s=o[t];Te(a)&&Te(s)?Co(a,s,r):n[t]=ur(s)}function Co(t,n,o){const r=rt(n)?n:[n],a=r.length;if(!Te(t))return t;o=o||{};const s=o.merger||lp;let i;for(let l=0;l<a;++l){if(i=r[l],!Te(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 Eo(t,n){return Co(t,n,{merger:cp})}function cp(t,n,o){if(!dl(t))return;const r=n[t],a=o[t];Te(r)&&Te(a)?Eo(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=ur(a))}const ul={"":t=>t,x:t=>t.x,y:t=>t.y};function dp(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 up(t){const n=dp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function Mn(t,n){return(ul[n]||(ul[n]=up(n)))(t)}function Ra(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Bo=t=>typeof t<"u",bn=t=>typeof t=="function",fl=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function fp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const He=Math.PI,Je=2*He,hp=Je+He,fr=Number.POSITIVE_INFINITY,mp=He/180,it=He/2,vn=He/4,hl=He*2/3,ml=Math.log10,Ut=Math.sign;function _o(t,n,o){return Math.abs(t-n)<o}function pl(t){const n=Math.round(t);t=_o(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(ml(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function pp(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 gp(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function So(t){return!gp(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function bp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function yp(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 nn(t){return t*(He/180)}function xp(t){return t*(180/He)}function gl(t){if(!ut(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function bl(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*He&&(s+=Je),{angle:s,distance:a}}function La(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function kp(t,n){return(t-n+hp)%Je-He}function Ct(t){return(t%Je+Je)%Je}function Ao(t,n,o,r){const a=Ct(t),s=Ct(n),i=Ct(o),l=Ct(s-a),c=Ct(i-a),d=Ct(a-s),u=Ct(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function ft(t,n,o){return Math.max(n,Math.min(o,t))}function wp(t){return ft(t,-32768,32767)}function on(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function $a(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 Pn=(t,n,o,r)=>$a(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),Cp=(t,n,o)=>$a(t,o,r=>t[r][n]>=o);function Ep(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 yl=["push","pop","shift","splice","unshift"];function Bp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),yl.forEach(o=>{const r="_onData"+Ra(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 xl(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)&&(yl.forEach(s=>{delete t[s]}),delete t._chartjs)}function kl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const wl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Cl(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,wl.call(window,()=>{r=!1,t.apply(n,o)}))}}function _p(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const ja=t=>t==="start"?"left":t==="end"?"right":"center",ht=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,Sp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Ap(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:h,minDefined:m,maxDefined:g}=i.getUserBounds();if(m){if(a=Math.min(Pn(c,u,f).lo,o?r:Pn(n,u,i.getPixelForValue(f)).lo),d){const b=c.slice(0,a+1).reverse().findIndex(x=>!Re(x[l.axis]));a-=Math.max(0,b)}a=ft(a,0,r-1)}if(g){let b=Math.max(Pn(c,i.axis,h,!0).hi+1,o?0:Pn(n,u,i.getPixelForValue(h),!0).hi+1);if(d){const x=c.slice(b-1).findIndex(p=>!Re(p[l.axis]));b+=Math.max(0,x)}s=ft(b,a,r)-a}else s=r-a}return{start:a,count:s}}function Vp(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 hr=t=>t===0||t===1,El=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*Je/o)),Bl=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*Je/o)+1,Vo={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*it)+1,easeOutSine:t=>Math.sin(t*it),easeInOutSine:t=>-.5*(Math.cos(He*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=>hr(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=>hr(t)?t:El(t,.075,.3),easeOutElastic:t=>hr(t)?t:Bl(t,.075,.3),easeInOutElastic(t){return hr(t)?t:t<.5?.5*El(t*2,.1125,.45):.5+.5*Bl(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-Vo.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?Vo.easeInBounce(t*2)*.5:Vo.easeOutBounce(t*2-1)*.5+.5};function Wa(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function _l(t){return Wa(t)?t:new wo(t)}function Ua(t){return Wa(t)?t:new wo(t).saturate(.5).darken(.1).hexString()}const Dp=["x","y","borderWidth","radius","tension"],Np=["color","borderColor","backgroundColor"];function Mp(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:Np},numbers:{type:"number",properties:Dp}}),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 vp(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Sl=new Map;function Pp(t,n){n=n||{};const o=t+JSON.stringify(n);let r=Sl.get(o);return r||(r=new Intl.NumberFormat(t,n),Sl.set(o,r)),r}function Ha(t,n,o){return Pp(n,o).format(t)}const Tp={values(t){return rt(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=Op(t,o)}const i=ml(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),Ha(t,r,c)}};function Op(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 Al={formatters:Tp};function Fp(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:Al.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 Tn=Object.create(null),qa=Object.create(null);function Do(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 Ga(t,n,o){return typeof n=="string"?Co(Do(t,n),o):Co(Do(t,""),n)}class zp{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)=>Ua(a.backgroundColor),this.hoverBorderColor=(r,a)=>Ua(a.borderColor),this.hoverColor=(r,a)=>Ua(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 Ga(this,n,o)}get(n){return Do(this,n)}describe(n,o){return Ga(qa,n,o)}override(n,o){return Ga(Tn,n,o)}route(n,o,r,a){const s=Do(this,n),i=Do(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 Te(c)?Object.assign({},d,c):De(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var tt=new zp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Mp,vp,Fp]);function Ip(t){return!t||Re(t.size)||Re(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Vl(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 On(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 Dl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function Xa(t,n,o,r){Nl(t,n,o,r,null)}function Nl(t,n,o,r,a){let s,i,l,c,d,u,f,h;const m=n.pointStyle,g=n.rotation,b=n.radius;let x=(g||0)*mp;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(x),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(b)||b<=0)){switch(t.beginPath(),m){default:a?t.ellipse(o,r,a/2,b,0,0,Je):t.arc(o,r,b,0,Je),t.closePath();break;case"triangle":u=a?a/2:b,t.moveTo(o+Math.sin(x)*u,r-Math.cos(x)*b),x+=hl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*b),x+=hl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*b),t.closePath();break;case"rectRounded":d=b*.516,c=b-d,i=Math.cos(x+vn)*c,f=Math.cos(x+vn)*(a?a/2-d:c),l=Math.sin(x+vn)*c,h=Math.sin(x+vn)*(a?a/2-d:c),t.arc(o-f,r-l,d,x-He,x-it),t.arc(o+h,r-i,d,x-it,x),t.arc(o+f,r+l,d,x,x+it),t.arc(o-h,r+i,d,x+it,x+He),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*b,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}x+=vn;case"rectRot":f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+h,r-i),t.lineTo(o+f,r+l),t.lineTo(o-h,r+i),t.closePath();break;case"crossRot":x+=vn;case"cross":f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"star":f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i),x+=vn,f=Math.cos(x)*(a?a/2:b),i=Math.cos(x)*b,l=Math.sin(x)*b,h=Math.sin(x)*(a?a/2:b),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"line":i=a?a/2:Math.cos(x)*b,l=Math.sin(x)*b,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(x)*(a?a/2:b),r+Math.sin(x)*b);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function No(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 mr(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function pr(t){t.restore()}function Rp(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 Lp(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 $p(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),Re(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 jp(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 Wp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function Mo(t,n,o,r,a,s={}){const i=rt(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,$p(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Wp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Re(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),jp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function gr(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*He,He,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,He,it,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,it,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-it,!0),t.lineTo(o+i.topLeft,r)}const Up=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Hp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function qp(t,n){const o=(""+t).match(Up);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 Gp=t=>+t||0;function Ka(t,n){const o={},r=Te(n),a=r?Object.keys(n):n,s=Te(t)?r?i=>De(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=Gp(s(i));return o}function Ml(t){return Ka(t,{top:"y",right:"x",bottom:"y",left:"x"})}function Yn(t){return Ka(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Nt(t){const n=Ml(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function mt(t,n){t=t||{},n=n||tt.font;let o=De(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=De(t.style,n.style);r&&!(""+r).match(Hp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:De(t.family,n.family),lineHeight:qp(De(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:De(t.weight,n.weight),string:""};return a.string=Ip(a),a}function br(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 Xp(t,n,o){const{min:r,max:a}=t,s=cl(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 Fn(t,n){return Object.assign(Object.create(t),n)}function Ya(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Fl("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>Ya([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 Pl(l,c,()=>ng(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return zl(l).includes(c)},ownKeys(l){return zl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function Jn(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:vl(t,r),setContext:s=>Jn(t,s,o,r),override:s=>Jn(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 Pl(s,i,()=>Yp(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 vl(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:bn(o)?o:()=>o,isIndexable:bn(r)?r:()=>r}}const Kp=(t,n)=>t?t+Ra(n):n,Ja=(t,n)=>Te(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function Pl(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function Yp(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return bn(l)&&i.isScriptable(n)&&(l=Jp(n,l,t,o)),rt(l)&&l.length&&(l=Qp(n,l,t,i.isIndexable)),Ja(n,l)&&(l=Jn(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),Ja(t,c)&&(c=Qa(a._scopes,a,t,c)),c}function Qp(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(Te(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=Qa(d,a,t,u);n.push(Jn(f,s,i&&i[t],l))}}return n}function Tl(t,n,o){return bn(t)?t(n,o):t}const Zp=(t,n)=>t===!0?n:typeof t=="string"?Mn(n,t):void 0;function eg(t,n,o,r,a){for(const s of n){const i=Zp(o,s);if(i){t.add(i);const l=Tl(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 Qa(t,n,o,r){const a=n._rootScopes,s=Tl(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Ol(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Ol(l,i,s,c,r),c===null)?!1:Ya(Array.from(l),[""],a,s,()=>tg(n,o,r))}function Ol(t,n,o,r,a){for(;o;)o=eg(t,n,o,r,a);return o}function tg(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return rt(a)&&Te(o)?o:a||{}}function ng(t,n,o,r){let a;for(const s of n)if(a=Fl(Kp(s,t),o),typeof a<"u")return Ja(t,a)?Qa(o,r,t,a):a}function Fl(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function zl(t){let n=t._keys;return n||(n=t._keys=og(t._scopes)),n}function og(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 rg=Number.EPSILON||1e-14,Qn=(t,n)=>n<t.length&&!t[n].skip&&t[n],Il=t=>t==="x"?"y":"x";function ag(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=La(s,a),c=La(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,h=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+h*(i.x-a.x),y:s.y+h*(i.y-a.y)}}}function sg(t,n,o){const r=t.length;let a,s,i,l,c,d=Qn(t,0);for(let u=0;u<r-1;++u)if(c=d,d=Qn(t,u+1),!(!c||!d)){if(_o(n[u],0,rg)){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 ig(t,n,o="x"){const r=Il(o),a=t.length;let s,i,l,c=Qn(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=Qn(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 lg(t,n="x"){const o=Il(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=Qn(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=Qn(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?Ut(a[i-1])!==Ut(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}sg(t,a,s),ig(t,s,n)}function yr(t,n,o){return Math.max(Math.min(t,o),n)}function cg(t,n){let o,r,a,s,i,l=No(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&No(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=yr(a.cp1x,n.left,n.right),a.cp1y=yr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=yr(a.cp2x,n.left,n.right),a.cp2y=yr(a.cp2y,n.top,n.bottom)))}function dg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")lg(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=ag(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&&cg(t,o)}function Za(){return typeof window<"u"&&typeof document<"u"}function es(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function xr(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 kr=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function ug(t,n){return kr(t).getPropertyValue(n)}const fg=["top","right","bottom","left"];function zn(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=fg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const hg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function mg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(hg(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 In(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=kr(o),s=a.boxSizing==="border-box",i=zn(a,"padding"),l=zn(a,"border","width"),{x:c,y:d,box:u}=mg(t,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:g}=n;return s&&(m-=i.width+l.width,g-=i.height+l.height),{x:Math.round((c-f)/m*o.width/r),y:Math.round((d-h)/g*o.height/r)}}function pg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&es(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=kr(s),c=zn(l,"border","width"),d=zn(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=xr(l.maxWidth,s,"clientWidth"),a=xr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||fr,maxHeight:a||fr}}const yn=t=>Math.round(t*10)/10;function gg(t,n,o,r){const a=kr(t),s=zn(a,"margin"),i=xr(a.maxWidth,t,"clientWidth")||fr,l=xr(a.maxHeight,t,"clientHeight")||fr,c=pg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const h=zn(a,"border","width"),m=zn(a,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=yn(Math.min(d,i,c.maxWidth)),u=yn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=yn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=yn(Math.floor(u*r))),{width:d,height:u}}function Rl(t,n,o){const r=n||1,a=yn(t.height*r),s=yn(t.width*r);t.height=yn(t.height),t.width=yn(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 bg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};Za()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function Ll(t,n){const o=ug(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Rn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function yg(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 xg(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Rn(t,a,o),l=Rn(a,s,o),c=Rn(s,n,o),d=Rn(i,l,o),u=Rn(l,c,o);return Rn(d,u,o)}const kg=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}}},wg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function Zn(t,n,o){return t?kg(n,o):wg()}function $l(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 jl(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function Wl(t){return t==="angle"?{between:Ao,compare:kp,normalize:Ct}:{between:on,compare:(n,o)=>n-o,normalize:n=>n}}function Ul({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 Cg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=Wl(r),c=n.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(n[d%c][r]),a,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Hl(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=Wl(r),{start:u,end:f,loop:h,style:m}=Cg(t,n,o),g=[];let b=!1,x=null,p,E,C;const w=()=>c(a,C,p)&&l(a,C)!==0,_=()=>l(s,p)===0||c(s,C,p),B=()=>b||w(),k=()=>!b||_();for(let y=u,V=u;y<=f;++y)E=n[y%i],!E.skip&&(p=d(E[r]),p!==C&&(b=c(p,a,s),x===null&&B()&&(x=l(p,a)===0?y:V),x!==null&&k()&&(g.push(Ul({start:x,end:y,loop:h,count:i,style:m})),x=null),V=y,C=p));return x!==null&&g.push(Ul({start:x,end:f,loop:h,count:i,style:m})),g}function ql(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=Hl(r[a],t.points,n);s.length&&o.push(...s)}return o}function Eg(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 Bg(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 _g(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=Eg(o,a,s,r);if(r===!0)return Gl(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 Gl(t,Bg(o,i,c,d),o,n)}function Gl(t,n,o,r){return!r||!r.setContext||!o?n:Sg(t,n,o,r)}function Sg(t,n,o,r){const a=t._chart.getContext(),s=Xl(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,h=f;function m(g,b,x,p){const E=l?-1:1;if(g!==b){for(g+=c;o[g%c].skip;)g-=E;for(;o[b%c].skip;)b+=E;g%c!==b%c&&(d.push({start:g%c,end:b%c,loop:x,style:p}),u=p,f=b%c)}}for(const g of n){f=l?f:g.start;let b=o[f%c],x;for(h=f+1;h<=g.end;h++){const p=o[h%c];x=Xl(r.setContext(Fn(a,{type:"segment",p0:b,p1:p,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Ag(x,u)&&m(f,h-1,g.loop,u),b=p,u=x}f<h-1&&m(f,h-1,g.loop,u)}return d}function Xl(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Ag(t,n){if(!n)return!1;const o=[],r=function(a,s){return Wa(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function wr(t,n,o){return t.options.clip?t[o]:n[o]}function Vg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:wr(o,n,"left"),right:wr(o,n,"right"),top:wr(r,n,"top"),bottom:wr(r,n,"bottom")}:n}function Kl(t,n){const o=n._clip;if(o.disabled)return!1;const r=Vg(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 Np{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,o,a,r){const s=o.listeners[r],i=o.duration;s.forEach(l=>l({chart:t,initial:o.initial,numSteps:i,currentStep:Math.min(a-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=il.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let o=0;this._charts.forEach((a,r)=>{if(!a.running||!a.items.length)return;const s=a.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>a.duration&&(a.duration=c._total),c.tick(t),l=!0):(s[i]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,a,t,"progress")),s.length||(a.running=!1,this._notify(r,a,t,"complete"),a.initial=!1),o+=s.length}),this._lastDate=t,o===0&&(this._running=!1)}_getAnims(t){const o=this._charts;let a=o.get(t);return a||(a={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(t,a)),a}listen(t,o,a){this._getAnims(t).listeners[o].push(a)}add(t,o){!o||!o.length||this._getAnims(t).items.push(...o)}has(t){return this._getAnims(t).items.length>0}start(t){const o=this._charts.get(t);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((a,r)=>Math.max(a,r._duration),0),this._refresh())}running(t){if(!this._running)return!1;const o=this._charts.get(t);return!(!o||!o.running||!o.items.length)}stop(t){const o=this._charts.get(t);if(!o||!o.items.length)return;const a=o.items;let r=a.length-1;for(;r>=0;--r)a[r].cancel();o.items=[],this._notify(t,o,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var jt=new Np;const zl="transparent",vp={boolean(e,t,o){return o>.5?t:e},color(e,t,o){const a=ul(e||zl),r=a.valid&&ul(t||zl);return r&&r.valid?r.mix(a,o).hexString():t},number(e,t,o){return e+(t-e)*o}};class Pp{constructor(t,o,a,r){const s=o[a];r=ta([t.to,r,s,t.from]);const i=ta([t.from,s,r]);this._active=!0,this._fn=t.fn||vp[t.type||typeof i],this._easing=ho[t.easing]||ho.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=o,this._prop=a,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(t,o,a){if(this._active){this._notify(!1);const r=this._target[this._prop],s=a-this._start,i=this._duration-s;this._start=a,this._duration=Math.floor(Math.max(i,t.duration)),this._total+=s,this._loop=!!t.loop,this._to=ta([t.to,o,r,t.from]),this._from=ta([t.from,r,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const o=t-this._start,a=this._duration,r=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<a),!this._active){this._target[r]=l,this._notify(!0);return}if(o<0){this._target[r]=s;return}c=o/a%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[r]=this._fn(s,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((o,a)=>{t.push({res:o,rej:a})})}_notify(t){const o=t?"res":"rej",a=this._promises||[];for(let r=0;r<a.length;r++)a[r][o]()}}class Fl{constructor(t,o){this._chart=t,this._properties=new Map,this.configure(o)}configure(t){if(!_e(t))return;const o=Object.keys(He.animation),a=this._properties;Object.getOwnPropertyNames(t).forEach(r=>{const s=t[r];if(!_e(s))return;const i={};for(const l of o)i[l]=s[l];(Ye(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!a.has(l))&&a.set(l,i)})})}_animateOptions(t,o){const a=o.options,r=Op(t,a);if(!r)return[];const s=this._createAnimations(r,a);return a.$shared&&Tp(t.options.$animations,a).then(()=>{t.options=a},()=>{}),s}_createAnimations(t,o){const a=this._properties,r=[],s=t.$animations||(t.$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"){r.push(...this._animateOptions(t,o));continue}const u=o[d];let f=s[d];const h=a.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){t[d]=u;continue}s[d]=f=new Pp(h,t,d,u),r.push(f)}return r}update(t,o){if(this._properties.size===0){Object.assign(t,o);return}const a=this._createAnimations(t,o);if(a.length)return jt.add(this._chart,a),!0}}function Tp(e,t){const o=[],a=Object.keys(t);for(let r=0;r<a.length;r++){const s=e[a[r]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function Op(e,t){if(!t)return;let o=e.options;if(!o){e.options=t;return}return o.$shared&&(e.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function Rl(e,t){const o=e&&e.options||{},a=o.reverse,r=o.min===void 0?t:0,s=o.max===void 0?t:0;return{start:a?s:r,end:a?r:s}}function zp(e,t,o){if(o===!1)return!1;const a=Rl(e,o),r=Rl(t,o);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Fp(e){let t,o,a,r;return _e(e)?(t=e.top,o=e.right,a=e.bottom,r=e.left):t=o=a=r=e,{top:t,right:o,bottom:a,left:r,disabled:e===!1}}function Il(e,t){const o=[],a=e._getSortedDatasetMetas(t);let r,s;for(r=0,s=a.length;r<s;++r)o.push(a[r].index);return o}function Ll(e,t,o,a={}){const r=e.keys,s=a.mode==="single";let i,l,c,d;if(t===null)return;let u=!1;for(i=0,l=r.length;i<l;++i){if(c=+r[i],c===o){if(u=!0,a.all)continue;break}d=e.values[c],ot(d)&&(s||t===0||Dt(t)===Dt(d))&&(t+=d)}return!u&&!a.all?0:t}function Rp(e,t){const{iScale:o,vScale:a}=t,r=o.axis==="x"?"x":"y",s=a.axis==="x"?"x":"y",i=Object.keys(e),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[r]:u,[s]:e[u]};return l}function jr(e,t){const o=e&&e.options.stacked;return o||o===void 0&&t.stack!==void 0}function Ip(e,t,o){return`${e.id}.${t.id}.${o.stack||o.type}`}function Lp(e){const{min:t,max:o,minDefined:a,maxDefined:r}=e.getUserBounds();return{min:a?t:Number.NEGATIVE_INFINITY,max:r?o:Number.POSITIVE_INFINITY}}function $p(e,t,o){const a=e[t]||(e[t]={});return a[o]||(a[o]={})}function $l(e,t,o,a){for(const r of t.getMatchingVisibleMetas(a).reverse()){const s=e[r.index];if(o&&s>0||!o&&s<0)return r.index}return null}function Wl(e,t){const{chart:o,_cachedMeta:a}=e,r=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=a,c=s.axis,d=i.axis,u=Ip(s,i,a),f=t.length;let h;for(let m=0;m<f;++m){const g=t[m],{[c]:y,[d]:k}=g,p=g._stacks||(g._stacks={});h=p[d]=$p(r,u,y),h[l]=k,h._top=$l(h,i,!0,a.type),h._bottom=$l(h,i,!1,a.type);const B=h._visualValues||(h._visualValues={});B[l]=k}}function Ur(e,t){const o=e.scales;return Object.keys(o).filter(a=>o[a].axis===t).shift()}function Wp(e,t){return Cn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function jp(e,t,o){return Cn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:o,index:t,mode:"default",type:"data"})}function bo(e,t){const o=e.controller.index,a=e.vScale&&e.vScale.axis;if(a){t=t||e._parsed;for(const r of t){const s=r._stacks;if(!s||s[a]===void 0||s[a][o]===void 0)return;delete s[a][o],s[a]._visualValues!==void 0&&s[a]._visualValues[o]!==void 0&&delete s[a]._visualValues[o]}}}const Hr=e=>e==="reset"||e==="none",jl=(e,t)=>t?e:Object.assign({},e),Up=(e,t,o)=>e&&!t.hidden&&t._stacked&&{keys:Il(o,!0),values:null};class Sn{constructor(t,o){this.chart=t,this._ctx=t.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 t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=jr(t.vScale,t),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(t){this.index!==t&&bo(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,o=this._cachedMeta,a=this.getDataset(),r=(f,h,m,g)=>f==="x"?h:f==="r"?g:m,s=o.xAxisID=Ce(a.xAxisID,Ur(t,"x")),i=o.yAxisID=Ce(a.yAxisID,Ur(t,"y")),l=o.rAxisID=Ce(a.rAxisID,Ur(t,"r")),c=o.indexAxis,d=o.iAxisID=r(c,s,i,l),u=o.vAxisID=r(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(t){return this.chart.scales[t]}_getOtherScale(t){const o=this._cachedMeta;return t===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&rl(this._data,this),t._stacked&&bo(t)}_dataCheck(){const t=this.getDataset(),o=t.data||(t.data=[]),a=this._data;if(_e(o)){const r=this._cachedMeta;this._data=Rp(o,r)}else if(a!==o){if(a){rl(a,this);const r=this._cachedMeta;bo(r),r._parsed=[]}o&&Object.isExtensible(o)&&Sm(o,this),this._syncList=[],this._data=o}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const o=this._cachedMeta,a=this.getDataset();let r=!1;this._dataCheck();const s=o._stacked;o._stacked=jr(o.vScale,o),o.stack!==a.stack&&(r=!0,bo(o),o.stack=a.stack),this._resyncElements(t),(r||s!==o._stacked)&&(Wl(this,o._parsed),o._stacked=jr(o.vScale,o))}configure(){const t=this.chart.config,o=t.datasetScopeKeys(this._type),a=t.getOptionScopes(this.getDataset(),o,!0);this.options=t.createResolver(a,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,o){const{_cachedMeta:a,_data:r}=this,{iScale:s,_stacked:i}=a,l=s.axis;let c=t===0&&o===r.length?!0:a._sorted,d=t>0&&a._parsed[t-1],u,f,h;if(this._parsing===!1)a._parsed=r,a._sorted=!0,h=r;else{Ye(r[t])?h=this.parseArrayData(a,r,t,o):_e(r[t])?h=this.parseObjectData(a,r,t,o):h=this.parsePrimitiveData(a,r,t,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)a._parsed[u+t]=f=h[u],c&&(m()&&(c=!1),d=f);a._sorted=c}i&&Wl(this,h)}parsePrimitiveData(t,o,a,r){const{iScale:s,vScale:i}=t,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(r);let h,m,g;for(h=0,m=r;h<m;++h)g=h+a,f[h]={[l]:u||s.parse(d[g],g),[c]:i.parse(o[g],g)};return f}parseArrayData(t,o,a,r){const{xScale:s,yScale:i}=t,l=new Array(r);let c,d,u,f;for(c=0,d=r;c<d;++c)u=c+a,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(t,o,a,r){const{xScale:s,yScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(r);let u,f,h,m;for(u=0,f=r;u<f;++u)h=u+a,m=o[h],d[u]={x:s.parse(bn(m,l),h),y:i.parse(bn(m,c),h)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,o,a){const r=this.chart,s=this._cachedMeta,i=o[t.axis],l={keys:Il(r,!0),values:o._stacks[t.axis]._visualValues};return Ll(l,i,s.index,{mode:a})}updateRangeFromParsed(t,o,a,r){const s=a[o.axis];let i=s===null?NaN:s;const l=r&&a._stacks[o.axis];r&&l&&(r.values=l,i=Ll(r,s,this._cachedMeta.index)),t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}getMinMax(t,o){const a=this._cachedMeta,r=a._parsed,s=a._sorted&&t===a.iScale,i=r.length,l=this._getOtherScale(t),c=Up(o,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Lp(l);let h,m;function g(){m=r[h];const y=m[l.axis];return!ot(m[t.axis])||u>y||f<y}for(h=0;h<i&&!(!g()&&(this.updateRangeFromParsed(d,t,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(d,t,m,c);break}}return d}getAllParsedValues(t){const o=this._cachedMeta._parsed,a=[];let r,s,i;for(r=0,s=o.length;r<s;++r)i=o[r][t.axis],ot(i)&&a.push(i);return a}getMaxOverflow(){return!1}getLabelAndValue(t){const o=this._cachedMeta,a=o.iScale,r=o.vScale,s=this.getParsed(t);return{label:a?""+a.getLabelForValue(s[a.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(t){const o=this._cachedMeta;this.update(t||"default"),o._clip=Fp(Ce(this.options.clip,zp(o.xScale,o.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,o=this.chart,a=this._cachedMeta,r=a.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let u;for(a.dataset&&a.dataset.draw(t,s,l,c),u=l;u<l+c;++u){const f=r[u];f.hidden||(f.active&&d?i.push(f):f.draw(t,s))}for(u=0;u<i.length;++u)i[u].draw(t,s)}getStyle(t,o){const a=o?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(a):this.resolveDataElementOptions(t||0,a)}getContext(t,o,a){const r=this.getDataset();let s;if(t>=0&&t<this._cachedMeta.data.length){const i=this._cachedMeta.data[t];s=i.$context||(i.$context=jp(this.getContext(),t,i)),s.parsed=this.getParsed(t),s.raw=r.data[t],s.index=s.dataIndex=t}else s=this.$context||(this.$context=Wp(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=a,s}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,o){return this._resolveElementOptions(this.dataElementType.id,o,t)}_resolveElementOptions(t,o="default",a){const r=o==="active",s=this._cachedDataOpts,i=t+"-"+o,l=s[i],c=this.enableOptionSharing&&lo(a);if(l)return jl(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,t),f=r?[`${t}Hover`,"hover",t,""]:[t,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(He.elements[t]),g=()=>this.getContext(a,r,o),y=d.resolveNamedOptions(h,m,g,f);return y.$shared&&(y.$shared=c,s[i]=Object.freeze(jl(y,c))),y}_resolveAnimations(t,o,a){const r=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(r.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(t,a,o))}const d=new Fl(r,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,o){return!o||Hr(t)||this.chart._animationsDisabled}_getSharedOptions(t,o){const a=this.resolveDataElementOptions(t,o),r=this._sharedOptions,s=this.getSharedOptions(a),i=this.includeOptions(o,s)||s!==r;return this.updateSharedOptions(s,o,a),{sharedOptions:s,includeOptions:i}}updateElement(t,o,a,r){Hr(r)?Object.assign(t,a):this._resolveAnimations(o,r).update(t,a)}updateSharedOptions(t,o,a){t&&!Hr(o)&&this._resolveAnimations(void 0,o).update(t,a)}_setStyle(t,o,a,r){t.active=r;const s=this.getStyle(o,r);this._resolveAnimations(o,a,r).update(t,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(t,o,a){this._setStyle(t,a,"active",!1)}setHoverStyle(t,o,a){this._setStyle(t,a,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const o=this._data,a=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const r=a.length,s=o.length,i=Math.min(s,r);i&&this.parse(0,i),s>r?this._insertElements(r,s-r,t):s<r&&this._removeElements(s,r-s)}_insertElements(t,o,a=!0){const r=this._cachedMeta,s=r.data,i=t+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=t;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(t,o),a&&this.updateElements(s,t,o,"reset")}updateElements(t,o,a,r){}_removeElements(t,o){const a=this._cachedMeta;if(this._parsing){const r=a._parsed.splice(t,o);a._stacked&&bo(a,r)}a.data.splice(t,o)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[o,a,r]=t;this[o](a,r)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,o){o&&this._sync(["_removeElements",t,o]);const a=arguments.length-2;a&&this._sync(["_insertElements",t,a])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}me(Sn,"defaults",{}),me(Sn,"datasetElementType",null),me(Sn,"dataElementType",null);function Hp(e,t){if(!e._cache.$bar){const o=e.getMatchingVisibleMetas(t);let a=[];for(let r=0,s=o.length;r<s;r++)a=a.concat(o[r].controller.getAllParsedValues(e));e._cache.$bar=sl(a.sort((r,s)=>r-s))}return e._cache.$bar}function qp(e){const t=e.iScale,o=Hp(t,e.type);let a=t._length,r,s,i,l;const c=()=>{i===32767||i===-32768||(lo(l)&&(a=Math.min(a,Math.abs(i-l)||a)),l=i)};for(r=0,s=o.length;r<s;++r)i=t.getPixelForValue(o[r]),c();for(l=void 0,r=0,s=t.ticks.length;r<s;++r)i=t.getPixelForTick(r),c();return a}function Gp(e,t,o,a){const r=o.barThickness;let s,i;return ve(r)?(s=t.min*o.categoryPercentage,i=o.barPercentage):(s=r*a,i=1),{chunk:s/a,ratio:i,start:t.pixels[e]-s/2}}function Xp(e,t,o,a){const r=t.pixels,s=r[e];let i=e>0?r[e-1]:null,l=e<r.length-1?r[e+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?t.end-t.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/a,ratio:o.barPercentage,start:d}}function Yp(e,t,o,a){const r=o.parse(e[0],a),s=o.parse(e[1],a),i=Math.min(r,s),l=Math.max(r,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),t[o.axis]=d,t._custom={barStart:c,barEnd:d,start:r,end:s,min:i,max:l}}function Ul(e,t,o,a){return Ye(e)?Yp(e,t,o,a):t[o.axis]=o.parse(e,a),t}function Hl(e,t,o,a){const r=e.iScale,s=e.vScale,i=r.getLabels(),l=r===s,c=[];let d,u,f,h;for(d=o,u=o+a;d<u;++d)h=t[d],f={},f[r.axis]=l||r.parse(i[d],d),c.push(Ul(h,f,s,d));return c}function qr(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function Kp(e,t,o){return e!==0?Dt(e):(t.isHorizontal()?1:-1)*(t.min>=o?1:-1)}function Jp(e){let t,o,a,r,s;return e.horizontal?(t=e.base>e.x,o="left",a="right"):(t=e.base<e.y,o="bottom",a="top"),t?(r="end",s="start"):(r="start",s="end"),{start:o,end:a,reverse:t,top:r,bottom:s}}function Qp(e,t,o,a){let r=t.borderSkipped;const s={};if(!r){e.borderSkipped=s;return}if(r===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=Jp(e);r==="middle"&&o&&(e.enableBorderRadius=!0,(o._top||0)===a?r=d:(o._bottom||0)===a?r=u:(s[ql(u,i,l,c)]=!0,r=d)),s[ql(r,i,l,c)]=!0,e.borderSkipped=s}function ql(e,t,o,a){return a?(e=Zp(e,t,o),e=Gl(e,o,t)):e=Gl(e,t,o),e}function Zp(e,t,o){return e===t?o:e===o?t:e}function Gl(e,t,o){return e==="start"?t:e==="end"?o:e}function eg(e,{inflateAmount:t},o){e.inflateAmount=t==="auto"?o===1?.33:0:t}class sa extends Sn{parsePrimitiveData(t,o,a,r){return Hl(t,o,a,r)}parseArrayData(t,o,a,r){return Hl(t,o,a,r)}parseObjectData(t,o,a,r){const{iScale:s,vScale:i}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,g,y;for(h=a,m=a+r;h<m;++h)y=o[h],g={},g[s.axis]=s.parse(bn(y,d),h),f.push(Ul(bn(y,u),g,i,h));return f}updateRangeFromParsed(t,o,a,r){super.updateRangeFromParsed(t,o,a,r);const s=a._custom;s&&o===this._cachedMeta.vScale&&(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const o=this._cachedMeta,{iScale:a,vScale:r}=o,s=this.getParsed(t),i=s._custom,l=qr(i)?"["+i.start+", "+i.end+"]":""+r.getLabelForValue(s[r.axis]);return{label:""+a.getLabelForValue(s[a.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,t)}updateElements(t,o,a,r){const s=r==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,r);for(let m=o;m<o+a;m++){const g=this.getParsed(m),y=s||ve(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),k=this._calculateBarIndexPixels(m,u),p=(g._stacks||{})[l.axis],B={horizontal:d,base:y.base,enableBorderRadius:!p||qr(g._custom)||i===p._top||i===p._bottom,x:d?y.head:k.center,y:d?k.center:y.head,height:d?k.size:Math.abs(y.size),width:d?Math.abs(y.size):k.size};h&&(B.options=f||this.resolveDataElementOptions(m,t[m].active?"active":r));const C=B.options||t[m].options;Qp(B,C,p,i),eg(B,C,u.ratio),this.updateElement(t[m],m,B,r)}}_getStacks(t,o){const{iScale:a}=this._cachedMeta,r=a.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=a.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[a.axis],d=u=>{const f=u._parsed.find(m=>m[a.axis]===c),h=f&&f[u.vScale.axis];if(ve(h)||isNaN(h))return!0};for(const u of r)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===t))break;return i.length||i.push(void 0),i}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(t).filter(a=>t[a].axis===o).shift()}_getAxis(){const t={},o=this.getFirstScaleIdForIndexAxis();for(const a of this.chart.data.datasets)t[Ce(this.chart.options.indexAxis==="x"?a.xAxisID:a.yAxisID,o)]=!0;return Object.keys(t)}_getStackIndex(t,o,a){const r=this._getStacks(t,a),s=o!==void 0?r.indexOf(o):-1;return s===-1?r.length-1:s}_getRuler(){const t=this.options,o=this._cachedMeta,a=o.iScale,r=[];let s,i;for(s=0,i=o.data.length;s<i;++s)r.push(a.getPixelForValue(this.getParsed(s)[a.axis],s));const l=t.barThickness;return{min:l||qp(o),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:o,_stacked:a,index:r},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(t),d=c._custom,u=qr(d);let f=c[o.axis],h=0,m=a?this.applyStack(o,c,a):f,g,y;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Dt(f)!==Dt(d.barEnd)&&(h=0),h+=f);const k=!ve(s)&&!u?s:h;let p=o.getPixelForValue(k);if(this.chart.getDataVisibility(t)?g=o.getPixelForValue(h+m):g=p,y=g-p,Math.abs(y)<i){y=Kp(y,o,l)*i,f===l&&(p-=y/2);const B=o.getPixelForDecimal(0),C=o.getPixelForDecimal(1),w=Math.min(B,C),E=Math.max(B,C);p=Math.max(Math.min(p,E),w),g=p+y,a&&!u&&(c._stacks[o.axis]._visualValues[r]=o.getValueForPixel(g)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const B=Dt(y)*o.getLineWidthForValue(l)/2;p+=B,y-=B}return{size:y,base:p,head:g,center:g+y/2}}_calculateBarIndexPixels(t,o){const a=o.scale,r=this.options,s=r.skipNull,i=Ce(r.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(t):o.stackCount,f=r.barThickness==="flex"?Xp(t,o,r,u*d):Gp(t,o,r,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Ce(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?t:void 0)+m;l=f.start+f.chunk*g+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=a.getPixelForValue(this.getParsed(t)[a.axis],t),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,o=t.vScale,a=t.data,r=a.length;let s=0;for(;s<r;++s)this.getParsed(s)[o.axis]!==null&&!a[s].hidden&&a[s].draw(this._ctx)}}me(sa,"id","bar"),me(sa,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),me(sa,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function tg(e,t,o){let a=1,r=1,s=0,i=0;if(t<$e){const l=e,c=l+t,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(C,w,E)=>fo(C,l,c,!0)?1:Math.max(w,w*o,E,E*o),g=(C,w,E)=>fo(C,l,c,!0)?-1:Math.min(w,w*o,E,E*o),y=m(0,d,f),k=m(Qe,u,h),p=g(Te,d,f),B=g(Te+Qe,u,h);a=(y-p)/2,r=(k-B)/2,s=-(y+p)/2,i=-(k+B)/2}return{ratioX:a,ratioY:r,offsetX:s,offsetY:i}}class Ln extends Sn{constructor(t,o){super(t,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,o){const a=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=a;else{let s=c=>+a[c];if(_e(a[t])){const{key:c="value"}=this._parsing;s=d=>+bn(a[d],c)}let i,l;for(i=t,l=t+o;i<l;++i)r._parsed[i]=s(i)}}_getRotation(){return $t(this.options.rotation-90)}_getCircumference(){return $t(this.options.circumference)}_getRotationExtents(){let t=$e,o=-$e;for(let a=0;a<this.chart.data.datasets.length;++a)if(this.chart.isDatasetVisible(a)&&this.chart.getDatasetMeta(a).type===this._type){const r=this.chart.getDatasetMeta(a).controller,s=r._getRotation(),i=r._getCircumference();t=Math.min(t,s),o=Math.max(o,s+i)}return{rotation:t,circumference:o-t}}update(t){const o=this.chart,{chartArea:a}=o,r=this._cachedMeta,s=r.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(a.width,a.height)-i)/2,0),c=Math.min(cm(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:g,offsetY:y}=tg(f,u,c),k=(a.width-i)/h,p=(a.height-i)/m,B=Math.max(Math.min(k,p)/2,0),C=Yi(this.options.radius,B),w=Math.max(C*c,0),E=(C-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*C,this.offsetY=y*C,r.total=this.calculateTotal(),this.outerRadius=C-E*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-E*d,0),this.updateElements(s,0,s.length,t)}_circumference(t,o){const a=this.options,r=this._cachedMeta,s=this._getCircumference();return o&&a.animation.animateRotate||!this.chart.getDataVisibility(t)||r._parsed[t]===null||r.data[t].hidden?0:this.calculateCircumference(r._parsed[t]*s/$e)}updateElements(t,o,a,r){const s=r==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=s&&d.animateScale,m=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:y,includeOptions:k}=this._getSharedOptions(o,r);let p=this._getRotation(),B;for(B=0;B<o;++B)p+=this._circumference(B,s);for(B=o;B<o+a;++B){const C=this._circumference(B,s),w=t[B],E={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+C,circumference:C,outerRadius:g,innerRadius:m};k&&(E.options=y||this.resolveDataElementOptions(B,w.active?"active":r)),p+=C,this.updateElement(w,B,E,r)}}calculateTotal(){const t=this._cachedMeta,o=t.data;let a=0,r;for(r=0;r<o.length;r++){const s=t._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!o[r].hidden&&(a+=Math.abs(s))}return a}calculateCircumference(t){const o=this._cachedMeta.total;return o>0&&!isNaN(t)?$e*(Math.abs(t)/o):0}getLabelAndValue(t){const o=this._cachedMeta,a=this.chart,r=a.data.labels||[],s=Pr(o._parsed[t],a.options.locale);return{label:r[t]||"",value:s}}getMaxBorderWidth(t){let o=0;const a=this.chart;let r,s,i,l,c;if(!t){for(r=0,s=a.data.datasets.length;r<s;++r)if(a.isDatasetVisible(r)){i=a.getDatasetMeta(r),t=i.data,l=i.controller;break}}if(!t)return 0;for(r=0,s=t.length;r<s;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(t){let o=0;for(let a=0,r=t.length;a<r;++a){const s=this.resolveDataElementOptions(a);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(t){let o=0;for(let a=0;a<t;++a)this.chart.isDatasetVisible(a)&&(o+=this._getRingWeight(a));return o}_getRingWeight(t){return Math.max(Ce(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}me(Ln,"id","doughnut"),me(Ln,"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"}),me(Ln,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),me(Ln,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const o=t.data,{labels:{pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=t.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!t.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:r,pointStyle:a,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(t,o,a){a.chart.toggleDataVisibility(o.index),a.chart.update()}}}});class ia extends Sn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const o=this._cachedMeta,{dataset:a,data:r=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Dm(o,r,i);this._drawStart=l,this._drawCount=c,Mm(o)&&(l=0,c=r.length),a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=r;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},t),this.updateElements(r,l,c,t)}updateElements(t,o,a,r){const s=r==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,r),h=i.axis,m=l.axis,{spanGaps:g,segment:y}=this.options,k=uo(g)?g:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||r==="none",B=o+a,C=t.length;let w=o>0&&this.getParsed(o-1);for(let E=0;E<C;++E){const _=t[E],x=p?_:{};if(E<o||E>=B){x.skip=!0;continue}const b=this.getParsed(E),A=ve(b[m]),D=x[h]=i.getPixelForValue(b[h],E),M=x[m]=s||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[m],E);x.skip=isNaN(D)||isNaN(M)||A,x.stop=E>0&&Math.abs(b[h]-w[h])>k,y&&(x.parsed=b,x.raw=d.data[E]),f&&(x.options=u||this.resolveDataElementOptions(E,_.active?"active":r)),p||this.updateElement(_,E,x,r),w=b}}getMaxOverflow(){const t=this._cachedMeta,o=t.dataset,a=o.options&&o.options.borderWidth||0,r=t.data||[];if(!r.length)return a;const s=r[0].size(this.resolveDataElementOptions(0)),i=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(a,s,i)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}me(ia,"id","line"),me(ia,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),me(ia,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Gr extends Ln{}me(Gr,"id","pie"),me(Gr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function An(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Xr{constructor(t){me(this,"options");this.options=t||{}}static override(t){Object.assign(Xr.prototype,t)}init(){}formats(){return An()}parse(){return An()}format(){return An()}add(){return An()}diff(){return An()}startOf(){return An()}endOf(){return An()}}var ng={_date:Xr};function og(e,t,o,a){const{controller:r,data:s,_sorted:i}=e,l=r._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(l&&t===l.axis&&t!=="r"&&i&&s.length){const d=l._reversePixels?Em:xn;if(a){if(r._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(t);if(f){const h=d(s,t,o-f),m=d(s,t,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,t,o);if(c){const{vScale:f}=r._cachedMeta,{_parsed:h}=e,m=h.slice(0,u.lo+1).reverse().findIndex(y=>!ve(y[f.axis]));u.lo-=Math.max(0,m);const g=h.slice(u.hi).findIndex(y=>!ve(y[f.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function la(e,t,o,a,r){const s=e.getSortedVisibleDatasetMetas(),i=o[t];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=og(s[l],t,i,r);for(let m=f;m<=h;++m){const g=u[m];g.skip||a(g,d,m)}}}function ag(e){const t=e.indexOf("x")!==-1,o=e.indexOf("y")!==-1;return function(a,r){const s=t?Math.abs(a.x-r.x):0,i=o?Math.abs(a.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Yr(e,t,o,a,r){const s=[];return!r&&!e.isPointInArea(t)||la(e,o,t,function(l,c,d){!r&&!po(l,e.chartArea,0)||l.inRange(t.x,t.y,a)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function rg(e,t,o,a){let r=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],a),{angle:f}=ol(i,{x:t.x,y:t.y});fo(f,d,u)&&r.push({element:i,datasetIndex:l,index:c})}return la(e,o,t,s),r}function sg(e,t,o,a,r,s){let i=[];const l=ag(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(t.x,t.y,r);if(a&&!m)return;const g=u.getCenterPoint(r);if(!(!!s||e.isPointInArea(g))&&!m)return;const k=l(t,g);k<c?(i=[{element:u,datasetIndex:f,index:h}],c=k):k===c&&i.push({element:u,datasetIndex:f,index:h})}return la(e,o,t,d),i}function Kr(e,t,o,a,r,s){return!s&&!e.isPointInArea(t)?[]:o==="r"&&!a?rg(e,t,o,r):sg(e,t,o,a,r,s)}function Xl(e,t,o,a,r){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return la(e,o,t,(c,d,u)=>{c[i]&&c[i](t[o],r)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(t.x,t.y,r))}),a&&!l?[]:s}var ig={modes:{index(e,t,o,a){const r=En(t,e),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Yr(e,r,s,a,i):Kr(e,r,s,!1,a,i),c=[];return l.length?(e.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(e,t,o,a){const r=En(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Yr(e,r,s,a,i):Kr(e,r,s,!1,a,i);if(l.length>0){const c=l[0].datasetIndex,d=e.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(e,t,o,a){const r=En(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Yr(e,r,s,a,i)},nearest(e,t,o,a){const r=En(t,e),s=o.axis||"xy",i=o.includeInvisible||!1;return Kr(e,r,s,o.intersect,a,i)},x(e,t,o,a){const r=En(t,e);return Xl(e,r,"x",o.intersect,a)},y(e,t,o,a){const r=En(t,e);return Xl(e,r,"y",o.intersect,a)}}};const Yl=["left","top","right","bottom"];function yo(e,t){return e.filter(o=>o.pos===t)}function Kl(e,t){return e.filter(o=>Yl.indexOf(o.pos)===-1&&o.box.axis===t)}function xo(e,t){return e.sort((o,a)=>{const r=t?a:o,s=t?o:a;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function lg(e){const t=[];let o,a,r,s,i,l;for(o=0,a=(e||[]).length;o<a;++o)r=e[o],{position:s,options:{stack:i,stackWeight:l=1}}=r,t.push({index:o,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&s+i,stackWeight:l});return t}function cg(e){const t={};for(const o of e){const{stack:a,pos:r,stackWeight:s}=o;if(!a||!Yl.includes(r))continue;const i=t[a]||(t[a]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return t}function dg(e,t){const o=cg(e),{vBoxMaxWidth:a,hBoxMaxHeight:r}=t;let s,i,l;for(s=0,i=e.length;s<i;++s){l=e[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*a:c&&t.availableWidth,l.height=r):(l.width=a,l.height=u?u*r:c&&t.availableHeight)}return o}function ug(e){const t=lg(e),o=xo(t.filter(d=>d.box.fullSize),!0),a=xo(yo(t,"left"),!0),r=xo(yo(t,"right")),s=xo(yo(t,"top"),!0),i=xo(yo(t,"bottom")),l=Kl(t,"x"),c=Kl(t,"y");return{fullSize:o,leftAndTop:a.concat(s),rightAndBottom:r.concat(c).concat(i).concat(l),chartArea:yo(t,"chartArea"),vertical:a.concat(r).concat(c),horizontal:s.concat(i).concat(l)}}function Jl(e,t,o,a){return Math.max(e[o],t[o])+Math.max(e[a],t[a])}function Ql(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function fg(e,t,o,a){const{pos:r,box:s}=o,i=e.maxPadding;if(!_e(r)){o.size&&(e[r]-=o.size);const f=a[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,e[r]+=o.size}s.getPadding&&Ql(i,s.getPadding());const l=Math.max(0,t.outerWidth-Jl(i,e,"left","right")),c=Math.max(0,t.outerHeight-Jl(i,e,"top","bottom")),d=l!==e.w,u=c!==e.h;return e.w=l,e.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function hg(e){const t=e.maxPadding;function o(a){const r=Math.max(t[a]-e[a],0);return e[a]+=r,r}e.y+=o("top"),e.x+=o("left"),o("right"),o("bottom")}function mg(e,t){const o=t.maxPadding;function a(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(i=>{s[i]=Math.max(t[i],o[i])}),s}return a(e?["left","right"]:["top","bottom"])}function ko(e,t,o,a){const r=[];let s,i,l,c,d,u;for(s=0,i=e.length,d=0;s<i;++s){l=e[s],c=l.box,c.update(l.width||t.w,l.height||t.h,mg(l.horizontal,t));const{same:f,other:h}=fg(t,o,l,a);d|=f&&r.length,u=u||h,c.fullSize||r.push(l)}return d&&ko(r,t,o,a)||u}function ca(e,t,o,a,r){e.top=o,e.left=t,e.right=t+a,e.bottom=o+r,e.width=a,e.height=r}function Zl(e,t,o,a){const r=o.padding;let{x:s,y:i}=t;for(const l of e){const c=l.box,d=a[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*u,h=d.size||c.height;lo(d.start)&&(i=d.start),c.fullSize?ca(c,r.left,i,o.outerWidth-r.right-r.left,h):ca(c,t.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=t.h*u,h=d.size||c.width;lo(d.start)&&(s=d.start),c.fullSize?ca(c,s,r.top,h,o.outerHeight-r.bottom-r.top):ca(c,s,t.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}t.x=s,t.y=i}var yt={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(o){t.draw(o)}}]},e.boxes.push(t)},removeBox(e,t){const o=e.boxes?e.boxes.indexOf(t):-1;o!==-1&&e.boxes.splice(o,1)},configure(e,t,o){t.fullSize=o.fullSize,t.position=o.position,t.weight=o.weight},update(e,t,o,a){if(!e)return;const r=bt(e.options.layout.padding),s=Math.max(t-r.width,0),i=Math.max(o-r.height,0),l=ug(e.boxes),c=l.vertical,d=l.horizontal;Pe(e.boxes,y=>{typeof y.beforeLayout=="function"&&y.beforeLayout()});const u=c.reduce((y,k)=>k.box.options&&k.box.options.display===!1?y:y+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:o,padding:r,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},r);Ql(h,bt(a));const m=Object.assign({maxPadding:h,w:s,h:i,x:r.left,y:r.top},r),g=dg(c.concat(d),f);ko(l.fullSize,m,f,g),ko(c,m,f,g),ko(d,m,f,g)&&ko(c,m,f,g),hg(m),Zl(l.leftAndTop,m,f,g),m.x+=m.w,m.y+=m.h,Zl(l.rightAndBottom,m,f,g),e.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Pe(l.chartArea,y=>{const k=y.box;Object.assign(k,e.chartArea),k.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class ec{acquireContext(t,o){}releaseContext(t){return!1}addEventListener(t,o,a){}removeEventListener(t,o,a){}getDevicePixelRatio(){return 1}getMaximumSize(t,o,a,r){return o=Math.max(0,o||t.width),a=a||t.height,{width:o,height:Math.max(0,r?Math.floor(o/r):a)}}isAttached(t){return!0}updateConfig(t){}}class pg extends ec{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const da="$chartjs",gg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},tc=e=>e===null||e==="";function bg(e,t){const o=e.style,a=e.getAttribute("height"),r=e.getAttribute("width");if(e[da]={initial:{height:a,width:r,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",tc(r)){const s=Sl(e,"width");s!==void 0&&(e.width=s)}if(tc(a))if(e.style.height==="")e.height=e.width/(t||2);else{const s=Sl(e,"height");s!==void 0&&(e.height=s)}return e}const nc=xp?{passive:!0}:!1;function yg(e,t,o){e&&e.addEventListener(t,o,nc)}function xg(e,t,o){e&&e.canvas&&e.canvas.removeEventListener(t,o,nc)}function kg(e,t){const o=gg[e.type]||e.type,{x:a,y:r}=En(e,t);return{type:o,chart:t,native:e,x:a!==void 0?a:null,y:r!==void 0?r:null}}function ua(e,t){for(const o of e)if(o===t||o.contains(t))return!0}function wg(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.addedNodes,a),i=i&&!ua(l.removedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}function Cg(e,t,o){const a=e.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ua(l.removedNodes,a),i=i&&!ua(l.addedNodes,a);i&&o()});return r.observe(document,{childList:!0,subtree:!0}),r}const wo=new Map;let oc=0;function ac(){const e=window.devicePixelRatio;e!==oc&&(oc=e,wo.forEach((t,o)=>{o.currentDevicePixelRatio!==e&&t()}))}function Bg(e,t){wo.size||window.addEventListener("resize",ac),wo.set(e,t)}function Eg(e){wo.delete(e),wo.size||window.removeEventListener("resize",ac)}function _g(e,t,o){const a=e.canvas,r=a&&Wr(a);if(!r)return;const s=ll((l,c)=>{const d=r.clientWidth;o(l,c),d<r.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(r),Bg(e,s),i}function Jr(e,t,o){o&&o.disconnect(),t==="resize"&&Eg(e)}function Sg(e,t,o){const a=e.canvas,r=ll(s=>{e.ctx!==null&&o(kg(s,e))},e);return yg(a,t,r),r}class Ag extends ec{acquireContext(t,o){const a=t&&t.getContext&&t.getContext("2d");return a&&a.canvas===t?(bg(t,o),a):null}releaseContext(t){const o=t.canvas;if(!o[da])return!1;const a=o[da].initial;["height","width"].forEach(s=>{const i=a[s];ve(i)?o.removeAttribute(s):o.setAttribute(s,i)});const r=a.style||{};return Object.keys(r).forEach(s=>{o.style[s]=r[s]}),o.width=o.width,delete o[da],!0}addEventListener(t,o,a){this.removeEventListener(t,o);const r=t.$proxies||(t.$proxies={}),i={attach:wg,detach:Cg,resize:_g}[o]||Sg;r[o]=i(t,o,a)}removeEventListener(t,o){const a=t.$proxies||(t.$proxies={}),r=a[o];if(!r)return;({attach:Jr,detach:Jr,resize:Jr}[o]||xg)(t,o,r),a[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,o,a,r){return yp(t,o,a,r)}isAttached(t){const o=t&&Wr(t);return!!(o&&o.isConnected)}}function Vg(e){return!$r()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?pg:Ag}let Ut=(Ua=class{constructor(){me(this,"x");me(this,"y");me(this,"active",!1);me(this,"options");me(this,"$animations")}tooltipPosition(t){const{x:o,y:a}=this.getProps(["x","y"],t);return{x:o,y:a}}hasValue(){return uo(this.x)&&uo(this.y)}getProps(t,o){const a=this.$animations;if(!o||!a)return this;const r={};return t.forEach(s=>{r[s]=a[s]&&a[s].active()?a[s]._to:this[s]}),r}},me(Ua,"defaults",{}),me(Ua,"defaultRoutes"),Ua);function Dg(e,t){const o=e.options.ticks,a=Mg(e),r=Math.min(o.maxTicksLimit||a,a),s=o.major.enabled?vg(t):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>r)return Pg(t,d,s,i/r),d;const u=Ng(s,t,r);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(fa(t,d,u,ve(m)?0:l-m,l),f=0,h=i-1;f<h;f++)fa(t,d,u,s[f],s[f+1]);return fa(t,d,u,c,ve(m)?t.length:c+m),d}return fa(t,d,u),d}function Mg(e){const t=e.options.offset,o=e._tickSize(),a=e._length/o+(t?0:1),r=e._maxLength/o;return Math.floor(Math.min(a,r))}function Ng(e,t,o){const a=Tg(e),r=t.length/o;if(!a)return Math.max(r,1);const s=bm(a);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>r)return c}return Math.max(r,1)}function vg(e){const t=[];let o,a;for(o=0,a=e.length;o<a;o++)e[o].major&&t.push(o);return t}function Pg(e,t,o,a){let r=0,s=o[0],i;for(a=Math.ceil(a),i=0;i<e.length;i++)i===s&&(t.push(e[i]),r++,s=o[r*a])}function fa(e,t,o,a,r){const s=Ce(a,0),i=Math.min(Ce(r,e.length),e.length);let l=0,c,d,u;for(o=Math.ceil(o),r&&(c=r-a,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&&(t.push(e[d]),l++,u=Math.round(s+l*o))}function Tg(e){const t=e.length;let o,a;if(t<2)return!1;for(a=e[0],o=1;o<t;++o)if(e[o]-e[o-1]!==a)return!1;return a}const Og=e=>e==="left"?"right":e==="right"?"left":e,rc=(e,t,o)=>t==="top"||t==="left"?e[t]+o:e[t]-o,sc=(e,t)=>Math.min(t||e,e);function ic(e,t){const o=[],a=e.length/t,r=e.length;let s=0;for(;s<r;s+=a)o.push(e[Math.floor(s)]);return o}function zg(e,t,o){const a=e.ticks.length,r=Math.min(t,a-1),s=e._startPixel,i=e._endPixel,l=1e-6;let c=e.getPixelForTick(r),d;if(!(o&&(a===1?d=Math.max(c-s,i-c):t===0?d=(e.getPixelForTick(1)-c)/2:d=(c-e.getPixelForTick(r-1))/2,c+=r<t?d:-d,c<s-l||c>i+l)))return c}function Fg(e,t){Pe(e,o=>{const a=o.gc,r=a.length/2;let s;if(r>t){for(s=0;s<r;++s)delete o.data[a[s]];a.splice(0,r)}})}function Co(e){return e.drawTicks?e.tickLength:0}function lc(e,t){if(!e.display)return 0;const o=st(e.font,t),a=bt(e.padding);return(Ye(e.text)?e.text.length:1)*o.lineHeight+a.height}function Rg(e,t){return Cn(e,{scale:t,type:"scale"})}function Ig(e,t,o){return Cn(e,{tick:o,index:t,type:"tick"})}function Lg(e,t,o){let a=Mr(e);return(o&&t!=="right"||!o&&t==="right")&&(a=Og(a)),a}function $g(e,t,o,a){const{top:r,left:s,bottom:i,right:l,chart:c}=e,{chartArea:d,scales:u}=c;let f=0,h,m,g;const y=i-r,k=l-s;if(e.isHorizontal()){if(m=rt(a,s,l),_e(o)){const p=Object.keys(o)[0],B=o[p];g=u[p].getPixelForValue(B)+y-t}else o==="center"?g=(d.bottom+d.top)/2+y-t:g=rc(e,o,t);h=l-s}else{if(_e(o)){const p=Object.keys(o)[0],B=o[p];m=u[p].getPixelForValue(B)-k+t}else o==="center"?m=(d.left+d.right)/2-k+t:m=rc(e,o,t);g=rt(a,i,r),f=o==="left"?-Qe:Qe}return{titleX:m,titleY:g,maxWidth:h,rotation:f}}class $n extends Ut{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.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(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,o){return t}getUserBounds(){let{_userMin:t,_userMax:o,_suggestedMin:a,_suggestedMax:r}=this;return t=Vt(t,Number.POSITIVE_INFINITY),o=Vt(o,Number.NEGATIVE_INFINITY),a=Vt(a,Number.POSITIVE_INFINITY),r=Vt(r,Number.NEGATIVE_INFINITY),{min:Vt(t,a),max:Vt(o,r),minDefined:ot(t),maxDefined:ot(o)}}getMinMax(t){let{min:o,max:a,minDefined:r,maxDefined:s}=this.getUserBounds(),i;if(r&&s)return{min:o,max:a};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,t),r||(o=Math.min(o,i.min)),s||(a=Math.max(a,i.max));return o=s&&o>a?a:o,a=r&&o>a?o:a,{min:Vt(o,Vt(a,o)),max:Vt(a,Vt(o,a))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Re(this.options.beforeUpdate,[this])}update(t,o,a){const{beginAtZero:r,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=o,this._margins=a=Object.assign({left:0,right:0,top:0,bottom:0},a),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+a.left+a.right:this.height+a.top+a.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Km(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?ic(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=Dg(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,o,a;this.isHorizontal()?(o=this.left,a=this.right):(o=this.top,a=this.bottom,t=!t),this._startPixel=o,this._endPixel=a,this._reversePixels=t,this._length=a-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Re(this.options.afterUpdate,[this])}beforeSetDimensions(){Re(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(){Re(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Re(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Re(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const o=this.options.ticks;let a,r,s;for(a=0,r=t.length;a<r;a++)s=t[a],s.label=Re(o.callback,[s.value,a,t],this)}afterTickToLabelConversion(){Re(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Re(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,o=t.ticks,a=sc(this.ticks.length,t.ticks.maxTicksLimit),r=o.minRotation||0,s=o.maxRotation;let i=r,l,c,d;if(!this._isVisible()||!o.display||r>=s||a<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=at(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/a:m/(a-1),f+6>l&&(l=m/(a-(t.offset?.5:1)),c=this.maxHeight-Co(t.grid)-o.padding-lc(t.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=wm(Math.min(Math.asin(at((u.highest.height+6)/l,-1,1)),Math.asin(at(c/d,-1,1))-Math.asin(at(h/d,-1,1)))),i=Math.max(r,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Re(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Re(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:o,options:{ticks:a,title:r,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=lc(r,o.options.font);if(l?(t.width=this.maxWidth,t.height=Co(s)+c):(t.height=this.maxHeight,t.width=Co(s)+c),a.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=a.padding*2,g=$t(this.labelRotation),y=Math.cos(g),k=Math.sin(g);if(l){const p=a.mirror?0:k*f.width+y*h.height;t.height=Math.min(this.maxHeight,t.height+p+m)}else{const p=a.mirror?0:y*f.width+k*h.height;t.width=Math.min(this.maxWidth,t.width+p+m)}this._calculatePadding(d,u,k,y)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,o,a,r){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 h=0,m=0;c?d?(h=r*t.width,m=a*o.height):(h=a*t.height,m=r*o.width):s==="start"?m=o.width:s==="end"?h=t.width:s!=="inner"&&(h=t.width/2,m=o.width/2),this.paddingLeft=Math.max((h-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=t.height/2;s==="start"?(u=0,f=t.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(){Re(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:o}=this.options;return o==="top"||o==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let o,a;for(o=0,a=t.length;o<a;o++)ve(t[o].label)&&(t.splice(o,1),a--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const o=this.options.ticks.sampleSize;let a=this.ticks;o<a.length&&(a=ic(a,o)),this._labelSizes=t=this._computeLabelSizes(a,a.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,o,a){const{ctx:r,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/sc(o,a));let d=0,u=0,f,h,m,g,y,k,p,B,C,w,E;for(f=0;f<o;f+=c){if(g=t[f].label,y=this._resolveTickFontOptions(f),r.font=k=y.string,p=s[k]=s[k]||{data:{},gc:[]},B=y.lineHeight,C=w=0,!ve(g)&&!Ye(g))C=ml(r,p.data,p.gc,C,g),w=B;else if(Ye(g))for(h=0,m=g.length;h<m;++h)E=g[h],!ve(E)&&!Ye(E)&&(C=ml(r,p.data,p.gc,C,E),w+=B);i.push(C),l.push(w),d=Math.max(C,d),u=Math.max(w,u)}Fg(s,o);const _=i.indexOf(d),x=l.indexOf(u),b=A=>({width:i[A]||0,height:l[A]||0});return{first:b(0),last:b(o-1),widest:b(_),highest:b(x),widths:i,heights:l}}getLabelForValue(t){return t}getPixelForValue(t,o){return NaN}getValueForPixel(t){}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const o=this._startPixel+t*this._length;return Bm(this._alignToPixels?wn(this.chart,o,0):o)}getDecimalForPixel(t){const o=(t-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:o}=this;return t<0&&o<0?o:t>0&&o>0?t:0}getContext(t){const o=this.ticks||[];if(t>=0&&t<o.length){const a=o[t];return a.$context||(a.$context=Ig(this.getContext(),t,a))}return this.$context||(this.$context=Rg(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,o=$t(this.labelRotation),a=Math.abs(Math.cos(o)),r=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=t.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*a>l*r?l/a:c/r:c*r<l*a?c/a:l/r}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const o=this.axis,a=this.chart,r=this.options,{grid:s,position:i,border:l}=r,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Co(s),m=[],g=l.setContext(this.getContext()),y=g.display?g.width:0,k=y/2,p=function(R){return wn(a,R,y)};let B,C,w,E,_,x,b,A,D,M,V,N;if(i==="top")B=p(this.bottom),x=this.bottom-h,A=B-k,M=p(t.top)+k,N=t.bottom;else if(i==="bottom")B=p(this.top),M=t.top,N=p(t.bottom)-k,x=B+k,A=this.top+h;else if(i==="left")B=p(this.right),_=this.right-h,b=B-k,D=p(t.left)+k,V=t.right;else if(i==="right")B=p(this.left),D=t.left,V=p(t.right)-k,_=B+k,b=this.left+h;else if(o==="x"){if(i==="center")B=p((t.top+t.bottom)/2+.5);else if(_e(i)){const R=Object.keys(i)[0],X=i[R];B=p(this.chart.scales[R].getPixelForValue(X))}M=t.top,N=t.bottom,x=B+k,A=x+h}else if(o==="y"){if(i==="center")B=p((t.left+t.right)/2);else if(_e(i)){const R=Object.keys(i)[0],X=i[R];B=p(this.chart.scales[R].getPixelForValue(X))}_=B-k,b=_-h,D=t.left,V=t.right}const T=Ce(r.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/T));for(C=0;C<f;C+=Y){const R=this.getContext(C),X=s.setContext(R),$=l.setContext(R),Q=X.lineWidth,L=X.color,H=$.dash||[],J=$.dashOffset,v=X.tickWidth,O=X.tickColor,W=X.tickBorderDash||[],q=X.tickBorderDashOffset;w=zg(this,C,c),w!==void 0&&(E=wn(a,w,Q),d?_=b=D=V=E:x=A=M=N=E,m.push({tx1:_,ty1:x,tx2:b,ty2:A,x1:D,y1:M,x2:V,y2:N,width:Q,color:L,borderDash:H,borderDashOffset:J,tickWidth:v,tickColor:O,tickBorderDash:W,tickBorderDashOffset:q}))}return this._ticksLength=f,this._borderValue=B,m}_computeLabelItems(t){const o=this.axis,a=this.options,{position:r,ticks:s}=a,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=Co(a.grid),m=h+u,g=f?-u:m,y=-$t(this.labelRotation),k=[];let p,B,C,w,E,_,x,b,A,D,M,V,N="middle";if(r==="top")_=this.bottom-g,x=this._getXAxisLabelAlignment();else if(r==="bottom")_=this.top+g,x=this._getXAxisLabelAlignment();else if(r==="left"){const Y=this._getYAxisLabelAlignment(h);x=Y.textAlign,E=Y.x}else if(r==="right"){const Y=this._getYAxisLabelAlignment(h);x=Y.textAlign,E=Y.x}else if(o==="x"){if(r==="center")_=(t.top+t.bottom)/2+m;else if(_e(r)){const Y=Object.keys(r)[0],R=r[Y];_=this.chart.scales[Y].getPixelForValue(R)+m}x=this._getXAxisLabelAlignment()}else if(o==="y"){if(r==="center")E=(t.left+t.right)/2-m;else if(_e(r)){const Y=Object.keys(r)[0],R=r[Y];E=this.chart.scales[Y].getPixelForValue(R)}x=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?N="top":c==="end"&&(N="bottom"));const T=this._getLabelSizes();for(p=0,B=l.length;p<B;++p){C=l[p],w=C.label;const Y=s.setContext(this.getContext(p));b=this.getPixelForTick(p)+s.labelOffset,A=this._resolveTickFontOptions(p),D=A.lineHeight,M=Ye(w)?w.length:1;const R=M/2,X=Y.color,$=Y.textStrokeColor,Q=Y.textStrokeWidth;let L=x;i?(E=b,x==="inner"&&(p===B-1?L=this.options.reverse?"left":"right":p===0?L=this.options.reverse?"right":"left":L="center"),r==="top"?d==="near"||y!==0?V=-M*D+D/2:d==="center"?V=-T.highest.height/2-R*D+D:V=-T.highest.height+D/2:d==="near"||y!==0?V=D/2:d==="center"?V=T.highest.height/2-R*D:V=T.highest.height-M*D,f&&(V*=-1),y!==0&&!Y.showLabelBackdrop&&(E+=D/2*Math.sin(y))):(_=b,V=(1-M)*D/2);let H;if(Y.showLabelBackdrop){const J=bt(Y.backdropPadding),v=T.heights[p],O=T.widths[p];let W=V-J.top,q=0-J.left;switch(N){case"middle":W-=v/2;break;case"bottom":W-=v;break}switch(x){case"center":q-=O/2;break;case"right":q-=O;break;case"inner":p===B-1?q-=O:p>0&&(q-=O/2);break}H={left:q,top:W,width:O+J.width,height:v+J.height,color:Y.backdropColor}}k.push({label:w,font:A,textOffset:V,options:{rotation:y,color:X,strokeColor:$,strokeWidth:Q,textAlign:L,textBaseline:N,translation:[E,_],backdrop:H}})}return k}_getXAxisLabelAlignment(){const{position:t,ticks:o}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let r="center";return o.align==="start"?r="left":o.align==="end"?r="right":o.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(t){const{position:o,ticks:{crossAlign:a,mirror:r,padding:s}}=this.options,i=this._getLabelSizes(),l=t+s,c=i.widest.width;let d,u;return o==="left"?r?(u=this.right+s,a==="near"?d="left":a==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?r?(u=this.left+s,a==="near"?d="right":a==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,a==="near"?d="left":a==="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 t=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:o},left:a,top:r,width:s,height:i}=this;o&&(t.save(),t.fillStyle=o,t.fillRect(a,r,s,i),t.restore())}getLineWidthForValue(t){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const r=this.ticks.findIndex(s=>s.value===t);return r>=0?o.setContext(this.getContext(r)).lineWidth:0}drawGrid(t){const o=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(a.save(),a.lineWidth=u.width,a.strokeStyle=u.color,a.setLineDash(u.borderDash||[]),a.lineDashOffset=u.borderDashOffset,a.beginPath(),a.moveTo(c.x,c.y),a.lineTo(d.x,d.y),a.stroke(),a.restore())};if(o.display)for(s=0,i=r.length;s<i;++s){const c=r[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:t,ctx:o,options:{border:a,grid:r}}=this,s=a.setContext(this.getContext()),i=a.display?s.width:0;if(!i)return;const l=r.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=wn(t,this.left,i)-i/2,u=wn(t,this.right,l)+l/2,f=h=c):(f=wn(t,this.top,i)-i/2,h=wn(t,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,h),o.stroke(),o.restore()}drawLabels(t){if(!this.options.ticks.display)return;const a=this.ctx,r=this._computeLabelArea();r&&Qo(a,r);const s=this.getLabelItems(t);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;go(a,d,0,u,c,l)}r&&Zo(a)}drawTitle(){const{ctx:t,options:{position:o,title:a,reverse:r}}=this;if(!a.display)return;const s=st(a.font),i=bt(a.padding),l=a.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||_e(o)?(c+=i.bottom,Ye(a.text)&&(c+=s.lineHeight*(a.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=$g(this,c,o,l);go(t,a.text,0,0,s,{color:a.color,maxWidth:f,rotation:h,textAlign:Lg(l,o,r),textBaseline:"middle",translation:[d,u]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,o=t.ticks&&t.ticks.z||0,a=Ce(t.grid&&t.grid.z,-1),r=Ce(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==$n.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:a,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(t){const o=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[a]===this.id&&(!t||l.type===t)&&r.push(l)}return r}_resolveTickFontOptions(t){const o=this.options.ticks.setContext(this.getContext(t));return st(o.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ha{constructor(t,o,a){this.type=t,this.scope=o,this.override=a,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const o=Object.getPrototypeOf(t);let a;Ug(o)&&(a=this.register(o));const r=this.items,s=t.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+t);return s in r||(r[s]=t,Wg(t,i,a),this.override&&He.override(t.id,t.overrides)),i}get(t){return this.items[t]}unregister(t){const o=this.items,a=t.id,r=this.scope;a in o&&delete o[a],r&&a in He[r]&&(delete He[r][a],this.override&&delete kn[a])}}function Wg(e,t,o){const a=so(Object.create(null),[o?He.get(o):{},He.get(t),e.defaults]);He.set(t,a),e.defaultRoutes&&jg(t,e.defaultRoutes),e.descriptors&&He.describe(t,e.descriptors)}function jg(e,t){Object.keys(t).forEach(o=>{const a=o.split("."),r=a.pop(),s=[e].concat(a).join("."),i=t[o].split("."),l=i.pop(),c=i.join(".");He.route(s,r,c,l)})}function Ug(e){return"id"in e&&"defaults"in e}class Hg{constructor(){this.controllers=new ha(Sn,"datasets",!0),this.elements=new ha(Ut,"elements"),this.plugins=new ha(Object,"plugins"),this.scales=new ha($n,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,o,a){[...o].forEach(r=>{const s=a||this._getRegistryForType(r);a||s.isForType(r)||s===this.plugins&&r.id?this._exec(t,s,r):Pe(r,i=>{const l=a||this._getRegistryForType(i);this._exec(t,l,i)})})}_exec(t,o,a){const r=Ar(t);Re(a["before"+r],[],a),o[t](a),Re(a["after"+r],[],a)}_getRegistryForType(t){for(let o=0;o<this._typedRegistries.length;o++){const a=this._typedRegistries[o];if(a.isForType(t))return a}return this.plugins}_get(t,o,a){const r=o.get(t);if(r===void 0)throw new Error('"'+t+'" is not a registered '+a+".");return r}}var Mt=new Hg;class qg{constructor(){this._init=void 0}notify(t,o,a,r){if(o==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const s=r?this._descriptors(t).filter(r):this._descriptors(t),i=this._notify(s,t,o,a);return o==="afterDestroy"&&(this._notify(s,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),i}_notify(t,o,a,r){r=r||{};for(const s of t){const i=s.plugin,l=i[a],c=[o,r,s.options];if(Re(l,c,i)===!1&&r.cancelable)return!1}return!0}invalidate(){ve(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),o}_createDescriptors(t,o){const a=t&&t.config,r=Ce(a.options&&a.options.plugins,{}),s=Gg(a);return r===!1&&!o?[]:Yg(t,s,r,o)}_notifyStateChanges(t){const o=this._oldCache||[],a=this._cache,r=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(r(o,a),t,"stop"),this._notify(r(a,o),t,"start")}}function Gg(e){const t={},o=[],a=Object.keys(Mt.plugins.items);for(let s=0;s<a.length;s++)o.push(Mt.getPlugin(a[s]));const r=e.plugins||[];for(let s=0;s<r.length;s++){const i=r[s];o.indexOf(i)===-1&&(o.push(i),t[i.id]=!0)}return{plugins:o,localIds:t}}function Xg(e,t){return!t&&e===!1?null:e===!0?{}:e}function Yg(e,{plugins:t,localIds:o},a,r){const s=[],i=e.getContext();for(const l of t){const c=l.id,d=Xg(a[c],r);d!==null&&s.push({plugin:l,options:Kg(e.config,{plugin:l,local:o[c]},d,i)})}return s}function Kg(e,{plugin:t,local:o},a,r){const s=e.pluginScopeKeys(t),i=e.getOptionScopes(a,s);return o&&t.defaults&&i.push(t.defaults),e.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Qr(e,t){const o=He.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||o.indexAxis||"x"}function Jg(e,t){let o=e;return e==="_index_"?o=t:e==="_value_"&&(o=t==="x"?"y":"x"),o}function Qg(e,t){return e===t?"_index_":"_value_"}function cc(e){if(e==="x"||e==="y"||e==="r")return e}function Zg(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Zr(e,...t){if(cc(e))return e;for(const o of t){const a=o.axis||Zg(o.position)||e.length>1&&cc(e[0].toLowerCase());if(a)return a}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function dc(e,t,o){if(o[t+"AxisID"]===e)return{axis:t}}function e0(e,t){if(t.data&&t.data.datasets){const o=t.data.datasets.filter(a=>a.xAxisID===e||a.yAxisID===e);if(o.length)return dc(e,"x",o[0])||dc(e,"y",o[0])}return{}}function t0(e,t){const o=kn[e.type]||{scales:{}},a=t.scales||{},r=Qr(e.type,t),s=Object.create(null);return Object.keys(a).forEach(i=>{const l=a[i];if(!_e(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=Zr(i,l,e0(i,e),He.scales[l.type]),d=Qg(c,r),u=o.scales||{};s[i]=io(Object.create(null),[{axis:c},l,u[c],u[d]])}),e.data.datasets.forEach(i=>{const l=i.type||e.type,c=i.indexAxis||Qr(l,t),u=(kn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=Jg(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),io(s[m],[{axis:h},a[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];io(l,[He.scales[l.type],He.scale])}),s}function uc(e){const t=e.options||(e.options={});t.plugins=Ce(t.plugins,{}),t.scales=t0(e,t)}function fc(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function n0(e){return e=e||{},e.data=fc(e.data),uc(e),e}const hc=new Map,mc=new Set;function ma(e,t){let o=hc.get(e);return o||(o=t(),hc.set(e,o),mc.add(o)),o}const Bo=(e,t,o)=>{const a=bn(t,o);a!==void 0&&e.add(a)};class o0{constructor(t){this._config=n0(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=fc(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),uc(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ma(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,o){return ma(`${t}.transition.${o}`,()=>[[`datasets.${t}.transitions.${o}`,`transitions.${o}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,o){return ma(`${t}-${o}`,()=>[[`datasets.${t}.elements.${o}`,`datasets.${t}`,`elements.${o}`,""]])}pluginScopeKeys(t){const o=t.id,a=this.type;return ma(`${a}-plugin-${o}`,()=>[[`plugins.${o}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,o){const a=this._scopeCache;let r=a.get(t);return(!r||o)&&(r=new Map,a.set(t,r)),r}getOptionScopes(t,o,a){const{options:r,type:s}=this,i=this._cachedScopes(t,a),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{t&&(c.add(t),u.forEach(f=>Bo(c,t,f))),u.forEach(f=>Bo(c,r,f)),u.forEach(f=>Bo(c,kn[s]||{},f)),u.forEach(f=>Bo(c,He,f)),u.forEach(f=>Bo(c,Tr,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),mc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:t,type:o}=this;return[t,kn[o]||{},He.datasets[o]||{},{type:o},He,Tr]}resolveNamedOptions(t,o,a,r=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=pc(this._resolverCache,t,r);let c=i;if(r0(i,o)){s.$shared=!1,a=on(a)?a():a;const d=this.createResolver(t,a,l);c=Fn(i,a,d)}for(const d of o)s[d]=c[d];return s}createResolver(t,o,a=[""],r){const{resolver:s}=pc(this._resolverCache,t,a);return _e(o)?Fn(s,o,void 0,r):s}}function pc(e,t,o){let a=e.get(t);a||(a=new Map,e.set(t,a));const r=o.join();let s=a.get(r);return s||(s={resolver:Rr(t,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},a.set(r,s)),s}const a0=e=>_e(e)&&Object.getOwnPropertyNames(e).some(t=>on(e[t]));function r0(e,t){const{isScriptable:o,isIndexable:a}=yl(e);for(const r of t){const s=o(r),i=a(r),l=(i||s)&&e[r];if(s&&(on(l)||a0(l))||i&&Ye(l))return!0}return!1}var s0="4.5.1";const i0=["top","bottom","left","right","chartArea"];function gc(e,t){return e==="top"||e==="bottom"||i0.indexOf(e)===-1&&t==="x"}function bc(e,t){return function(o,a){return o[e]===a[e]?o[t]-a[t]:o[e]-a[e]}}function yc(e){const t=e.chart,o=t.options.animation;t.notifyPlugins("afterRender"),Re(o&&o.onComplete,[e],t)}function l0(e){const t=e.chart,o=t.options.animation;Re(o&&o.onProgress,[e],t)}function xc(e){return $r()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const pa={},kc=e=>{const t=xc(e);return Object.values(pa).filter(o=>o.canvas===t).pop()};function c0(e,t,o){const a=Object.keys(e);for(const r of a){const s=+r;if(s>=t){const i=e[r];delete e[r],(o>0||s>t)&&(e[s+o]=i)}}}function d0(e,t,o,a){return!o||e.type==="mouseout"?null:a?t:e}class Ht{static register(...t){Mt.add(...t),wc()}static unregister(...t){Mt.remove(...t),wc()}constructor(t,o){const a=this.config=new o0(o),r=xc(t),s=kc(r);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=a.createResolver(a.chartOptionScopes(),this.getContext());this.platform=new(a.platform||Vg(r)),this.platform.updateConfig(a);const l=this.platform.acquireContext(r,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=lm(),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 qg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Am(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],pa[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}jt.listen(this,"complete",yc),jt.listen(this,"progress",l0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:o},width:a,height:r,_aspectRatio:s}=this;return ve(t)?o&&s?s:r?a/r:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():_l(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return pl(this.canvas,this.ctx),this}stop(){return jt.stop(this),this}resize(t,o){jt.running(this)?this._resizeBeforeDraw={width:t,height:o}:this._resize(t,o)}_resize(t,o){const a=this.options,r=this.canvas,s=a.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,t,o,s),l=a.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,_l(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Re(a.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Pe(o,(a,r)=>{a.id=r})}buildOrUpdateScales(){const t=this.options,o=t.scales,a=this.scales,r=Object.keys(a).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=Zr(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Pe(s,i=>{const l=i.options,c=l.id,d=Zr(c,l),u=Ce(l.type,i.dtype);(l.position===void 0||gc(l.position,d)!==gc(i.dposition))&&(l.position=i.dposition),r[c]=!0;let f=null;if(c in a&&a[c].type===u)f=a[c];else{const h=Mt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),a[f.id]=f}f.init(l,t)}),Pe(r,(i,l)=>{i||delete a[l]}),Pe(a,i=>{yt.configure(this,i,i.options),yt.addBox(this,i)})}_updateMetasets(){const t=this._metasets,o=this.data.datasets.length,a=t.length;if(t.sort((r,s)=>r.index-s.index),a>o){for(let r=o;r<a;++r)this._destroyDatasetMeta(r);t.splice(o,a-o)}this._sortedMetasets=t.slice(0).sort(bc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:o}}=this;t.length>o.length&&delete this._stacks,t.forEach((a,r)=>{o.filter(s=>s===a._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const t=[],o=this.data.datasets;let a,r;for(this._removeUnreferencedMetasets(),a=0,r=o.length;a<r;a++){const s=o[a];let i=this.getDatasetMeta(a);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(a),i=this.getDatasetMeta(a)),i.type=l,i.indexAxis=s.indexAxis||Qr(l,this.options),i.order=s.order||0,i.index=a,i.label=""+s.label,i.visible=this.isDatasetVisible(a),i.controller)i.controller.updateIndex(a),i.controller.linkScales();else{const c=Mt.getController(l),{datasetElementType:d,dataElementType:u}=He.datasets[l];Object.assign(c,{dataElementType:Mt.getElement(u),datasetElementType:d&&Mt.getElement(d)}),i.controller=new c(this,a),t.push(i.controller)}}return this._updateMetasets(),t}_resetElements(){Pe(this.data.datasets,(t,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const o=this.config;o.update();const a=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!a.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,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),h=!r&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=a.layout.autoPadding?i:0,this._updateLayout(i),r||Pe(s,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(bc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Pe(this.scales,t=>{yt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,o=new Set(Object.keys(this._listeners)),a=new Set(t.events);(!Qi(o,a)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,o=this._getUniformDataChanges()||[];for(const{method:a,start:r,count:s}of o){const i=a==="_removeElements"?-s:s;c0(t,r,i)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const o=this.data.datasets.length,a=s=>new Set(t.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),r=a(0);for(let s=1;s<o;s++)if(!Qi(r,a(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;yt.update(this,this.width,this.height,t);const o=this.chartArea,a=o.width<=0||o.height<=0;this._layers=[],Pe(this.boxes,r=>{a&&r.position==="chartArea"||(r.configure&&r.configure(),this._layers.push(...r._layers()))},this),this._layers.forEach((r,s)=>{r._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let o=0,a=this.data.datasets.length;o<a;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,a=this.data.datasets.length;o<a;++o)this._updateDataset(o,on(t)?t({datasetIndex:o}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,o){const a=this.getDatasetMeta(t),r={meta:a,index:t,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(a.controller._update(o),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(jt.has(this)?this.attached&&!jt.running(this)&&jt.start(this):(this.draw(),yc({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:a,height:r}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(a,r)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(t=0;t<o.length&&o[t].z<=0;++t)o[t].draw(this.chartArea);for(this._drawDatasets();t<o.length;++t)o[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const o=this._sortedMetasets,a=[];let r,s;for(r=0,s=o.length;r<s;++r){const i=o[r];(!t||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let o=t.length-1;o>=0;--o)this._drawDataset(t[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const o=this.ctx,a={meta:t,index:t.index,cancelable:!0},r=Ol(this,t);this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&Qo(o,r),t.controller.draw(),r&&Zo(o),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return po(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,o,a,r){const s=ig.modes[o];return typeof s=="function"?s(this,t,a,r):[]}getDatasetMeta(t){const o=this.data.datasets[t],a=this._metasets;let r=a.filter(s=>s&&s._dataset===o).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:t,_dataset:o,_parsed:[],_sorted:!1},a.push(r)),r}getContext(){return this.$context||(this.$context=Cn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const o=this.data.datasets[t];if(!o)return!1;const a=this.getDatasetMeta(t);return typeof a.hidden=="boolean"?!a.hidden:!o.hidden}setDatasetVisibility(t,o){const a=this.getDatasetMeta(t);a.hidden=!o}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,o,a){const r=a?"show":"hide",s=this.getDatasetMeta(t),i=s.controller._resolveAnimations(void 0,r);lo(o)?(s.data[o].hidden=!a,this.update()):(this.setDatasetVisibility(t,a),i.update(s,{visible:a}),this.update(l=>l.datasetIndex===t?r:void 0))}hide(t,o){this._updateVisibility(t,o,!1)}show(t,o){this._updateVisibility(t,o,!0)}_destroyDatasetMeta(t){const o=this._metasets[t];o&&o.controller&&o.controller._destroy(),delete this._metasets[t]}_stop(){let t,o;for(this.stop(),jt.remove(this),t=0,o=this.data.datasets.length;t<o;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:o}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),pl(t,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete pa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,o=this.platform,a=(s,i)=>{o.addEventListener(this,s,i),t[s]=i},r=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Pe(this.options.events,s=>a(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,o=this.platform,a=(c,d)=>{o.addEventListener(this,c,d),t[c]=d},r=(c,d)=>{t[c]&&(o.removeEventListener(this,c,d),delete t[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{r("attach",l),this.attached=!0,this.resize(),a("resize",s),a("detach",i)};i=()=>{this.attached=!1,r("resize",s),this._stop(),this._resize(0,0),a("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Pe(this._listeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._listeners={},Pe(this._responsiveListeners,(t,o)=>{this.platform.removeEventListener(this,o,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,o,a){const r=a?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(t[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){i=t[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const o=this._active||[],a=t.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(a,o)&&(this._active=a,this._lastEvent=null,this._updateHoverStyles(a,o))}notifyPlugins(t,o,a){return this._plugins.notify(this,t,o,a)}isPluginEnabled(t){return this._plugins._cache.filter(o=>o.plugin.id===t).length===1}_updateHoverStyles(t,o,a){const r=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,t),l=a?t:s(t,o);i.length&&this.updateHoverStyle(i,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(t,o){const a={event:t,replay:o,cancelable:!0,inChartArea:this.isPointInArea(t)},r=i=>(i.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",a,r)===!1)return;const s=this._handleEvent(t,o,a.inChartArea);return a.cancelable=!1,this.notifyPlugins("afterEvent",a,r),(s||a.changed)&&this.render(),this}_handleEvent(t,o,a){const{_active:r=[],options:s}=this,i=o,l=this._getActiveElements(t,r,a,i),c=mm(t),d=d0(t,this._lastEvent,a,c);a&&(this._lastEvent=null,Re(s.onHover,[t,l,this],this),c&&Re(s.onClick,[t,l,this],this));const u=!Xo(l,r);return(u||o)&&(this._active=l,this._updateHoverStyles(l,r,o)),this._lastEvent=d,u}_getActiveElements(t,o,a,r){if(t.type==="mouseout")return[];if(!a)return o;const s=this.options.hover;return this.getElementsAtEventForMode(t,s.mode,s,r)}}me(Ht,"defaults",He),me(Ht,"instances",pa),me(Ht,"overrides",kn),me(Ht,"registry",Mt),me(Ht,"version",s0),me(Ht,"getChart",kc);function wc(){return Pe(Ht.instances,e=>e._plugins.invalidate())}function u0(e,t,o){const{startAngle:a,x:r,y:s,outerRadius:i,innerRadius:l,options:c}=t,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,mt(a-o));if(e.beginPath(),e.arc(r,s,i-d/2,a+f/2,o-f/2),l>0){const h=Math.min(d/l,mt(a-o));e.arc(r,s,l+d/2,o-h/2,a+h/2,!0)}else{const h=Math.min(d/2,i*mt(a-o));if(u==="round")e.arc(r,s,h,o-Te/2,a+Te/2,!0);else if(u==="bevel"){const m=2*h*h,g=-m*Math.cos(o+Te/2)+r,y=-m*Math.sin(o+Te/2)+s,k=m*Math.cos(a+Te/2)+r,p=m*Math.sin(a+Te/2)+s;e.lineTo(g,y),e.lineTo(k,p)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function f0(e,t,o){const{startAngle:a,pixelMargin:r,x:s,y:i,outerRadius:l,innerRadius:c}=t;let d=r/l;e.beginPath(),e.arc(s,i,l,a-d,o+d),c>r?(d=r/c,e.arc(s,i,c,o+d,a-d,!0)):e.arc(s,i,r,o+Qe,a-Qe),e.closePath(),e.clip()}function h0(e){return Fr(e,["outerStart","outerEnd","innerStart","innerEnd"])}function m0(e,t,o,a){const r=h0(e.options.borderRadius),s=(o-t)/2,i=Math.min(s,a*t/2),l=c=>{const d=(o-Math.min(s,c))*a/2;return at(c,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:at(r.innerStart,0,i),innerEnd:at(r.innerEnd,0,i)}}function Wn(e,t,o,a){return{x:o+e*Math.cos(t),y:a+e*Math.sin(t)}}function ga(e,t,o,a,r,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=t,f=Math.max(t.outerRadius+a+o-d,0),h=u>0?u+a+o+d:0;let m=0;const g=r-c;if(a){const Y=u>0?u-a:0,R=f>0?f-a:0,X=(Y+R)/2,$=X!==0?g*X/(X+a):g;m=(g-$)/2}const y=Math.max(.001,g*f-o/Te)/f,k=(g-y)/2,p=c+k+m,B=r-k-m,{outerStart:C,outerEnd:w,innerStart:E,innerEnd:_}=m0(t,h,f,B-p),x=f-C,b=f-w,A=p+C/x,D=B-w/b,M=h+E,V=h+_,N=p+E/M,T=B-_/V;if(e.beginPath(),s){const Y=(A+D)/2;if(e.arc(i,l,f,A,Y),e.arc(i,l,f,Y,D),w>0){const Q=Wn(b,D,i,l);e.arc(Q.x,Q.y,w,D,B+Qe)}const R=Wn(V,B,i,l);if(e.lineTo(R.x,R.y),_>0){const Q=Wn(V,T,i,l);e.arc(Q.x,Q.y,_,B+Qe,T+Math.PI)}const X=(B-_/h+(p+E/h))/2;if(e.arc(i,l,h,B-_/h,X,!0),e.arc(i,l,h,X,p+E/h,!0),E>0){const Q=Wn(M,N,i,l);e.arc(Q.x,Q.y,E,N+Math.PI,p-Qe)}const $=Wn(x,p,i,l);if(e.lineTo($.x,$.y),C>0){const Q=Wn(x,A,i,l);e.arc(Q.x,Q.y,C,p-Qe,A)}}else{e.moveTo(i,l);const Y=Math.cos(A)*f+i,R=Math.sin(A)*f+l;e.lineTo(Y,R);const X=Math.cos(D)*f+i,$=Math.sin(D)*f+l;e.lineTo(X,$)}e.closePath()}function p0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l}=t;let c=t.endAngle;if(s){ga(e,t,o,a,c,r);for(let d=0;d<s;++d)e.fill();isNaN(l)||(c=i+(l%$e||$e))}return ga(e,t,o,a,c,r),e.fill(),c}function g0(e,t,o,a,r){const{fullCircles:s,startAngle:i,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,g=c.borderAlign==="inner";if(!d)return;e.setLineDash(f||[]),e.lineDashOffset=h,g?(e.lineWidth=d*2,e.lineJoin=u||"round"):(e.lineWidth=d,e.lineJoin=u||"bevel");let y=t.endAngle;if(s){ga(e,t,o,a,y,r);for(let k=0;k<s;++k)e.stroke();isNaN(l)||(y=i+(l%$e||$e))}g&&f0(e,t,y),c.selfJoin&&y-i>=Te&&m===0&&u!=="miter"&&u0(e,t,y),s||(ga(e,t,o,a,y,r),e.stroke())}class Eo extends Ut{constructor(o){super();me(this,"circumference");me(this,"endAngle");me(this,"fullCircles");me(this,"innerRadius");me(this,"outerRadius");me(this,"pixelMargin");me(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,a,r){const s=this.getProps(["x","y"],r),{angle:i,distance:l}=ol(s,{x:o,y:a}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],r),m=(this.options.spacing+this.options.borderWidth)/2,g=Ce(h,d-c),y=fo(i,c,d)&&c!==d,k=g>=$e||y,p=Wt(l,u+m,f+m);return k&&p}getCenterPoint(o){const{x:a,y:r,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,h=(l+c+u+d)/2;return{x:a+Math.cos(f)*h,y:r+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:a,circumference:r}=this,s=(a.offset||0)/4,i=(a.spacing||0)/2,l=a.circular;if(this.pixelMargin=a.borderAlign==="inner"?.33:0,this.fullCircles=r>$e?Math.floor(r/$e):0,r===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(Te,r||0)),u=s*d;o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,p0(o,this,u,i,l),g0(o,this,u,i,l),o.restore()}}me(Eo,"id","arc"),me(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}),me(Eo,"defaultRoutes",{backgroundColor:"backgroundColor"}),me(Eo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Cc(e,t,o=t){e.lineCap=Ce(o.borderCapStyle,t.borderCapStyle),e.setLineDash(Ce(o.borderDash,t.borderDash)),e.lineDashOffset=Ce(o.borderDashOffset,t.borderDashOffset),e.lineJoin=Ce(o.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Ce(o.borderWidth,t.borderWidth),e.strokeStyle=Ce(o.borderColor,t.borderColor)}function b0(e,t,o){e.lineTo(o.x,o.y)}function y0(e){return e.stepped?$m:e.tension||e.cubicInterpolationMode==="monotone"?Wm:b0}function Bc(e,t,o={}){const a=e.length,{start:r=0,end:s=a-1}=o,{start:i,end:l}=t,c=Math.max(r,i),d=Math.min(s,l),u=r<i&&s<i||r>l&&s>l;return{count:a,start:c,loop:t.loop,ilen:d<c&&!u?a+d-c:d-c}}function x0(e,t,o,a){const{points:r,options:s}=t,{count:i,start:l,loop:c,ilen:d}=Bc(r,o,a),u=y0(s);let{move:f=!0,reverse:h}=a||{},m,g,y;for(m=0;m<=d;++m)g=r[(l+(h?d-m:m))%i],!g.skip&&(f?(e.moveTo(g.x,g.y),f=!1):u(e,y,g,h,s.stepped),y=g);return c&&(g=r[(l+(h?d:0))%i],u(e,y,g,h,s.stepped)),!!c}function k0(e,t,o,a){const r=t.points,{count:s,start:i,ilen:l}=Bc(r,o,a),{move:c=!0,reverse:d}=a||{};let u=0,f=0,h,m,g,y,k,p;const B=w=>(i+(d?l-w:w))%s,C=()=>{y!==k&&(e.lineTo(u,k),e.lineTo(u,y),e.lineTo(u,p))};for(c&&(m=r[B(0)],e.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=r[B(h)],m.skip)continue;const w=m.x,E=m.y,_=w|0;_===g?(E<y?y=E:E>k&&(k=E),u=(f*u+w)/++f):(C(),e.lineTo(w,E),g=_,f=0,y=k=E),p=E}C()}function es(e){const t=e.options,o=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!o?k0:x0}function w0(e){return e.stepped?kp:e.tension||e.cubicInterpolationMode==="monotone"?wp:_n}function C0(e,t,o,a){let r=t._path;r||(r=t._path=new Path2D,t.path(r,o,a)&&r.closePath()),Cc(e,t.options),e.stroke(r)}function B0(e,t,o,a){const{segments:r,options:s}=t,i=es(t);for(const l of r)Cc(e,s,l.style),e.beginPath(),i(e,t,l,{start:o,end:o+a-1})&&e.closePath(),e.stroke()}const E0=typeof Path2D=="function";function _0(e,t,o,a){E0&&!t.options.segment?C0(e,t,o,a):B0(e,t,o,a)}class rn extends Ut{constructor(t){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,t&&Object.assign(this,t)}updateControlPoints(t,o){const a=this.options;if((a.tension||a.cubicInterpolationMode==="monotone")&&!a.stepped&&!this._pointsUpdated){const r=a.spanGaps?this._loop:this._fullLoop;fp(this._points,a,t,r,o),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ap(this,this.options.segment))}first(){const t=this.segments,o=this.points;return t.length&&o[t[0].start]}last(){const t=this.segments,o=this.points,a=t.length;return a&&o[t[a-1].end]}interpolate(t,o){const a=this.options,r=t[o],s=this.points,i=vl(this,{property:o,start:r,end:r});if(!i.length)return;const l=[],c=w0(a);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],g=s[h];if(m===g){l.push(m);continue}const y=Math.abs((r-m[o])/(g[o]-m[o])),k=c(m,g,y,a.stepped);k[o]=t[o],l.push(k)}return l.length===1?l[0]:l}pathSegment(t,o,a){return es(this)(t,this,o,a)}path(t,o,a){const r=this.segments,s=es(this);let i=this._loop;o=o||0,a=a||this.points.length-o;for(const l of r)i&=s(t,this,l,{start:o,end:o+a-1});return!!i}draw(t,o,a,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(t.save(),_0(t,this,a,r),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}me(rn,"id","line"),me(rn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),me(rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),me(rn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ec(e,t,o,a){const r=e.options,{[o]:s}=e.getProps([o],a);return Math.abs(t-s)<r.radius+r.hitRadius}class ba extends Ut{constructor(o){super();me(this,"parsed");me(this,"skip");me(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,a,r){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],r);return Math.pow(o-i,2)+Math.pow(a-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,a){return Ec(this,o,"x",a)}inYRange(o,a){return Ec(this,o,"y",a)}getCenterPoint(o){const{x:a,y:r}=this.getProps(["x","y"],o);return{x:a,y:r}}size(o){o=o||this.options||{};let a=o.radius||0;a=Math.max(a,a&&o.hoverRadius||0);const r=a&&o.borderWidth||0;return(a+r)*2}draw(o,a){const r=this.options;this.skip||r.radius<.1||!po(this,a,this.size(r)/2)||(o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.fillStyle=r.backgroundColor,zr(o,r,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}me(ba,"id","point"),me(ba,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),me(ba,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function _c(e,t){const{x:o,y:a,base:r,width:s,height:i}=e.getProps(["x","y","base","width","height"],t);let l,c,d,u,f;return e.horizontal?(f=i/2,l=Math.min(o,r),c=Math.max(o,r),d=a-f,u=a+f):(f=s/2,l=o-f,c=o+f,d=Math.min(a,r),u=Math.max(a,r)),{left:l,top:d,right:c,bottom:u}}function sn(e,t,o,a){return e?0:at(t,o,a)}function S0(e,t,o){const a=e.options.borderWidth,r=e.borderSkipped,s=bl(a);return{t:sn(r.top,s.top,0,o),r:sn(r.right,s.right,0,t),b:sn(r.bottom,s.bottom,0,o),l:sn(r.left,s.left,0,t)}}function A0(e,t,o){const{enableBorderRadius:a}=e.getProps(["enableBorderRadius"]),r=e.options.borderRadius,s=zn(r),i=Math.min(t,o),l=e.borderSkipped,c=a||_e(r);return{topLeft:sn(!c||l.top||l.left,s.topLeft,0,i),topRight:sn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:sn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:sn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function V0(e){const t=_c(e),o=t.right-t.left,a=t.bottom-t.top,r=S0(e,o/2,a/2),s=A0(e,o/2,a/2);return{outer:{x:t.left,y:t.top,w:o,h:a,radius:s},inner:{x:t.left+r.l,y:t.top+r.t,w:o-r.l-r.r,h:a-r.t-r.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(r.t,r.l)),topRight:Math.max(0,s.topRight-Math.max(r.t,r.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(r.b,r.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(r.b,r.r))}}}}function ts(e,t,o,a){const r=t===null,s=o===null,l=e&&!(r&&s)&&_c(e,a);return l&&(r||Wt(t,l.left,l.right))&&(s||Wt(o,l.top,l.bottom))}function D0(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function M0(e,t){e.rect(t.x,t.y,t.w,t.h)}function ns(e,t,o={}){const a=e.x!==o.x?-t:0,r=e.y!==o.y?-t:0,s=(e.x+e.w!==o.x+o.w?t:0)-a,i=(e.y+e.h!==o.y+o.h?t:0)-r;return{x:e.x+a,y:e.y+r,w:e.w+s,h:e.h+i,radius:e.radius}}class ya extends Ut{constructor(t){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,t&&Object.assign(this,t)}draw(t){const{inflateAmount:o,options:{borderColor:a,backgroundColor:r}}=this,{inner:s,outer:i}=V0(this),l=D0(i.radius)?ea:M0;t.save(),(i.w!==s.w||i.h!==s.h)&&(t.beginPath(),l(t,ns(i,o,s)),t.clip(),l(t,ns(s,-o,i)),t.fillStyle=a,t.fill("evenodd")),t.beginPath(),l(t,ns(s,o)),t.fillStyle=r,t.fill(),t.restore()}inRange(t,o,a){return ts(this,t,o,a)}inXRange(t,o){return ts(this,t,null,o)}inYRange(t,o){return ts(this,null,t,o)}getCenterPoint(t){const{x:o,y:a,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],t);return{x:s?(o+r)/2:o,y:s?a:(a+r)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}me(ya,"id","bar"),me(ya,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),me(ya,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function N0(e,t,o){const a=e.segments,r=e.points,s=t.points,i=[];for(const l of a){let{start:c,end:d}=l;d=xa(c,d,r);const u=os(o,r[c],r[d],l.loop);if(!t.segments){i.push({source:l,target:u,start:r[c],end:r[d]});continue}const f=vl(t,u);for(const h of f){const m=os(o,s[h.start],s[h.end],h.loop),g=Nl(l,r,m);for(const y of g)i.push({source:y,target:h,start:{[o]:Sc(u,m,"start",Math.max)},end:{[o]:Sc(u,m,"end",Math.min)}})}}return i}function os(e,t,o,a){if(a)return;let r=t[e],s=o[e];return e==="angle"&&(r=mt(r),s=mt(s)),{property:e,start:r,end:s}}function v0(e,t){const{x:o=null,y:a=null}=e||{},r=t.points,s=[];return t.segments.forEach(({start:i,end:l})=>{l=xa(i,l,r);const c=r[i],d=r[l];a!==null?(s.push({x:c.x,y:a}),s.push({x:d.x,y:a})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function xa(e,t,o){for(;t>e;t--){const a=o[t];if(!isNaN(a.x)&&!isNaN(a.y))break}return t}function Sc(e,t,o,a){return e&&t?a(e[o],t[o]):e?e[o]:t?t[o]:0}function Ac(e,t){let o=[],a=!1;return Ye(e)?(a=!0,o=e):o=v0(e,t),o.length?new rn({points:o,options:{tension:0},_loop:a,_fullLoop:a}):null}function Vc(e){return e&&e.fill!==!1}function P0(e,t,o){let r=e[t].fill;const s=[t];let i;if(!o)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!ot(r))return r;if(i=e[r],!i)return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function T0(e,t,o){const a=R0(e);if(_e(a))return isNaN(a.value)?!1:a;let r=parseFloat(a);return ot(r)&&Math.floor(r)===r?O0(a[0],t,r,o):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function O0(e,t,o,a){return(e==="-"||e==="+")&&(o=t+o),o===t||o<0||o>=a?!1:o}function z0(e,t){let o=null;return e==="start"?o=t.bottom:e==="end"?o=t.top:_e(e)?o=t.getPixelForValue(e.value):t.getBasePixel&&(o=t.getBasePixel()),o}function F0(e,t,o){let a;return e==="start"?a=o:e==="end"?a=t.options.reverse?t.min:t.max:_e(e)?a=e.value:a=t.getBaseValue(),a}function R0(e){const t=e.options,o=t.fill;let a=Ce(o&&o.target,o);return a===void 0&&(a=!!t.backgroundColor),a===!1||a===null?!1:a===!0?"origin":a}function I0(e){const{scale:t,index:o,line:a}=e,r=[],s=a.segments,i=a.points,l=L0(t,o);l.push(Ac({x:null,y:t.bottom},a));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)$0(r,i[u],l)}return new rn({points:r,options:{}})}function L0(e,t){const o=[],a=e.getMatchingVisibleMetas("line");for(let r=0;r<a.length;r++){const s=a[r];if(s.index===t)break;s.hidden||o.unshift(s.dataset)}return o}function $0(e,t,o){const a=[];for(let r=0;r<o.length;r++){const s=o[r],{first:i,last:l,point:c}=W0(s,t,"x");if(!(!c||i&&l)){if(i)a.unshift(c);else if(e.push(c),!l)break}}e.push(...a)}function W0(e,t,o){const a=e.interpolate(t,o);if(!a)return{};const r=a[o],s=e.segments,i=e.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],h=i[u.end][o];if(Wt(r,f,h)){l=r===f,c=r===h;break}}return{first:l,last:c,point:a}}class Dc{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,o,a){const{x:r,y:s,radius:i}=this;return o=o||{start:0,end:$e},t.arc(r,s,i,o.end,o.start,!0),!a.bounds}interpolate(t){const{x:o,y:a,radius:r}=this,s=t.angle;return{x:o+Math.cos(s)*r,y:a+Math.sin(s)*r,angle:s}}}function j0(e){const{chart:t,fill:o,line:a}=e;if(ot(o))return U0(t,o);if(o==="stack")return I0(e);if(o==="shape")return!0;const r=H0(e);return r instanceof Dc?r:Ac(r,a)}function U0(e,t){const o=e.getDatasetMeta(t);return o&&e.isDatasetVisible(t)?o.dataset:null}function H0(e){return(e.scale||{}).getPointPositionForValue?G0(e):q0(e)}function q0(e){const{scale:t={},fill:o}=e,a=z0(o,t);if(ot(a)){const r=t.isHorizontal();return{x:r?a:null,y:r?null:a}}return null}function G0(e){const{scale:t,fill:o}=e,a=t.options,r=t.getLabels().length,s=a.reverse?t.max:t.min,i=F0(o,t,s),l=[];if(a.grid.circular){const c=t.getPointPositionForValue(0,s);return new Dc({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(i)})}for(let c=0;c<r;++c)l.push(t.getPointPositionForValue(c,i));return l}function as(e,t,o){const a=j0(t),{chart:r,index:s,line:i,scale:l,axis:c}=t,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},g=r.getDatasetMeta(s),y=Ol(r,g);a&&i.points.length&&(Qo(e,o),X0(e,{line:i,target:a,above:h,below:m,area:o,scale:l,axis:c,clip:y}),Zo(e))}function X0(e,t){const{line:o,target:a,above:r,below:s,area:i,scale:l,clip:c}=t,d=o._loop?"angle":t.axis;e.save();let u=s;s!==r&&(d==="x"?(Mc(e,a,i.top),rs(e,{line:o,target:a,color:r,scale:l,property:d,clip:c}),e.restore(),e.save(),Mc(e,a,i.bottom)):d==="y"&&(Nc(e,a,i.left),rs(e,{line:o,target:a,color:s,scale:l,property:d,clip:c}),e.restore(),e.save(),Nc(e,a,i.right),u=r)),rs(e,{line:o,target:a,color:u,scale:l,property:d,clip:c}),e.restore()}function Mc(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(u.x,o),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(f.x,o)}e.lineTo(t.first().x,o),e.closePath(),e.clip()}function Nc(e,t,o){const{segments:a,points:r}=t;let s=!0,i=!1;e.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[xa(c,d,r)];s?(e.moveTo(u.x,u.y),s=!1):(e.lineTo(o,u.y),e.lineTo(u.x,u.y)),i=!!t.pathSegment(e,l,{move:i}),i?e.closePath():e.lineTo(o,f.y)}e.lineTo(o,t.first().y),e.closePath(),e.clip()}function rs(e,t){const{line:o,target:a,property:r,color:s,scale:i,clip:l}=t,c=N0(o,a,r);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,g=a!==!0;e.save(),e.fillStyle=m,Y0(e,i,l,g&&os(r,f,h)),e.beginPath();const y=!!o.pathSegment(e,d);let k;if(g){y?e.closePath():vc(e,a,h,r);const p=!!a.pathSegment(e,u,{move:y,reverse:!0});k=y&&p,k||vc(e,a,f,r)}e.closePath(),e.fill(k?"evenodd":"nonzero"),e.restore()}}function Y0(e,t,o,a){const r=t.chart.chartArea,{property:s,start:i,end:l}=a||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=r.top,u=l,f=r.bottom):(c=r.left,d=i,u=r.right,f=l),e.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)),e.rect(c,d,u-c,f-d),e.clip()}}function vc(e,t,o,a){const r=t.interpolate(o,a);r&&e.lineTo(r.x,r.y)}var K0={id:"filler",afterDatasetsUpdate(e,t,o){const a=(e.data.datasets||[]).length,r=[];let s,i,l,c;for(i=0;i<a;++i)s=e.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof rn&&(c={visible:e.isDatasetVisible(i),index:i,fill:T0(l,i,a),chart:e,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,r.push(c);for(i=0;i<a;++i)c=r[i],!(!c||c.fill===!1)&&(c.fill=P0(r,i,o.propagate))},beforeDraw(e,t,o){const a=o.drawTime==="beforeDraw",r=e.getSortedVisibleDatasetMetas(),s=e.chartArea;for(let i=r.length-1;i>=0;--i){const l=r[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),a&&l.fill&&as(e.ctx,l,s))}},beforeDatasetsDraw(e,t,o){if(o.drawTime!=="beforeDatasetsDraw")return;const a=e.getSortedVisibleDatasetMetas();for(let r=a.length-1;r>=0;--r){const s=a[r].$filler;Vc(s)&&as(e.ctx,s,e.chartArea)}},beforeDatasetDraw(e,t,o){const a=t.meta.$filler;!Vc(a)||o.drawTime!=="beforeDatasetDraw"||as(e.ctx,a,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Pc=(e,t)=>{let{boxHeight:o=t,boxWidth:a=t}=e;return e.usePointStyle&&(o=Math.min(o,t),a=e.pointStyleWidth||Math.min(a,t)),{boxWidth:a,boxHeight:o,itemHeight:Math.max(t,o)}},J0=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Tc extends Ut{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,o,a){this.maxWidth=t,this.maxHeight=o,this._margins=a,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 t=this.options.labels||{};let o=Re(t.generateLabels,[this.chart],this)||[];t.filter&&(o=o.filter(a=>t.filter(a,this.chart.data))),t.sort&&(o=o.sort((a,r)=>t.sort(a,r,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:t,ctx:o}=this;if(!t.display){this.width=this.height=0;return}const a=t.labels,r=st(a.font),s=r.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Pc(a,s);let d,u;o.font=r.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,r,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(u,t.maxHeight||this.maxHeight)}_fitRows(t,o,a,r){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=r+l;let f=t;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((g,y)=>{const k=a+o/2+s.measureText(g.text).width;(y===0||d[d.length-1]+k+2*l>i)&&(f+=u,d[d.length-(y>0?0:1)]=0,m+=u,h++),c[y]={left:0,top:m,row:h,width:k,height:r},d[d.length-1]+=k+l}),f}_fitCols(t,o,a,r){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-t;let f=l,h=0,m=0,g=0,y=0;return this.legendItems.forEach((k,p)=>{const{itemWidth:B,itemHeight:C}=Q0(a,o,s,k,r);p>0&&m+C+2*l>u&&(f+=h+l,d.push({width:h,height:m}),g+=h+l,y++,h=m=0),c[p]={left:g,top:m,col:y,width:B,height:C},h=Math.max(h,B),m+=C+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:a,labels:{padding:r},rtl:s}}=this,i=In(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=rt(a,this.left+r,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=rt(a,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+t+r,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+r}else{let l=0,c=rt(a,this.top+t+r,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=rt(a,this.top+t+r,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+r,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+r}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Qo(t,this),this._draw(),Zo(t)}}_draw(){const{options:t,columnSizes:o,lineWidths:a,ctx:r}=this,{align:s,labels:i}=t,l=He.color,c=In(t.rtl,this.left,this.width),d=st(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),r.textAlign=c.textAlign("left"),r.textBaseline="middle",r.lineWidth=.5,r.font=d.string;const{boxWidth:g,boxHeight:y,itemHeight:k}=Pc(i,f),p=function(_,x,b){if(isNaN(g)||g<=0||isNaN(y)||y<0)return;r.save();const A=Ce(b.lineWidth,1);if(r.fillStyle=Ce(b.fillStyle,l),r.lineCap=Ce(b.lineCap,"butt"),r.lineDashOffset=Ce(b.lineDashOffset,0),r.lineJoin=Ce(b.lineJoin,"miter"),r.lineWidth=A,r.strokeStyle=Ce(b.strokeStyle,l),r.setLineDash(Ce(b.lineDash,[])),i.usePointStyle){const D={radius:y*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:A},M=c.xPlus(_,g/2),V=x+h;gl(r,D,M,V,i.pointStyleWidth&&g)}else{const D=x+Math.max((f-y)/2,0),M=c.leftForLtr(_,g),V=zn(b.borderRadius);r.beginPath(),Object.values(V).some(N=>N!==0)?ea(r,{x:M,y:D,w:g,h:y,radius:V}):r.rect(M,D,g,y),r.fill(),A!==0&&r.stroke()}r.restore()},B=function(_,x,b){go(r,b.text,_,x+k/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},C=this.isHorizontal(),w=this._computeTitleHeight();C?m={x:rt(s,this.left+u,this.right-a[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:rt(s,this.top+w+u,this.bottom-o[0].height),line:0},Al(this.ctx,t.textDirection);const E=k+u;this.legendItems.forEach((_,x)=>{r.strokeStyle=_.fontColor,r.fillStyle=_.fontColor;const b=r.measureText(_.text).width,A=c.textAlign(_.textAlign||(_.textAlign=i.textAlign)),D=g+h+b;let M=m.x,V=m.y;c.setWidth(this.width),C?x>0&&M+D+u>this.right&&(V=m.y+=E,m.line++,M=m.x=rt(s,this.left+u,this.right-a[m.line])):x>0&&V+E>this.bottom&&(M=m.x=M+o[m.line].width+u,m.line++,V=m.y=rt(s,this.top+w+u,this.bottom-o[m.line].height));const N=c.x(M);if(p(N,V,_),M=Vm(A,M+g+h,C?M+D:this.right,t.rtl),B(c.x(M),V,_),C)m.x+=D+u;else if(typeof _.text!="string"){const T=d.lineHeight;m.y+=Oc(_,T)+u}else m.y+=E}),Vl(this.ctx,t.textDirection)}drawTitle(){const t=this.options,o=t.title,a=st(o.font),r=bt(o.padding);if(!o.display)return;const s=In(t.rtl,this.left,this.width),i=this.ctx,l=o.position,c=a.size/2,d=r.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=rt(t.align,f,this.right-h);else{const g=this.columnSizes.reduce((y,k)=>Math.max(y,k.height),0);u=d+rt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const m=rt(l,f,f+h);i.textAlign=s.textAlign(Mr(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=a.string,go(i,o.text,m,u,a)}_computeTitleHeight(){const t=this.options.title,o=st(t.font),a=bt(t.padding);return t.display?o.lineHeight+a.height:0}_getLegendItemAt(t,o){let a,r,s;if(Wt(t,this.left,this.right)&&Wt(o,this.top,this.bottom)){for(s=this.legendHitBoxes,a=0;a<s.length;++a)if(r=s[a],Wt(t,r.left,r.left+r.width)&&Wt(o,r.top,r.top+r.height))return this.legendItems[a]}return null}handleEvent(t){const o=this.options;if(!tb(t.type,o))return;const a=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const r=this._hoveredItem,s=J0(r,a);r&&!s&&Re(o.onLeave,[t,r,this],this),this._hoveredItem=a,a&&!s&&Re(o.onHover,[t,a,this],this)}else a&&Re(o.onClick,[t,a,this],this)}}function Q0(e,t,o,a,r){const s=Z0(a,e,t,o),i=eb(r,a,t.lineHeight);return{itemWidth:s,itemHeight:i}}function Z0(e,t,o,a){let r=e.text;return r&&typeof r!="string"&&(r=r.reduce((s,i)=>s.length>i.length?s:i)),t+o.size/2+a.measureText(r).width}function eb(e,t,o){let a=e;return typeof t.text!="string"&&(a=Oc(t,o)),a}function Oc(e,t){const o=e.text?e.text.length:0;return t*o}function tb(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var nb={id:"legend",_element:Tc,start(e,t,o){const a=e.legend=new Tc({ctx:e.ctx,options:o,chart:e});yt.configure(e,a,o),yt.addBox(e,a)},stop(e){yt.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,o){const a=e.legend;yt.configure(e,a,o),a.options=o},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,o){const a=t.datasetIndex,r=o.chart;r.isDatasetVisible(a)?(r.hide(a),t.hidden=!0):(r.show(a),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:o,pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=e.legend.options;return e._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=bt(d.borderWidth);return{text:t[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:a||d.pointStyle,rotation:d.rotation,textAlign:r||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class zc extends Ut{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.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(t,o){const a=this.options;if(this.left=0,this.top=0,!a.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=o;const r=Ye(a.text)?a.text.length:1;this._padding=bt(a.padding);const s=r*st(a.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:o,left:a,bottom:r,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=rt(l,a,s),f=o+t,d=s-a):(i.position==="left"?(u=a+t,f=rt(l,r,o),c=Te*-.5):(u=s-t,f=rt(l,o,r),c=Te*.5),d=r-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,o=this.options;if(!o.display)return;const a=st(o.font),s=a.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);go(t,o.text,0,0,a,{color:o.color,maxWidth:c,rotation:d,textAlign:Mr(o.align),textBaseline:"middle",translation:[i,l]})}}function ob(e,t){const o=new zc({ctx:e.ctx,options:t,chart:e});yt.configure(e,o,t),yt.addBox(e,o),e.titleBlock=o}var ab={id:"title",_element:zc,start(e,t,o){ob(e,o)},stop(e){const t=e.titleBlock;yt.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,o){const a=e.titleBlock;yt.configure(e,a,o),a.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(e){if(!e.length)return!1;let t,o,a=new Set,r=0,s=0;for(t=0,o=e.length;t<o;++t){const l=e[t].element;if(l&&l.hasValue()){const c=l.tooltipPosition();a.add(c.x),r+=c.y,++s}}return s===0||a.size===0?!1:{x:[...a].reduce((l,c)=>l+c)/a.size,y:r/s}},nearest(e,t){if(!e.length)return!1;let o=t.x,a=t.y,r=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=e.length;s<i;++s){const c=e[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Vr(t,d);u<r&&(r=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,a=c.y}return{x:o,y:a}}};function Nt(e,t){return t&&(Ye(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function qt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
17
- `)>-1?e.split(`
18
- `):e}function rb(e,t){const{element:o,datasetIndex:a,index:r}=t,s=e.getDatasetMeta(a).controller,{label:i,value:l}=s.getLabelAndValue(r);return{chart:e,label:i,parsed:s.getParsed(r),raw:e.data.datasets[a].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:a,element:o}}function Fc(e,t){const o=e.chart.ctx,{body:a,footer:r,title:s}=e,{boxWidth:i,boxHeight:l}=t,c=st(t.bodyFont),d=st(t.titleFont),u=st(t.footerFont),f=s.length,h=r.length,m=a.length,g=bt(t.padding);let y=g.height,k=0,p=a.reduce((w,E)=>w+E.before.length+E.lines.length+E.after.length,0);if(p+=e.beforeBody.length+e.afterBody.length,f&&(y+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),p){const w=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;y+=m*w+(p-m)*c.lineHeight+(p-1)*t.bodySpacing}h&&(y+=t.footerMarginTop+h*u.lineHeight+(h-1)*t.footerSpacing);let B=0;const C=function(w){k=Math.max(k,o.measureText(w).width+B)};return o.save(),o.font=d.string,Pe(e.title,C),o.font=c.string,Pe(e.beforeBody.concat(e.afterBody),C),B=t.displayColors?i+2+t.boxPadding:0,Pe(a,w=>{Pe(w.before,C),Pe(w.lines,C),Pe(w.after,C)}),B=0,o.font=u.string,Pe(e.footer,C),o.restore(),k+=g.width,{width:k,height:y}}function sb(e,t){const{y:o,height:a}=t;return o<a/2?"top":o>e.height-a/2?"bottom":"center"}function ib(e,t,o,a){const{x:r,width:s}=a,i=o.caretSize+o.caretPadding;if(e==="left"&&r+s+i>t.width||e==="right"&&r-s-i<0)return!0}function lb(e,t,o,a){const{x:r,width:s}=o,{width:i,chartArea:{left:l,right:c}}=e;let d="center";return a==="center"?d=r<=(l+c)/2?"left":"right":r<=s/2?d="left":r>=i-s/2&&(d="right"),ib(d,e,t,o)&&(d="center"),d}function Rc(e,t,o){const a=o.yAlign||t.yAlign||sb(e,o);return{xAlign:o.xAlign||t.xAlign||lb(e,t,o,a),yAlign:a}}function cb(e,t){let{x:o,width:a}=e;return t==="right"?o-=a:t==="center"&&(o-=a/2),o}function db(e,t,o){let{y:a,height:r}=e;return t==="top"?a+=o:t==="bottom"?a-=r+o:a-=r/2,a}function Ic(e,t,o,a){const{caretSize:r,caretPadding:s,cornerRadius:i}=e,{xAlign:l,yAlign:c}=o,d=r+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=zn(i);let g=cb(t,l);const y=db(t,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,h)+r:l==="right"&&(g+=Math.max(f,m)+r),{x:at(g,0,a.width-t.width),y:at(y,0,a.height-t.height)}}function ka(e,t,o){const a=bt(o.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-a.right:e.x+a.left}function Lc(e){return Nt([],qt(e))}function ub(e,t,o){return Cn(e,{tooltip:t,tooltipItems:o,type:"tooltip"})}function $c(e,t){const o=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return o?e.override(o):e}const Wc={beforeTitle:Lt,title(e){if(e.length>0){const t=e[0],o=t.chart.data.labels,a=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(a>0&&t.dataIndex<a)return o[t.dataIndex]}return""},afterTitle:Lt,beforeBody:Lt,beforeLabel:Lt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const o=e.formattedValue;return ve(o)||(t+=o),t},labelColor(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.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(e){const o=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:Lt,afterBody:Lt,beforeFooter:Lt,footer:Lt,afterFooter:Lt};function ct(e,t,o,a){const r=e[t].call(o,a);return typeof r>"u"?Wc[t].call(o,a):r}class ss extends Ut{constructor(t){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=t.chart,this.options=t.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(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const o=this.chart,a=this.options.setContext(this.getContext()),r=a.enabled&&o.options.animation&&a.animations,s=new Fl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ub(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,o){const{callbacks:a}=o,r=ct(a,"beforeTitle",this,t),s=ct(a,"title",this,t),i=ct(a,"afterTitle",this,t);let l=[];return l=Nt(l,qt(r)),l=Nt(l,qt(s)),l=Nt(l,qt(i)),l}getBeforeBody(t,o){return Lc(ct(o.callbacks,"beforeBody",this,t))}getBody(t,o){const{callbacks:a}=o,r=[];return Pe(t,s=>{const i={before:[],lines:[],after:[]},l=$c(a,s);Nt(i.before,qt(ct(l,"beforeLabel",this,s))),Nt(i.lines,ct(l,"label",this,s)),Nt(i.after,qt(ct(l,"afterLabel",this,s))),r.push(i)}),r}getAfterBody(t,o){return Lc(ct(o.callbacks,"afterBody",this,t))}getFooter(t,o){const{callbacks:a}=o,r=ct(a,"beforeFooter",this,t),s=ct(a,"footer",this,t),i=ct(a,"afterFooter",this,t);let l=[];return l=Nt(l,qt(r)),l=Nt(l,qt(s)),l=Nt(l,qt(i)),l}_createItems(t){const o=this._active,a=this.chart.data,r=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(rb(this.chart,o[c]));return t.filter&&(l=l.filter((u,f,h)=>t.filter(u,f,h,a))),t.itemSort&&(l=l.sort((u,f)=>t.itemSort(u,f,a))),Pe(l,u=>{const f=$c(t.callbacks,u);r.push(ct(f,"labelColor",this,u)),s.push(ct(f,"labelPointStyle",this,u)),i.push(ct(f,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(t,o){const a=this.options.setContext(this.getContext()),r=this._active;let s,i=[];if(!r.length)this.opacity!==0&&(s={opacity:0});else{const l=_o[a.position].call(this,r,this._eventPosition);i=this._createItems(a),this.title=this.getTitle(i,a),this.beforeBody=this.getBeforeBody(i,a),this.body=this.getBody(i,a),this.afterBody=this.getAfterBody(i,a),this.footer=this.getFooter(i,a);const c=this._size=Fc(this,a),d=Object.assign({},l,c),u=Rc(this.chart,a,d),f=Ic(a,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),t&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(t,o,a,r){const s=this.getCaretPosition(t,a,r);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(t,o,a){const{xAlign:r,yAlign:s}=this,{caretSize:i,cornerRadius:l}=a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=zn(l),{x:h,y:m}=t,{width:g,height:y}=o;let k,p,B,C,w,E;return s==="center"?(w=m+y/2,r==="left"?(k=h,p=k-i,C=w+i,E=w-i):(k=h+g,p=k+i,C=w-i,E=w+i),B=k):(r==="left"?p=h+Math.max(c,u)+i:r==="right"?p=h+g-Math.max(d,f)-i:p=this.caretX,s==="top"?(C=m,w=C-i,k=p-i,B=p+i):(C=m+y,w=C+i,k=p+i,B=p-i),E=C),{x1:k,x2:p,x3:B,y1:C,y2:w,y3:E}}drawTitle(t,o,a){const r=this.title,s=r.length;let i,l,c;if(s){const d=In(a.rtl,this.x,this.width);for(t.x=ka(this,a.titleAlign,a),o.textAlign=d.textAlign(a.titleAlign),o.textBaseline="middle",i=st(a.titleFont),l=a.titleSpacing,o.fillStyle=a.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(r[c],d.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+l,c+1===s&&(t.y+=a.titleMarginBottom-l)}}_drawColorBox(t,o,a,r,s){const i=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:c,boxWidth:d}=s,u=st(s.bodyFont),f=ka(this,"left",s),h=r.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=o.y+m;if(s.usePointStyle){const y={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},k=r.leftForLtr(h,d)+d/2,p=g+c/2;t.strokeStyle=s.multiKeyBackground,t.fillStyle=s.multiKeyBackground,zr(t,y,k,p),t.strokeStyle=i.borderColor,t.fillStyle=i.backgroundColor,zr(t,y,k,p)}else{t.lineWidth=_e(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,t.strokeStyle=i.borderColor,t.setLineDash(i.borderDash||[]),t.lineDashOffset=i.borderDashOffset||0;const y=r.leftForLtr(h,d),k=r.leftForLtr(r.xPlus(h,1),d-2),p=zn(i.borderRadius);Object.values(p).some(B=>B!==0)?(t.beginPath(),t.fillStyle=s.multiKeyBackground,ea(t,{x:y,y:g,w:d,h:c,radius:p}),t.fill(),t.stroke(),t.fillStyle=i.backgroundColor,t.beginPath(),ea(t,{x:k,y:g+1,w:d-2,h:c-2,radius:p}),t.fill()):(t.fillStyle=s.multiKeyBackground,t.fillRect(y,g,d,c),t.strokeRect(y,g,d,c),t.fillStyle=i.backgroundColor,t.fillRect(k,g+1,d-2,c-2))}t.fillStyle=this.labelTextColors[a]}drawBody(t,o,a){const{body:r}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=a,f=st(a.bodyFont);let h=f.lineHeight,m=0;const g=In(a.rtl,this.x,this.width),y=function(b){o.fillText(b,g.x(t.x+m),t.y+h/2),t.y+=h+s},k=g.textAlign(i);let p,B,C,w,E,_,x;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,t.x=ka(this,k,a),o.fillStyle=a.bodyColor,Pe(this.beforeBody,y),m=l&&k!=="right"?i==="center"?d/2+u:d+2+u:0,w=0,_=r.length;w<_;++w){for(p=r[w],B=this.labelTextColors[w],o.fillStyle=B,Pe(p.before,y),C=p.lines,l&&C.length&&(this._drawColorBox(o,t,w,g,a),h=Math.max(f.lineHeight,c)),E=0,x=C.length;E<x;++E)y(C[E]),h=f.lineHeight;Pe(p.after,y)}m=0,h=f.lineHeight,Pe(this.afterBody,y),t.y-=s}drawFooter(t,o,a){const r=this.footer,s=r.length;let i,l;if(s){const c=In(a.rtl,this.x,this.width);for(t.x=ka(this,a.footerAlign,a),t.y+=a.footerMarginTop,o.textAlign=c.textAlign(a.footerAlign),o.textBaseline="middle",i=st(a.footerFont),o.fillStyle=a.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(r[l],c.x(t.x),t.y+i.lineHeight/2),t.y+=i.lineHeight+a.footerSpacing}}drawBackground(t,o,a,r){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=t,{width:d,height:u}=a,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:g}=zn(r.cornerRadius);o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,o.lineWidth=r.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(t,o,a,r),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(t,o,a,r),o.lineTo(l+d,c+u-g),o.quadraticCurveTo(l+d,c+u,l+d-g,c+u),i==="bottom"&&this.drawCaret(t,o,a,r),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(t,o,a,r),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),r.borderWidth>0&&o.stroke()}_updateAnimationTarget(t){const o=this.chart,a=this.$animations,r=a&&a.x,s=a&&a.y;if(r||s){const i=_o[t.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=Fc(this,t),c=Object.assign({},i,this._size),d=Rc(o,t,c),u=Ic(t,c,d,o);(r._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(t){const o=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(o);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const i=bt(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(t.save(),t.globalAlpha=a,this.drawBackground(s,t,r,o),Al(t,o.textDirection),s.y+=i.top,this.drawTitle(s,t,o),this.drawBody(s,t,o),this.drawFooter(s,t,o),Vl(t,o.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,o){const a=this._active,r=t.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(a,r),i=this._positionChanged(r,o);(s||i)&&(this._active=r,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,o,a=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],i=this._getActiveElements(t,s,o,a),l=this._positionChanged(i,t),c=o||!Xo(i,s)||l;return c&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,o))),c}_getActiveElements(t,o,a,r){const s=this.options;if(t.type==="mouseout")return[];if(!r)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(t,s.mode,s,a);return s.reverse&&i.reverse(),i}_positionChanged(t,o){const{caretX:a,caretY:r,options:s}=this,i=_o[s.position].call(this,t,o);return i!==!1&&(a!==i.x||r!==i.y)}}me(ss,"positioners",_o);var fb={id:"tooltip",_element:ss,positioners:_o,afterInit(e,t,o){o&&(e.tooltip=new ss({chart:e,options:o}))},beforeUpdate(e,t,o){e.tooltip&&e.tooltip.initialize(o)},reset(e,t,o){e.tooltip&&e.tooltip.initialize(o)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const o={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",o)}},afterEvent(e,t){if(e.tooltip){const o=t.replay;e.tooltip.handleEvent(t.event,o,t.inChartArea)&&(t.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:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.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:Wc},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const hb=(e,t,o,a)=>(typeof t=="string"?(o=e.push(t)-1,a.unshift({index:o,label:t})):isNaN(t)&&(o=null),o);function mb(e,t,o,a){const r=e.indexOf(t);if(r===-1)return hb(e,t,o,a);const s=e.lastIndexOf(t);return r!==s?o:r}const pb=(e,t)=>e===null?null:at(Math.round(e),0,t);function jc(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class is extends $n{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const o=this._addedLabels;if(o.length){const a=this.getLabels();for(const{index:r,label:s}of o)a[r]===s&&a.splice(r,1);this._addedLabels=[]}super.init(t)}parse(t,o){if(ve(t))return null;const a=this.getLabels();return o=isFinite(o)&&a[o]===t?o:mb(a,t,Ce(o,t),this._addedLabels),pb(o,a.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:o}=this.getUserBounds();let{min:a,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(a=0),o||(r=this.getLabels().length-1)),this.min=a,this.max=r}buildTicks(){const t=this.min,o=this.max,a=this.options.offset,r=[];let s=this.getLabels();s=t===0&&o===s.length-1?s:s.slice(t,o+1),this._valueRange=Math.max(s.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let i=t;i<=o;i++)r.push({value:i});return r}getLabelForValue(t){return jc.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const o=this.ticks;return t<0||t>o.length-1?null:this.getPixelForValue(o[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}me(is,"id","category"),me(is,"defaults",{ticks:{callback:jc}});function gb(e,t){const o=[],{bounds:r,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=e,m=s||1,g=u-1,{min:y,max:k}=t,p=!ve(i),B=!ve(l),C=!ve(d),w=(k-y)/(f+1);let E=tl((k-y)/g/m)*m,_,x,b,A;if(E<1e-14&&!p&&!B)return[{value:y},{value:k}];A=Math.ceil(k/E)-Math.floor(y/E),A>g&&(E=tl(A*E/g/m)*m),ve(c)||(_=Math.pow(10,c),E=Math.ceil(E*_)/_),r==="ticks"?(x=Math.floor(y/E)*E,b=Math.ceil(k/E)*E):(x=y,b=k),p&&B&&s&&xm((l-i)/s,E/1e3)?(A=Math.round(Math.min((l-i)/E,u)),E=(l-i)/A,x=i,b=l):C?(x=p?i:x,b=B?l:b,A=d-1,E=(b-x)/A):(A=(b-x)/E,co(A,Math.round(A),E/1e3)?A=Math.round(A):A=Math.ceil(A));const D=Math.max(nl(E),nl(x));_=Math.pow(10,ve(c)?D:c),x=Math.round(x*_)/_,b=Math.round(b*_)/_;let M=0;for(p&&(h&&x!==i?(o.push({value:i}),x<i&&M++,co(Math.round((x+M*E)*_)/_,i,Uc(i,w,e))&&M++):x<i&&M++);M<A;++M){const V=Math.round((x+M*E)*_)/_;if(B&&V>l)break;o.push({value:V})}return B&&h&&b!==l?o.length&&co(o[o.length-1].value,l,Uc(l,w,e))?o[o.length-1].value=l:o.push({value:l}):(!B||b===l)&&o.push({value:b}),o}function Uc(e,t,{horizontal:o,minRotation:a}){const r=$t(a),s=(o?Math.sin(r):Math.cos(r))||.001,i=.75*t*(""+e).length;return Math.min(t/s,i)}class bb extends $n{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,o){return ve(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:o,maxDefined:a}=this.getUserBounds();let{min:r,max:s}=this;const i=c=>r=o?r:c,l=c=>s=a?s:c;if(t){const c=Dt(r),d=Dt(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(r===s){let c=s===0?1:Math.abs(s*.05);l(s+c),t||i(r-c)}this.min=r,this.max=s}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:o,stepSize:a}=t,r;return a?(r=Math.ceil(this.max/a)-Math.floor(this.min/a)+1,r>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${a} would result generating up to ${r} ticks. Limiting to 1000.`),r=1e3)):(r=this.computeTickLimit(),o=o||11),o&&(r=Math.min(o,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,o=t.ticks;let a=this.getTickLimit();a=Math.max(2,a);const r={maxTicks:a,bounds:t.bounds,min:t.min,max:t.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=gb(r,s);return t.bounds==="ticks"&&km(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const t=this.ticks;let o=this.min,a=this.max;if(super.configure(),this.options.offset&&t.length){const r=(a-o)/Math.max(t.length-1,1)/2;o-=r,a+=r}this._startValue=o,this._endValue=a,this._valueRange=a-o}getLabelForValue(t){return Pr(t,this.chart.options.locale,this.options.ticks.format)}}class ls extends bb{determineDataLimits(){const{min:t,max:o}=this.getMinMax(!0);this.min=ot(t)?t:0,this.max=ot(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),o=t?this.width:this.height,a=$t(this.options.ticks.minRotation),r=(t?Math.sin(a):Math.cos(a))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/r))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}me(ls,"id","linear"),me(ls,"defaults",{ticks:{callback:hl.formatters.numeric}});const wa={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}},dt=Object.keys(wa);function Hc(e,t){return e-t}function qc(e,t){if(ve(t))return null;const o=e._adapter,{parser:a,round:r,isoWeekday:s}=e._parseOpts;let i=t;return typeof a=="function"&&(i=a(i)),ot(i)||(i=typeof a=="string"?o.parse(i,a):o.parse(i)),i===null?null:(r&&(i=r==="week"&&(uo(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,r)),+i)}function Gc(e,t,o,a){const r=dt.length;for(let s=dt.indexOf(e);s<r-1;++s){const i=wa[dt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-t)/(l*i.size))<=a)return dt[s]}return dt[r-1]}function yb(e,t,o,a,r){for(let s=dt.length-1;s>=dt.indexOf(o);s--){const i=dt[s];if(wa[i].common&&e._adapter.diff(r,a,i)>=t-1)return i}return dt[o?dt.indexOf(o):0]}function xb(e){for(let t=dt.indexOf(e)+1,o=dt.length;t<o;++t)if(wa[dt[t]].common)return dt[t]}function Xc(e,t,o){if(!o)e[t]=!0;else if(o.length){const{lo:a,hi:r}=Dr(o,t),s=o[a]>=t?o[a]:o[r];e[s]=!0}}function kb(e,t,o,a){const r=e._adapter,s=+r.startOf(t[0].value,a),i=t[t.length-1].value;let l,c;for(l=s;l<=i;l=+r.add(l,1,a))c=o[l],c>=0&&(t[c].major=!0);return t}function Yc(e,t,o){const a=[],r={},s=t.length;let i,l;for(i=0;i<s;++i)l=t[i],r[l]=i,a.push({value:l,major:!1});return s===0||!o?a:kb(e,a,r,o)}class Ca extends $n{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,o={}){const a=t.time||(t.time={}),r=this._adapter=new ng._date(t.adapters.date);r.init(o),io(a.displayFormats,r.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(t),this._normalized=o.normalized}parse(t,o){return t===void 0?null:qc(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,o=this._adapter,a=t.time.unit||"day";let{min:r,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(r=Math.min(r,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=ot(r)&&!isNaN(r)?r:+o.startOf(Date.now(),a),s=ot(s)&&!isNaN(s)?s:+o.endOf(Date.now(),a)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const t=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return t.length&&(o=t[0],a=t[t.length-1]),{min:o,max:a}}buildTicks(){const t=this.options,o=t.time,a=t.ticks,r=a.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&r.length&&(this.min=this._userMin||r[0],this.max=this._userMax||r[r.length-1]);const s=this.min,i=this.max,l=_m(r,s,i);return this._unit=o.unit||(a.autoSkip?Gc(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):yb(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:xb(this._unit),this.initOffsets(r),t.reverse&&l.reverse(),Yc(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let o=0,a=0,r,s;this.options.offset&&t.length&&(r=this.getDecimalForValue(t[0]),t.length===1?o=1-r:o=(this.getDecimalForValue(t[1])-r)/2,s=this.getDecimalForValue(t[t.length-1]),t.length===1?a=s:a=(s-this.getDecimalForValue(t[t.length-2]))/2);const i=t.length<3?.5:.25;o=at(o,0,i),a=at(a,0,i),this._offsets={start:o,end:a,factor:1/(o+1+a)}}_generate(){const t=this._adapter,o=this.min,a=this.max,r=this.options,s=r.time,i=s.unit||Gc(s.minUnit,o,a,this._getLabelCapacity(o)),l=Ce(r.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=uo(c)||c===!0,u={};let f=o,h,m;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":i),t.diff(a,o,i)>1e5*l)throw new Error(o+" and "+a+" are too far apart with stepSize of "+l+" "+i);const g=r.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<a;h=+t.add(h,l,i),m++)Xc(u,h,g);return(h===a||r.bounds==="ticks"||m===1)&&Xc(u,h,g),Object.keys(u).sort(Hc).map(y=>+y)}getLabelForValue(t){const o=this._adapter,a=this.options.time;return a.tooltipFormat?o.format(t,a.tooltipFormat):o.format(t,a.displayFormats.datetime)}format(t,o){const r=this.options.time.displayFormats,s=this._unit,i=o||r[s];return this._adapter.format(t,i)}_tickFormatFunction(t,o,a,r){const s=this.options,i=s.ticks.callback;if(i)return Re(i,[t,o,a],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=a[o],m=d&&f&&h&&h.major;return this._adapter.format(t,r||(m?f:u))}generateTickLabels(t){let o,a,r;for(o=0,a=t.length;o<a;++o)r=t[o],r.label=this._tickFormatFunction(r.value,o,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const o=this._offsets,a=this.getDecimalForValue(t);return this.getPixelForDecimal((o.start+a)*o.factor)}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return this.min+a*(this.max-this.min)}_getLabelSize(t){const o=this.options.ticks,a=this.ctx.measureText(t).width,r=$t(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(r),i=Math.sin(r),l=this._resolveTickFontOptions(0).size;return{w:a*s+l*i,h:a*i+l*s}}_getLabelCapacity(t){const o=this.options.time,a=o.displayFormats,r=a[o.unit]||a.millisecond,s=this._tickFormatFunction(t,0,Yc(this,[t],this._majorUnit),r),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 t=this._cache.data||[],o,a;if(t.length)return t;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(o=0,a=r.length;o<a;++o)t=t.concat(r[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let o,a;if(t.length)return t;const r=this.getLabels();for(o=0,a=r.length;o<a;++o)t.push(qc(this,r[o]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return sl(t.sort(Hc))}}me(Ca,"id","time"),me(Ca,"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 Ba(e,t,o){let a=0,r=e.length-1,s,i,l,c;o?(t>=e[a].pos&&t<=e[r].pos&&({lo:a,hi:r}=xn(e,"pos",t)),{pos:s,time:l}=e[a],{pos:i,time:c}=e[r]):(t>=e[a].time&&t<=e[r].time&&({lo:a,hi:r}=xn(e,"time",t)),{time:s,pos:l}=e[a],{time:i,pos:c}=e[r]);const d=i-s;return d?l+(c-l)*(t-s)/d:l}class Kc extends Ca{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(t);this._minPos=Ba(o,this.min),this._tableRange=Ba(o,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:o,max:a}=this,r=[],s=[];let i,l,c,d,u;for(i=0,l=t.length;i<l;++i)d=t[i],d>=o&&d<=a&&r.push(d);if(r.length<2)return[{time:o,pos:0},{time:a,pos:1}];for(i=0,l=r.length;i<l;++i)u=r[i+1],c=r[i-1],d=r[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const t=this.min,o=this.max;let a=super.getDataTimestamps();return(!a.includes(t)||!a.length)&&a.splice(0,0,t),(!a.includes(o)||a.length===1)&&a.push(o),a.sort((r,s)=>r-s)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const o=this.getDataTimestamps(),a=this.getLabelTimestamps();return o.length&&a.length?t=this.normalize(o.concat(a)):t=o.length?o:a,t=this._cache.all=t,t}getDecimalForValue(t){return(Ba(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const o=this._offsets,a=this.getDecimalForPixel(t)/o.factor-o.end;return Ba(this._table,a*this._tableRange+this._minPos,!0)}}me(Kc,"id","timeseries"),me(Kc,"defaults",Ca.defaults);const wb={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Cb={key:0,class:"text-red-500 ml-1"},Bb={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Eb={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},_b={class:"text-red-600 text-sm"},Sb={key:1,class:"mt-2 text-xs text-gray-500"},Ab={key:0},Jc=ht(n.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(e,{expose:t,emit:o}){Ht.register(is,ls,ba,rn,ya,Eo,ab,fb,nb,K0,ia,sa,Gr,Ln);const a=e,r=o,s=n.ref(null),i=n.shallowRef(null),l=n.ref(null),c=n.computed(()=>({"opacity-50 pointer-events-none":a.loading||a.error})),d=()=>{const h=a.theme==="dark";return{responsive:a.responsive,maintainAspectRatio:a.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let g=0;return m.type==="data"&&m.mode==="default"&&(g=m.dataIndex*100+m.datasetIndex*50),g},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:a.type!=="pie"&&a.type!=="doughnut"&&a.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,g)=>{const y=g%a.colors.length,k=a.colors[y];let p=m.backgroundColor,B=m.borderColor;return["pie","doughnut","polarArea"].includes(a.type)&&(!p||p.length===0)?m.data&&(p=m.data.map((C,w)=>a.colors[w%a.colors.length]+"80"),B=m.data.map((C,w)=>a.colors[w%a.colors.length])):(p=p||k+"40",B=B||k),{...m,borderColor:B,backgroundColor:p,pointBackgroundColor:m.pointBackgroundColor||k,pointBorderColor:m.pointBorderColor||k,hoverBackgroundColor:m.hoverBackgroundColor||k+"60",hoverBorderColor:m.hoverBorderColor||k}})},f=async()=>{if(!s.value)return;await n.nextTick(),i.value&&i.value.destroy();const h=a.data||a.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const y=Object.keys(h[0]),k=y.find(B=>["label","name","x","category","title"].includes(B.toLowerCase()))||y[0],p=y.find(B=>B!==k&&["value","y","count","amount","total","data"].includes(B.toLowerCase()))||y.find(B=>B!==k&&typeof h[0][B]=="number")||(y.length>1?y.find(B=>B!==k):y[0]);m={labels:h.map(B=>B[k||""]),datasets:[{label:a.label||"Data",data:h.map(B=>B[p||""])}]}}else h.length>0?m={labels:h.map((y,k)=>`Data ${k+1}`),datasets:[{label:a.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const g={...d(),...a.options,onClick:(y,k)=>{r("click",y,k),a.onClick&&a.onClick(y,k)},onHover:(y,k)=>{r("hover",y,k),a.onHover&&a.onHover(y,k)}};i.value=new Ht(s.value,{type:a.type,data:l.value,options:g}),r("ready",i.value)};return n.watch(()=>[a.data,a.modelValue,a.type,a.options,a.theme],()=>{f()},{deep:!0}),n.watch(()=>[a.width,a.height],()=>{i.value&&i.value.resize()}),n.onMounted(()=>{f()}),n.onUnmounted(()=>{i.value&&i.value.destroy()}),t({chart:i,updateChart:f}),(h,m)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["d-code-chart",c.value])},[e.label?(n.openBlock(),n.createElementBlock("div",wb,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Cb,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"relative",style:n.normalizeStyle({height:e.height+"px"})},[n.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),e.loading?(n.openBlock(),n.createElementBlock("div",Bb,[...m[0]||(m[0]=[n.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):n.createCommentVNode("",!0),e.error?(n.openBlock(),n.createElementBlock("div",Eb,[n.createElementVNode("div",_b,n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0)],4),e.showInfo&&l.value?(n.openBlock(),n.createElementBlock("div",Sb,[l.value.datasets?(n.openBlock(),n.createElementBlock("div",Ab,n.toDisplayString(l.value.datasets.length)+" dataset(s) • "+n.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),So=n.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(pe.Label),n.mergeProps(n.unref(o),{class:n.unref(Se)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Vb={class:"grid gap-1.5"},Db={key:0,class:"ml-1 text-destructive"},Mb=["aria-busy"],Nb={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},vb={key:1,class:"flex items-center"},Pb=["id","checked","indeterminate","disabled","required"],Gt=ht(n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>r.visible??!0),i=n.computed(()=>r.required),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`dcode-checkbox-${r.id||r.label||"checkbox"}-${l}`),d=n.ref(!!r.modelValue);n.watch(()=>r.modelValue,h=>{d.value=!!h},{immediate:!0});const u=()=>{if(r.disabled)return;const h=!d.value;d.value=h,a("update:modelValue",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(n.openBlock(),n.createElementBlock("div",Vb,[e.label?(n.openBlock(),n.createBlock(So,{key:0,class:"text-sm font-medium mb-1"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Db,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass([n.unref(o).class,{"opacity-60 cursor-not-allowed":e.disabled}]),"aria-busy":e.skeleton},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",Nb)):n.createCommentVNode("",!0),m[0]||(m[0]=n.createElementVNode("div",{class:"flex items-center gap-2.5"},[n.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),n.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(n.openBlock(),n.createElementBlock("div",vb,[n.createElementVNode("label",{class:n.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!e.disabled,"opacity-50 cursor-not-allowed":e.disabled}])},[n.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:e.indeterminate,disabled:e.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Pb),n.createElementVNode("div",{class:n.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||e.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",e.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!e.indeterminate?(n.openBlock(),n.createBlock(n.unref(ae.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):e.indeterminate?(n.openBlock(),n.createBlock(n.unref(ae.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):n.createCommentVNode("",!0)],2),e.title?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[e.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"]])},n.toDisplayString(e.title),3)):n.createCommentVNode("",!0)],2)]))],10,Mb),[[n.vShow,s.value]])]))}}),[["__scopeId","data-v-f9cef4a6"]]),Tb={class:"w-full"},Ob={key:0,class:"mb-4"},zb={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Fb={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Rb={key:0,class:"ml-1 text-destructive"},Ib={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Lb={key:1,class:"flex flex-wrap gap-4"},$b={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Wb={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},jb={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},cs=ht(n.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(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Xe(),a=t,r=e,s=n.ref(new Set);n.watch(()=>r.modelValue,E=>{if(!E){s.value=new Set;return}const _=E.map(x=>typeof x=="object"&&x!==null?x.id!==void 0?x.id:x.value:x);s.value=new Set(_)},{immediate:!0,deep:!0});const i=n.ref([]),l=n.ref(!1),c=n.ref(null),d=async()=>{var _,x;const E=((_=r.endpoint)==null?void 0:_.apiUrl)||r.apiUrl;if(!(!E&&!r.apiModule&&!r.apiAction)){l.value=!0,c.value=null;try{let b;const A=((x=r.endpoint)==null?void 0:x.apiMethod)||r.apiMethod||"GET",D={page:1,perPage:100,...r.apiParams};if(E)b=await o(E,A,D);else if(r.apiModule&&r.apiAction){const{DCodeApi:V}=Xe();b=await V(r.apiModule,r.apiAction,D)}let M=b;r.dataPath?M=r.dataPath.split(".").reduce((N,T)=>N&&N[T]!==void 0?N[T]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(M=b.data),Array.isArray(M)?i.value=M:(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=n.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.onMounted(()=>{var E;((E=r.endpoint)!=null&&E.apiUrl||r.apiUrl||r.apiModule&&r.apiAction)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),n.onBeforeUnmount(()=>{f&&f.disconnect()});const m=n.computed(()=>r.options&&r.options.length>0?r.options:r.items&&r.items.length>0?r.items:i.value),g=E=>{if(typeof E!="object"||E===null)return E;const _=r.itemValue||r.model||"id";return E[_]},y=E=>{if(typeof E!="object"||E===null)return String(E);const _=r.itemTitle||"name";return E[_]},k=E=>s.value.has(E),p=(E,_)=>{if(r.disabled)return;const x=new Set(s.value);_?x.add(E):x.delete(E),s.value=x;const b=Array.from(s.value);a("update:modelValue",b),a("change",b)},B=n.computed(()=>r.skeleton||l.value),C=n.computed(()=>!!r.error||!!c.value),w=n.computed(()=>r.error||c.value);return(E,_)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",Tb,[e.label||B.value?(n.openBlock(),n.createElementBlock("div",Ob,[B.value?(n.openBlock(),n.createElementBlock("div",zb)):(n.openBlock(),n.createElementBlock("h3",Fb,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",Rb,"*")):n.createCommentVNode("",!0)]))])):n.createCommentVNode("",!0),n.createElementVNode("div",null,[l.value?(n.openBlock(),n.createElementBlock("div",Ib,[n.createVNode(n.unref(ae.Loader2),{class:"w-4 h-4 animate-spin"}),_[0]||(_[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),B.value?(n.openBlock(),n.createElementBlock("div",Lb,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(6,x=>n.createElementVNode("div",{key:`skeleton-${x}`,class:"flex items-center gap-2.5 min-w-[120px]"},[..._[1]||(_[1]=[n.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),n.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[m.value.length===0?(n.openBlock(),n.createElementBlock("div",$b," Tidak ada data ")):(n.openBlock(),n.createElementBlock("div",Wb,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(x,b)=>(n.openBlock(),n.createElementBlock("div",{key:b,class:"flex items-start"},[n.createVNode(Gt,{"model-value":k(g(x)),title:y(x),disabled:e.disabled,"onUpdate:modelValue":A=>p(g(x),A)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),C.value&&w.value?(n.openBlock(),n.createElementBlock("div",jb,[n.createVNode(n.unref(ae.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(w.value),1)])):n.createCommentVNode("",!0)])],512)),[[n.vShow,e.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Ub=["aria-busy"],Hb={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},qb={key:1,class:"flex justify-end"},Gb=["for"],Xb={key:0,class:"ml-1 text-destructive"},Yb={class:"relative w-full group"},Kb={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Jb={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},Qb=["id","disabled","readonly","placeholder","maxlength"],Zb={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"},ey={key:1,class:"flex items-center gap-1 text-xs text-destructive"},ds=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`app-currency-field-${o.id||r.label||"currency-field"}-${s}`),l=n.computed(()=>{const M=o.required,V=o["aria-required"];return M===""||M===!0||M==="true"||(V==="true"||V===!0)}),c=n.computed(()=>{const M=o.maxlength??o.maxLength;let V=Number.NaN;return typeof M=="number"?V=M:typeof M=="string"&&(V=Number.parseInt(M,10)),Number.isFinite(V)&&V>0?V:void 0}),d=n.computed(()=>r.locale?r.locale:"en-US"),u=n.computed(()=>r.prependInner?r.prependInner:r.currency==="USD"?"$":r.currency==="IDR"?"Rp":r.currency),f=n.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=M=>{const V=M.replaceAll(/\D/g,"");return V?Number(V):null},m=M=>f.value.format(M),g=n.ref(""),y=n.ref(null);n.watch(()=>r.modelValue,M=>{M==null?g.value="":h(g.value)!==M&&(g.value=m(M))},{immediate:!0});const k=(M,V)=>{let N=0;for(let T=0;T<V;T++)/\d/.test(M[T])&&N++;return N},p=(M,V)=>{let N=0;for(let T=0;T<M.length;T++)if(/\d/.test(M[T])&&(N++,N===V))return T+1;return M.length},B=M=>{const V=M.target,N=V.value,T=V.selectionStart??N.length,Y=h(N);if(Y===null){g.value="",a("update:modelValue",null);return}const R=m(Y);if(N!==R){const X=k(N,T);g.value=R,n.nextTick(()=>{if(y.value){const $=p(R,X);y.value.setSelectionRange($,$)}})}a("update:modelValue",Y)},C=()=>{g.value="",a("update:modelValue",null),a("clear")},w=n.computed(()=>!r.clearable||r.disabled||r.readonly?!1:r.hideClearWhenEmpty?g.value.length>0:!0),E=n.computed(()=>!!r.error),_=n.computed(()=>{const{class:M,maxlength:V,maxLength:N,...T}=o;return T}),x=n.computed(()=>g.value.length),b=n.computed(()=>r.showCharCount?(c.value??0)>0:!1),A=n.computed(()=>b.value&&x.value>0),D=n.computed(()=>`${x.value} / ${c.value}`);return(M,V)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1.5 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",Hb)):n.createCommentVNode("",!0),V[2]||(V[2]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(n.openBlock(),n.createElementBlock("div",qb,[...V[1]||(V[1]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",Xb,"*")):n.createCommentVNode("",!0)],8,Gb)):n.createCommentVNode("",!0),n.createElementVNode("div",Yb,[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-900",E.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",r.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[n.createElementVNode("div",Kb,[n.createElementVNode("span",Jb,n.toDisplayString(u.value),1)]),n.withDirectives(n.createElementVNode("input",n.mergeProps({id:i.value,ref_key:"inputRef",ref:y,"onUpdate:modelValue":V[0]||(V[0]=N=>g.value=N),onInput:B,type:"text",inputmode:"numeric"},_.value,{disabled:r.disabled,readonly:r.readonly,placeholder:r.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",w.value?"pr-8":""]}),null,16,Qb),[[n.vModelText,g.value]]),w.value?(n.openBlock(),n.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:C},[n.createVNode(n.unref(ae.X),{class:"w-3.5 h-3.5"})])):n.createCommentVNode("",!0)],2),A.value&&!E.value?(n.openBlock(),n.createElementBlock("p",Zb,n.toDisplayString(D.value),1)):n.createCommentVNode("",!0)]),E.value?(n.openBlock(),n.createElementBlock("p",ey,[n.createVNode(n.unref(ae.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(r.error),1)])):n.createCommentVNode("",!0)],64))],10,Ub))}}),Qc=6048e5,ty=864e5,Zc=Symbol.for("constructDateFrom");function ln(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Zc in e?e[Zc](t):e instanceof Date?new e.constructor(t):new Date(t)}function _t(e,t){return ln(t||e,e)}let ny={};function Ea(){return ny}function Ao(e,t){var l,c,d,u;const o=Ea(),a=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,r=_t(e,t==null?void 0:t.in),s=r.getDay(),i=(s<a?7:0)+s-a;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function _a(e,t){return Ao(e,{...t,weekStartsOn:1})}function ed(e,t){const o=_t(e,t==null?void 0:t.in),a=o.getFullYear(),r=ln(o,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const s=_a(r),i=ln(o,0);i.setFullYear(a,0,4),i.setHours(0,0,0,0);const l=_a(i);return o.getTime()>=s.getTime()?a+1:o.getTime()>=l.getTime()?a:a-1}function td(e){const t=_t(e),o=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return o.setUTCFullYear(t.getFullYear()),+e-+o}function oy(e,...t){const o=ln.bind(null,t.find(a=>typeof a=="object"));return t.map(o)}function nd(e,t){const o=_t(e,t==null?void 0:t.in);return o.setHours(0,0,0,0),o}function ay(e,t,o){const[a,r]=oy(o==null?void 0:o.in,e,t),s=nd(a),i=nd(r),l=+s-td(s),c=+i-td(i);return Math.round((l-c)/ty)}function ry(e,t){const o=ed(e,t),a=ln(e,0);return a.setFullYear(o,0,4),a.setHours(0,0,0,0),_a(a)}function sy(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function iy(e){return!(!sy(e)&&typeof e!="number"||isNaN(+_t(e)))}function ly(e,t){const o=_t(e,t==null?void 0:t.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const cy={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"}},dy=(e,t,o)=>{let a;const r=cy[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+a:a+" ago":a};function jn(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}const uy={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},fy={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},hy={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},my={date:jn({formats:uy,defaultWidth:"full"}),time:jn({formats:fy,defaultWidth:"full"}),dateTime:jn({formats:hy,defaultWidth:"full"})},py={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},gy=(e,t,o,a)=>py[e];function vt(e){return(t,o)=>{const a=o!=null&&o.context?String(o.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):i;r=e.formattingValues[l]||e.formattingValues[i]}else{const i=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;r=e.values[l]||e.values[i]}const s=e.argumentCallback?e.argumentCallback(t):t;return r[s]}}const by={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},yy={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},xy={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"]},ky={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"]},wy={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"}},Cy={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"}},By={ordinalNumber:(e,t)=>{const o=Number(e),a=o%100;if(a>20||a<10)switch(a%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:vt({values:by,defaultWidth:"wide"}),quarter:vt({values:yy,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vt({values:xy,defaultWidth:"wide"}),day:vt({values:ky,defaultWidth:"wide"}),dayPeriod:vt({values:wy,defaultWidth:"wide",formattingValues:Cy,defaultFormattingWidth:"wide"})};function Pt(e){return(t,o={})=>{const a=o.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=t.match(r);if(!s)return null;const i=s[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?_y(l,f=>f.test(i)):Ey(l,f=>f.test(i));let d;d=e.valueCallback?e.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=t.slice(i.length);return{value:d,rest:u}}}function Ey(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function _y(e,t){for(let o=0;o<e.length;o++)if(t(e[o]))return o}function od(e){return(t,o={})=>{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],s=t.match(e.parsePattern);if(!s)return null;let i=e.valueCallback?e.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=t.slice(r.length);return{value:i,rest:l}}}const Sy=/^(\d+)(th|st|nd|rd)?/i,Ay=/\d+/i,Vy={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},Dy={any:[/^b/i,/^(a|c)/i]},My={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ny={any:[/1/i,/2/i,/3/i,/4/i]},vy={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},Py={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]},Ty={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},Oy={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]},zy={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},Fy={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}},Ry={ordinalNumber:od({matchPattern:Sy,parsePattern:Ay,valueCallback:e=>parseInt(e,10)}),era:Pt({matchPatterns:Vy,defaultMatchWidth:"wide",parsePatterns:Dy,defaultParseWidth:"any"}),quarter:Pt({matchPatterns:My,defaultMatchWidth:"wide",parsePatterns:Ny,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Pt({matchPatterns:vy,defaultMatchWidth:"wide",parsePatterns:Py,defaultParseWidth:"any"}),day:Pt({matchPatterns:Ty,defaultMatchWidth:"wide",parsePatterns:Oy,defaultParseWidth:"any"}),dayPeriod:Pt({matchPatterns:zy,defaultMatchWidth:"any",parsePatterns:Fy,defaultParseWidth:"any"})},ad={code:"en-US",formatDistance:dy,formatLong:my,formatRelative:gy,localize:By,match:Ry,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Iy(e,t){const o=_t(e,t==null?void 0:t.in);return ay(o,ly(o))+1}function Ly(e,t){const o=_t(e,t==null?void 0:t.in),a=+_a(o)-+ry(o);return Math.round(a/Qc)+1}function rd(e,t){var u,f,h,m;const o=_t(e,t==null?void 0:t.in),a=o.getFullYear(),r=Ea(),s=(t==null?void 0:t.firstWeekContainsDate)??((f=(u=t==null?void 0:t.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=ln((t==null?void 0:t.in)||e,0);i.setFullYear(a+1,0,s),i.setHours(0,0,0,0);const l=Ao(i,t),c=ln((t==null?void 0:t.in)||e,0);c.setFullYear(a,0,s),c.setHours(0,0,0,0);const d=Ao(c,t);return+o>=+l?a+1:+o>=+d?a:a-1}function $y(e,t){var l,c,d,u;const o=Ea(),a=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,r=rd(e,t),s=ln((t==null?void 0:t.in)||e,0);return s.setFullYear(r,0,a),s.setHours(0,0,0,0),Ao(s,t)}function Wy(e,t){const o=_t(e,t==null?void 0:t.in),a=+Ao(o,t)-+$y(o,t);return Math.round(a/Qc)+1}function Oe(e,t){const o=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return o+a}const cn={y(e,t){const o=e.getFullYear(),a=o>0?o:1-o;return Oe(t==="yy"?a%100:a,t.length)},M(e,t){const o=e.getMonth();return t==="M"?String(o+1):Oe(o+1,2)},d(e,t){return Oe(e.getDate(),t.length)},a(e,t){const o=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(e,t){return Oe(e.getHours()%12||12,t.length)},H(e,t){return Oe(e.getHours(),t.length)},m(e,t){return Oe(e.getMinutes(),t.length)},s(e,t){return Oe(e.getSeconds(),t.length)},S(e,t){const o=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,o-3));return Oe(r,t.length)}},Un={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},sd={G:function(e,t,o){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return o.era(a,{width:"abbreviated"});case"GGGGG":return o.era(a,{width:"narrow"});case"GGGG":default:return o.era(a,{width:"wide"})}},y:function(e,t,o){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return o.ordinalNumber(r,{unit:"year"})}return cn.y(e,t)},Y:function(e,t,o,a){const r=rd(e,a),s=r>0?r:1-r;if(t==="YY"){const i=s%100;return Oe(i,2)}return t==="Yo"?o.ordinalNumber(s,{unit:"year"}):Oe(s,t.length)},R:function(e,t){const o=ed(e);return Oe(o,t.length)},u:function(e,t){const o=e.getFullYear();return Oe(o,t.length)},Q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Oe(a,2);case"Qo":return o.ordinalNumber(a,{unit:"quarter"});case"QQQ":return o.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,o){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Oe(a,2);case"qo":return o.ordinalNumber(a,{unit:"quarter"});case"qqq":return o.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,o){const a=e.getMonth();switch(t){case"M":case"MM":return cn.M(e,t);case"Mo":return o.ordinalNumber(a+1,{unit:"month"});case"MMM":return o.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,o){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Oe(a+1,2);case"Lo":return o.ordinalNumber(a+1,{unit:"month"});case"LLL":return o.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,o,a){const r=Wy(e,a);return t==="wo"?o.ordinalNumber(r,{unit:"week"}):Oe(r,t.length)},I:function(e,t,o){const a=Ly(e);return t==="Io"?o.ordinalNumber(a,{unit:"week"}):Oe(a,t.length)},d:function(e,t,o){return t==="do"?o.ordinalNumber(e.getDate(),{unit:"date"}):cn.d(e,t)},D:function(e,t,o){const a=Iy(e);return t==="Do"?o.ordinalNumber(a,{unit:"dayOfYear"}):Oe(a,t.length)},E:function(e,t,o){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return o.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(a,{width:"short",context:"formatting"});case"EEEE":default:return o.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(s);case"ee":return Oe(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,o,a){const r=e.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(s);case"cc":return Oe(s,t.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,o){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return Oe(r,t.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(a,{width:"short",context:"formatting"});case"iiii":default:return o.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,o){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,o){const a=e.getHours();let r;switch(a===12?r=Un.noon:a===0?r=Un.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,o){const a=e.getHours();let r;switch(a>=17?r=Un.evening:a>=12?r=Un.afternoon:a>=4?r=Un.morning:r=Un.night,t){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,o){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),o.ordinalNumber(a,{unit:"hour"})}return cn.h(e,t)},H:function(e,t,o){return t==="Ho"?o.ordinalNumber(e.getHours(),{unit:"hour"}):cn.H(e,t)},K:function(e,t,o){const a=e.getHours()%12;return t==="Ko"?o.ordinalNumber(a,{unit:"hour"}):Oe(a,t.length)},k:function(e,t,o){let a=e.getHours();return a===0&&(a=24),t==="ko"?o.ordinalNumber(a,{unit:"hour"}):Oe(a,t.length)},m:function(e,t,o){return t==="mo"?o.ordinalNumber(e.getMinutes(),{unit:"minute"}):cn.m(e,t)},s:function(e,t,o){return t==="so"?o.ordinalNumber(e.getSeconds(),{unit:"second"}):cn.s(e,t)},S:function(e,t){return cn.S(e,t)},X:function(e,t,o){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return ld(a);case"XXXX":case"XX":return Vn(a);case"XXXXX":case"XXX":default:return Vn(a,":")}},x:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"x":return ld(a);case"xxxx":case"xx":return Vn(a);case"xxxxx":case"xxx":default:return Vn(a,":")}},O:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+id(a,":");case"OOOO":default:return"GMT"+Vn(a,":")}},z:function(e,t,o){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+id(a,":");case"zzzz":default:return"GMT"+Vn(a,":")}},t:function(e,t,o){const a=Math.trunc(+e/1e3);return Oe(a,t.length)},T:function(e,t,o){return Oe(+e,t.length)}};function id(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),s=a%60;return s===0?o+String(r):o+String(r)+t+Oe(s,2)}function ld(e,t){return e%60===0?(e>0?"-":"+")+Oe(Math.abs(e)/60,2):Vn(e,t)}function Vn(e,t=""){const o=e>0?"-":"+",a=Math.abs(e),r=Oe(Math.trunc(a/60),2),s=Oe(a%60,2);return o+r+t+s}const cd=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},dd=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},jy={p:dd,P:(e,t)=>{const o=e.match(/(P+)(p+)?/)||[],a=o[1],r=o[2];if(!r)return cd(e,t);let s;switch(a){case"P":s=t.dateTime({width:"short"});break;case"PP":s=t.dateTime({width:"medium"});break;case"PPP":s=t.dateTime({width:"long"});break;case"PPPP":default:s=t.dateTime({width:"full"});break}return s.replace("{{date}}",cd(a,t)).replace("{{time}}",dd(r,t))}},Uy=/^D+$/,Hy=/^Y+$/,qy=["D","DD","YY","YYYY"];function Gy(e){return Uy.test(e)}function Xy(e){return Hy.test(e)}function Yy(e,t,o){const a=Ky(e,t,o);if(console.warn(a),qy.includes(e))throw new RangeError(a)}function Ky(e,t,o){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Jy=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Qy=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Zy=/^'([^]*?)'?$/,ex=/''/g,tx=/[a-zA-Z]/;function ud(e,t,o){var u,f,h,m;const a=Ea(),r=a.locale??ad,s=a.firstWeekContainsDate??((f=(u=a.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=a.weekStartsOn??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=_t(e,o==null?void 0:o.in);if(!iy(l))throw new RangeError("Invalid time value");let c=t.match(Qy).map(g=>{const y=g[0];if(y==="p"||y==="P"){const k=jy[y];return k(g,r.formatLong)}return g}).join("").match(Jy).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const y=g[0];if(y==="'")return{isToken:!1,value:nx(g)};if(sd[y])return{isToken:!0,value:g};if(y.match(tx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:g}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return c.map(g=>{if(!g.isToken)return g.value;const y=g.value;(Xy(y)||Gy(y))&&Yy(y,t,String(e));const k=sd[y[0]];return k(l,y,r.localize,d)}).join("")}function nx(e){const t=e.match(Zy);return t?t[1].replace(ex,"'"):e}const ox={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"}},ax=(e,t,o)=>{let a;const r=ox[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+a:a+" yang lalu":a},rx={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},sx={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},ix={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},lx={date:jn({formats:rx,defaultWidth:"full"}),time:jn({formats:sx,defaultWidth:"full"}),dateTime:jn({formats:ix,defaultWidth:"full"})},cx={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},dx=(e,t,o,a)=>cx[e],ux={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},fx={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},hx={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"]},mx={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"]},px={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"}},gx={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"}},bx={ordinalNumber:(e,t)=>"ke-"+Number(e),era:vt({values:ux,defaultWidth:"wide"}),quarter:vt({values:fx,defaultWidth:"wide",argumentCallback:e=>e-1}),month:vt({values:hx,defaultWidth:"wide"}),day:vt({values:mx,defaultWidth:"wide"}),dayPeriod:vt({values:px,defaultWidth:"wide",formattingValues:gx,defaultFormattingWidth:"wide"})},yx=/^ke-(\d+)?/i,xx=/\d+/i,kx={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},wx={any:[/^s/i,/^(m|e)/i]},Cx={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},Bx={any:[/1/i,/2/i,/3/i,/4/i]},Ex={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},_x={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]},Sx={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},Ax={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]},Vx={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},Dx={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}},Mx={ordinalNumber:od({matchPattern:yx,parsePattern:xx,valueCallback:e=>parseInt(e,10)}),era:Pt({matchPatterns:kx,defaultMatchWidth:"wide",parsePatterns:wx,defaultParseWidth:"any"}),quarter:Pt({matchPatterns:Cx,defaultMatchWidth:"wide",parsePatterns:Bx,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Pt({matchPatterns:Ex,defaultMatchWidth:"wide",parsePatterns:_x,defaultParseWidth:"any"}),day:Pt({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any"}),dayPeriod:Pt({matchPatterns:Vx,defaultMatchWidth:"any",parsePatterns:Dx,defaultParseWidth:"any"})},Nx={code:"id",formatDistance:ax,formatLong:lx,formatRelative:dx,localize:bx,match:Mx,options:{weekStartsOn:1,firstWeekContainsDate:1}},fd={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)"}}},hd="dcode-dp-theme-forced";function vx(e,t=hd){const o=fd[e]??fd.primary,a=`
16
+ */class Dg{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=wl.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 rn=new Dg;const Yl="transparent",Ng={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=_l(t||Yl),a=r.valid&&_l(n||Yl);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Mg{constructor(n,o,r,a){const s=o[r];a=br([n.to,a,s,n.from]);const i=br([n.from,s,a]);this._active=!0,this._fn=n.fn||Ng[n.type||typeof i],this._easing=Vo[n.easing]||Vo.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=br([n.to,o,a,n.from]),this._from=br([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(!Te(n))return;const o=Object.keys(tt.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Te(s))return;const i={};for(const l of o)i[l]=s[l];(rt(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=Pg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&vg(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 h=r.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){n[d]=u;continue}s[d]=f=new Mg(h,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 rn.add(this._chart,r),!0}}function vg(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 Pg(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 Ql(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 Tg(t,n,o){if(o===!1)return!1;const r=Ql(t,o),a=Ql(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Og(t){let n,o,r,a;return Te(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 Zl(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 ec(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],ut(d)&&(s||n===0||Ut(n)===Ut(d))&&(n+=d)}return!u&&!r.all?0:n}function Fg(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 ts(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function zg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Ig(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 Rg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function tc(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 nc(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=zg(s,i,r),f=n.length;let h;for(let m=0;m<f;++m){const g=n[m],{[c]:b,[d]:x}=g,p=g._stacks||(g._stacks={});h=p[d]=Rg(a,u,b),h[l]=x,h._top=tc(h,i,!0,r.type),h._bottom=tc(h,i,!1,r.type);const E=h._visualValues||(h._visualValues={});E[l]=x}}function ns(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Lg(t,n){return Fn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function $g(t,n,o){return Fn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function vo(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 os=t=>t==="reset"||t==="none",oc=(t,n)=>n?t:Object.assign({},t),jg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:Zl(o,!0),values:null};class Ln{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=ts(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&&vo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,h,m,g)=>f==="x"?h:f==="r"?g:m,s=o.xAxisID=De(r.xAxisID,ns(n,"x")),i=o.yAxisID=De(r.yAxisID,ns(n,"y")),l=o.rAxisID=De(r.rAxisID,ns(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&&xl(this._data,this),n._stacked&&vo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Te(o)){const a=this._cachedMeta;this._data=Fg(o,a)}else if(r!==o){if(r){xl(r,this);const a=this._cachedMeta;vo(a),a._parsed=[]}o&&Object.isExtensible(o)&&Bp(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=ts(o.vScale,o),o.stack!==r.stack&&(a=!0,vo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(nc(this,o._parsed),o._stacked=ts(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,h;if(this._parsing===!1)r._parsed=a,r._sorted=!0,h=a;else{rt(a[n])?h=this.parseArrayData(r,a,n,o):Te(a[n])?h=this.parseObjectData(r,a,n,o):h=this.parsePrimitiveData(r,a,n,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=h[u],c&&(m()&&(c=!1),d=f);r._sorted=c}i&&nc(this,h)}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 h,m,g;for(h=0,m=a;h<m;++h)g=h+r,f[h]={[l]:u||s.parse(d[g],g),[c]:i.parse(o[g],g)};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,h,m;for(u=0,f=a;u<f;++u)h=u+r,m=o[h],d[u]={x:s.parse(Mn(m,l),h),y:i.parse(Mn(m,c),h)};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:Zl(a,!0),values:o._stacks[n.axis]._visualValues};return ec(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=ec(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=jg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Ig(l);let h,m;function g(){m=a[h];const b=m[l.axis];return!ut(m[n.axis])||u>b||f<b}for(h=0;h<i&&!(!g()&&(this.updateRangeFromParsed(d,n,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(d,n,m,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],ut(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=Og(De(this.options.clip,Tg(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=$g(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=Lg(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&&Bo(r);if(l)return oc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(tt.elements[n]),g=()=>this.getContext(r,a,o),b=d.resolveNamedOptions(h,m,g,f);return b.$shared&&(b.$shared=c,s[i]=Object.freeze(oc(b,c))),b}_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),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,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||os(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){os(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!os(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&&vo(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])}}ye(Ln,"defaults",{}),ye(Ln,"datasetElementType",null),ye(Ln,"dataElementType",null);function Wg(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=kl(r.sort((a,s)=>a-s))}return t._cache.$bar}function Ug(t){const n=t.iScale,o=Wg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Bo(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 Hg(t,n,o,r){const a=o.barThickness;let s,i;return Re(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 qg(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 Gg(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 rc(t,n,o,r){return rt(t)?Gg(t,n,o,r):n[o.axis]=o.parse(t,r),n}function ac(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,h;for(d=o,u=o+r;d<u;++d)h=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(rc(h,f,s,d));return c}function rs(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Xg(t,n,o){return t!==0?Ut(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function Kg(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 Yg(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}=Kg(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[sc(u,i,l,c)]=!0,a=d)),s[sc(a,i,l,c)]=!0,t.borderSkipped=s}function sc(t,n,o,r){return r?(t=Jg(t,n,o),t=ic(t,o,n)):t=ic(t,n,o),t}function Jg(t,n,o){return t===n?o:t===o?n:t}function ic(t,n,o){return t==="start"?n:t==="end"?o:t}function Qg(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class Cr extends Ln{parsePrimitiveData(n,o,r,a){return ac(n,o,r,a)}parseArrayData(n,o,r,a){return ac(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 h,m,g,b;for(h=r,m=r+a;h<m;++h)b=o[h],g={},g[s.axis]=s.parse(Mn(b,d),h),f.push(rc(Mn(b,u),g,i,h));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=rs(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:h}=this._getSharedOptions(o,a);for(let m=o;m<o+r;m++){const g=this.getParsed(m),b=s||Re(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),x=this._calculateBarIndexPixels(m,u),p=(g._stacks||{})[l.axis],E={horizontal:d,base:b.base,enableBorderRadius:!p||rs(g._custom)||i===p._top||i===p._bottom,x:d?b.head:x.center,y:d?x.center:b.head,height:d?x.size:Math.abs(b.size),width:d?Math.abs(b.size):x.size};h&&(E.options=f||this.resolveDataElementOptions(m,n[m].active?"active":a));const C=E.options||n[m].options;Yg(E,C,p,i),Qg(E,C,u.ratio),this.updateElement(n[m],m,E,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(m=>m[r.axis]===c),h=f&&f[u.vScale.axis];if(Re(h)||isNaN(h))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[De(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||Ug(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=rs(d);let f=c[o.axis],h=0,m=r?this.applyStack(o,c,r):f,g,b;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&Ut(f)!==Ut(d.barEnd)&&(h=0),h+=f);const x=!Re(s)&&!u?s:h;let p=o.getPixelForValue(x);if(this.chart.getDataVisibility(n)?g=o.getPixelForValue(h+m):g=p,b=g-p,Math.abs(b)<i){b=Xg(b,o,l)*i,f===l&&(p-=b/2);const E=o.getPixelForDecimal(0),C=o.getPixelForDecimal(1),w=Math.min(E,C),_=Math.max(E,C);p=Math.max(Math.min(p,_),w),g=p+b,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(g)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const E=Ut(b)*o.getLineWidthForValue(l)/2;p+=E,b-=E}return{size:b,base:p,head:g,center:g+b/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=De(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"?qg(n,o,a,u*d):Hg(n,o,a,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(De(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+m;l=f.start+f.chunk*g+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)}}ye(Cr,"id","bar"),ye(Cr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ye(Cr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Zg(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),h=Math.sin(c),m=(C,w,_)=>Ao(C,l,c,!0)?1:Math.max(w,w*o,_,_*o),g=(C,w,_)=>Ao(C,l,c,!0)?-1:Math.min(w,w*o,_,_*o),b=m(0,d,f),x=m(it,u,h),p=g(He,d,f),E=g(He+it,u,h);r=(b-p)/2,a=(x-E)/2,s=-(b+p)/2,i=-(x+E)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class eo extends Ln{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(Te(r[n])){const{key:c="value"}=this._parsing;s=d=>+Mn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return nn(this.options.rotation-90)}_getCircumference(){return nn(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(ip(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:g,offsetY:b}=Zg(f,u,c),x=(r.width-i)/h,p=(r.height-i)/m,E=Math.max(Math.min(x,p)/2,0),C=cl(this.options.radius,E),w=Math.max(C*c,0),_=(C-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*C,this.offsetY=b*C,a.total=this.calculateTotal(),this.outerRadius=C-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*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,h=s&&d.animateScale,m=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:b,includeOptions:x}=this._getSharedOptions(o,a);let p=this._getRotation(),E;for(E=0;E<o;++E)p+=this._circumference(E,s);for(E=o;E<o+r;++E){const C=this._circumference(E,s),w=n[E],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+C,circumference:C,outerRadius:g,innerRadius:m};x&&(_.options=b||this.resolveDataElementOptions(E,w.active?"active":a)),p+=C,this.updateElement(w,E,_,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=Ha(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(De(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ye(eo,"id","doughnut"),ye(eo,"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"}),ye(eo,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),ye(eo,"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 Er extends Ln{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}=Ap(o,a,i);this._drawStart=l,this._drawCount=c,Vp(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),h=i.axis,m=l.axis,{spanGaps:g,segment:b}=this.options,x=So(g)?g:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",E=o+r,C=n.length;let w=o>0&&this.getParsed(o-1);for(let _=0;_<C;++_){const B=n[_],k=p?B:{};if(_<o||_>=E){k.skip=!0;continue}const y=this.getParsed(_),V=Re(y[m]),N=k[h]=i.getPixelForValue(y[h],_),M=k[m]=s||V?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,y,c):y[m],_);k.skip=isNaN(N)||isNaN(M)||V,k.stop=_>0&&Math.abs(y[h]-w[h])>x,b&&(k.parsed=y,k.raw=d.data[_]),f&&(k.options=u||this.resolveDataElementOptions(_,B.active?"active":a)),p||this.updateElement(B,_,k,a),w=y}}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()}}ye(Er,"id","line"),ye(Er,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ye(Er,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class as extends eo{}ye(as,"id","pie"),ye(as,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function $n(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ss{constructor(n){ye(this,"options");this.options=n||{}}static override(n){Object.assign(ss.prototype,n)}init(){}formats(){return $n()}parse(){return $n()}format(){return $n()}add(){return $n()}diff(){return $n()}startOf(){return $n()}endOf(){return $n()}}var e0={_date:ss};function t0(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?Cp:Pn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const h=d(s,n,o-f),m=d(s,n,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(b=>!Re(b[f.axis]));u.lo-=Math.max(0,m);const g=h.slice(u.hi).findIndex(b=>!Re(b[f.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Br(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:h}=t0(s[l],n,i,a);for(let m=f;m<=h;++m){const g=u[m];g.skip||r(g,d,m)}}}function n0(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 is(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||Br(t,o,n,function(l,c,d){!a&&!No(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function o0(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=bl(i,{x:n.x,y:n.y});Ao(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return Br(t,o,n,s),a}function r0(t,n,o,r,a,s){let i=[];const l=n0(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(n.x,n.y,a);if(r&&!m)return;const g=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(g))&&!m)return;const x=l(n,g);x<c?(i=[{element:u,datasetIndex:f,index:h}],c=x):x===c&&i.push({element:u,datasetIndex:f,index:h})}return Br(t,o,n,d),i}function ls(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?o0(t,n,o,a):r0(t,n,o,r,a,s)}function lc(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return Br(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 a0={modes:{index(t,n,o,r){const a=In(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?is(t,a,s,r,i):ls(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=In(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?is(t,a,s,r,i):ls(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=In(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return is(t,a,s,r,i)},nearest(t,n,o,r){const a=In(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return ls(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=In(n,t);return lc(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=In(n,t);return lc(t,a,"y",o.intersect,r)}}};const cc=["left","top","right","bottom"];function Po(t,n){return t.filter(o=>o.pos===n)}function dc(t,n){return t.filter(o=>cc.indexOf(o.pos)===-1&&o.box.axis===n)}function To(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 s0(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 i0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!cc.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 l0(t,n){const o=i0(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 c0(t){const n=s0(t),o=To(n.filter(d=>d.box.fullSize),!0),r=To(Po(n,"left"),!0),a=To(Po(n,"right")),s=To(Po(n,"top"),!0),i=To(Po(n,"bottom")),l=dc(n,"x"),c=dc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:Po(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function uc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function fc(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 d0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Te(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&&fc(i,s.getPadding());const l=Math.max(0,n.outerWidth-uc(i,t,"left","right")),c=Math.max(0,n.outerHeight-uc(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 u0(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 f0(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 Oo(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,f0(l.horizontal,n));const{same:f,other:h}=d0(n,o,l,r);d|=f&&a.length,u=u||h,c.fullSize||a.push(l)}return d&&Oo(a,n,o,r)||u}function _r(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 hc(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,h=d.size||c.height;Bo(d.start)&&(i=d.start),c.fullSize?_r(c,a.left,i,o.outerWidth-a.right-a.left,h):_r(c,n.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,h=d.size||c.width;Bo(d.start)&&(s=d.start),c.fullSize?_r(c,s,a.top,h,o.outerHeight-a.bottom-a.top):_r(c,s,n.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var Mt={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=Nt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=c0(t.boxes),c=l.vertical,d=l.horizontal;Ue(t.boxes,b=>{typeof b.beforeLayout=="function"&&b.beforeLayout()});const u=c.reduce((b,x)=>x.box.options&&x.box.options.display===!1?b:b+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},a);fc(h,Nt(r));const m=Object.assign({maxPadding:h,w:s,h:i,x:a.left,y:a.top},a),g=l0(c.concat(d),f);Oo(l.fullSize,m,f,g),Oo(c,m,f,g),Oo(d,m,f,g)&&Oo(c,m,f,g),u0(m),hc(l.leftAndTop,m,f,g),m.x+=m.w,m.y+=m.h,hc(l.rightAndBottom,m,f,g),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Ue(l.chartArea,b=>{const x=b.box;Object.assign(x,t.chartArea),x.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class mc{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 h0 extends mc{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const Sr="$chartjs",m0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},pc=t=>t===null||t==="";function p0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[Sr]={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",pc(a)){const s=Ll(t,"width");s!==void 0&&(t.width=s)}if(pc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=Ll(t,"height");s!==void 0&&(t.height=s)}return t}const gc=bg?{passive:!0}:!1;function g0(t,n,o){t&&t.addEventListener(n,o,gc)}function b0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,gc)}function y0(t,n){const o=m0[t.type]||t.type,{x:r,y:a}=In(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function Ar(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function x0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||Ar(l.addedNodes,r),i=i&&!Ar(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function k0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||Ar(l.removedNodes,r),i=i&&!Ar(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Fo=new Map;let bc=0;function yc(){const t=window.devicePixelRatio;t!==bc&&(bc=t,Fo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function w0(t,n){Fo.size||window.addEventListener("resize",yc),Fo.set(t,n)}function C0(t){Fo.delete(t),Fo.size||window.removeEventListener("resize",yc)}function E0(t,n,o){const r=t.canvas,a=r&&es(r);if(!a)return;const s=Cl((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),w0(t,s),i}function cs(t,n,o){o&&o.disconnect(),n==="resize"&&C0(t)}function B0(t,n,o){const r=t.canvas,a=Cl(s=>{t.ctx!==null&&o(y0(s,t))},t);return g0(r,n,a),a}class _0 extends mc{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(p0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[Sr])return!1;const r=o[Sr].initial;["height","width"].forEach(s=>{const i=r[s];Re(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[Sr],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:x0,detach:k0,resize:E0}[o]||B0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:cs,detach:cs,resize:cs}[o]||b0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return gg(n,o,r,a)}isAttached(n){const o=n&&es(n);return!!(o&&o.isConnected)}}function S0(t){return!Za()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?h0:_0}let an=(sa=class{constructor(){ye(this,"x");ye(this,"y");ye(this,"active",!1);ye(this,"options");ye(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return So(this.x)&&So(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}},ye(sa,"defaults",{}),ye(sa,"defaultRoutes"),sa);function A0(t,n){const o=t.options.ticks,r=V0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?N0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return M0(n,d,s,i/a),d;const u=D0(s,n,a);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(Vr(n,d,u,Re(m)?0:l-m,l),f=0,h=i-1;f<h;f++)Vr(n,d,u,s[f],s[f+1]);return Vr(n,d,u,c,Re(m)?n.length:c+m),d}return Vr(n,d,u),d}function V0(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 D0(t,n,o){const r=v0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=pp(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 N0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function M0(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 Vr(t,n,o,r,a){const s=De(r,0),i=Math.min(De(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 v0(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 P0=t=>t==="left"?"right":t==="right"?"left":t,xc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,kc=(t,n)=>Math.min(n||t,t);function wc(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 T0(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 O0(t,n){Ue(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 zo(t){return t.drawTicks?t.tickLength:0}function Cc(t,n){if(!t.display)return 0;const o=mt(t.font,n),r=Nt(t.padding);return(rt(t.text)?t.text.length:1)*o.lineHeight+r.height}function F0(t,n){return Fn(t,{scale:n,type:"scale"})}function z0(t,n,o){return Fn(t,{tick:o,index:n,type:"tick"})}function I0(t,n,o){let r=ja(t);return(o&&n!=="right"||!o&&n==="right")&&(r=P0(r)),r}function R0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,g;const b=i-a,x=l-s;if(t.isHorizontal()){if(m=ht(r,s,l),Te(o)){const p=Object.keys(o)[0],E=o[p];g=u[p].getPixelForValue(E)+b-n}else o==="center"?g=(d.bottom+d.top)/2+b-n:g=xc(t,o,n);h=l-s}else{if(Te(o)){const p=Object.keys(o)[0],E=o[p];m=u[p].getPixelForValue(E)-x+n}else o==="center"?m=(d.left+d.right)/2-x+n:m=xc(t,o,n);g=ht(r,i,a),f=o==="left"?-it:it}return{titleX:m,titleY:g,maxWidth:h,rotation:f}}class to extends an{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=Wt(n,Number.POSITIVE_INFINITY),o=Wt(o,Number.NEGATIVE_INFINITY),r=Wt(r,Number.POSITIVE_INFINITY),a=Wt(a,Number.NEGATIVE_INFINITY),{min:Wt(n,r),max:Wt(o,a),minDefined:ut(n),maxDefined:ut(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:Wt(o,Wt(r,o)),max:Wt(r,Wt(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(){Ye(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=Xp(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?wc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=A0(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(){Ye(this.options.afterUpdate,[this])}beforeSetDimensions(){Ye(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(){Ye(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),Ye(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ye(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=Ye(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){Ye(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ye(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=kc(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,h=u.highest.height,m=ft(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:m/(r-1),f+6>l&&(l=m/(r-(n.offset?.5:1)),c=this.maxHeight-zo(n.grid)-o.padding-Cc(n.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=xp(Math.min(Math.asin(ft((u.highest.height+6)/l,-1,1)),Math.asin(ft(c/d,-1,1))-Math.asin(ft(h/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Ye(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ye(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=Cc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=zo(s)+c):(n.height=this.maxHeight,n.width=zo(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=r.padding*2,g=nn(this.labelRotation),b=Math.cos(g),x=Math.sin(g);if(l){const p=r.mirror?0:x*f.width+b*h.height;n.height=Math.min(this.maxHeight,n.height+p+m)}else{const p=r.mirror?0:b*f.width+x*h.height;n.width=Math.min(this.maxWidth,n.width+p+m)}this._calculatePadding(d,u,x,b)}}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 h=0,m=0;c?d?(h=a*n.width,m=r*o.height):(h=r*n.height,m=a*o.width):s==="start"?m=o.width:s==="end"?h=n.width:s!=="inner"&&(h=n.width/2,m=o.width/2),this.paddingLeft=Math.max((h-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-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(){Ye(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++)Re(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=wc(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/kc(o,r));let d=0,u=0,f,h,m,g,b,x,p,E,C,w,_;for(f=0;f<o;f+=c){if(g=n[f].label,b=this._resolveTickFontOptions(f),a.font=x=b.string,p=s[x]=s[x]||{data:{},gc:[]},E=b.lineHeight,C=w=0,!Re(g)&&!rt(g))C=Vl(a,p.data,p.gc,C,g),w=E;else if(rt(g))for(h=0,m=g.length;h<m;++h)_=g[h],!Re(_)&&!rt(_)&&(C=Vl(a,p.data,p.gc,C,_),w+=E);i.push(C),l.push(w),d=Math.max(C,d),u=Math.max(w,u)}O0(s,o);const B=i.indexOf(d),k=l.indexOf(u),y=V=>({width:i[V]||0,height:l[V]||0});return{first:y(0),last:y(o-1),widest:y(B),highest:y(k),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 wp(this._alignToPixels?On(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=z0(this.getContext(),n,r))}return this.$context||(this.$context=F0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=nn(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),h=zo(s),m=[],g=l.setContext(this.getContext()),b=g.display?g.width:0,x=b/2,p=function($){return On(r,$,b)};let E,C,w,_,B,k,y,V,N,M,D,v;if(i==="top")E=p(this.bottom),k=this.bottom-h,V=E-x,M=p(n.top)+x,v=n.bottom;else if(i==="bottom")E=p(this.top),M=n.top,v=p(n.bottom)-x,k=E+x,V=this.top+h;else if(i==="left")E=p(this.right),B=this.right-h,y=E-x,N=p(n.left)+x,D=n.right;else if(i==="right")E=p(this.left),N=n.left,D=p(n.right)-x,B=E+x,y=this.left+h;else if(o==="x"){if(i==="center")E=p((n.top+n.bottom)/2+.5);else if(Te(i)){const $=Object.keys(i)[0],q=i[$];E=p(this.chart.scales[$].getPixelForValue(q))}M=n.top,v=n.bottom,k=E+x,V=k+h}else if(o==="y"){if(i==="center")E=p((n.left+n.right)/2);else if(Te(i)){const $=Object.keys(i)[0],q=i[$];E=p(this.chart.scales[$].getPixelForValue(q))}B=E-x,y=B-h,N=n.left,D=n.right}const P=De(a.ticks.maxTicksLimit,f),H=Math.max(1,Math.ceil(f/P));for(C=0;C<f;C+=H){const $=this.getContext(C),q=s.setContext($),ee=l.setContext($),G=q.lineWidth,L=q.color,W=ee.dash||[],ae=ee.dashOffset,Z=q.tickWidth,J=q.tickColor,le=q.tickBorderDash||[],ue=q.tickBorderDashOffset;w=T0(this,C,c),w!==void 0&&(_=On(r,w,G),d?B=y=N=D=_:k=V=M=v=_,m.push({tx1:B,ty1:k,tx2:y,ty2:V,x1:N,y1:M,x2:D,y2:v,width:G,color:L,borderDash:W,borderDashOffset:ae,tickWidth:Z,tickColor:J,tickBorderDash:le,tickBorderDashOffset:ue}))}return this._ticksLength=f,this._borderValue=E,m}_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,h=zo(r.grid),m=h+u,g=f?-u:m,b=-nn(this.labelRotation),x=[];let p,E,C,w,_,B,k,y,V,N,M,D,v="middle";if(a==="top")B=this.bottom-g,k=this._getXAxisLabelAlignment();else if(a==="bottom")B=this.top+g,k=this._getXAxisLabelAlignment();else if(a==="left"){const H=this._getYAxisLabelAlignment(h);k=H.textAlign,_=H.x}else if(a==="right"){const H=this._getYAxisLabelAlignment(h);k=H.textAlign,_=H.x}else if(o==="x"){if(a==="center")B=(n.top+n.bottom)/2+m;else if(Te(a)){const H=Object.keys(a)[0],$=a[H];B=this.chart.scales[H].getPixelForValue($)+m}k=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")_=(n.left+n.right)/2-m;else if(Te(a)){const H=Object.keys(a)[0],$=a[H];_=this.chart.scales[H].getPixelForValue($)}k=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?v="top":c==="end"&&(v="bottom"));const P=this._getLabelSizes();for(p=0,E=l.length;p<E;++p){C=l[p],w=C.label;const H=s.setContext(this.getContext(p));y=this.getPixelForTick(p)+s.labelOffset,V=this._resolveTickFontOptions(p),N=V.lineHeight,M=rt(w)?w.length:1;const $=M/2,q=H.color,ee=H.textStrokeColor,G=H.textStrokeWidth;let L=k;i?(_=y,k==="inner"&&(p===E-1?L=this.options.reverse?"left":"right":p===0?L=this.options.reverse?"right":"left":L="center"),a==="top"?d==="near"||b!==0?D=-M*N+N/2:d==="center"?D=-P.highest.height/2-$*N+N:D=-P.highest.height+N/2:d==="near"||b!==0?D=N/2:d==="center"?D=P.highest.height/2-$*N:D=P.highest.height-M*N,f&&(D*=-1),b!==0&&!H.showLabelBackdrop&&(_+=N/2*Math.sin(b))):(B=y,D=(1-M)*N/2);let W;if(H.showLabelBackdrop){const ae=Nt(H.backdropPadding),Z=P.heights[p],J=P.widths[p];let le=D-ae.top,ue=0-ae.left;switch(v){case"middle":le-=Z/2;break;case"bottom":le-=Z;break}switch(k){case"center":ue-=J/2;break;case"right":ue-=J;break;case"inner":p===E-1?ue-=J:p>0&&(ue-=J/2);break}W={left:ue,top:le,width:J+ae.width,height:Z+ae.height,color:H.backdropColor}}x.push({label:w,font:V,textOffset:D,options:{rotation:b,color:q,strokeColor:ee,strokeWidth:G,textAlign:L,textBaseline:v,translation:[_,B],backdrop:W}})}return x}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-nn(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,h;this.isHorizontal()?(d=On(n,this.left,i)-i/2,u=On(n,this.right,l)+l/2,f=h=c):(f=On(n,this.top,i)-i/2,h=On(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,h),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&mr(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;Mo(r,d,0,u,c,l)}a&&pr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=mt(r.font),i=Nt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Te(o)?(c+=i.bottom,rt(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=R0(this,c,o,l);Mo(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:I0(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=De(n.grid&&n.grid.z,-1),a=De(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==to.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 mt(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class Dr{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;j0(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,L0(n,i,r),this.override&&tt.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 tt[a]&&(delete tt[a][r],this.override&&delete Tn[r])}}function L0(t,n,o){const r=Co(Object.create(null),[o?tt.get(o):{},tt.get(n),t.defaults]);tt.set(n,r),t.defaultRoutes&&$0(n,t.defaultRoutes),t.descriptors&&tt.describe(n,t.descriptors)}function $0(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(".");tt.route(s,a,c,l)})}function j0(t){return"id"in t&&"defaults"in t}class W0{constructor(){this.controllers=new Dr(Ln,"datasets",!0),this.elements=new Dr(an,"elements"),this.plugins=new Dr(Object,"plugins"),this.scales=new Dr(to,"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):Ue(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=Ra(n);Ye(r["before"+a],[],r),o[n](r),Ye(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 Ht=new W0;class U0{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(Ye(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){Re(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=De(r.options&&r.options.plugins,{}),s=H0(r);return a===!1&&!o?[]:G0(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 H0(t){const n={},o=[],r=Object.keys(Ht.plugins.items);for(let s=0;s<r.length;s++)o.push(Ht.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 q0(t,n){return!n&&t===!1?null:t===!0?{}:t}function G0(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=q0(r[c],a);d!==null&&s.push({plugin:l,options:X0(t.config,{plugin:l,local:o[c]},d,i)})}return s}function X0(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 ds(t,n){const o=tt.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function K0(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function Y0(t,n){return t===n?"_index_":"_value_"}function Ec(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 us(t,...n){if(Ec(t))return t;for(const o of n){const r=o.axis||J0(o.position)||t.length>1&&Ec(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Bc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function Q0(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 Bc(t,"x",o[0])||Bc(t,"y",o[0])}return{}}function Z0(t,n){const o=Tn[t.type]||{scales:{}},r=n.scales||{},a=ds(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Te(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=us(i,l,Q0(i,t),tt.scales[l.type]),d=Y0(c,a),u=o.scales||{};s[i]=Eo(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||ds(l,n),u=(Tn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=K0(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),Eo(s[m],[{axis:h},r[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Eo(l,[tt.scales[l.type],tt.scale])}),s}function _c(t){const n=t.options||(t.options={});n.plugins=De(n.plugins,{}),n.scales=Z0(t,n)}function Sc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function eb(t){return t=t||{},t.data=Sc(t.data),_c(t),t}const Ac=new Map,Vc=new Set;function Nr(t,n){let o=Ac.get(t);return o||(o=n(),Ac.set(t,o),Vc.add(o)),o}const Io=(t,n,o)=>{const r=Mn(n,o);r!==void 0&&t.add(r)};class tb{constructor(n){this._config=eb(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=Sc(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(),_c(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return Nr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Nr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Nr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Nr(`${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=>Io(c,n,f))),u.forEach(f=>Io(c,a,f)),u.forEach(f=>Io(c,Tn[s]||{},f)),u.forEach(f=>Io(c,tt,f)),u.forEach(f=>Io(c,qa,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Vc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,Tn[o]||{},tt.datasets[o]||{},{type:o},tt,qa]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Dc(this._resolverCache,n,a);let c=i;if(ob(i,o)){s.$shared=!1,r=bn(r)?r():r;const d=this.createResolver(n,r,l);c=Jn(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=Dc(this._resolverCache,n,r);return Te(o)?Jn(s,o,void 0,a):s}}function Dc(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:Ya(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const nb=t=>Te(t)&&Object.getOwnPropertyNames(t).some(n=>bn(t[n]));function ob(t,n){const{isScriptable:o,isIndexable:r}=vl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(bn(l)||nb(l))||i&&rt(l))return!0}return!1}var rb="4.5.1";const ab=["top","bottom","left","right","chartArea"];function Nc(t,n){return t==="top"||t==="bottom"||ab.indexOf(t)===-1&&n==="x"}function Mc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function vc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),Ye(o&&o.onComplete,[t],n)}function sb(t){const n=t.chart,o=n.options.animation;Ye(o&&o.onProgress,[t],n)}function Pc(t){return Za()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const Mr={},Tc=t=>{const n=Pc(t);return Object.values(Mr).filter(o=>o.canvas===n).pop()};function ib(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 lb(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class sn{static register(...n){Ht.add(...n),Oc()}static unregister(...n){Ht.remove(...n),Oc()}constructor(n,o){const r=this.config=new tb(o),a=Pc(n),s=Tc(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||S0(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=sp(),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 U0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=_p(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],Mr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}rn.listen(this,"complete",vc),rn.listen(this,"progress",sb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return Re(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 Ht}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Rl(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Dl(this.canvas,this.ctx),this}stop(){return rn.stop(this),this}resize(n,o){rn.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,Rl(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Ye(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Ue(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=us(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Ue(s,i=>{const l=i.options,c=l.id,d=us(c,l),u=De(l.type,i.dtype);(l.position===void 0||Nc(l.position,d)!==Nc(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 h=Ht.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Ue(a,(i,l)=>{i||delete r[l]}),Ue(r,i=>{Mt.configure(this,i,i.options),Mt.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(Mc("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||ds(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=Ht.getController(l),{datasetElementType:d,dataElementType:u}=tt.datasets[l];Object.assign(c,{dataElementType:Ht.getElement(u),datasetElementType:d&&Ht.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Ue(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),h=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Ue(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Mc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Ue(this.scales,n=>{Mt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!fl(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;ib(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(!fl(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;Mt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Ue(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,bn(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&&(rn.has(this)?this.attached&&!rn.running(this)&&rn.start(this):(this.draw(),vc({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=Kl(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&mr(o,a),n.controller.draw(),a&&pr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return No(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=a0.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=Fn(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);Bo(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(),rn.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(),Dl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete Mr[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)};Ue(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(){Ue(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Ue(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}});!dr(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=fp(n),d=lb(n,this._lastEvent,r,c);r&&(this._lastEvent=null,Ye(s.onHover,[n,l,this],this),c&&Ye(s.onClick,[n,l,this],this));const u=!dr(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)}}ye(sn,"defaults",tt),ye(sn,"instances",Mr),ye(sn,"overrides",Tn),ye(sn,"registry",Ht),ye(sn,"version",rb),ye(sn,"getChart",Tc);function Oc(){return Ue(sn.instances,t=>t._plugins.invalidate())}function cb(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,Ct(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const h=Math.min(d/l,Ct(r-o));t.arc(a,s,l+d/2,o-h/2,r+h/2,!0)}else{const h=Math.min(d/2,i*Ct(r-o));if(u==="round")t.arc(a,s,h,o-He/2,r+He/2,!0);else if(u==="bevel"){const m=2*h*h,g=-m*Math.cos(o+He/2)+a,b=-m*Math.sin(o+He/2)+s,x=m*Math.cos(r+He/2)+a,p=m*Math.sin(r+He/2)+s;t.lineTo(g,b),t.lineTo(x,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function db(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+it,r-it),t.closePath(),t.clip()}function ub(t){return Ka(t,["outerStart","outerEnd","innerStart","innerEnd"])}function fb(t,n,o,r){const a=ub(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 ft(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:ft(a.innerStart,0,i),innerEnd:ft(a.innerEnd,0,i)}}function no(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function vr(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),h=u>0?u+r+o+d:0;let m=0;const g=a-c;if(r){const H=u>0?u-r:0,$=f>0?f-r:0,q=(H+$)/2,ee=q!==0?g*q/(q+r):g;m=(g-ee)/2}const b=Math.max(.001,g*f-o/He)/f,x=(g-b)/2,p=c+x+m,E=a-x-m,{outerStart:C,outerEnd:w,innerStart:_,innerEnd:B}=fb(n,h,f,E-p),k=f-C,y=f-w,V=p+C/k,N=E-w/y,M=h+_,D=h+B,v=p+_/M,P=E-B/D;if(t.beginPath(),s){const H=(V+N)/2;if(t.arc(i,l,f,V,H),t.arc(i,l,f,H,N),w>0){const G=no(y,N,i,l);t.arc(G.x,G.y,w,N,E+it)}const $=no(D,E,i,l);if(t.lineTo($.x,$.y),B>0){const G=no(D,P,i,l);t.arc(G.x,G.y,B,E+it,P+Math.PI)}const q=(E-B/h+(p+_/h))/2;if(t.arc(i,l,h,E-B/h,q,!0),t.arc(i,l,h,q,p+_/h,!0),_>0){const G=no(M,v,i,l);t.arc(G.x,G.y,_,v+Math.PI,p-it)}const ee=no(k,p,i,l);if(t.lineTo(ee.x,ee.y),C>0){const G=no(k,V,i,l);t.arc(G.x,G.y,C,p-it,V)}}else{t.moveTo(i,l);const H=Math.cos(V)*f+i,$=Math.sin(V)*f+l;t.lineTo(H,$);const q=Math.cos(N)*f+i,ee=Math.sin(N)*f+l;t.lineTo(q,ee)}t.closePath()}function hb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){vr(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%Je||Je))}return vr(t,n,o,r,c,a),t.fill(),c}function mb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,g=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,g?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let b=n.endAngle;if(s){vr(t,n,o,r,b,a);for(let x=0;x<s;++x)t.stroke();isNaN(l)||(b=i+(l%Je||Je))}g&&db(t,n,b),c.selfJoin&&b-i>=He&&m===0&&u!=="miter"&&cb(t,n,b),s||(vr(t,n,o,r,b,a),t.stroke())}class Ro extends an{constructor(o){super();ye(this,"circumference");ye(this,"endAngle");ye(this,"fullCircles");ye(this,"innerRadius");ye(this,"outerRadius");ye(this,"pixelMargin");ye(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}=bl(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,g=De(h,d-c),b=Ao(i,c,d)&&c!==d,x=g>=Je||b,p=on(l,u+m,f+m);return x&&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,h=(l+c+u+d)/2;return{x:r+Math.cos(f)*h,y:a+Math.sin(f)*h}}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(He,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,hb(o,this,u,i,l),mb(o,this,u,i,l),o.restore()}}ye(Ro,"id","arc"),ye(Ro,"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}),ye(Ro,"defaultRoutes",{backgroundColor:"backgroundColor"}),ye(Ro,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Fc(t,n,o=n){t.lineCap=De(o.borderCapStyle,n.borderCapStyle),t.setLineDash(De(o.borderDash,n.borderDash)),t.lineDashOffset=De(o.borderDashOffset,n.borderDashOffset),t.lineJoin=De(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=De(o.borderWidth,n.borderWidth),t.strokeStyle=De(o.borderColor,n.borderColor)}function pb(t,n,o){t.lineTo(o.x,o.y)}function gb(t){return t.stepped?Rp:t.tension||t.cubicInterpolationMode==="monotone"?Lp:pb}function zc(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 bb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=zc(a,o,r),u=gb(s);let{move:f=!0,reverse:h}=r||{},m,g,b;for(m=0;m<=d;++m)g=a[(l+(h?d-m:m))%i],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,b,g,h,s.stepped),b=g);return c&&(g=a[(l+(h?d:0))%i],u(t,b,g,h,s.stepped)),!!c}function yb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=zc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,h,m,g,b,x,p;const E=w=>(i+(d?l-w:w))%s,C=()=>{b!==x&&(t.lineTo(u,x),t.lineTo(u,b),t.lineTo(u,p))};for(c&&(m=a[E(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=a[E(h)],m.skip)continue;const w=m.x,_=m.y,B=w|0;B===g?(_<b?b=_:_>x&&(x=_),u=(f*u+w)/++f):(C(),t.lineTo(w,_),g=B,f=0,b=x=_),p=_}C()}function fs(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?yb:bb}function xb(t){return t.stepped?yg:t.tension||t.cubicInterpolationMode==="monotone"?xg:Rn}function kb(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Fc(t,n.options),t.stroke(a)}function wb(t,n,o,r){const{segments:a,options:s}=n,i=fs(n);for(const l of a)Fc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const Cb=typeof Path2D=="function";function Eb(t,n,o,r){Cb&&!n.options.segment?kb(t,n,o,r):wb(t,n,o,r)}class xn extends an{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;dg(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=_g(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=ql(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=xb(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],g=s[h];if(m===g){l.push(m);continue}const b=Math.abs((a-m[o])/(g[o]-m[o])),x=c(m,g,b,r.stepped);x[o]=n[o],l.push(x)}return l.length===1?l[0]:l}pathSegment(n,o,r){return fs(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=fs(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(),Eb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ye(xn,"id","line"),ye(xn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ye(xn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ye(xn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function Ic(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class Pr extends an{constructor(o){super();ye(this,"parsed");ye(this,"skip");ye(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 Ic(this,o,"x",r)}inYRange(o,r){return Ic(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||!No(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,Xa(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}ye(Pr,"id","point"),ye(Pr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ye(Pr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Rc(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 kn(t,n,o,r){return t?0:ft(n,o,r)}function Bb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Ml(r);return{t:kn(a.top,s.top,0,o),r:kn(a.right,s.right,0,n),b:kn(a.bottom,s.bottom,0,o),l:kn(a.left,s.left,0,n)}}function _b(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=Yn(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Te(a);return{topLeft:kn(!c||l.top||l.left,s.topLeft,0,i),topRight:kn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:kn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:kn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function Sb(t){const n=Rc(t),o=n.right-n.left,r=n.bottom-n.top,a=Bb(t,o/2,r/2),s=_b(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 hs(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&Rc(t,r);return l&&(a||on(n,l.left,l.right))&&(s||on(o,l.top,l.bottom))}function Ab(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Vb(t,n){t.rect(n.x,n.y,n.w,n.h)}function ms(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 Tr extends an{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}=Sb(this),l=Ab(i.radius)?gr:Vb;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,ms(i,o,s)),n.clip(),l(n,ms(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,ms(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return hs(this,n,o,r)}inXRange(n,o){return hs(this,n,null,o)}inYRange(n,o){return hs(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}}ye(Tr,"id","bar"),ye(Tr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ye(Tr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Db(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=Or(c,d,a);const u=ps(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=ql(n,u);for(const h of f){const m=ps(o,s[h.start],s[h.end],h.loop),g=Hl(l,a,m);for(const b of g)i.push({source:b,target:h,start:{[o]:Lc(u,m,"start",Math.max)},end:{[o]:Lc(u,m,"end",Math.min)}})}}return i}function ps(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Ct(a),s=Ct(s)),{property:t,start:a,end:s}}function Nb(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Or(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 Or(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function Lc(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function $c(t,n){let o=[],r=!1;return rt(t)?(r=!0,o=t):o=Nb(t,n),o.length?new xn({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function jc(t){return t&&t.fill!==!1}function Mb(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(!ut(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function vb(t,n,o){const r=Fb(t);if(Te(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return ut(a)&&Math.floor(a)===a?Pb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function Pb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function Tb(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Te(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Ob(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Te(t)?r=t.value:r=n.getBaseValue(),r}function Fb(t){const n=t.options,o=n.fill;let r=De(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function zb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Ib(n,o);l.push($c({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++)Rb(a,i[u],l)}return new xn({points:a,options:{}})}function Ib(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 Rb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Lb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Lb(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],h=i[u.end][o];if(on(a,f,h)){l=a===f,c=a===h;break}}return{first:l,last:c,point:r}}class Wc{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 $b(t){const{chart:n,fill:o,line:r}=t;if(ut(o))return jb(n,o);if(o==="stack")return zb(t);if(o==="shape")return!0;const a=Wb(t);return a instanceof Wc?a:$c(a,r)}function jb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Wb(t){return(t.scale||{}).getPointPositionForValue?Hb(t):Ub(t)}function Ub(t){const{scale:n={},fill:o}=t,r=Tb(o,n);if(ut(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Hb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Ob(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new Wc({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 gs(t,n,o){const r=$b(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},g=a.getDatasetMeta(s),b=Kl(a,g);r&&i.points.length&&(mr(t,o),qb(t,{line:i,target:r,above:h,below:m,area:o,scale:l,axis:c,clip:b}),pr(t))}function qb(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"?(Uc(t,r,i.top),bs(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),Uc(t,r,i.bottom)):d==="y"&&(Hc(t,r,i.left),bs(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Hc(t,r,i.right),u=a)),bs(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function Uc(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[Or(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 Hc(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[Or(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 bs(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=Db(o,r,a);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,g=r!==!0;t.save(),t.fillStyle=m,Gb(t,i,l,g&&ps(a,f,h)),t.beginPath();const b=!!o.pathSegment(t,d);let x;if(g){b?t.closePath():qc(t,r,h,a);const p=!!r.pathSegment(t,u,{move:b,reverse:!0});x=b&&p,x||qc(t,r,f,a)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}function Gb(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 qc(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var Xb={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 xn&&(c={visible:t.isDatasetVisible(i),index:i,fill:vb(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=Mb(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&&gs(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;jc(s)&&gs(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!jc(r)||o.drawTime!=="beforeDatasetDraw"||gs(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Gc=(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)}},Kb=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class Xc extends an{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=Ye(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=mt(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=Gc(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 h=-1,m=-u;return this.legendItems.forEach((g,b)=>{const x=r+o/2+s.measureText(g.text).width;(b===0||d[d.length-1]+x+2*l>i)&&(f+=u,d[d.length-(b>0?0:1)]=0,m+=u,h++),c[b]={left:0,top:m,row:h,width:x,height:a},d[d.length-1]+=x+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,h=0,m=0,g=0,b=0;return this.legendItems.forEach((x,p)=>{const{itemWidth:E,itemHeight:C}=Yb(r,o,s,x,a);p>0&&m+C+2*l>u&&(f+=h+l,d.push({width:h,height:m}),g+=h+l,b++,h=m=0),c[p]={left:g,top:m,col:b,width:E,height:C},h=Math.max(h,E),m+=C+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=Zn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=ht(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=ht(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=ht(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=ht(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;mr(n,this),this._draw(),pr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=tt.color,c=Zn(n.rtl,this.left,this.width),d=mt(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:g,boxHeight:b,itemHeight:x}=Gc(i,f),p=function(B,k,y){if(isNaN(g)||g<=0||isNaN(b)||b<0)return;a.save();const V=De(y.lineWidth,1);if(a.fillStyle=De(y.fillStyle,l),a.lineCap=De(y.lineCap,"butt"),a.lineDashOffset=De(y.lineDashOffset,0),a.lineJoin=De(y.lineJoin,"miter"),a.lineWidth=V,a.strokeStyle=De(y.strokeStyle,l),a.setLineDash(De(y.lineDash,[])),i.usePointStyle){const N={radius:b*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:V},M=c.xPlus(B,g/2),D=k+h;Nl(a,N,M,D,i.pointStyleWidth&&g)}else{const N=k+Math.max((f-b)/2,0),M=c.leftForLtr(B,g),D=Yn(y.borderRadius);a.beginPath(),Object.values(D).some(v=>v!==0)?gr(a,{x:M,y:N,w:g,h:b,radius:D}):a.rect(M,N,g,b),a.fill(),V!==0&&a.stroke()}a.restore()},E=function(B,k,y){Mo(a,y.text,B,k+x/2,d,{strikethrough:y.hidden,textAlign:c.textAlign(y.textAlign)})},C=this.isHorizontal(),w=this._computeTitleHeight();C?m={x:ht(s,this.left+u,this.right-r[0]),y:this.top+u+w,line:0}:m={x:this.left+u,y:ht(s,this.top+w+u,this.bottom-o[0].height),line:0},$l(this.ctx,n.textDirection);const _=x+u;this.legendItems.forEach((B,k)=>{a.strokeStyle=B.fontColor,a.fillStyle=B.fontColor;const y=a.measureText(B.text).width,V=c.textAlign(B.textAlign||(B.textAlign=i.textAlign)),N=g+h+y;let M=m.x,D=m.y;c.setWidth(this.width),C?k>0&&M+N+u>this.right&&(D=m.y+=_,m.line++,M=m.x=ht(s,this.left+u,this.right-r[m.line])):k>0&&D+_>this.bottom&&(M=m.x=M+o[m.line].width+u,m.line++,D=m.y=ht(s,this.top+w+u,this.bottom-o[m.line].height));const v=c.x(M);if(p(v,D,B),M=Sp(V,M+g+h,C?M+N:this.right,n.rtl),E(c.x(M),D,B),C)m.x+=N+u;else if(typeof B.text!="string"){const P=d.lineHeight;m.y+=Kc(B,P)+u}else m.y+=_}),jl(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=mt(o.font),a=Nt(o.padding);if(!o.display)return;const s=Zn(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,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=ht(n.align,f,this.right-h);else{const g=this.columnSizes.reduce((b,x)=>Math.max(b,x.height),0);u=d+ht(n.align,this.top,this.bottom-g-n.labels.padding-this._computeTitleHeight())}const m=ht(l,f,f+h);i.textAlign=s.textAlign(ja(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,Mo(i,o.text,m,u,r)}_computeTitleHeight(){const n=this.options.title,o=mt(n.font),r=Nt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(on(n,this.left,this.right)&&on(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],on(n,a.left,a.left+a.width)&&on(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!Zb(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=Kb(a,r);a&&!s&&Ye(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&Ye(o.onHover,[n,r,this],this)}else r&&Ye(o.onClick,[n,r,this],this)}}function Yb(t,n,o,r,a){const s=Jb(r,t,n,o),i=Qb(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 Qb(t,n,o){let r=t;return typeof n.text!="string"&&(r=Kc(n,o)),r}function Kc(t,n){const o=t.text?t.text.length:0;return n*o}function Zb(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var ey={id:"legend",_element:Xc,start(t,n,o){const r=t.legend=new Xc({ctx:t.ctx,options:o,chart:t});Mt.configure(t,r,o),Mt.addBox(t,r)},stop(t){Mt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;Mt.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=Nt(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 Yc extends an{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=rt(r.text)?r.text.length:1;this._padding=Nt(r.padding);const s=a*mt(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=ht(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=ht(l,a,o),c=He*-.5):(u=s-n,f=ht(l,o,a),c=He*.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=mt(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);Mo(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:ja(o.align),textBaseline:"middle",translation:[i,l]})}}function ty(t,n){const o=new Yc({ctx:t.ctx,options:n,chart:t});Mt.configure(t,o,n),Mt.addBox(t,o),t.titleBlock=o}var ny={id:"title",_element:Yc,start(t,n,o){ty(t,o)},stop(t){const n=t.titleBlock;Mt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;Mt.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 Lo={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=La(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 qt(t,n){return n&&(rt(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function ln(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
17
+ `)>-1?t.split(`
18
+ `):t}function oy(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=mt(n.bodyFont),d=mt(n.titleFont),u=mt(n.footerFont),f=s.length,h=a.length,m=r.length,g=Nt(n.padding);let b=g.height,x=0,p=r.reduce((w,_)=>w+_.before.length+_.lines.length+_.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(b+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const w=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;b+=m*w+(p-m)*c.lineHeight+(p-1)*n.bodySpacing}h&&(b+=n.footerMarginTop+h*u.lineHeight+(h-1)*n.footerSpacing);let E=0;const C=function(w){x=Math.max(x,o.measureText(w).width+E)};return o.save(),o.font=d.string,Ue(t.title,C),o.font=c.string,Ue(t.beforeBody.concat(t.afterBody),C),E=n.displayColors?i+2+n.boxPadding:0,Ue(r,w=>{Ue(w.before,C),Ue(w.lines,C),Ue(w.after,C)}),E=0,o.font=u.string,Ue(t.footer,C),o.restore(),x+=g.width,{width:x,height:b}}function ry(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function ay(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 sy(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"),ay(d,t,n,o)&&(d="center"),d}function Qc(t,n,o){const r=o.yAlign||n.yAlign||ry(t,o);return{xAlign:o.xAlign||n.xAlign||sy(t,n,o,r),yAlign:r}}function iy(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function ly(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function Zc(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:h,bottomRight:m}=Yn(i);let g=iy(n,l);const b=ly(n,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,h)+a:l==="right"&&(g+=Math.max(f,m)+a),{x:ft(g,0,r.width-n.width),y:ft(b,0,r.height-n.height)}}function Fr(t,n,o){const r=Nt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function ed(t){return qt([],ln(t))}function cy(t,n,o){return Fn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function td(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const nd={beforeTitle:tn,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:tn,beforeBody:tn,beforeLabel:tn,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 Re(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:tn,afterBody:tn,beforeFooter:tn,footer:tn,afterFooter:tn};function bt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?nd[n].call(o,r):a}class ys extends an{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=cy(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=bt(r,"beforeTitle",this,n),s=bt(r,"title",this,n),i=bt(r,"afterTitle",this,n);let l=[];return l=qt(l,ln(a)),l=qt(l,ln(s)),l=qt(l,ln(i)),l}getBeforeBody(n,o){return ed(bt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Ue(n,s=>{const i={before:[],lines:[],after:[]},l=td(r,s);qt(i.before,ln(bt(l,"beforeLabel",this,s))),qt(i.lines,bt(l,"label",this,s)),qt(i.after,ln(bt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return ed(bt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=bt(r,"beforeFooter",this,n),s=bt(r,"footer",this,n),i=bt(r,"afterFooter",this,n);let l=[];return l=qt(l,ln(a)),l=qt(l,ln(s)),l=qt(l,ln(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(oy(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,h)=>n.filter(u,f,h,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Ue(l,u=>{const f=td(n.callbacks,u);a.push(bt(f,"labelColor",this,u)),s.push(bt(f,"labelPointStyle",this,u)),i.push(bt(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=Lo[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=Qc(this.chart,r,d),f=Zc(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}=Yn(l),{x:h,y:m}=n,{width:g,height:b}=o;let x,p,E,C,w,_;return s==="center"?(w=m+b/2,a==="left"?(x=h,p=x-i,C=w+i,_=w-i):(x=h+g,p=x+i,C=w-i,_=w+i),E=x):(a==="left"?p=h+Math.max(c,u)+i:a==="right"?p=h+g-Math.max(d,f)-i:p=this.caretX,s==="top"?(C=m,w=C-i,x=p-i,E=p+i):(C=m+b,w=C+i,x=p+i,E=p-i),_=C),{x1:x,x2:p,x3:E,y1:C,y2:w,y3:_}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=Zn(r.rtl,this.x,this.width);for(n.x=Fr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=mt(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=mt(s.bodyFont),f=Fr(this,"left",s),h=a.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=o.y+m;if(s.usePointStyle){const b={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=a.leftForLtr(h,d)+d/2,p=g+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,Xa(n,b,x,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,Xa(n,b,x,p)}else{n.lineWidth=Te(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 b=a.leftForLtr(h,d),x=a.leftForLtr(a.xPlus(h,1),d-2),p=Yn(i.borderRadius);Object.values(p).some(E=>E!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,gr(n,{x:b,y:g,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),gr(n,{x,y:g+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(b,g,d,c),n.strokeRect(b,g,d,c),n.fillStyle=i.backgroundColor,n.fillRect(x,g+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=mt(r.bodyFont);let h=f.lineHeight,m=0;const g=Zn(r.rtl,this.x,this.width),b=function(y){o.fillText(y,g.x(n.x+m),n.y+h/2),n.y+=h+s},x=g.textAlign(i);let p,E,C,w,_,B,k;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Fr(this,x,r),o.fillStyle=r.bodyColor,Ue(this.beforeBody,b),m=l&&x!=="right"?i==="center"?d/2+u:d+2+u:0,w=0,B=a.length;w<B;++w){for(p=a[w],E=this.labelTextColors[w],o.fillStyle=E,Ue(p.before,b),C=p.lines,l&&C.length&&(this._drawColorBox(o,n,w,g,r),h=Math.max(f.lineHeight,c)),_=0,k=C.length;_<k;++_)b(C[_]),h=f.lineHeight;Ue(p.after,b)}m=0,h=f.lineHeight,Ue(this.afterBody,b),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=Zn(r.rtl,this.x,this.width);for(n.x=Fr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=mt(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:h,bottomLeft:m,bottomRight:g}=Yn(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-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-g),o.quadraticCurveTo(l+d,c+u,l+d-g,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),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=Lo[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=Qc(o,n,c),u=Zc(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=Nt(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),$l(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),jl(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=!dr(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||!dr(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=Lo[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}ye(ys,"positioners",Lo);var dy={id:"tooltip",_element:ys,positioners:Lo,afterInit(t,n,o){o&&(t.tooltip=new ys({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:nd},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 uy=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function fy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return uy(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const hy=(t,n)=>t===null?null:ft(Math.round(t),0,n);function od(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class xs extends to{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(Re(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:fy(r,n,De(o,n),this._addedLabels),hy(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 od.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}}ye(xs,"id","category"),ye(xs,"defaults",{ticks:{callback:od}});function my(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,g=u-1,{min:b,max:x}=n,p=!Re(i),E=!Re(l),C=!Re(d),w=(x-b)/(f+1);let _=pl((x-b)/g/m)*m,B,k,y,V;if(_<1e-14&&!p&&!E)return[{value:b},{value:x}];V=Math.ceil(x/_)-Math.floor(b/_),V>g&&(_=pl(V*_/g/m)*m),Re(c)||(B=Math.pow(10,c),_=Math.ceil(_*B)/B),a==="ticks"?(k=Math.floor(b/_)*_,y=Math.ceil(x/_)*_):(k=b,y=x),p&&E&&s&&bp((l-i)/s,_/1e3)?(V=Math.round(Math.min((l-i)/_,u)),_=(l-i)/V,k=i,y=l):C?(k=p?i:k,y=E?l:y,V=d-1,_=(y-k)/V):(V=(y-k)/_,_o(V,Math.round(V),_/1e3)?V=Math.round(V):V=Math.ceil(V));const N=Math.max(gl(_),gl(k));B=Math.pow(10,Re(c)?N:c),k=Math.round(k*B)/B,y=Math.round(y*B)/B;let M=0;for(p&&(h&&k!==i?(o.push({value:i}),k<i&&M++,_o(Math.round((k+M*_)*B)/B,i,rd(i,w,t))&&M++):k<i&&M++);M<V;++M){const D=Math.round((k+M*_)*B)/B;if(E&&D>l)break;o.push({value:D})}return E&&h&&y!==l?o.length&&_o(o[o.length-1].value,l,rd(l,w,t))?o[o.length-1].value=l:o.push({value:l}):(!E||y===l)&&o.push({value:y}),o}function rd(t,n,{horizontal:o,minRotation:r}){const a=nn(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class py extends to{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 Re(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=Ut(a),d=Ut(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=my(a,s);return n.bounds==="ticks"&&yp(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 Ha(n,this.chart.options.locale,this.options.ticks.format)}}class ks extends py{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=ut(n)?n:0,this.max=ut(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=nn(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}}ye(ks,"id","linear"),ye(ks,"defaults",{ticks:{callback:Al.formatters.numeric}});const zr={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}},yt=Object.keys(zr);function ad(t,n){return t-n}function sd(t,n){if(Re(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)),ut(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(So(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function id(t,n,o,r){const a=yt.length;for(let s=yt.indexOf(t);s<a-1;++s){const i=zr[yt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return yt[s]}return yt[a-1]}function gy(t,n,o,r,a){for(let s=yt.length-1;s>=yt.indexOf(o);s--){const i=yt[s];if(zr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return yt[o?yt.indexOf(o):0]}function by(t){for(let n=yt.indexOf(t)+1,o=yt.length;n<o;++n)if(zr[yt[n]].common)return yt[n]}function ld(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=$a(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function yy(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 cd(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:yy(t,r,a,o)}class Ir extends to{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 e0._date(n.adapters.date);a.init(o),Eo(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:sd(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=ut(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=ut(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=Ep(a,s,i);return this._unit=o.unit||(r.autoSkip?id(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):gy(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:by(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),cd(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=ft(o,0,i),r=ft(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||id(s.minUnit,o,r,this._getLabelCapacity(o)),l=De(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=So(c)||c===!0,u={};let f=o,h,m;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 g=a.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<r;h=+n.add(h,l,i),m++)ld(u,h,g);return(h===r||a.bounds==="ticks"||m===1)&&ld(u,h,g),Object.keys(u).sort(ad).map(b=>+b)}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 Ye(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=r[o],m=d&&f&&h&&h.major;return this._adapter.format(n,a||(m?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=nn(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,cd(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(sd(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return kl(n.sort(ad))}}ye(Ir,"id","time"),ye(Ir,"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 Rr(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}=Pn(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}=Pn(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 dd extends Ir{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=Rr(o,this.min),this._tableRange=Rr(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(Rr(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return Rr(this._table,r*this._tableRange+this._minPos,!0)}}ye(dd,"id","timeseries"),ye(dd,"defaults",Ir.defaults);const xy={key:0,class:"mb-2 text-sm font-medium text-gray-700"},ky={key:0,class:"text-red-500 ml-1"},wy={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Cy={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Ey={class:"text-red-600 text-sm"},By={key:1,class:"mt-2 text-xs text-gray-500"},_y={key:0},ud=wt(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}){sn.register(xs,ks,Pr,xn,Tr,Ro,ny,dy,ey,Xb,Er,Cr,as,eo);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 h=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let g=0;return m.type==="data"&&m.mode==="default"&&(g=m.dataIndex*100+m.datasetIndex*50),g},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,g)=>{const b=g%r.colors.length,x=r.colors[b];let p=m.backgroundColor,E=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?m.data&&(p=m.data.map((C,w)=>r.colors[w%r.colors.length]+"80"),E=m.data.map((C,w)=>r.colors[w%r.colors.length])):(p=p||x+"40",E=E||x),{...m,borderColor:E,backgroundColor:p,pointBackgroundColor:m.pointBackgroundColor||x,pointBorderColor:m.pointBorderColor||x,hoverBackgroundColor:m.hoverBackgroundColor||x+"60",hoverBorderColor:m.hoverBorderColor||x}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const h=r.data||r.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const b=Object.keys(h[0]),x=b.find(E=>["label","name","x","category","title"].includes(E.toLowerCase()))||b[0],p=b.find(E=>E!==x&&["value","y","count","amount","total","data"].includes(E.toLowerCase()))||b.find(E=>E!==x&&typeof h[0][E]=="number")||(b.length>1?b.find(E=>E!==x):b[0]);m={labels:h.map(E=>E[x||""]),datasets:[{label:r.label||"Data",data:h.map(E=>E[p||""])}]}}else h.length>0?m={labels:h.map((b,x)=>`Data ${x+1}`),datasets:[{label:r.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const g={...d(),...r.options,onClick:(b,x)=>{a("click",b,x),r.onClick&&r.onClick(b,x)},onHover:(b,x)=>{a("hover",b,x),r.onHover&&r.onHover(b,x)}};i.value=new sn(s.value,{type:r.type,data:l.value,options:g}),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}),(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",xy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",ky,"*")):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",wy,[...m[0]||(m[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",Cy,[e.createElementVNode("div",Ey,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",By,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",_y,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"]]),$o=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Qe.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.Label),e.mergeProps(e.unref(o),{class:e.unref(Pe)("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"]))}}),Sy={class:"grid gap-1.5"},Ay={key:0,class:"ml-1 text-destructive"},Vy=["aria-busy"],Dy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Ny={key:1,class:"flex items-center"},My=["id","checked","indeterminate","disabled","required"],cn=wt(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,h=>{d.value=!!h},{immediate:!0});const u=()=>{if(a.disabled)return;const h=!d.value;d.value=h,r("update:modelValue",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",Sy,[t.label?(e.openBlock(),e.createBlock($o,{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",Ay,"*")):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",Dy)):e.createCommentVNode("",!0),m[0]||(m[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",Ny,[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,My),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(ce.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ce.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,Vy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),vy={class:"w-full"},Py={key:0,class:"mb-4"},Ty={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Oy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Fy={key:0,class:"ml-1 text-destructive"},zy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Iy={key:1,class:"flex flex-wrap gap-4"},Ry={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Ly={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},$y={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},ws=wt(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}=ot(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,_=>{if(!_){s.value=new Set;return}const B=_.map(k=>typeof k=="object"&&k!==null?k.id!==void 0?k.id:k.value:k);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,k;const _=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(!(!_&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let y;const V=((k=a.endpoint)==null?void 0:k.apiMethod)||a.apiMethod||"GET",N={page:1,perPage:100,...a.apiParams};if(_)y=await o(_,V,N);else if(a.apiModule&&a.apiAction){const{DCodeApi:D}=ot();y=await D(a.apiModule,a.apiAction,N)}let M=y;a.dataPath?M=a.dataPath.split(".").reduce((v,P)=>v&&v[P]!==void 0?v[P]:void 0,y):typeof y=="object"&&!Array.isArray(y)&&y.data&&(M=y.data),Array.isArray(M)?i.value=M:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(y){console.error("DCodeCardCheckboxList fetch error:",y),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),g=_=>{if(typeof _!="object"||_===null)return _;const B=a.itemValue||a.model||"id";return _[B]},b=_=>{if(typeof _!="object"||_===null)return String(_);const B=a.itemTitle||"name";return _[B]},x=_=>s.value.has(_),p=(_,B)=>{if(a.disabled)return;const k=new Set(s.value);B?k.add(_):k.delete(_),s.value=k;const y=Array.from(s.value);r("update:modelValue",y),r("change",y)},E=e.computed(()=>a.skeleton||l.value),C=e.computed(()=>!!a.error||!!c.value),w=e.computed(()=>a.error||c.value);return(_,B)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",vy,[t.label||E.value?(e.openBlock(),e.createElementBlock("div",Py,[E.value?(e.openBlock(),e.createElementBlock("div",Ty)):(e.openBlock(),e.createElementBlock("h3",Oy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Fy,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",zy,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",Iy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,k=>e.createElementVNode("div",{key:`skeleton-${k}`,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},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",Ry," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",Ly,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(k,y)=>(e.openBlock(),e.createElementBlock("div",{key:y,class:"flex items-start"},[e.createVNode(cn,{"model-value":x(g(k)),title:b(k),disabled:t.disabled,"onUpdate:modelValue":V=>p(g(k),V)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),C.value&&w.value?(e.openBlock(),e.createElementBlock("div",$y,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(w.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),jy=["aria-busy"],Wy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Uy={key:1,class:"flex justify-end"},Hy=["for"],qy={key:0,class:"ml-1 text-destructive"},Gy={class:"relative w-full group"},Xy={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},Ky={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},Yy=["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"},Qy={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Cs=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 M=o.required,D=o["aria-required"];return M===""||M===!0||M==="true"||(D==="true"||D===!0)}),c=e.computed(()=>{const M=o.maxlength??o.maxLength;let D=Number.NaN;return typeof M=="number"?D=M:typeof M=="string"&&(D=Number.parseInt(M,10)),Number.isFinite(D)&&D>0?D: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})),h=M=>{const D=M.replaceAll(/\D/g,"");return D?Number(D):null},m=M=>f.value.format(M),g=e.ref(""),b=e.ref(null);e.watch(()=>a.modelValue,M=>{M==null?g.value="":h(g.value)!==M&&(g.value=m(M))},{immediate:!0});const x=(M,D)=>{let v=0;for(let P=0;P<D;P++)/\d/.test(M[P])&&v++;return v},p=(M,D)=>{let v=0;for(let P=0;P<M.length;P++)if(/\d/.test(M[P])&&(v++,v===D))return P+1;return M.length},E=M=>{const D=M.target,v=D.value,P=D.selectionStart??v.length,H=h(v);if(H===null){g.value="",r("update:modelValue",null);return}const $=m(H);if(v!==$){const q=x(v,P);g.value=$,e.nextTick(()=>{if(b.value){const ee=p($,q);b.value.setSelectionRange(ee,ee)}})}r("update:modelValue",H)},C=()=>{g.value="",r("update:modelValue",null),r("clear")},w=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?g.value.length>0:!0),_=e.computed(()=>!!a.error),B=e.computed(()=>{const{class:M,maxlength:D,maxLength:v,...P}=o;return P}),k=e.computed(()=>g.value.length),y=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),V=e.computed(()=>y.value&&k.value>0),N=e.computed(()=>`${k.value} / ${c.value}`);return(M,D)=>(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",Wy)):e.createCommentVNode("",!0),D[2]||(D[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)),y.value?(e.openBlock(),e.createElementBlock("div",Uy,[...D[1]||(D[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",qy,"*")):e.createCommentVNode("",!0)],8,Hy)):e.createCommentVNode("",!0),e.createElementVNode("div",Gy,[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",_.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",Xy,[e.createElementVNode("span",Ky,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:b,"onUpdate:modelValue":D[0]||(D[0]=v=>g.value=v),onInput:E,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",w.value?"pr-8":""]}),null,16,Yy),[[e.vModelText,g.value]]),w.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:C},[e.createVNode(e.unref(ce.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),V.value&&!_.value?(e.openBlock(),e.createElementBlock("p",Jy,e.toDisplayString(N.value),1)):e.createCommentVNode("",!0)]),_.value?(e.openBlock(),e.createElementBlock("p",Qy,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,jy))}}),fd=6048e5,Zy=864e5,hd=Symbol.for("constructDateFrom");function wn(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&hd in t?t[hd](n):t instanceof Date?new t.constructor(n):new Date(n)}function Rt(t,n){return wn(n||t,t)}let ex={};function Lr(){return ex}function jo(t,n){var l,c,d,u;const o=Lr(),r=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=Rt(t,n==null?void 0:n.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function $r(t,n){return jo(t,{...n,weekStartsOn:1})}function md(t,n){const o=Rt(t,n==null?void 0:n.in),r=o.getFullYear(),a=wn(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=$r(a),i=wn(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=$r(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function pd(t){const n=Rt(t),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+t-+o}function tx(t,...n){const o=wn.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function gd(t,n){const o=Rt(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function nx(t,n,o){const[r,a]=tx(o==null?void 0:o.in,t,n),s=gd(r),i=gd(a),l=+s-pd(s),c=+i-pd(i);return Math.round((l-c)/Zy)}function ox(t,n){const o=md(t,n),r=wn(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),$r(r)}function rx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ax(t){return!(!rx(t)&&typeof t!="number"||isNaN(+Rt(t)))}function sx(t,n){const o=Rt(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const ix={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"}},lx=(t,n,o)=>{let r;const a=ix[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 oo(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const cx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},dx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ux={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},fx={date:oo({formats:cx,defaultWidth:"full"}),time:oo({formats:dx,defaultWidth:"full"}),dateTime:oo({formats:ux,defaultWidth:"full"})},hx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},mx=(t,n,o,r)=>hx[t];function Gt(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 px={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},gx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},bx={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"]},yx={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"]},xx={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"}},kx={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"}},wx={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:Gt({values:px,defaultWidth:"wide"}),quarter:Gt({values:gx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Gt({values:bx,defaultWidth:"wide"}),day:Gt({values:yx,defaultWidth:"wide"}),dayPeriod:Gt({values:xx,defaultWidth:"wide",formattingValues:kx,defaultFormattingWidth:"wide"})};function Xt(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)?Ex(l,f=>f.test(i)):Cx(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 Cx(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function Ex(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function bd(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 Bx=/^(\d+)(th|st|nd|rd)?/i,_x=/\d+/i,Sx={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},Ax={any:[/^b/i,/^(a|c)/i]},Vx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Dx={any:[/1/i,/2/i,/3/i,/4/i]},Nx={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},Mx={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]},vx={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},Px={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]},Tx={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},Ox={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}},Fx={ordinalNumber:bd({matchPattern:Bx,parsePattern:_x,valueCallback:t=>parseInt(t,10)}),era:Xt({matchPatterns:Sx,defaultMatchWidth:"wide",parsePatterns:Ax,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:Vx,defaultMatchWidth:"wide",parsePatterns:Dx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Xt({matchPatterns:Nx,defaultMatchWidth:"wide",parsePatterns:Mx,defaultParseWidth:"any"}),day:Xt({matchPatterns:vx,defaultMatchWidth:"wide",parsePatterns:Px,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:Tx,defaultMatchWidth:"any",parsePatterns:Ox,defaultParseWidth:"any"})},yd={code:"en-US",formatDistance:lx,formatLong:fx,formatRelative:mx,localize:wx,match:Fx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function zx(t,n){const o=Rt(t,n==null?void 0:n.in);return nx(o,sx(o))+1}function Ix(t,n){const o=Rt(t,n==null?void 0:n.in),r=+$r(o)-+ox(o);return Math.round(r/fd)+1}function xd(t,n){var u,f,h,m;const o=Rt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Lr(),s=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=wn((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=jo(i,n),c=wn((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=jo(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function Rx(t,n){var l,c,d,u;const o=Lr(),r=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=xd(t,n),s=wn((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),jo(s,n)}function Lx(t,n){const o=Rt(t,n==null?void 0:n.in),r=+jo(o,n)-+Rx(o,n);return Math.round(r/fd)+1}function qe(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const Cn={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return qe(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):qe(o+1,2)},d(t,n){return qe(t.getDate(),n.length)},a(t,n){const o=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,n){return qe(t.getHours()%12||12,n.length)},H(t,n){return qe(t.getHours(),n.length)},m(t,n){return qe(t.getMinutes(),n.length)},s(t,n){return qe(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return qe(a,n.length)}},ro={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},kd={G:function(t,n,o){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})}},y:function(t,n,o){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return o.ordinalNumber(a,{unit:"year"})}return Cn.y(t,n)},Y:function(t,n,o,r){const a=xd(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return qe(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):qe(s,n.length)},R:function(t,n){const o=md(t);return qe(o,n.length)},u:function(t,n){const o=t.getFullYear();return qe(o,n.length)},Q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return qe(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return qe(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,o){const r=t.getMonth();switch(n){case"M":case"MM":return Cn.M(t,n);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,o){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return qe(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,o,r){const a=Lx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):qe(a,n.length)},I:function(t,n,o){const r=Ix(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):qe(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):Cn.d(t,n)},D:function(t,n,o){const r=zx(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):qe(r,n.length)},E:function(t,n,o){const r=t.getDay();switch(n){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});case"EEEE":default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return qe(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(a,{width:"short",context:"formatting"});case"eeee":default:return o.day(a,{width:"wide",context:"formatting"})}},c:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return qe(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(a,{width:"narrow",context:"standalone"});case"cccccc":return o.day(a,{width:"short",context:"standalone"});case"cccc":default:return o.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,o){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return qe(a,n.length);case"io":return o.ordinalNumber(a,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});case"iiii":default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,o){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,o){const r=t.getHours();let a;switch(r===12?a=ro.noon:r===0?a=ro.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,o){const r=t.getHours();let a;switch(r>=17?a=ro.evening:r>=12?a=ro.afternoon:r>=4?a=ro.morning:a=ro.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,o){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Cn.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):Cn.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):qe(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):qe(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):Cn.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):Cn.s(t,n)},S:function(t,n){return Cn.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return Cd(r);case"XXXX":case"XX":return jn(r);case"XXXXX":case"XXX":default:return jn(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return Cd(r);case"xxxx":case"xx":return jn(r);case"xxxxx":case"xxx":default:return jn(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+wd(r,":");case"OOOO":default:return"GMT"+jn(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+wd(r,":");case"zzzz":default:return"GMT"+jn(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return qe(r,n.length)},T:function(t,n,o){return qe(+t,n.length)}};function wd(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?o+String(a):o+String(a)+n+qe(s,2)}function Cd(t,n){return t%60===0?(t>0?"-":"+")+qe(Math.abs(t)/60,2):jn(t,n)}function jn(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=qe(Math.trunc(r/60),2),s=qe(r%60,2);return o+a+n+s}const Ed=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Bd=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},$x={p:Bd,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return Ed(t,n);let s;switch(r){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Ed(r,n)).replace("{{time}}",Bd(a,n))}},jx=/^D+$/,Wx=/^Y+$/,Ux=["D","DD","YY","YYYY"];function Hx(t){return jx.test(t)}function qx(t){return Wx.test(t)}function Gx(t,n,o){const r=Xx(t,n,o);if(console.warn(r),Ux.includes(t))throw new RangeError(r)}function Xx(t,n,o){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Kx=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Yx=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Jx=/^'([^]*?)'?$/,Qx=/''/g,Zx=/[a-zA-Z]/;function _d(t,n,o){var u,f,h,m;const r=Lr(),a=r.locale??yd,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Rt(t,o==null?void 0:o.in);if(!ax(l))throw new RangeError("Invalid time value");let c=n.match(Yx).map(g=>{const b=g[0];if(b==="p"||b==="P"){const x=$x[b];return x(g,a.formatLong)}return g}).join("").match(Kx).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const b=g[0];if(b==="'")return{isToken:!1,value:ek(g)};if(kd[b])return{isToken:!0,value:g};if(b.match(Zx))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const b=g.value;(qx(b)||Hx(b))&&Gx(b,n,String(t));const x=kd[b[0]];return x(l,b,a.localize,d)}).join("")}function ek(t){const n=t.match(Jx);return n?n[1].replace(Qx,"'"):t}const tk={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"}},nk=(t,n,o)=>{let r;const a=tk[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},ok={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},rk={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},ak={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},sk={date:oo({formats:ok,defaultWidth:"full"}),time:oo({formats:rk,defaultWidth:"full"}),dateTime:oo({formats:ak,defaultWidth:"full"})},ik={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},lk=(t,n,o,r)=>ik[t],ck={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},dk={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},uk={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"]},fk={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"]},hk={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"}},mk={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"}},pk={ordinalNumber:(t,n)=>"ke-"+Number(t),era:Gt({values:ck,defaultWidth:"wide"}),quarter:Gt({values:dk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Gt({values:uk,defaultWidth:"wide"}),day:Gt({values:fk,defaultWidth:"wide"}),dayPeriod:Gt({values:hk,defaultWidth:"wide",formattingValues:mk,defaultFormattingWidth:"wide"})},gk=/^ke-(\d+)?/i,bk=/\d+/i,yk={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},xk={any:[/^s/i,/^(m|e)/i]},kk={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},wk={any:[/1/i,/2/i,/3/i,/4/i]},Ck={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},Ek={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]},Bk={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},_k={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]},Sk={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},Ak={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}},Vk={ordinalNumber:bd({matchPattern:gk,parsePattern:bk,valueCallback:t=>parseInt(t,10)}),era:Xt({matchPatterns:yk,defaultMatchWidth:"wide",parsePatterns:xk,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:kk,defaultMatchWidth:"wide",parsePatterns:wk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Xt({matchPatterns:Ck,defaultMatchWidth:"wide",parsePatterns:Ek,defaultParseWidth:"any"}),day:Xt({matchPatterns:Bk,defaultMatchWidth:"wide",parsePatterns:_k,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:Sk,defaultMatchWidth:"any",parsePatterns:Ak,defaultParseWidth:"any"})},Dk={code:"id",formatDistance:nk,formatLong:sk,formatRelative:lk,localize:pk,match:Vk,options:{weekStartsOn:1,firstWeekContainsDate:1}},Sd={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 Nk(t,n=Ad){const o=Sd[t]??Sd.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 r=document.getElementById(t);r||(r=document.createElement("style"),r.id=t,document.head.appendChild(r)),r.textContent=a}function Px(e,t=hd){n.watch(e,o=>vx(o,t),{immediate:!0})}const Tx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Ox=["for"],zx={key:0,class:"ml-1 text-destructive"},Fx=["disabled","onClick"],Rx={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Ix=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Lx={class:"h-full p-2 flex flex-col gap-3 w-32"},$x=["onClick"],Wx={class:"flex items-center justify-end gap-2 w-full p-2"},jx=["disabled","onClick"],Ux={key:1,class:"text-xs text-destructive"},Sa=n.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(e,{emit:t}){const o=n.useAttrs(),a=e,r=t,s=Math.random().toString(36).slice(2,7),i=n.computed(()=>`dcode-datepicker-${o.id||a.label||"date-picker"}-${s}`),l=n.computed(()=>{const N=o.required,T=o["aria-required"];return N===""||N===!0||N==="true"||T==="true"||T===!0}),c=n.computed(()=>!!a.error),d=n.computed({get:()=>a.modelValue,set:N=>{r("update:modelValue",N),r("change",N)}}),u=n.computed(()=>a.locale==="en"?ad:Nx),f=n.computed(()=>a.range?2:!1),h=n.computed(()=>{if(!a.range)return!1;const N={partialRange:!1};return a.autoRangeDays&&a.autoRangeDays>0&&(N.maxRange=a.autoRangeDays,N.autoRange=a.autoRangeDays),N}),m=N=>{const T=new Date(N);return T.setHours(0,0,0,0),T},g=N=>{const T=new Date(N);return T.setHours(23,59,59,999),T},y=(N,T)=>{const Y=new Date(N);return Y.setDate(Y.getDate()+T),Y},k=n.computed(()=>{if(a.disablePast)return m(new Date)}),p=n.computed(()=>{if(a.maxDaysAhead&&a.maxDaysAhead>0)return g(y(new Date,a.maxDaysAhead))}),B=n.ref(null),C=n.ref(null),w=N=>{C.value={month:N.month,year:N.year}},E=n.ref(!1);let _=null;n.onMounted(()=>{const N=document.documentElement,T=()=>E.value=N.classList.contains("dark");T(),_=new MutationObserver(T),_.observe(N,{attributes:!0,attributeFilter:["class"]})}),n.onBeforeUnmount(()=>{_==null||_.disconnect(),_=null}),Px(n.toRef(a,"tone"));const x=N=>{const T=new Date(N),Y=T.getDay(),R=T.getDate()-Y+(Y===0?-6:1);return T.setDate(R),m(T)},b=N=>{const T=x(N);return T.setDate(T.getDate()+6),g(T)},A=N=>{const T=new Date(N);return T.setDate(1),m(T)},D=N=>{const T=new Date(N);return T.setMonth(T.getMonth()+1),T.setDate(0),g(T)},M=n.computed(()=>{if(!a.range)return[];const N=new Date,T=m(N),Y=x(N),R=b(N),X=A(N),$=D(N),Q=(L,H)=>{let J=L;a.disablePast&&J<T&&(J=T);let v=H;if(a.autoRangeDays&&a.autoRangeDays>0){const O=g(y(J,a.autoRangeDays-1));v>O&&(v=O)}return v<J&&(v=g(new Date(J))),[J,v]};return[{label:a.locale==="id"?"Minggu Ini":"This Week",range:Q(Y,R)},{label:a.locale==="id"?"Bulan Ini":"This Month",range:Q(X,$)}]}),V=async N=>{var H,J;const T=a.modelType||"yyyy-MM-dd";if(N.length===0){d.value=null;return}if(N.length<2)return;const Y=ud(N[0],T),R=ud(N[1],T);d.value=[Y,R],await n.nextTick();const X=N[0],$=X.getMonth(),Q=X.getFullYear();C.value&&C.value.month===$&&C.value.year===Q||(H=B.value)==null||H.setMonthYear({month:$,year:Q}),(J=B.value)==null||J.openMenu()};return(N,T)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class])},[e.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[e.label?(n.openBlock(),n.createElementBlock("div",Tx)):n.createCommentVNode("",!0),T[2]||(T[2]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[e.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(e.label)+" ",1),l.value?(n.openBlock(),n.createElementBlock("span",zx,"*")):n.createCommentVNode("",!0)],8,Ox)):n.createCommentVNode("",!0),n.createVNode(n.unref(eu.VueDatePicker),{ref_key:"dpRef",ref:B,modelValue:d.value,"onUpdate:modelValue":T[1]||(T[1]=Y=>d.value=Y),dark:E.value,range:h.value,"multi-calendars":f.value,disabled:e.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":e.modelType,formats:{input:e.displayFormat},"min-date":k.value,"max-date":p.value,"preset-ranges":M.value,floating:{placement:e.placement,offset:8,arrow:!1,flip:!1,shift:!0},teleport:!0,"menu-class-name":"dcode-datepicker-menu","calendar-class-name":"dcode-datepicker-calendar",onUpdateMonthYear:w},n.createSlots({"dp-input":n.withCtx(({value:Y,onInput:R,onEnter:X,onTab:$,onBlur:Q,onFocus:L,onKeypress:H,onPaste:J,toggleMenu:v})=>[n.createElementVNode("div",{class:n.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 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":"",e.disabled?"opacity-50 cursor-not-allowed":""]])},[n.createElementVNode("button",{type:"button",tabindex:"-1",disabled:e.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:O=>v()},[n.createVNode(n.unref(ae.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Fx),T[4]||(T[4]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),e.prependInner?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("span",Rx,n.toDisplayString(e.prependInner),1),T[3]||(T[3]=n.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:i.value,value:Y,placeholder:e.placeholder,disabled:e.disabled,autocomplete:"off",readonly:"",class:n.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",e.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:O=>v(),onFocus:O=>L(),onBlur:O=>Q(),onInput:O=>R(O),onKeydown:[n.withKeys(O=>X(O),["enter"]),n.withKeys(O=>$(O),["tab"])],onKeypress:O=>H(O),onPaste:O=>J()},null,42,Ix)],2)]),"action-buttons":n.withCtx(({selectDate:Y,selectionDisabled:R})=>[n.createElementVNode("div",Wx,[n.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:T[0]||(T[0]=X=>{var $;return($=B.value)==null?void 0:$.closeMenu()})},n.toDisplayString(e.cancelLabel),1),n.createElementVNode("button",{type:"button",disabled:R,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:X=>Y()},n.toDisplayString(e.selectLabel),9,jx)])]),_:2},[e.range?{name:"left-sidebar",fn:n.withCtx(()=>[n.createElementVNode("div",Lx,[M.value.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(M.value,Y=>(n.openBlock(),n.createElementBlock("button",{key:Y.label,type:"button",class:"w-full 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",onClick:R=>V(Y.range)},n.toDisplayString(Y.label),9,$x))),128)):n.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(n.openBlock(),n.createElementBlock("p",Ux,n.toDisplayString(a.error),1)):n.createCommentVNode("",!0)],64))],2))}}),Hx=n.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(e,{emit:t}){const o=e,a=t,r=pe.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(pe.DialogRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),qx=n.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const o=e,a=t,r=We.reactiveOmit(o,"class"),s=pe.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(pe.DialogPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(pe.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"}),n.createVNode(n.unref(pe.DialogContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(Se)("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:n.withCtx(()=>[n.renderSlot(i.$slots,"default"),n.createVNode(n.unref(pe.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:n.withCtx(()=>[n.createVNode(n.unref(ae.X),{class:"w-4 h-4"}),l[0]||(l[0]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),Gx=n.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.DialogDescription),n.mergeProps(n.unref(a),{class:n.unref(Se)("text-sm text-muted-foreground",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Xx=n.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.DialogTitle),n.mergeProps(n.unref(a),{class:n.unref(Se)("text-lg font-medium leading-none tracking-tight",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Yx={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200 dark:border-neutral-800 bg-white/80 dark:bg-neutral-900/80 backdrop-blur-md sticky top-0 z-20"},Kx={class:"flex items-center gap-3"},Jx={class:"flex flex-col"},Qx={key:0,class:"flex items-center gap-2"},Zx={key:1,class:"px-6 py-4 border-t border-neutral-200 dark:border-neutral-800 bg-neutral-50/50 dark:bg-neutral-900/50 sticky bottom-0 z-20"},ek={class:"flex justify-end gap-3 flex-wrap"},Vo=ht(n.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(e,{emit:t}){const o=e,a=t,r=n.useAttrs(),s=n.computed(()=>{const{style:d,...u}=r;return u}),i=n.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=n.computed(()=>o.icon?kt[o.icon]??null:null),c=d=>{a("update:modelValue",d)};return(d,u)=>(n.openBlock(),n.createBlock(n.unref(Hx),{open:e.modelValue,"onUpdate:open":c},{default:n.withCtx(()=>[n.createVNode(n.unref(qx),n.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-950 border-0",onInteractOutside:u[0]||(u[0]=f=>e.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>e.persistent?f.preventDefault():null)}),{default:n.withCtx(()=>[e.title||d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",Yx,[n.createElementVNode("div",Kx,[l.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["p-2 rounded-lg",e.iconClass||"bg-primary/10 text-primary"])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):n.createCommentVNode("",!0),n.createElementVNode("div",Jx,[n.createVNode(n.unref(Xx),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),n.createVNode(n.unref(Gx),{class:"hidden"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(n.openBlock(),n.createElementBlock("div",Qx,[n.renderSlot(d.$slots,"header-append",{},void 0,!0)])):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",e.contentClass]),style:n.normalizeStyle(e.contentStyle)},[n.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(n.openBlock(),n.createElementBlock("div",Zx,[n.createElementVNode("div",ek,[n.renderSlot(d.$slots,"actions",{},void 0,!0)])])):n.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-ca4cb507"]]),md=n.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(e){const t=e,o=n.computed(()=>kt[t.icon]??kt.X);return(a,r)=>(n.openBlock(),n.createBlock(n.unref(Et),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:n.withCtx(()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.value),{size:Number(e.iconSize)},null,8,["size"]))]),_:1}))}}),tk=n.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Se)(n.unref(ok)({variant:e.variant}),t.class)),role:"alert"},[n.renderSlot(o.$slots,"default")],2))}}),nk=n.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Se)("text-sm [&_p]:leading-relaxed",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ok=wr("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"}}),us=n.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Se)("rounded-xl border bg-card text-card-foreground shadow",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),fs=n.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Se)("p-6 pt-0",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),hs=n.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(n.unref(Se)("flex flex-col gap-y-1.5 p-6",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ms=n.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createElementBlock("h3",{class:n.normalizeClass(n.unref(Se)("font-medium leading-none tracking-tight",t.class))},[n.renderSlot(o.$slots,"default")],2))}}),ak={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},rk={class:"flex flex-wrap items-center justify-center gap-2"},sk=["accept","multiple"],Aa=ht(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);n.computed(()=>o.accept||"file/*");const d=n.computed(()=>o.error??i.value);function u(){var x;o.disabled||(x=r.value)==null||x.click()}function f(x){const b=x/1024,A=b/1024;return A>=1?`${A.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${x} B`}function h(x){var A;if(!x)return"File tidak valid";if((A=o.accept)!=null&&A.includes("image/")&&!x.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return x.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(x){l.value=x.name,c.value=x.size}function g(x){if(i.value=null,!x.length)return;if(o.mode==="single"){const A=x[0],D=h(A);if(D){i.value=D,a("error",D);return}o.showSelected&&m(A),a("picked",A);return}const b=[];for(const A of x){const D=h(A);if(D){i.value=D,a("error",D);return}b.push(A)}b.length&&(o.showSelected&&m(b[0]),a("picked:multiple",b))}function y(x){const b=x.target,A=Array.from(b.files??[]);g(A),b.value=""}function k(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function B(){s.value=!1}function C(x){var D,M;if(o.disabled)return;s.value=!1;const b=Array.from(((D=x.dataTransfer)==null?void 0:D.files)??[]),A=(M=o.accept)!=null&&M.includes("image/")?b.filter(V=>V.type.startsWith("image/")):b;g(A)}const w=n.computed(()=>(o.accept||"file/*").split(",").map(x=>x.trim()).filter(Boolean).map(x=>x==="image/*"?"IMAGE":x.replace(/^image\//,"").replace(/^\./,"")).join(", "));n.computed(()=>`${o.maxSizeMb??0}MB`);const E=n.ref(!1),_=n.computed(()=>{if(o.disabled||!E.value)return{};const x=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:x?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:x?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(x,b)=>{const A=n.resolveComponent("DCodeBadge");return n.openBlock(),n.createBlock(n.unref(us),{class:n.normalizeClass([e.disabled?"opacity-60":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(n.unref(hs),{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(n.unref(ms),{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label),1)]),_:1})]),_:1}),n.createVNode(n.unref(fs),{class:"pt-2"},{default:n.withCtx(()=>[n.createElementVNode("div",{class:n.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",e.disabled?"is-disabled":""]]),style:n.normalizeStyle([{minHeight:"190px"},_.value]),onClick:u,onDragenter:n.withModifiers(k,["prevent"]),onDragover:n.withModifiers(p,["prevent"]),onDragleave:n.withModifiers(B,["prevent"]),onDrop:n.withModifiers(C,["prevent"]),onMouseenter:b[0]||(b[0]=D=>E.value=!0),onMouseleave:b[1]||(b[1]=D=>E.value=!1)},[n.createElementVNode("div",ak,[b[2]||(b[2]=n.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=n.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),n.createElementVNode("div",rk,[n.createVNode(A,{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Allowed: "+n.toDisplayString(w.value),1)]),_:1}),n.createVNode(A,{variant:"secondary",class:"text-[11px] dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(" Max: "+n.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),e.showSelected&&l.value?(n.openBlock(),n.createBlock(A,{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-700 dark:text-neutral-300"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(l.value)+" • "+n.toDisplayString(c.value?f(c.value):""),1)]),_:1})):n.createCommentVNode("",!0)]),n.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:e.accept,multiple:e.mode==="multiple",onChange:y},null,40,sk)],38),d.value?(n.openBlock(),n.createBlock(n.unref(tk),{key:0,variant:"destructive",class:"mt-3"},{default:n.withCtx(()=>[n.createVNode(n.unref(nk),{class:"text-sm"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value),1)]),_:1})]),_:1})):n.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"])}}}),[["__scopeId","data-v-0897e9f4"]]),ik={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},lk=["src"],ck={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"},dk={class:"space-y-0.5"},uk={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},fk={class:"text-xs opacity-70"},hk=["disabled"],mk={key:1},pk=["disabled"],gk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},bk={class:"flex gap-2"},yk={class:"font-medium truncate"},xk={class:"flex gap-2"},kk={class:"font-medium"},wk={class:"flex gap-2"},Ck={class:"font-medium truncate"},ps=ht(n.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(e,{emit:t}){const o=e,a=t,r=n.ref(null),s=n.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));n.watch(()=>o.file,m=>{r.value&&URL.revokeObjectURL(r.value),r.value=m?URL.createObjectURL(m):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),u&&u.disconnect()});function i(m){const g=m/1024,y=g/1024;return y>=1?`${y.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const l=n.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=n.ref(!1),d=n.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.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 h=n.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(m,g)=>e.file?(n.openBlock(),n.createBlock(us,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(hs,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(ms,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",ik,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(fs,{class:"pt-2"},{default:n.withCtx(()=>{var y,k,p,B,C;return[n.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-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},h.value]),onMouseenter:g[2]||(g[2]=w=>c.value=!0),onMouseleave:g[3]||(g[3]=w=>c.value=!1)},[s.value&&r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,lk)):(n.openBlock(),n.createElementBlock("div",ck,[n.createVNode(n.unref(ae.FileText),{class:"w-10 h-10"}),n.createElementVNode("div",dk,[n.createElementVNode("p",uk,n.toDisplayString((y=l.value)==null?void 0:y.name),1),n.createElementVNode("p",fk,n.toDisplayString((k=l.value)==null?void 0:k.size),1)])])),n.createElementVNode("div",{class:"d-action-buttons",style:n.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[e.showEdit&&s.value?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[0]||(g[0]=w=>a("edit"))},[n.createVNode(n.unref(ae.Pencil),{style:{width:"16px",height:"16px"}})],12,hk)):(n.openBlock(),n.createElementBlock("div",mk)),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:2,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[1]||(g[1]=w=>a("remove"))},[n.createVNode(n.unref(ae.Trash2),{style:{width:"16px",height:"16px"}})],12,pk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.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"})},[n.createElementVNode("div",gk,[n.createElementVNode("div",bk,[g[4]||(g[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",yk,n.toDisplayString((p=l.value)==null?void 0:p.name),1)]),n.createElementVNode("div",xk,[g[5]||(g[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",kk,n.toDisplayString((B=l.value)==null?void 0:B.size),1)]),n.createElementVNode("div",wk,[g[6]||(g[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",Ck,n.toDisplayString((C=l.value)==null?void 0:C.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-4f5c1d5e"]]);function gs(){const e=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:e,success:(s,i)=>e({type:"success",message:s,title:i}),error:(s,i)=>e({type:"error",message:s,title:i}),warning:(s,i)=>e({type:"warning",message:s,title:i}),info:(s,i)=>e({type:"info",message:s,title:i})}}const Bk={class:"space-y-3"},Ek={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"},pd=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:_=>a("update:modelValue",_)}),s=n.ref(null),i=n.ref(null);function l(_){i.value=_,a("error",_)}function c(){i.value=null}const d=n.computed(()=>{const _=(o.allowedTypes??"").trim();return _?_.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(_){const x=_.lastIndexOf(".");return x>=0?_.slice(x).toLowerCase():""}const f=n.computed(()=>{if(d.value.length){const _=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),..._].join(",")}return o.accept}),h=n.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(_){if(d.value.length){const x=(_.type||"").toLowerCase(),b=u(_.name);return d.value.some(A=>A.includes("/")?x===A:A.startsWith(".")?b===A:b===`.${A}`)}if(o.accept){if(o.accept==="*/*")return!0;const x=o.accept.split(",").map(D=>D.trim().toLowerCase()),b=(_.type||"").toLowerCase(),A=u(_.name);return x.some(D=>{if(D.endsWith("/*")){const M=D.slice(0,-2);return b.startsWith(M)}return D.startsWith(".")?A===D:b===D})}return!0}function g(_){return _*1024*1024}async function y(_){return _?m(_)?o.minSizeMb!=null&&_.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&_.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:k}=Xe(),p=gs(),B=n.ref(!1);async function C(_){var x;if(o.uploadFn){try{B.value=!0;const b=await o.uploadFn(_);r.value=_,a("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{B.value=!1}return}if(!((x=o.endpoint)!=null&&x.apiUrl)){r.value=_;return}if(typeof k!="function"){l("useApi() must expose DCodeApi()");return}try{B.value=!0;const b=new FormData;b.append("doc",_);const A=(o.endpoint.apiMethod||"POST").toUpperCase(),D=o.endpoint.apiUrl,M=await k("","",b,{_url:D,_method:A,withCredentials:!0,transformRequest:[(N,T)=>(T&&(delete T["Content-Type"],delete T["content-type"]),N)]}),V=(M==null?void 0:M.data)??M;r.value=_,a("uploaded",V)}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{B.value=!1}}async function w(_){var b;if(o.disabled)return;c();const x=await y(_);if(x){l(x);return}s.value=_,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await C(_):r.value=_}function E(){c(),r.value=null,s.value=null}return n.watch(()=>o.modelValue,_=>{_&&!s.value&&(s.value=_),_||(s.value=null)},{immediate:!0}),(_,x)=>(n.openBlock(),n.createElementBlock("div",Bk,[r.value?B.value?(n.openBlock(),n.createElementBlock("div",Ek,[...x[1]||(x[1]=[n.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(n.openBlock(),n.createBlock(ps,{key:2,file:r.value,title:e.label,description:e.hint,disabled:e.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":e.previewHeight,"preview-width":e.previewWidth,onRemove:E},null,8,["file","title","description","disabled","preview-height","preview-width"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:f.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled||B.value,onPicked:w,error:i.value,onError:x[0]||(x[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),_k=["for"],Sk={key:0,class:"!ml-1 !text-destructive"},Ak={class:"relative w-full block box-border"},Vk={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Dk=["id","readonly","disabled","placeholder"],Mk={class:"absolute inset-y-0 right-4 flex items-center z-10"},Nk={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg box-border"},vk={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Pk={key:1,class:"text-sm text-muted-foreground text-center"},Tk=["onClick","title"],Ok={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},zk={class:"flex items-center justify-center flex-1"},Fk={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},Rk={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},gd=n.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(e,{emit:t}){const o=e,a=t,r=kt,s=n.ref(null),i=n.ref(null),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=n.ref(!1),u=n.computed(()=>(o.modelValue??"").trim()||""),f=n.ref(""),h=n.ref(!1),m=n.ref(!1),g=n.ref(!1),y=n.shallowRef([]),k=n.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),B=async()=>{if(m.value||g.value)return;g.value=!0,await new Promise(H=>setTimeout(H,0));const L=Object.keys(r).filter(H=>!p.has(H)).filter(H=>/^[A-Z]/.test(H)).filter(H=>typeof r[H]=="function"||typeof r[H]=="object"&&r[H]).sort((H,J)=>H.localeCompare(J));y.value=L,m.value=!0,g.value=!1},C=n.computed(()=>!m.value||!u.value||!y.value.includes(u.value)?null:r[u.value]),w=n.ref(u.value),E=n.computed(()=>!!u.value&&!d.value),_=n.computed(()=>{if(!m.value)return[];const L=(f.value??"").trim().toLowerCase();return L?y.value.filter(H=>H.toLowerCase().includes(L)):y.value}),x=n.computed(()=>_.value.slice(0,k.value)),b=n.computed(()=>{const L=o.columns;return L<=2?"grid-cols-2":L===3?"grid-cols-3":L===4?"grid-cols-4":L===5?"grid-cols-5":L>=8?"grid-cols-8":"grid-cols-6"});n.computed(()=>o.clearable?"!pr-10":"!pr-3"),n.computed(()=>C.value&&!d.value?"!pl-12":"!pl-3");const A=async()=>{var L;await n.nextTick(),(L=i.value)==null||L.focus()},D=async L=>{if(o.disabled)return;const H=L!==!1;if(h.value){h.value=!1;return}d.value=!0,await B(),H&&(f.value="",w.value=""),k.value=o.pageSize,await A()},M=()=>{d.value=!1,f.value="",w.value=u.value,k.value=o.pageSize},V=async()=>{o.disabled||(d.value?M():await D())};let N=null;const T=async L=>{if(o.disabled)return;a("update:modelValue",null),d.value||await D(!1),N&&clearTimeout(N);const H=w.value;N=setTimeout(()=>{f.value=H},300)},Y=L=>{o.disabled||(a("update:modelValue",L),M(),queueMicrotask(()=>{var H;return(H=i.value)==null?void 0:H.blur()}))},R=()=>{o.disabled||(a("update:modelValue",null),a("clear"),h.value=!0,M(),queueMicrotask(()=>{var L;return(L=i.value)==null?void 0:L.focus()}))},X=L=>{if(L.key==="Escape"){L.preventDefault(),M();return}if(L.key==="Enter"&&d.value){const H=_.value[0];H&&(L.preventDefault(),Y(H))}},$=L=>{if(!d.value)return;const H=L.target;s.value&&!s.value.contains(H)&&M()},Q=L=>{const H=L.target;H.scrollTop+H.clientHeight>=H.scrollHeight-24&&k.value<_.value.length&&(k.value=Math.min(k.value+o.pageSize,_.value.length))};return n.onMounted(()=>{document.addEventListener("mousedown",$),queueMicrotask(()=>{var L;i.value=((L=s.value)==null?void 0:L.querySelector("input"))??null}),u.value&&B()}),n.onBeforeUnmount(()=>{document.removeEventListener("mousedown",$),N&&clearTimeout(N)}),n.watch(u,L=>{d.value||(w.value=L)}),n.watch(()=>f.value,()=>{k.value=o.pageSize}),(L,H)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[n.createTextVNode(n.toDisplayString(o.label)+" ",1),o.required?(n.openBlock(),n.createElementBlock("span",Sk,"*")):n.createCommentVNode("",!0)],8,_k)):n.createCommentVNode("",!0),n.createElementVNode("div",Ak,[C.value&&!d.value?(n.openBlock(),n.createElementBlock("div",Vk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(C.value),{size:18}))])):n.createCommentVNode("",!0),n.withDirectives(n.createElementVNode("input",{id:c.value,"onUpdate:modelValue":H[0]||(H[0]=J=>w.value=J),readonly:E.value,disabled:o.disabled,placeholder:o.placeholder,class:n.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 pr-10 outline-none box-border truncate",[C.value&&!d.value?"pl-10":"pl-4",E.value?"cursor-pointer select-none":""]]),onClick:D,onFocus:D,onInput:T,onKeydown:X},null,42,Dk),[[n.vModelText,w.value]]),n.createElementVNode("div",Mk,[o.clearable&&u.value?(n.openBlock(),n.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:H[1]||(H[1]=n.withModifiers(()=>{},["prevent"])),onClick:R,title:"Clear"},[n.createVNode(n.unref(ae.X),{class:"h-4 w-4"})],32)):(n.openBlock(),n.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:H[2]||(H[2]=n.withModifiers(()=>{},["prevent"])),onClick:V,title:"Open"},[n.createVNode(n.unref(ae.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(n.openBlock(),n.createElementBlock("div",Nk,[n.createElementVNode("div",{class:"p-2 overflow-auto",style:n.normalizeStyle({maxHeight:o.maxHeight}),onScroll:Q},[g.value?(n.openBlock(),n.createElementBlock("div",vk,[n.createVNode(n.unref(ae.Loader2),{class:"h-4 w-4 animate-spin"}),H[3]||(H[3]=n.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&_.value.length===0?(n.openBlock(),n.createElementBlock("div",Pk," Icon tidak ditemukan ")):(n.openBlock(),n.createElementBlock("div",{key:2,class:n.normalizeClass(["grid gap-2",b.value])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(x.value,J=>(n.openBlock(),n.createElementBlock("button",{key:J,type:"button",class:n.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===J?"ring-1 ring-primary":""]),onClick:v=>Y(J),title:J},[n.createElementVNode("div",Ok,[n.createElementVNode("div",zk,[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(r)[J]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),n.createElementVNode("span",Fk,n.toDisplayString(J),1)])],10,Tk))),128))],2)),m.value&&_.value.length>0?(n.openBlock(),n.createElementBlock("div",Rk," Showing "+n.toDisplayString(x.value.length)+" / "+n.toDisplayString(_.value.length),1)):n.createCommentVNode("",!0)],36)])):n.createCommentVNode("",!0)])],512))}}),Ik={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Lk={class:"flex items-center justify-between border-b dark:border-neutral-800 px-6 py-4"},$k={class:"relative overflow-auto p-0"},bs=n.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:C=>a("update:modelValue",C)}),s=n.ref(null),i=n.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 h(C,w,E,_,x){const b=await new Promise((M,V)=>{const N=URL.createObjectURL(C),T=new Image;T.onload=()=>{URL.revokeObjectURL(N),M(T)},T.onerror=Y=>{URL.revokeObjectURL(N),V(Y)},T.src=N}),A=document.createElement("canvas");A.width=w,A.height=E;const D=A.getContext("2d");return D?(D.drawImage(b,0,0,w,E),await new Promise(M=>{A.toBlob(V=>M(V||C),_,x)})):C}function m(){if(!l||!i.value)return;const C=l.getPlugin("Dashboard"),w=l.getFile(i.value);!C||!w||requestAnimationFrame(()=>{try{C.openFileEditor(w)}catch{try{C.openFileEditor(i.value)}catch{}}})}async function g(C){if(l){l.cancelAll(),i.value=null;try{const w=l.addFile({name:C.name,type:C.type,data:C,source:"Local",isRemote:!1});i.value=String(w)}catch{}}}function y(){if(!s.value)return;l&&f(),l=new tu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const C=document.documentElement.classList.contains("dark");l.use(Rs,{target:s.value,inline:!0,height:480,theme:C?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const w=document.documentElement.classList.contains("dark"),E=l.getPlugin("Dashboard");E&&E.setOptions({theme:w?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(nu,{target:Rs,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",w=>{i.value=(w==null?void 0:w.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async w=>{const E=++d;try{const _=w.data,x=_.type||w.type||"image/jpeg";let b=_;if(o.outputWidth&&o.outputHeight&&(b=await h(_,o.outputWidth,o.outputHeight,x,o.quality)),c||E!==d)return;const A=w.name||"edited-image.jpg",D=new File([b],A,{type:x});await k(D,"UPPY_EDITOR_COMPLETE"),a("done",D),r.value=!1}catch{}})}async function k(C,w="CROP_RESULT"){const E=URL.createObjectURL(C);try{const _=await new Promise((x,b)=>{const A=new Image;A.onload=()=>x(A),A.onerror=b,A.src=E});console.group(w),console.log("file:",C),console.table({name:C.name,type:C.type,sizeBytes:C.size,sizeMB:+(C.size/1024/1024).toFixed(3),width:_.naturalWidth,height:_.naturalHeight,ratio:+(_.naturalWidth/_.naturalHeight).toFixed(4)}),console.log("previewUrl:",E),console.groupEnd()}finally{URL.revokeObjectURL(E)}}n.watch(r,async C=>{c=!C,d++,C?(await n.nextTick(),y(),o.file&&await g(o.file)):f()},{flush:"post"}),n.watch(()=>o.file,async C=>{r.value&&C&&(await n.nextTick(),await g(C))}),n.onBeforeUnmount(()=>{c=!0,d++,f()});const p=C=>{C.key==="Escape"&&r.value&&(r.value=!1)};n.watch(r,C=>{C?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const B=n.ref(!1);return(C,w)=>r.value?(n.openBlock(),n.createElementBlock("div",Ik,[n.createVNode(n.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:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:w[0]||(w[0]=E=>r.value=!1)})):n.createCommentVNode("",!0)]),_:1}),n.createVNode(n.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:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-800 bg-background dark:bg-neutral-900 shadow-2xl transition-all",onClick:w[4]||(w[4]=n.withModifiers(()=>{},["stop"]))},[n.createElementVNode("div",Lk,[w[6]||(w[6]=n.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),n.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:n.normalizeStyle({opacity:B.value?1:.7}),onClick:w[1]||(w[1]=E=>r.value=!1),onMouseenter:w[2]||(w[2]=E=>B.value=!0),onMouseleave:w[3]||(w[3]=E=>B.value=!1)},[n.createVNode(n.unref(ae.X),{class:"h-4 w-4"}),w[5]||(w[5]=n.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),n.createElementVNode("div",$k,[n.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):n.createCommentVNode("",!0)]),_:1})])):n.createCommentVNode("",!0)}}),Wk={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},jk=["src"],Uk=["disabled"],Hk=["disabled"],qk={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Gk={class:"flex gap-2"},Xk={class:"font-medium truncate"},Yk={class:"flex gap-2"},Kk={class:"font-medium"},Jk={class:"flex gap-2"},Qk={class:"font-medium truncate"},ys=ht(n.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(e,{emit:t}){const o=e,a=t,r=n.ref(null);n.watch(()=>o.file,h=>{r.value&&URL.revokeObjectURL(r.value),r.value=h?URL.createObjectURL(h):null},{immediate:!0}),n.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value),d&&d.disconnect()});function s(h){const m=h/1024,g=m/1024;return g>=1?`${g.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=n.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=n.ref(!1),c=n.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.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=n.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(h,m)=>e.file?(n.openBlock(),n.createBlock(us,{key:0,class:n.normalizeClass([e.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-900 dark:border-neutral-800"])},{default:n.withCtx(()=>[n.createVNode(hs,{class:"pb-2"},{default:n.withCtx(()=>[n.createVNode(ms,{class:"text-sm font-semibold dark:text-neutral-100"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.title),1)]),_:1}),e.description?(n.openBlock(),n.createElementBlock("div",Wk,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),_:1}),n.createVNode(fs,{class:"pt-2"},{default:n.withCtx(()=>{var g,y,k;return[n.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-800/50 border-border dark:border-neutral-700 w-full",style:n.normalizeStyle([{height:`${e.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=p=>l.value=!0),onMouseleave:m[3]||(m[3]=p=>l.value=!1)},[r.value?(n.openBlock(),n.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,jk)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"d-action-buttons",style:n.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[e.showEdit?(n.openBlock(),n.createElementBlock("button",{key:0,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[0]||(m[0]=p=>a("edit"))},[n.createVNode(n.unref(ae.Pencil),{style:{width:"16px",height:"16px"}})],12,Uk)):n.createCommentVNode("",!0),e.showRemove?(n.openBlock(),n.createElementBlock("button",{key:1,disabled:e.disabled,class:"d-action-btn shadow-md",style:n.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:e.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[1]||(m[1]=p=>a("remove"))},[n.createVNode(n.unref(ae.Trash2),{style:{width:"16px",height:"16px"}})],12,Hk)):n.createCommentVNode("",!0)],4),n.createElementVNode("div",{class:"d-metadata-overlay",style:n.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"})},[n.createElementVNode("div",qk,[n.createElementVNode("div",Gk,[m[4]||(m[4]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),n.createElementVNode("span",Xk,n.toDisplayString((g=i.value)==null?void 0:g.name),1)]),n.createElementVNode("div",Yk,[m[5]||(m[5]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),n.createElementVNode("span",Kk,n.toDisplayString((y=i.value)==null?void 0:y.size),1)]),n.createElementVNode("div",Jk,[m[6]||(m[6]=n.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),n.createElementVNode("span",Qk,n.toDisplayString((k=i.value)==null?void 0:k.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-72c623f7"]]),Zk={class:"space-y-3"},Va=n.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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:R=>a("update:modelValue",R)}),s=n.ref(!1),i=n.ref(null),l=n.ref(null),c=n.ref(null);function d(R){c.value=R,a("error",R)}function u(){c.value=null}const f=n.computed(()=>{const R=(o.allowedTypes??"").trim();return R?R.split(/[,\s;]+/g).map($=>$.trim().toLowerCase()).filter(Boolean).map($=>$.includes("/")||$.startsWith(".")?$:`.${$}`):[]});function h(R){const X=R.lastIndexOf(".");return X>=0?R.slice(X).toLowerCase():""}const m=n.computed(()=>{if(f.value.length){const R=f.value.filter($=>$.startsWith("."));return[...f.value.filter($=>$.includes("/")),...R].join(",")}return o.accept||"image/*"}),g=n.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function y(R){if(f.value.length){const $=(R.type||"").toLowerCase(),Q=h(R.name);return f.value.some(L=>L.includes("/")?$===L:L.startsWith(".")?Q===L:Q===`.${L}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(R.type||"").toLowerCase().startsWith("image/"):!0}function k(R){return R*1024*1024}async function p(R){var X;return(X=R.type)!=null&&X.startsWith("image/")?await new Promise($=>{const Q=URL.createObjectURL(R),L=new Image;L.onload=()=>{URL.revokeObjectURL(Q),$({w:L.naturalWidth,h:L.naturalHeight})},L.onerror=()=>{URL.revokeObjectURL(Q),$(null)},L.src=Q}):null}async function B(R){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const $=await p(R);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 C(R){return R?y(R)?o.minSizeMb!=null&&R.size<k(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&R.size>k(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await B(R):`only Allowed: ${g.value}`:"File tidak valid"}function w(R){o.disabled||(i.value=R,s.value=!0)}async function E(R){if(o.disabled)return;u();const X=await C(R);if(X){d(X);return}l.value=R,w(R)}const{DCodeApi:_}=Xe(),x=gs(),b=n.ref(!1);n.ref(null);function A(R,X){return!R||!X?null:R.replace(/\/+$/,"")+"/"+X.replace(/^\/+/,"")}function D(R){var L;const X=(R==null?void 0:R.data)??R,$=(L=X==null?void 0:X.data)==null?void 0:L[0];if(!$)return null;const Q=A($.server,$.url);return{...$,fullUrl:Q?encodeURI(Q):null}}async function M(R){var X;if(o.uploadFn){try{b.value=!0;const $=await o.uploadFn(R);r.value=R,a("uploaded",$)}catch($){console.error("Upload Error",$),x.error("Upload Failed",($==null?void 0:$.message)||"Unknown error"),d(($==null?void 0:$.message)||"Upload Failed")}finally{b.value=!1}return}if(!((X=o.endpoint)!=null&&X.apiUrl)){r.value=R;return}if(typeof _!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const $=new FormData;$.append("doc",R);const Q=(o.endpoint.apiMethod||"POST").toUpperCase(),L=o.endpoint.apiUrl,H=await _("","",$,{_url:L,_method:Q,withCredentials:!0,transformRequest:[(v,O)=>(O&&(delete O["Content-Type"],delete O["content-type"]),v)]}),J=(H==null?void 0:H.data)??H;D(J),r.value=R,a("uploaded",J)}catch($){console.error("Upload Error",$),x.error("Upload Failed",($==null?void 0:$.message)||"Unknown error"),d(($==null?void 0:$.message)||"Upload Failed")}finally{b.value=!1}}async function V(R){var X;u(),o.uploadFn||(X=o.endpoint)!=null&&X.apiUrl?await M(R):r.value=R,s.value=!1,i.value=null}function N(){s.value=!1,i.value=null}async function T(){if(!r.value)return;u();const R=o.editUseOriginal?l.value??r.value:r.value,X=await C(R);if(X){d(X);return}w(R)}function Y(){u(),r.value=null,i.value=null,s.value=!1,l.value=null}return n.watch(()=>o.modelValue,R=>{R&&!l.value&&(l.value=R),R||(l.value=null)},{immediate:!0}),(R,X)=>(n.openBlock(),n.createElementBlock("div",Zk,[r.value?(n.openBlock(),n.createBlock(ys,{key:1,file:r.value,title:e.label,description:e.description,"preview-width":e.previewWidth,disabled:e.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:T,onRemove:Y,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(n.openBlock(),n.createBlock(Aa,{key:0,label:e.label,hint:e.hint,accept:m.value,maxSizeMb:e.maxSizeMb,disabled:e.disabled,onPicked:E,error:c.value,onError:X[0]||(X[0]=$=>d($))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),n.createVNode(bs,{modelValue:s.value,"onUpdate:modelValue":X[1]||(X[1]=$=>s.value=$),file:i.value,title:e.title,description:e.description,"auto-open-editor":e.autoOpenEditor,"aspect-ratio":e.aspectRatio,"output-width":e.outputWidth,"output-height":e.outputHeight,quality:e.quality,onDone:V,onCancel:N},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),Hn=n.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(e){const t=n.useAttrs(),o=e,a=n.computed(()=>o.icon&&kt[o.icon]||null),r=n.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=n.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=n.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=n.computed(()=>{const u=`${r.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=t.class??"";return[u,f].filter(Boolean).join(" ")}),d=n.computed(()=>{const{class:u,...f}=t;return f});return(u,f)=>(n.openBlock(),n.createElementBlock("span",n.mergeProps({class:c.value},d.value),[a.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(a.value),{key:0,class:n.normalizeClass(["shrink-0",i.value,e.iconClass])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.label||e.text),1)],16))}}),ew=["aria-busy"],tw={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},nw=["for"],ow={key:0,class:"ml-1 text-destructive"},aw=["id","disabled"],rw={class:"min-w-0 flex-1 text-left"},sw={key:0,class:"flex flex-wrap gap-1.5"},iw={class:"max-w-[220px] truncate"},lw=["onClick"],cw={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"},dw={key:1,class:"text-muted-foreground truncate"},uw={class:"flex items-center gap-2 shrink-0"},fw={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},hw=["placeholder","onKeydown"],mw={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},pw=["disabled","onClick"],gw={class:"truncate"},bw={key:0,class:"text-primary-600 dark:text-primary-400"},yw={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},xw={key:0},kw={key:1},ww={key:1,class:"text-xs text-destructive"},xs=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>(r.label||o.label)??void 0),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{if(r.required)return!0;const te=o.required,re=o["aria-required"];return te===""||te===!0||te==="true"||(re==="true"||re===!0)}),u=n.computed(()=>!!r.error);function f(te){return te?typeof r.itemTitle=="function"?r.itemTitle(te)??"":String((te==null?void 0:te[r.itemTitle])??""):""}function h(te){return te?typeof r.itemValue=="function"?r.itemValue(te):te==null?void 0:te[r.itemValue]:null}function m(te,re){return h(te)??re}const g=n.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),y=n.computed(()=>{var te;return!!((te=r.endpoint)!=null&&te.apiUrl)||!!r.fetchItems}),k=n.ref([]),p=n.ref(!1),B=n.ref(!1),C=n.computed(()=>{var re;const te=(re=r.endpoint)==null?void 0:re.apiOptions;if(te)return typeof te=="function"?te():te}),w=n.computed(()=>{var ke,je;const te=((ke=r.endpoint)==null?void 0:ke.apiUrl)??"",re=(((je=r.endpoint)==null?void 0:je.apiMethod)??"GET").toUpperCase(),ce=JSON.stringify(C.value??null);return`${re} ${te} :: ${ce}`}),E=n.computed(()=>y.value?k.value:r.items||[]);async function _(){var te;if(y.value&&!(!((te=r.endpoint)!=null&&te.apiUrl)&&!r.fetchItems)&&!p.value){p.value=!0;try{let re;if(r.fetchItems){const ce=await r.fetchItems(),ke=(ce==null?void 0:ce.data)??ce;re=(ke==null?void 0:ke.data)??ke}else{const{DCodeApi:ce}=Xe();if(typeof ce!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const ke={page:1,perPage:100,...C.value||{}},je=await ce("","",ke,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),Tt=(je==null?void 0:je.data)??je;re=(Tt==null?void 0:Tt.data)??Tt}k.value=Array.isArray(re)?re:[],B.value=!0}catch(re){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",re),k.value=[]}finally{p.value=!1}}}n.watch(()=>w.value,()=>{k.value=[],B.value=!1}),n.onMounted(()=>{r.autoFetchOnMount&&y.value&&_()});const x=n.computed(()=>{const te=g.value;if(r.returnObject)return te;const re=new Map;for(const ce of E.value)re.set(h(ce),ce);return te.map(ce=>re.get(ce)??{[r.itemValue]:ce,[r.itemTitle]:String(ce)})}),b=n.computed(()=>r.maxChips===null?x.value:x.value.slice(0,r.maxChips));function A(te){const re=g.value;if(r.returnObject){const ce=h(te);return re.some(ke=>h(ke)===ce)}return re.includes(h(te))}const D=n.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const te=Number(r.maxSelected);return Number.isFinite(te)&&te>0?te:null}),M=n.computed(()=>{const te=D.value;return te===null?!1:g.value.length>=te});function V(te){return!A(te)&&M.value}const N=n.computed(()=>{const te=g.value,re=new Set;if(r.returnObject)for(const ce of te)re.add(h(ce));else for(const ce of te)re.add(ce);return re}),T=n.computed(()=>{const te=N.value;return(E.value||[]).filter(re=>!te.has(h(re)))}),Y=n.computed(()=>E.value.length===0?!1:T.value.length===0),R=n.ref(null),X=n.ref(null),$=n.ref(null),Q=n.ref(!1),L=n.ref(""),H=n.ref(0),J=n.ref(0),{floatingStyles:v}=hr(R,X,{whileElementsMounted:lr,placement:"bottom-start",middleware:[cr(8),ur(),dr({padding:8}),fr({apply({rects:te,elements:re}){Object.assign(re.floating.style,{width:`${te.reference.width}px`,"--floating-width":`${te.reference.width}px`})}})]}),O=n.computed(()=>v.value),W=n.computed(()=>{const te=Number(r.maxRows);return Number.isFinite(te)&&te>0?te:5});async function q(){r.disabled||(Q.value=!0,J.value=0,requestAnimationFrame(()=>{$.value&&($.value.scrollTop=0),H.value=0}),y.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!B.value)&&!p.value&&await _())}function ne(){Q.value=!1}function se(){Q.value?ne():q()}function ie(te){var ce,ke;if(!Q.value)return;const re=te.target;(ce=R.value)!=null&&ce.contains(re)||(ke=X.value)!=null&&ke.contains(re)||ne()}n.onMounted(()=>document.addEventListener("mousedown",ie)),n.onBeforeUnmount(()=>document.removeEventListener("mousedown",ie));function z(te){if(r.disabled)return;if(V(te)){a("max");return}const re=[...g.value];if(r.returnObject){const ce=h(te);if(re.some(je=>h(je)===ce))return;a("update:modelValue",[...re,te])}else{const ce=h(te);if(re.includes(ce))return;a("update:modelValue",[...re,ce])}L.value="",J.value=0,requestAnimationFrame(()=>{$.value&&($.value.scrollTop=0),H.value=0})}function P(te){if(r.disabled)return;const re=[...g.value];if(r.returnObject){const ce=h(te);a("update:modelValue",re.filter(ke=>h(ke)!==ce))}else{const ce=h(te);a("update:modelValue",re.filter(ke=>ke!==ce))}}function U(){r.disabled||(a("update:modelValue",[]),a("clear"),ne())}const K=n.computed(()=>{const te=L.value.trim().toLowerCase(),re=T.value;return te?re.filter(ce=>f(ce).toLowerCase().includes(te)):re}),oe=n.computed(()=>K.value.length);n.watch(Q,te=>{te||(L.value="")});const xe=n.computed(()=>{if(Y.value)return r.itemHeight;const te=oe.value;return(te<=0?1:Math.min(te,W.value))*r.itemHeight}),Ee=n.computed(()=>r.virtual?oe.value*r.itemHeight:0),ge=n.computed(()=>r.virtual?Math.ceil(xe.value/r.itemHeight)+r.overscan:oe.value),fe=n.computed(()=>{if(!r.virtual)return 0;const te=Math.floor(H.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,te)}),Me=n.computed(()=>r.virtual?Math.min(oe.value,fe.value+ge.value):oe.value),qe=n.computed(()=>r.virtual?fe.value*r.itemHeight:0),Ze=n.computed(()=>{const te=K.value;return r.virtual?te.slice(fe.value,Me.value):te});function nt(te){const re=te.target;H.value=re.scrollTop}function Ke(te){return te===J.value}function G(te){const re=$.value;if(!re||!r.virtual)return;const ce=te*r.itemHeight,ke=ce+r.itemHeight,je=re.scrollTop,Tt=re.scrollTop+re.clientHeight;ce<je?re.scrollTop=ce:ke>Tt&&(re.scrollTop=ke-re.clientHeight)}function le(te){const re=Math.max(0,oe.value-1);J.value=Math.min(re,Math.max(0,J.value+te)),G(J.value)}function ye(){const te=K.value[J.value];te&&z(te)}const ze=n.computed(()=>r.clearable&&!r.disabled&&x.value.length>0),De=n.computed(()=>u.value?"border-destructive ring-1 ring-destructive":Q.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(te,re)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",tw)):n.createCommentVNode("",!0),re[3]||(re[3]=n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",ow,"*")):n.createCommentVNode("",!0)],8,nw)):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"referenceEl",ref:R,class:"relative"},[n.createElementVNode("button",{id:c.value,type:"button",class:n.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-900 border-gray-300 dark:border-gray-700 text-foreground dark:text-gray-300",De.value]]),disabled:r.disabled,onClick:se},[n.createElementVNode("div",rw,[x.value.length?(n.openBlock(),n.createElementBlock("div",sw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(b.value,(ce,ke)=>(n.openBlock(),n.createElementBlock("div",{key:`chip-${m(ce,ke)}`,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"},[n.createElementVNode("span",iw,n.toDisplayString(f(ce)),1),r.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:n.withModifiers(je=>P(ce),["stop"]),"aria-label":"Remove"}," ✕ ",8,lw))]))),128)),r.maxChips!==null&&x.value.length>r.maxChips?(n.openBlock(),n.createElementBlock("div",cw," +"+n.toDisplayString(x.value.length-(r.maxChips??0)),1)):n.createCommentVNode("",!0)])):(n.openBlock(),n.createElementBlock("div",dw,n.toDisplayString(r.placeholder),1))]),n.createElementVNode("div",uw,[ze.value?(n.openBlock(),n.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:n.withModifiers(U,["stop"]),"aria-label":"Clear"}," ✕ ")):n.createCommentVNode("",!0),n.createVNode(n.unref(ae.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,aw),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[Q.value?(n.openBlock(),n.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:X,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-900 border-gray-200 dark:border-gray-800",style:n.normalizeStyle(O.value)},[r.searchable&&!Y.value?(n.openBlock(),n.createElementBlock("div",fw,[n.withDirectives(n.createElementVNode("input",{"onUpdate:modelValue":re[0]||(re[0]=ce=>L.value=ce),placeholder:r.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-900 border border-gray-200 dark:border-gray-800 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[re[1]||(re[1]=n.withKeys(n.withModifiers(ce=>le(1),["prevent"]),["down"])),re[2]||(re[2]=n.withKeys(n.withModifiers(ce=>le(-1),["prevent"]),["up"])),n.withKeys(n.withModifiers(ye,["prevent"]),["enter"]),n.withKeys(n.withModifiers(ne,["prevent"]),["esc"])]},null,40,hw),[[n.vModelText,L.value]])])):n.createCommentVNode("",!0),n.createElementVNode("div",{ref_key:"listEl",ref:$,class:"relative overflow-auto",style:n.normalizeStyle({height:xe.value+"px"}),onScroll:nt},[Y.value?(n.openBlock(),n.createElementBlock("div",mw," All items have been selected ")):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[r.virtual?(n.openBlock(),n.createElementBlock("div",{key:0,style:n.normalizeStyle({height:Ee.value+"px"})},null,4)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:n.normalizeStyle(r.virtual?{transform:`translateY(${qe.value}px)`}:void 0)},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ze.value,(ce,ke)=>(n.openBlock(),n.createElementBlock("button",{key:String(m(ce,fe.value+ke)),type:"button",class:n.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[V(ce)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",Ke(fe.value+ke)?"bg-neutral-50 dark:bg-neutral-800/60":"",A(ce)?"font-semibold":"font-normal"]]),style:n.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||V(ce),onClick:je=>z(ce)},[n.createElementVNode("span",gw,n.toDisplayString(f(ce)),1),A(ce)?(n.openBlock(),n.createElementBlock("span",bw,"✓")):n.createCommentVNode("",!0)],14,pw))),128))],6),oe.value===0?(n.openBlock(),n.createElementBlock("div",yw,[p.value?(n.openBlock(),n.createElementBlock("span",xw,"Loading data…")):(n.openBlock(),n.createElementBlock("span",kw,"Tidak ada data"))])):n.createCommentVNode("",!0)],64))],36)],4)):n.createCommentVNode("",!0)]))],512),u.value?(n.openBlock(),n.createElementBlock("p",ww,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,ew)),[[n.vShow,i.value]])}}),Cw={class:"space-y-4"},Bw={key:0,class:"flex flex-col gap-0.5"},Ew=["for"],_w=["for"],Sw={class:"text-[11px] text-gray-500 dark:text-gray-400"},Aw={class:"flex items-center gap-2 flex-nowrap"},Vw=["id","value","disabled","onKeydown","onInput","onPaste"],Da=n.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(e,{emit:t}){const o=n.useAttrs(),a=Math.random().toString(36).slice(2,7),r=n.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${a}`),s=e,i=t,l=n.ref([]),c=n.ref([]),d=n.ref(!1),{DCodeApi:u}=Xe(),f=gs(),h=n.computed(()=>{const _=Number(s.totalInput);return _&&_>0?_:6}),m=()=>{c.value=Array.from({length:h.value},(_,x)=>{var b;return((b=s.default)==null?void 0:b[x])??""}),i("updateOtp",c.value.join(""))};m(),n.watch(()=>[s.totalInput,s.default],()=>m());const g=_=>{_<0||_>=h.value||n.nextTick(()=>{var x;return(x=l.value[_])==null?void 0:x.focus()})},y=_=>_.match(/[a-zA-Z0-9]/)?_.match(/[a-zA-Z0-9]/)[0]:"";async function k(_){var x;if(i("complete",_),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(_);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((x=s.endpoint)!=null&&x.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(),A=s.endpoint.apiUrl,D=await u("","",{otp:_},{_url:A,_method:b,withCredentials:!0}),M=(D==null?void 0:D.data)??D;i("success",M)}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=(_,x)=>{c.value[_]=y(x);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===h.value&&k(b)},B=(_,x)=>{const b=_.key,A=/^\d$/.test(b),D=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(_.preventDefault(),c.value[x]){p(x,"");return}x>0&&(p(x-1,""),g(x-1));return}if(b==="ArrowLeft"){_.preventDefault(),g(x-1);return}if(b==="ArrowRight"){_.preventDefault(),g(x+1);return}if(A||D){_.preventDefault(),p(x,b),x<h.value-1&&g(x+1);return}b.length===1&&_.preventDefault()},C=(_,x)=>{const b=_.target,A=b.value??"",D=y(A);b.value=D,p(x,D),D&&x<h.value-1&&g(x+1)},w=(_,x)=>{var V;_.preventDefault();const A=(((V=_.clipboardData)==null?void 0:V.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!A)return;let D=x;for(const N of A){if(D>=h.value)break;c.value[D]=N,D++}const M=c.value.join("");i("updateOtp",M),i("update:modelValue",M),M.length===h.value&&k(M),g(Math.min(D,h.value-1))},E=_=>x=>{l.value[_]=(x==null?void 0:x.$el)??x};return(_,x)=>(n.openBlock(),n.createElementBlock("div",Cw,[s.label||h.value?(n.openBlock(),n.createElementBlock("div",Bw,[s.label?(n.openBlock(),n.createElementBlock("label",{key:0,for:r.value,class:"text-sm font-medium text-foreground"},n.toDisplayString(s.label),9,Ew)):(n.openBlock(),n.createElementBlock("label",{key:1,for:r.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,_w)),n.createElementVNode("p",Sw," Ketik "+n.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):n.createCommentVNode("",!0),n.createElementVNode("div",Aw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(h.value,b=>(n.openBlock(),n.createElementBlock("input",{key:b,id:b===1?r.value:void 0,ref_for:!0,ref:E(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:n.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-900 text-foreground dark:text-gray-300":"border-gray-300 dark:border-gray-700 bg-white dark:bg-neutral-900 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:A=>B(A,b-1),onInput:A=>C(A,b-1),onPaste:A=>w(A,b-1)},null,42,Vw))),128))])]))}}),Dw={class:"w-full"},Mw={key:0,class:"flex items-center justify-between mb-2"},Nw={key:0,class:"text-sm font-medium text-gray-700"},vw={key:1,class:"text-sm text-gray-600"},Pw={name:"DCodeProgress"},bd=n.defineComponent({...Pw,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=n.computed(()=>Math.min(o.modelValue/o.max*100,100)),r=n.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=n.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=n.computed(()=>`${Math.round(a.value)}%`);return(l,c)=>(n.openBlock(),n.createElementBlock("div",Dw,[e.label||e.showValue?(n.openBlock(),n.createElementBlock("div",Mw,[e.label?(n.openBlock(),n.createElementBlock("span",Nw,n.toDisplayString(e.label),1)):n.createCommentVNode("",!0),e.showValue?(n.openBlock(),n.createElementBlock("span",vw,n.toDisplayString(i.value),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(r.value)},[n.createElementVNode("div",{class:n.normalizeClass(s.value),style:n.normalizeStyle({width:`${a.value}%`})},null,6)],2)]))}}),Tw={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},yd=ht(n.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(e){return(t,o)=>(n.openBlock(),n.createBlock(n.Transition,{name:"fade"},{default:n.withCtx(()=>[e.isApiLoading?(n.openBlock(),n.createElementBlock("div",Tw,[n.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:n.normalizeStyle({width:`${e.apiProgress}%`})},null,4)])):n.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),Ow={class:"grid gap-3"},zw={key:0,class:"ml-1 text-destructive"},Fw={class:"flex flex-col"},Rw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},Iw={class:"relative flex-shrink-0 mt-0.5"},Lw=["id","name","value","checked","disabled","required","onChange"],$w=["onClick"],Ww=["for"],jw={key:0,class:"ml-1 text-red-500"},Uw={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},ks=n.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(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Xe(),a=t,r=e,s=n.ref([]),i=n.ref(!1),l=n.ref(null),c=async()=>{var w,E;const C=((w=r.endpoint)==null?void 0:w.apiUrl)||r.apiUrl;if(C){i.value=!0,l.value=null;try{const _={page:1,perPage:100},x=((E=r.endpoint)==null?void 0:E.apiMethod)||r.apiMethod,b=await o(C,x,_);let A=b;r.dataPath?A=r.dataPath.split(".").reduce((M,V)=>M&&M[V]!=="undefined"?M[V]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(A=b.data),Array.isArray(A)?s.value=A:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(_){console.error("DCodeRadio fetch error:",_),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};n.onMounted(()=>{var C;((C=r.endpoint)!=null&&C.apiUrl||r.apiUrl)&&c()});const d=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(s.value.length>0)return s.value;const C=r.itemValue||r.model||"id",w=r.itemTitle||(r.label===""?"name":r.label);return w&&r.label!==""?[{[C]:C,[w]:w}]:[]}),u=C=>{if(typeof C!="object")return C;const w=r.itemValue||r.model||"id";return C[w]},f=C=>{if(typeof C!="object")return String(C);const w=r.itemTitle||"name";return C[w]},h=n.computed(()=>r.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=n.computed(()=>!!r.error||!!l.value),g=n.computed(()=>r.error||l.value),y=C=>C==null?r.modelValue===C:String(r.modelValue)===String(C),k=n.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[r.size]),p=(C,w)=>{w.target.checked&&(a("update:modelValue",C),a("change",C))},B=C=>{!r.disabled&&!y(C)&&(a("update:modelValue",C),a("change",C))};return(C,w)=>(n.openBlock(),n.createElementBlock("div",Ow,[e.label?(n.openBlock(),n.createBlock(So,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",zw,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Fw,[i.value?(n.openBlock(),n.createElementBlock("div",Rw,[n.createVNode(n.unref(ae.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["flex",e.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,(E,_)=>(n.openBlock(),n.createElementBlock("div",{key:_,class:n.normalizeClass(["flex items-start",k.value.container,e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[n.createElementVNode("div",Iw,[n.createElementVNode("input",{id:e.id?`${e.id}-${_}`:`${h.value}-${_}`,name:h.value,type:"radio",value:u(E),checked:y(u(E)),disabled:e.disabled,required:e.required&&_===0,onChange:x=>p(u(E),x),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,Lw)]),n.createElementVNode("div",{class:"flex-1 min-w-0",onClick:x=>B(u(E))},[n.createElementVNode("label",{for:e.id?`${e.id}-${_}`:`${h.value}-${_}`,class:n.normalizeClass([k.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",e.disabled?"cursor-not-allowed opacity-50":""])},[n.createTextVNode(n.toDisplayString(f(E))+" ",1),e.required&&d.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",jw,"*")):n.createCommentVNode("",!0)],10,Ww)],8,$w)],2))),128))],2),m.value&&g.value?(n.openBlock(),n.createElementBlock("div",Uw,[n.createVNode(n.unref(ae.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(g.value),1)])):n.createCommentVNode("",!0)])]))}}),Hw={class:"grid gap-3"},qw={key:0,class:"ml-1 text-destructive"},Gw={class:"flex flex-col"},Xw={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},Yw=["onClick"],Kw=["id","name","value","checked","disabled","required","onChange"],Jw={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},Qw=["for"],Zw={key:0,class:"ml-1 text-red-500"},e1={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},ws=n.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(e,{emit:t}){n.useAttrs();const{apiUrl:o}=Xe(),a=t,r=e,s=n.ref(r.modelValue??void 0);n.watch(()=>r.modelValue,A=>{s.value=A},{immediate:!0});const i=n.ref([]),l=n.ref(!1),c=n.ref(null),d=async()=>{var D,M;const A=((D=r.endpoint)==null?void 0:D.apiUrl)||r.apiUrl;if(A){l.value=!0,c.value=null;try{const V={page:1,perPage:100},N=((M=r.endpoint)==null?void 0:M.apiMethod)||r.apiMethod,T=await o(A,N,V);let Y=T;r.dataPath?Y=r.dataPath.split(".").reduce((X,$)=>X&&X[$]!=="undefined"?X[$]:void 0,T):typeof T=="object"&&!Array.isArray(T)&&T.data&&(Y=T.data),Array.isArray(Y)?i.value=Y:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(V){console.error("DCodeRadioCustom fetch error:",V),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=n.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};n.onMounted(()=>{var A;((A=r.endpoint)!=null&&A.apiUrl||r.apiUrl)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),n.onBeforeUnmount(()=>{f&&f.disconnect()});const m=n.computed(()=>{if(r.options&&r.options.length>0)return r.options;if(i.value.length>0)return i.value;const A=r.itemValue||r.model||"id",D=r.itemTitle||(r.label===""?"name":r.label);return D&&r.label!==""?[{[A]:A,[D]:D}]:[]}),g=A=>{if(typeof A!="object")return A;const D=r.itemValue||r.model||"id";return A[D]},y=A=>{if(typeof A!="object")return String(A);const D=r.itemTitle||"name";return A[D]},k=Math.random().toString(36).slice(2,7),p=n.computed(()=>r.id?`radio-custom-${r.id}`:`radio-custom-${r.model}-${k}`),B=n.computed(()=>!!r.error||!!c.value),C=n.computed(()=>r.error||c.value),w=A=>{const D=s.value;return A==null?D===A:String(D)===String(A)},E=n.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[r.size]),_=n.computed(()=>r.icon&&kt[r.icon]||null),x=(A,D)=>{D.target.checked&&(s.value=A,a("update:modelValue",A),a("change",A))},b=A=>{r.disabled||w(A)||(s.value=A,a("update:modelValue",A),a("change",A))};return(A,D)=>(n.openBlock(),n.createElementBlock("div",Hw,[e.label?(n.openBlock(),n.createBlock(So,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",qw,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",Gw,[l.value?(n.openBlock(),n.createElementBlock("div",Xw,[n.createVNode(n.unref(ae.Loader2),{class:"w-4 h-4 animate-spin"}),D[0]||(D[0]=n.createTextVNode(" Sedang memuat opsi... ",-1))])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["grid",e.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(m.value,(M,V)=>(n.openBlock(),n.createElementBlock("div",{key:V,class:n.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",w(g(M))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",e.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:N=>!e.disabled&&b(g(M))},[n.createElementVNode("input",{id:e.id?`${e.id}-${V}`:`${p.value}-${V}`,name:p.value,type:"radio",value:g(M),checked:w(g(M)),disabled:e.disabled,required:e.required&&V===0,onChange:N=>x(g(M),N),class:"sr-only",tabindex:"-1"},null,40,Kw),n.createElementVNode("div",{class:n.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",w(g(M))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[_.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(_.value),{key:0,class:"w-6 h-6"})):(n.openBlock(),n.createElementBlock("svg",Jw,[...D[1]||(D[1]=[n.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),n.createElementVNode("label",{for:e.id?`${e.id}-${V}`:`${p.value}-${V}`,class:n.normalizeClass([E.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",w(g(M))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",e.disabled?"cursor-not-allowed":"cursor-pointer"])},[n.createTextVNode(n.toDisplayString(y(M))+" ",1),e.required&&m.value.length===1&&e.label?(n.openBlock(),n.createElementBlock("span",Zw,"*")):n.createCommentVNode("",!0)],10,Qw)],10,Yw))),128))],2),B.value&&C.value?(n.openBlock(),n.createElementBlock("div",e1,[n.createVNode(n.unref(ae.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),n.createTextVNode(" "+n.toDisplayString(C.value),1)])):n.createCommentVNode("",!0)])]))}}),t1={key:0,class:"ml-1 text-destructive"},n1={class:"relative w-full"},o1={key:0,class:"mb-2 flex items-center justify-between"},a1={class:"text-sm text-muted-foreground"},r1={class:"text-sm font-medium text-foreground"},s1={class:"text-sm text-muted-foreground"},i1={class:"relative"},l1=["id","value","min","max","step","disabled","placeholder"],c1={key:1,class:"relative mt-2"},d1={class:"text-xs text-muted-foreground mt-1"},u1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},f1={name:"DCodeSlider"},Ma=n.defineComponent({...f1,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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.ref(),i=n.ref(!1),l=n.computed(()=>!!r.error),c=n.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=n.computed(()=>(r.label||o.label)??void 0),u=n.computed(()=>!0),f=n.computed(()=>{const E={sm:"h-2",md:"h-2.5",lg:"h-3"},_={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",E[r.size],_[r.color]||_.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=n.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"}[r.size],r.color==="blue"?"focus:ring-blue-500":r.color==="green"?"focus:ring-green-500":r.color==="red"?"focus:ring-red-500":r.color==="yellow"?"focus:ring-yellow-500":r.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=n.computed(()=>`${r.valuePrefix}${r.modelValue}${r.valueSuffix}`),g=n.computed(()=>{const E=r.max-r.min;return(r.modelValue-r.min)/E*100}),y=E=>{const _=E.target,x=parseFloat(_.value);a("update:modelValue",x),a("input",x)},k=E=>{const _=E.target,x=parseFloat(_.value);a("change",x)},p=()=>{i.value=!0},B=()=>{i.value=!1},C=E=>{const _=r.max-r.min;return(E-r.min)/_*100},w=n.computed(()=>{const E={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 Mk(t,n=Ad){e.watch(t,o=>Nk(o,n),{immediate:!0})}const vk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Pk=["for"],Tk={key:0,class:"ml-1 text-destructive"},Ok=["disabled","onClick"],Fk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},zk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Ik={class:"h-full p-2 flex flex-col gap-3 w-32"},Rk=["onClick"],Lk={class:"flex items-center justify-end gap-2 w-full p-2"},$k=["disabled","onClick"],jk={key:1,class:"text-xs text-destructive"},jr=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 v=o.required,P=o["aria-required"];return v===""||v===!0||v==="true"||P==="true"||P===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:v=>{a("update:modelValue",v),a("change",v)}}),u=e.computed(()=>r.locale==="en"?yd:Dk),f=e.computed(()=>r.range?2:!1),h=e.computed(()=>{if(!r.range)return!1;const v={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(v.maxRange=r.autoRangeDays,v.autoRange=r.autoRangeDays),v}),m=v=>{const P=new Date(v);return P.setHours(0,0,0,0),P},g=v=>{const P=new Date(v);return P.setHours(23,59,59,999),P},b=(v,P)=>{const H=new Date(v);return H.setDate(H.getDate()+P),H},x=e.computed(()=>{if(r.disablePast)return m(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return g(b(new Date,r.maxDaysAhead))}),E=e.ref(null),C=e.ref(null),w=v=>{C.value={month:v.month,year:v.year}},_=e.ref(!1);let B=null;e.onMounted(()=>{const v=document.documentElement,P=()=>_.value=v.classList.contains("dark");P(),B=new MutationObserver(P),B.observe(v,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{B==null||B.disconnect(),B=null}),Mk(e.toRef(r,"tone"));const k=v=>{const P=new Date(v),H=P.getDay(),$=P.getDate()-H+(H===0?-6:1);return P.setDate($),m(P)},y=v=>{const P=k(v);return P.setDate(P.getDate()+6),g(P)},V=v=>{const P=new Date(v);return P.setDate(1),m(P)},N=v=>{const P=new Date(v);return P.setMonth(P.getMonth()+1),P.setDate(0),g(P)},M=e.computed(()=>{if(!r.range)return[];const v=new Date,P=m(v),H=k(v),$=y(v),q=V(v),ee=N(v),G=(L,W)=>{let ae=L;r.disablePast&&ae<P&&(ae=P);let Z=W;if(r.autoRangeDays&&r.autoRangeDays>0){const J=g(b(ae,r.autoRangeDays-1));Z>J&&(Z=J)}return Z<ae&&(Z=g(new Date(ae))),[ae,Z]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:G(H,$)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:G(q,ee)}]}),D=async v=>{var W,ae;const P=r.modelType||"yyyy-MM-dd";if(v.length===0){d.value=null;return}if(v.length<2)return;const H=_d(v[0],P),$=_d(v[1],P);d.value=[H,$],await e.nextTick();const q=v[0],ee=q.getMonth(),G=q.getFullYear();C.value&&C.value.month===ee&&C.value.year===G||(W=E.value)==null||W.setMonthYear({month:ee,year:G}),(ae=E.value)==null||ae.openMenu()};return(v,P)=>(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",vk)):e.createCommentVNode("",!0),P[2]||(P[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",Tk,"*")):e.createCommentVNode("",!0)],8,Pk)):e.createCommentVNode("",!0),e.createVNode(e.unref(du.VueDatePicker),{ref_key:"dpRef",ref:E,modelValue:d.value,"onUpdate:modelValue":P[1]||(P[1]=H=>d.value=H),dark:_.value,range:h.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":x.value,"max-date":p.value,"preset-ranges":M.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:w},e.createSlots({"dp-input":e.withCtx(({value:H,onInput:$,onEnter:q,onTab:ee,onBlur:G,onFocus:L,onKeypress:W,onPaste:ae,toggleMenu:Z})=>[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:J=>Z()},[e.createVNode(e.unref(ce.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Ok),P[4]||(P[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",Fk,e.toDisplayString(t.prependInner),1),P[3]||(P[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:H,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:J=>Z(),onFocus:J=>L(),onBlur:J=>G(),onInput:J=>$(J),onKeydown:[e.withKeys(J=>q(J),["enter"]),e.withKeys(J=>ee(J),["tab"])],onKeypress:J=>W(J),onPaste:J=>ae()},null,42,zk)],2)]),"action-buttons":e.withCtx(({selectDate:H,selectionDisabled:$})=>[e.createElementVNode("div",Lk,[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:P[0]||(P[0]=q=>{var ee;return(ee=E.value)==null?void 0:ee.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:$,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:q=>H()},e.toDisplayString(t.selectLabel),9,$k)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",Ik,[M.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(M.value,H=>(e.openBlock(),e.createElementBlock("button",{key:H.label,type:"button",class:"w-full 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",onClick:$=>D(H.range)},e.toDisplayString(H.label),9,Rk))),128)):e.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",jk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),Wk=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=we.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(we.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Uk=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=Qe.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(we.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(we.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Pe)("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(we.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(ce.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),Hk=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Qe.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(Pe)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),qk=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Qe.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(Pe)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),Gk={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"},Xk={class:"flex items-center gap-3"},Kk={class:"flex flex-col"},Yk={key:0,class:"flex items-center gap-2"},Jk={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"},Qk={class:"flex justify-end gap-3 flex-wrap"},ao=wt(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?Tt[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(Wk),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(Uk),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",Gk,[e.createElementVNode("div",Xk,[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",Kk,[e.createVNode(e.unref(qk),{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(Hk),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",Yk,[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",Jk,[e.createElementVNode("div",Qk,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),so=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(()=>o.icon&&Tt[o.icon]||null),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))}}),Zk={class:"flex flex-col gap-3 w-full"},ew={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"},tw={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"},nw={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"},ow={class:"text-sm font-medium text-slate-500"},rw={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"},aw={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},sw=["onClick"],iw=["for","onDrop"],lw={class:"text-xs text-slate-500 dark:text-slate-400"},cw={key:2,class:"text-xs text-slate-400"},dw=["id","disabled","accept","onChange"],Es=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}=Vt.useI18n(),i=e.computed(()=>{const p=o.endpoint;if(!(p!=null&&p.apiUrl))return null;let E=p.apiUrl;if(!E.startsWith("http")&&o.baseUrl){const C=o.baseUrl.replace(/\/$/,""),w=E.startsWith("/")?E:`/${E}`;E=`${C}${w}`}return E}),l=e.computed(()=>{const p=c.value.length;return p<=1?"grid-cols-1":p===2?"grid-cols-1 md:grid-cols-2":p===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":p===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),h=async()=>{var p;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((p=o.endpointReference)!=null&&p.apiUrl)){f.value=!1;return}try{const{apiUrl:E}=ot(),C=await E(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let w=(C==null?void 0:C.data)||C;Array.isArray(w)||(w=[w]),c.value=w}catch(E){console.error("Failed to fetch dynamic document list",E)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),h()}),e.watch(()=>o.modelValue,p=>{Array.isArray(p)&&JSON.stringify(p)!==JSON.stringify(d.value)&&(d.value=JSON.parse(JSON.stringify(p)))},{deep:!0}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiUrl},(p,E)=>{p!==E&&h()}),e.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiMethod},(p,E)=>{p!==E&&h()}),e.watch(()=>o.items,p=>{c.value=p??[],f.value=!1},{deep:!0,immediate:!0});const m=p=>{const E=p[o.itemValue]||p.id||p.typeDocument;return d.value.find(C=>C.typeDocument===E||C.idDocumentType===E||C[o.itemValue]===E)||null},g=async(p,E,C)=>{var k,y;const w=C.target,_=(k=w.files)==null?void 0:k[0];if(!_)return;const B=p[o.itemValue]||p.id||p.typeDocument;if(p[o.itemTitle]||p.name||p.filename,!i.value){const V=[...d.value],N=V.findIndex(D=>D.typeDocument===B||D.idDocumentType===B),M={id:null,idDocument:null,idDocumentType:B,filename:_.name,document:_.name,typeDocument:B};N>-1?V[N]={...V[N],...M}:V.push(M),d.value=V,r("update:modelValue",V);return}u.value.add(E);try{const{apiUrl:V}=ot(),N=new FormData;N.append("doc",_),N.append("typeDocument",String(B));const M=await V(i.value,((y=o.endpoint)==null?void 0:y.apiMethod)||"POST",N),D=Array.isArray(M==null?void 0:M.data)?M.data[0]:(M==null?void 0:M.data)||M,v=(D==null?void 0:D.url)||(D==null?void 0:D.document)||_.name,P=(D==null?void 0:D.id)||null,H=(D==null?void 0:D.filename)||(D==null?void 0:D.name)||_.name,$=[...d.value],q=$.findIndex(G=>G.typeDocument===B||G.idDocumentType===B),ee={...D||{},id:P,idDocument:P,idDocumentType:B,filename:H,document:v,typeDocument:B};q>-1?$[q]={...$[q],...ee}:$.push(ee),d.value=$,r("update:modelValue",$),r("uploaded",D),r("success",D)}catch(V){console.error("Upload failed",V)}finally{u.value.delete(E),w.value=""}},b=p=>{const E=p[o.itemValue]||p.id||p.typeDocument,C=d.value.filter(w=>w.typeDocument!==E&&w.idDocumentType!==E);d.value=C,r("update:modelValue",C)},x=(p,E,C)=>{var B,k;C.preventDefault();const w=(k=(B=C.dataTransfer)==null?void 0:B.files)==null?void 0:k[0];if(!w)return;g(p,E,{target:{files:[w],value:""}})};return(p,E)=>(e.openBlock(),e.createElementBlock("div",Zk,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(so,{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",ew,[e.createVNode(so,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",tw,[e.createVNode(e.unref(ce.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",nw,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",ow,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(C,w)=>{var _;return e.openBlock(),e.createElementBlock("div",{key:w,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.createVNode(so,{text:C[t.itemTitle]||C.name||C.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),m(C)?(e.openBlock(),e.createElementBlock("div",rw,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",aw,e.toDisplayString(((_=m(C))==null?void 0:_.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:B=>b(C)},[e.createVNode(e.unref(ce.X),{class:"w-4 h-4"})],8,sw))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${w}`,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(w)?"pointer-events-none opacity-70":""]]),onDragover:E[0]||(E[0]=e.withModifiers(()=>{},["prevent"])),onDrop:B=>!t.disabled&&!u.value.has(w)&&x(C,w,B)},[u.value.has(w)?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(ce.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",lw,e.toDisplayString(u.value.has(w)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",cw,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${w}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(w),accept:t.typeFile,onChange:B=>g(C,w,B)},null,40,dw)],42,iw))])}),128))],2)]))}}),Vd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>Tt[n.icon]??Tt.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(It),{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}))}}),uw=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(Pe)(e.unref(hw)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),fw=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(Pe)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),hw=sr("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"}}),Bs=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(Pe)(e.unref(mw)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),mw=sr("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"}}),_s=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(Pe)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ss=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(Pe)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),As=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(Pe)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Vs=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(Pe)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),pw={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},gw={class:"flex flex-wrap items-center justify-center gap-2"},bw=["accept","multiple"],Wr=wt(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 k;o.disabled||(k=a.value)==null||k.click()}function f(k){const y=k/1024,V=y/1024;return V>=1?`${V.toFixed(2)} MB`:y>=1?`${y.toFixed(1)} KB`:`${k} B`}function h(k){var V;if(!k)return"File tidak valid";if((V=o.accept)!=null&&V.includes("image/")&&!k.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const y=(o.maxSizeMb??2)*1024*1024;return k.size>y?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(k){l.value=k.name,c.value=k.size}function g(k){if(i.value=null,!k.length)return;if(o.mode==="single"){const V=k[0],N=h(V);if(N){i.value=N,r("error",N);return}o.showSelected&&m(V),r("picked",V);return}const y=[];for(const V of k){const N=h(V);if(N){i.value=N,r("error",N);return}y.push(V)}y.length&&(o.showSelected&&m(y[0]),r("picked:multiple",y))}function b(k){const y=k.target,V=Array.from(y.files??[]);g(V),y.value=""}function x(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function E(){s.value=!1}function C(k){var N,M;if(o.disabled)return;s.value=!1;const y=Array.from(((N=k.dataTransfer)==null?void 0:N.files)??[]),V=(M=o.accept)!=null&&M.includes("image/")?y.filter(D=>D.type.startsWith("image/")):y;g(V)}const w=e.computed(()=>(o.accept||"file/*").split(",").map(k=>k.trim()).filter(Boolean).map(k=>k==="image/*"?"IMAGE":k.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const _=e.ref(!1),B=e.computed(()=>{if(o.disabled||!_.value)return{};const k=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:k?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:k?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(k,y)=>(e.openBlock(),e.createBlock(e.unref(_s),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(As),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(Vs),{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(Ss),{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(x,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(E,["prevent"]),onDrop:e.withModifiers(C,["prevent"]),onMouseenter:y[0]||(y[0]=V=>_.value=!0),onMouseleave:y[1]||(y[1]=V=>_.value=!1)},[e.createElementVNode("div",pw,[y[2]||(y[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),y[3]||(y[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",gw,[e.createVNode(e.unref(Bs),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(w.value),1)]),_:1}),e.createVNode(e.unref(Bs),{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(Bs),{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:b},null,40,bw)],38),d.value?(e.openBlock(),e.createBlock(e.unref(uw),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(fw),{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"]]),yw={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},xw=["src"],kw={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"},ww={class:"space-y-0.5"},Cw={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Ew={class:"text-xs opacity-70"},Bw=["disabled"],_w={key:1},Sw=["disabled"],Aw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Vw={class:"flex gap-2"},Dw={class:"font-medium truncate"},Nw={class:"flex gap-2"},Mw={class:"font-medium"},vw={class:"flex gap-2"},Pw={class:"font-medium truncate"},Ds=wt(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,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(m){const g=m/1024,b=g/1024;return b>=1?`${b.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} 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 h=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(m,g)=>t.file?(e.openBlock(),e.createBlock(_s,{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(As,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Vs,{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",yw,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Ss,{class:"pt-2"},{default:e.withCtx(()=>{var b,x,p,E,C;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`},h.value]),onMouseenter:g[2]||(g[2]=w=>c.value=!0),onMouseleave:g[3]||(g[3]=w=>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,xw)):(e.openBlock(),e.createElementBlock("div",kw,[e.createVNode(e.unref(ce.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",ww,[e.createElementVNode("p",Cw,e.toDisplayString((b=l.value)==null?void 0:b.name),1),e.createElementVNode("p",Ew,e.toDisplayString((x=l.value)==null?void 0:x.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:g[0]||(g[0]=w=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,Bw)):(e.openBlock(),e.createElementBlock("div",_w)),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:g[1]||(g[1]=w=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,Sw)):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",Aw,[e.createElementVNode("div",Vw,[g[4]||(g[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Dw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",Nw,[g[5]||(g[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Mw,e.toDisplayString((E=l.value)==null?void 0:E.size),1)]),e.createElementVNode("div",vw,[g[6]||(g[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Pw,e.toDisplayString((C=l.value)==null?void 0:C.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function Ns(){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 Tw={class:"space-y-3"},Ow={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"},Dd=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(y=>y.trim().toLowerCase()).filter(Boolean).map(y=>y.includes("/")||y.startsWith(".")?y:`.${y}`):[]});function u(B){const k=B.lastIndexOf(".");return k>=0?B.slice(k).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const B=d.value.filter(y=>y.startsWith("."));return[...d.value.filter(y=>y.includes("/")),...B].join(",")}return o.accept}),h=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(B){if(d.value.length){const k=(B.type||"").toLowerCase(),y=u(B.name);return d.value.some(V=>V.includes("/")?k===V:V.startsWith(".")?y===V:y===`.${V}`)}if(o.accept){if(o.accept==="*/*")return!0;const k=o.accept.split(",").map(N=>N.trim().toLowerCase()),y=(B.type||"").toLowerCase(),V=u(B.name);return k.some(N=>{if(N.endsWith("/*")){const M=N.slice(0,-2);return y.startsWith(M)}return N.startsWith(".")?V===N:y===N})}return!0}function g(B){return B*1024*1024}async function b(B){return B?m(B)?o.minSizeMb!=null&&B.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&B.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:x}=ot(),p=Ns(),E=e.ref(!1);async function C(B){var k;if(o.uploadFn){try{E.value=!0;const y=await o.uploadFn(B);a.value=B,r("uploaded",y)}catch(y){console.error("Upload Error",y),p.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{E.value=!1}return}if(!((k=o.endpoint)!=null&&k.apiUrl)){a.value=B;return}if(typeof x!="function"){l("useApi() must expose DCodeApi()");return}try{E.value=!0;const y=new FormData;y.append("doc",B);const V=(o.endpoint.apiMethod||"POST").toUpperCase(),N=o.endpoint.apiUrl,M=await x("","",y,{_url:N,_method:V,withCredentials:!0,transformRequest:[(v,P)=>(P&&(delete P["Content-Type"],delete P["content-type"]),v)]}),D=(M==null?void 0:M.data)??M;a.value=B,r("uploaded",D)}catch(y){console.error("Upload Error",y),p.error("Upload Failed",(y==null?void 0:y.message)||"Unknown error"),l((y==null?void 0:y.message)||"Upload Failed")}finally{E.value=!1}}async function w(B){var y;if(o.disabled)return;c();const k=await b(B);if(k){l(k);return}s.value=B,o.uploadFn||(y=o.endpoint)!=null&&y.apiUrl?await C(B):a.value=B}function _(){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,k)=>(e.openBlock(),e.createElementBlock("div",Tw,[a.value?E.value?(e.openBlock(),e.createElementBlock("div",Ow,[...k[1]||(k[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(Ds,{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:_},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(Wr,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||E.value,onPicked:w,error:i.value,onError:k[0]||(k[0]=y=>l(y))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Fw=["for"],zw={key:0,class:"!ml-1 !text-destructive"},Iw={class:"relative w-full block box-border"},Rw={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},Lw=["id","readonly","disabled","placeholder"],$w={class:"absolute inset-y-0 right-4 flex items-center z-10"},jw={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"},Ww={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},Uw={key:1,class:"text-sm text-muted-foreground text-center"},Hw=["onClick","title"],qw={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},Gw={class:"flex items-center justify-center flex-1"},Xw={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},Kw={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},Nd=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=Tt,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(""),h=e.ref(!1),m=e.ref(!1),g=e.ref(!1),b=e.shallowRef([]),x=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),E=async()=>{if(m.value||g.value)return;g.value=!0,await new Promise(W=>setTimeout(W,0));const L=Object.keys(a).filter(W=>!p.has(W)).filter(W=>/^[A-Z]/.test(W)).filter(W=>typeof a[W]=="function"||typeof a[W]=="object"&&a[W]).sort((W,ae)=>W.localeCompare(ae));b.value=L,m.value=!0,g.value=!1},C=e.computed(()=>!m.value||!u.value||!b.value.includes(u.value)?null:a[u.value]),w=e.ref(u.value),_=e.computed(()=>!!u.value&&!d.value),B=e.computed(()=>{if(!m.value)return[];const L=(f.value??"").trim().toLowerCase();return L?b.value.filter(W=>W.toLowerCase().includes(L)):b.value}),k=e.computed(()=>B.value.slice(0,x.value)),y=e.computed(()=>{const L=o.columns;return L<=2?"grid-cols-2":L===3?"grid-cols-3":L===4?"grid-cols-4":L===5?"grid-cols-5":L>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>C.value&&!d.value?"!pl-12":"!pl-3");const V=async()=>{var L;await e.nextTick(),(L=i.value)==null||L.focus()},N=async L=>{if(o.disabled)return;const W=L!==!1;if(h.value){h.value=!1;return}d.value=!0,await E(),W&&(f.value="",w.value=""),x.value=o.pageSize,await V()},M=()=>{d.value=!1,f.value="",w.value=u.value,x.value=o.pageSize},D=async()=>{o.disabled||(d.value?M():await N())};let v=null;const P=async L=>{if(o.disabled)return;r("update:modelValue",null),d.value||await N(!1),v&&clearTimeout(v);const W=w.value;v=setTimeout(()=>{f.value=W},300)},H=L=>{o.disabled||(r("update:modelValue",L),M(),queueMicrotask(()=>{var W;return(W=i.value)==null?void 0:W.blur()}))},$=()=>{o.disabled||(r("update:modelValue",null),r("clear"),h.value=!0,M(),queueMicrotask(()=>{var L;return(L=i.value)==null?void 0:L.focus()}))},q=L=>{if(L.key==="Escape"){L.preventDefault(),M();return}if(L.key==="Enter"&&d.value){const W=B.value[0];W&&(L.preventDefault(),H(W))}},ee=L=>{if(!d.value)return;const W=L.target;s.value&&!s.value.contains(W)&&M()},G=L=>{const W=L.target;W.scrollTop+W.clientHeight>=W.scrollHeight-24&&x.value<B.value.length&&(x.value=Math.min(x.value+o.pageSize,B.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",ee),queueMicrotask(()=>{var L;i.value=((L=s.value)==null?void 0:L.querySelector("input"))??null}),u.value&&E()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",ee),v&&clearTimeout(v)}),e.watch(u,L=>{d.value||(w.value=L)}),e.watch(()=>f.value,()=>{x.value=o.pageSize}),(L,W)=>(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",zw,"*")):e.createCommentVNode("",!0)],8,Fw)):e.createCommentVNode("",!0),e.createElementVNode("div",Iw,[C.value&&!d.value?(e.openBlock(),e.createElementBlock("div",Rw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(C.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":W[0]||(W[0]=ae=>w.value=ae),readonly:_.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",[C.value&&!d.value?"pl-10":"pl-4",_.value?"cursor-pointer select-none":""]]),onClick:N,onFocus:N,onInput:P,onKeydown:q},null,42,Lw),[[e.vModelText,w.value]]),e.createElementVNode("div",$w,[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:W[1]||(W[1]=e.withModifiers(()=>{},["prevent"])),onClick:$,title:"Clear"},[e.createVNode(e.unref(ce.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:W[2]||(W[2]=e.withModifiers(()=>{},["prevent"])),onClick:D,title:"Open"},[e.createVNode(e.unref(ce.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",jw,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:G},[g.value?(e.openBlock(),e.createElementBlock("div",Ww,[e.createVNode(e.unref(ce.Loader2),{class:"h-4 w-4 animate-spin"}),W[3]||(W[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&B.value.length===0?(e.openBlock(),e.createElementBlock("div",Uw," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",y.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,ae=>(e.openBlock(),e.createElementBlock("button",{key:ae,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===ae?"ring-1 ring-primary":""]),onClick:Z=>H(ae),title:ae},[e.createElementVNode("div",qw,[e.createElementVNode("div",Gw,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[ae]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",Xw,e.toDisplayString(ae),1)])],10,Hw))),128))],2)),m.value&&B.value.length>0?(e.openBlock(),e.createElementBlock("div",Kw," Showing "+e.toDisplayString(k.value.length)+" / "+e.toDisplayString(B.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),Yw={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},Jw={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},Qw={class:"relative overflow-auto p-0"},Ms=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:C=>r("update:modelValue",C)}),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 h(C,w,_,B,k){const y=await new Promise((M,D)=>{const v=URL.createObjectURL(C),P=new Image;P.onload=()=>{URL.revokeObjectURL(v),M(P)},P.onerror=H=>{URL.revokeObjectURL(v),D(H)},P.src=v}),V=document.createElement("canvas");V.width=w,V.height=_;const N=V.getContext("2d");return N?(N.drawImage(y,0,0,w,_),await new Promise(M=>{V.toBlob(D=>M(D||C),B,k)})):C}function m(){if(!l||!i.value)return;const C=l.getPlugin("Dashboard"),w=l.getFile(i.value);!C||!w||requestAnimationFrame(()=>{try{C.openFileEditor(w)}catch{try{C.openFileEditor(i.value)}catch{}}})}async function g(C){if(l){l.cancelAll(),i.value=null;try{const w=l.addFile({name:C.name,type:C.type,data:C,source:"Local",isRemote:!1});i.value=String(w)}catch{}}}function b(){if(!s.value)return;l&&f(),l=new uu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const C=document.documentElement.classList.contains("dark");l.use(Js,{target:s.value,inline:!0,height:480,theme:C?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const w=document.documentElement.classList.contains("dark"),_=l.getPlugin("Dashboard");_&&_.setOptions({theme:w?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(fu,{target:Js,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",w=>{i.value=(w==null?void 0:w.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async w=>{const _=++d;try{const B=w.data,k=B.type||w.type||"image/jpeg";let y=B;if(o.outputWidth&&o.outputHeight&&(y=await h(B,o.outputWidth,o.outputHeight,k,o.quality)),c||_!==d)return;const V=w.name||"edited-image.jpg",N=new File([y],V,{type:k});await x(N,"UPPY_EDITOR_COMPLETE"),r("done",N),a.value=!1}catch{}})}async function x(C,w="CROP_RESULT"){const _=URL.createObjectURL(C);try{const B=await new Promise((k,y)=>{const V=new Image;V.onload=()=>k(V),V.onerror=y,V.src=_});console.group(w),console.log("file:",C),console.table({name:C.name,type:C.type,sizeBytes:C.size,sizeMB:+(C.size/1024/1024).toFixed(3),width:B.naturalWidth,height:B.naturalHeight,ratio:+(B.naturalWidth/B.naturalHeight).toFixed(4)}),console.log("previewUrl:",_),console.groupEnd()}finally{URL.revokeObjectURL(_)}}e.watch(a,async C=>{c=!C,d++,C?(await e.nextTick(),b(),o.file&&await g(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async C=>{a.value&&C&&(await e.nextTick(),await g(C))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=C=>{C.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,C=>{C?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const E=e.ref(!1);return(C,w)=>a.value?(e.openBlock(),e.createElementBlock("div",Yw,[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:w[0]||(w[0]=_=>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:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Jw,[w[6]||(w[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:E.value?1:.7}),onClick:w[1]||(w[1]=_=>a.value=!1),onMouseenter:w[2]||(w[2]=_=>E.value=!0),onMouseleave:w[3]||(w[3]=_=>E.value=!1)},[e.createVNode(e.unref(ce.X),{class:"h-4 w-4"}),w[5]||(w[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",Qw,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),Zw={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},e1=["src"],t1=["disabled"],n1=["disabled"],o1={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},r1={class:"flex gap-2"},a1={class:"font-medium truncate"},s1={class:"flex gap-2"},i1={class:"font-medium"},l1={class:"flex gap-2"},c1={class:"font-medium truncate"},vs=wt(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,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(h){const m=h/1024,g=m/1024;return g>=1?`${g.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} 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(h,m)=>t.file?(e.openBlock(),e.createBlock(_s,{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(As,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Vs,{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",Zw,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(Ss,{class:"pt-2"},{default:e.withCtx(()=>{var g,b,x;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:m[2]||(m[2]=p=>l.value=!0),onMouseleave:m[3]||(m[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,e1)):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:m[0]||(m[0]=p=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,t1)):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:m[1]||(m[1]=p=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,n1)):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",o1,[e.createElementVNode("div",r1,[m[4]||(m[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",a1,e.toDisplayString((g=i.value)==null?void 0:g.name),1)]),e.createElementVNode("div",s1,[m[5]||(m[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",i1,e.toDisplayString((b=i.value)==null?void 0:b.size),1)]),e.createElementVNode("div",l1,[m[6]||(m[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",c1,e.toDisplayString((x=i.value)==null?void 0:x.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),d1={class:"space-y-3"},Ur=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:$=>r("update:modelValue",$)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d($){c.value=$,r("error",$)}function u(){c.value=null}const f=e.computed(()=>{const $=(o.allowedTypes??"").trim();return $?$.split(/[,\s;]+/g).map(ee=>ee.trim().toLowerCase()).filter(Boolean).map(ee=>ee.includes("/")||ee.startsWith(".")?ee:`.${ee}`):[]});function h($){const q=$.lastIndexOf(".");return q>=0?$.slice(q).toLowerCase():""}const m=e.computed(()=>{if(f.value.length){const $=f.value.filter(ee=>ee.startsWith("."));return[...f.value.filter(ee=>ee.includes("/")),...$].join(",")}return o.accept||"image/*"}),g=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function b($){if(f.value.length){const ee=($.type||"").toLowerCase(),G=h($.name);return f.value.some(L=>L.includes("/")?ee===L:L.startsWith(".")?G===L:G===`.${L}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?($.type||"").toLowerCase().startsWith("image/"):!0}function x($){return $*1024*1024}async function p($){var q;return(q=$.type)!=null&&q.startsWith("image/")?await new Promise(ee=>{const G=URL.createObjectURL($),L=new Image;L.onload=()=>{URL.revokeObjectURL(G),ee({w:L.naturalWidth,h:L.naturalHeight})},L.onerror=()=>{URL.revokeObjectURL(G),ee(null)},L.src=G}):null}async function E($){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const ee=await p($);return ee?o.minWidth!=null&&ee.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&ee.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&ee.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&ee.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function C($){return $?b($)?o.minSizeMb!=null&&$.size<x(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&$.size>x(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await E($):`only Allowed: ${g.value}`:"File tidak valid"}function w($){o.disabled||(i.value=$,s.value=!0)}async function _($){if(o.disabled)return;u();const q=await C($);if(q){d(q);return}l.value=$,w($)}const{DCodeApi:B}=ot(),k=Ns(),y=e.ref(!1);e.ref(null);function V($,q){return!$||!q?null:$.replace(/\/+$/,"")+"/"+q.replace(/^\/+/,"")}function N($){var L;const q=($==null?void 0:$.data)??$,ee=(L=q==null?void 0:q.data)==null?void 0:L[0];if(!ee)return null;const G=V(ee.server,ee.url);return{...ee,fullUrl:G?encodeURI(G):null}}async function M($){var q;if(o.uploadFn){try{y.value=!0;const ee=await o.uploadFn($);a.value=$,r("uploaded",ee)}catch(ee){console.error("Upload Error",ee),k.error("Upload Failed",(ee==null?void 0:ee.message)||"Unknown error"),d((ee==null?void 0:ee.message)||"Upload Failed")}finally{y.value=!1}return}if(!((q=o.endpoint)!=null&&q.apiUrl)){a.value=$;return}if(typeof B!="function"){d("useApi() must expose DCodeApi()");return}try{y.value=!0;const ee=new FormData;ee.append("doc",$);const G=(o.endpoint.apiMethod||"POST").toUpperCase(),L=o.endpoint.apiUrl,W=await B("","",ee,{_url:L,_method:G,withCredentials:!0,transformRequest:[(Z,J)=>(J&&(delete J["Content-Type"],delete J["content-type"]),Z)]}),ae=(W==null?void 0:W.data)??W;N(ae),a.value=$,r("uploaded",ae)}catch(ee){console.error("Upload Error",ee),k.error("Upload Failed",(ee==null?void 0:ee.message)||"Unknown error"),d((ee==null?void 0:ee.message)||"Upload Failed")}finally{y.value=!1}}async function D($){var q;u(),o.uploadFn||(q=o.endpoint)!=null&&q.apiUrl?await M($):a.value=$,s.value=!1,i.value=null}function v(){s.value=!1,i.value=null}async function P(){if(!a.value)return;u();const $=o.editUseOriginal?l.value??a.value:a.value,q=await C($);if(q){d(q);return}w($)}function H(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,$=>{$&&!l.value&&(l.value=$),$||(l.value=null)},{immediate:!0}),($,q)=>(e.openBlock(),e.createElementBlock("div",d1,[a.value?(e.openBlock(),e.createBlock(vs,{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:P,onRemove:H,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(Wr,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:_,error:c.value,onError:q[0]||(q[0]=ee=>d(ee))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Ms,{modelValue:s.value,"onUpdate:modelValue":q[1]||(q[1]=ee=>s.value=ee),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:D,onCancel:v},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),u1=["aria-busy"],f1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},h1=["for"],m1={key:0,class:"ml-1 text-destructive"},p1=["id","disabled"],g1={class:"min-w-0 flex-1 text-left"},b1={key:0,class:"flex flex-wrap gap-1.5"},y1={class:"max-w-[220px] truncate"},x1=["onClick"],k1={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"},w1={key:1,class:"text-muted-foreground truncate"},C1={class:"flex items-center gap-2 shrink-0"},E1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},B1=["placeholder","onKeydown"],_1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},S1=["disabled","onClick"],A1={class:"truncate"},V1={key:0,class:"text-primary-600 dark:text-primary-400"},D1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},N1={key:0},M1={key:1},v1={key:1,class:"text-xs text-destructive"},Ps=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 T=o.required,Y=o["aria-required"];return T===""||T===!0||T==="true"||(Y==="true"||Y===!0)}),u=e.computed(()=>!!a.error);function f(T){return T?typeof a.itemTitle=="function"?a.itemTitle(T)??"":String((T==null?void 0:T[a.itemTitle])??""):""}function h(T){return T?typeof a.itemValue=="function"?a.itemValue(T):T==null?void 0:T[a.itemValue]:null}function m(T,Y){return h(T)??Y}const g=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),b=e.computed(()=>{var T;return!!((T=a.endpoint)!=null&&T.apiUrl)||!!a.fetchItems}),x=e.ref([]),p=e.ref(!1),E=e.ref(!1),C=e.computed(()=>{var Y;const T=(Y=a.endpoint)==null?void 0:Y.apiOptions;if(T)return typeof T=="function"?T():T}),w=e.computed(()=>{var de,fe;const T=((de=a.endpoint)==null?void 0:de.apiUrl)??"",Y=(((fe=a.endpoint)==null?void 0:fe.apiMethod)??"GET").toUpperCase(),ne=JSON.stringify(C.value??null);return`${Y} ${T} :: ${ne}`}),_=e.computed(()=>b.value?x.value:a.items||[]);async function B(){var T;if(b.value&&!(!((T=a.endpoint)!=null&&T.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let Y;if(a.fetchItems){const ne=await a.fetchItems(),de=(ne==null?void 0:ne.data)??ne;Y=(de==null?void 0:de.data)??de}else{const{DCodeApi:ne}=ot();if(typeof ne!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const de={page:1,perPage:100,...C.value||{}},fe=await ne("","",de,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),Ve=(fe==null?void 0:fe.data)??fe;Y=(Ve==null?void 0:Ve.data)??Ve}x.value=Array.isArray(Y)?Y:[],E.value=!0}catch(Y){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",Y),x.value=[]}finally{p.value=!1}}}e.watch(()=>w.value,()=>{x.value=[],E.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&b.value&&B()});const k=e.computed(()=>{const T=g.value;if(a.returnObject)return T;const Y=new Map;for(const ne of _.value)Y.set(h(ne),ne);return T.map(ne=>Y.get(ne)??{[a.itemValue]:ne,[a.itemTitle]:String(ne)})}),y=e.computed(()=>a.maxChips===null?k.value:k.value.slice(0,a.maxChips));function V(T){const Y=g.value;if(a.returnObject){const ne=h(T);return Y.some(de=>h(de)===ne)}return Y.includes(h(T))}const N=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const T=Number(a.maxSelected);return Number.isFinite(T)&&T>0?T:null}),M=e.computed(()=>{const T=N.value;return T===null?!1:g.value.length>=T});function D(T){return!V(T)&&M.value}const v=e.computed(()=>{const T=g.value,Y=new Set;if(a.returnObject)for(const ne of T)Y.add(h(ne));else for(const ne of T)Y.add(ne);return Y}),P=e.computed(()=>{const T=v.value;return(_.value||[]).filter(Y=>!T.has(h(Y)))}),H=e.computed(()=>_.value.length===0?!1:P.value.length===0),$=e.ref(null),q=e.ref(null),ee=e.ref(null),G=e.ref(!1),L=e.ref(""),W=e.ref(0),ae=e.ref(0),{floatingStyles:Z}=Ba($,q,{whileElementsMounted:xa,placement:"bottom-start",middleware:[ka(8),Ca(),wa({padding:8}),Ea({apply({rects:T,elements:Y}){Object.assign(Y.floating.style,{width:`${T.reference.width}px`,"--floating-width":`${T.reference.width}px`})}})]}),J=e.computed(()=>Z.value),le=e.computed(()=>{const T=Number(a.maxRows);return Number.isFinite(T)&&T>0?T:5});async function ue(){a.disabled||(G.value=!0,ae.value=0,requestAnimationFrame(()=>{ee.value&&(ee.value.scrollTop=0),W.value=0}),b.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!E.value)&&!p.value&&await B())}function Ce(){G.value=!1}function _e(){G.value?Ce():ue()}function me(T){var ne,de;if(!G.value)return;const Y=T.target;(ne=$.value)!=null&&ne.contains(Y)||(de=q.value)!=null&&de.contains(Y)||Ce()}e.onMounted(()=>document.addEventListener("mousedown",me)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",me));function Q(T){if(a.disabled)return;if(D(T)){r("max");return}const Y=[...g.value];if(a.returnObject){const ne=h(T);if(Y.some(fe=>h(fe)===ne))return;r("update:modelValue",[...Y,T])}else{const ne=h(T);if(Y.includes(ne))return;r("update:modelValue",[...Y,ne])}L.value="",ae.value=0,requestAnimationFrame(()=>{ee.value&&(ee.value.scrollTop=0),W.value=0})}function O(T){if(a.disabled)return;const Y=[...g.value];if(a.returnObject){const ne=h(T);r("update:modelValue",Y.filter(de=>h(de)!==ne))}else{const ne=h(T);r("update:modelValue",Y.filter(de=>de!==ne))}}function K(){a.disabled||(r("update:modelValue",[]),r("clear"),Ce())}const re=e.computed(()=>{const T=L.value.trim().toLowerCase(),Y=P.value;return T?Y.filter(ne=>f(ne).toLowerCase().includes(T)):Y}),be=e.computed(()=>re.value.length);e.watch(G,T=>{T||(L.value="")});const Be=e.computed(()=>{if(H.value)return a.itemHeight;const T=be.value;return(T<=0?1:Math.min(T,le.value))*a.itemHeight}),Ie=e.computed(()=>a.virtual?be.value*a.itemHeight:0),$e=e.computed(()=>a.virtual?Math.ceil(Be.value/a.itemHeight)+a.overscan:be.value),Ge=e.computed(()=>{if(!a.virtual)return 0;const T=Math.floor(W.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,T)}),ve=e.computed(()=>a.virtual?Math.min(be.value,Ge.value+$e.value):be.value),lt=e.computed(()=>a.virtual?Ge.value*a.itemHeight:0),dt=e.computed(()=>{const T=re.value;return a.virtual?T.slice(Ge.value,ve.value):T});function R(T){const Y=T.target;W.value=Y.scrollTop}function U(T){return T===ae.value}function A(T){const Y=ee.value;if(!Y||!a.virtual)return;const ne=T*a.itemHeight,de=ne+a.itemHeight,fe=Y.scrollTop,Ve=Y.scrollTop+Y.clientHeight;ne<fe?Y.scrollTop=ne:de>Ve&&(Y.scrollTop=de-Y.clientHeight)}function F(T){const Y=Math.max(0,be.value-1);ae.value=Math.min(Y,Math.max(0,ae.value+T)),A(ae.value)}function X(){const T=re.value[ae.value];T&&Q(T)}const ie=e.computed(()=>a.clearable&&!a.disabled&&k.value.length>0),se=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":G.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(T,Y)=>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",f1)):e.createCommentVNode("",!0),Y[3]||(Y[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",m1,"*")):e.createCommentVNode("",!0)],8,h1)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:$,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",se.value]]),disabled:a.disabled,onClick:_e},[e.createElementVNode("div",g1,[k.value.length?(e.openBlock(),e.createElementBlock("div",b1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(ne,de)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${m(ne,de)}`,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",y1,e.toDisplayString(f(ne)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(fe=>O(ne),["stop"]),"aria-label":"Remove"}," ✕ ",8,x1))]))),128)),a.maxChips!==null&&k.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",k1," +"+e.toDisplayString(k.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",w1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",C1,[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(ce.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,p1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[G.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:q,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(J.value)},[a.searchable&&!H.value?(e.openBlock(),e.createElementBlock("div",E1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Y[0]||(Y[0]=ne=>L.value=ne),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:[Y[1]||(Y[1]=e.withKeys(e.withModifiers(ne=>F(1),["prevent"]),["down"])),Y[2]||(Y[2]=e.withKeys(e.withModifiers(ne=>F(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(X,["prevent"]),["enter"]),e.withKeys(e.withModifiers(Ce,["prevent"]),["esc"])]},null,40,B1),[[e.vModelText,L.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:ee,class:"relative overflow-auto",style:e.normalizeStyle({height:Be.value+"px"}),onScroll:R},[H.value?(e.openBlock(),e.createElementBlock("div",_1," 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:Ie.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(${lt.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value,(ne,de)=>(e.openBlock(),e.createElementBlock("button",{key:String(m(ne,Ge.value+de)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[D(ne)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",U(Ge.value+de)?"bg-neutral-50 dark:bg-neutral-800/60":"",V(ne)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||D(ne),onClick:fe=>Q(ne)},[e.createElementVNode("span",A1,e.toDisplayString(f(ne)),1),V(ne)?(e.openBlock(),e.createElementBlock("span",V1,"✓")):e.createCommentVNode("",!0)],14,S1))),128))],6),be.value===0?(e.openBlock(),e.createElementBlock("div",D1,[p.value?(e.openBlock(),e.createElementBlock("span",N1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",M1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",v1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,u1)),[[e.vShow,i.value]])}}),P1={class:"space-y-4"},T1={key:0,class:"flex flex-col gap-0.5"},O1=["for"],F1=["for"],z1={class:"text-[11px] text-gray-500 dark:text-gray-400"},I1={class:"flex items-center gap-2 flex-nowrap"},R1=["id","value","disabled","onKeydown","onInput","onPaste"],Hr=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}=ot(),f=Ns(),h=e.computed(()=>{const B=Number(s.totalInput);return B&&B>0?B:6}),m=()=>{c.value=Array.from({length:h.value},(B,k)=>{var y;return((y=s.default)==null?void 0:y[k])??""}),i("updateOtp",c.value.join(""))};m(),e.watch(()=>[s.totalInput,s.default],()=>m());const g=B=>{B<0||B>=h.value||e.nextTick(()=>{var k;return(k=l.value[B])==null?void 0:k.focus()})},b=B=>B.match(/[a-zA-Z0-9]/)?B.match(/[a-zA-Z0-9]/)[0]:"";async function x(B){var k;if(i("complete",B),s.submitFn){try{d.value=!0,i("loading",!0);const y=await s.submitFn(B);i("success",y)}catch(y){console.error("OTP Submit Error",y),f.error("Submit Failed",(y==null?void 0:y.message)||"Unknown error"),i("error",(y==null?void 0:y.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((k=s.endpoint)!=null&&k.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const y=(s.endpoint.apiMethod||"POST").toUpperCase(),V=s.endpoint.apiUrl,N=await u("","",{otp:B},{_url:V,_method:y,withCredentials:!0}),M=(N==null?void 0:N.data)??N;i("success",M)}catch(y){console.error("OTP Submit Error",y),f.error("Submit Failed",(y==null?void 0:y.message)||"Unknown error"),i("error",(y==null?void 0:y.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const p=(B,k)=>{c.value[B]=b(k);const y=c.value.join("");i("updateOtp",y),i("update:modelValue",y),y.length===h.value&&x(y)},E=(B,k)=>{const y=B.key,V=/^\d$/.test(y),N=/^[a-zA-Z]$/.test(y);if(y==="Backspace"){if(B.preventDefault(),c.value[k]){p(k,"");return}k>0&&(p(k-1,""),g(k-1));return}if(y==="ArrowLeft"){B.preventDefault(),g(k-1);return}if(y==="ArrowRight"){B.preventDefault(),g(k+1);return}if(V||N){B.preventDefault(),p(k,y),k<h.value-1&&g(k+1);return}y.length===1&&B.preventDefault()},C=(B,k)=>{const y=B.target,V=y.value??"",N=b(V);y.value=N,p(k,N),N&&k<h.value-1&&g(k+1)},w=(B,k)=>{var D;B.preventDefault();const V=(((D=B.clipboardData)==null?void 0:D.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!V)return;let N=k;for(const v of V){if(N>=h.value)break;c.value[N]=v,N++}const M=c.value.join("");i("updateOtp",M),i("update:modelValue",M),M.length===h.value&&x(M),g(Math.min(N,h.value-1))},_=B=>k=>{l.value[B]=(k==null?void 0:k.$el)??k};return(B,k)=>(e.openBlock(),e.createElementBlock("div",P1,[s.label||h.value?(e.openBlock(),e.createElementBlock("div",T1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,O1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,F1)),e.createElementVNode("p",z1," Ketik "+e.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,y=>(e.openBlock(),e.createElementBlock("input",{key:y,id:y===1?a.value:void 0,ref_for:!0,ref:_(y-1),value:c.value[y-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[y-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:V=>E(V,y-1),onInput:V=>C(V,y-1),onPaste:V=>w(V,y-1)},null,42,R1))),128))])]))}}),L1={class:"w-full"},$1={key:0,class:"flex items-center justify-between mb-2"},j1={key:0,class:"text-sm font-medium text-gray-700"},W1={key:1,class:"text-sm text-gray-600"},U1={name:"DCodeProgress"},Md=e.defineComponent({...U1,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",L1,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",$1,[t.label?(e.openBlock(),e.createElementBlock("span",j1,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",W1,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)]))}}),H1={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},vd=wt(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",H1,[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"]]),q1={class:"grid gap-3"},G1={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"},Y1={class:"relative flex-shrink-0 mt-0.5"},J1=["id","name","value","checked","disabled","required","onChange"],Q1=["onClick"],Z1=["for"],eC={key:0,class:"ml-1 text-red-500"},tC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Ts=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}=ot(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var w,_;const C=((w=a.endpoint)==null?void 0:w.apiUrl)||a.apiUrl;if(C){i.value=!0,l.value=null;try{const B={page:1,perPage:100},k=((_=a.endpoint)==null?void 0:_.apiMethod)||a.apiMethod,y=await o(C,k,B);let V=y;a.dataPath?V=a.dataPath.split(".").reduce((M,D)=>M&&M[D]!=="undefined"?M[D]:void 0,y):typeof y=="object"&&!Array.isArray(y)&&y.data&&(V=y.data),Array.isArray(V)?s.value=V:(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 C;((C=a.endpoint)!=null&&C.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 C=a.itemValue||a.model||"id",w=a.itemTitle||(a.label===""?"name":a.label);return w&&a.label!==""?[{[C]:C,[w]:w}]:[]}),u=C=>{if(typeof C!="object")return C;const w=a.itemValue||a.model||"id";return C[w]},f=C=>{if(typeof C!="object")return String(C);const w=a.itemTitle||"name";return C[w]},h=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=e.computed(()=>!!a.error||!!l.value),g=e.computed(()=>a.error||l.value),b=C=>C==null?a.modelValue===C:String(a.modelValue)===String(C),x=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=(C,w)=>{w.target.checked&&(r("update:modelValue",C),r("change",C))},E=C=>{!a.disabled&&!b(C)&&(r("update:modelValue",C),r("change",C))};return(C,w)=>(e.openBlock(),e.createElementBlock("div",q1,[t.label?(e.openBlock(),e.createBlock($o,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",G1,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",X1,[i.value?(e.openBlock(),e.createElementBlock("div",K1,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[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,(_,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:e.normalizeClass(["flex items-start",x.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",Y1,[e.createElementVNode("input",{id:t.id?`${t.id}-${B}`:`${h.value}-${B}`,name:h.value,type:"radio",value:u(_),checked:b(u(_)),disabled:t.disabled,required:t.required&&B===0,onChange:k=>p(u(_),k),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,J1)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:k=>E(u(_))},[e.createElementVNode("label",{for:t.id?`${t.id}-${B}`:`${h.value}-${B}`,class:e.normalizeClass([x.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(_))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",eC,"*")):e.createCommentVNode("",!0)],10,Z1)],8,Q1)],2))),128))],2),m.value&&g.value?(e.openBlock(),e.createElementBlock("div",tC,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0)])]))}}),nC={class:"grid gap-3"},oC={key:0,class:"ml-1 text-destructive"},rC={class:"flex flex-col"},aC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},sC=["onClick"],iC=["id","name","value","checked","disabled","required","onChange"],lC={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},cC=["for"],dC={key:0,class:"ml-1 text-red-500"},uC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Os=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}=ot(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,V=>{s.value=V},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var N,M;const V=((N=a.endpoint)==null?void 0:N.apiUrl)||a.apiUrl;if(V){l.value=!0,c.value=null;try{const D={page:1,perPage:100},v=((M=a.endpoint)==null?void 0:M.apiMethod)||a.apiMethod,P=await o(V,v,D);let H=P;a.dataPath?H=a.dataPath.split(".").reduce((q,ee)=>q&&q[ee]!=="undefined"?q[ee]:void 0,P):typeof P=="object"&&!Array.isArray(P)&&P.data&&(H=P.data),Array.isArray(H)?i.value=H:(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}}},u=e.ref(!1);let f=null;const h=()=>{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)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const V=a.itemValue||a.model||"id",N=a.itemTitle||(a.label===""?"name":a.label);return N&&a.label!==""?[{[V]:V,[N]:N}]:[]}),g=V=>{if(typeof V!="object")return V;const N=a.itemValue||a.model||"id";return V[N]},b=V=>{if(typeof V!="object")return String(V);const N=a.itemTitle||"name";return V[N]},x=Math.random().toString(36).slice(2,7),p=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${x}`),E=e.computed(()=>!!a.error||!!c.value),C=e.computed(()=>a.error||c.value),w=V=>{const N=s.value;return V==null?N===V:String(N)===String(V)},_=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]),B=e.computed(()=>a.icon&&Tt[a.icon]||null),k=(V,N)=>{N.target.checked&&(s.value=V,r("update:modelValue",V),r("change",V))},y=V=>{a.disabled||w(V)||(s.value=V,r("update:modelValue",V),r("change",V))};return(V,N)=>(e.openBlock(),e.createElementBlock("div",nC,[t.label?(e.openBlock(),e.createBlock($o,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",oC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",rC,[l.value?(e.openBlock(),e.createElementBlock("div",aC,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),N[0]||(N[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(m.value,(M,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",w(g(M))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:v=>!t.disabled&&y(g(M))},[e.createElementVNode("input",{id:t.id?`${t.id}-${D}`:`${p.value}-${D}`,name:p.value,type:"radio",value:g(M),checked:w(g(M)),disabled:t.disabled,required:t.required&&D===0,onChange:v=>k(g(M),v),class:"sr-only",tabindex:"-1"},null,40,iC),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",w(g(M))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[B.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",lC,[...N[1]||(N[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${D}`:`${p.value}-${D}`,class:e.normalizeClass([_.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",w(g(M))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(b(M))+" ",1),t.required&&m.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",dC,"*")):e.createCommentVNode("",!0)],10,cC)],10,sC))),128))],2),E.value&&C.value?(e.openBlock(),e.createElementBlock("div",uC,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])]))}}),fC={key:0,class:"ml-1 text-destructive"},hC={class:"relative w-full"},mC={key:0,class:"mb-2 flex items-center justify-between"},pC={class:"text-sm text-muted-foreground"},gC={class:"text-sm font-medium text-foreground"},bC={class:"text-sm text-muted-foreground"},yC={class:"relative"},xC=["id","value","min","max","step","disabled","placeholder"],kC={key:1,class:"relative mt-2"},wC={class:"text-xs text-muted-foreground mt-1"},CC={key:1,class:"flex items-center gap-1 text-sm text-destructive"},EC={name:"DCodeSlider"},qr=e.defineComponent({...EC,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 _={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",_[a.size],B[a.color]||B.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=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(" ")),m=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),g=e.computed(()=>{const _=a.max-a.min;return(a.modelValue-a.min)/_*100}),b=_=>{const B=_.target,k=parseFloat(B.value);r("update:modelValue",k),r("input",k)},x=_=>{const B=_.target,k=parseFloat(B.value);r("change",k)},p=()=>{i.value=!0},E=()=>{i.value=!1},C=_=>{const B=a.max-a.min;return(_-a.min)/B*100},w=e.computed(()=>{const _={sm:16,md:20,lg:24};return`
67
67
  input[type="range"]::-webkit-slider-thumb {
68
68
  ${h.value}
69
- width: ${E[r.size]}px;
70
- height: ${E[r.size]}px;
69
+ width: ${_[a.size]}px;
70
+ height: ${_[a.size]}px;
71
71
  }
72
72
 
73
73
  input[type="range"]::-moz-range-thumb {
74
74
  ${h.value}
75
- width: ${E[r.size]}px;
76
- height: ${E[r.size]}px;
75
+ width: ${_[a.size]}px;
76
+ height: ${_[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(E,_)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-2 w-full",n.unref(o).class]),"aria-busy":!1},[d.value?(n.openBlock(),n.createBlock(n.unref(So),{key:0,for:c.value,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(d.value)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",t1,"*")):n.createCommentVNode("",!0)]),_:1},8,["for"])):n.createCommentVNode("",!0),n.createElementVNode("div",n1,[e.showValue?(n.openBlock(),n.createElementBlock("div",o1,[n.createElementVNode("span",a1,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.min)+n.toDisplayString(r.valueSuffix),1),n.createElementVNode("span",r1,n.toDisplayString(m.value),1),n.createElementVNode("span",s1,n.toDisplayString(r.valuePrefix)+n.toDisplayString(e.max)+n.toDisplayString(r.valueSuffix),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",i1,[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[e.size==="sm"?"h-2":e.size==="md"?"h-2.5":"h-3"]])},[n.createElementVNode("div",{class:n.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[e.color==="blue"?"bg-blue-500":e.color==="green"?"bg-green-500":e.color==="red"?"bg-red-500":e.color==="yellow"?"bg-yellow-500":e.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:n.normalizeStyle({width:`${g.value}%`})},null,6)],2),n.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:e.modelValue,min:e.min,max:e.max,step:e.step,disabled:e.disabled,placeholder:e.placeholder,class:n.normalizeClass(f.value),onInput:y,onChange:k,onMousedown:p,onMouseup:B,onTouchstart:p,onTouchend:B},null,42,l1)]),e.marks.length>0?(n.openBlock(),n.createElementBlock("div",c1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.marks,x=>(n.openBlock(),n.createElementBlock("div",{key:x.value,class:"absolute flex flex-col items-center",style:n.normalizeStyle({left:`${C(x.value)}%`,transform:"translateX(-50%)"})},[_[0]||(_[0]=n.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),n.createElementVNode("span",d1,n.toDisplayString(x.label),1)],4))),128))])):n.createCommentVNode("",!0)]),l.value?(n.openBlock(),n.createElementBlock("div",u1,[_[1]||(_[1]=n.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[n.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)),n.createTextVNode(" "+n.toDisplayString(e.error),1)])):n.createCommentVNode("",!0),w.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent("style"),{key:2},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(w.value),1)]),_:1})):n.createCommentVNode("",!0)],2)),[[n.vShow,u.value]])}}),h1={class:"grid gap-3"},m1={key:0,class:"ml-1 text-destructive"},p1={class:"inline-flex items-center gap-3"},g1=["id","name","aria-checked","aria-label","disabled"],b1={key:0,class:"absolute inset-0 flex items-center justify-center"},y1={class:"relative z-10 flex items-center gap-2"},x1=["id","name","aria-checked","aria-label","disabled"],k1={key:0,class:"absolute inset-0 flex items-center justify-center"},w1={name:"DCodeSwitch"},Na=n.defineComponent({...w1,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(e,{emit:t}){const o=e,a=t,r=n.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(a("update:modelValue",f),a("change",f))}}),s=n.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=n.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=n.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=n.computed(()=>{if(o.disabled)return"bg-gray-300";if(!r.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=()=>{r.value=!r.value},u=n.computed(()=>r.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(n.openBlock(),n.createElementBlock("div",h1,[e.title?(n.openBlock(),n.createBlock(So,{key:0,class:"text-sm font-medium"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",m1,"*")):n.createCommentVNode("",!0)]),_:1})):n.createCommentVNode("",!0),n.createElementVNode("div",p1,[n.createVNode(n.unref(Ii),null,{default:n.withCtx(()=>[e.showTooltip?(n.openBlock(),n.createBlock(n.unref(Fi),{key:0,"delay-duration":200},{default:n.withCtx(()=>[n.createVNode(n.unref(Li),{"as-child":""},{default:n.withCtx(()=>[n.createElementVNode("button",{type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(n.openBlock(),n.createElementBlock("span",b1,[...h[0]||(h[0]=[n.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"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.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)])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,g1)]),_:1}),n.createVNode(n.unref(Ri),{side:"top","side-offset":8,class:n.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:n.withCtx(()=>[n.createElementVNode("span",y1,[n.createElementVNode("span",{class:n.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),n.createTextVNode(" "+n.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",id:e.id,name:e.name,"aria-checked":r.value?"true":"false","aria-label":e.label||"Toggle switch",disabled:e.disabled||e.loading,class:n.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":e.disabled,"cursor-wait":e.loading,"cursor-pointer":!e.disabled&&!e.loading}]),onClick:d},[n.createElementVNode("span",{class:n.normalizeClass([i.value,r.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[e.loading?(n.openBlock(),n.createElementBlock("span",k1,[...h[1]||(h[1]=[n.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"},[n.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),n.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)])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.Check),{key:0,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!r.value&&!e.loading?(n.openBlock(),n.createBlock(n.unref(ae.X),{key:1,class:n.normalizeClass([e.size==="small"?"w-2.5 h-2.5":e.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):n.createCommentVNode("",!0)]),_:1})],2)],10,x1))]),_:1})])]))}}),C1=["aria-busy"],B1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},E1={key:1,class:"flex justify-end"},_1=["for"],S1={key:0,class:"ml-1 text-destructive"},A1={class:"relative w-full group"},V1={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},D1={key:1},M1=["id","value","placeholder"],N1={key:1,class:"absolute inset-y-0 right-4 flex items-center"},v1={key:2,class:"absolute inset-y-0 right-4 flex items-center"},P1={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"},T1={key:1,class:"text-xs text-destructive"},va=n.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(e,{emit:t}){const o=n.useAttrs(),a=n.computed(()=>{var P;return((P=l.valueType)==null?void 0:P.toLowerCase())==="password"||o.type==="password"}),r=n.ref(!1),s=()=>{r.value=!r.value},i=t,l=e,c=n.computed(()=>o.label);n.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=n.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=n.computed(()=>{const P=o.required,U=o["aria-required"];return P===""||P===!0||P==="true"||(U==="true"||U===!0)}),h=n.computed(()=>{const{label:P,class:U,id:K,required:oe,"aria-required":xe,...Ee}=o;return Ee}),m=n.computed(()=>{var U,K;const P={...h.value};return((U=l.valueType)==null?void 0:U.toLowerCase())==="number"&&(P.type="text",P.inputmode="numeric",P.pattern="[0-9]*"),((K=l.valueType)==null?void 0:K.toLowerCase())==="email"&&(P.type="email",P.inputmode="email"),a.value&&(P.type=r.value?"text":"password"),l.disabled&&(P.disabled=!0),l.maxLength&&(P.maxlength=l.maxLength),l.minLength&&(P.minlength=l.minLength),l.maxValue&&(P.max=l.maxValue),l.minValue&&(P.min=l.minValue),P}),g=n.computed(()=>{const P=l.modelValue;return P==null||String(P).length===0}),y=n.computed(()=>l.clearable?l.hideClearWhenEmpty?!g.value:!0:!1),k=n.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=n.ref(String(l.modelValue??""));n.watch(()=>l.modelValue,P=>{const U=String(P??"");U!==p.value&&(p.value=U)});const B=n.ref(!1),C=n.ref(!1),w=P=>P.split(/(\s+)/).map(U=>{if(U.trim()==="")return U;const K=U.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}).join(""),E=P=>{const U=P.toLowerCase(),K=U.search(new RegExp("\\p{L}","u"));return K<0?U:U.slice(0,K)+U.charAt(K).toUpperCase()+U.slice(K+1)},_=P=>{switch(l.textCase){case"uppercase":return P.toUpperCase();case"lowercase":return P.toLowerCase();case"titlecase":return w(P);case"sentencecase":return E(P);case"none":default:return P}},x=P=>{if(!P)return null;const U=Array.isArray(P)?P.join(""):P;return U?new Set(U):null},b=n.computed(()=>x(l.allowChars)),A=(P,U)=>(P.lastIndex=0,P.test(U)),D=P=>{var ge;const U=(ge=l.valueType)==null?void 0:ge.toLowerCase();if(U==="free"||U==="email"||U==="password")return!0;const K=P===" ",oe=/\d/.test(P),xe=new RegExp("\\p{L}","u").test(P),Ee=new RegExp("\\p{N}","u").test(P);return U==="number"?oe:U==="letter"?xe||l.allowSpaces&&K:U==="letternumber"?xe||Ee||l.allowSpaces&&K:!0},M=P=>{let U="";for(const K of P){const oe=!!b.value&&b.value.has(K);l.pattern&&!oe&&!A(l.pattern,K)||!oe&&!D(K)||(U+=K)}return U},V=n.computed(()=>{const P=l.maxLength??o.maxlength??o.maxLength;let U=Number.NaN;return typeof P=="number"?U=P:typeof P=="string"&&(U=Number.parseInt(P,10)),Number.isFinite(U)&&U>0?U:-1}),N=n.computed(()=>p.value.length),T=n.computed(()=>l.showCharCount?V.value>0:!1),Y=P=>V.value>0?P.slice(0,V.value):P,R=P=>{const U=M(P),K=l.applyTextCaseToValue?_(U):U;return Y(K)};let X=null;const $=P=>{var U;if(P==="")return null;if(((U=l.valueType)==null?void 0:U.toLowerCase())==="number"&&l.returnNumber){const K=Number(P);return Number.isFinite(K)?K:null}return P},Q=P=>{p.value=P,i("update:modelValue",$(P))},L=(P,U)=>{const K=Y(U);C.value=!0,P.value=K,Q(K),queueMicrotask(()=>C.value=!1)},H=(P,U)=>{const K=P.selectionStart??P.value.length,oe=P.selectionEnd??P.value.length;if(V.value>0){const xe=P.value.length-(oe-K),Ee=V.value-xe;if(Ee<=0)return;U=U.slice(0,Ee)}P.setRangeText(U,K,oe,"end"),L(P,R(P.value))},J=P=>{var oe;if(!X||B.value||C.value||!((oe=P.inputType)!=null&&oe.startsWith("insert")))return;const U=P.data;if(U==null)return;const K=R(U);K!==U&&(P.preventDefault(),K.length>0&&H(X,K))},v=P=>{var oe;if(!X||B.value||C.value)return;const U=((oe=P.clipboardData)==null?void 0:oe.getData("text"))??"",K=R(U);K!==U&&(P.preventDefault(),K.length>0&&H(X,K))},O=P=>{if(!X||B.value||C.value)return;const U=P.target,K=U.value??"",oe=R(K);oe===K?Q(oe):L(U,oe)},W=()=>B.value=!0,q=()=>{if(B.value=!1,!X)return;const P=X.value??"",U=R(P);U===P?Q(U):L(X,U)};n.onMounted(()=>{if(X=document.getElementById(u.value),!X)return;X.addEventListener("beforeinput",J),X.addEventListener("paste",v),X.addEventListener("input",O),X.addEventListener("compositionstart",W),X.addEventListener("compositionend",q);const P=X.value??"",U=R(P);U===P?Q(U):L(X,U)}),n.onBeforeUnmount(()=>{X&&(X.removeEventListener("beforeinput",J),X.removeEventListener("paste",v),X.removeEventListener("input",O),X.removeEventListener("compositionstart",W),X.removeEventListener("compositionend",q),X=null)});const ne=()=>{p.value="",X&&(X.value=""),i("update:modelValue",null),i("clear")},se=n.computed(()=>T.value&&N.value>0),ie=n.computed(()=>`${N.value} / ${V.value}`),z=n.computed(()=>!!l.error);return(P,U)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[c.value?(n.openBlock(),n.createElementBlock("div",B1)):n.createCommentVNode("",!0),U[1]||(U[1]=n.createElementVNode("div",{class:"relative w-full"},[n.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),T.value?(n.openBlock(),n.createElementBlock("div",E1,[...U[0]||(U[0]=[n.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):n.createCommentVNode("",!0)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[c.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(c.value)+" ",1),f.value?(n.openBlock(),n.createElementBlock("span",S1,"*")):n.createCommentVNode("",!0)],8,_1)):n.createCommentVNode("",!0),n.createElementVNode("div",A1,[l.icon||l.prependInner||P.$slots["prepend-inner"]?(n.openBlock(),n.createElementBlock("div",V1,[n.renderSlot(P.$slots,"prepend-inner",{},()=>[l.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(n.openBlock(),n.createElementBlock("span",D1,n.toDisplayString(l.prependInner),1)):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0),n.createElementVNode("input",n.mergeProps({id:u.value,value:p.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${k.value}; padding-left: ${l.icon||l.prependInner||P.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${y.value||a.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-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 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",z.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,M1),a.value?(n.openBlock(),n.createElementBlock("div",N1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.value?n.unref(ae.Eye):n.unref(ae.EyeOff)),{class:"w-4 h-4"}))])])):n.createCommentVNode("",!0),y.value&&!a.value?(n.openBlock(),n.createElementBlock("div",v1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:ne}," ✕ ")])):n.createCommentVNode("",!0),se.value&&!z.value?(n.openBlock(),n.createElementBlock("p",P1,n.toDisplayString(ie.value),1)):n.createCommentVNode("",!0)]),z.value?(n.openBlock(),n.createElementBlock("p",T1,n.toDisplayString(l.error),1)):n.createCommentVNode("",!0)],64))],10,C1)),[[n.vShow,e.visible]])}}),O1=["aria-busy"],z1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},F1=["for"],R1={key:0,class:"ml-1 text-destructive"},I1={class:"relative w-full group"},L1=["id","value"],$1={key:0,class:"absolute top-1 right-2"},W1={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"},j1={key:1,class:"text-xs text-destructive"},qn=n.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(e,{emit:t}){const o=n.useAttrs(),a=t,r=e,s=n.computed(()=>o.label),i=n.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=n.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=n.computed(()=>{const z=o.required,P=o["aria-required"];return z===""||z===!0||z==="true"||(P==="true"||P===!0)}),u=n.computed(()=>{const{label:z,class:P,id:U,required:K,"aria-required":oe,...xe}=o;return xe}),f=n.computed(()=>{const z=o.maxlength;let P=Number.NaN;return typeof z=="number"?P=z:typeof z=="string"&&(P=Number.parseInt(z,10)),Number.isFinite(P)&&P>0?P:-1}),h=z=>f.value>0?z.slice(0,f.value):z,m=n.computed(()=>{const z=r.modelValue;return z==null||String(z).length===0}),g=n.computed(()=>r.clearable?r.hideClearWhenEmpty?!m.value:!0:!1),y=n.ref(String(r.modelValue??""));n.watch(()=>r.modelValue,z=>{const P=String(z??"");P!==y.value&&(y.value=P)});const k=n.ref(!1),p=n.ref(!1),B=z=>z.split(/(\s+)/).map(P=>{if(P.trim()==="")return P;const U=P.toLowerCase();return U.charAt(0).toUpperCase()+U.slice(1)}).join(""),C=z=>{const P=z.toLowerCase(),U=P.search(new RegExp("\\p{L}","u"));return U<0?P:P.slice(0,U)+P.charAt(U).toUpperCase()+P.slice(U+1)},w=z=>{switch(r.textCase){case"uppercase":return z.toUpperCase();case"lowercase":return z.toLowerCase();case"titlecase":return B(z);case"sentencecase":return C(z);case"none":default:return z}},E=n.computed(()=>{switch(r.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),_=z=>{if(!z)return null;const P=Array.isArray(z)?z.join(""):z;return P?new Set(P):null},x=n.computed(()=>_(r.allowChars)),b=(z,P)=>(z.lastIndex=0,z.test(P)),A=z=>{if(z===`
96
- `)return r.valueType!=="number";if(r.valueType==="free")return!0;const P=z===" ",U=/\d/.test(z),K=new RegExp("\\p{L}","u").test(z),oe=new RegExp("\\p{N}","u").test(z);return r.valueType==="number"?U:r.valueType==="letter"?K||r.allowSpaces&&P:r.valueType==="letternumber"?K||oe||r.allowSpaces&&P:!0},D=z=>{let P="";for(const U of z){const K=!!x.value&&x.value.has(U);r.pattern&&!K&&!b(r.pattern,U)||!K&&!A(U)||(P+=U)}return P},M=z=>{const P=D(z),U=r.applyTextCaseToValue?w(P):P;return h(U)};let V=null;const N=z=>{if(z==="")return null;if(r.valueType==="number"&&r.returnNumber){const P=z.replaceAll(`
97
- `,""),U=Number(P);return Number.isFinite(U)?U:null}return z},T=z=>{y.value=z,a("update:modelValue",N(z))},Y=(z,P)=>{const U=h(P);p.value=!0,z.value=U,T(U),queueMicrotask(()=>p.value=!1)},R=(z,P)=>{const U=z.selectionStart??z.value.length,K=z.selectionEnd??z.value.length;if(f.value>0){const oe=z.value.length-(K-U),xe=f.value-oe;if(xe<=0)return;P=P.slice(0,xe)}z.setRangeText(P,U,K,"end"),Y(z,M(z.value))},X=z=>{var K;if(!V||k.value||p.value||!((K=z.inputType)!=null&&K.startsWith("insert")))return;const P=z.data;if(P==null)return;const U=M(P);U!==P&&(z.preventDefault(),U.length>0&&R(V,U))},$=z=>{var K;if(!V||k.value||p.value)return;const P=((K=z.clipboardData)==null?void 0:K.getData("text"))??"",U=M(P);U!==P&&(z.preventDefault(),U.length>0&&R(V,U))},Q=async z=>{if(!V||k.value||p.value)return;const P=z.target,U=P.value??"",K=M(U);if(K===U){const oe=P.selectionStart??K.length,xe=P.selectionEnd??K.length;Y(P,K),await n.nextTick();try{P.setSelectionRange(oe,xe)}catch{}T(K)}else{const oe=P.selectionStart??K.length,xe=P.selectionEnd??K.length;Y(P,K),await n.nextTick();try{P.setSelectionRange(oe,xe)}catch{}}},L=()=>k.value=!0,H=()=>{if(k.value=!1,!V)return;const z=V.value??"",P=M(z);P===z?T(P):Y(V,P)};n.onMounted(()=>{if(V=document.getElementById(c.value),!V)return;V.addEventListener("beforeinput",X),V.addEventListener("paste",$),V.addEventListener("input",Q),V.addEventListener("compositionstart",L),V.addEventListener("compositionend",H);const z=V.value??"",P=M(z);P===z?T(P):Y(V,P)}),n.onBeforeUnmount(()=>{V&&(V.removeEventListener("beforeinput",X),V.removeEventListener("paste",$),V.removeEventListener("input",Q),V.removeEventListener("compositionstart",L),V.removeEventListener("compositionend",H),V=null)});const J=()=>{y.value="",V&&(V.value=""),a("update:modelValue",null),a("clear")},v=n.computed(()=>y.value.length),O=n.computed(()=>r.showCharCount?f.value>0:!1),W=n.computed(()=>O.value&&v.value>0),q=n.computed(()=>`${v.value} / ${f.value}`),ne=n.computed(()=>!!r.error),se=n.computed(()=>{const z=o.rows,P=typeof z=="number"?z:Number.parseInt(String(z??""),10);return Number.isFinite(P)&&P>0?P:3}),ie=n.computed(()=>({height:`${se.value*24+16}px`}));return(z,P)=>n.withDirectives((n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["flex flex-col gap-1 w-full",n.unref(o).class]),"aria-busy":r.skeleton},[r.skeleton?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[s.value?(n.openBlock(),n.createElementBlock("div",z1)):n.createCommentVNode("",!0),n.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:n.normalizeStyle(ie.value)},null,4)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[s.value?(n.openBlock(),n.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[n.createTextVNode(n.toDisplayString(s.value)+" ",1),d.value?(n.openBlock(),n.createElementBlock("span",R1,"*")):n.createCommentVNode("",!0)],8,F1)):n.createCommentVNode("",!0),n.createElementVNode("div",I1,[n.createElementVNode("textarea",n.mergeProps({id:c.value,value:y.value},u.value,{style:`text-transform: ${E.value}; padding-right: ${g.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-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 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",ne.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,L1),g.value?(n.openBlock(),n.createElementBlock("div",$1,[n.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:J}," ✕ ")])):n.createCommentVNode("",!0),W.value&&!ne.value?(n.openBlock(),n.createElementBlock("p",W1,n.toDisplayString(q.value),1)):n.createCommentVNode("",!0)]),ne.value?(n.openBlock(),n.createElementBlock("p",j1,n.toDisplayString(r.error),1)):n.createCommentVNode("",!0)],64))],10,O1)),[[n.vShow,i.value]])}}),xd=n.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(pe.AvatarRoot),{class:n.normalizeClass(n.unref(Se)(n.unref(U1)({size:e.size,shape:e.shape}),t.class))},{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),kd=n.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(pe.AvatarFallback),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),wd=n.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(pe.AvatarImage),n.mergeProps(t,{class:"h-full w-full object-cover"}),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),U1=wr("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"}}}),Pa=n.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(pe.Separator),n.mergeProps(n.unref(o),{class:n.unref(Se)("shrink-0 bg-border",t.orientation==="horizontal"?"h-px w-full":"w-px h-full",t.class)}),null,16,["class"]))}}),H1={class:"bg-card text-card-foreground"},q1={class:"pb-6 px-3"},G1={key:0,class:"flex justify-center p-8"},X1={key:1,class:"p-8 text-center text-red-500"},Y1={key:2,class:"relative"},K1={class:"space-y-6"},J1={class:"rounded-xl border bg-card text-card-foreground shadow"},Q1={class:"p-4"},Z1={class:"flex items-center justify-between gap-3"},eC={class:"font-medium"},tC={class:"text-xs text-muted-foreground"},nC={class:"mt-1 text-sm text-muted-foreground"},oC={class:"text-foreground"},aC={class:"text-foreground"},rC={class:"mt-1 text-xs text-muted-foreground"},sC={key:0,class:"mt-3 flex items-center gap-2 text-sm"},iC={class:"flex items-center justify-between gap-3"},lC={class:"font-medium"},cC={class:"text-xs text-muted-foreground"},dC={class:"mt-2 text-sm text-muted-foreground"},uC={class:"flex flex-wrap items-center justify-between gap-3"},fC={class:"flex items-center gap-3"},hC={class:"leading-tight"},mC={class:"text-sm font-medium"},pC={class:"text-xs text-muted-foreground"},gC={class:"flex items-center gap-2"},bC={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},yC={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},xC=["src"],kC={class:"flex-1"},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-left sm:text-center"},SC={class:"text-xs text-muted-foreground"},AC={class:"text-left sm:text-center"},VC={class:"text-xs text-muted-foreground"},DC={class:"text-left sm:text-center"},MC={class:"text-xs text-muted-foreground"},NC={class:"flex items-center justify-between gap-3"},vC={class:"font-medium"},PC={class:"text-xs text-muted-foreground"},TC={class:"mt-2 text-sm text-muted-foreground"},OC={class:"mt-3 flex items-center gap-3"},zC={class:"text-sm font-medium"},FC={class:"flex items-start justify-between gap-3"},RC={class:"font-medium"},IC={class:"mt-3 grid gap-2 text-sm"},LC={class:"flex items-center justify-between gap-3"},$C={class:"flex items-center gap-2 text-muted-foreground"},WC={class:"font-medium"},jC={class:"flex items-center justify-between gap-3"},UC={class:"flex items-center gap-2 text-muted-foreground"},HC={class:"font-medium"},qC={class:"flex items-center justify-between gap-3"},GC={class:"flex items-center gap-2 text-muted-foreground"},XC={class:"font-medium"},YC={class:"flex items-center justify-between"},KC={class:"flex items-center gap-2"},JC={class:"flex items-start justify-between gap-3"},QC={class:"flex items-center gap-2"},ZC={class:"font-medium"},eB={class:"mt-2 text-sm text-muted-foreground"},tB={key:0,class:"mt-1 text-sm text-muted-foreground"},nB={class:"flex flex-wrap items-center justify-between gap-3"},oB={class:"flex items-center gap-2"},aB={class:"text-xs text-muted-foreground"},Cd=n.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(e){const o=We.useBreakpoints(We.breakpointsTailwind).smaller("md");n.ref(!1);const a=e,r=n.ref(!1),s=n.ref(null),i=n.ref([]),l=n.computed(()=>i.value.length>0?i.value:a.items&&a.items.length>0?a.items:[]),c=async()=>{if(a.apiUrl){r.value=!0,s.value=null;try{const f=await fetch(a.apiUrl,{method:a.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const h=await f.json();Array.isArray(h)?i.value=h:h.data&&Array.isArray(h.data)?i.value=h.data:h.items&&Array.isArray(h.items)?i.value=h.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{r.value=!1}}};n.onMounted(()=>{a.apiUrl&&c()}),n.watch(()=>a.apiUrl,()=>{a.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:ae.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ae.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ae.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ae.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ae.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ae.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:ae.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(h=>{var m;return(m=h[0])==null?void 0:m.toUpperCase()}).join("");return(f,h)=>{const m=n.resolveComponent("ShoppingCart"),g=n.resolveComponent("DCodeBadge"),y=n.resolveComponent("RefreshCcw"),k=n.resolveComponent("MapPin");return n.openBlock(),n.createElementBlock("div",H1,[h[8]||(h[8]=n.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[n.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),n.createElementVNode("div",q1,[r.value?(n.openBlock(),n.createElementBlock("div",G1,[...h[0]||(h[0]=[n.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(n.openBlock(),n.createElementBlock("div",X1,n.toDisplayString(s.value),1)):(n.openBlock(),n.createElementBlock("div",Y1,[h[7]||(h[7]=n.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),n.createElementVNode("div",K1,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,(p,B)=>(n.openBlock(),n.createElementBlock("div",{key:B,class:"relative pl-14"},[n.createElementVNode("div",{class:n.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),n.createElementVNode("div",J1,[n.createElementVNode("div",Q1,[p.type==="flight"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("div",Z1,[n.createElementVNode("p",eC,n.toDisplayString(p.title),1),n.createElementVNode("p",tC,n.toDisplayString(p.meta),1)]),n.createElementVNode("p",nC,[n.createElementVNode("span",oC,n.toDisplayString(p.from),1),n.createVNode(n.unref(ae.ArrowRight),{class:"mx-2 inline h-4 w-4"}),n.createElementVNode("span",aC,n.toDisplayString(p.to),1)]),n.createElementVNode("p",rC,n.toDisplayString(p.time),1),p.fileName?(n.openBlock(),n.createElementBlock("div",sC,[n.createVNode(n.unref(ae.FileText),{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("span",null,n.toDisplayString(p.fileName),1)])):n.createCommentVNode("",!0)],64)):p.type==="interview"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",iC,[n.createElementVNode("p",lC,n.toDisplayString(p.title),1),n.createElementVNode("p",cC,n.toDisplayString(p.meta),1)]),n.createElementVNode("p",dC,n.toDisplayString(p.desc),1),n.createVNode(n.unref(Pa),{class:"my-4"}),n.createElementVNode("div",uC,[n.createElementVNode("div",fC,[n.createVNode(n.unref(xd),{class:"h-10 w-10"},{default:n.withCtx(()=>[p.avatarUrl?(n.openBlock(),n.createBlock(n.unref(wd),{key:0,src:p.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(kd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("div",hC,[n.createElementVNode("p",mC,n.toDisplayString(p.personName),1),n.createElementVNode("p",pC,n.toDisplayString(p.personRole),1)])]),n.createElementVNode("div",gC,[n.createVNode(n.unref(Et),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(Et),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(n.openBlock(),n.createElementBlock("div",bC,[n.createElementVNode("div",yC,[p.imgUrl?(n.openBlock(),n.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,xC)):(n.openBlock(),n.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),n.createElementVNode("div",kC,[n.createElementVNode("div",wC,[n.createElementVNode("p",CC,n.toDisplayString(p.title),1),n.createElementVNode("p",BC,n.toDisplayString(p.meta),1)]),n.createElementVNode("p",EC,n.toDisplayString(p.desc),1),n.createElementVNode("div",{class:n.normalizeClass(["mt-4 grid gap-3",n.unref(o)?"grid-cols-1":"grid-cols-3"])},[n.createElementVNode("div",_C,[h[1]||(h[1]=n.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),n.createElementVNode("p",SC,n.toDisplayString(p.customer),1)]),n.createElementVNode("div",AC,[h[2]||(h[2]=n.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),n.createElementVNode("p",VC,n.toDisplayString(p.price),1)]),n.createElementVNode("div",DC,[h[3]||(h[3]=n.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),n.createElementVNode("p",MC,n.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("div",NC,[n.createElementVNode("p",vC,n.toDisplayString(p.title),1),n.createElementVNode("p",PC,n.toDisplayString(p.meta),1)]),n.createElementVNode("p",TC,n.toDisplayString(p.desc),1),n.createElementVNode("div",OC,[n.createVNode(n.unref(xd),{class:"h-10 w-10"},{default:n.withCtx(()=>[p.avatarUrl?(n.openBlock(),n.createBlock(n.unref(wd),{key:0,src:p.avatarUrl},null,8,["src"])):n.createCommentVNode("",!0),n.createVNode(n.unref(kd),null,{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),n.createElementVNode("p",zC,n.toDisplayString(p.personName),1)])],64)):p.type==="server"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createElementVNode("div",FC,[n.createElementVNode("p",RC,n.toDisplayString(p.title),1),n.createVNode(g,{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(p.chipText??""),1)]),_:2},1024)]),n.createElementVNode("div",IC,[n.createElementVNode("div",LC,[n.createElementVNode("div",$C,[n.createVNode(n.unref(ae.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=n.createElementVNode("span",null,"IP Address",-1))]),n.createElementVNode("span",WC,n.toDisplayString(p.ip),1)]),n.createElementVNode("div",jC,[n.createElementVNode("div",UC,[n.createVNode(n.unref(ae.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=n.createElementVNode("span",null,"CPU",-1))]),n.createElementVNode("span",HC,n.toDisplayString(p.cpu),1)]),n.createElementVNode("div",qC,[n.createElementVNode("div",GC,[n.createVNode(n.unref(ae.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=n.createElementVNode("span",null,"Memory",-1))]),n.createElementVNode("span",XC,n.toDisplayString(p.memory),1)])]),n.createVNode(n.unref(Pa),{class:"my-4"}),n.createElementVNode("div",YC,[n.createElementVNode("div",KC,[n.createVNode(n.unref(Et),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Share2),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(Et),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(y,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:5},[n.createElementVNode("div",JC,[n.createElementVNode("div",QC,[n.createVNode(k,{class:"h-4 w-4 text-muted-foreground"}),n.createElementVNode("p",ZC,n.toDisplayString(p.title),1)]),n.createVNode(g,{variant:"destructive",class:"h-6"},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(p.chipText),1)]),_:2},1024)]),n.createElementVNode("p",eB,n.toDisplayString(p.desc1),1),p.desc2?(n.openBlock(),n.createElementBlock("p",tB,n.toDisplayString(p.desc2),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(Pa),{class:"my-4"}),n.createElementVNode("div",nB,[n.createElementVNode("div",oB,[n.createVNode(n.unref(Et),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Link),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(Et),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.MessageSquare),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(Et),{size:"icon",variant:"ghost"},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.User),{class:"h-4 w-4"})]),_:1})]),n.createElementVNode("p",aB,"Due date: "+n.toDisplayString(p.due),1)])],64)):n.createCommentVNode("",!0)])])]))),128))])]))])])}}}),rB={class:"dcode-upload-file"},sB={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"},iB={key:0,class:"text-xs text-gray-500 mt-1"},lB=["accept"],cB={key:1,class:"text-xs text-red-600 mt-1"},Bd=n.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=t,a=r=>{var i;const s=(i=r.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(r,s)=>(n.openBlock(),n.createElementBlock("div",rB,[e.label?(n.openBlock(),n.createBlock(Hn,{key:0,label:e.label},null,8,["label"])):n.createCommentVNode("",!0),n.createElementVNode("div",sB,[n.createVNode(n.unref(ae.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=n.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[n.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),n.createTextVNode(" or drag and drop ")],-1)),e.accept?(n.openBlock(),n.createElementBlock("p",iB,n.toDisplayString(e.accept),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{type:"file",class:"hidden",onChange:a,accept:e.accept},null,40,lB)]),e.errorMessage?(n.openBlock(),n.createElementBlock("p",cB,n.toDisplayString(e.errorMessage),1)):n.createCommentVNode("",!0)]))}}),dB=["onClick"],uB={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"},hB={key:1},mB={key:0,class:"text-white"},pB={key:1},gB={key:2},bB=["disabled","onClick"],yB={key:1,class:"mr-2 text-sm font-bold opacity-70"},xB={class:"whitespace-normal text-sm text-center leading-tight"},kB={class:"flex flex-col flex-1 min-w-0"},wB={class:"text-sm text-muted-foreground"},CB={class:"px-1"},BB=["disabled"],EB=["type"],_B=["disabled"],Cs=ht(n.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(e,{emit:t}){const o=e,a=t,r=Xe(),s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=n.ref(o.defaultTab),l=n.computed({get(){var x;if(typeof o.modelValue=="string"){const b=(x=o.tabs)==null?void 0:x.findIndex(A=>A.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(x){var b;if(i.value=x,typeof o.modelValue=="string"){const A=(b=o.tabs)==null?void 0:b[x];A?a("update:modelValue",A.key):a("update:modelValue",x)}else a("update:modelValue",x)}}),c=n.computed(()=>{var x;return((x=o.tabs)==null?void 0:x.length)??0}),d=n.computed(()=>{var x;return(x=o.tabs)==null?void 0:x[l.value]});function u(x){return c.value<=0?0:Math.min(Math.max(x,0),c.value-1)}function f(x){return x?typeof x=="string"?kt[x]||null:x:null}const h=n.reactive({});function m(x){return h[x.key]||(h[x.key]={loaded:!1,loading:!1,data:null,error:null}),h[x.key]}function g(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function y(x){const b=x.endpoint||{};return{apiModule:x.apiModule||b.apiModule,apiAction:x.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:x.apiParams}}function k(x){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[x];return!(!b||b.disabled)}async function p(x){if(typeof x.tab.fetchData=="function"){const T=await x.tab.fetchData(),Y=(T==null?void 0:T.data)??T;return(Y==null?void 0:Y.data)??Y}const b=y(x.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const D=g();let M;if(b.apiUrl)M=await s("","",D,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const T={...D,...b.apiParams};M=await s(b.apiModule,b.apiAction,T)}const V=(M==null?void 0:M.data)??M;return(V==null?void 0:V.data)??V}async function B(x,{force:b=!1}={}){const A=u(x),D=o.tabs[A];if(!D)return;const M=m(D);if(!(o.cache&&M.loaded&&!b)&&!M.loading){M.loading=!0,M.error=null;try{const V=await p({tabIndex:A,tab:D});M.data=V,M.loaded=!0,a("loaded",{tabIndex:A,tab:D,data:V})}catch(V){const N=typeof(V==null?void 0:V.message)=="string"&&V.message||typeof V=="string"&&V||"Failed to load tab data.";M.error=N,a("error",{tabIndex:A,tab:D,message:N})}finally{M.loading=!1}}}function C(x){const b=u(x);k(b)&&b!==l.value&&(l.value=b)}function w(x=l.value){return B(x,{force:!0})}function E(){const x=u(l.value-1);x!==l.value&&(l.value=x)}function _(){const x=u(l.value+1);x!==l.value&&(l.value=x)}return n.watch(()=>o.tabs,x=>{for(const b of x??[])m(b)},{immediate:!0}),n.watch(()=>l.value,async x=>{var A;const b=(A=o.tabs)==null?void 0:A[x];b&&a("change",{tabIndex:x,tab:b}),await B(x)},{immediate:!0}),n.watch(()=>o.autoFetchOnMount,async x=>{x&&await B(l.value)},{immediate:!0}),(x,b)=>{var A,D,M;return n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":e.isVertical,"pb-2":e.isWizard&&!e.isVertical}])},[n.createElementVNode("div",{class:n.normalizeClass({"mt-4":!e.isVertical||e.isWizard})},[e.isWizard?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["w-full relative flex overflow-visible rounded-lg",e.isVertical?"flex-col gap-2":""])},[e.isVertical?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:1},n.renderList(e.tabs,(V,N)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[n.createElementVNode("div",{class:n.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[N<l.value?"wizard-num-done":"",N===l.value?"wizard-num-active":N>l.value?"wizard-num-pending":""]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4"})):e.typeWizard==="number"||!V.icon&&e.typeWizard!=="none"?(n.openBlock(),n.createElementBlock("span",hB,[N<l.value?(n.openBlock(),n.createElementBlock("span",mB,"✓")):(n.openBlock(),n.createElementBlock("span",pB,n.toDisplayString(N+1),1))])):(n.openBlock(),n.createElementBlock("span",gB))],2),n.createElementVNode("span",{class:n.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",N===l.value?"wizard-text-active":"wizard-text-pending"])},n.toDisplayString(V.title),3)]))),128)):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(e.tabs,(V,N)=>(n.openBlock(),n.createElementBlock("div",{key:V.key,onClick:T=>C(N),style:n.normalizeStyle({zIndex:e.tabs.length-N}),class:"relative flex-1 group"},[n.createElementVNode("div",{class:n.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[N>0?"pl-8":"",N===l.value?"wizard-step-active":N<l.value?"wizard-step-done":"wizard-step-pending"]])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",uB,n.toDisplayString(N+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",fB,n.toDisplayString(V.title),1)],2),N<e.tabs.length-1?(n.openBlock(),n.createElementBlock("svg",{key:0,class:n.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[N===l.value?"wizard-svg-active":N<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[n.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):n.createCommentVNode("",!0)],12,dB))),128))],2)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex w-full",e.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.tabs,(V,N)=>(n.openBlock(),n.createElementBlock("button",{key:V.key,type:"button",disabled:!k(N),onClick:T=>C(N),class:n.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 wizard-btn-common",n.unref(Se)("border-b border-r",!e.isVertical&&N===e.tabs.length-1&&"border-r-0",N===l.value?"wizard-btn-active":"wizard-btn-pending",!k(N)&&"opacity-60 cursor-not-allowed",e.isVertical?"w-full justify-start border-r-0":"flex-1")])},[e.typeWizard==="icon"&&V.icon?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(f(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):e.typeWizard==="number"?(n.openBlock(),n.createElementBlock("span",yB,n.toDisplayString(N+1),1)):n.createCommentVNode("",!0),n.createElementVNode("span",xB,n.toDisplayString(V.title),1)],10,bB))),128))],2))],2)],2),e.isVertical?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(n.unref(Pa),{key:0})),n.createElementVNode("div",kB,[n.createElementVNode("div",{class:n.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":e.isVertical}])},[d.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[(A=h[d.value.key])!=null&&A.loading?n.renderSlot(x.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[b[1]||(b[1]=n.createElementVNode("div",{class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground"},"Loading...",-1))],!0):n.renderSlot(x.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(D=h[d.value.key])==null?void 0:D.data,loaded:(M=h[d.value.key])==null?void 0:M.loaded,reload:w},()=>[n.createElementVNode("div",wB,[b[2]||(b[2]=n.createTextVNode(" Slot ",-1)),n.createElementVNode("code",CB,"tab-"+n.toDisplayString(d.value.key),1),b[3]||(b[3]=n.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):n.createCommentVNode("",!0)],2),e.isWizard||e.showNavigation?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":e.isVertical}])},[n.createElementVNode("button",{type:"button",onClick:E,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,BB),l.value<c.value-1?(n.openBlock(),n.createElementBlock("button",{key:0,type:e.isSubmit?"submit":"button",onClick:_,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,EB)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"submit",disabled:e.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#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-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[e.loading?(n.openBlock(),n.createBlock(n.unref(ae.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(e.submitText),1)],8,_B))],2)):n.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-9379f062"]]),SB={class:"permission-menu w-full space-y-4"},AB={class:"bg-white dark:bg-zinc-900 text-neutral-700 dark:text-neutral-100 p-4"},VB={class:"flex items-center justify-between"},DB={class:"flex items-center gap-3 flex-1"},MB=["onClick"],NB={key:1,class:"w-7"},vB={key:2,class:"flex-shrink-0"},PB={class:"text-lg font-semibold flex-1"},TB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},OB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},zB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},FB=["checked","disabled","onChange"],RB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},IB={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},LB={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},$B={class:"bg-blue-500 dark:bg-primary-900 text-white p-3"},WB={class:"flex items-center justify-between"},jB={class:"flex items-center gap-3 flex-1"},UB={key:0,class:"flex-shrink-0"},HB={class:"text-base font-semibold flex-1"},qB={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},GB={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},XB=["checked","onChange"],YB={class:"text-xs font-medium"},KB={key:0,class:"p-3"},JB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},QB=["checked","disabled","onChange"],ZB={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},Bs=ht(n.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(e,{expose:t,emit:o}){const{t:a}=Yt.useI18n(),r=e,s=o,i=n.computed(()=>r.menuList&&r.menuList.length>0?r.menuList:r.treeData||[]),l=n.ref(new Map),c=n.ref(new Set),d=(D=!0)=>{(V=>{V.forEach(N=>{N.permission.forEach(T=>{const Y=`${N.id}-${T.id}-parent`,R=T.code==="VIEW"||T.name.toUpperCase()==="VIEW";l.value.has(Y)||l.value.set(Y,R||(D?N.checked??!1:!1))}),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{T.permission.forEach(Y=>{const R=`${T.id}-${Y.id}-child`,X=Y.code==="VIEW"||Y.name.toUpperCase()==="VIEW";l.value.has(R)||l.value.set(R,X||(D?T.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",r.modelValue),l.value.clear(),d(!1),r.modelValue&&r.modelValue.length>0&&r.modelValue.forEach(D=>{const M=D.menuId,V=D.actionsIds;i.value.forEach(N=>{N.id===M&&V.forEach(T=>{const Y=`${M}-${T}-parent`;l.value.set(Y,!0)}),N.detail&&N.detail.length>0&&N.detail.forEach(T=>{T.id===M&&V.forEach(Y=>{const R=`${M}-${Y}-child`;l.value.set(R,!0)})})})})};u(),n.watch(()=>r.modelValue,()=>{u()},{deep:!0}),n.watch(()=>i.value.length,(D,M)=>{M===0&&D>0&&u()});const f=D=>D.detail&&D.detail.length>0,h=D=>{c.value.has(D)?c.value.delete(D):c.value.add(D)},m=D=>c.value.has(D),g=(D,M,V=!1)=>{const N=`${D}-${M}-${V?"child":"parent"}`;return l.value.get(N)??!1},y=()=>{const D=_();s("update:modelValue",D.permissions)},k=(D,M,V,N=!1)=>{const T=V.target.checked,Y=`${D}-${M}-${N?"child":"parent"}`;l.value.set(Y,T),s("permission-change",D,M,T,!N),y()},p=D=>D.permission.filter(B),B=D=>D.code==="VIEW"||D.name.toUpperCase()==="VIEW",C=(D,M,V)=>{const N=V.target.checked;M.permission.forEach(T=>{if(B(T)){const R=`${M.id}-${T.id}-child`;l.value.set(R,!0);return}const Y=`${M.id}-${T.id}-child`;l.value.set(Y,N)}),l.value=new Map(l.value),s("menu-check",M.id,N),y()},w=(D,M=!1)=>{const V=M?D.permission:p(D);return!V||V.length===0?!1:V.every(N=>{const T=`${D.id}-${N.id}-${M?"child":"parent"}`;return l.value.get(T)??!1})},E=()=>{const D={};return i.value.forEach(M=>{var V;D[M.id]={name:M.name,parentPermissions:M.permission.map(N=>({id:N.id,name:N.name,checked:g(M.id,N.id,!1)})),children:((V=M.detail)==null?void 0:V.map(N=>({id:N.id,name:N.name,permissions:N.permission.map(T=>({id:T.id,name:T.name,checked:g(N.id,T.id,!0)}))})))||[]}}),D},_=()=>{const D=[],M=(V,N=!1)=>{const T=[];V.permission.forEach(Y=>{const R=`${V.id}-${Y.id}-${N?"child":"parent"}`;(l.value.get(R)??!1)&&T.push(Y.id)}),T.length>0&&D.push({menuId:V.id,actionsIds:T})};return i.value.forEach(V=>{M(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(N=>{M(N,!0)})}),{permissions:D}};return t({getCurrentStates:E,getPermissionsForDatabase:_,getAllPermissionsWithStatus:()=>{const D=[],M=(V,N=!1)=>{const T=V.permission.map(R=>{const X=`${V.id}-${R.id}-${N?"child":"parent"}`,$=l.value.get(X)??!1;return{id:R.id,name:R.name,checked:$}}),Y=T.filter(R=>R.checked).map(R=>R.id);D.push({menuId:V.id,menuName:V.name,actionsIds:Y,actions:T})};return i.value.forEach(V=>{M(V,!1),V.detail&&V.detail.length>0&&V.detail.forEach(N=>{M(N,!0)})}),{permissions:D}},permissionStates:l,expandAll:()=>{i.value.forEach(D=>{f(D)&&c.value.add(D.id)})},collapseAll:()=>{c.value.clear()}}),(D,M)=>(n.openBlock(),n.createElementBlock("div",SB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,V=>(n.openBlock(),n.createElementBlock("div",{key:V.id,class:n.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(V)}])},[n.createElementVNode("div",AB,[n.createElementVNode("div",VB,[n.createElementVNode("div",DB,[f(V)?(n.openBlock(),n.createElementBlock("button",{key:0,onClick:N=>h(V.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(V.id)?(n.openBlock(),n.createBlock(n.unref(ae.ChevronDown),{key:0,class:"w-5 h-5"})):(n.openBlock(),n.createBlock(n.unref(ae.ChevronRight),{key:1,class:"w-5 h-5"}))],8,MB)):(n.openBlock(),n.createElementBlock("div",NB)),e.showIcons&&V.icon?(n.openBlock(),n.createElementBlock("span",vB,[n.createElementVNode("i",{class:n.normalizeClass([V.icon,"text-2xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h3",PB,n.toDisplayString(V.name),1)])])]),V.permission&&V.permission.length>0&&!f(V)?(n.openBlock(),n.createElementBlock("div",TB,[n.createElementVNode("h4",OB,n.toDisplayString(n.unref(a)("common.permissions"))+": ",1),n.createElementVNode("div",zB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p(V),N=>(n.openBlock(),n.createElementBlock("label",{key:N.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-zinc-900 border border-gray-200 dark:border-neutral-700 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-zinc-800 transition-all group"},[n.createElementVNode("input",{type:"checkbox",checked:B(N)||g(V.id,N.id,!1),disabled:B(N),onChange:T=>k(V.id,N.id,T,!1),class:n.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",B(N)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,FB),n.createElementVNode("span",RB,n.toDisplayString(N.name),1)]))),128))])])):n.createCommentVNode("",!0),n.createVNode(n.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:n.withCtx(()=>[f(V)&&m(V.id)?(n.openBlock(),n.createElementBlock("div",IB,[n.createElementVNode("h4",LB,[M[0]||(M[0]=n.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),n.createTextVNode(" "+n.toDisplayString(n.unref(a)("common.subMenus")),1)]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(V.detail,N=>(n.openBlock(),n.createElementBlock("div",{key:N.id,class:"bg-white dark:bg-zinc-900 rounded-lg border border-gray-200 dark:border-neutral-700 overflow-hidden shadow-sm hover:shadow transition-shadow"},[n.createElementVNode("div",$B,[n.createElementVNode("div",WB,[n.createElementVNode("div",jB,[e.showIcons&&N.icon?(n.openBlock(),n.createElementBlock("span",UB,[n.createElementVNode("i",{class:n.normalizeClass([N.icon,"text-xl"])},null,2)])):n.createCommentVNode("",!0),n.createElementVNode("h5",HB,n.toDisplayString(N.name),1),N.path?(n.openBlock(),n.createElementBlock("span",qB,n.toDisplayString(N.path),1)):n.createCommentVNode("",!0),n.createElementVNode("label",GB,[n.createElementVNode("input",{type:"checkbox",checked:w(N,!0),onChange:T=>C(V,N,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,XB),n.createElementVNode("span",YB,n.toDisplayString(n.unref(a)("common.selectAll")),1)])])])]),N.permission&&N.permission.length>0?(n.openBlock(),n.createElementBlock("div",KB,[n.createElementVNode("div",JB,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.permission,T=>(n.openBlock(),n.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"},[n.createElementVNode("input",{type:"checkbox",checked:B(T)||g(N.id,T.id,!0),disabled:B(T),onChange:Y=>k(N.id,T.id,Y,!0),class:n.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",B(T)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,QB),n.createElementVNode("span",ZB,n.toDisplayString(T.name),1)]))),128))])])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-5f742a90"]]),eE={class:"space-y-4"},tE={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},nE={key:0,class:"text-danger-500"},oE={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"},rE={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},sE={class:"text-neutral-500 dark:text-neutral-400"},iE={key:3,class:"space-y-3"},lE={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},cE={class:"flex items-center gap-3"},dE={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},uE={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},fE={class:"flex items-center gap-2 text-sm font-medium"},hE={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},mE={class:"p-4"},pE={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},gE={class:"ml-2 flex-1 min-w-0"},bE=["for"],yE={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},xE={key:4,class:"mt-1 text-xs text-danger-600"},Es=n.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,{t:r}=Yt.useI18n(),s=n.ref(!0),i=n.ref([]),l=n.ref({}),c=n.ref([]),d=n.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(B=>({menuId:B.menuId,module:B.module,label:B.label||B.module,permissions:B.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const B={};return p.forEach(C=>{const w=C.key,E=w&&w.includes(".")?w.split(".")[0]:"other";B[E]||(B[E]={menuId:0,module:E,label:E,permissions:[]}),B[E].permissions.push({id:C.id,key:C.key,label:C.label,description:C.description})}),Object.values(B)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const B=[],C=(w,E="")=>{const _=E?`${E}.${w.name}`:w.name,x=_.toLowerCase().replace(/\s+/g,"_"),b=[];if(w.detail&&Array.isArray(w.detail)&&w.detail.forEach(A=>{b.push(A.id)}),w.permission&&w.permission.length>0){const A=w.permission.map(D=>({id:D.id,key:`${x}.${D.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${D.name} ${w.name}`,description:`Permission to ${D.name.toLowerCase()} ${w.name.toLowerCase()}`}));B.push({menuId:w.id,module:x,label:w.name,permissions:A,subMenuIds:b.length>0?b:void 0})}w.detail&&Array.isArray(w.detail)&&w.detail.forEach(A=>{C(A,_)})};return p.forEach(w=>C(w)),B}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 B=u(p);i.value=B;const C={},w=[],E={};B.forEach(x=>{x.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;E[A]=x.menuId})});const _=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(x=>{w.push(x.menuId),x.actionsIds&&Array.isArray(x.actionsIds)&&x.actionsIds.forEach(b=>_.add(b))}),B.forEach(x=>x.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;C[A]=_.has(A)})),l.value=C,c.value=w,d.value=E}catch{i.value=[]}finally{s.value=!1}},h=p=>p.permissions.filter(B=>{const C=typeof B.id=="string"?parseInt(B.id):B.id;return l.value[C]}).length,m=p=>p.permissions.every(B=>{const C=typeof B.id=="string"?parseInt(B.id):B.id;return l.value[C]}),g=p=>{const B=h(p);return B>0&&B<p.permissions.length},y=n.ref(!1),k=(p,B)=>{y.value=!0,p.permissions.map(E=>typeof E.id=="string"?parseInt(E.id):E.id),p.permissions.forEach(E=>{const _=typeof E.id=="string"?parseInt(E.id):E.id;l.value[_]=B});let C=o.modelValue?[...o.modelValue]:[],w=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(w=[...w,...p.subMenuIds],p.subMenuIds.forEach(E=>{const _=i.value.find(x=>x.menuId===E);_&&_.permissions.forEach(x=>{const b=typeof x.id=="string"?parseInt(x.id):x.id;l.value[b]=B})})),B?w.forEach(E=>{const _=i.value.find(x=>x.menuId===E);if(_){const x=_.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),b=C.findIndex(A=>A.menuId===E);b!==-1?C[b]={menuId:E,actionsIds:x}:C.push({menuId:E,actionsIds:x})}}):C=C.filter(E=>!w.includes(E.menuId)),c.value=C.map(E=>E.menuId),console.log("Full Result:",JSON.stringify(C,null,2)),a("update:modelValue",C),setTimeout(()=>{y.value=!1},100)};return n.watch(()=>o.modelValue,p=>{if(!p)return;const B=new Set,C=[];p.forEach(w=>{C.push(w.menuId),w.actionsIds&&Array.isArray(w.actionsIds)&&w.actionsIds.forEach(E=>B.add(E))}),Object.keys(l.value).forEach(w=>{const E=parseInt(w);l.value[E]=B.has(E)}),c.value=C}),n.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),n.watch(l,(p,B)=>{if(y.value)return;if(Object.keys(p).map(w=>parseInt(w)).filter(w=>p[w]!==(B==null?void 0:B[w])).length>0){let w=o.modelValue?[...o.modelValue]:[];const E={};Object.keys(p).forEach(_=>{const x=parseInt(_);if(p[x]){const b=d.value[x];console.log(`Permission ${x} belongs to Menu ${b}`),b!==void 0&&(E[b]||(E[b]=[]),E[b].push(x))}}),Object.keys(E).forEach(_=>{const x=parseInt(_),b=E[x],A=w.findIndex(D=>D.menuId===x);A!==-1?w[A]={menuId:x,actionsIds:b}:w.push({menuId:x,actionsIds:b})}),w=w.filter(_=>E[_.menuId]&&E[_.menuId].length>0),c.value=w.map(_=>_.menuId),console.log("Result:",JSON.stringify(w,null,2)),a("update:modelValue",w)}},{deep:!0}),n.onMounted(f),(p,B)=>(n.openBlock(),n.createElementBlock("div",eE,[e.label?(n.openBlock(),n.createElementBlock("label",tE,[n.createTextVNode(n.toDisplayString(e.label)+" ",1),e.required?(n.openBlock(),n.createElementBlock("span",nE,"*")):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0),s.value?(n.openBlock(),n.createElementBlock("div",oE,[n.createVNode(n.unref(ae.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),n.createElementVNode("span",aE,n.toDisplayString(n.unref(r)("common.loadingPermissions")),1)])):i.value.length===0?(n.openBlock(),n.createElementBlock("div",rE,[n.createElementVNode("p",sE,n.toDisplayString(n.unref(r)("common.noPermissions")),1)])):(n.openBlock(),n.createElementBlock("div",iE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value,C=>(n.openBlock(),n.createElementBlock("div",{key:C.module,class:"bg-white dark:bg-neutral-900 rounded-lg border border-neutral-200 dark:border-neutral-700 shadow-sm hover:shadow-md transition-shadow"},[n.createElementVNode("div",lE,[n.createElementVNode("div",cE,[n.createVNode(Gt,{modelValue:m(C),indeterminate:g(C),"onUpdate:modelValue":w=>k(C,!!w),disabled:e.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),n.createElementVNode("div",null,[n.createElementVNode("div",dE,n.toDisplayString(C.label||C.module),1),n.createElementVNode("div",uE,n.toDisplayString(h(C))+" "+n.toDisplayString(n.unref(r)("common.from"))+" "+n.toDisplayString(C.permissions.length)+" "+n.toDisplayString(n.unref(r)("common.selected")),1)])]),n.createElementVNode("div",fE,[n.createElementVNode("div",hE,n.toDisplayString(h(C))+"/"+n.toDisplayString(C.permissions.length),1)])]),n.createElementVNode("div",mE,[n.createElementVNode("div",pE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(C.permissions,w=>(n.openBlock(),n.createElementBlock("div",{key:w.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[n.createVNode(Gt,{modelValue:l.value[typeof w.id=="string"?parseInt(w.id):w.id],"onUpdate:modelValue":E=>l.value[typeof w.id=="string"?parseInt(w.id):w.id]=E,disabled:e.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),n.createElementVNode("div",gE,[n.createElementVNode("label",{for:`perm-${w.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},n.toDisplayString(w.label||w.key),9,bE),w.description?(n.openBlock(),n.createElementBlock("p",yE,n.toDisplayString(w.description),1)):n.createCommentVNode("",!0)])]))),128))])])]))),128))])),e.error?(n.openBlock(),n.createElementBlock("p",xE,n.toDisplayString(e.error),1)):n.createCommentVNode("",!0)]))}}),kE=(e,t="short",o="id-ID")=>{const a=typeof e=="string"?new Date(e):e,r=c=>String(c).padStart(2,"0"),s=c=>`${r(c.getHours())}:${r(c.getMinutes())}:${r(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return t==="time"?s(a):t==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a):t==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(a):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(a)},wE=e=>new Promise((t,o)=>{const a=document.createElement("textarea");a.value=e,a.style.top="0",a.style.left="0",a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy")?t():o(new Error("Copy command was unsuccessful"))}catch(r){o(r)}finally{document.body.removeChild(a)}}),CE=async e=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(e):wE(e),BE={key:0,class:"fixed inset-0 z-[100] flex justify-end"},EE={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"},_E={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},SE={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},AE={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},VE={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},DE={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},ME=n.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(e,{expose:t}){const o=n.ref(!1),a=()=>{o.value=!0,document.body.style.overflow="hidden"},r=()=>{o.value=!1,document.body.style.overflow=""};return t({open:a,close:r}),(s,i)=>(n.openBlock(),n.createElementBlock("div",null,[n.createElementVNode("div",{onClick:a},[n.renderSlot(s.$slots,"trigger",{},()=>[n.createVNode(Ue,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[o.value?(n.openBlock(),n.createElementBlock("div",BE,[n.createVNode(n.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:n.withCtx(()=>[o.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:r})):n.createCommentVNode("",!0)]),_:1}),n.createVNode(n.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:n.withCtx(()=>[o.value?(n.openBlock(),n.createElementBlock("div",EE,[n.createElementVNode("div",_E,[n.createElementVNode("div",null,[n.createElementVNode("h3",SE,n.toDisplayString(e.title),1),e.description?(n.openBlock(),n.createElementBlock("p",AE,n.toDisplayString(e.description),1)):n.createCommentVNode("",!0)]),n.createVNode(Ue,{variant:"ghost",size:"icon",onClick:r,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),n.createElementVNode("div",VE,[n.renderSlot(s.$slots,"default")]),n.createElementVNode("div",DE,[n.renderSlot(s.$slots,"footer")])])):n.createCommentVNode("",!0)]),_:3})])):n.createCommentVNode("",!0)]))]))}}),NE={key:0},vE=["value","name"],Ed=n.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const{locale:o}=Yt.useI18n(),a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:Gt,DCodeSwitch:Na,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Ma},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.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(h=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(h)&&!f.hasOwnProperty(h)&&(f[h]=u[h])}),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",NE,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,vE)])):(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),PE=n.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,a=t,r=We.useVModel(o,"modelValue",a,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>n.withDirectives((n.openBlock(),n.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>n.isRef(r)?r.value=l:null),class:n.normalizeClass(n.unref(Se)("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)),[[n.vModelText,n.unref(r)]])}}),TE=n.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(e,{emit:t}){const o=e,a=t,r=We.reactiveOmit(o,"class"),s=pe.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationRoot),n.mergeProps({"data-slot":"pagination"},n.unref(s),{class:o.class}),{default:n.withCtx(c=>[n.renderSlot(i.$slots,"default",n.normalizeProps(n.guardReactiveProps(c)))]),_:3},16,["class"]))}}),OE=n.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationList),n.mergeProps({"data-slot":"pagination-content"},n.unref(o),{class:n.unref(Se)("flex flex-row items-center gap-1",t.class)}),{default:n.withCtx(s=>[n.renderSlot(a.$slots,"default",n.normalizeProps(n.guardReactiveProps(s)))]),_:3},16,["class"]))}}),zE=n.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationEllipsis),n.mergeProps({"data-slot":"pagination-ellipsis"},n.unref(o),{class:n.unref(Se)("flex size-9 items-center justify-center",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default",{},()=>[n.createVNode(n.unref(ae.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=n.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),FE=n.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class","size"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationFirst),n.mergeProps({"data-slot":"pagination-first",class:n.unref(Se)(n.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),RE=n.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(e){const t=e,o=We.reactiveOmit(t,"class","size","isActive");return(a,r)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationListItem),n.mergeProps({"data-slot":"pagination-item"},n.unref(o),{class:n.unref(Se)(n.unref(Tn)({variant:"ghost",size:e.size}),e.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",t.class)}),{default:n.withCtx(()=>[n.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),IE=n.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class","size"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationLast),n.mergeProps({"data-slot":"pagination-last",class:n.unref(Se)(n.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),n.createVNode(n.unref(ae.ChevronRightIcon))])]),_:3},16,["class"]))}}),LE=n.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class","size"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationNext),n.mergeProps({"data-slot":"pagination-next",class:n.unref(Se)(n.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),n.createVNode(n.unref(ae.ChevronRightIcon))])]),_:3},16,["class"]))}}),$E=n.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class","size"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.PaginationPrev),n.mergeProps({"data-slot":"pagination-previous",class:n.unref(Se)(n.unref(Tn)({variant:"ghost",size:e.size}),"gap-1 px-2.5 sm:pr-2.5",t.class)},n.unref(a)),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronLeftIcon)),s[0]||(s[0]=n.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),WE=n.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(e,{emit:t}){const o=e,a=t,r=pe.useForwardPropsEmits(o,a);return(s,i)=>(n.openBlock(),n.createBlock(n.unref(pe.SelectRoot),n.normalizeProps(n.guardReactiveProps(n.unref(r))),{default:n.withCtx(()=>[n.renderSlot(s.$slots,"default")]),_:3},16))}}),jE=n.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(e,{emit:t}){const o=e,a=t,r=We.reactiveOmit(o,"class"),s=pe.useForwardPropsEmits(r,a);return(i,l)=>(n.openBlock(),n.createBlock(n.unref(pe.SelectPortal),null,{default:n.withCtx(()=>[n.createVNode(n.unref(pe.SelectContent),n.mergeProps({...n.unref(s),...i.$attrs},{class:n.unref(Se)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:n.withCtx(()=>[n.createVNode(n.unref(GE)),n.createVNode(n.unref(pe.SelectViewport),{class:n.normalizeClass(n.unref(Se)("p-1",e.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:n.withCtx(()=>[n.renderSlot(i.$slots,"default")]),_:3},8,["class"]),n.createVNode(n.unref(qE))]),_:3},16,["class"])]),_:3}))}}),UE={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},HE=n.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.SelectItem),n.mergeProps(n.unref(a),{class:n.unref(Se)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t.class)}),{default:n.withCtx(()=>[n.createElementVNode("span",UE,[n.createVNode(n.unref(pe.SelectItemIndicator),null,{default:n.withCtx(()=>[n.createVNode(n.unref(ae.Check),{class:"h-4 w-4"})]),_:1})]),n.createVNode(n.unref(pe.SelectItemText),null,{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),qE=n.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.SelectScrollDownButton),n.mergeProps(n.unref(a),{class:n.unref(Se)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronDown))])]),_:3},16,["class"]))}}),GE=n.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.SelectScrollUpButton),n.mergeProps(n.unref(a),{class:n.unref(Se)("flex cursor-default items-center justify-center py-1",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default",{},()=>[n.createVNode(n.unref(ae.ChevronUp))])]),_:3},16,["class"]))}}),XE=n.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(e){const t=e,o=We.reactiveOmit(t,"class"),a=pe.useForwardProps(o);return(r,s)=>(n.openBlock(),n.createBlock(n.unref(pe.SelectTrigger),n.mergeProps(n.unref(a),{class:n.unref(Se)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",t.class)}),{default:n.withCtx(()=>[n.renderSlot(r.$slots,"default"),n.createVNode(n.unref(pe.SelectIcon),{"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),YE=n.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(e){const t=e;return(o,a)=>(n.openBlock(),n.createBlock(n.unref(pe.SelectValue),n.normalizeProps(n.guardReactiveProps(t)),{default:n.withCtx(()=>[n.renderSlot(o.$slots,"default")]),_:3},16))}}),Do={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"},lt={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},KE={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},JE={dangerouslyHTMLString:!1,multiple:!0,position:Do.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},QE={rtl:!1,newestOnTop:!1,toastClassName:""},_d={...JE,...QE};lt.DEFAULT;var Ve=(e=>(e[e.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",e[e.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",e.CSS_NAMESPACE="Toastify",e))(Ve||{}),_s=(e=>(e.ENTRANCE_ANIMATION_END="d",e))(_s||{});const ZE={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},e2={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},t2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},n2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},Sd="Toastify--animate Toastify__none-enter";function Ad(e,t=!1){var o;let a=ZE;if(!e||typeof e=="string")switch(e){case"flip":a=n2;break;case"zoom":a=t2;break;case"slide":a=e2;break}else a=e;if(t)a.enter=Sd;else if(a.enter===Sd){const r=(o=a.exit.split("__")[1])==null?void 0:o.split("-")[0];a.enter=`Toastify--animate Toastify__${r}-enter`}return a}function o2(e){return e.containerId||String(e.position)}const Ta="will-unmount";function a2(e=Do.TOP_RIGHT){return!!document.querySelector(`.${Ve.CSS_NAMESPACE}__toast-container--${e}`)}function r2(e=Do.TOP_RIGHT){return`${Ve.CSS_NAMESPACE}__toast-container--${e}`}function s2(e,t,o=!1){const a=[`${Ve.CSS_NAMESPACE}__toast-container`,`${Ve.CSS_NAMESPACE}__toast-container--${e}`,o?`${Ve.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Yn(t)?t({position:e,rtl:o,defaultClassName:a}):`${a} ${t||""}`}function i2(e){var t;const{position:o,containerClassName:a,rtl:r=!1,style:s={}}=e,i=Ve.CSS_NAMESPACE,l=r2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((t=d.className)!=null&&t.includes(Ta)),f=c||document.createElement("div"),h=document.createElement("div");h.className=s2(o,a,r),h.dataset.testid=`${Ve.CSS_NAMESPACE}__toast-container--${o}`,h.id=o2(e);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const g=s[m];h.style[m]=g}return c||(f.className=Ve.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function Ss(e){var t,o,a;const r=typeof e=="string"?e:((t=e.currentTarget)==null?void 0:t.id)||((o=e.target)==null?void 0:o.id),s=document.getElementById(r);s&&s.removeEventListener("animationend",Ss,!1);try{Mo[r].unmount(),(a=document.getElementById(r))==null||a.remove(),delete Mo[r],delete tt[r]}catch{}}const Mo=n.reactive({});function l2(e,t){const o=document.getElementById(String(t));o&&(Mo[o.id]=e)}function As(e,t=!0){const o=String(e);if(!Mo[o])return;const a=document.getElementById(o);a&&a.classList.add(Ta),t?(d2(e),a&&a.addEventListener("animationend",Ss,!1)):Ss(o),xt.items=xt.items.filter(r=>r.containerId!==e)}function c2(e){for(const t in Mo)As(t,e);xt.items=[]}function Vd(e,t){const o=document.getElementById(e.toastId);if(o){let a=e;a={...a,...Ad(a.transition)};const r=a.appendPosition?`${a.exit}--${a.position}`:a.exit;o.className+=` ${r}`,t&&t(o)}}function d2(e){for(const t in tt)if(t===e)for(const o of tt[t]||[])Vd(o)}function u2(e){const t=Xn().find(o=>o.toastId===e);return t==null?void 0:t.containerId}function Vs(e){return document.getElementById(e)}function f2(e){const t=Vs(e.containerId);return t&&t.classList.contains(Ta)}function Dd(e){var t;const o=n.isVNode(e.content)?n.toRaw(e.content.props):null;return o??n.toRaw((t=e.data)!=null?t:{})}function h2(e){return e?xt.items.filter(t=>t.containerId===e).length>0:xt.items.length>0}function m2(){if(xt.items.length>0){const e=xt.items.shift();Oa(e==null?void 0:e.toastContent,e==null?void 0:e.toastProps)}}const tt=n.reactive({}),xt=n.reactive({items:[]});function Xn(){const e=n.toRaw(tt);return Object.values(e).reduce((t,o)=>[...t,...o],[])}function p2(e){return Xn().find(t=>t.toastId===e)}function Oa(e,t={}){if(f2(t)){const o=Vs(t.containerId);o&&o.addEventListener("animationend",Ds.bind(null,e,t),!1)}else Ds(e,t)}function Ds(e,t={}){const o=Vs(t.containerId);o&&o.removeEventListener("animationend",Ds.bind(null,e,t),!1);const a=tt[t.containerId]||[],r=a.length>0;if(!r&&!a2(t.position)){const s=i2(t),i=n.createApp(I2,t);t.useHandler&&t.useHandler(i),i.mount(s),l2(i,s.id)}r&&!t.updateId&&(t.position=a[0].position),n.nextTick(()=>{t.updateId?pt.update(t):pt.add(e,t)})}const pt={add(e,t){const{containerId:o=""}=t;o&&(tt[o]=tt[o]||[],tt[o].find(a=>a.toastId===t.toastId)||setTimeout(()=>{var a,r;t.newestOnTop?(a=tt[o])==null||a.unshift(t):(r=tt[o])==null||r.push(t),t.onOpen&&t.onOpen(Dd(t))},t.delay||0))},remove(e){if(e){const t=u2(e);if(t){const o=tt[t];let a=o.find(r=>r.toastId===e);tt[t]=o.filter(r=>r.toastId!==e),!tt[t].length&&!h2(t)&&As(t,!1),m2(),n.nextTick(()=>{a!=null&&a.onClose&&(a.onClose(Dd(a)),a=void 0)})}}},update(e={}){const{containerId:t=""}=e;if(t&&e.updateId){tt[t]=tt[t]||[];const o=tt[t].find(s=>s.toastId===e.toastId),a=(o==null?void 0:o.position)!==e.position||(o==null?void 0:o.transition)!==e.transition,r={...e,disabledEnterTransition:!a,updateId:void 0};pt.dismissForce(e==null?void 0:e.toastId),setTimeout(()=>{Fe(r.content,r)},e.delay||0)}},clear(e,t=!0){e?As(e,t):c2(t)},dismissCallback(e){var t;const o=(t=e.currentTarget)==null?void 0:t.id,a=document.getElementById(o);a&&(a.removeEventListener("animationend",pt.dismissCallback,!1),setTimeout(()=>{pt.remove(o)}))},dismiss(e){if(e){const t=Xn();for(const o of t)if(o.toastId===e){Vd(o,a=>{a.addEventListener("animationend",pt.dismissCallback,!1)});break}}},dismissForce(e){if(e){const t=Xn();for(const o of t)if(o.toastId===e){const a=document.getElementById(e);a&&(a.remove(),a.removeEventListener("animationend",pt.dismissCallback,!1),pt.remove(e));break}}}},g2=n.reactive({useHandler:void 0}),Md=n.reactive({}),za=n.reactive({});function Nd(){return Math.random().toString(36).substring(2,9)}function b2(e){return typeof e=="number"&&!isNaN(e)}function Ms(e){return typeof e=="string"}function Yn(e){return typeof e=="function"}function Fa(...e){return n.mergeProps(...e)}function Ra(e){return typeof e=="object"&&(!!(e!=null&&e.render)||!!(e!=null&&e.setup)||typeof(e==null?void 0:e.type)=="object")}function y2(e={}){Md[`${Ve.CSS_NAMESPACE}-default-options`]=e}function vd(){return Md[`${Ve.CSS_NAMESPACE}-default-options`]||_d}function x2(){const e=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||e?"dark":"light"}var Ia=(e=>(e[e.Enter=0]="Enter",e[e.Exit=1]="Exit",e))(Ia||{});const Pd={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:Do.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:lt.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}},k2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:lt.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}},w2=n.defineComponent({name:"ProgressBar",props:k2,setup(e,{attrs:t}){const o=n.ref(),a=n.computed(()=>e.hide?"true":"false"),r=n.computed(()=>({...t.style||{},animationDuration:`${e.autoClose===!0?5e3:e.autoClose}ms`,animationPlayState:e.isRunning?"running":"paused",opacity:e.hide||e.autoClose===!1?0:1,transform:e.controlledProgress?`scaleX(${e.progress})`:"none"})),s=n.computed(()=>[`${Ve.CSS_NAMESPACE}__progress-bar`,e.controlledProgress?`${Ve.CSS_NAMESPACE}__progress-bar--controlled`:`${Ve.CSS_NAMESPACE}__progress-bar--animated`,`${Ve.CSS_NAMESPACE}__progress-bar-theme--${e.theme}`,`${Ve.CSS_NAMESPACE}__progress-bar--${e.type}`,e.rtl?`${Ve.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=n.computed(()=>`${s.value} ${(t==null?void 0:t.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{e.isIn&&e.closeToast&&e.autoClose!==!1&&(e.closeToast(),l())},d=n.computed(()=>e.controlledProgress?null:c),u=n.computed(()=>e.controlledProgress?c:null);return n.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>n.createVNode("div",{ref:o,role:"progressbar","aria-hidden":a.value,"aria-label":"notification timer",class:i.value,style:r.value},null)}}),C2=n.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(e){return()=>n.createVNode("button",{class:`${Ve.CSS_NAMESPACE}__close-button ${Ve.CSS_NAMESPACE}__close-button--${e.theme}`,type:"button",onClick:t=>{t.stopPropagation(),e.closeToast&&e.closeToast(t)},"aria-label":e.ariaLabel},[n.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[n.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)])])}}),La=({theme:e,type:t,path:o,...a})=>n.createVNode("svg",n.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:e==="colored"?"currentColor":`var(--toastify-icon-color-${t})`}},a),[n.createVNode("path",{d:o},null)]);function B2(e){return n.createVNode(La,n.mergeProps(e,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function E2(e){return n.createVNode(La,n.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function _2(e){return n.createVNode(La,n.mergeProps(e,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function S2(e){return n.createVNode(La,n.mergeProps(e,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function A2(){return n.createVNode("div",{class:`${Ve.CSS_NAMESPACE}__spinner`},null)}const $a={info:E2,warning:B2,success:_2,error:S2,spinner:A2},V2=e=>e in $a;function D2({theme:e,type:t,isLoading:o,icon:a}){let r;const s=!!o||t==="loading",i={theme:e,type:t};if(s&&(a===void 0||typeof a=="boolean"))return $a.spinner();if(a!==!1){if(Ra(a))r=n.toRaw(a);else if(Yn(a)){const l=a;i.type=s?"loading":t,r=l(i),r=!r&&s?$a.spinner():r}else n.isVNode(a)?r=n.cloneVNode(a,i):Ms(a)||b2(a)?r=a:V2(t)&&(r=$a[t](i));return r}}const M2=()=>{};function N2(e,t,o=Ve.COLLAPSE_DURATION){const{scrollHeight:a,style:r}=e,s=o;requestAnimationFrame(()=>{r.minHeight="initial",r.height=a+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,s)})})}function v2(e){const t=n.ref(!1),o=n.ref(!1),a=n.ref(!1),r=n.ref(Ia.Enter),s=n.reactive({...e,appendPosition:e.appendPosition||!1,collapse:typeof e.collapse>"u"?!0:e.collapse,collapseDuration:e.collapseDuration||Ve.COLLAPSE_DURATION}),i=s.done||M2,l=n.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=n.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=n.computed(()=>e.pauseOnHover?{onMouseenter:k,onMouseleave:y}:{});function u(){const B=l.value.split(" ");h().addEventListener(_s.ENTRANCE_ANIMATION_END,y,{once:!0});const C=E=>{const _=h();E.target===_&&(_.dispatchEvent(new Event(_s.ENTRANCE_ANIMATION_END)),_.removeEventListener("animationend",C),_.removeEventListener("animationcancel",C),r.value===Ia.Enter&&E.type!=="animationcancel"&&_.classList.remove(...B))},w=()=>{const E=h();E.classList.add(...B),E.addEventListener("animationend",C),E.addEventListener("animationcancel",C)};e.pauseOnFocusLoss&&m(),w()}function f(){if(!h())return;const B=()=>{const w=h();w.removeEventListener("animationend",B),s.collapse?N2(w,i,s.collapseDuration):i()},C=()=>{const w=h();r.value=Ia.Exit,w&&(w.className+=` ${c.value}`,w.addEventListener("animationend",B))};o.value||(a.value?B():setTimeout(C))}function h(){return e.toastRef.value}function m(){document.hasFocus()||k(),window.addEventListener("focus",y),window.addEventListener("blur",k)}function g(){window.removeEventListener("focus",y),window.removeEventListener("blur",k)}function y(){(!e.loading.value||e.isLoading===void 0)&&(t.value=!0)}function k(){t.value=!1}function p(B){B&&(B.stopPropagation(),B.preventDefault()),o.value=!1}return n.watchEffect(f),n.watchEffect(()=>{const B=Xn();o.value=B.findIndex(C=>C.toastId===s.toastId)>-1}),n.watchEffect(()=>{e.isLoading!==void 0&&(e.loading.value?k():y())}),n.onMounted(u),n.onUnmounted(()=>{e.pauseOnFocusLoss&&g()}),{isIn:o,isRunning:t,hideToast:p,eventHandlers:d}}function P2(e){if(!e||typeof e!="object"||Array.isArray(e)||e.__v_isVNode)return!1;const t=e;return["title","content"].some(o=>o in t)}const T2=n.defineComponent({name:"ToastItem",inheritAttrs:!1,props:Pd,setup(e){const t=n.ref(),o=n.computed(()=>!!e.isLoading),a=n.computed(()=>e.progress!==void 0&&e.progress!==null),r=n.computed(()=>D2(e)),s=n.computed(()=>[`${Ve.CSS_NAMESPACE}__toast`,`${Ve.CSS_NAMESPACE}__toast-theme--${e.theme}`,`${Ve.CSS_NAMESPACE}__toast--${e.type}`,e.rtl?`${Ve.CSS_NAMESPACE}__toast--rtl`:void 0,e.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=v2({toastRef:t,loading:o,done:()=>{pt.remove(e.toastId)},...Ad(e.transition,e.disabledEnterTransition),...e});function u(){const f=e.content;if(P2(f)){const h=[];return f.title!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-title",class:`${Ve.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(n.createVNode("div",{"data-testid":"toast-text-content",class:`${Ve.CSS_NAMESPACE}__toast-text-content`},[f.content])),n.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ve.CSS_NAMESPACE}__toast-text`},[h])}return Ra(f)?n.h(n.toRaw(f),{toastProps:n.toRaw(e),closeToast:c,data:e.data,...e.expandCustomProps?e.contentProps:{contentProps:e.contentProps||{}}}):Yn(f)?f({toastProps:n.toRaw(e),closeToast:c,data:e.data}):e.dangerouslyHTMLString?n.h("div",{innerHTML:f}):f}return()=>n.createVNode("div",n.mergeProps({id:e.toastId,class:s.value,style:e.toastStyle||{},ref:t,"data-testid":`toast-item-${e.toastId}`,onClick:f=>{e.closeOnClick&&c(),e.onClick&&e.onClick(f)}},d.value),[n.createVNode("div",{role:e.role,"data-testid":"toast-body",class:`${Ve.CSS_NAMESPACE}__toast-body ${e.bodyClassName||""}`},[r.value!=null&&n.createVNode("div",{"data-testid":`toast-icon-${e.type}`,class:[`${Ve.CSS_NAMESPACE}__toast-icon`,e.isLoading?"":`${Ve.CSS_NAMESPACE}--animate-icon ${Ve.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Ra(r.value)?n.h(n.toRaw(r.value),{theme:e.theme,type:e.type}):Yn(r.value)?r.value({theme:e.theme,type:e.type}):r.value]),n.createVNode("div",{"data-testid":"toast-content"},[u()])]),(e.closeButton===void 0||e.closeButton===!0)&&n.createVNode(C2,{theme:e.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Ra(e.closeButton)?n.h(n.toRaw(e.closeButton),{closeToast:c,type:e.type,theme:e.theme}):Yn(e.closeButton)?e.closeButton({closeToast:c,type:e.type,theme:e.theme}):null,n.createVNode(w2,{className:e.progressClassName,style:e.progressStyle,rtl:e.rtl,theme:e.theme,isIn:l.value,type:e.type,hide:e.hideProgressBar,isRunning:i.value,autoClose:e.autoClose,controlledProgress:a.value,progress:e.progress,closeToast:e.isLoading?void 0:c},null)])}}),Wa="vue3-toastify:url-change";let ja=0,No;function O2(){if(!(typeof window>"u")&&za.lastUrl!==window.location.href){za.lastUrl=window.location.href;const e=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:vd().clearOnUrlChange!==!1,t=Object.values(tt).reduce((o,a)=>(Array.isArray(a)&&o.push(...a),o),[]);for(const o of t)o.toastId&&e(o)&&pt.dismiss(o.toastId);xt.items=xt.items.filter(o=>!e(o.toastProps))}}function z2(){const{history:e}=window,t=e.pushState,o=e.replaceState;return e.pushState=function(...a){const r=t.apply(this,a);return window.dispatchEvent(new Event(Wa)),r},e.replaceState=function(...a){const r=o.apply(this,a);return window.dispatchEvent(new Event(Wa)),r},()=>{e.pushState=t,e.replaceState=o}}function F2(){if(typeof window>"u"||No)return;const e=z2(),t=()=>O2();window.addEventListener(Wa,t),window.addEventListener("popstate",t),window.addEventListener("hashchange",t),No=()=>{e(),window.removeEventListener(Wa,t),window.removeEventListener("popstate",t),window.removeEventListener("hashchange",t),No=void 0}}function R2(){No&&(No(),za.lastUrl="")}const I2=n.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:Pd,setup(e){const t=n.computed(()=>e.containerId),o=n.computed(()=>tt[t.value]||[]),a=n.computed(()=>o.value.filter(r=>r.position===e.position));return n.onMounted(()=>{typeof window<"u"&&(ja+=1,F2())}),n.onUnmounted(()=>{typeof window<"u"&&ja>0&&(ja-=1,ja===0&&R2())}),()=>n.createVNode(n.Fragment,null,[a.value.map(r=>{const{toastId:s=""}=r;return n.createVNode(T2,n.mergeProps({key:s},r),null)})])}});let Ns=!1;const Td={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Od(){const e=[];return Xn().forEach(t=>{const o=document.getElementById(t.containerId);o&&!o.classList.contains(Ta)&&e.push(t)}),e}function L2(e){const t=Od().length,o=e??0;return o>0&&t+xt.items.length>=o}function $2(e){L2(e.limit)&&!e.updateId&&xt.items.push({toastId:e.toastId,containerId:e.containerId,toastContent:e.content,toastProps:e})}function dn(e,t,o={}){if(Ns)return;o=Fa(vd(),{type:t},n.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Nd()),o={...o,...o.type==="loading"?Td:{},content:e,containerId:o.containerId||String(o.position)};const a=Number(o==null?void 0:o.progress);return!isNaN(a)&&a<0&&(o.progress=0),a>1&&(o.progress=1),o.theme==="auto"&&(o.theme=x2()),$2(o),za.lastUrl=window.location.href,o.multiple?xt.items.length?o.updateId&&Oa(e,o):Oa(e,o):(Ns=!0,Fe.clearAll(void 0,!1),setTimeout(()=>{Oa(e,o)},0),setTimeout(()=>{Ns=!1},390)),o.toastId}const Fe=(e,t)=>dn(e,lt.DEFAULT,t);Fe.info=(e,t)=>dn(e,lt.DEFAULT,{...t,type:lt.INFO}),Fe.error=(e,t)=>dn(e,lt.DEFAULT,{...t,type:lt.ERROR}),Fe.warning=(e,t)=>dn(e,lt.DEFAULT,{...t,type:lt.WARNING}),Fe.warn=Fe.warning,Fe.success=(e,t)=>dn(e,lt.DEFAULT,{...t,type:lt.SUCCESS}),Fe.loading=(e,t)=>dn(e,lt.DEFAULT,Fa(t,Td)),Fe.dark=(e,t)=>dn(e,lt.DEFAULT,Fa(t,{theme:Gn.DARK})),Fe.remove=e=>{e?pt.dismiss(e):pt.clear()},Fe.clearAll=(e,t)=>{n.nextTick(()=>{pt.clear(e,t)})},Fe.isActive=e=>{let t=!1;return t=Od().findIndex(o=>o.toastId===e)>-1,t},Fe.update=(e,t={})=>{setTimeout(()=>{const o=p2(e);if(o){const a=n.toRaw(o),{content:r}=a,s={...a,...t,toastId:t.toastId||e,updateId:Nd()},i=s.render||r;delete s.render,dn(i,s.type,s)}},0)},Fe.done=e=>{Fe.update(e,{isLoading:!1,progress:1})},Fe.promise=W2;function W2(e,{pending:t,error:o,success:a},r){var s,i,l;let c;const d={...r||{},autoClose:!1};t&&(c=Ms(t)?Fe.loading(t,d):Fe.loading(t.render,{...d,...t}));const u={autoClose:(s=r==null?void 0:r.autoClose)!=null?s:!0,closeOnClick:(i=r==null?void 0:r.closeOnClick)!=null?i:!0,closeButton:(l=r==null?void 0:r.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,g,y)=>{if(g==null){Fe.remove(c);return}const k={type:m,...u,...r,data:y},p=Ms(g)?{render:g}:g;return c?Fe.update(c,{...k,...p,isLoading:!1}):Fe(p.render,{...k,...p,isLoading:!1}),y},h=Yn(e)?e():e;return h.then(m=>{f("success",a,m)}).catch(m=>{f("error",o,m)}),h}Fe.POSITION=Do,Fe.THEME=Gn,Fe.TYPE=lt,Fe.TRANSITIONS=KE;const j2={install(e,t={}){g2.useHandler=t.useHandler||(()=>{}),U2(t)}};typeof window<"u"&&(window.Vue3Toastify=j2);function U2(e={}){const t=Fa(_d,e);y2(t)}const H2={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:[]},q2={key:0,class:"inline-block"},vs=ht(n.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(e){const t=e,o=n.computed(()=>t.icon?kt[t.icon]:null),a=n.computed(()=>t.visible??!0),r=n.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[t.size]||f.sm}),s=n.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[t.size]||f.sm}),i=n.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[t.size]||f.sm}),l=n.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[t.variant]||f.default}),c=n.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"})[t.variant]||"bg-current"),d=n.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return Se(f[t.size]||f.sm,"rounded animate-pulse bg-muted")}),u=n.computed(()=>Se("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",t.pill?"rounded-full":"rounded-md",r.value,l.value,t.class));return(f,h)=>a.value?(n.openBlock(),n.createElementBlock("div",q2,[e.skeleton?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(d.value)},null,2)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(u.value)},[e.dot?(n.openBlock(),n.createElementBlock("span",{key:0,class:n.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):n.createCommentVNode("",!0),o.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(o.value),{key:1,class:n.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):n.createCommentVNode("",!0),n.renderSlot(f.$slots,"default",{},()=>[n.createElementVNode("span",null,n.toDisplayString(e.text),1)],!0)],2))])):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-42cc5d83"]]),G2={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"},Y2={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},K2={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]"},J2={class:"relative w-full sm:w-64"},Q2={key:0,class:"relative"},Z2={class:"flex flex-col h-full"},e_={key:0,class:"flex-1 overflow-y-auto py-4"},t_={class:"grid grid-cols-1 gap-4 px-1"},n_={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"},o_={class:"flex justify-end gap-2 w-full"},a_={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},r_={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},s_={class:"dcode-table w-full"},i_={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},l_=["onClick"],c_={key:0,class:"flex items-center justify-center w-full"},d_={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},u_={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},f_={key:0,class:"px-3 py-0.5"},h_={key:1},m_=["colspan"],p_={class:"flex flex-col items-center gap-2"},g_={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},b_={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},y_={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},x_={key:0,class:"flex items-center justify-center"},k_={key:0,class:"px-3 py-0.5 !text-center"},w_={key:0,class:"flex items-center justify-center gap-1.5"},C_={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},B_=["colspan"],E_={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"},__={class:"flex items-center gap-4"},S_={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},A_={class:"text-neutral-900 dark:text-neutral-100 font-medium"},V_={class:"text-neutral-900 dark:text-neutral-100 font-medium"},D_={class:"text-neutral-900 dark:text-neutral-100 font-medium"},M_={class:"flex-shrink-0"},N_={class:"space-y-4"},v_={class:"text-gray-600 dark:text-gray-400"},P_={class:"grid grid-cols-1 gap-4 py-4 px-1"},T_={class:"flex items-end gap-2"},Kn=n.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}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(e,{expose:t,emit:o}){var Xd,Yd,Kd,Jd,Qd,Zd;const a=e,r=o,s=n.getCurrentInstance(),{apiUrl:i}=Xe(),{locale:l}=Yt.useI18n();let c={query:{},params:{},path:""};try{const S=Mn.useRoute();S?c=S:(Kd=(Yd=(Xd=s==null?void 0:s.appContext)==null?void 0:Xd.config)==null?void 0:Yd.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:S=>{console.warn("Router push() logic called from fallback:",S),typeof S=="string"&&S.startsWith("/")&&(window.location.href=S)}};try{const S=Mn.useRouter();S?d=S:(Zd=(Qd=(Jd=s==null?void 0:s.appContext)==null?void 0:Jd.config)==null?void 0:Qd.globalProperties)!=null&&Zd.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=n.ref(""),f=n.ref(1),h=n.ref(a.perPage),m=n.ref({key:"",direction:"asc"}),g=n.ref([]),y=n.ref(!1),k=n.ref(0),p=n.ref({}),B=n.ref([]),C=n.ref(null),w=n.ref(!0),E=n.ref([]),_=n.ref([]),x=n.ref([]),b=n.ref(!1),A=n.ref(!1),D=n.ref({}),M=n.ref(null),V=n.ref(null),N=n.ref(null),T=n.ref([]),Y=n.computed(()=>{if(G.value.length===0)return!1;const S=G.value.map(I=>{const ee=z.value.find(j=>j.type==="CHECKBOX"),F=(ee==null?void 0:ee.keyCheckbox)||"id";return I[F]}).filter(I=>I!=null);return S.length===0?!1:S.every(I=>T.value.includes(I))}),R=n.computed(()=>{if(G.value.length===0)return!1;const S=z.value.find(j=>j.type==="CHECKBOX"),I=(S==null?void 0:S.keyCheckbox)||"id",ee=G.value.map(j=>j[I]).filter(j=>j!=null),F=ee.filter(j=>T.value.includes(j)).length;return F>0&&F<ee.length}),X=S=>{const I=z.value.find(j=>j.type==="CHECKBOX"),ee=(I==null?void 0:I.keyCheckbox)||"id",F=S[ee];return F!==void 0&&T.value.includes(F)},$=S=>{const I=z.value.find(j=>j.type==="CHECKBOX"),ee=(I==null?void 0:I.keyCheckbox)||"id",F=G.value.map(j=>j[ee]).filter(j=>j!=null);if(S){const j=new Set([...T.value,...F]);T.value=Array.from(j)}else T.value=T.value.filter(j=>!F.includes(j))},Q=(S,I)=>{const ee=z.value.find(Z=>Z.type==="CHECKBOX"),F=(ee==null?void 0:ee.keyCheckbox)||"id",j=S[F];j!=null&&(I?T.value.includes(j)||T.value.push(j):T.value=T.value.filter(Z=>Z!==j))};n.watch(T,S=>{var ee;r("update:selection",S);const I=Y.value||S.length>1;(ee=_.value)!=null&&ee.length&&_.value.forEach(F=>{var j;(j=F.fieldActionGlobal)!=null&&j.length&&F.fieldActionGlobal.forEach(Z=>{var Ae,Ge;const be=F.endpoint||((Ae=F.propsActionGlobal)==null?void 0:Ae.endpointPropAction)||F.propsActionGlobal,Ne=(Ge=be==null?void 0:be.keyParam)==null?void 0:Ge[0];(Ne&&Z.model===Ne||!Ne&&/^(id|ids|idAuditTrail)/i.test(Z.model))&&I&&Z.model&&(D.value[Z.model]=S)})})},{deep:!0});const L=S=>Array.from({length:S}).map((I,ee)=>{const F={id:ee+1,no:ee+1};return z.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?F[j.keyCheckbox||"id"]=ee+1:j.type==="BADGE"||j.type==="badge"||j.condition?F[j.key]=j.condition&&j.condition.length>0?j.condition[0].value:"Active":F[j.key]=`Data ${j.label} ${ee+1}`)}),F}),H=S=>S&&typeof S=="string"&&S.trim()?S:void 0,J=n.computed(()=>{var S,I,ee,F;return H((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiModule)||H((F=(ee=C.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiModule)||a.apiModule}),v=n.computed(()=>{var S,I,ee,F;return H((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiAction)||H((F=(ee=C.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiAction)||a.apiAction}),O=n.computed(()=>{var S,I,ee,F;return H((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiMethod)||H((F=(ee=C.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiMethod)||a.apiMethod||"POST"}),W=n.computed(()=>{var S,I,ee,F;return H((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiUrl)||H((F=(ee=C.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiUrl)||a.apiUrl}),q=n.computed(()=>a.permissionBase||""),ne=n.computed(()=>!x.value||x.value.length===0?[]:[...x.value].sort((S,I)=>(S.seq||0)-(I.seq||0))),se=S=>{var Z,be,Ne;const I=(S==null?void 0:S.column)||((Z=S==null?void 0:S.props)==null?void 0:Z.column)||((be=S==null?void 0:S.propsFieldGlobal)==null?void 0:be.column)||((Ne=S==null?void 0:S.propsFieldCustom)==null?void 0:Ne.column);if(!I)return"col-span-1";const ee=I.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"}[ee]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${I}, returned=${j}`),j},ie=()=>{let S=null;if(a.tableConfig&&(S=a.tableConfig),S){C.value=S,S.headers&&(B.value=S.headers.map(F=>{var be,Ne,we,Ae,Ge,Le,Ie,Ot,Dn,Ja;if(F.key==="action"||((be=F.custom)==null?void 0:be.type)==="ACTION"||((Ne=F.custom)==null?void 0:Ne.type)==="action"){const un=((we=F.custom)==null?void 0:we.actionCustom)||((Ae=F.custom)==null?void 0:Ae.action);return un&&(E.value=un.map(Xt=>{const et=Xt.propsActionCustom||Xt.props||{},Qa=Xt.propCustomMessage||{};return{permission:Xt.permission,label:l.value==="id"?et.labelID:et.labelEN,tooltip:l.value==="id"?et.tooltipID||et.labelID:et.tooltipEN||et.labelEN,icon:et.icon,variant:et.variant||"ghost",bgColor:et.bgColor,action:et.actionType||et.key,route:et.route,path:et.path,endpoint:et.endpointPropAction,requiredCondition:Xt.requiredCondition||!1,propCustomCondition:Xt.propCustomCondition||[],openDialog:Xt.openDialog||!1,fieldActionCustom:(Xt.fieldActionCustom||[]).map(Za=>{const Fs=Za.propsFieldCustom||Za.propsFieldGlobal||Za.props||{};return{...Za,props:{...Fs,endpoint:Fs.endpointComponent||Fs.endpoint}}}),requireConfirm:Xt.requireConfirm||et.requireConfirm||!1,confirmTitle:l.value==="id"?Qa.titleID||et.confirmTitleID||"Konfirmasi":Qa.titleEN||et.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?Qa.messageID||et.confirmMessageID||"Apakah Anda yakin?":Qa.messageEN||et.confirmMessageEN||"Are you sure?"}})),null}let j;const Z=((Ge=F.custom)==null?void 0:Ge.conditionBadge)||((Le=F.custom)==null?void 0:Le.condition);return(((Ie=F.custom)==null?void 0:Ie.type)==="BADGE"||((Ot=F.custom)==null?void 0:Ot.type)==="badge")&&Z&&(j=Z.map(un=>({value:un.value,label:l.value==="id"?un.labelID:un.labelEN,color:un.color,variant:un.variant}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(Dn=F.custom)==null?void 0:Dn.type,condition:j,keyCheckbox:(Ja=F.custom)==null?void 0:Ja.keyCheckbox}}).filter(F=>F!==null));const I=S.filters||S.filter;I&&Array.isArray(I)&&(x.value=I.map(F=>({...F,props:F.propsFilters||F.props||{}})),x.value.forEach(F=>{p.value[F.model]=""}));const ee=S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",ee),ee&&Array.isArray(ee)?(_.value=ee.map(F=>{const j=F.propsActionGlobal||F.props||{};return{key:j.key,permission:F.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||F.endpoint,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(Z=>{const be=Z.propsFieldGlobal||Z.props||{};return{...Z,props:{...be,endpoint:be.endpointComponent||be.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",_.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(w.value=S.pagination)}};n.watch(()=>a.tableConfig,()=>{ie()},{deep:!0,immediate:!0});const z=n.computed(()=>a.dynamicColumns||a.configKey||a.tableConfig?B.value:a.columns||[]),P=n.computed(()=>a.hasActions||E.value.length>0),U=n.computed(()=>a.dummyMode?!1:J.value||W.value?y.value:a.loading),K=n.computed(()=>!!J.value||!!W.value),oe=n.computed(()=>[]),xe=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!a.permissionChecker,effectivePath:q.value}),a.menuPermissions&&a.menuPermissions.length>0){const I=c.path,ee=a.menuPermissions.find(F=>I.startsWith(F.path));if(ee&&ee.actions){const F=ee.actions.find(j=>j.code===S.toUpperCase());return F?F.checked:!1}return!1}if(a.permissionChecker){const I=a.permissionChecker(q.value,S);return console.log("[DEBUG] permissionChecker result:",I),I}return oe.value.some(I=>I.code===S)},Ee=(S,I)=>{if(!S.visibilityCondition)return!0;const{field:ee,operator:F,value:j}=S.visibilityCondition,Z=De(I,ee);switch(F){case"equals":return Z===j;case"notEquals":return Z!==j;case"in":return Array.isArray(j)&&j.includes(Z);case"notIn":return Array.isArray(j)&&!j.includes(Z);case"greaterThan":return Z>j;case"lessThan":return Z<j;case"contains":return String(Z).includes(String(j));default:return!0}},ge=n.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:_.value,ignorePermissions:a.ignorePermissions}),_.value.length===0)return _.value;const S=_.value.filter(I=>{if(a.ignorePermissions)return!0;if(!I.permission)return console.log("[DEBUG] Action no permission, showing:",I.label),!0;if(a.checkPermission){const F=a.checkPermission(I.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(a.permissions){const F=a.permissions.includes(I.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const ee=xe(I.permission);return console.log("[DEBUG] Internal permission check:",{label:I.label,permission:I.permission,hasPerm:ee}),ee});return console.log("[DEBUG] Filtered header actions:",S.length),S}),fe=n.computed(()=>E.value.length===0?E.value:E.value.filter(S=>a.ignorePermissions||!S.permission?!0:a.checkPermission?a.checkPermission(S.permission):a.permissions?a.permissions.includes(S.permission):xe(S.permission))),Me=S=>fe.value.filter(I=>Ee(I,S)),qe=(S,I)=>{var j,Z;if(S.requiredCondition&&((j=S.propCustomCondition)==null?void 0:j.length)>0){const be=De(I,"status"),Ne=S.propCustomCondition.find(we=>we.value===be);if(Ne)return Ne.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const ee=De(I,S.colorCondition.field),F=(Z=S.colorCondition.conditions)==null?void 0:Z.find(be=>be.value===ee);return(F==null?void 0:F.bgColor)||S.bgColor||"primary"},Ze=S=>{const I=(S||"left").toLowerCase();return I==="center"?"justify-center":I==="right"?"justify-end":"justify-start"},nt={ToggleLeft:ae.ToggleLeft,SquarePen:ae.SquarePen,Trash2:ae.Trash2,Eye:ae.Eye,CheckCircle:ae.CheckCircle,Plus:ae.Plus,Download:ae.Download,RefreshCw:ae.RefreshCw,Search:ae.Search,SlidersHorizontal:ae.SlidersHorizontal},Ke=S=>S?kt[S]?kt[S]:nt[S]||null:null,G=n.computed(()=>a.dummyMode?z.value.length>0?L(10):[]:K.value?g.value.map((S,I)=>({...S,no:(f.value-1)*h.value+I+1})):ce.value),le=n.computed(()=>a.dummyMode?10:K.value?k.value:te.value.length),ye=n.computed(()=>le.value===0?0:(f.value-1)*h.value+1),ze=n.computed(()=>{const S=f.value*h.value;return S>le.value?le.value:S}),De=(S,I)=>{if(!(!S||!I))return I in S?S[I]:I.split(".").reduce((ee,F)=>ee&&ee[F],S)},te=n.computed(()=>{if(K.value)return[];if(!u.value)return a.data;const S=u.value.toLowerCase();return a.data.filter(I=>z.value.some(ee=>{const F=De(I,ee.key);return F==null?!1:String(F).toLowerCase().includes(S)}))}),re=n.computed(()=>K.value?[]:m.value.key?[...te.value].sort((I,ee)=>{const F=De(I,m.value.key),j=De(ee,m.value.key);if(F===j)return 0;let Z=0;return typeof F=="number"&&typeof j=="number"?Z=F-j:Z=String(F).localeCompare(String(j)),m.value.direction==="asc"?Z:-Z}):te.value),ce=n.computed(()=>{if(K.value)return[];const S=(f.value-1)*h.value,I=S+h.value;return re.value.slice(S,I).map((ee,F)=>({...ee,no:S+F+1}))}),ke=n.computed(()=>K.value?Object.values(p.value).some(S=>!!S):!!u.value),je=[10,25,50,100],Tt=()=>{K.value&&(p.value={...p.value,keyword:u.value},f.value=1,it())};let Ha;const Id=()=>{a.enableQuickSearch&&(clearTimeout(Ha),Ha=setTimeout(()=>{Tt()},500))};let qa;const Ld=()=>{clearTimeout(qa),qa=setTimeout(()=>{K.value&&it()},1e3)};n.watch(u,()=>{a.enableQuickSearch&&K.value&&Id()});const it=async()=>{if(!a.dummyMode&&K.value&&!(!J.value&&!W.value))try{y.value=!0;const S={page:f.value,perPage:h.value,...p.value,...a.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(ee=>{(S[ee]===""||S[ee]===null||S[ee]===void 0)&&delete S[ee]});let I;J.value?I=await i(J.value,v.value,S):W.value&&(I=await i(W.value,O.value,S)),$d(I)}catch(S){console.error("DataTable fetch error",S),y.value=!1}},$d=S=>{console.log("DataTable handleResponseData:",S),S&&(a.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(B.value=S.columns.map(I=>({key:I.key||I.field||I.name,label:I.label||I.header||I.name,width:I.width,align:I.align||"LEFT",sortable:I.sortable!==!1,type:I.type,condition:I.condition,format:I.format}))),S.data&&Array.isArray(S.data)?(g.value=S.data,S.totalData?k.value=S.totalData:S.maxPage?k.value=S.maxPage*h.value:k.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(g.value=S,k.value=S.length):S.users?(g.value=S.users,k.value=S.users.length):S.items&&Array.isArray(S.items)?(g.value=S.items,k.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(g.value=S.list,k.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(g.value=S.rows,k.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(g.value=S.result,k.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),g.value=[],k.value=0)),y.value=!1};n.onUnmounted(()=>{clearTimeout(Ha),clearTimeout(qa)});const Ga=()=>{Object.keys(p.value).forEach(S=>{p.value[S]=""}),u.value="",f.value=1,it()},Wd=()=>{f.value=1,it()},Xa=(S,I)=>{const ee=De(S,I.key);let F={variant:"secondary",class:"",label:ee};if(I.condition){const j=I.condition.find(Z=>{const be=(Ne,we)=>typeof Ne=="string"&&typeof we=="string"?Ne.toLowerCase().trim()===we.toLowerCase().trim():Ne==we;return typeof ee=="object"&&ee!==null?be(Z.value,ee.code)||be(Z.value,ee.id):be(Z.value,ee)});if(j){if(j.variant&&(F.variant=j.variant),F.label=j.label||(typeof ee=="object"?ee.name||ee.code:ee),j.color){const Z=j.color.toLowerCase(),be=F.variant==="outline",Ne={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"},we={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"},Ae={danger:"destructive",secondary:"secondary",primary:"default"};be?we[Z]&&(F.class=we[Z]):Ae[Z]?F.variant=Ae[Z]:Ne[Z]&&(F.class=Ne[Z])}}else F.label=typeof ee=="object"?(ee==null?void 0:ee.name)||(ee==null?void 0:ee.code)||"-":ee}else F.label=typeof ee=="object"?(ee==null?void 0:ee.name)||(ee==null?void 0:ee.code)||"-":ee;return F},jd=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),r("update:sort",m.value)},zs=S=>{S!==f.value&&(f.value=S,K.value&&it(),r("update:page",S))},Ud=S=>{h.value=S,f.value=1,K.value&&it()},Hd=S=>{const I=Math.random()*15+75;if(S.width){const ee=parseInt(String(S.width));return ee<100?`${Math.floor(ee*(Math.random()*.2+.7))}px`:`${I}%`}return`${I}%`},Ya=()=>{u.value="",p.value={},f.value=1,it()},SS=S=>{var I;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const ee=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${ee}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){V.value=S,N.value=null,D.value={};const ee=S.fieldActionGlobal||S.field||[];ee.length&&ee.forEach(F=>{var be;const j=S.endpoint||((be=S.propsActionGlobal)==null?void 0:be.endpointPropAction)||S.propsActionGlobal,Z=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;Z&&F.model===Z||!Z&&/^(id|ids|idAuditTrail)/i.test(F.model)?D.value[F.model]=T.value:D.value[F.model]||(D.value[F.model]="")}),A.value=!0}else r("action",{action:((I=S.propsActionCustom)==null?void 0:I.key)||S.key||"create",row:null,selection:T.value})},AS=async(S,I)=>{var ee,F,j,Z;if(S.requireConfirm){M.value={button:S,row:I},b.value=!0;return}if(S.openDialog){V.value=S,N.value=I,D.value={};const be=z.value.find(Ae=>Ae.type==="CHECKBOX"),Ne=(be==null?void 0:be.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(Ae=>{/^(id|ids|idAuditTrail)/i.test(Ae.model)?D.value[Ae.model]=[I[Ne]]:S.action==="showToken"&&Ae.model==="token"?D.value[Ae.model]=I.token!==void 0?I.token:"":I[Ae.model]!==void 0?D.value[Ae.model]=I[Ae.model]:D.value[Ae.model]=""});const we=S.endpoint||((ee=S.propsActionGlobal)==null?void 0:ee.endpointPropAction)||((F=S.propsActionCustom)==null?void 0:F.endpointPropAction)||((j=S.props)==null?void 0:j.endpointPropAction);if(((Z=we==null?void 0:we.apiMethod)==null?void 0:Z.toUpperCase())==="GET"&&we.apiUrl){y.value=!0;const{apiUrl:Ae}=Xe(),Ge={};we.keyParam&&Array.isArray(we.keyParam)&&we.keyParam.forEach((Le,Ie)=>{const Ot=we.model&&Ie===0?we.model:Le;I[Le]!==void 0&&(Ge[Ot]=I[Le])}),Object.keys(Ge).length===0&&I.id&&(Ge.id=I.id),Ae(we.apiUrl,"GET",Ge).then(Le=>{let Ie=Le;if(Le&&Le.data!==void 0?Ie=Le.data:Le&&Le.result!==void 0&&(Ie=Le.result),Ie!=null){if(typeof Ie=="string")D.value.hasOwnProperty("token")&&(D.value.token=Ie);else if(typeof Ie=="object"&&(Ie.item&&(Ie=Ie.item),Array.isArray(Ie)&&(Ie=Ie[0]||{}),Object.keys(Ie).forEach(Ot=>{D.value[Ot]=Ie[Ot]}),!D.value.token)){const Ot=Object.keys(Ie).find(Dn=>Dn.toLowerCase().includes("token"));if(Ot)D.value.token=Ie[Ot];else{const Dn=Object.values(Ie).filter(Ja=>typeof Ja=="string");Dn.length===1&&(D.value.token=Dn[0])}}}A.value=!0}).catch(Le=>{console.error("Fetch Data Failed",Le)}).finally(()=>{y.value=!1});return}A.value=!0;return}qd(S,I)},qd=(S,I)=>{if(S.route){if(S.path){const j=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${j}`,S.path)}let ee=S.route;ee.includes(":")?ee=ee.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,Z)=>I[Z]||I.id||Z):I.id&&(ee=`${ee.replace(/\/$/,"")}/${I.id}`);const F={};S.path&&(F.code=S.path),d==null||d.push({path:ee,query:F})}else if(S.endpoint&&S.endpoint.apiUrl){y.value=!0;const{apiUrl:ee}=Xe(),F=S.endpoint.apiUrl,j=S.endpoint.apiMethod||"POST",Z={};S.endpoint.keyParam&&Array.isArray(S.endpoint.keyParam)&&S.endpoint.keyParam.forEach((be,Ne)=>{const we=S.endpoint.model&&Ne===0?S.endpoint.model:be;I[be]!==void 0&&(Z[we]=I[be])}),Object.keys(Z).length===0&&I.id&&(Z.id=I.id),ee(F,j,Z).then(()=>{it(),r("action",{action:S.action||"success",row:I})}).catch(be=>{console.error("Action Failed",be)}).finally(()=>{y.value=!1})}else r("action",{action:S.action,row:I})},VS=()=>{M.value&&(qd(M.value.button,M.value.row),Gd())},DS=()=>{var S,I,ee;if(V.value){const F=V.value,j=F.endpoint||((S=F.propsActionGlobal)==null?void 0:S.endpointPropAction)||F.propsActionGlobal;let Z=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!Z){const Ae=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(Ge=>/^(id|ids|idAuditTrail)/i.test(Ge.model));Z=Ae?Ae.model:"ids"}let be=null,Ne=!1;if(N.value){const we=z.value.find(Le=>Le.type==="CHECKBOX"),Ae=(we==null?void 0:we.keyCheckbox)||"id",Ge=N.value[Ae];j!=null&&j.apiUrl&&(be={...D.value},be[Z]||(be[Z]=[Ge]),Ne=!0)}else j!=null&&j.apiUrl&&(be={...D.value},be[Z]||(be[Z]=T.value||[]),Ne=!0);if(Ne&&be&&(j!=null&&j.apiUrl)){if(((I=j==null?void 0:j.apiMethod)==null?void 0:I.toUpperCase())==="GET"){A.value=!1,N.value||(T.value=[]);return}const{apiUrl:we}=Xe(),Ae=j.apiUrl,Ge=j.apiMethod||"POST";we(Ae,Ge,be).then(()=>{A.value=!1,N.value||(T.value=[]),it(),r("action",{action:"success",row:null})}).catch(Le=>{console.error("Action Failed",Le)})}else if(N.value){const we=z.value.find(Ie=>Ie.type==="CHECKBOX"),Ae=(we==null?void 0:we.keyCheckbox)||"id",Ge=N.value[Ae],Le={...D.value};Le[Z]||(Le[Z]=[Ge]),r("action",{action:V.value.action,row:Le}),A.value=!1}else{const we={...D.value};we[Z]||(we[Z]=T.value);const Ae={action:((ee=V.value.propsActionGlobal)==null?void 0:ee.key)||V.value.key,row:we,selection:T.value};r("action",Ae),A.value=!1}}},MS=S=>{const I=D.value[S];I&&CE(String(I)).then(()=>{Fe.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(ee=>{console.error("Failed to copy",ee)})},Gd=()=>{b.value=!1,M.value=null},NS=n.computed(()=>M.value?M.value.button.confirmTitle||"Confirm":""),vS=n.computed(()=>M.value?M.value.button.confirmMessage||"Confirm":"");t({fetchData:it,filters:p,resetFilters:Ga,handleRefresh:Ya});const Ka=n.ref(""),PS=S=>{if(!S)return"";const I=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:I.apiUrl||S.apiUrl,module:I.apiModule||S.apiModule,action:I.apiAction||S.apiAction,method:I.apiMethod||S.apiMethod,params:S.apiParams,socket:I.socket||S.socketEndpoint,socketParams:S.socketParams})};return n.watch(()=>a.tableConfig,()=>{if(a.tableConfig){ie();const S=PS(a.tableConfig);S!==Ka.value&&(!Ka.value&&K.value?(Ka.value=S,it()):(Ka.value=S,K.value&&Ld()))}},{deep:!0,immediate:!0}),n.watch(()=>a.apiModule,()=>{K.value&&it()}),n.watch(()=>a.apiParams,()=>{K.value&&it()},{deep:!0}),n.watch(()=>_.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const I=ge.value;console.log("[DEBUG] visibleHeaderActions evaluated:",I.length,"items")},{deep:!0}),n.onMounted(()=>{ie(),K.value&&(a.tableConfig||(y.value=!0,it()))}),(S,I)=>{var ee;return n.openBlock(),n.createElementBlock("div",G2,[n.createElementVNode("div",X2,[n.createElementVNode("div",Y2,[e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",K2,[n.createElementVNode("div",J2,[n.createVNode(n.unref(ae.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),n.createVNode(n.unref(PE),{modelValue:u.value,"onUpdate:modelValue":I[0]||(I[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:n.withKeys(Tt,["enter"])},null,8,["modelValue"])]),x.value.length>0?(n.openBlock(),n.createElementBlock("div",Q2,[n.createVNode(ME,null,{trigger:n.withCtx(()=>[n.createVNode(Ue,{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:n.withCtx(()=>[n.createElementVNode("div",o_,[n.renderSlot(S.$slots,"filter-footer",{fetch:it,reset:Ga})])]),default:n.withCtx(()=>[I[8]||(I[8]=n.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),n.createElementVNode("div",Z2,[n.renderSlot(S.$slots,"filter-form",{filters:p.value},()=>[x.value.length>0?(n.openBlock(),n.createElementBlock("div",e_,[n.createElementVNode("div",t_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ne.value,(F,j)=>(n.openBlock(),n.createElementBlock("div",{key:j,class:n.normalizeClass(se(F))},[n.createVNode(Ed,{field:F,modelValue:p.value[F.model],"onUpdate:modelValue":Z=>p.value[F.model]=Z},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):n.createCommentVNode("",!0)]),x.value.length>0?(n.openBlock(),n.createElementBlock("div",n_,[n.createVNode(Ue,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:Ga,disabled:U.value},null,8,["disabled"]),n.createVNode(Ue,{onClick:Wd,disabled:U.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):n.createCommentVNode("",!0)])]),_:3})])):n.createCommentVNode("",!0)])),n.createElementVNode("div",{class:n.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":e.nested}])},[e.nested?(n.openBlock(),n.createElementBlock("span",a_)):n.createCommentVNode("",!0),e.nested?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Ue,{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:Ya,disabled:U.value},{icon:n.withCtx(()=>[n.createVNode(n.unref(ae.RefreshCw),{class:n.normalizeClass(["w-3.5 h-3.5",{"animate-spin":U.value}])},null,8,["class"])]),_:1},8,["disabled"])),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ge.value,(F,j)=>(n.openBlock(),n.createBlock(Ue,{key:j,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:Z=>SS(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),n.renderSlot(S.$slots,"header-actions")],2)])]),n.createElementVNode("div",r_,[n.createElementVNode("table",s_,[n.createElementVNode("thead",i_,[n.createElementVNode("tr",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.value,F=>(n.openBlock(),n.createElementBlock("th",{key:F.key,class:n.normalizeClass([F.align?`text-${F.align.toLowerCase()}`:"",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:n.normalizeStyle(F.width?{width:F.width}:{}),onClick:j=>F.sortable&&jd(F.key)},[F.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",c_,[n.createVNode(Gt,{"model-value":Y.value,indeterminate:R.value,"onUpdate:modelValue":I[1]||(I[1]=j=>$(!!j)),onClick:I[2]||(I[2]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-2 w-full",Ze(F.align)])},[n.createElementVNode("span",null,n.toDisplayString(F.label),1)],2))],14,l_))),128)),P.value?(n.openBlock(),n.createElementBlock("th",d_,[...I[9]||(I[9]=[n.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):n.createCommentVNode("",!0)])]),n.createElementVNode("tbody",u_,[U.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(h.value,F=>(n.openBlock(),n.createElementBlock("tr",{key:`skeleton-${F}`},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.value,j=>{var Z,be;return n.openBlock(),n.createElementBlock("td",{key:j.key,class:n.normalizeClass([j.align?`text-${j.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[n.createElementVNode("div",{class:n.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",((Z=j.align)==null?void 0:Z.toLowerCase())==="center"?"mx-auto":"",((be=j.align)==null?void 0:be.toLowerCase())==="right"?"ml-auto":""]]),style:n.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:Hd(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),e.hasActions?(n.openBlock(),n.createElementBlock("td",f_,[...I[10]||(I[10]=[n.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),n.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):n.createCommentVNode("",!0)]))),128)):G.value.length===0?(n.openBlock(),n.createElementBlock("tr",h_,[n.createElementVNode("td",{colspan:z.value.length+(P.value?1:0),class:"text-center py-16"},[n.createElementVNode("div",p_,[n.createVNode(n.unref(ou.Vue3Lottie),{animationData:n.unref(H2),height:200,width:200},null,8,["animationData"]),n.createElementVNode("div",null,[n.createElementVNode("p",g_,n.toDisplayString(ke.value?"No search results":"No data"),1),n.createElementVNode("p",b_,n.toDisplayString(ke.value?"Try changing keywords":"No data added"),1)])])],8,m_)])):(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:2},n.renderList(G.value,(F,j)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:j},[n.createElementVNode("tr",y_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.value,Z=>(n.openBlock(),n.createElementBlock("td",{key:Z.key,class:n.normalizeClass([Z.align?`text-${Z.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[n.renderSlot(S.$slots,`cell-${Z.key}`,{row:F,value:De(F,Z.key)},()=>[Z.type==="CHECKBOX"?(n.openBlock(),n.createElementBlock("div",x_,[n.createVNode(Gt,{"model-value":X(F),"onUpdate:modelValue":be=>Q(F,!!be),onClick:I[3]||(I[3]=n.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):Z.type==="badge"||Z.type==="BADGE"||Z.condition?(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[Z.align?`justify-${Z.align.toLowerCase()}`:"justify-start"]])},[n.createVNode(vs,{variant:Xa(F,Z).variant,class:n.normalizeClass([Xa(F,Z).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(Xa(F,Z).label),1)]),_:2},1032,["variant","class"])],2)):Z.key==="no"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createTextVNode(n.toDisplayString((f.value-1)*h.value+j+1),1)],64)):Z.type==="date"||Z.type==="DATE"?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createTextVNode(n.toDisplayString(De(F,Z.key)?n.unref(kE)(De(F,Z.key),"long"):"-"),1)],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:4},[n.createTextVNode(n.toDisplayString(Z.format?Z.format(De(F,Z.key)):De(F,Z.key)),1)],64))])],2))),128)),P.value?(n.openBlock(),n.createElementBlock("td",k_,[n.renderSlot(S.$slots,"actions",{row:F,buttons:Me(F),getButtonColor:qe,getIconComponent:Ke},()=>[Me(F).length>0?(n.openBlock(),n.createElementBlock("div",w_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Me(F),(Z,be)=>(n.openBlock(),n.createElementBlock("div",{key:be,class:"group relative"},[n.createVNode(Ue,{tooltip:Z.tooltip||Z.label,icon:Z.icon,size:"icon",rounded:Z.rounded||"sm",borderStyle:Z.borderStyle||"none",variant:Z.variant||"ghost","bg-color":qe(Z,F),onClick:Ne=>AS(Z,F)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):n.createCommentVNode("",!0)])])):n.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(n.openBlock(),n.createElementBlock("tr",C_,[n.createElementVNode("td",{colspan:z.value.length+(P.value?1:0),class:"px-0 py-0"},[n.renderSlot(S.$slots,"expanded-row",{row:F,index:j})],8,B_)])):n.createCommentVNode("",!0)],64))),128))])])]),!U.value&&G.value.length>0&&e.showPagination&&w.value?(n.openBlock(),n.createElementBlock("div",E_,[n.createElementVNode("div",__,[n.createVNode(n.unref(WE),{"model-value":String(h.value),"onUpdate:modelValue":I[4]||(I[4]=F=>Ud(Number(F)))},{default:n.withCtx(()=>[n.createVNode(n.unref(XE),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:n.withCtx(()=>[n.createVNode(n.unref(YE),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),n.createVNode(n.unref(jE),null,{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(je,F=>n.createVNode(n.unref(HE),{key:F,value:String(F)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),I[15]||(I[15]=n.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),n.createElementVNode("span",S_,[I[11]||(I[11]=n.createTextVNode(" Showing ",-1)),n.createElementVNode("span",A_,n.toDisplayString(ye.value),1),I[12]||(I[12]=n.createTextVNode(" to ",-1)),n.createElementVNode("span",V_,n.toDisplayString(ze.value),1),I[13]||(I[13]=n.createTextVNode(" of ",-1)),n.createElementVNode("span",D_,n.toDisplayString(le.value),1),I[14]||(I[14]=n.createTextVNode(" items ",-1))])]),n.createElementVNode("div",M_,[n.createVNode(n.unref(TE),{total:le.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":zs,class:"scale-90 origin-right"},{default:n.withCtx(()=>[n.createVNode(n.unref(OE),{class:"flex items-center gap-1"},{default:n.withCtx(({items:F})=>[n.createVNode(n.unref(FE),{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:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref($E),{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:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(F,(j,Z)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[j.type==="page"?(n.openBlock(),n.createBlock(n.unref(RE),{key:Z,value:j.value,"as-child":""},{default:n.withCtx(()=>[n.createVNode(n.unref(Et),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:be=>zs(j.value)},{default:n.withCtx(()=>[n.createTextVNode(n.toDisplayString(j.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(n.openBlock(),n.createBlock(n.unref(zE),{key:j.type,index:Z},null,8,["index"]))],64))),256)),n.createVNode(n.unref(LE),{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:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronRight),{class:"h-4 w-4"})]),_:1}),n.createVNode(n.unref(IE),{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:n.withCtx(()=>[n.createVNode(n.unref(ae.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):n.createCommentVNode("",!0),n.createVNode(Vo,{modelValue:b.value,"onUpdate:modelValue":I[5]||(I[5]=F=>b.value=F),title:NS.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:n.withCtx(()=>[n.createVNode(Ue,{variant:"outline",onClick:Gd,text:"Cancel"}),n.createVNode(Ue,{variant:"default",onClick:VS,text:"Yes"})]),default:n.withCtx(()=>[n.createElementVNode("div",N_,[n.createElementVNode("p",v_,n.toDisplayString(vS.value),1)])]),_:1},8,["modelValue","title"]),n.createVNode(Vo,{modelValue:A.value,"onUpdate:modelValue":I[7]||(I[7]=F=>A.value=F),title:((ee=V.value)==null?void 0:ee.label)||"Action",icon:"AlertCircle","max-width":450},{actions:n.withCtx(()=>[n.createVNode(Ue,{variant:"outline",onClick:I[6]||(I[6]=F=>A.value=!1),text:"Cancel"}),n.createVNode(Ue,{variant:"default",onClick:DS,text:"Save"})]),default:n.withCtx(()=>{var F,j;return[n.createElementVNode("div",P_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(((F=V.value)==null?void 0:F.fieldActionCustom)||((j=V.value)==null?void 0:j.fieldActionGlobal)||[],(Z,be)=>{var Ne,we,Ae;return n.openBlock(),n.createElementBlock(n.Fragment,{key:be},[Z.isHidden?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(se(Z))},[n.createElementVNode("div",T_,[n.createVNode(Ed,{class:"flex-1 w-full",field:Z,modelValue:D.value[Z.model],"onUpdate:modelValue":Ge=>D.value[Z.model]=Ge},null,8,["field","modelValue","onUpdate:modelValue"]),Z.isCopyable||(Ne=Z.props)!=null&&Ne.isCopyable||((we=V.value)==null?void 0:we.action)==="showToken"||((Ae=V.value)==null?void 0:Ae.action)==="copyToken"?(n.openBlock(),n.createBlock(Ue,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:Ge=>MS(Z.model)},null,8,["onClick"])):n.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function O_(){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 z_={class:"flex flex-col gap-3 w-full"},F_={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-dashed border-slate-200 dark:border-slate-800 rounded-lg opacity-70 pointer-events-none animate-pulse"},R_={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-slate-700 bg-slate-50 dark:bg-slate-800 text-slate-400"},I_={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-slate-800/50 border border-slate-200 dark:border-slate-800 rounded-lg opacity-70"},L_={class:"text-sm font-medium text-slate-500"},$_={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"},W_={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},j_=["onClick"],U_=["for","onDrop"],H_={class:"text-xs text-slate-500 dark:text-slate-400"},q_={key:2,class:"text-xs text-slate-400"},G_=["id","disabled","accept","onChange"],X_=n.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"],setup(e,{emit:t}){const o=e,a=t,{t:r,locale:s}=Yt.useI18n(),i=n.computed(()=>{const p=o.endpoint;if(!(p!=null&&p.apiUrl))return null;let B=p.apiUrl;if(!B.startsWith("http")&&o.baseUrl){const C=o.baseUrl.replace(/\/$/,""),w=B.startsWith("/")?B:`/${B}`;B=`${C}${w}`}return B}),l=n.computed(()=>{const p=c.value.length;return p<=1?"grid-cols-1":p===2?"grid-cols-1 md:grid-cols-2":p===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":p===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=n.ref([]),d=n.ref([]),u=n.ref(new Set),f=n.ref(!0),h=async()=>{var p;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((p=o.endpointReference)!=null&&p.apiUrl)){f.value=!1;return}try{const{apiUrl:B}=Xe(),C=await B(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let w=(C==null?void 0:C.data)||C;Array.isArray(w)||(w=[w]),c.value=w}catch(B){console.error("Failed to fetch dynamic document list",B)}finally{f.value=!1}};n.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=structuredClone(n.toRaw(o.modelValue))),h()}),n.watch(()=>o.modelValue,p=>{Array.isArray(p)&&JSON.stringify(p)!==JSON.stringify(d.value)&&(d.value=structuredClone(n.toRaw(p)))},{deep:!0}),n.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiUrl},(p,B)=>{p!==B&&h()}),n.watch(()=>{var p;return(p=o.endpointReference)==null?void 0:p.apiMethod},(p,B)=>{p!==B&&h()}),n.watch(()=>o.items,p=>{c.value=p??[],f.value=!1},{deep:!0,immediate:!0});const m=p=>{const B=p[o.itemValue]||p.id||p.typeDocument;return d.value.find(C=>C.typeDocument===B||C.idDocumentType===B||C[o.itemValue]===B)||null},g=async(p,B,C)=>{var x,b;const w=C.target,E=(x=w.files)==null?void 0:x[0];if(!E)return;const _=p[o.itemValue]||p.id||p.typeDocument;if(p[o.itemTitle]||p.name||p.filename,!i.value){const A=[...d.value],D=A.findIndex(V=>V.typeDocument===_||V.idDocumentType===_),M={id:null,filename:E.name,document:E.name,typeDocument:_};D>-1?A[D]={...A[D],...M}:A.push(M),d.value=A,a("update:modelValue",A);return}u.value.add(B);try{const{apiUrl:A}=Xe(),D=new FormData;D.append("doc",E),D.append("typeDocument",String(_));const M=await A(i.value,((b=o.endpoint)==null?void 0:b.apiMethod)||"POST",D),V=Array.isArray(M==null?void 0:M.data)?M.data[0]:(M==null?void 0:M.data)||M,N=(V==null?void 0:V.url)||(V==null?void 0:V.document)||E.name,T=(V==null?void 0:V.id)||null,Y=(V==null?void 0:V.filename)||(V==null?void 0:V.name)||E.name,R=[...d.value],X=R.findIndex(Q=>Q.typeDocument===_||Q.idDocumentType===_),$={id:T,filename:Y,document:N,typeDocument:_};X>-1?R[X]={...R[X],...$}:R.push($),d.value=R,a("update:modelValue",R)}catch(A){console.error("Upload failed",A)}finally{u.value.delete(B),w.value=""}},y=p=>{const B=p[o.itemValue]||p.id||p.typeDocument,C=d.value.filter(w=>w.typeDocument!==B&&w.idDocumentType!==B);d.value=C,a("update:modelValue",C)},k=(p,B,C)=>{var _,x;C.preventDefault();const w=(x=(_=C.dataTransfer)==null?void 0:_.files)==null?void 0:x[0];if(!w)return;g(p,B,{target:{files:[w],value:""}})};return(p,B)=>(n.openBlock(),n.createElementBlock("div",z_,[e.label||e.labelID||e.labelEN?(n.openBlock(),n.createBlock(Hn,{key:0,text:e.label||(n.unref(s).toLowerCase().startsWith("en")?e.labelEN:e.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:e.required},null,8,["text","required"])):n.createCommentVNode("",!0),n.createElementVNode("div",{class:n.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(n.openBlock(),n.createElementBlock("div",F_,[n.createVNode(Hn,{text:n.unref(r)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),n.createElementVNode("div",R_,[n.createVNode(n.unref(ae.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(n.openBlock(),n.createElementBlock("div",I_,[n.createVNode(n.unref(ae.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),n.createElementVNode("span",L_,n.toDisplayString(n.unref(r)("dynamicUploadList.noDocsRequired")),1)])):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,(C,w)=>{var E;return n.openBlock(),n.createElementBlock("div",{key:w,class:"flex flex-col gap-2 p-3 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-lg shadow-sm"},[n.createVNode(Hn,{text:C[e.itemTitle]||C.name||C.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-slate-300"},null,8,["text"]),m(C)?(n.openBlock(),n.createElementBlock("div",$_,[n.createVNode(n.unref(ae.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),n.createElementVNode("span",W_,n.toDisplayString(((E=m(C))==null?void 0:E.filename)||n.unref(r)("dynamicUploadList.fileUploaded")),1),e.disabled?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:_=>y(C)},[n.createVNode(n.unref(ae.X),{class:"w-4 h-4"})],8,j_))])):(n.openBlock(),n.createElementBlock("label",{key:1,for:`dyn-upload-input-${w}`,class:n.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[e.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",u.value.has(w)?"pointer-events-none opacity-70":""]]),onDragover:B[0]||(B[0]=n.withModifiers(()=>{},["prevent"])),onDrop:_=>!e.disabled&&!u.value.has(w)&&k(C,w,_)},[u.value.has(w)?(n.openBlock(),n.createBlock(n.unref(ae.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(n.openBlock(),n.createBlock(n.unref(ae.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),n.createElementVNode("span",H_,n.toDisplayString(u.value.has(w)?n.unref(r)("dynamicUploadList.uploading"):n.unref(r)("dynamicUploadList.clickOrDrag")),1),e.typeFile?(n.openBlock(),n.createElementBlock("span",q_,n.toDisplayString(e.typeFile),1)):n.createCommentVNode("",!0),n.createElementVNode("input",{id:`dyn-upload-input-${w}`,type:"file",class:"sr-only",disabled:e.disabled||u.value.has(w),accept:e.typeFile,onChange:_=>g(C,w,_)},null,40,G_)],42,U_))])}),128))],2)]))}}),Y_={key:0},K_=["value","name"],J_={key:2,class:"text-xs text-neutral-400 italic"},Ps=n.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:t}){let o=n.ref("en");try{o=Yt.useI18n().locale}catch{}const a=e,r=t,s=n.ref(a.modelValue);n.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:va,DCodeAutoComplete:Lo,DCodeDatePicker:Sa,DCodeTextarea:qn,DCodeTextArea:qn,DCodeCheckbox:Gt,DCodeSwitch:Na,DCodeOtpInput:Da,DCodeImageField:Va,DCodeSlider:Ma,DCodeRadio:ks,DCodeRadioCustom:ws,DCodeDynamicUploadList:X_,DCodeMultiSelect:xs,DCodeCurrencyField:ds,DCodePermissionMenu:Bs,DCodeTreePermissions:Es,DCodeCardCheckboxList:cs},l=n.computed(()=>{const u=a.field.component;return i[u]||null}),c=n.computed(()=>{const u=a.field.props||{},f={};if((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),f.required=a.required!==void 0?a.required:u.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxLength","minLength","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons"].forEach(m=>{u[m]!==void 0&&u[m]!==null&&(f[m]=u[m])}),u.valueType&&(f.type=u.valueType),u.endpoint&&u.endpoint.apiUrl){const m={};Array.isArray(u.endpoint.keyParam)&&u.endpoint.keyParam.forEach(g=>{a.formData&&a.formData[g]!=null&&(m[g]=a.formData[g])}),f.endpoint={apiUrl:u.endpoint.apiUrl,apiMethod:u.endpoint.apiMethod||"GET"},Object.keys(m).length&&(f.apiParams=m)}return u.endpointReference&&u.endpointReference.apiUrl&&(f.endpointReference=u.endpointReference),a.options&&a.options.length>0&&(f.options=a.options,f.items=a.options),f}),d=u=>{s.value=u,r("update:modelValue",u)};return(u,f)=>e.field.isHidden?(n.openBlock(),n.createElementBlock("div",Y_,[n.createElementVNode("input",{type:"hidden",value:s.value,name:e.field.model},null,8,K_)])):l.value?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(l.value),n.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"])):(n.openBlock(),n.createElementBlock("div",J_," Unknown field: "+n.toDisplayString(e.field.component),1))}}),Q_={class:"w-full space-y-6"},Z_={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},eS={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},tS={key:0,class:"px-4 py-3"},nS={class:"text-sm font-semibold text-white"},oS={class:"px-4 py-3"},aS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},rS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},sS={key:2,class:"w-full"},iS={class:"space-y-6 mt-4"},lS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},cS={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},dS={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},uS=n.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action"],setup(e,{emit:t}){const o=e,a=t;let r=n.ref("en"),s=v=>v;try{const v=Yt.useI18n();r=v.locale,s=v.t}catch{}const i=n.ref(!1),l=n.ref(null),c=n.computed(()=>o.schema||l.value),d=n.reactive({}),u=n.reactive({}),f=n.reactive({}),h=v=>{var O,W,q;return((O=v.propsForm)==null?void 0:O.key)||((W=v.propsTable)==null?void 0:W.key)||((q=v.propsWizard)==null?void 0:q.key)||v.id||"unknown-section"},m=v=>{var q;const O=((q=v.propsWizard)==null?void 0:q.propsSteps)||[],W=r.value==="en";return O.map((ne,se)=>{let ie=[];if(Array.isArray(ne.sectionsWizard))ie=ne.sectionsWizard;else if(ne.sectionsWizard&&typeof ne.sectionsWizard=="object"){const z=ne.sectionsWizard;ie=[{type:z.type||(z.fields?"FORM":z.isDataTable?"TABLE":"UNKNOWN"),...z}]}return{key:ne.key||`step-${se}`,title:W?ne.titleEN:ne.titleID,description:W?ne.descriptionEN:ne.descriptionID,icon:ne.icon||void 0,sections:ie}})},g=v=>v?[...v].sort((O,W)=>(O.seq||0)-(W.seq||0)):[],y=(v,O)=>{d[v]=O},k=(v,O)=>{var z,P;if(O==null)return O;let W=null;if((P=(z=c.value)==null?void 0:z.sections)==null||P.forEach(U=>{var xe,Ee,ge;const oe=(((xe=U.propsForm)==null?void 0:xe.fields)||U.fields||((Ee=U.sectionsWizard)==null?void 0:Ee.fields)||[]).find(fe=>fe.model===v);oe&&(W=oe),U.type==="WIZARD"&&(((ge=U.propsWizard)==null?void 0:ge.propsSteps)||[]).forEach(Me=>{(Array.isArray(Me.sectionsWizard)?Me.sectionsWizard:[Me.sectionsWizard].filter(Boolean)).forEach(Ze=>{if(Ze.fields){const nt=Ze.fields.find(Ke=>Ke.model===v);nt&&(W=nt)}})})}),!W)return O;const q=B[W.key];if(!q||!Array.isArray(q))return O;const ne=W.props||{},se=ne.itemValue||ne.model||"id",ie=q.find(U=>String(U[se])===String(O));return ie&&ie.code?ie.code:ie&&ie.value?ie.value:O},p=(v,O)=>{if(v==null)return!0;if(typeof v!="object")return v;if(Object.keys(v).length===0)return null;if("var"in v)return O[v.var]??null;if("=="in v){const W=(v["=="]||[])[0],q=(v["=="]||[])[1],ne=p(W,O),se=p(q,O);if(String(ne)===String(se))return console.log(`[DynamicForm] evaluateLogic ==: ${ne} == ${se} ? true (direct)`),!0;if(W&&typeof W=="object"&&W.var){const ie=k(W.var,ne);if(String(ie)===String(se))return console.log(`[DynamicForm] evaluateLogic ==: ${ne}(->${ie}) == ${se} ? true (resolved)`),!0}if(q&&typeof q=="object"&&q.var){const ie=k(q.var,se);if(String(ne)===String(ie))return console.log(`[DynamicForm] evaluateLogic ==: ${ne} == ${se}(->${ie}) ? true (resolved)`),!0}return console.log(`[DynamicForm] evaluateLogic ==: ${ne} == ${se} ? false`),!1}if("!="in v)return!p({"==":v["!="]},O);if(">"in v){const[W,q]=(v[">"]||[]).map(ne=>p(ne,O));return Number(W)>Number(q)}if(">="in v){const[W,q]=(v[">="]||[]).map(ne=>p(ne,O));return Number(W)>=Number(q)}if("<"in v){const[W,q]=(v["<"]||[]).map(ne=>p(ne,O));return Number(W)<Number(q)}if("<="in v){const[W,q]=(v["<="]||[]).map(ne=>p(ne,O));return Number(W)<=Number(q)}if("and"in v)return v.and.every(W=>p(W,O));if("or"in v)return v.or.some(W=>p(W,O));if("!"in v)return!p(v["!"],O);if("length"in v){const W=p(v.length,O);return W==null?0:typeof W=="string"||Array.isArray(W)?W.length:0}return!0},B=n.reactive({}),C=async v=>{const O=v.props||{},W=O.endpointReference||O.endpoint;if(!(!(W!=null&&W.apiUrl)||B[v.key]))try{console.log(`[DynamicForm] Prefetching for ${v.key} from ${W.apiUrl}`);const{apiUrl:q}=Xe(),ne=await q(W.apiUrl,W.apiMethod||"GET",{page:1,perPage:100});let se=(ne==null?void 0:ne.data)||ne;Array.isArray(se)||(se=se?[se]:[]),B[v.key]=se,console.log(`[DynamicForm] Prefetched ${se.length} items for ${v.key}`)}catch(q){console.error(`[DynamicForm] Failed prefetching for ${v.key}`,q),B[v.key]=[]}},w=v=>{var ie,z;const O=v.props||{},W=B[v.key]||O.items||O.options||[];if(!((ie=v.logic)!=null&&ie.optionsFilterRule)||!Array.isArray(v.logic.optionsFilterRule))return W;console.log(`[DynamicForm] getFilteredItems check for ${v.key}`,{formData:JSON.parse(JSON.stringify(d)),hasRules:!!((z=v.logic)!=null&&z.optionsFilterRule)});const q=v.logic.optionsFilterRule.find(P=>P.condition?p(P.condition,d):!0);if(!q)return console.log(`[DynamicForm] getFilteredItems: No active rule found for ${v.key}`),W;const ne=O.itemValue||O.model||"id",se=W.filter(P=>typeof P!="object"?q.values.includes(String(P))||q.values.includes(P):[ne,"code","id","value"].some(K=>{const oe=P[K];return oe==null?!1:q.values.includes(String(oe))||q.values.includes(oe)}));return console.log(`[DynamicForm] Filtering ${v.key}: ${W.length} -> ${se.length} items (rule active)`,{ruleValues:q.values}),se},E=v=>{if(!v||typeof v!="object")return[];if("var"in v)return[v.var];let O=[];return Object.values(v).forEach(W=>{Array.isArray(W)?W.forEach(q=>{O=O.concat(E(q))}):typeof W=="object"&&(O=O.concat(E(W)))}),O};n.watch(()=>c.value,v=>{if(!(v!=null&&v.sections))return;const O=new Set,W=q=>{q&&["visibleRule","requiredRule","optionsFilterRule"].forEach(ne=>{q[ne]&&E(q[ne]).forEach(se=>O.add(se))})};v.sections.forEach(q=>{var ne,se,ie,z,P,U;if(((ne=q.type)==null?void 0:ne.toUpperCase())==="FORM"&&((se=q.propsForm)!=null&&se.fields)&&q.propsForm.fields.forEach(K=>{var oe;W(K.logic),(oe=K.logic)!=null&&oe.optionsFilterRule&&C(K)}),((ie=q.type)==null?void 0:ie.toUpperCase())==="TABLE"&&((z=q.propsTable)!=null&&z.modelDatatable)){const K=q.propsTable.modelDatatable;(!d[K]||!Array.isArray(d[K]))&&(d[K]=[])}else if(((P=q.type)==null?void 0:P.toUpperCase())==="WIZARD"){const K=h(q);u[K]===void 0&&(u[K]=0),(((U=q.propsWizard)==null?void 0:U.propsSteps)||[]).forEach(xe=>{(Array.isArray(xe.sectionsWizard)?xe.sectionsWizard:[xe.sectionsWizard].filter(Boolean)).forEach(ge=>{ge.fields&&ge.fields.forEach(fe=>{var Me;W(fe.logic),(Me=fe.logic)!=null&&Me.optionsFilterRule&&C(fe)})})})}}),v.sections.forEach(q=>{var se,ie;(((se=q.propsForm)==null?void 0:se.fields)||q.fields||[]).forEach(z=>{O.has(z.model)&&C(z)}),q.type==="WIZARD"&&(((ie=q.propsWizard)==null?void 0:ie.propsSteps)||[]).forEach(P=>{(Array.isArray(P.sectionsWizard)?P.sectionsWizard:[P.sectionsWizard].filter(Boolean)).forEach(K=>{K.fields&&K.fields.forEach(oe=>{O.has(oe.model)&&C(oe)})})})})},{immediate:!0}),n.watch(()=>o.model,v=>{v&&Object.keys(v).length>0&&(console.log("[DynamicForm] Syncing model to formData",v),Object.assign(d,v))},{immediate:!0,deep:!0});const _=v=>{var W;const O=(W=v.logic)==null?void 0:W.visibleRule;return!O||Object.keys(O).length===0?!0:!!p(O,d)},x=v=>{var q,ne;const O=((q=v.props)==null?void 0:q.required)??!1,W=(ne=v.logic)==null?void 0:ne.requiredRule;return!W||Object.keys(W).length===0?O:!!p(W,d)},b=async v=>{const O=v.propsActionGlobal;if(!O)return;const W=O.fieldMapping;let q={};W&&typeof W=="object"&&Object.keys(W).length>0?Object.keys(W).forEach(ne=>{const se=W[ne];d[ne]!==void 0&&(q[se]=d[ne])}):q={...d},a("action",O.key||"",v,q)},A=async()=>{i.value=!0;try{a("submit",{...d})}finally{i.value=!1}},D=()=>{a("cancel")},M=v=>v.permission?o.isEditMode?v.permission!=="CREATE":v.permission!=="UPDATE":!0,V=v=>{const O=v.modelDatatable;if(!O)return[];const W=d[O];return Array.isArray(W)?W:[]},N=n.ref(!1),T=n.ref(""),Y=n.ref([]),R=n.reactive({}),X=n.ref(""),$=n.ref(null),Q=n.ref(null),L=(v,O)=>{var q,ne;X.value=v.modelDatatable||"",Q.value=O,$.value=null;const W=O.fieldActionGlobal||[];Y.value=W,T.value=((q=O.propsActionGlobal)==null?void 0:q.labelID)||((ne=O.propsActionGlobal)==null?void 0:ne.labelEN)||"Add Row",Object.keys(R).forEach(se=>delete R[se]),W.forEach(se=>{R[se.model]=null}),N.value=!0},H=(v,O)=>{var K;const{action:W,row:q}=O;if(/delete|trash|remove/i.test(W)){const oe=v.modelDatatable;if(oe&&Array.isArray(d[oe])){const xe=d[oe].indexOf(q);if(xe!==-1)d[oe].splice(xe,1);else{const Ee=JSON.stringify(q),ge=d[oe].findIndex(fe=>JSON.stringify(fe)===Ee);ge!==-1&&d[oe].splice(ge,1)}}return}const se=v.modelDatatable||"";X.value=se;const ie=d[se],z=Array.isArray(ie)?ie.indexOf(q):-1;$.value=z!==-1?z:null;const P=v.actionTableGlobal||[],U=((K=P[0])==null?void 0:K.fieldActionGlobal)||[];Y.value=U,T.value="Edit Row",Q.value=P[0],Object.keys(R).forEach(oe=>delete R[oe]),U.forEach(oe=>{R[oe.model]=q[oe.model]??null}),N.value=!0},J=()=>{const v=X.value;if(!v)return;Array.isArray(d[v])||(d[v]=[]);const O={...R};$.value!==null?d[v].splice($.value,1,O):d[v].push(O),N.value=!1};return(v,O)=>{var W,q,ne,se,ie;return n.openBlock(),n.createElementBlock("div",Q_,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList((W=c.value)==null?void 0:W.sections,(z,P)=>{var U,K,oe,xe,Ee;return n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[((U=z.type)==null?void 0:U.toUpperCase())==="FORM"&&z.propsForm?(n.openBlock(),n.createElementBlock("div",Z_,[n.createElementVNode("div",eS,[z.propsForm.titleID||z.propsForm.titleEN?(n.openBlock(),n.createElementBlock("div",tS,[n.createElementVNode("h3",nS,n.toDisplayString(n.unref(r)==="id"?z.propsForm.titleID:z.propsForm.titleEN),1)])):n.createCommentVNode("",!0),n.createElementVNode("div",oS,[n.createVNode(Ue,{size:"sm",icon:"List",text:n.unref(s)("common.back"),variant:"outline",onClick:D},null,8,["text"])])]),n.createElementVNode("div",{class:n.normalizeClass(["p-4 grid gap-4",z.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g(z.propsForm.fields),ge=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:ge.key},[_(ge)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([ge.column==="FULL"&&z.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ps,{field:ge,"model-value":d[ge.model],"form-data":d,required:x(ge),options:w(ge),"onUpdate:modelValue":fe=>y(ge.model,fe)},null,8,["field","model-value","form-data","required","options","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)])):((K=z.type)==null?void 0:K.toUpperCase())==="TABLE"&&z.propsTable?(n.openBlock(),n.createElementBlock("div",aS,[(oe=z.propsTable.actionTableGlobal)!=null&&oe.length?(n.openBlock(),n.createElementBlock("div",rS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(z.propsTable.actionTableGlobal,(ge,fe)=>{var Me,qe;return n.openBlock(),n.createElementBlock(n.Fragment,{key:fe},[ge.propsActionGlobal?(n.openBlock(),n.createBlock(Ue,{key:0,icon:ge.propsActionGlobal.icon,"bg-color":((Me=ge.propsActionGlobal.bgColor)==null?void 0:Me.toLowerCase())||"primary",variant:((qe=ge.propsActionGlobal.variant)==null?void 0:qe.toLowerCase())||"default",size:"sm",onClick:Ze=>L(z.propsTable,ge)},null,8,["icon","bg-color","variant","onClick"])):n.createCommentVNode("",!0)],64)}),128))])):n.createCommentVNode("",!0),n.createVNode(Kn,{"table-config":z.propsTable,data:V(z.propsTable),nested:!0,"show-pagination":z.propsTable.pagination??!0,onAction:ge=>H(z.propsTable,ge)},null,8,["table-config","data","show-pagination","onAction"])])):((xe=z.type)==null?void 0:xe.toUpperCase())==="WIZARD"&&z.propsWizard?(n.openBlock(),n.createElementBlock("div",sS,[n.createVNode(Cs,{tabs:m(z),modelValue:u[h(z)],"onUpdate:modelValue":ge=>u[h(z)]=ge,"is-vertical":z.propsWizard.isVertical,"is-wizard":z.propsWizard.isWizard,"type-wizard":((Ee=z.propsWizard.typeWizard)==null?void 0:Ee.toLowerCase())||"icon",loading:i.value},n.createSlots({_:2},[n.renderList(m(z),ge=>({name:`tab-${ge.key}`,fn:n.withCtx(()=>[n.createElementVNode("div",iS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ge.sections,(fe,Me)=>{var qe,Ze,nt;return n.openBlock(),n.createElementBlock(n.Fragment,{key:Me},[((qe=fe.type)==null?void 0:qe.toUpperCase())==="FORM"?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["grid gap-4",fe.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g(fe.fields),Ke=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:Ke.key},[_(Ke)?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass([Ke.column==="FULL"&&fe.layoutColumns>1?"md:col-span-2":"col-span-1"])},[n.createVNode(Ps,{field:Ke,"model-value":d[Ke.model],"form-data":d,required:x(Ke),options:w(Ke),"onUpdate:modelValue":G=>y(Ke.model,G)},null,8,["field","model-value","form-data","required","options","onUpdate:modelValue"])],2)):n.createCommentVNode("",!0)],64))),128))],2)):((Ze=fe.type)==null?void 0:Ze.toUpperCase())==="TABLE"||fe.isDataTable?(n.openBlock(),n.createElementBlock("div",lS,[n.createVNode(Kn,{"table-config":fe.propsDataTableWizard||fe.propsTable,data:V(fe.propsDataTableWizard||fe.propsTable),nested:!0,"show-pagination":((nt=fe.propsDataTableWizard||fe.propsTable)==null?void 0:nt.pagination)??!0,onAction:Ke=>H(fe.propsDataTableWizard||fe.propsTable,Ke)},null,8,["table-config","data","show-pagination","onAction"])])):(n.openBlock(),n.createElementBlock("div",cS," Unknown section type: "+n.toDisplayString(fe.type),1))],64)}),128))])])}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):n.createCommentVNode("",!0)],64)}),128)),f!=null&&f.global?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(((ne=(q=c.value)==null?void 0:q.ui)==null?void 0:ne.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(ie=(se=c.value)==null?void 0:se.actionGlobal)!=null&&ie.length?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(c.value.actionGlobal,(z,P)=>{var U,K;return n.openBlock(),n.createElementBlock(n.Fragment,{key:P},[z.propsActionGlobal&&M(z)?(n.openBlock(),n.createBlock(Ue,{key:0,icon:z.propsActionGlobal.icon,text:n.unref(r)==="id"?z.propsActionGlobal.labelID:z.propsActionGlobal.labelEN,"bg-color":((U=z.propsActionGlobal.bgColor)==null?void 0:U.toLowerCase())||"primary",variant:((K=z.propsActionGlobal.variant)==null?void 0:K.toLowerCase())||"default",loading:i.value,onClick:oe=>b(z)},null,8,["icon","text","bg-color","variant","loading","onClick"])):n.createCommentVNode("",!0)],64)}),128)):(n.openBlock(),n.createBlock(Ue,{key:1,text:"Submit","bg-color":"primary",loading:i.value,onClick:A},null,8,["loading"]))],2)),n.createVNode(Vo,{modelValue:N.value,"onUpdate:modelValue":O[1]||(O[1]=z=>N.value=z),title:T.value,icon:"Plus","max-width":700},{actions:n.withCtx(()=>[n.createVNode(Ue,{variant:"outline",text:"Cancel",onClick:O[0]||(O[0]=z=>N.value=!1)}),n.createVNode(Ue,{text:"Save",onClick:J})]),default:n.withCtx(()=>[Y.value.length?(n.openBlock(),n.createElementBlock("div",dS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Y.value,z=>(n.openBlock(),n.createElementBlock("div",{key:z.key,class:n.normalizeClass(z.column==="FULL"?"md:col-span-2":"col-span-1")},[n.createVNode(Ps,{field:z,"model-value":R[z.model],"form-data":R,"onUpdate:modelValue":P=>R[z.model]=P},null,8,["field","model-value","form-data","onUpdate:modelValue"])],2))),128))])):n.createCommentVNode("",!0)]),_:1},8,["modelValue","title"])])}}}),fS={class:"w-full space-y-6 animate-pulse"},hS={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},mS=n.defineComponent({__name:"AutoLayoutSkeleton",setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",fS,[o[2]||(o[2]=n.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(2,a=>n.createElementVNode("div",{key:a,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=n.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[n.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),n.createElementVNode("div",hS,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(6,r=>n.createElementVNode("div",{key:r,class:n.normalizeClass(r>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[n.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),n.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]=n.createElementVNode("div",{class:"flex items-center gap-2"},[n.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),n.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),pS={class:"w-full"},gS={class:"relative mx-auto min-h-[37.5rem]"},bS={key:"content",class:"w-full"},yS={class:"mb-6"},xS={class:"text-neutral-500 dark:text-neutral-400"},kS={key:"skeleton",class:"w-full"},wS={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Ts=ht(n.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean}},emits:["submit-success","cancel","action-success"],setup(e,{emit:t}){var D,M,V,N,T,Y,R,X;const o=e,a=t,r=(M=(D=n.getCurrentInstance())==null?void 0:D.appContext)==null?void 0:M.app;r&&!r._context.provides[Symbol.for("vue-router-route-location")]&&r.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const $=Mn.useRoute();if($&&Object.keys($).length>0)s=$;else{const Q=n.getCurrentInstance();(T=(N=(V=Q==null?void 0:Q.appContext)==null?void 0:V.config)==null?void 0:N.globalProperties)!=null&&T.$route&&(s=Q.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:$=>{typeof window<"u"&&(typeof $=="string"?window.location.href=$:$&&$.path&&(window.location.href=$.path))},__isFallback:!0};try{const $=Mn.useRouter();if($)i=$;else{const Q=n.getCurrentInstance();(X=(R=(Y=Q==null?void 0:Q.appContext)==null?void 0:Y.config)==null?void 0:R.globalProperties)!=null&&X.$router&&(i=Q.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=Xe();let d;try{d=Yt.useI18n().locale}catch{d=n.ref("en")}const{setPageTitle:u}=O_(),f=n.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);n.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=n.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const $=s.path.match(/\/edit\/([^\/]+)$/);return $?$[1]:null}),m=n.ref({}),g=n.ref(null),y=n.ref(!0),k=n.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",B="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",C=n.ref(o.layoutCode),w=n.computed(()=>{var L;if(!g.value)return"";const $=((L=d==null?void 0:d.value)==null?void 0:L.toLowerCase())||"en";return($==="en"||$.startsWith("en-")?g.value.titleEN:g.value.titleID)||g.value.title||o.layoutCode});n.watch(w,$=>{$&&u($)},{immediate:!0});const E=($,Q="")=>{const L={};return!$||typeof $!="object"||Object.keys($).forEach(H=>{const J=$[H],v=Q?`${Q}.${H}`:H;J&&typeof J=="object"&&!Array.isArray(J)&&!(J instanceof Date)&&Object.assign(L,E(J,v)),L[v]=J}),L},_=async()=>{var $,Q,L,H,J,v;y.value=!0;try{let O=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(O=s.query.code||o.layoutCode);const W="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",q=W?{Authorization:`Bearer ${W}`}:{},ne=`${p}${O}`;let se=await l(ne,"GET",null,q);if(!se.status||!se.data||Array.isArray(se.data)&&se.data.length===0)try{const ie=`${B}${O}`,z=await l(ie,"GET",null,q);if(z.status){const P=Array.isArray(z.data)?z.data[0]:z.data;P&&P.code&&(O=P.code,C.value=O,se=await l(`${p}${O}`,"GET",null,q))}}catch(ie){console.warn("Failed to resolve layout code via datatable",ie)}if(se.status){g.value=Array.isArray(se.data)?se.data[0]:se.data;const ie={};if(($=g.value)!=null&&$.sections&&g.value.sections.forEach(z=>{((z.propsForm||z.props||{}).fields||z.fields||[]).forEach(K=>{var xe;const oe=K.model||((xe=K.props)==null?void 0:xe.model)||K.key;oe&&(ie[oe]=null)})}),m.value=ie,y.value=!1,f.value&&h.value){k.value=!0;try{const z=(H=(L=(Q=g.value.sections)==null?void 0:Q[0])==null?void 0:L.propsForm)==null?void 0:H.endpointForm,P=g.value.endpointForm,U=z||P;if(U!=null&&U.apiUrl){const K=U.apiUrl,oe=U.apiMethod||"GET",xe=U.keyParam||[],Ee={};xe.length>0?xe.forEach(fe=>{Ee[fe]=h.value}):Ee.id=h.value;const ge=await c(K,oe,Ee);if(ge.status){let fe=Array.isArray(ge.data)?ge.data[0]:ge.data;ge.payload&&(fe={...fe,...ge.payload});const Me=E(fe);m.value={...m.value,...fe,...Me}}}else if((J=g.value.endpointGlobal)!=null&&J.apiUrl){const K=g.value.endpointGlobal.apiUrl,oe=g.value.endpointGlobal.apiMethod||"GET",xe={id:h.value},Ee=await c(K,oe,xe);if(Ee.status){const ge=Array.isArray(Ee.data)?Ee.data[0]:Ee.data,fe=E(ge);m.value={...m.value,...ge,...fe}}}else{const K=((v=g.value.endpoint)==null?void 0:v.detailUrl)||`/api/${C.value}/detail/${h.value}`,oe=await l(K,"GET");if(oe.status){let xe=Array.isArray(oe.data)?oe.data[0]:oe.data;if(oe.payload){const fe={...oe.payload};if(Object.keys(fe).forEach(Me=>{xe[Me]!==void 0&&xe[Me]!==null&&(fe[Me]=xe[Me])}),!("id"in fe)&&xe.id){const Me=Object.keys(fe).find(qe=>qe.startsWith("id")&&qe.length>2&&!fe[qe]);Me&&(fe[Me]=xe.id)}xe=fe}const Ee={...xe};Object.keys(m.value).forEach(fe=>{if(Ee[fe]===void 0||Ee[fe]===null){if(fe.toLowerCase().startsWith("id")&&fe.length>2){const qe=fe.substring(2).toLowerCase(),Ze=Array.isArray(oe.data)?oe.data[0]:oe.data,nt=Object.keys(Ze).find(Ke=>Ke.toLowerCase()===qe);nt&&Ze[nt]&&typeof Ze[nt]=="object"&&"id"in Ze[nt]&&(Ee[fe]=Ze[nt].id)}if(fe==="idSupervisor"){const qe=Array.isArray(oe.data)?oe.data[0]:oe.data;qe.supervisorId&&(Ee[fe]=qe.supervisorId)}}});const ge=E(Ee);m.value={...m.value,...Ee,...ge}}}}catch(z){console.error("Failed to fetch record data:",z)}finally{k.value=!1}}}}catch(O){console.error("Failed to load form layout:",O),y.value=!1}},x=async $=>{var Q,L,H;try{const J=(H=(L=(Q=g.value.sections)==null?void 0:Q[0])==null?void 0:L.propsForm)==null?void 0:H.endpointForm,v=g.value.endpointGlobal||g.value.endpoint,O=(J==null?void 0:J.submitUrl)||(v==null?void 0:v.submitUrl)||`/api/generic/${o.layoutCode}`,W=(J==null?void 0:J.submitMethod)||(v==null?void 0:v.submitMethod)||(f.value?"PUT":"POST"),q={...$};f.value&&h.value&&!q.id&&(q.id=h.value),await l(O,W,q),a("submit-success",q),i.back()}catch(J){console.error("Submit failed:",J)}},b=async($,Q,L)=>{if($==="cancel"){A();return}const H=Q.endpointPropAction||Q.propsActionGlobal&&Q.propsActionGlobal.endpointPropAction;if(H)try{y.value=!0;const J=L?{...L}:{...m.value};f.value&&Q.model&&h.value&&(J[Q.model]=h.value);const v=H.apiUrl,O=H.apiMethod||"POST";(await c(v,O,J)).status&&(a("action-success",$,Q,J),i.back())}catch(J){console.error("Action failed:",J)}finally{y.value=!1}},A=()=>{a("cancel"),i.back()};return n.onMounted(()=>{_()}),n.onUnmounted(()=>{u("")}),($,Q)=>(n.openBlock(),n.createElementBlock("div",pS,[n.createElementVNode("div",gS,[n.createVNode(n.Transition,{name:"fade",mode:"out-in"},{default:n.withCtx(()=>[!y.value&&g.value?(n.openBlock(),n.createElementBlock("div",bS,[n.createElementVNode("div",yS,[n.createElementVNode("p",xS,n.toDisplayString(g.value.description),1)]),n.createVNode(uS,{schema:g.value,model:m.value,"is-edit-mode":f.value,loading:k.value,onSubmit:x,onCancel:A,onAction:b,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):y.value?(n.openBlock(),n.createElementBlock("div",kS,[n.createVNode(mS)])):(n.openBlock(),n.createElementBlock("div",wS," Failed to load form configuration for "+n.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-9cac5f9c"]]),CS={class:"h-full flex flex-col"},BS={key:1,class:"flex-1 flex items-center justify-center"},ES={key:2,class:"flex-1 flex items-center justify-center text-red-500"},Os=n.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(e,{emit:t}){var B,C,w,E,_,x;const o=e,a=t,r=n.getCurrentInstance(),{apiUrl:s}=Xe();let i={query:{},params:{},path:""};try{const b=Mn.useRoute();b?i=b:(w=(C=(B=r==null?void 0:r.appContext)==null?void 0:B.config)==null?void 0:C.globalProperties)!=null&&w.$route&&(i=r.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:b=>{typeof window<"u"&&(typeof b=="string"?window.location.href=b:b&&b.path&&(window.location.href=b.path))}};try{const b=Mn.useRouter();b?l=b:(x=(_=(E=r==null?void 0:r.appContext)==null?void 0:E.config)==null?void 0:_.globalProperties)!=null&&x.$router&&(l=r.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=n.inject("hasActionAccess",()=>!1),d=n.inject("userPermissions",null),u=n.ref(null),f=n.ref(!0),h=n.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",g=n.computed(()=>`${m}${o.layoutCode}`),y=async()=>{var b;f.value=!0;try{const A="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=A?{Authorization:`Bearer ${A}`}:{},M=await s(g.value,"GET",null,D);M.status&&(u.value=Array.isArray(M.data)?M.data[0]:M.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),console.log("[DEBUG] actionGlobal in config:",(b=u.value)==null?void 0:b.actionGlobal))}catch(A){console.error("Gagal Menampilkan Datatable:",A)}finally{f.value=!1}},k=b=>{b.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",b.action,b)},p=b=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",b);let A=b.route;if(A||(A=`/${((i==null?void 0:i.path)||"").split("/")[1]||"product"}/create`),A){const D=b.path?{code:b.path}:{};console.log("[DEBUG] Emitting navigate to parent:",{path:A,query:D}),a("navigate",{route:A,query:D})}else console.warn("[DEBUG] No route or path provided for navigation")};return n.onMounted(()=>{y()}),(b,A)=>(n.openBlock(),n.createElementBlock("div",CS,[!f.value&&u.value?(n.openBlock(),n.createBlock(Kn,{key:0,ref_key:"dtRef",ref:h,"api-url":g.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||n.unref(d),"permission-checker":n.unref(c),checkPermission:o.checkPermission,onAction:k,onNavigate:p},{"header-actions":n.withCtx(()=>[...A[0]||(A[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(n.openBlock(),n.createElementBlock("div",BS,[...A[1]||(A[1]=[n.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(n.openBlock(),n.createElementBlock("div",ES," Failed to load configuration for "+n.toDisplayString(o.layoutCode),1))]))}}),zd=n.defineCustomElement(Ts),Fd=n.defineCustomElement(Os);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",zd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Fd));const _S=[Lo,li,Ue,$i,Jc,Gt,cs,ds,Sa,Vo,md,Aa,pd,ps,gd,bs,Va,ys,Hn,xs,Da,bd,yd,ks,ws,Ma,Na,va,qn,Cd,Bd,Cs,Bs,Es,vs,Kn,Ts,Os],Rd={install(e,t={}){t&&Object.keys(t).length>0&&Is(t),_S.forEach(o=>{o.name&&e.component(o.name,o)})}};de.AutoLayoutDatatable=Os,de.AutoLayoutForm=Ts,de.DCodeAutoComplete=Lo,de.DCodeBadge=vs,de.DCodeButton=Ue,de.DCodeCard=$i,de.DCodeCardCheckboxList=cs,de.DCodeChart=Jc,de.DCodeCheckbox=Gt,de.DCodeCurrencyField=ds,de.DCodeDatePicker=Sa,de.DCodeDialog=Vo,de.DCodeDialogCloseBtn=md,de.DCodeDropzone=Aa,de.DCodeFileField=pd,de.DCodeFileResult=ps,de.DCodeIconDropdown=gd,de.DCodeImageCropperDialog=bs,de.DCodeImageField=Va,de.DCodeImageResult=ys,de.DCodeInfiniteAutoComplete=li,de.DCodeLabel=Hn,de.DCodeMultiSelect=xs,de.DCodeOtpInput=Da,de.DCodePermissionMenu=Bs,de.DCodeProgress=bd,de.DCodeProgressBar=yd,de.DCodeRadio=ks,de.DCodeRadioCustom=ws,de.DCodeSlider=Ma,de.DCodeSwitch=Na,de.DCodeTextField=va,de.DCodeTextarea=qn,de.DCodeTimelineWithIcons=Cd,de.DCodeTreePermissions=Es,de.DCodeUploadFile=Bd,de.DCodeWizard=Cs,de.DataTable=Kn,de.DataTableComponent=Kn,de.DynamicUI=Rd,de.MicroDynamicDatatable=Fd,de.MicroDynamicForm=zd,de.cn=Se,de.default=Rd,de.setApiConfig=Is,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
95
+ `});return(_,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($o),{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",fC,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",hC,[t.showValue?(e.openBlock(),e.createElementBlock("div",mC,[e.createElementVNode("span",pC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",gC,e.toDisplayString(m.value),1),e.createElementVNode("span",bC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",yC,[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:`${g.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:b,onChange:x,onMousedown:p,onMouseup:E,onTouchstart:p,onTouchend:E},null,42,xC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",kC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,k=>(e.openBlock(),e.createElementBlock("div",{key:k.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${C(k.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",wC,e.toDisplayString(k.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",CC,[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),w.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(w.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),BC={class:"grid gap-3"},_C={key:0,class:"ml-1 text-destructive"},SC={class:"inline-flex items-center gap-3"},AC=["id","name","aria-checked","aria-label","disabled"],VC={key:0,class:"absolute inset-0 flex items-center justify-center"},DC={class:"relative z-10 flex items-center gap-2"},NC=["id","name","aria-checked","aria-label","disabled"],MC={key:0,class:"absolute inset-0 flex items-center justify-center"},vC={name:"DCodeSwitch"},Gr=e.defineComponent({...vC,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,h)=>(e.openBlock(),e.createElementBlock("div",BC,[t.title?(e.openBlock(),e.createBlock($o,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",_C,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",SC,[e.createVNode(e.unref(Zi),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(el),{"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",VC,[...h[0]||(h[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(ce.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(ce.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,AC)]),_:1}),e.createVNode(e.unref(Qi),{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",DC,[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",MC,[...h[1]||(h[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(ce.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(ce.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})])]))}}),PC=["aria-busy"],TC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},OC=["for"],FC={key:0,class:"ml-1 text-destructive"},zC={class:"relative w-full group"},IC=["id","value"],RC={key:0,class:"absolute top-1 right-2"},LC={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"},$C={key:1,class:"text-xs text-destructive"},io=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 Q=o.required,O=o["aria-required"];return Q===""||Q===!0||Q==="true"||(O==="true"||O===!0)}),u=e.computed(()=>{const{label:Q,class:O,id:K,required:re,"aria-required":be,...Be}=o;return Be}),f=e.computed(()=>{const Q=o.maxlength;let O=Number.NaN;return typeof Q=="number"?O=Q:typeof Q=="string"&&(O=Number.parseInt(Q,10)),Number.isFinite(O)&&O>0?O:-1}),h=Q=>f.value>0?Q.slice(0,f.value):Q,m=e.computed(()=>{const Q=a.modelValue;return Q==null||String(Q).length===0}),g=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!m.value:!0:!1),b=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,Q=>{const O=String(Q??"");O!==b.value&&(b.value=O)});const x=e.ref(!1),p=e.ref(!1),E=Q=>Q.split(/(\s+)/).map(O=>{if(O.trim()==="")return O;const K=O.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}).join(""),C=Q=>{const O=Q.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)},w=Q=>{switch(a.textCase){case"uppercase":return Q.toUpperCase();case"lowercase":return Q.toLowerCase();case"titlecase":return E(Q);case"sentencecase":return C(Q);case"none":default:return Q}},_=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),B=Q=>{if(!Q)return null;const O=Array.isArray(Q)?Q.join(""):Q;return O?new Set(O):null},k=e.computed(()=>B(a.allowChars)),y=(Q,O)=>(Q.lastIndex=0,Q.test(O)),V=Q=>{if(Q===`
96
+ `)return a.valueType!=="number";if(a.valueType==="free")return!0;const O=Q===" ",K=/\d/.test(Q),re=new RegExp("\\p{L}","u").test(Q),be=new RegExp("\\p{N}","u").test(Q);return a.valueType==="number"?K:a.valueType==="letter"?re||a.allowSpaces&&O:a.valueType==="letternumber"?re||be||a.allowSpaces&&O:!0},N=Q=>{let O="";for(const K of Q){const re=!!k.value&&k.value.has(K);a.pattern&&!re&&!y(a.pattern,K)||!re&&!V(K)||(O+=K)}return O},M=Q=>{const O=N(Q),K=a.applyTextCaseToValue?w(O):O;return h(K)};let D=null;const v=Q=>{if(Q==="")return null;if(a.valueType==="number"&&a.returnNumber){const O=Q.replaceAll(`
97
+ `,""),K=Number(O);return Number.isFinite(K)?K:null}return Q},P=Q=>{b.value=Q,r("update:modelValue",v(Q))},H=(Q,O)=>{const K=h(O);p.value=!0,Q.value=K,P(K),queueMicrotask(()=>p.value=!1)},$=(Q,O)=>{const K=Q.selectionStart??Q.value.length,re=Q.selectionEnd??Q.value.length;if(f.value>0){const be=Q.value.length-(re-K),Be=f.value-be;if(Be<=0)return;O=O.slice(0,Be)}Q.setRangeText(O,K,re,"end"),H(Q,M(Q.value))},q=Q=>{var re;if(!D||x.value||p.value||!((re=Q.inputType)!=null&&re.startsWith("insert")))return;const O=Q.data;if(O==null)return;const K=M(O);K!==O&&(Q.preventDefault(),K.length>0&&$(D,K))},ee=Q=>{var re;if(!D||x.value||p.value)return;const O=((re=Q.clipboardData)==null?void 0:re.getData("text"))??"",K=M(O);K!==O&&(Q.preventDefault(),K.length>0&&$(D,K))},G=async Q=>{if(!D||x.value||p.value)return;const O=Q.target,K=O.value??"",re=M(K);if(re===K){const be=O.selectionStart??re.length,Be=O.selectionEnd??re.length;H(O,re),await e.nextTick();try{O.setSelectionRange(be,Be)}catch{}P(re)}else{const be=O.selectionStart??re.length,Be=O.selectionEnd??re.length;H(O,re),await e.nextTick();try{O.setSelectionRange(be,Be)}catch{}}},L=()=>x.value=!0,W=()=>{if(x.value=!1,!D)return;const Q=D.value??"",O=M(Q);O===Q?P(O):H(D,O)};e.onMounted(()=>{if(D=document.getElementById(c.value),!D)return;D.addEventListener("beforeinput",q),D.addEventListener("paste",ee),D.addEventListener("input",G),D.addEventListener("compositionstart",L),D.addEventListener("compositionend",W);const Q=D.value??"",O=M(Q);O===Q?P(O):H(D,O)}),e.onBeforeUnmount(()=>{D&&(D.removeEventListener("beforeinput",q),D.removeEventListener("paste",ee),D.removeEventListener("input",G),D.removeEventListener("compositionstart",L),D.removeEventListener("compositionend",W),D=null)});const ae=()=>{b.value="",D&&(D.value=""),r("update:modelValue",null),r("clear")},Z=e.computed(()=>b.value.length),J=e.computed(()=>a.showCharCount?f.value>0:!1),le=e.computed(()=>J.value&&Z.value>0),ue=e.computed(()=>`${Z.value} / ${f.value}`),Ce=e.computed(()=>!!a.error),_e=e.computed(()=>{const Q=o.rows,O=typeof Q=="number"?Q:Number.parseInt(String(Q??""),10);return Number.isFinite(O)&&O>0?O:3}),me=e.computed(()=>({height:`${_e.value*24+16}px`}));return(Q,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",TC)):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",FC,"*")):e.createCommentVNode("",!0)],8,OC)):e.createCommentVNode("",!0),e.createElementVNode("div",zC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:b.value},u.value,{style:`text-transform: ${_.value}; padding-right: ${g.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",Ce.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,IC),g.value?(e.openBlock(),e.createElementBlock("div",RC,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:ae}," ✕ ")])):e.createCommentVNode("",!0),le.value&&!Ce.value?(e.openBlock(),e.createElementBlock("p",LC,e.toDisplayString(ue.value),1)):e.createCommentVNode("",!0)]),Ce.value?(e.openBlock(),e.createElementBlock("p",$C,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,PC)),[[e.vShow,i.value]])}}),Pd=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(we.AvatarRoot),{class:e.normalizeClass(e.unref(Pe)(e.unref(jC)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),Td=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Od=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(we.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),jC=sr("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"}}}),Xr=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=Qe.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.Separator),e.mergeProps(e.unref(o),{class:e.unref(Pe)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),WC={class:"bg-card text-card-foreground"},UC={class:"pb-6 px-3"},HC={key:0,class:"flex justify-center p-8"},qC={key:1,class:"p-8 text-center text-red-500"},GC={key:2,class:"relative"},XC={class:"space-y-6"},KC={class:"rounded-xl border bg-card text-card-foreground shadow"},YC={class:"p-4"},JC={class:"flex items-center justify-between gap-3"},QC={class:"font-medium"},ZC={class:"text-xs text-muted-foreground"},eE={class:"mt-1 text-sm text-muted-foreground"},tE={class:"text-foreground"},nE={class:"text-foreground"},oE={class:"mt-1 text-xs text-muted-foreground"},rE={key:0,class:"mt-3 flex items-center gap-2 text-sm"},aE={class:"flex items-center justify-between gap-3"},sE={class:"font-medium"},iE={class:"text-xs text-muted-foreground"},lE={class:"mt-2 text-sm text-muted-foreground"},cE={class:"flex flex-wrap items-center justify-between gap-3"},dE={class:"flex items-center gap-3"},uE={class:"leading-tight"},fE={class:"text-sm font-medium"},hE={class:"text-xs text-muted-foreground"},mE={class:"flex items-center gap-2"},pE={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},gE={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},bE=["src"],yE={class:"flex-1"},xE={class:"flex items-center justify-between gap-3"},kE={class:"font-medium"},wE={class:"text-xs text-muted-foreground"},CE={class:"mt-1 text-sm text-muted-foreground"},EE={class:"text-left sm:text-center"},BE={class:"text-xs text-muted-foreground"},_E={class:"text-left sm:text-center"},SE={class:"text-xs text-muted-foreground"},AE={class:"text-left sm:text-center"},VE={class:"text-xs text-muted-foreground"},DE={class:"flex items-center justify-between gap-3"},NE={class:"font-medium"},ME={class:"text-xs text-muted-foreground"},vE={class:"mt-2 text-sm text-muted-foreground"},PE={class:"mt-3 flex items-center gap-3"},TE={class:"text-sm font-medium"},OE={class:"flex items-start justify-between gap-3"},FE={class:"font-medium"},zE={class:"mt-3 grid gap-2 text-sm"},IE={class:"flex items-center justify-between gap-3"},RE={class:"flex items-center gap-2 text-muted-foreground"},LE={class:"font-medium"},$E={class:"flex items-center justify-between gap-3"},jE={class:"flex items-center gap-2 text-muted-foreground"},WE={class:"font-medium"},UE={class:"flex items-center justify-between gap-3"},HE={class:"flex items-center gap-2 text-muted-foreground"},qE={class:"font-medium"},GE={class:"flex items-center justify-between"},XE={class:"flex items-center gap-2"},KE={class:"flex items-start justify-between gap-3"},YE={class:"flex items-center gap-2"},JE={class:"font-medium"},QE={class:"mt-2 text-sm text-muted-foreground"},ZE={key:0,class:"mt-1 text-sm text-muted-foreground"},eB={class:"flex flex-wrap items-center justify-between gap-3"},tB={class:"flex items-center gap-2"},nB={class:"text-xs text-muted-foreground"},Fd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=Qe.useBreakpoints(Qe.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 h=await f.json();Array.isArray(h)?i.value=h:h.data&&Array.isArray(h.data)?i.value=h.data:h.items&&Array.isArray(h.items)?i.value=h.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:ce.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ce.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ce.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ce.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ce.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ce.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:ce.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(h=>{var m;return(m=h[0])==null?void 0:m.toUpperCase()}).join("");return(f,h)=>{const m=e.resolveComponent("ShoppingCart"),g=e.resolveComponent("DCodeBadge"),b=e.resolveComponent("RefreshCcw"),x=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",WC,[h[8]||(h[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",UC,[a.value?(e.openBlock(),e.createElementBlock("div",HC,[...h[0]||(h[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",qC,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",GC,[h[7]||(h[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",XC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,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",KC,[e.createElementVNode("div",YC,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",JC,[e.createElementVNode("p",QC,e.toDisplayString(p.title),1),e.createElementVNode("p",ZC,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",eE,[e.createElementVNode("span",tE,e.toDisplayString(p.from),1),e.createVNode(e.unref(ce.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",nE,e.toDisplayString(p.to),1)]),e.createElementVNode("p",oE,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",rE,[e.createVNode(e.unref(ce.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",aE,[e.createElementVNode("p",sE,e.toDisplayString(p.title),1),e.createElementVNode("p",iE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",lE,e.toDisplayString(p.desc),1),e.createVNode(e.unref(Xr),{class:"my-4"}),e.createElementVNode("div",cE,[e.createElementVNode("div",dE,[e.createVNode(e.unref(Pd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Od),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Td),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",uE,[e.createElementVNode("p",fE,e.toDisplayString(p.personName),1),e.createElementVNode("p",hE,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",mE,[e.createVNode(e.unref(It),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(It),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",pE,[e.createElementVNode("div",gE,[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,bE)):(e.openBlock(),e.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",yE,[e.createElementVNode("div",xE,[e.createElementVNode("p",kE,e.toDisplayString(p.title),1),e.createElementVNode("p",wE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",CE,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",EE,[h[1]||(h[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",BE,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",_E,[h[2]||(h[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",SE,e.toDisplayString(p.price),1)]),e.createElementVNode("div",AE,[h[3]||(h[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",VE,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",DE,[e.createElementVNode("p",NE,e.toDisplayString(p.title),1),e.createElementVNode("p",ME,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",vE,e.toDisplayString(p.desc),1),e.createElementVNode("div",PE,[e.createVNode(e.unref(Pd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Od),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Td),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",TE,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",OE,[e.createElementVNode("p",FE,e.toDisplayString(p.title),1),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",zE,[e.createElementVNode("div",IE,[e.createElementVNode("div",RE,[e.createVNode(e.unref(ce.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",LE,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",$E,[e.createElementVNode("div",jE,[e.createVNode(e.unref(ce.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",WE,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",UE,[e.createElementVNode("div",HE,[e.createVNode(e.unref(ce.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",qE,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(Xr),{class:"my-4"}),e.createElementVNode("div",GE,[e.createElementVNode("div",XE,[e.createVNode(e.unref(It),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(It),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(b,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",KE,[e.createElementVNode("div",YE,[e.createVNode(x,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",JE,e.toDisplayString(p.title),1)]),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",QE,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",ZE,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(Xr),{class:"my-4"}),e.createElementVNode("div",eB,[e.createElementVNode("div",tB,[e.createVNode(e.unref(It),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(It),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(It),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",nB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),oB={class:"dcode-upload-file"},rB={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"},aB={key:0,class:"text-xs text-gray-500 mt-1"},sB=["accept"],iB={key:1,class:"text-xs text-red-600 mt-1"},zd=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",oB,[t.label?(e.openBlock(),e.createBlock(so,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",rB,[e.createVNode(e.unref(ce.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",aB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,sB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",iB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),lB=["onClick"],cB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},dB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},uB={key:1},fB={key:0,class:"text-white"},hB={key:1},mB={key:2},pB=["disabled","onClick"],gB={key:1,class:"mr-2 text-sm font-bold opacity-70"},bB={class:"whitespace-normal text-sm text-center leading-tight"},yB={class:"flex flex-col flex-1 min-w-0"},xB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},kB={class:"text-sm text-muted-foreground"},wB={class:"px-1"},CB=["disabled"],EB=["type"],BB=["disabled"],Fs=wt(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=ot(),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 k;if(typeof o.modelValue=="string"){const y=(k=o.tabs)==null?void 0:k.findIndex(V=>V.key===o.modelValue);if(y!==void 0&&y>=0)return y}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(k){var y;if(i.value=k,typeof o.modelValue=="string"){const V=(y=o.tabs)==null?void 0:y[k];V?r("update:modelValue",V.key):r("update:modelValue",k)}else r("update:modelValue",k)}}),c=e.computed(()=>{var k;return((k=o.tabs)==null?void 0:k.length)??0}),d=e.computed(()=>{var k;return(k=o.tabs)==null?void 0:k[l.value]});function u(k){return c.value<=0?0:Math.min(Math.max(k,0),c.value-1)}function f(k){return k?typeof k=="string"?Tt[k]||null:k:null}const h=e.reactive({});function m(k){return h[k.key]||(h[k.key]={loaded:!1,loading:!1,data:null,error:null}),h[k.key]}function g(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function b(k){const y=k.endpoint||{};return{apiModule:k.apiModule||y.apiModule,apiAction:k.apiAction||y.apiAction,apiUrl:y.apiUrl,apiMethod:y.apiMethod||"GET",apiParams:k.apiParams}}function x(k){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const y=o.tabs[k];return!(!y||y.disabled)}async function p(k){if(typeof k.tab.fetchData=="function"){const P=await k.tab.fetchData(),H=(P==null?void 0:P.data)??P;return(H==null?void 0:H.data)??H}const y=b(k.tab);if(!(y.apiModule&&y.apiAction||y.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const N=g();let M;if(y.apiUrl)M=await s("","",N,{_url:y.apiUrl,_method:y.apiMethod,_data:y.apiParams??void 0});else{const P={...N,...y.apiParams};M=await s(y.apiModule,y.apiAction,P)}const D=(M==null?void 0:M.data)??M;return(D==null?void 0:D.data)??D}async function E(k,{force:y=!1}={}){const V=u(k),N=o.tabs[V];if(!N)return;const M=m(N);if(!(o.cache&&M.loaded&&!y)&&!M.loading){M.loading=!0,M.error=null;try{const D=await p({tabIndex:V,tab:N});M.data=D,M.loaded=!0,r("loaded",{tabIndex:V,tab:N,data:D})}catch(D){const v=typeof(D==null?void 0:D.message)=="string"&&D.message||typeof D=="string"&&D||"Failed to load tab data.";M.error=v,r("error",{tabIndex:V,tab:N,message:v})}finally{M.loading=!1}}}function C(k){const y=u(k);x(y)&&y!==l.value&&(l.value=y)}function w(k=l.value){return E(k,{force:!0})}function _(){const k=u(l.value-1);k!==l.value&&(l.value=k)}function B(){const k=u(l.value+1);k!==l.value&&(l.value=k)}return e.watch(()=>o.tabs,k=>{for(const y of k??[])m(y)},{immediate:!0}),e.watch(()=>l.value,async k=>{var V;const y=(V=o.tabs)==null?void 0:V[k];y&&r("change",{tabIndex:k,tab:y}),await E(k)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async k=>{k&&await E(l.value)},{immediate:!0}),(k,y)=>(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,(V,N)=>(e.openBlock(),e.createElementBlock("div",{key:V.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",[N<l.value?"wizard-num-done":"",N===l.value?"wizard-num-active":N>l.value?"wizard-num-pending":""]])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!V.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",uB,[N<l.value?(e.openBlock(),e.createElementBlock("span",fB,"✓")):(e.openBlock(),e.createElementBlock("span",hB,e.toDisplayString(N+1),1))])):(e.openBlock(),e.createElementBlock("span",mB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",N===l.value?"wizard-text-active":"wizard-text-pending"])},e.toDisplayString(V.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(V,N)=>(e.openBlock(),e.createElementBlock("div",{key:V.key,onClick:M=>C(N),style:e.normalizeStyle({zIndex:t.tabs.length-N}),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",[N>0?"pl-8":"",N===l.value?"wizard-step-active":N<l.value?"wizard-step-done":"wizard-step-pending"]])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(V.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",cB,e.toDisplayString(N+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",dB,e.toDisplayString(V.title),1)],2),N<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",[N===l.value?"wizard-svg-active":N<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...y[0]||(y[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,lB))),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,(V,N)=>(e.openBlock(),e.createElementBlock("button",{key:V.key,type:"button",disabled:!x(N),onClick:M=>C(N),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 wizard-btn-common",e.unref(Pe)("border-b border-r",!t.isVertical&&N===t.tabs.length-1&&"border-r-0",N===l.value?"wizard-btn-active":"wizard-btn-pending",!x(N)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&V.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(V.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",gB,e.toDisplayString(N+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",bB,e.toDisplayString(V.title),1)],10,pB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(Xr),{key:0})),e.createElementVNode("div",yB,[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 V,N,M,D;return[(e.openBlock(),e.createElementBlock("div",{key:((V=d.value)==null?void 0:V.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(N=h[d.value.key])!=null&&N.loading?e.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",xB,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),y[1]||(y[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(k.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(M=h[d.value.key])==null?void 0:M.data,loaded:(D=h[d.value.key])==null?void 0:D.loaded,reload:w},()=>[e.createElementVNode("div",kB,[y[2]||(y[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",wB,"tab-"+e.toDisplayString(d.value.key),1),y[3]||(y[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:_,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,CB),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,EB)):(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-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,BB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),_B={class:"permission-menu w-full space-y-4"},SB={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"},AB={class:"flex items-center justify-between"},VB={class:"flex items-center gap-3 flex-1"},DB=["onClick"],NB={key:1,class:"w-7"},MB={key:2,class:"flex-shrink-0"},vB={class:"text-lg font-semibold flex-1"},PB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},TB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},OB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},FB=["checked","disabled","onChange"],zB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},IB={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},RB={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},LB={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"},$B={class:"flex items-center justify-between"},jB={class:"flex items-center gap-3 flex-1"},WB={key:0,class:"flex-shrink-0"},UB={class:"text-base font-semibold flex-1"},HB={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},qB={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},GB=["checked","onChange"],XB={class:"text-xs font-medium"},KB={key:0,class:"p-3"},YB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},JB=["checked","disabled","onChange"],QB={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},zs=wt(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}=Vt.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=(N=!0)=>{(D=>{D.forEach(v=>{v.permission.forEach(P=>{const H=`${v.id}-${P.id}-parent`,$=P.code==="VIEW"||P.name.toUpperCase()==="VIEW";l.value.has(H)||l.value.set(H,$||(N?v.checked??!1:!1))}),v.detail&&v.detail.length>0&&v.detail.forEach(P=>{P.permission.forEach(H=>{const $=`${P.id}-${H.id}-child`,q=H.code==="VIEW"||H.name.toUpperCase()==="VIEW";l.value.has($)||l.value.set($,q||(N?P.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(N=>{const M=N.menuId,D=N.actionsIds;i.value.forEach(v=>{v.id===M&&D.forEach(P=>{const H=`${M}-${P}-parent`;l.value.set(H,!0)}),v.detail&&v.detail.length>0&&v.detail.forEach(P=>{P.id===M&&D.forEach(H=>{const $=`${M}-${H}-child`;l.value.set($,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(N,M)=>{M===0&&N>0&&u()});const f=N=>N.detail&&N.detail.length>0,h=N=>{c.value.has(N)?c.value.delete(N):c.value.add(N)},m=N=>c.value.has(N),g=(N,M,D=!1)=>{const v=`${N}-${M}-${D?"child":"parent"}`;return l.value.get(v)??!1},b=()=>{const N=B();s("update:modelValue",N.permissions)},x=(N,M,D,v=!1)=>{const P=D.target.checked,H=`${N}-${M}-${v?"child":"parent"}`;l.value.set(H,P),s("permission-change",N,M,P,!v),b()},p=N=>N.permission.filter(E),E=N=>N.code==="VIEW"||N.name.toUpperCase()==="VIEW",C=(N,M,D)=>{const v=D.target.checked;M.permission.forEach(P=>{if(E(P)){const $=`${M.id}-${P.id}-child`;l.value.set($,!0);return}const H=`${M.id}-${P.id}-child`;l.value.set(H,v)}),l.value=new Map(l.value),s("menu-check",M.id,v),b()},w=(N,M=!1)=>{const D=M?N.permission:p(N);return!D||D.length===0?!1:D.every(v=>{const P=`${N.id}-${v.id}-${M?"child":"parent"}`;return l.value.get(P)??!1})},_=()=>{const N={};return i.value.forEach(M=>{var D;N[M.id]={name:M.name,parentPermissions:M.permission.map(v=>({id:v.id,name:v.name,checked:g(M.id,v.id,!1)})),children:((D=M.detail)==null?void 0:D.map(v=>({id:v.id,name:v.name,permissions:v.permission.map(P=>({id:P.id,name:P.name,checked:g(v.id,P.id,!0)}))})))||[]}}),N},B=()=>{const N=[],M=(D,v=!1)=>{const P=[];D.permission.forEach(H=>{const $=`${D.id}-${H.id}-${v?"child":"parent"}`;(l.value.get($)??!1)&&P.push(H.id)}),P.length>0&&N.push({menuId:D.id,actionsIds:P})};return i.value.forEach(D=>{M(D,!1),D.detail&&D.detail.length>0&&D.detail.forEach(v=>{M(v,!0)})}),{permissions:N}};return n({getCurrentStates:_,getPermissionsForDatabase:B,getAllPermissionsWithStatus:()=>{const N=[],M=(D,v=!1)=>{const P=D.permission.map($=>{const q=`${D.id}-${$.id}-${v?"child":"parent"}`,ee=l.value.get(q)??!1;return{id:$.id,name:$.name,checked:ee}}),H=P.filter($=>$.checked).map($=>$.id);N.push({menuId:D.id,menuName:D.name,actionsIds:H,actions:P})};return i.value.forEach(D=>{M(D,!1),D.detail&&D.detail.length>0&&D.detail.forEach(v=>{M(v,!0)})}),{permissions:N}},permissionStates:l,expandAll:()=>{i.value.forEach(N=>{f(N)&&c.value.add(N.id)})},collapseAll:()=>{c.value.clear()}}),(N,M)=>(e.openBlock(),e.createElementBlock("div",_B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,D=>(e.openBlock(),e.createElementBlock("div",{key:D.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(D)}])},[e.createElementVNode("div",SB,[e.createElementVNode("div",AB,[e.createElementVNode("div",VB,[f(D)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:v=>h(D.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(D.id)?(e.openBlock(),e.createBlock(e.unref(ce.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(ce.ChevronRight),{key:1,class:"w-5 h-5"}))],8,DB)):(e.openBlock(),e.createElementBlock("div",NB)),t.showIcons&&D.icon?(e.openBlock(),e.createElementBlock("span",MB,[e.createElementVNode("i",{class:e.normalizeClass([D.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",vB,e.toDisplayString(D.name),1)])])]),D.permission&&D.permission.length>0&&!f(D)?(e.openBlock(),e.createElementBlock("div",PB,[e.createElementVNode("h4",TB,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",OB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(D),v=>(e.openBlock(),e.createElementBlock("label",{key:v.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:E(v)||g(D.id,v.id,!1),disabled:E(v),onChange:P=>x(D.id,v.id,P,!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",E(v)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,FB),e.createElementVNode("span",zB,e.toDisplayString(v.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(D)&&m(D.id)?(e.openBlock(),e.createElementBlock("div",IB,[e.createElementVNode("h4",RB,[M[0]||(M[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(D.detail,v=>(e.openBlock(),e.createElementBlock("div",{key:v.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",LB,[e.createElementVNode("div",$B,[e.createElementVNode("div",jB,[t.showIcons&&v.icon?(e.openBlock(),e.createElementBlock("span",WB,[e.createElementVNode("i",{class:e.normalizeClass([v.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",UB,e.toDisplayString(v.name),1),v.path?(e.openBlock(),e.createElementBlock("span",HB,e.toDisplayString(v.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",qB,[e.createElementVNode("input",{type:"checkbox",checked:w(v,!0),onChange:P=>C(D,v,P),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,GB),e.createElementVNode("span",XB,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),v.permission&&v.permission.length>0?(e.openBlock(),e.createElementBlock("div",KB,[e.createElementVNode("div",YB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.permission,P=>(e.openBlock(),e.createElementBlock("label",{key:P.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:E(P)||g(v.id,P.id,!0),disabled:E(P),onChange:H=>x(v.id,P.id,H,!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",E(P)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,JB),e.createElementVNode("span",QB,e.toDisplayString(P.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),ZB={class:"space-y-4"},e_={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},t_={key:0,class:"text-danger-500"},n_={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},o_={class:"text-neutral-600 dark:text-neutral-400"},r_={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},a_={class:"text-neutral-500 dark:text-neutral-400"},s_={key:3,class:"space-y-3"},i_={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},l_={class:"flex items-center gap-3"},c_={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},d_={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},u_={class:"flex items-center gap-2 text-sm font-medium"},f_={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},h_={class:"p-4"},m_={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},p_={class:"ml-2 flex-1 min-w-0"},g_=["for"],b_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},y_={key:4,class:"mt-1 text-xs text-danger-600"},Is=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}=Vt.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(E=>({menuId:E.menuId,module:E.module,label:E.label||E.module,permissions:E.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const E={};return p.forEach(C=>{const w=C.key,_=w&&w.includes(".")?w.split(".")[0]:"other";E[_]||(E[_]={menuId:0,module:_,label:_,permissions:[]}),E[_].permissions.push({id:C.id,key:C.key,label:C.label,description:C.description})}),Object.values(E)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const E=[],C=(w,_="")=>{const B=_?`${_}.${w.name}`:w.name,k=B.toLowerCase().replace(/\s+/g,"_"),y=[];if(w.detail&&Array.isArray(w.detail)&&w.detail.forEach(V=>{y.push(V.id)}),w.permission&&w.permission.length>0){const V=w.permission.map(N=>({id:N.id,key:`${k}.${N.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${N.name} ${w.name}`,description:`Permission to ${N.name.toLowerCase()} ${w.name.toLowerCase()}`}));E.push({menuId:w.id,module:k,label:w.name,permissions:V,subMenuIds:y.length>0?y:void 0})}w.detail&&Array.isArray(w.detail)&&w.detail.forEach(V=>{C(V,B)})};return p.forEach(w=>C(w)),E}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 E=u(p);i.value=E;const C={},w=[],_={};E.forEach(k=>{k.permissions.forEach(y=>{const V=typeof y.id=="string"?parseInt(y.id):y.id;_[V]=k.menuId})});const B=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(k=>{w.push(k.menuId),k.actionsIds&&Array.isArray(k.actionsIds)&&k.actionsIds.forEach(y=>B.add(y))}),E.forEach(k=>k.permissions.forEach(y=>{const V=typeof y.id=="string"?parseInt(y.id):y.id;C[V]=B.has(V)})),l.value=C,c.value=w,d.value=_}catch{i.value=[]}finally{s.value=!1}},h=p=>p.permissions.filter(E=>{const C=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[C]}).length,m=p=>p.permissions.every(E=>{const C=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[C]}),g=p=>{const E=h(p);return E>0&&E<p.permissions.length},b=e.ref(!1),x=(p,E)=>{b.value=!0,p.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),p.permissions.forEach(_=>{const B=typeof _.id=="string"?parseInt(_.id):_.id;l.value[B]=E});let C=o.modelValue?[...o.modelValue]:[],w=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(w=[...w,...p.subMenuIds],p.subMenuIds.forEach(_=>{const B=i.value.find(k=>k.menuId===_);B&&B.permissions.forEach(k=>{const y=typeof k.id=="string"?parseInt(k.id):k.id;l.value[y]=E})})),E?w.forEach(_=>{const B=i.value.find(k=>k.menuId===_);if(B){const k=B.permissions.map(V=>typeof V.id=="string"?parseInt(V.id):V.id),y=C.findIndex(V=>V.menuId===_);y!==-1?C[y]={menuId:_,actionsIds:k}:C.push({menuId:_,actionsIds:k})}}):C=C.filter(_=>!w.includes(_.menuId)),c.value=C.map(_=>_.menuId),console.log("Full Result:",JSON.stringify(C,null,2)),r("update:modelValue",C),setTimeout(()=>{b.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const E=new Set,C=[];p.forEach(w=>{C.push(w.menuId),w.actionsIds&&Array.isArray(w.actionsIds)&&w.actionsIds.forEach(_=>E.add(_))}),Object.keys(l.value).forEach(w=>{const _=parseInt(w);l.value[_]=E.has(_)}),c.value=C}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,E)=>{if(b.value)return;if(Object.keys(p).map(w=>parseInt(w)).filter(w=>p[w]!==(E==null?void 0:E[w])).length>0){let w=o.modelValue?[...o.modelValue]:[];const _={};Object.keys(p).forEach(B=>{const k=parseInt(B);if(p[k]){const y=d.value[k];console.log(`Permission ${k} belongs to Menu ${y}`),y!==void 0&&(_[y]||(_[y]=[]),_[y].push(k))}}),Object.keys(_).forEach(B=>{const k=parseInt(B),y=_[k],V=w.findIndex(N=>N.menuId===k);V!==-1?w[V]={menuId:k,actionsIds:y}:w.push({menuId:k,actionsIds:y})}),w=w.filter(B=>_[B.menuId]&&_[B.menuId].length>0),c.value=w.map(B=>B.menuId),console.log("Result:",JSON.stringify(w,null,2)),r("update:modelValue",w)}},{deep:!0}),e.onMounted(f),(p,E)=>(e.openBlock(),e.createElementBlock("div",ZB,[t.label?(e.openBlock(),e.createElementBlock("label",e_,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",t_,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",n_,[e.createVNode(e.unref(ce.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",o_,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",r_,[e.createElementVNode("p",a_,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",s_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,C=>(e.openBlock(),e.createElementBlock("div",{key:C.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",i_,[e.createElementVNode("div",l_,[e.createVNode(cn,{modelValue:m(C),indeterminate:g(C),"onUpdate:modelValue":w=>x(C,!!w),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",c_,e.toDisplayString(C.label||C.module),1),e.createElementVNode("div",d_,e.toDisplayString(h(C))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(C.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",u_,[e.createElementVNode("div",f_,e.toDisplayString(h(C))+"/"+e.toDisplayString(C.permissions.length),1)])]),e.createElementVNode("div",h_,[e.createElementVNode("div",m_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.permissions,w=>(e.openBlock(),e.createElementBlock("div",{key:w.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(cn,{modelValue:l.value[typeof w.id=="string"?parseInt(w.id):w.id],"onUpdate:modelValue":_=>l.value[typeof w.id=="string"?parseInt(w.id):w.id]=_,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",p_,[e.createElementVNode("label",{for:`perm-${w.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(w.label||w.key),9,g_),w.description?(e.openBlock(),e.createElementBlock("p",b_,e.toDisplayString(w.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",y_,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),x_=(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)},k_=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)}}),w_=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):k_(t),C_={key:0,class:"fixed inset-0 z-[100] flex justify-end"},E_={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"},B_={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},__={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},S_={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},A_={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},V_={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},D_=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(Ke,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",C_,[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",E_,[e.createElementVNode("div",B_,[e.createElementVNode("div",null,[e.createElementVNode("h3",__,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",S_,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Ke,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",A_,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",V_,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),N_={key:0},M_=["value","name"],Id=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=Vt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:Xn,DCodeAutoComplete:tr,DCodeDatePicker:jr,DCodeTextarea:io,DCodeTextArea:io,DCodeCheckbox:cn,DCodeSwitch:Gr,DCodeOtpInput:Hr,DCodeImageField:Ur,DCodeSlider:qr},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(h=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(h)&&!f.hasOwnProperty(h)&&(f[h]=u[h])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",N_,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,M_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),v_=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=Qe.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(Pe)("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)]])}}),P_=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=Qe.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.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"]))}}),T_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Qe.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(Pe)("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"]))}}),O_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Qe.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(Pe)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(ce.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),F_=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=Qe.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(Pe)(e.unref(Gn)({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(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),z_=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=Qe.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(Pe)(e.unref(Gn)({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=Qe.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(Pe)(e.unref(Gn)({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(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),R_=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=Qe.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(Pe)(e.unref(Gn)({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(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),L_=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=Qe.reactiveOmit(n,"class","size"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(Pe)(e.unref(Gn)({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(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),$_=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=we.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(we.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),j_=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=Qe.reactiveOmit(o,"class"),s=we.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(we.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(we.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Pe)("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(q_)),e.createVNode(e.unref(we.SelectViewport),{class:e.normalizeClass(e.unref(Pe)("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}))}}),W_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},U_=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=Qe.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(Pe)("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",W_,[e.createVNode(e.unref(we.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(we.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=Qe.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(Pe)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronDown))])]),_:3},16,["class"]))}}),q_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=Qe.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(Pe)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.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=Qe.reactiveOmit(n,"class"),r=we.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(we.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(Pe)("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(we.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),X_=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(we.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Wo={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},lo={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},pt={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},K_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},Y_={dangerouslyHTMLString:!1,multiple:!0,position:Wo.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},J_={rtl:!1,newestOnTop:!1,toastClassName:""},Rd={...Y_,...J_};pt.DEFAULT;var ze=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(ze||{}),Rs=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(Rs||{});const Q_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},Z_={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},e2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},t2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},Ld="Toastify--animate Toastify__none-enter";function $d(t,n=!1){var o;let r=Q_;if(!t||typeof t=="string")switch(t){case"flip":r=t2;break;case"zoom":r=e2;break;case"slide":r=Z_;break}else r=t;if(n)r.enter=Ld;else if(r.enter===Ld){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function n2(t){return t.containerId||String(t.position)}const Kr="will-unmount";function o2(t=Wo.TOP_RIGHT){return!!document.querySelector(`.${ze.CSS_NAMESPACE}__toast-container--${t}`)}function r2(t=Wo.TOP_RIGHT){return`${ze.CSS_NAMESPACE}__toast-container--${t}`}function a2(t,n,o=!1){const r=[`${ze.CSS_NAMESPACE}__toast-container`,`${ze.CSS_NAMESPACE}__toast-container--${t}`,o?`${ze.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return uo(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function s2(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=ze.CSS_NAMESPACE,l=r2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(Kr)),f=c||document.createElement("div"),h=document.createElement("div");h.className=a2(o,r,a),h.dataset.testid=`${ze.CSS_NAMESPACE}__toast-container--${o}`,h.id=n2(t);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const g=s[m];h.style[m]=g}return c||(f.className=ze.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function Ls(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",Ls,!1);try{Uo[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete Uo[a],delete ct[a]}catch{}}const Uo=e.reactive({});function i2(t,n){const o=document.getElementById(String(n));o&&(Uo[o.id]=t)}function $s(t,n=!0){const o=String(t);if(!Uo[o])return;const r=document.getElementById(o);r&&r.classList.add(Kr),n?(c2(t),r&&r.addEventListener("animationend",Ls,!1)):Ls(o),vt.items=vt.items.filter(a=>a.containerId!==t)}function l2(t){for(const n in Uo)$s(n,t);vt.items=[]}function jd(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...$d(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function c2(t){for(const n in ct)if(n===t)for(const o of ct[n]||[])jd(o)}function d2(t){const n=co().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function js(t){return document.getElementById(t)}function u2(t){const n=js(t.containerId);return n&&n.classList.contains(Kr)}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 f2(t){return t?vt.items.filter(n=>n.containerId===t).length>0:vt.items.length>0}function h2(){if(vt.items.length>0){const t=vt.items.shift();Yr(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const ct=e.reactive({}),vt=e.reactive({items:[]});function co(){const t=e.toRaw(ct);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function m2(t){return co().find(n=>n.toastId===t)}function Yr(t,n={}){if(u2(n)){const o=js(n.containerId);o&&o.addEventListener("animationend",Ws.bind(null,t,n),!1)}else Ws(t,n)}function Ws(t,n={}){const o=js(n.containerId);o&&o.removeEventListener("animationend",Ws.bind(null,t,n),!1);const r=ct[n.containerId]||[],a=r.length>0;if(!a&&!o2(n.position)){const s=s2(n),i=e.createApp(I2,n);n.useHandler&&n.useHandler(i),i.mount(s),i2(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?Et.update(n):Et.add(t,n)})}const Et={add(t,n){const{containerId:o=""}=n;o&&(ct[o]=ct[o]||[],ct[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=ct[o])==null||r.unshift(n):(a=ct[o])==null||a.push(n),n.onOpen&&n.onOpen(Wd(n))},n.delay||0))},remove(t){if(t){const n=d2(t);if(n){const o=ct[n];let r=o.find(a=>a.toastId===t);ct[n]=o.filter(a=>a.toastId!==t),!ct[n].length&&!f2(n)&&$s(n,!1),h2(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(Wd(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){ct[n]=ct[n]||[];const o=ct[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};Et.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{Le(a.content,a)},t.delay||0)}},clear(t,n=!0){t?$s(t,n):l2(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",Et.dismissCallback,!1),setTimeout(()=>{Et.remove(o)}))},dismiss(t){if(t){const n=co();for(const o of n)if(o.toastId===t){jd(o,r=>{r.addEventListener("animationend",Et.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=co();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",Et.dismissCallback,!1),Et.remove(t));break}}}},p2=e.reactive({useHandler:void 0}),Ud=e.reactive({}),Jr=e.reactive({});function Hd(){return Math.random().toString(36).substring(2,9)}function g2(t){return typeof t=="number"&&!isNaN(t)}function Us(t){return typeof t=="string"}function uo(t){return typeof t=="function"}function Qr(...t){return e.mergeProps(...t)}function Zr(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function b2(t={}){Ud[`${ze.CSS_NAMESPACE}-default-options`]=t}function qd(){return Ud[`${ze.CSS_NAMESPACE}-default-options`]||Rd}function y2(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var ea=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(ea||{});const Gd={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:Wo.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:lo.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:pt.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}},x2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:pt.DEFAULT},theme:{type:String,required:!1,default:lo.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}},k2=e.defineComponent({name:"ProgressBar",props:x2,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(()=>[`${ze.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${ze.CSS_NAMESPACE}__progress-bar--controlled`:`${ze.CSS_NAMESPACE}__progress-bar--animated`,`${ze.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${ze.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${ze.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)}}),w2=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:lo.AUTO},type:{type:String,required:!1,default:lo.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${ze.CSS_NAMESPACE}__close-button ${ze.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)])])}}),ta=({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 C2(t){return e.createVNode(ta,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 E2(t){return e.createVNode(ta,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 B2(t){return e.createVNode(ta,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 _2(t){return e.createVNode(ta,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 S2(){return e.createVNode("div",{class:`${ze.CSS_NAMESPACE}__spinner`},null)}const na={info:E2,warning:C2,success:B2,error:_2,spinner:S2},A2=t=>t in na;function V2({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 na.spinner();if(r!==!1){if(Zr(r))a=e.toRaw(r);else if(uo(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?na.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):Us(r)||g2(r)?a=r:A2(n)&&(a=na[n](i));return a}}const D2=()=>{};function N2(t,n,o=ze.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 M2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(ea.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||ze.COLLAPSE_DURATION}),i=s.done||D2,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:x,onMouseleave:b}:{});function u(){const E=l.value.split(" ");h().addEventListener(Rs.ENTRANCE_ANIMATION_END,b,{once:!0});const C=_=>{const B=h();_.target===B&&(B.dispatchEvent(new Event(Rs.ENTRANCE_ANIMATION_END)),B.removeEventListener("animationend",C),B.removeEventListener("animationcancel",C),a.value===ea.Enter&&_.type!=="animationcancel"&&B.classList.remove(...E))},w=()=>{const _=h();_.classList.add(...E),_.addEventListener("animationend",C),_.addEventListener("animationcancel",C)};t.pauseOnFocusLoss&&m(),w()}function f(){if(!h())return;const E=()=>{const w=h();w.removeEventListener("animationend",E),s.collapse?N2(w,i,s.collapseDuration):i()},C=()=>{const w=h();a.value=ea.Exit,w&&(w.className+=` ${c.value}`,w.addEventListener("animationend",E))};o.value||(r.value?E():setTimeout(C))}function h(){return t.toastRef.value}function m(){document.hasFocus()||x(),window.addEventListener("focus",b),window.addEventListener("blur",x)}function g(){window.removeEventListener("focus",b),window.removeEventListener("blur",x)}function b(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function x(){n.value=!1}function p(E){E&&(E.stopPropagation(),E.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const E=co();o.value=E.findIndex(C=>C.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?x():b())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&g()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function v2(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 P2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:Gd,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>V2(t)),s=e.computed(()=>[`${ze.CSS_NAMESPACE}__toast`,`${ze.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${ze.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${ze.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=M2({toastRef:n,loading:o,done:()=>{Et.remove(t.toastId)},...$d(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(v2(f)){const h=[];return f.title!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${ze.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${ze.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${ze.CSS_NAMESPACE}__toast-text`},[h])}return Zr(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):uo(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:`${ze.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${ze.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${ze.CSS_NAMESPACE}--animate-icon ${ze.CSS_NAMESPACE}__zoom-enter`].join(" ")},[Zr(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):uo(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(w2,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),Zr(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):uo(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(k2,{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)])}}),oa="vue3-toastify:url-change";let ra=0,Ho;function T2(){if(!(typeof window>"u")&&Jr.lastUrl!==window.location.href){Jr.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:qd().clearOnUrlChange!==!1,n=Object.values(ct).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&Et.dismiss(o.toastId);vt.items=vt.items.filter(o=>!t(o.toastProps))}}function O2(){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(oa)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(oa)),a},()=>{t.pushState=n,t.replaceState=o}}function F2(){if(typeof window>"u"||Ho)return;const t=O2(),n=()=>T2();window.addEventListener(oa,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),Ho=()=>{t(),window.removeEventListener(oa,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),Ho=void 0}}function z2(){Ho&&(Ho(),Jr.lastUrl="")}const I2=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:Gd,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>ct[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(ra+=1,F2())}),e.onUnmounted(()=>{typeof window<"u"&&ra>0&&(ra-=1,ra===0&&z2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(P2,e.mergeProps({key:s},a),null)})])}});let Hs=!1;const Xd={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function Kd(){const t=[];return co().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(Kr)&&t.push(n)}),t}function R2(t){const n=Kd().length,o=t??0;return o>0&&n+vt.items.length>=o}function L2(t){R2(t.limit)&&!t.updateId&&vt.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function En(t,n,o={}){if(Hs)return;o=Qr(qd(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=Hd()),o={...o,...o.type==="loading"?Xd:{},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=y2()),L2(o),Jr.lastUrl=window.location.href,o.multiple?vt.items.length?o.updateId&&Yr(t,o):Yr(t,o):(Hs=!0,Le.clearAll(void 0,!1),setTimeout(()=>{Yr(t,o)},0),setTimeout(()=>{Hs=!1},390)),o.toastId}const Le=(t,n)=>En(t,pt.DEFAULT,n);Le.info=(t,n)=>En(t,pt.DEFAULT,{...n,type:pt.INFO}),Le.error=(t,n)=>En(t,pt.DEFAULT,{...n,type:pt.ERROR}),Le.warning=(t,n)=>En(t,pt.DEFAULT,{...n,type:pt.WARNING}),Le.warn=Le.warning,Le.success=(t,n)=>En(t,pt.DEFAULT,{...n,type:pt.SUCCESS}),Le.loading=(t,n)=>En(t,pt.DEFAULT,Qr(n,Xd)),Le.dark=(t,n)=>En(t,pt.DEFAULT,Qr(n,{theme:lo.DARK})),Le.remove=t=>{t?Et.dismiss(t):Et.clear()},Le.clearAll=(t,n)=>{e.nextTick(()=>{Et.clear(t,n)})},Le.isActive=t=>{let n=!1;return n=Kd().findIndex(o=>o.toastId===t)>-1,n},Le.update=(t,n={})=>{setTimeout(()=>{const o=m2(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:Hd()},i=s.render||a;delete s.render,En(i,s.type,s)}},0)},Le.done=t=>{Le.update(t,{isLoading:!1,progress:1})},Le.promise=$2;function $2(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=Us(n)?Le.loading(n,d):Le.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=(m,g,b)=>{if(g==null){Le.remove(c);return}const x={type:m,...u,...a,data:b},p=Us(g)?{render:g}:g;return c?Le.update(c,{...x,...p,isLoading:!1}):Le(p.render,{...x,...p,isLoading:!1}),b},h=uo(t)?t():t;return h.then(m=>{f("success",r,m)}).catch(m=>{f("error",o,m)}),h}Le.POSITION=Wo,Le.THEME=lo,Le.TYPE=pt,Le.TRANSITIONS=K_;const j2={install(t,n={}){p2.useHandler=n.useHandler||(()=>{}),W2(n)}};typeof window<"u"&&(window.Vue3Toastify=j2);function W2(t={}){const n=Qr(Rd,t);b2(n)}const U2={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"},qs=wt(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(()=>n.icon?Tt[n.icon]:null),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 Pe(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>Pe("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,h)=>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-42cc5d83"]]);var aa={exports:{}},q2=aa.exports,Yd;function G2(){return Yd||(Yd=1,(function(t,n){(function(o,r){t.exports=r()})(q2,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(x){return r.apply(x,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,h,m;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 h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.filter(function(x){return r.truthy(r.apply(f,x))}):[];if(l==="map")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.map(function(x){return r.apply(f,x)}):[];if(l==="reduce")return h=r.apply(c[0],i),f=c[1],m=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(h)?h.reduce(function(x,p){return r.apply(f,{current:p,accumulator:x})},m):m;if(l==="all"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(!r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="none"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!0;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="some"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!0;return!1}}if(c=c.map(function(x){return r.apply(x,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var g=String(l).split("."),b=a;for(d=0;d<g.length;d++){if(!b.hasOwnProperty(g[d]))throw new Error("Unrecognized operation "+l+" (failed at "+g.slice(0,d+1).join(".")+")");b=b[g[d]]}return b.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})})(aa)),aa.exports}var X2=G2();const Kt=Ui(X2),K2={class:"dcode-card animate-slide-up"},Y2={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"},J2={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},Q2={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]"},Z2={class:"relative w-full sm:w-64"},eS={key:0,class:"relative"},tS={class:"flex flex-col h-full"},nS={key:0,class:"flex-1 overflow-y-auto py-4"},oS={class:"grid grid-cols-1 gap-4 px-1"},rS={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"},aS={class:"flex justify-end gap-2 w-full"},sS={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},iS={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},lS={class:"dcode-table w-full"},cS={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},dS=["onClick"],uS={key:0,class:"flex items-center justify-center w-full"},fS={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},hS={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},mS={key:0,class:"px-3 py-0.5"},pS={key:1},gS=["colspan"],bS={class:"flex flex-col items-center gap-2"},yS={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},xS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},kS={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},wS={key:0,class:"flex items-center justify-center"},CS={key:0,class:"px-3 py-0.5 !text-center"},ES={key:0,class:"flex items-center justify-center gap-1.5"},BS={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},_S=["colspan"],SS={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"},AS={class:"flex items-center gap-4"},VS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},DS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},NS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},MS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},vS={class:"flex-shrink-0"},PS={class:"space-y-4"},TS={class:"text-gray-600 dark:text-gray-400"},OS={class:"grid grid-cols-1 gap-4 py-4 px-1"},FS={class:"flex items-end gap-2"},fo=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}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var ru,au,su,iu,lu,cu;Kt.add_operation("length",S=>S==null?0:typeof S=="string"||Array.isArray(S)?S.length:typeof S=="number"?String(S).length:typeof S=="object"?Object.keys(S).length:0),Kt.add_operation("==",(S,I)=>S!==null&&typeof S=="object"&&"_isLogicValue"in S?S.id==I||S.code==I:I!==null&&typeof I=="object"&&"_isLogicValue"in I?I.id==S||I.code==S:S==I),Kt.add_operation("!=",(S,I)=>S!==null&&typeof S=="object"&&"_isLogicValue"in S?!(S.id==I||S.code==I):I!==null&&typeof I=="object"&&"_isLogicValue"in I?!(I.id==S||I.code==S):S!=I);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=ot(),{locale:l}=Vt.useI18n();let c={query:{},params:{},path:""};try{const S=_n.useRoute();S?c=S:(su=(au=(ru=s==null?void 0:s.appContext)==null?void 0:ru.config)==null?void 0:au.globalProperties)!=null&&su.$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:S=>{console.warn("Router push() logic called from fallback:",S),typeof S=="string"&&S.startsWith("/")&&(window.location.href=S)}};try{const S=_n.useRouter();S?d=S:(cu=(lu=(iu=s==null?void 0:s.appContext)==null?void 0:iu.config)==null?void 0:lu.globalProperties)!=null&&cu.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),h=e.ref(r.perPage),m=e.ref({key:"",direction:"asc"}),g=e.ref([]),b=e.ref(!1),x=e.ref(0),p=e.ref({}),E=e.ref([]),C=e.ref(null),w=e.ref(!0),_=e.ref([]),B=e.ref([]),k=e.ref([]),y=e.ref(!1),V=e.ref(!1),N=e.ref({}),M=e.ref(null),D=e.ref(null),v=e.ref(null),P=e.ref([]),H=e.computed(()=>{if(A.value.length===0)return!1;const S=A.value.map(I=>{const oe=Q.value.find(j=>j.type==="CHECKBOX"),z=(oe==null?void 0:oe.keyCheckbox)||"id";return I[z]}).filter(I=>I!=null);return S.length===0?!1:S.every(I=>P.value.includes(I))}),$=e.computed(()=>{if(A.value.length===0)return!1;const S=Q.value.find(j=>j.type==="CHECKBOX"),I=(S==null?void 0:S.keyCheckbox)||"id",oe=A.value.map(j=>j[I]).filter(j=>j!=null),z=oe.filter(j=>P.value.includes(j)).length;return z>0&&z<oe.length}),q=S=>{const I=Q.value.find(j=>j.type==="CHECKBOX"),oe=(I==null?void 0:I.keyCheckbox)||"id",z=S[oe];return z!==void 0&&P.value.includes(z)},ee=S=>{const I=Q.value.find(j=>j.type==="CHECKBOX"),oe=(I==null?void 0:I.keyCheckbox)||"id",z=A.value.map(j=>j[oe]).filter(j=>j!=null);if(S){const j=new Set([...P.value,...z]);P.value=Array.from(j)}else P.value=P.value.filter(j=>!z.includes(j))},G=(S,I)=>{const oe=Q.value.find(te=>te.type==="CHECKBOX"),z=(oe==null?void 0:oe.keyCheckbox)||"id",j=S[z];j!=null&&(I?P.value.includes(j)||P.value.push(j):P.value=P.value.filter(te=>te!==j))};e.watch(P,S=>{var oe;a("update:selection",S);const I=H.value||S.length>1;(oe=B.value)!=null&&oe.length&&B.value.forEach(z=>{var j;(j=z.fieldActionGlobal)!=null&&j.length&&z.fieldActionGlobal.forEach(te=>{var Se,je;const ke=z.endpoint||((Se=z.propsActionGlobal)==null?void 0:Se.endpointPropAction)||z.propsActionGlobal,Ae=(je=ke==null?void 0:ke.keyParam)==null?void 0:je[0];(Ae&&te.model===Ae||!Ae&&/^(id|ids|idAuditTrail)/i.test(te.model))&&I&&te.model&&(N.value[te.model]=S)})})},{deep:!0});const L=S=>Array.from({length:S}).map((I,oe)=>{const z={id:oe+1,no:oe+1};return Q.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?z[j.keyCheckbox||"id"]=oe+1:j.type==="BADGE"||j.type==="badge"||j.condition?z[j.key]=j.condition&&j.condition.length>0?j.condition[0].value:"Active":z[j.key]=`Data ${j.label} ${oe+1}`)}),z}),W=S=>S&&typeof S=="string"&&S.trim()?S:void 0,ae=e.computed(()=>{var S,I,oe,z;return W((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiModule)||W((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiModule)||r.apiModule}),Z=e.computed(()=>{var S,I,oe,z;return W((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiAction)||W((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiAction)||r.apiAction}),J=e.computed(()=>{var S,I,oe,z;return W((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiMethod)||W((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiMethod)||r.apiMethod||"POST"}),le=e.computed(()=>{var S,I,oe,z;return W((I=(S=C.value)==null?void 0:S.endpoint)==null?void 0:I.apiUrl)||W((z=(oe=C.value)==null?void 0:oe.endpointGlobal)==null?void 0:z.apiUrl)||r.apiUrl}),ue=e.computed(()=>r.permissionBase||""),Ce=e.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((S,I)=>(S.seq||0)-(I.seq||0))),_e=S=>{var te,ke,Ae;const I=(S==null?void 0:S.column)||((te=S==null?void 0:S.props)==null?void 0:te.column)||((ke=S==null?void 0:S.propsFieldGlobal)==null?void 0:ke.column)||((Ae=S==null?void 0:S.propsFieldCustom)==null?void 0:Ae.column);if(!I)return"col-span-1";const oe=I.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"}[oe]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${S==null?void 0:S.model}: type=${I}, returned=${j}`),j},me=()=>{let S=null;if(r.tableConfig&&(S=r.tableConfig),S){C.value=S,S.headers&&(E.value=S.headers.map(z=>{var ke,Ae,Ee,Se,je,Oe,We,St,Yt,la;if(z.key==="action"||((ke=z.custom)==null?void 0:ke.type)==="ACTION"||((Ae=z.custom)==null?void 0:Ae.type)==="action"){const At=((Ee=z.custom)==null?void 0:Ee.actionCustom)||((Se=z.custom)==null?void 0:Se.action);return At&&(_.value=At.map(Pt=>{const et=Pt.propsActionCustom||Pt.props||{},ca=Pt.propCustomMessage||{};return{permission:Pt.permission,label:l.value==="id"?et.labelID:et.labelEN,tooltip:l.value==="id"?et.tooltipID||et.labelID:et.tooltipEN||et.labelEN,icon:et.icon,variant:et.variant||"ghost",bgColor:et.bgColor,action:et.actionType||et.key,route:et.route,path:et.path,endpoint:et.endpointPropAction,requiredCondition:Pt.requiredCondition||!1,propCustomCondition:Pt.propCustomCondition||[],fieldMapping:Pt.fieldMapping||et.fieldMapping||null,openDialog:Pt.openDialog||!1,fieldActionCustom:(Pt.fieldActionCustom||[]).map(da=>{const Ys=da.propsFieldCustom||da.propsFieldGlobal||da.props||{};return{...da,props:{...Ys,endpoint:Ys.endpointComponent||Ys.endpoint}}}),condition:Pt.visibleRule||Pt.propCustomCondition||et.visibleRule||et.propCustomCondition||null,requireConfirm:Pt.requireConfirm||et.requireConfirm||!1,confirmTitle:l.value==="id"?ca.titleID||et.confirmTitleID||"Konfirmasi":ca.titleEN||et.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?ca.messageID||et.confirmMessageID||"Apakah Anda yakin?":ca.messageEN||et.confirmMessageEN||"Are you sure?"}})),null}let j;const te=((je=z.custom)==null?void 0:je.conditionBadge)||((Oe=z.custom)==null?void 0:Oe.condition);return(((We=z.custom)==null?void 0:We.type)==="BADGE"||((St=z.custom)==null?void 0:St.type)==="badge")&&te&&(j=te.map(At=>({value:At.value,label:l.value==="id"?At.labelID:At.labelEN,labelID:At.labelID,labelEN:At.labelEN,color:At.color||At.bgColor,variant:At.variant,logic:At.logic||At.conditionRule||null}))),{key:z.key,label:l.value==="id"?z.labelID:z.labelEN,width:z.width,align:z.align,sortable:!0,type:(Yt=z.custom)==null?void 0:Yt.type,condition:j,keyCheckbox:(la=z.custom)==null?void 0:la.keyCheckbox}}).filter(z=>z!==null));const I=S.filters||S.filter;I&&Array.isArray(I)&&(k.value=I.map(z=>({...z,props:z.propsFilters||z.props||{}})),k.value.forEach(z=>{p.value[z.model]=""}));const oe=S.actionGlobal||S.action;console.log("[DEBUG] loadConfig rawActions:",oe),oe&&Array.isArray(oe)?(B.value=oe.map(z=>{const j=z.propsActionGlobal||z.props||{};return{key:j.key,permission:z.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||z.endpoint,fieldMapping:z.fieldMapping||j.fieldMapping||null,visibleRule:z.visibleRule||j.visibleRule||z.propCustomCondition||j.propCustomCondition||null,openDialog:z.openDialog||!1,fieldActionGlobal:(z.fieldActionGlobal||z.field||[]).map(te=>{const ke=te.propsFieldGlobal||te.props||{};return{...te,props:{...ke,endpoint:ke.endpointComponent||ke.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",B.value)):console.log("[DEBUG] loadConfig no rawActions found"),S.pagination!==void 0&&(w.value=S.pagination)}};e.watch(()=>r.tableConfig,()=>{me()},{deep:!0,immediate:!0});const Q=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?E.value:r.columns||[]),O=e.computed(()=>r.hasActions||_.value.length>0),K=e.computed(()=>r.dummyMode?!1:ae.value||le.value?b.value:r.loading),re=e.computed(()=>!!ae.value||!!le.value),be=e.computed(()=>[]),Be=S=>{if(console.log("[DEBUG] hasAction called:",{actionCode:S,permissionChecker:!!r.permissionChecker,effectivePath:ue.value}),r.menuPermissions&&r.menuPermissions.length>0){const I=c.path,oe=r.menuPermissions.find(z=>I.startsWith(z.path));if(oe&&oe.actions){const z=oe.actions.find(j=>j.code===S.toUpperCase());return z?z.checked:!1}return!1}if(r.permissionChecker){const I=r.permissionChecker(ue.value,S);return console.log("[DEBUG] permissionChecker result:",I),I}return be.value.some(I=>I.code===S)},Ie=(S,I)=>{if(S.condition)try{return Kt.apply(S.condition,I)}catch(ke){return console.warn("Row action jsonLogic error:",ke),!1}if(!S.visibilityCondition)return!0;const{field:oe,operator:z,value:j}=S.visibilityCondition,te=se(I,oe);switch(z){case"equals":return te===j;case"notEquals":return te!==j;case"in":return Array.isArray(j)&&j.includes(te);case"notIn":return Array.isArray(j)&&!j.includes(te);case"greaterThan":return te>j;case"lessThan":return te<j;case"contains":return String(te).includes(String(j));default:return!0}},$e=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:B.value,ignorePermissions:r.ignorePermissions}),B.value.length===0)return B.value;const S=B.value.filter(I=>{if(I.visibleRule)try{const z=A.value[0]||{};if(!Kt.apply(I.visibleRule,z))return!1}catch(z){console.warn("Header action visibility logic error:",z)}if(r.ignorePermissions)return!0;if(!I.permission)return console.log("[DEBUG] Action no permission, showing:",I.label),!0;if(r.checkPermission){const z=r.checkPermission(I.permission);return console.log("[DEBUG] Parent checkPermission result:",z),z}if(r.permissions){const z=r.permissions.includes(I.permission);return console.log("[DEBUG] Parent permissions check result:",z),z}const oe=Be(I.permission);return console.log("[DEBUG] Internal permission check:",{label:I.label,permission:I.permission,hasPerm:oe}),oe});return console.log("[DEBUG] Filtered header actions:",S.length),S}),Ge=e.computed(()=>_.value.length===0?_.value:_.value.filter(S=>r.ignorePermissions||!S.permission?!0:r.checkPermission?r.checkPermission(S.permission):r.permissions?r.permissions.includes(S.permission):Be(S.permission))),ve=S=>Ge.value.filter(I=>Ie(I,S)),lt=(S,I)=>{var j,te;if(S.requiredCondition&&((j=S.propCustomCondition)==null?void 0:j.length)>0){const ke=se(I,"status"),Ae=S.propCustomCondition.find(Ee=>Ee.value===ke);if(Ae)return Ae.bgColor||S.bgColor||"primary"}if(!S.dynamicColor||!S.colorCondition)return S.bgColor||"primary";const oe=se(I,S.colorCondition.field),z=(te=S.colorCondition.conditions)==null?void 0:te.find(ke=>ke.value===oe);return(z==null?void 0:z.bgColor)||S.bgColor||"primary"},dt=S=>{const I=(S||"left").toLowerCase();return I==="center"?"justify-center":I==="right"?"justify-end":"justify-start"},R={ToggleLeft:ce.ToggleLeft,SquarePen:ce.SquarePen,Trash2:ce.Trash2,Eye:ce.Eye,CheckCircle:ce.CheckCircle,Plus:ce.Plus,Download:ce.Download,RefreshCw:ce.RefreshCw,Search:ce.Search,SlidersHorizontal:ce.SlidersHorizontal},U=S=>S?Tt[S]?Tt[S]:R[S]||null:null,A=e.computed(()=>r.dummyMode?Q.value.length>0?L(10):[]:re.value?g.value.map((S,I)=>({...S,no:(f.value-1)*h.value+I+1})):ne.value),F=e.computed(()=>r.dummyMode?10:re.value?x.value:T.value.length),X=e.computed(()=>F.value===0?0:(f.value-1)*h.value+1),ie=e.computed(()=>{const S=f.value*h.value;return S>F.value?F.value:S}),se=(S,I)=>{if(!(!S||!I))return I in S?S[I]:I.split(".").reduce((oe,z)=>oe&&oe[z],S)},T=e.computed(()=>{if(re.value)return[];if(!u.value)return r.data;const S=u.value.toLowerCase();return r.data.filter(I=>Q.value.some(oe=>{const z=se(I,oe.key);return z==null?!1:String(z).toLowerCase().includes(S)}))}),Y=e.computed(()=>re.value?[]:m.value.key?[...T.value].sort((I,oe)=>{const z=se(I,m.value.key),j=se(oe,m.value.key);if(z===j)return 0;let te=0;return typeof z=="number"&&typeof j=="number"?te=z-j:te=String(z).localeCompare(String(j)),m.value.direction==="asc"?te:-te}):T.value),ne=e.computed(()=>{if(re.value)return[];const S=(f.value-1)*h.value,I=S+h.value;return Y.value.slice(S,I).map((oe,z)=>({...oe,no:S+z+1}))}),de=e.computed(()=>re.value?Object.values(p.value).some(S=>!!S):!!u.value),fe=[10,25,50,100],Ve=()=>{re.value&&(p.value={...p.value,keyword:u.value},f.value=1,Xe())};let Fe;const nt=()=>{r.enableQuickSearch&&(clearTimeout(Fe),Fe=setTimeout(()=>{Ve()},500))};let xe;const at=()=>{clearTimeout(xe),xe=setTimeout(()=>{re.value&&Xe()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&re.value&&nt()});const Xe=async()=>{if(!r.dummyMode&&re.value&&!(!ae.value&&!le.value))try{b.value=!0;const S={page:f.value,perPage:h.value,...p.value,...r.apiParams};u.value&&(S.keyword=u.value),Object.keys(S).forEach(oe=>{(S[oe]===""||S[oe]===null||S[oe]===void 0)&&delete S[oe]});let I;ae.value?I=await i(ae.value,Z.value,S):le.value&&(I=await i(le.value,J.value,S)),Ne(I)}catch(S){console.error("DataTable fetch error",S),b.value=!1}},Ne=S=>{console.log("DataTable handleResponseData:",S),S&&(r.dynamicColumns&&S.columns&&Array.isArray(S.columns)&&(E.value=S.columns.map(I=>({key:I.key||I.field||I.name,label:I.label||I.header||I.name,width:I.width,align:I.align||"LEFT",sortable:I.sortable!==!1,type:I.type,condition:I.condition,format:I.format}))),S.data&&Array.isArray(S.data)?(g.value=S.data,S.totalData?x.value=S.totalData:S.maxPage?x.value=S.maxPage*h.value:x.value=S.data.length*(S.maxPage||1)):Array.isArray(S)?(g.value=S,x.value=S.length):S.users?(g.value=S.users,x.value=S.users.length):S.items&&Array.isArray(S.items)?(g.value=S.items,x.value=S.total||S.totalItems||S.items.length):S.list&&Array.isArray(S.list)?(g.value=S.list,x.value=S.total||S.list.length):S.rows&&Array.isArray(S.rows)?(g.value=S.rows,x.value=S.count||S.total||S.rows.length):S.result&&Array.isArray(S.result)?(g.value=S.result,x.value=S.total||S.count||S.result.length):(console.warn("DataTable: Unknown response format",S),g.value=[],x.value=0)),b.value=!1};e.onUnmounted(()=>{clearTimeout(Fe),clearTimeout(xe)});const gt=()=>{Object.keys(p.value).forEach(S=>{p.value[S]=""}),u.value="",f.value=1,Xe()},Bt=()=>{f.value=1,Xe()},_t=(S,I)=>{const oe=se(S,I.key);let z={variant:"secondary",class:"",label:oe};if(I.condition){const j=I.condition.find(te=>{if(te.logic||typeof te.value=="object"&&te.value!==null)try{const Ae=te.logic||te.value;return Kt.apply(Ae,S)}catch(Ae){return console.warn("Badge logic error:",Ae),!1}const ke=(Ae,Ee)=>Ae==null||Ee===void 0||Ee===null?!1:typeof Ae=="string"&&typeof Ee=="string"?Ae.toLowerCase().trim()===Ee.toLowerCase().trim():Ae==Ee;if(ke(te.value,oe)||typeof oe=="object"&&oe!==null&&(ke(te.value,oe.code)||ke(te.value,oe.id)))return!0;if(I.key.includes(".")){const Ee=I.key.split(".").slice(0,-1).join("."),Se=se(S,Ee);if(Se&&typeof Se=="object"&&(ke(te.value,Se.code)||ke(te.value,Se.id)))return!0}return!1});if(j){j.variant&&(z.variant=j.variant);const ke=(l.value||"en")==="id"?j.labelID:j.labelEN;if(z.label=ke||j.label||(typeof oe=="object"?oe.name||oe.code:oe),j.color||j.bgColor){const Ae=(j.color||j.bgColor||"").toLowerCase(),Ee=z.variant==="outline",Se={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"},je={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"},Oe={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};Ee?je[Ae]&&(z.class=je[Ae]):Oe[Ae]?z.variant=Oe[Ae]:Se[Ae]&&(z.class=Se[Ae])}}else z.label=typeof oe=="object"?(oe==null?void 0:oe.name)||(oe==null?void 0:oe.code)||"-":oe}else z.label=typeof oe=="object"?(oe==null?void 0:oe.name)||(oe==null?void 0:oe.code)||"-":oe;return z},Lt=S=>{m.value.key===S?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=S,m.value.direction="asc"),a("update:sort",m.value)},Ze=S=>{S!==f.value&&(f.value=S,re.value&&Xe(),a("update:page",S))},Bn=S=>{h.value=S,f.value=1,re.value&&Xe()},qo=S=>{const I=Math.random()*15+75;if(S.width){const oe=parseInt(String(S.width));return oe<100?`${Math.floor(oe*(Math.random()*.2+.7))}px`:`${I}%`}return`${I}%`},Wn=()=>{u.value="",p.value={},f.value=1,Xe()},tu=S=>{var I;if(console.log("[DEBUG] handleHeaderAction called:",S),S.route){if(S.path){const oe=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${oe}`,S.path)}d==null||d.push(S.route)}else if(S.openDialog){D.value=S,v.value=null,N.value={};const oe=S.fieldActionGlobal||S.field||[];oe.length&&oe.forEach(z=>{var ke;const j=S.endpoint||((ke=S.propsActionGlobal)==null?void 0:ke.endpointPropAction)||S.propsActionGlobal,te=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;te&&z.model===te||!te&&/^(id|ids|idAuditTrail)/i.test(z.model)?N.value[z.model]=P.value:N.value[z.model]||(N.value[z.model]="")}),V.value=!0}else a("action",{action:((I=S.propsActionCustom)==null?void 0:I.key)||S.key||"create",row:null,selection:P.value})},xA=async(S,I)=>{var oe,z,j,te;if(S.requireConfirm){M.value={button:S,row:I},y.value=!0;return}if(S.openDialog){D.value=S,v.value=I,N.value={};const ke=Q.value.find(Se=>Se.type==="CHECKBOX"),Ae=(ke==null?void 0:ke.keyCheckbox)||"id";S.fieldActionCustom&&S.fieldActionCustom.forEach(Se=>{/^(id|ids|idAuditTrail)/i.test(Se.model)?N.value[Se.model]=[I[Ae]]:S.action==="showToken"&&Se.model==="token"?N.value[Se.model]=I.token!==void 0?I.token:"":I[Se.model]!==void 0?N.value[Se.model]=I[Se.model]:N.value[Se.model]=""});const Ee=S.endpoint||((oe=S.propsActionGlobal)==null?void 0:oe.endpointPropAction)||((z=S.propsActionCustom)==null?void 0:z.endpointPropAction)||((j=S.props)==null?void 0:j.endpointPropAction);if(((te=Ee==null?void 0:Ee.apiMethod)==null?void 0:te.toUpperCase())==="GET"&&Ee.apiUrl){b.value=!0;const{apiUrl:Se}=ot(),je={};Ee.keyParam&&Array.isArray(Ee.keyParam)&&Ee.keyParam.forEach((Oe,We)=>{const St=Ee.model&&We===0?Ee.model:Oe;I[Oe]!==void 0&&(je[St]=I[Oe])}),Object.keys(je).length===0&&I.id&&(je.id=I.id),Se(Ee.apiUrl,"GET",je).then(Oe=>{let We=Oe;if(Oe&&Oe.data!==void 0?We=Oe.data:Oe&&Oe.result!==void 0&&(We=Oe.result),We!=null){if(typeof We=="string")N.value.hasOwnProperty("token")&&(N.value.token=We);else if(typeof We=="object"&&(We.item&&(We=We.item),Array.isArray(We)&&(We=We[0]||{}),Object.keys(We).forEach(St=>{N.value[St]=We[St]}),!N.value.token)){const St=Object.keys(We).find(Yt=>Yt.toLowerCase().includes("token"));if(St)N.value.token=We[St];else{const Yt=Object.values(We).filter(la=>typeof la=="string");Yt.length===1&&(N.value.token=Yt[0])}}}V.value=!0}).catch(Oe=>{console.error("Fetch Data Failed",Oe)}).finally(()=>{b.value=!1});return}V.value=!0;return}nu(S,I)},nu=(S,I)=>{if(S.route){if(S.path){const j=S.route.startsWith("/")?S.route:"/"+S.route;sessionStorage.setItem(`layout_${j}`,S.path)}let oe=S.route;oe.includes(":")?oe=oe.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,te)=>I[te]||I.id||te):I.id&&(oe=`${oe.replace(/\/$/,"")}/${I.id}`);const z={};S.path&&(z.code=S.path),d==null||d.push({path:oe,query:z})}else if(S.endpoint&&S.endpoint.apiUrl){b.value=!0;const{apiUrl:oe}=ot(),z=S.endpoint.apiUrl,j=S.endpoint.apiMethod||"POST",te={},ke=S.fieldMapping;if(ke&&typeof ke=="object"){const{locale:Ae}=Vt.useI18n(),Ee=Ae.value||"en",Se=[];if(Object.entries(ke).forEach(([je,Oe])=>{if(typeof Oe=="string"){const We=se(I,je);We!==void 0?te[Oe]=We:(console.warn(`[MAPPING-DEBUG] No matching source found for '${je}'`),Se.push(je))}}),Se.length>0){const je=Ee==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Oe=Ee==="id"?`Terdapat ketidaksesuaian skema pada field: ${Se.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${Se.join(", ")}. Please contact the development team.`;Le.warning(`${je}: ${Oe}`,{autoClose:5e3,position:"top-right"})}}Object.keys(te).length===0&&I.id&&(te.id=I.id),oe(z,j,te).then(()=>{Xe(),a("action",{action:S.action||"success",row:I})}).catch(Ae=>{console.error("Action Failed",Ae)}).finally(()=>{b.value=!1})}else a("action",{action:S.action,row:I})},kA=()=>{M.value&&(nu(M.value.button,M.value.row),ou())},wA=()=>{var S,I,oe;if(D.value){const z=D.value,j=z.endpoint||((S=z.propsActionGlobal)==null?void 0:S.endpointPropAction)||z.propsActionGlobal;let te=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!te){const Se=(z.fieldActionGlobal||z.fieldActionCustom||z.field||[]).find(je=>/^(id|ids|idAuditTrail)/i.test(je.model));te=Se?Se.model:"ids"}let ke=null,Ae=!1;if(v.value){const Ee=Q.value.find(Oe=>Oe.type==="CHECKBOX"),Se=(Ee==null?void 0:Ee.keyCheckbox)||"id",je=v.value[Se];if(j!=null&&j.apiUrl){ke={...N.value};const Oe=z.fieldMapping;Oe&&typeof Oe=="object"&&Object.entries(Oe).forEach(([We,St])=>{if(typeof St=="string"){const Yt=se(v.value,We);Yt!==void 0&&(ke[St]=Yt)}}),ke[te]||(ke[te]=[je]),Ae=!0}}else j!=null&&j.apiUrl&&(ke={...N.value},ke[te]||(ke[te]=P.value||[]),Ae=!0);if(Ae&&ke&&(j!=null&&j.apiUrl)){if(((I=j==null?void 0:j.apiMethod)==null?void 0:I.toUpperCase())==="GET"){V.value=!1,v.value||(P.value=[]);return}const{apiUrl:Ee}=ot(),Se=j.apiUrl,je=j.apiMethod||"POST";Ee(Se,je,ke).then(()=>{V.value=!1,v.value||(P.value=[]),Xe(),a("action",{action:"success",row:null})}).catch(Oe=>{console.error("Action Failed",Oe)})}else if(v.value){const Ee=Q.value.find(We=>We.type==="CHECKBOX"),Se=(Ee==null?void 0:Ee.keyCheckbox)||"id",je=v.value[Se],Oe={...N.value};Oe[te]||(Oe[te]=[je]),a("action",{action:D.value.action,row:Oe}),V.value=!1}else{const Ee={...N.value};Ee[te]||(Ee[te]=P.value);const Se={action:((oe=D.value.propsActionGlobal)==null?void 0:oe.key)||D.value.key,row:Ee,selection:P.value};a("action",Se),V.value=!1}}},CA=S=>{const I=N.value[S];I&&w_(String(I)).then(()=>{Le.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(oe=>{console.error("Failed to copy",oe)})},ou=()=>{y.value=!1,M.value=null},EA=e.computed(()=>M.value?M.value.button.confirmTitle||"Confirm":""),BA=e.computed(()=>M.value?M.value.button.confirmMessage||"Confirm":"");n({fetchData:Xe,filters:p,resetFilters:gt,handleRefresh:Wn});const ia=e.ref(""),_A=S=>{if(!S)return"";const I=S.endpoint||S.endpointGlobal||{};return JSON.stringify({url:I.apiUrl||S.apiUrl,module:I.apiModule||S.apiModule,action:I.apiAction||S.apiAction,method:I.apiMethod||S.apiMethod,params:S.apiParams,socket:I.socket||S.socketEndpoint,socketParams:S.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){me();const S=_A(r.tableConfig);S!==ia.value&&(!ia.value&&re.value?(ia.value=S,Xe()):(ia.value=S,re.value&&at()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{re.value&&Xe()}),e.watch(()=>r.apiParams,()=>{re.value&&Xe()},{deep:!0}),e.watch(()=>B.value,S=>{console.log("[DEBUG] headerActions changed:",S.length,"items");const I=$e.value;console.log("[DEBUG] visibleHeaderActions evaluated:",I.length,"items")},{deep:!0}),e.onMounted(()=>{me(),re.value&&(r.tableConfig||(b.value=!0,Xe()))}),(S,I)=>{var oe;return e.openBlock(),e.createElementBlock("div",K2,[e.createElementVNode("div",Y2,[e.createElementVNode("div",J2,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Q2,[e.createElementVNode("div",Z2,[e.createVNode(e.unref(ce.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(v_),{modelValue:u.value,"onUpdate:modelValue":I[0]||(I[0]=z=>u.value=z),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(Ve,["enter"])},null,8,["modelValue"])]),k.value.length>0?(e.openBlock(),e.createElementBlock("div",eS,[e.createVNode(D_,null,{trigger:e.withCtx(()=>[e.createVNode(Ke,{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",aS,[e.renderSlot(S.$slots,"filter-footer",{fetch:Xe,reset:gt})])]),default:e.withCtx(()=>[I[8]||(I[8]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",tS,[e.renderSlot(S.$slots,"filter-form",{filters:p.value},()=>[k.value.length>0?(e.openBlock(),e.createElementBlock("div",nS,[e.createElementVNode("div",oS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(z,j)=>(e.openBlock(),e.createElementBlock("div",{key:j,class:e.normalizeClass(_e(z))},[e.createVNode(Id,{field:z,modelValue:p.value[z.model],"onUpdate:modelValue":te=>p.value[z.model]=te},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),k.value.length>0?(e.openBlock(),e.createElementBlock("div",rS,[e.createVNode(Ke,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:gt,disabled:K.value},null,8,["disabled"]),e.createVNode(Ke,{onClick:Bt,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",sS)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ke,{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:Wn,disabled:K.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(ce.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($e.value,(z,j)=>(e.openBlock(),e.createBlock(Ke,{key:j,icon:z.icon,text:z.label,tooltip:z.tooltip,variant:z.variant,"bg-color":z.bgColor,"text-color":z.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:te=>tu(z)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(S.$slots,"header-actions")],2)])]),e.createElementVNode("div",iS,[e.createElementVNode("table",lS,[e.createElementVNode("thead",cS,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,z=>(e.openBlock(),e.createElementBlock("th",{key:z.key,class:e.normalizeClass([z.align?`text-${z.align.toLowerCase()}`:"",z.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(z.width?{width:z.width}:{}),onClick:j=>z.sortable&&Lt(z.key)},[z.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",uS,[e.createVNode(cn,{"model-value":H.value,indeterminate:$.value,"onUpdate:modelValue":I[1]||(I[1]=j=>ee(!!j)),onClick:I[2]||(I[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",dt(z.align)])},[e.createElementVNode("span",null,e.toDisplayString(z.label),1)],2))],14,dS))),128)),O.value?(e.openBlock(),e.createElementBlock("th",fS,[...I[9]||(I[9]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",hS,[K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value,z=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${z}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,j=>{var te,ke;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",((te=j.align)==null?void 0:te.toLowerCase())==="center"?"mx-auto":"",((ke=j.align)==null?void 0:ke.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:qo(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",mS,[...I[10]||(I[10]=[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)):A.value.length===0?(e.openBlock(),e.createElementBlock("tr",pS,[e.createElementVNode("td",{colspan:Q.value.length+(O.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",bS,[e.createVNode(e.unref(hu.Vue3Lottie),{animationData:e.unref(U2),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",yS,e.toDisplayString(de.value?"No search results":"No data"),1),e.createElementVNode("p",xS,e.toDisplayString(de.value?"Try changing keywords":"No data added"),1)])])],8,gS)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(A.value,(z,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:j},[e.createElementVNode("tr",kS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,te=>(e.openBlock(),e.createElementBlock("td",{key:te.key,class:e.normalizeClass([te.align?`text-${te.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(S.$slots,`cell-${te.key}`,{row:z,value:se(z,te.key)},()=>[te.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",wS,[e.createVNode(cn,{"model-value":q(z),"onUpdate:modelValue":ke=>G(z,!!ke),onClick:I[3]||(I[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):te.type==="badge"||te.type==="BADGE"||te.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[te.align?`justify-${te.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(qs,{variant:_t(z,te).variant,class:e.normalizeClass([_t(z,te).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(_t(z,te).label),1)]),_:2},1032,["variant","class"])],2)):te.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*h.value+j+1),1)],64)):te.type==="date"||te.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(se(z,te.key)?e.unref(x_)(se(z,te.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(te.format?te.format(se(z,te.key)):se(z,te.key)),1)],64))])],2))),128)),O.value?(e.openBlock(),e.createElementBlock("td",CS,[e.renderSlot(S.$slots,"actions",{row:z,buttons:ve(z),getButtonColor:lt,getIconComponent:U},()=>[ve(z).length>0?(e.openBlock(),e.createElementBlock("div",ES,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve(z),(te,ke)=>(e.openBlock(),e.createElementBlock("div",{key:ke,class:"group relative"},[e.createVNode(Ke,{tooltip:te.tooltip||te.label,icon:te.icon,size:"icon",rounded:te.rounded||"sm",borderStyle:te.borderStyle||"none",variant:te.variant||"ghost","bg-color":lt(te,z),onClick:Ae=>xA(te,z)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),S.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",BS,[e.createElementVNode("td",{colspan:Q.value.length+(O.value?1:0),class:"px-0 py-0"},[e.renderSlot(S.$slots,"expanded-row",{row:z,index:j})],8,_S)])):e.createCommentVNode("",!0)],64))),128))])])]),!K.value&&A.value.length>0&&t.showPagination&&w.value?(e.openBlock(),e.createElementBlock("div",SS,[e.createElementVNode("div",AS,[e.createVNode(e.unref($_),{"model-value":String(h.value),"onUpdate:modelValue":I[4]||(I[4]=z=>Bn(Number(z)))},{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(X_),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(j_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(fe,z=>e.createVNode(e.unref(U_),{key:z,value:String(z)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(z),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),I[15]||(I[15]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",VS,[I[11]||(I[11]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",DS,e.toDisplayString(X.value),1),I[12]||(I[12]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",NS,e.toDisplayString(ie.value),1),I[13]||(I[13]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",MS,e.toDisplayString(F.value),1),I[14]||(I[14]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",vS,[e.createVNode(e.unref(P_),{total:F.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":Ze,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(T_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:z})=>[e.createVNode(e.unref(F_),{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(ce.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),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(ce.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z,(j,te)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[j.type==="page"?(e.openBlock(),e.createBlock(e.unref(z_),{key:te,value:j.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(It),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:ke=>Ze(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(O_),{key:j.type,index:te},null,8,["index"]))],64))),256)),e.createVNode(e.unref(R_),{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(ce.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(ce.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(ao,{modelValue:y.value,"onUpdate:modelValue":I[5]||(I[5]=z=>y.value=z),title:EA.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",onClick:ou,text:"Cancel"}),e.createVNode(Ke,{variant:"default",onClick:kA,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",PS,[e.createElementVNode("p",TS,e.toDisplayString(BA.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(ao,{modelValue:V.value,"onUpdate:modelValue":I[7]||(I[7]=z=>V.value=z),title:((oe=D.value)==null?void 0:oe.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",onClick:I[6]||(I[6]=z=>V.value=!1),text:"Cancel"}),e.createVNode(Ke,{variant:"default",onClick:wA,text:"Save"})]),default:e.withCtx(()=>{var z,j;return[e.createElementVNode("div",OS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((z=D.value)==null?void 0:z.fieldActionCustom)||((j=D.value)==null?void 0:j.fieldActionGlobal)||[],(te,ke)=>{var Ae,Ee,Se;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ke},[te.isHidden?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(_e(te))},[e.createElementVNode("div",FS,[e.createVNode(Id,{class:"flex-1 w-full",field:te,modelValue:N.value[te.model],"onUpdate:modelValue":je=>N.value[te.model]=je},null,8,["field","modelValue","onUpdate:modelValue"]),te.isCopyable||(Ae=te.props)!=null&&Ae.isCopyable||((Ee=D.value)==null?void 0:Ee.action)==="showToken"||((Se=D.value)==null?void 0:Se.action)==="copyToken"?(e.openBlock(),e.createBlock(Ke,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:je=>CA(te.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2))],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});function Jd(){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 zS={key:0},IS=["value","name"],RS={key:2,class:"text-xs text-neutral-400 italic"},Gs=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=Vt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:Xn,DCodeAutoComplete:tr,DCodeDatePicker:jr,DCodeTextarea:io,DCodeTextArea:io,DCodeCheckbox:cn,DCodeSwitch:Gr,DCodeOtpInput:Hr,DCodeImageField:Ur,DCodeSlider:qr,DCodeRadio:Ts,DCodeRadioCustom:Os,DCodeDynamicUploadList:Es,DCodeMultiSelect:Ps,DCodeCurrencyField:Cs,DCodePermissionMenu:zs,DCodeTreePermissions:Is,DCodeCardCheckboxList:ws,DCodeBeforeAfter:va,DCodeListLabels:Pa},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props||r.field.propsFieldGlobal||{},f={};if((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),f.required=r.required!==void 0?r.required:u.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxLength","minLength","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(m=>{u[m]!==void 0&&u[m]!==null&&(f[m]=u[m])}),u.valueType&&(f.type=u.valueType),r.error&&(f.error=r.error),u.endpoint&&u.endpoint.apiUrl){const m={};Array.isArray(u.endpoint.keyParam)&&u.endpoint.keyParam.forEach(g=>{r.formData&&r.formData[g]!=null&&(m[g]=r.formData[g])}),f.endpoint={apiUrl:u.endpoint.apiUrl,apiMethod:u.endpoint.apiMethod||"GET"},Object.keys(m).length&&(f.apiParams=m)}return u.endpointReference&&u.endpointReference.apiUrl&&(f.endpointReference=u.endpointReference),r.options&&r.options.length>0&&(f.options=r.options,f.items=r.options),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",zS,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,IS)])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",RS," Unknown field: "+e.toDisplayString(t.field.component),1))}}),LS={class:"w-full space-y-6"},$S={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},jS={class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},WS={key:0,class:"px-4 py-3"},US={class:"text-sm font-semibold text-white"},HS={class:"px-4 py-3 flex items-center gap-2"},qS={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},GS={key:0,class:"px-4 py-2 bg-primary-700 dark:bg-primary-900 flex items-center justify-end gap-2"},XS={key:2,class:"w-full"},KS={class:"space-y-6 mt-4"},YS={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},JS={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},QS={key:1,class:"text-xs text-neutral-500"},ZS={key:0,class:"flex items-center gap-2"},eA={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},tA={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},nA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},oA={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},rA=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["submit","cancel","action","update:model"],setup(t,{emit:n}){Kt.add_operation("length",R=>R==null?0:typeof R=="string"||Array.isArray(R)?R.length:typeof R=="number"?String(R).length:typeof R=="object"?Object.keys(R).length:0),Kt.add_operation("==",(R,U)=>R!==null&&typeof R=="object"&&"_isLogicValue"in R?R.id==U||R.code==U:U!==null&&typeof U=="object"&&"_isLogicValue"in U?U.id==R||U.code==R:R==U),Kt.add_operation("!=",(R,U)=>R!==null&&typeof R=="object"&&"_isLogicValue"in R?!(R.id==U||R.code==U):U!==null&&typeof U=="object"&&"_isLogicValue"in U?!(U.id==R||U.code==R):R!=U);const o=t,r=n,{t:a,locale:s}=Vt.useI18n(),i=e.computed(()=>s.value),l=_n.useRouter(),c=e.ref(!1),d=e.ref(null),u=e.computed(()=>o.schema||d.value),f=e.reactive({}),h=e.reactive({}),m=e.reactive({}),g=e.reactive({}),b=e.reactive({}),x=e.reactive({visible:!1,title:"",message:"",action:null}),p=R=>{var U,A,F;return((U=R.propsForm)==null?void 0:U.key)||((A=R.propsTable)==null?void 0:A.key)||((F=R.propsWizard)==null?void 0:F.key)||R.id||"unknown-section"},E=R=>{var F;const U=((F=R.propsWizard)==null?void 0:F.propsSteps)||[],A=i.value==="en";return U.map((X,ie)=>{var T;let se=[];if(Array.isArray(X.sectionsWizard))se=X.sectionsWizard;else if(X.sectionsWizard&&typeof X.sectionsWizard=="object"){const Y=X.sectionsWizard;se=[{type:Y.type||(Y.fields?"FORM":Y.isDataTable?"TABLE":"UNKNOWN"),...Y}]}return{key:X.key||`step-${ie}`,title:A?X.titleEN:X.titleID,description:A?X.descriptionEN:X.descriptionID,icon:X.icon||void 0,sections:se,actions:((T=X.propsComponent)==null?void 0:T.actionComponent)||X.actionComponent||[]}})},C=R=>R?[...R].sort((U,A)=>(U.seq||0)-(A.seq||0)):[],w=(R,U)=>{const A=R.props||R.propsFieldGlobal;if(!A)return null;const F=U==null?"":String(U);if(F==="")return null;if(A.minLength&&F.length<A.minLength)return i.value==="id"?`Minimal ${A.minLength} karakter`:`Minimum ${A.minLength} characters`;if(A.maxLength&&F.length>A.maxLength)return i.value==="id"?`Maksimal ${A.maxLength} karakter`:`Maximum ${A.maxLength} characters`;if(A.regex)try{if(!new RegExp(A.regex).test(F))return A.regexMessage||(i.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${R.model}:`,A.regex)}return null},_=(R,U)=>{var F,X;f[R]=U;let A=null;(X=(F=u.value)==null?void 0:F.sections)==null||X.forEach(ie=>{var Y,ne;const T=(((Y=ie.propsForm)==null?void 0:Y.fields)||ie.fields||[]).find(de=>de.model===R);T&&(A=T),((ne=ie.type)==null?void 0:ne.toUpperCase())==="WIZARD"&&E(ie).forEach(fe=>{fe.sections.forEach(Ve=>{var xe;const nt=(Ve.fields||((xe=Ve.propsForm)==null?void 0:xe.fields)||[]).find(at=>at.model===R);nt&&(A=nt)})})}),A&&(b[R]=w(A,U)),r("update:model",G())},B=(R,U)=>{var T,Y;if(U==null)return U;let A=null;if((Y=(T=u.value)==null?void 0:T.sections)==null||Y.forEach(ne=>{var Ve,Fe,nt;const fe=(((Ve=ne.propsForm)==null?void 0:Ve.fields)||ne.fields||((Fe=ne.sectionsWizard)==null?void 0:Fe.fields)||[]).find(xe=>xe.model===R);fe&&(A=fe),ne.type==="WIZARD"&&(((nt=ne.propsWizard)==null?void 0:nt.propsSteps)||[]).forEach(at=>{(Array.isArray(at.sectionsWizard)?at.sectionsWizard:[at.sectionsWizard].filter(Boolean)).forEach(Ne=>{if(Ne.fields){const gt=Ne.fields.find(Bt=>Bt.model===R);gt&&(A=gt)}})})}),!A)return U;const F=V[A.key];if(!F||!Array.isArray(F))return U;const X=A.props||{},ie=X.itemValue||X.model||"id",se=F.find(ne=>String(ne[ie])===String(U));return se&&se.code?{id:U,code:se.code,_isLogicValue:!0}:se&&se.value?se.value:U},k=e.computed(()=>{const R={};for(const U in f){const A=f[U];A!==null&&typeof A=="object"&&!Array.isArray(A)?R[U]=(A==null?void 0:A.code)??(A==null?void 0:A.id)??(A==null?void 0:A.value)??(A==null?void 0:A.key)??String(A):R[U]=B(U,A)}return R}),y=(R,U,A="LOGIC")=>{if(R==null)return!0;if(typeof R=="boolean")return R;if(typeof R=="object")try{const F=Kt.apply(R,U);return A.includes("FILTER")&&console.log(`[${A}] Evaluating rule:`,JSON.stringify(R),"with data vars:",JSON.stringify(U),"=> Result:",F),F}catch(F){return console.error(`[${A}] JsonLogic error:`,F,"Rule:",R),!1}try{return!!new Function("formData",`return ${R};`)(U)}catch(F){return console.error(`[${A}] String logic error:`,F,"Rule:",R),!1}},V=e.reactive({}),N=async R=>{const U=R.props||{},A=U.endpointReference||U.endpoint;if(!(!(A!=null&&A.apiUrl)||V[R.key]))try{console.log(`[DynamicForm] Prefetching for ${R.key} from ${A.apiUrl}`);const{apiUrl:F}=ot(),X=await F(A.apiUrl,A.apiMethod||"GET",{page:1,perPage:100});let ie=(X==null?void 0:X.data)||X;Array.isArray(ie)||(ie=ie?[ie]:[]),V[R.key]=ie,console.log(`[DynamicForm] Prefetched ${ie.length} items for ${R.key}`)}catch(F){console.error(`[DynamicForm] Failed prefetching for ${R.key}`,F),V[R.key]=[]}},M=R=>{var Y;const U=R.props||{},A=V[R.key]||U.items||U.options||[],F=`FILTER-DEBUG-${R.model}`;if(!((Y=R.logic)!=null&&Y.optionsFilterRule)||!Array.isArray(R.logic.optionsFilterRule))return A;console.log(`[${F}] Starting filter. Total items: ${A.length}`),console.log(`[${F}] Current state (normalized):`,JSON.stringify(k.value));let X=-1;const ie=R.logic.optionsFilterRule.find((ne,de)=>{if(!ne.condition)return!0;const fe=y(ne.condition,k.value,F);return fe&&(X=de),fe});if(!ie)return console.log(`[${F}] No active rule matches current state. Returning all items.`),A;console.log(`[${F}] Active Rule index: ${X}. Values allowed:`,ie.values);const se=U.itemValue||U.model||"id",T=A.filter(ne=>typeof ne!="object"?ie.values.includes(String(ne))||ie.values.includes(ne):[se,"code","id","value"].some(Ve=>{const Fe=ne[Ve];return Fe==null?!1:ie.values.some(nt=>String(nt)===String(Fe))}));return console.log(`[${F}] Filtering completed. ${A.length} -> ${T.length} items.`),T.length===0&&A.length>0&&console.warn(`[${F}] Warning: Filter resulting in 0 items. First item sample:`,JSON.stringify(A[0])),T},D=R=>{if(!R||typeof R!="object")return[];if("var"in R)return[R.var];let U=[];return Object.values(R).forEach(A=>{Array.isArray(A)?A.forEach(F=>{U=U.concat(D(F))}):typeof A=="object"&&(U=U.concat(D(A)))}),U};e.watch(()=>u.value,R=>{if(!(R!=null&&R.sections))return;const U=new Set,A=F=>{F&&["visibleRule","requiredRule","optionsFilterRule"].forEach(X=>{F[X]&&D(F[X]).forEach(ie=>U.add(ie))})};R.sections.forEach(F=>{var X,ie,se,T,Y,ne;if(((X=F.type)==null?void 0:X.toUpperCase())==="FORM"&&((ie=F.propsForm)!=null&&ie.fields)&&F.propsForm.fields.forEach(de=>{var fe;A(de.logic),(fe=de.logic)!=null&&fe.optionsFilterRule&&N(de)}),((se=F.type)==null?void 0:se.toUpperCase())==="TABLE"&&((T=F.propsTable)!=null&&T.modelDatatable)){const de=F.propsTable.modelDatatable;(!f[de]||!Array.isArray(f[de]))&&(f[de]=[])}else if(((Y=F.type)==null?void 0:Y.toUpperCase())==="WIZARD"){const de=p(F);m[de]===void 0&&(m[de]=0),(((ne=F.propsWizard)==null?void 0:ne.propsSteps)||[]).forEach(Ve=>{(Array.isArray(Ve.sectionsWizard)?Ve.sectionsWizard:[Ve.sectionsWizard].filter(Boolean)).forEach(nt=>{nt.fields&&nt.fields.forEach(xe=>{var at;A(xe.logic),(at=xe.logic)!=null&&at.optionsFilterRule&&N(xe)})})})}}),R.sections.forEach(F=>{var ie,se;(((ie=F.propsForm)==null?void 0:ie.fields)||F.fields||[]).forEach(T=>{U.has(T.model)&&N(T)}),F.type==="WIZARD"&&(((se=F.propsWizard)==null?void 0:se.propsSteps)||[]).forEach(Y=>{(Array.isArray(Y.sectionsWizard)?Y.sectionsWizard:[Y.sectionsWizard].filter(Boolean)).forEach(de=>{de.fields&&de.fields.forEach(fe=>{U.has(fe.model)&&N(fe)})})})})},{immediate:!0}),e.watch(()=>o.model,R=>{R&&Object.keys(R).length>0&&(console.log("[DynamicForm] Syncing model to formData",R),Object.assign(f,R),e.nextTick(()=>{Object.keys(R).forEach(U=>{})}))},{immediate:!0,deep:!0});const v=R=>{var X;if(!R)return!0;const U=R.propsForm||R.propsTable||R.propsWizard||R.props||{},A=R.logic||U.logic||((X=R.props)==null?void 0:X.logic);if(!A)return!0;const F=A.visibleRule||A.rule;return F==null?!0:!!y(F,k.value)},P=R=>{var A,F;if((A=R.props)!=null&&A.disabled)return!0;const U=(F=R.logic)==null?void 0:F.disabledRule;return U===!1?!1:U===!0?!0:!U||typeof U=="object"&&Object.keys(U).length===0?!1:!!y(U,k.value,`DISABLED-${R.model}`)},H=R=>{var A;const U=(A=R.logic)==null?void 0:A.visibleRule;return U===!1?!1:U===!0||!U||typeof U=="object"&&Object.keys(U).length===0?!0:!!y(U,k.value,`VISIBLE-${R.model}`)},$=R=>{var F,X;const U=(F=R.logic)==null?void 0:F.requiredRule,A=((X=R.props)==null?void 0:X.required)||!1;return U===!1?!1:U===!0?!0:!U||typeof U=="object"&&Object.keys(U).length===0?A:!!y(U,k.value,`REQUIRED-${R.model}`)},q=()=>{var A;if(!((A=u.value)!=null&&A.sections))return;const R=3;let U=0;for(;U<R;){let F=!1;if(u.value.sections.forEach(X=>{var se;(((se=X.propsForm)==null?void 0:se.fields)||X.fields||[]).forEach(T=>{var ne;const Y=(ne=T.logic)==null?void 0:ne.calculateRule;if(Y&&typeof Y=="object"){const de=Object.keys(Y);if(de.length>0){const fe=de[0],Ve=Y[fe],Fe=y(Ve,k.value,`CALC-${fe}`);Fe!==void 0&&f[fe]!==Fe&&(f[fe]=Fe,F=!0)}}})}),!F)break;U++}},ee=e.computed(()=>{var U,A,F;if(!((U=u.value)!=null&&U.sections))return!1;if(Object.keys(h).length>0)return!0;const R=X=>{for(const ie of X)if(H(ie)){if($(ie)){const se=f[ie.model];if(Array.isArray(se)?se.length===0:se==null||se==="")return!0}if(b[ie.model])return!0}return!1};for(const X of u.value.sections){const ie=((A=X.propsForm)==null?void 0:A.fields)||X.fields||[];if(R(ie))return!0;if(((F=X.type)==null?void 0:F.toUpperCase())==="WIZARD"){const se=E(X);for(const T of se)if(R(T.sections.flatMap(Y=>Y.fields||[])))return!0}}return!1});e.watch(()=>({...f}),()=>{var A;if(!((A=u.value)!=null&&A.sections))return;q();let R=!1;const U=F=>{F.forEach(X=>{const ie=X.model;H(X)||h[ie]&&delete h[ie]})};u.value.sections.forEach(F=>{var se,T;const X=v(F),ie=((se=F.propsForm)==null?void 0:se.fields)||F.fields||[];X?U(ie):ie.forEach(Y=>{f[Y.model]!==null&&f[Y.model]!==void 0&&(f[Y.model]=Array.isArray(f[Y.model])?[]:null,R=!0)}),((T=F.type)==null?void 0:T.toUpperCase())==="WIZARD"&&E(F).forEach(ne=>{ne.sections.forEach(de=>{var Ve;const fe=de.fields||((Ve=de.propsForm)==null?void 0:Ve.fields)||[];X?fe&&U(fe):fe.forEach(Fe=>{f[Fe.model]!==null&&f[Fe.model]!==void 0&&(f[Fe.model]=Array.isArray(f[Fe.model])?[]:null,R=!0)})})})}),R&&r("update:model",G())},{deep:!0});const G=()=>{var A;if(!((A=u.value)!=null&&A.sections))return{...f};const R={},U=new Set;return u.value.sections.forEach(F=>{var ie,se,T;if(!v(F))return;if((((ie=F.propsForm)==null?void 0:ie.fields)||F.fields||[]).forEach(Y=>{H(Y)&&(R[Y.model]=f[Y.model],U.add(Y.model))}),((se=F.type)==null?void 0:se.toUpperCase())==="WIZARD"&&E(F).forEach(ne=>{ne.sections.forEach(de=>{var Ve;(de.fields||((Ve=de.propsForm)==null?void 0:Ve.fields)||[]).forEach(Fe=>{H(Fe)&&(R[Fe.model]=f[Fe.model],U.add(Fe.model))})})}),(T=F.propsTable)!=null&&T.modelDatatable){const Y=F.propsTable.modelDatatable;f[Y]!==void 0&&(R[Y]=f[Y],U.add(Y))}}),["id","_id"].forEach(F=>{f[F]!==void 0&&!U.has(F)&&(R[F]=f[F])}),R},L=(R,U)=>{const A={},F=[];if(Object.keys(U).forEach(X=>{const ie=U[X];if(typeof ie=="string"){const se=X,T=ie;R[se]!==void 0&&(A[T]=R[se])}else if(Array.isArray(ie)&&ie.length>0&&typeof ie[0]=="object"){const se=X,T=ie[0],Y=Object.keys(T);let ne=null;Array.isArray(R[se])&&(ne=R[se]),ne?(console.log(`%c[MAPPING] Mapping array '${se}'`,"color: #3b82f6; font-weight: bold;"),A[se]=ne.map(de=>{const fe={};return Y.forEach(Ve=>{const Fe=Ve,nt=T[Ve];de[Fe]!==void 0&&(fe[nt]=de[Fe])}),fe})):(F.push(se),A[se]=[])}}),F.length>0){const X=F.join(", "),ie=i.value==="id"?`Kesalahan Pemetaan: Data sumber tidak ditemukan untuk field (${X}). Harap periksa skema atau hubungi tim teknis.`:`Mapping Error: Source data not found for fields (${X}). Please check the schema or contact technical team.`;Le.error(ie,{autoClose:5e3,position:Le.POSITION.TOP_RIGHT}),console.warn(`[MAPPING-ERROR] ${ie}`)}return A},W=R=>{var U,A,F,X;if(R.requireConfirm){const ie=i.value==="id";x.title=ie?((U=R.propCustomMessage)==null?void 0:U.titleID)||"Konfirmasi Tindakan":((A=R.propCustomMessage)==null?void 0:A.titleEN)||"Confirm Action",x.message=ie?((F=R.propCustomMessage)==null?void 0:F.messageID)||"Apakah Anda yakin ingin melanjutkan tindakan ini?":((X=R.propCustomMessage)==null?void 0:X.messageEN)||"Are you sure you want to proceed with this action?",x.action=R,x.visible=!0;return}Z(R)},ae=()=>{const R=x.action;x.visible=!1,R&&Z(R)},Z=async R=>{const U=G(),A=R.propsActionGlobal||R.props||{},F=A.fieldMapping||R.fieldMapping||{};let X={};F&&typeof F=="object"&&Object.keys(F).length>0?X=L(U,F):X={...U},console.log("%c[SUBMIT-ACTION-PAYLOAD]","color: #10b981; font-weight: bold;",X),r("action",R,X);const ie=!!(A.endpointPropAction||R.endpointPropAction);if(R.permission==="CREATE"||R.permission==="UPDATE"||A.type==="SUBMIT"||A.key==="submit"){c.value=!0;try{ie||r("submit",X)}finally{ie||(c.value=!1)}}A.keyRedirect&&A.route&&l&&l.push(A.route)},J=()=>{var U;if(!((U=u.value)!=null&&U.sections))return!0;let R=!0;return u.value.sections.forEach(A=>{var X,ie;if(!v(A))return;(((X=A.propsForm)==null?void 0:X.fields)||A.fields||[]).forEach(se=>{if(H(se)){const T=w(se,f[se.model]);T&&(h[se.model]=T,R=!1)}}),((ie=A.type)==null?void 0:ie.toUpperCase())==="WIZARD"&&E(A).forEach(se=>{se.sections.forEach(T=>{(T.fields||[]).forEach(ne=>{if(H(ne)){const de=w(ne,f[ne.model]);de&&(h[ne.model]=de,R=!1)}})})})}),R},le=async()=>{if(!J()){console.warn("[DynamicForm] Submit blocked by validation errors",h);return}c.value=!0;try{const R=G();r("submit",R)}finally{c.value=!1}},ue=()=>{r("cancel")},Ce=R=>R.permission?o.isEditMode?R.permission!=="CREATE":R.permission!=="UPDATE":!0,_e=R=>{const U=R.modelDatatable;if(!U)return[];const A=f[U];return Array.isArray(A)?A:[]},me=e.ref(!1),Q=e.ref(""),O=e.ref("Plus"),K=e.ref([]),re=e.reactive({}),be=e.reactive({}),Be=e.ref(""),Ie=e.ref(null),$e=e.ref(null),Ge=(R,U)=>{re[R]=U;const A=K.value.find(F=>F.model===R);if(A){const F=be,X=w(A,U);X?F[R]=X:delete F[R]}},ve=(R,U)=>{var F,X,ie;Be.value=R.modelDatatable||"",$e.value=U,Ie.value=null,Q.value=i.value==="id"?U.labelID||((F=U.propsActionGlobal)==null?void 0:F.labelID)||"Tambah Data":U.labelEN||((X=U.propsActionGlobal)==null?void 0:X.labelEN)||"Add Data",O.value=U.icon||((ie=U.propsActionGlobal)==null?void 0:ie.icon)||"Plus";const A=(U.fieldActionGlobal||[]).map(se=>({...se,props:se.propsFieldGlobal||se.props||{}}));K.value=A,me.value=!0,Object.keys(re).forEach(se=>delete re[se]),Object.keys(be).forEach(se=>delete be[se]),A.forEach(se=>{re[se.model]=null}),me.value=!0},lt=(R,U)=>{var de;const{action:A,row:F}=U;if(/delete|trash|remove/i.test(A)){const fe=R.modelDatatable;if(fe&&Array.isArray(f[fe])){const Ve=f[fe].indexOf(F);if(Ve!==-1)f[fe].splice(Ve,1);else{const Fe=JSON.stringify(F),nt=f[fe].findIndex(xe=>JSON.stringify(xe)===Fe);nt!==-1&&f[fe].splice(nt,1)}}return}const ie=R.modelDatatable||"";Be.value=ie,Q.value=i.value==="id"?"Ubah Data":"Edit Data",O.value="SquarePen";const se=f[ie],T=Array.isArray(se)?se.indexOf(F):-1;Ie.value=T!==-1?T:null;const ne=(((de=(R.actionTableGlobal||[])[0])==null?void 0:de.fieldActionGlobal)||[]).map(fe=>({...fe,props:fe.propsFieldGlobal||fe.props||{}}));K.value=ne,me.value=!0,Object.keys(re).forEach(fe=>delete re[fe]),Object.keys(be).forEach(fe=>delete be[fe]),ne.forEach(fe=>{re[fe.model]=F[fe.model]??null}),me.value=!0},dt=()=>{let R=!0;if(K.value.forEach(F=>{const X=w(F,re[F.model]);X&&(be[F.model]=X,R=!1)}),!R)return;const U=Be.value;if(!U)return;Array.isArray(f[U])||(f[U]=[]);const A={...re};Ie.value!==null?f[U].splice(Ie.value,1,A):f[U].push(A),me.value=!1};return(R,U)=>{var A,F,X,ie,se;return e.openBlock(),e.createElementBlock("div",LS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((A=u.value)==null?void 0:A.sections,(T,Y)=>{var ne,de,fe,Ve,Fe,nt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Y},[((ne=T.type)==null?void 0:ne.toUpperCase())==="FORM"&&T.propsForm&&v(T)?(e.openBlock(),e.createElementBlock("div",$S,[e.createElementVNode("div",jS,[T.propsForm.titleID||T.propsForm.titleEN?(e.openBlock(),e.createElementBlock("div",WS,[e.createElementVNode("h3",US,e.toDisplayString(i.value==="id"?T.propsForm.titleID:T.propsForm.titleEN),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",HS,[(de=T.propsForm.actionSection)!=null&&de.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.propsForm.actionSection,(xe,at)=>{var Xe,Ne,gt,Bt,_t,Lt,Ze;return e.openBlock(),e.createElementBlock(e.Fragment,{key:at},[Ce(xe)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:xe.icon||((Xe=xe.propsActionGlobal)==null?void 0:Xe.icon),text:i.value==="id"?xe.labelID||((Ne=xe.propsActionGlobal)==null?void 0:Ne.labelID):xe.labelEN||((gt=xe.propsActionGlobal)==null?void 0:gt.labelEN),"bg-color":((_t=xe.bgColor||((Bt=xe.propsActionGlobal)==null?void 0:Bt.bgColor))==null?void 0:_t.toLowerCase())||"primary",variant:((Ze=xe.variant||((Lt=xe.propsActionGlobal)==null?void 0:Lt.variant))==null?void 0:Ze.toLowerCase())||"outline",size:"sm",onClick:Bn=>W(xe)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),Y===0?(e.openBlock(),e.createBlock(Ke,{key:1,size:"sm",icon:"List",text:e.unref(a)("common.back"),variant:"outline",onClick:ue},null,8,["text"])):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",T.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C(T.propsForm.fields),xe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:xe.key},[H(xe)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([xe.column==="FULL"&&T.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(Gs,{field:xe,"model-value":f[xe.model],"form-data":f,required:$(xe),options:M(xe),error:h[xe.model],"onUpdate:modelValue":at=>_(xe.model,at)},null,8,["field","model-value","form-data","required","options","error","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])):((fe=T.type)==null?void 0:fe.toUpperCase())==="TABLE"&&T.propsTable&&v(T)?(e.openBlock(),e.createElementBlock("div",qS,[(Ve=T.propsTable.actionTableGlobal)!=null&&Ve.length?(e.openBlock(),e.createElementBlock("div",GS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.propsTable.actionTableGlobal,(xe,at)=>{var Xe,Ne;return e.openBlock(),e.createElementBlock(e.Fragment,{key:at},[xe.propsActionGlobal?(e.openBlock(),e.createBlock(Ke,{key:0,icon:xe.propsActionGlobal.icon,"bg-color":((Xe=xe.propsActionGlobal.bgColor)==null?void 0:Xe.toLowerCase())||"primary",variant:((Ne=xe.propsActionGlobal.variant)==null?void 0:Ne.toLowerCase())||"default",size:"sm",onClick:gt=>ve(T.propsTable,xe)},null,8,["icon","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0),e.createVNode(fo,{"table-config":T.propsTable,data:_e(T.propsTable),nested:!0,"show-pagination":T.propsTable.pagination??!0,onAction:xe=>lt(T.propsTable,xe)},null,8,["table-config","data","show-pagination","onAction"])])):((Fe=T.type)==null?void 0:Fe.toUpperCase())==="WIZARD"&&T.propsWizard&&v(T)?(e.openBlock(),e.createElementBlock("div",XS,[e.createVNode(Fs,{tabs:E(T),modelValue:m[p(T)],"onUpdate:modelValue":xe=>m[p(T)]=xe,"is-vertical":T.propsWizard.isVertical,"is-wizard":T.propsWizard.isWizard,"type-wizard":((nt=T.propsWizard.typeWizard)==null?void 0:nt.toLowerCase())||"icon",loading:c.value},e.createSlots({_:2},[e.renderList(E(T),xe=>({name:`tab-${xe.key}`,fn:e.withCtx(()=>{var at,Xe;return[e.createElementVNode("div",KS,[xe.title||(at=xe.actions)!=null&&at.length?(e.openBlock(),e.createElementBlock("div",YS,[e.createElementVNode("div",null,[xe.title?(e.openBlock(),e.createElementBlock("h4",JS,e.toDisplayString(xe.title),1)):e.createCommentVNode("",!0),xe.description?(e.openBlock(),e.createElementBlock("p",QS,e.toDisplayString(xe.description),1)):e.createCommentVNode("",!0)]),(Xe=xe.actions)!=null&&Xe.length?(e.openBlock(),e.createElementBlock("div",ZS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.actions,(Ne,gt)=>{var Bt,_t,Lt,Ze,Bn,qo,Wn;return e.openBlock(),e.createElementBlock(e.Fragment,{key:gt},[Ce(Ne)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:Ne.icon||((Bt=Ne.propsActionGlobal)==null?void 0:Bt.icon),text:i.value==="id"?Ne.labelID||((_t=Ne.propsActionGlobal)==null?void 0:_t.labelID):Ne.labelEN||((Lt=Ne.propsActionGlobal)==null?void 0:Lt.labelEN),"bg-color":((Bn=Ne.bgColor||((Ze=Ne.propsActionGlobal)==null?void 0:Ze.bgColor))==null?void 0:Bn.toLowerCase())||"primary",variant:((Wn=Ne.variant||((qo=Ne.propsActionGlobal)==null?void 0:qo.variant))==null?void 0:Wn.toLowerCase())||"tonal",size:"sm",onClick:tu=>W(Ne)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.sections,(Ne,gt)=>{var Bt,_t,Lt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:gt},[((Bt=Ne.type)==null?void 0:Bt.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",Ne.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C(Ne.fields),Ze=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ze.key},[H(Ze)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([Ze.column==="FULL"&&Ne.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(Gs,{field:Ze,"model-value":f[Ze.model],"form-data":f,required:$(Ze),disabled:P(Ze),options:M(Ze),error:h[Ze.model],"onUpdate:modelValue":Bn=>_(Ze.model,Bn)},null,8,["field","model-value","form-data","required","disabled","options","error","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((_t=Ne.type)==null?void 0:_t.toUpperCase())==="TABLE"||Ne.isDataTable?(e.openBlock(),e.createElementBlock("div",eA,[e.createVNode(fo,{"table-config":Ne.propsDataTableWizard||Ne.propsTable,data:_e(Ne.propsDataTableWizard||Ne.propsTable),nested:!0,"show-pagination":((Lt=Ne.propsDataTableWizard||Ne.propsTable)==null?void 0:Lt.pagination)??!0,onAction:Ze=>lt(Ne.propsDataTableWizard||Ne.propsTable,Ze)},null,8,["table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",tA," Unknown section type: "+e.toDisplayString(Ne.type),1))],64)}),128))])]})}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):e.createCommentVNode("",!0)],64)}),128)),g!=null&&g.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((X=(F=u.value)==null?void 0:F.ui)==null?void 0:X.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(se=(ie=u.value)==null?void 0:ie.actionGlobal)!=null&&se.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(u.value.actionGlobal,(T,Y)=>{var ne,de,fe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Y},[T.propsActionGlobal&&Ce(T)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:T.propsActionGlobal.icon,text:i.value==="id"?T.propsActionGlobal.labelID:T.propsActionGlobal.labelEN,"bg-color":((ne=T.propsActionGlobal.bgColor)==null?void 0:ne.toLowerCase())||"primary",variant:((de=T.propsActionGlobal.variant)==null?void 0:de.toLowerCase())||"default",loading:c.value,disabled:ee.value&&(T.permission==="CREATE"||T.permission==="UPDATE"||((fe=T.propsActionGlobal)==null?void 0:fe.key)==="submit"),onClick:Ve=>W(T)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(Ke,{key:1,text:"Submit","bg-color":"primary",loading:c.value,disabled:ee.value,onClick:le},null,8,["loading","disabled"]))],2)),e.createVNode(ao,{modelValue:x.visible,"onUpdate:modelValue":U[1]||(U[1]=T=>x.visible=T),title:x.title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:e.unref(a)("common.cancel"),onClick:U[0]||(U[0]=T=>x.visible=!1)},null,8,["text"]),e.createVNode(Ke,{text:e.unref(a)("common.confirm"),onClick:ae},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",nA,e.toDisplayString(x.message),1)]),_:1},8,["modelValue","title"]),e.createVNode(ao,{modelValue:me.value,"onUpdate:modelValue":U[3]||(U[3]=T=>me.value=T),title:Q.value,icon:O.value,"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:"Cancel",onClick:U[2]||(U[2]=T=>me.value=!1)}),e.createVNode(Ke,{text:"Save",onClick:dt})]),default:e.withCtx(()=>[K.value.length?(e.openBlock(),e.createElementBlock("div",oA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,T=>(e.openBlock(),e.createElementBlock("div",{key:T.key,class:e.normalizeClass(T.column==="FULL"?"md:col-span-2":"col-span-1")},[e.createVNode(Gs,{field:T,"model-value":re[T.model],"form-data":re,error:be[T.model],"onUpdate:modelValue":Y=>Ge(T.model,Y)},null,8,["field","model-value","form-data","error","onUpdate:modelValue"])],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"])])}}}),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"},hA={key:"skeleton",class:"w-full"},mA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},Xs=wt(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var M,D,v,P,H,$,q,ee;const o=t,r=n,a=(D=(M=e.getCurrentInstance())==null?void 0:M.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 G=_n.useRoute();if(G&&Object.keys(G).length>0)s=G;else{const L=e.getCurrentInstance();(H=(P=(v=L==null?void 0:L.appContext)==null?void 0:v.config)==null?void 0:P.globalProperties)!=null&&H.$route&&(s=L.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:G=>{typeof window<"u"&&(typeof G=="string"?window.location.href=G:G&&G.path&&(window.location.href=G.path))},__isFallback:!0};try{const G=_n.useRouter();if(G)i=G;else{const L=e.getCurrentInstance();(ee=(q=($=L==null?void 0:L.appContext)==null?void 0:$.config)==null?void 0:q.globalProperties)!=null&&ee.$router&&(i=L.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=ot();let d;try{d=Vt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=Jd(),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 h=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const G=s.path.match(/\/edit\/([^\/]+)$/);return G?G[1]:null}),m=e.ref({}),g=e.ref(null),b=e.ref(!0),x=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",E="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",C=e.ref(o.layoutCode),w=e.computed(()=>{var W;if(!g.value)return"";const G=((W=d==null?void 0:d.value)==null?void 0:W.toLowerCase())||"en";return(G==="en"||G.startsWith("en-")?g.value.titleEN:g.value.titleID)||g.value.title||o.layoutCode});e.watch(w,G=>{G&&u(G)},{immediate:!0});const _=(G,L="")=>{const W={};return!G||typeof G!="object"||Object.keys(G).forEach(ae=>{const Z=G[ae],J=L?`${L}.${ae}`:ae;Z&&typeof Z=="object"&&!Array.isArray(Z)&&!(Z instanceof Date)&&Object.assign(W,_(Z,J)),W[J]=Z}),W},B=async()=>{var G,L,W,ae,Z,J;b.value=!0;try{let le=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(le=s.query.code||o.layoutCode);const ue="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",Ce=ue?{Authorization:`Bearer ${ue}`}:{},_e=`${p}${le}`;let me=await l(_e,"GET",null,Ce);if(!me.status||!me.data||Array.isArray(me.data)&&me.data.length===0)try{const Q=`${E}${le}`,O=await l(Q,"GET",null,Ce);if(O.status){const K=Array.isArray(O.data)?O.data[0]:O.data;K&&K.code&&(le=K.code,C.value=le,me=await l(`${p}${le}`,"GET",null,Ce))}}catch(Q){console.warn("Failed to resolve layout code via datatable",Q)}if(me.status){g.value=Array.isArray(me.data)?me.data[0]:me.data;const Q={};if((G=g.value)!=null&&G.sections&&g.value.sections.forEach(O=>{((O.propsForm||O.props||{}).fields||O.fields||[]).forEach(be=>{var Ie;const Be=be.model||((Ie=be.props)==null?void 0:Ie.model)||be.key;Be&&(Q[Be]=null)})}),m.value=Q,b.value=!1,f.value&&h.value){x.value=!0;try{const O=(ae=(W=(L=g.value.sections)==null?void 0:L[0])==null?void 0:W.propsForm)==null?void 0:ae.endpointForm,K=g.value.endpointForm,re=O||K;if(re!=null&&re.apiUrl){const be=re.apiUrl,Be=re.apiMethod||"GET",Ie=re.keyParam||[],$e={};Ie.length>0?Ie.forEach(ve=>{$e[ve]=h.value}):$e.id=h.value;const Ge=await c(be,Be,$e);if(Ge.status){let ve=Array.isArray(Ge.data)?Ge.data[0]:Ge.data;Ge.payload&&(ve={...ve,...Ge.payload});const lt=_(ve);m.value={...m.value,...ve,...lt}}}else if((Z=g.value.endpointGlobal)!=null&&Z.apiUrl){const be=g.value.endpointGlobal.apiUrl,Be=g.value.endpointGlobal.apiMethod||"GET",Ie={id:h.value},$e=await c(be,Be,Ie);if($e.status){const Ge=Array.isArray($e.data)?$e.data[0]:$e.data,ve=_(Ge);m.value={...m.value,...Ge,...ve}}}else{const be=((J=g.value.endpoint)==null?void 0:J.detailUrl)||`/api/${C.value}/detail/${h.value}`,Be=await l(be,"GET");if(Be.status){let Ie=Array.isArray(Be.data)?Be.data[0]:Be.data;if(Be.payload){const ve={...Be.payload};if(Object.keys(ve).forEach(lt=>{Ie[lt]!==void 0&&Ie[lt]!==null&&(ve[lt]=Ie[lt])}),!("id"in ve)&&Ie.id){const lt=Object.keys(ve).find(dt=>dt.startsWith("id")&&dt.length>2&&!ve[dt]);lt&&(ve[lt]=Ie.id)}Ie=ve}const $e={...Ie};Object.keys(m.value).forEach(ve=>{if($e[ve]===void 0||$e[ve]===null){if(ve.toLowerCase().startsWith("id")&&ve.length>2){const dt=ve.substring(2).toLowerCase(),R=Array.isArray(Be.data)?Be.data[0]:Be.data,U=Object.keys(R).find(A=>A.toLowerCase()===dt);U&&R[U]&&typeof R[U]=="object"&&"id"in R[U]&&($e[ve]=R[U].id)}if(ve==="idSupervisor"){const dt=Array.isArray(Be.data)?Be.data[0]:Be.data;dt.supervisorId&&($e[ve]=dt.supervisorId)}}});const Ge=_($e);m.value={...m.value,...$e,...Ge}}}}catch(O){console.error("Failed to fetch record data:",O)}finally{x.value=!1}}}}catch(le){console.error("Failed to load form layout:",le),b.value=!1}},k=G=>{m.value=G,r("update:model",G)},y=async G=>{var L,W,ae;try{const Z=(ae=(W=(L=g.value.sections)==null?void 0:L[0])==null?void 0:W.propsForm)==null?void 0:ae.endpointForm,J=g.value.endpointGlobal||g.value.endpoint,le=(Z==null?void 0:Z.submitUrl)||(J==null?void 0:J.submitUrl)||`/api/generic/${o.layoutCode}`,ue=(Z==null?void 0:Z.submitMethod)||(J==null?void 0:J.submitMethod)||(f.value?"PUT":"POST"),Ce=Object.values(G).some(me=>me instanceof File||me instanceof Blob);let _e;Ce?(_e=new FormData,Object.keys(G).forEach(me=>{const Q=G[me];Q!=null&&(Array.isArray(Q)?Q.forEach(O=>_e.append(`${me}[]`,O)):_e.append(me,Q))})):(_e={...G},f.value&&h.value&&!_e.id&&(_e.id=h.value)),await l(le,ue,_e),r("submit-success",_e),i.back()}catch(Z){console.error("Submit failed:",Z)}},V=async(G,L,W)=>{if(G==="cancel"){N();return}const ae=L.endpointPropAction||L.propsActionGlobal&&L.propsActionGlobal.endpointPropAction;if(ae)try{b.value=!0;const Z=W?{...W}:{...m.value};f.value&&L.model&&h.value&&(Z[L.model]=h.value);const J=ae.apiUrl,le=ae.apiMethod||"POST";(await c(J,le,Z)).status&&(r("action-success",G,L,Z),i.back())}catch(Z){console.error("Action failed:",Z)}finally{b.value=!1}},N=()=>{r("cancel"),i.back()};return e.onMounted(()=>{B()}),e.watch(()=>o.model,G=>{G&&Object.keys(G).length>0&&(m.value={...m.value,...G})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(G,L)=>(e.openBlock(),e.createElementBlock("div",lA,[e.createElementVNode("div",cA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!b.value&&g.value?(e.openBlock(),e.createElementBlock("div",dA,[e.createElementVNode("div",uA,[e.createElementVNode("p",fA,e.toDisplayString(g.value.description),1)]),e.createVNode(rA,{schema:g.value,model:m.value,"is-edit-mode":f.value,loading:x.value,"onUpdate:model":L[0]||(L[0]=W=>k(W)),onSubmit:y,onCancel:N,onAction:V,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):b.value?(e.openBlock(),e.createElementBlock("div",hA,[e.createVNode(iA)])):(e.openBlock(),e.createElementBlock("div",mA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-9d6797b1"]]),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"},Ks=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var _,B,k,y,V,N;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=ot();let i={query:{},params:{},path:""};try{const M=_n.useRoute();M?i=M:(k=(B=(_=a==null?void 0:a.appContext)==null?void 0:_.config)==null?void 0:B.globalProperties)!=null&&k.$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:M=>{typeof window<"u"&&(typeof M=="string"?window.location.href=M:M&&M.path&&(window.location.href=M.path))}};try{const M=_n.useRouter();M?l=M:(N=(V=(y=a==null?void 0:a.appContext)==null?void 0:y.config)==null?void 0:V.globalProperties)!=null&&N.$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),h=e.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",g=e.computed(()=>`${m}${o.layoutCode}`),{setPageTitle:b}=Jd();let x;try{x=Vt.useI18n().locale}catch{x=e.ref("en")}const p=()=>{if(u.value){const D=(x.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";b(D)}};e.watch(x,()=>{p()});const E=async()=>{f.value=!0;try{const M="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",D=M?{Authorization:`Bearer ${M}`}:{},v=await s(g.value,"GET",null,D);v.status&&(u.value=Array.isArray(v.data)?v.data[0]:v.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(M){console.error("Gagal Menampilkan Datatable:",M)}finally{f.value=!1}},C=M=>{M.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",M.action,M)},w=M=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",M);let D=M.route;const v=M.path;if(!D&&v){const H=((i==null?void 0:i.path)||"").split("/");H.length>=2&&(D=`/${H[1]}/create`)}if(D||v){const P={...M.query||{},code:v||void 0};Object.keys(P).forEach(H=>P[H]===void 0&&delete P[H]),console.log("[DEBUG] Emitting navigate to parent:",{route:D,query:P}),r("navigate",{route:D||"/form",query:P}),l&&!l.__isFallback&&l.push({path:D||"/form",query:P})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{E()}),(M,D)=>(e.openBlock(),e.createElementBlock("div",pA,[!f.value&&u.value?(e.openBlock(),e.createBlock(fo,{key:0,ref_key:"dtRef",ref:h,"api-url":g.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:C,onNavigate:w},{"header-actions":e.withCtx(()=>[...D[0]||(D[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",gA,[...D[1]||(D[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))]))}}),Qd=e.defineCustomElement(Xs),Zd=e.defineCustomElement(Ks);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",Qd),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",Zd));const yA=[tr,wi,Ke,tl,va,Pa,ud,cn,ws,Cs,jr,ao,Vd,Wr,Dd,Ds,Es,Nd,Ms,Ur,vs,so,Ps,Hr,Md,vd,Ts,Os,qr,Gr,Xn,io,Fd,zd,Fs,zs,Is,qs,fo,Xs,Ks],eu={install(t,n={}){n&&Object.keys(n).length>0&&Qs(n),yA.forEach(o=>{o.name&&t.component(o.name,o)})}};he.AutoLayoutDatatable=Ks,he.AutoLayoutForm=Xs,he.DCodeAutoComplete=tr,he.DCodeBadge=qs,he.DCodeBeforeAfter=va,he.DCodeButton=Ke,he.DCodeCard=tl,he.DCodeCardCheckboxList=ws,he.DCodeChart=ud,he.DCodeCheckbox=cn,he.DCodeCurrencyField=Cs,he.DCodeDatePicker=jr,he.DCodeDialog=ao,he.DCodeDialogCloseBtn=Vd,he.DCodeDropzone=Wr,he.DCodeDynamicUploadList=Es,he.DCodeFileField=Dd,he.DCodeFileResult=Ds,he.DCodeIconDropdown=Nd,he.DCodeImageCropperDialog=Ms,he.DCodeImageField=Ur,he.DCodeImageResult=vs,he.DCodeInfiniteAutoComplete=wi,he.DCodeLabel=so,he.DCodeListLabels=Pa,he.DCodeMultiSelect=Ps,he.DCodeOtpInput=Hr,he.DCodePermissionMenu=zs,he.DCodeProgress=Md,he.DCodeProgressBar=vd,he.DCodeRadio=Ts,he.DCodeRadioCustom=Os,he.DCodeSlider=qr,he.DCodeSwitch=Gr,he.DCodeTextField=Xn,he.DCodeTextarea=io,he.DCodeTimelineWithIcons=Fd,he.DCodeTreePermissions=Is,he.DCodeUploadFile=zd,he.DCodeWizard=Fs,he.DataTable=fo,he.DataTableComponent=fo,he.DynamicUI=eu,he.MicroDynamicDatatable=Zd,he.MicroDynamicForm=Qd,he.cn=Pe,he.default=eu,he.setApiConfig=Qs,Object.defineProperties(he,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));