@gemafajarramadhan/dynamic-ui 1.1.6 → 1.1.7

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(le,o){typeof exports=="object"&&typeof module<"u"?o(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")):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"],o):(le=typeof globalThis<"u"?globalThis:le||self,o(le.DynamicUI={},le.Vue,le.LucideVueNext,le.RekaUI,le.VueUseCore,le.VueDatePicker,le.Uppy,le.UppyDashboard,le.UppyImageEditor,le.VueI18n,le.VueRouter))})(this,(function(le,o,ne,Q,ke,Rd,vd,is,Ld,wo,zn){"use strict";var n2=Object.defineProperty;var o2=(le,o,ne)=>o in le?n2(le,o,{enumerable:!0,configurable:!0,writable:!0,value:ne}):le[o]=ne;var ie=(le,o,ne)=>o2(le,typeof o!="symbol"?o+"":o,ne);var Ba;function Id(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Qt=Id(ne);let ct={};function ls(t){ct={...ct,...t}}function jd(){return ct.apiBaseUrl?ct.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function Wd(){const t={"Content-Type":"application/json",Accept:"application/json"};let e=null;if(ct.getAuthToken?e=ct.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?e=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(e=localStorage.getItem("token")||sessionStorage.getItem("token")),e&&(t.Authorization=`Bearer ${e}`),ct.getHeaders){const n=ct.getHeaders();return{...t,...n}}return t}function Hd(){ct.onUnauthorized&&ct.onUnauthorized()}async function cs(t,e,n){if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const a=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],r=(e||"").trim().toUpperCase(),s=a.includes(r)?r:"GET";a.includes(r)||console.warn(`[DynamicUI][useApi] HTTP method '${e}' tidak valid, fallback ke 'GET'.`);const i=jd(),l=t.startsWith("http")?t:`${i}${t}`,c={method:s,headers:Wd()};n&&!["GET","DELETE"].includes(s)&&(c.body=JSON.stringify(n));let d=l;if(n&&s==="GET"){const h=new URLSearchParams;Object.entries(n).forEach(([b,p])=>{p!=null&&h.append(b,String(p))});const m=h.toString();m&&(d=`${l}${l.includes("?")?"&":"?"}${m}`)}const u=await fetch(d,c);if(u.status===401&&Hd(),!u.ok){const h=await u.text();throw new Error(`HTTP ${u.status}: ${h}`)}return(u.headers.get("content-type")||"").includes("application/json")?u.json():{status:!0,data:await u.text()}}function at(){return{apiUrl:(n,a,r)=>cs(n,a,r),DCodeApi:(n,a,r,s)=>{let i=n,l=a,c=r;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):n&&a&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(a.toUpperCase())||(i=`${n.endsWith("/")?n.slice(0,-1):n}/${a}`,l="POST")),cs(i,l,c)}}}const yn=Math.min,Ke=Math.max,_o=Math.round,Co=Math.floor,dt=t=>({x:t,y:t}),qd={left:"right",right:"left",bottom:"top",top:"bottom"},Ud={start:"end",end:"start"};function ds(t,e,n){return Ke(t,yn(e,n))}function Fn(t,e){return typeof t=="function"?t(e):t}function zt(t){return t.split("-")[0]}function Rn(t){return t.split("-")[1]}function us(t){return t==="x"?"y":"x"}function fs(t){return t==="y"?"height":"width"}const Yd=new Set(["top","bottom"]);function kt(t){return Yd.has(zt(t))?"y":"x"}function hs(t){return us(kt(t))}function Gd(t,e,n){n===void 0&&(n=!1);const a=Rn(t),r=hs(t),s=fs(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=Bo(i)),[i,Bo(i)]}function Kd(t){const e=Bo(t);return[Aa(t),e,Aa(e)]}function Aa(t){return t.replace(/start|end/g,e=>Ud[e])}const ms=["left","right"],ps=["right","left"],Xd=["top","bottom"],Jd=["bottom","top"];function Qd(t,e,n){switch(t){case"top":case"bottom":return n?e?ps:ms:e?ms:ps;case"left":case"right":return e?Xd:Jd;default:return[]}}function Zd(t,e,n,a){const r=Rn(t);let s=Qd(zt(t),n==="start",a);return r&&(s=s.map(i=>i+"-"+r),e&&(s=s.concat(s.map(Aa)))),s}function Bo(t){return t.replace(/left|right|bottom|top/g,e=>qd[e])}function eu(t){return{top:0,right:0,bottom:0,left:0,...t}}function tu(t){return typeof t!="number"?eu(t):{top:t,right:t,bottom:t,left:t}}function So(t){const{x:e,y:n,width:a,height:r}=t;return{width:a,height:r,top:n,left:e,right:e+a,bottom:n+r,x:e,y:n}}function gs(t,e,n){let{reference:a,floating:r}=t;const s=kt(e),i=hs(e),l=fs(i),c=zt(e),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(Rn(e)){case"start":m[i]-=h*(n&&d?-1:1);break;case"end":m[i]+=h*(n&&d?-1:1);break}return m}async function nu(t,e){var n;e===void 0&&(e={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Fn(e,t),b=tu(m),g=l[h?f==="floating"?"reference":"floating":f],y=So(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.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,D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),M=await(s.isElement==null?void 0:s.isElement(D))?await(s.getScale==null?void 0:s.getScale(D))||{x:1,y:1}:{x:1,y:1},S=So(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:B,offsetParent:D,strategy:c}):B);return{top:(y.top-S.top+b.top)/M.y,bottom:(S.bottom-y.bottom+b.bottom)/M.y,left:(y.left-S.left+b.left)/M.x,right:(S.right-y.right+b.right)/M.x}}const ou=async(t,e,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=gs(d,a,c),h=a,m={},b=0;for(let g=0;g<l.length;g++){var p;const{name:y,fn:B}=l[g],{x:D,y:M,data:S,reset:k}=await B({x:u,y:f,initialPlacement:a,placement:h,strategy:r,middlewareData:m,rects:d,platform:{...i,detectOverflow:(p=i.detectOverflow)!=null?p:nu},elements:{reference:t,floating:e}});u=D??u,f=M??f,m={...m,[y]:{...m[y],...S}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(d=k.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):k.rects),{x:u,y:f}=gs(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:m}},au=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...g}=Fn(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=zt(r),B=kt(l),D=zt(l)===l,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=h||(D||!p?[Bo(l)]:Kd(l)),k=b!=="none";!h&&k&&S.push(...Zd(l,p,b,M));const C=[l,...S],x=await c.detectOverflow(e,g),w=[];let E=((a=s.flip)==null?void 0:a.overflows)||[];if(u&&w.push(x[y]),f){const L=Gd(r,i,M);w.push(x[L[0]],x[L[1]])}if(E=[...E,{placement:r,overflows:w}],!w.every(L=>L<=0)){var A,T;const L=(((A=s.flip)==null?void 0:A.index)||0)+1,Y=C[L];if(Y&&(!(f==="alignment"?B!==kt(Y):!1)||E.every(W=>kt(W.placement)===B?W.overflows[0]>0:!0)))return{data:{index:L,overflows:E},reset:{placement:Y}};let z=(T=E.filter(v=>v.overflows[0]<=0).sort((v,W)=>v.overflows[1]-W.overflows[1])[0])==null?void 0:T.placement;if(!z)switch(m){case"bestFit":{var F;const v=(F=E.filter(W=>{if(k){const O=kt(W.placement);return O===B||O==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(O=>O>0).reduce((O,N)=>O+N,0)]).sort((W,O)=>W[1]-O[1])[0])==null?void 0:F[0];v&&(z=v);break}case"initialPlacement":z=l;break}if(r!==z)return{reset:{placement:z}}}return{}}}},ru=new Set(["left","top"]);async function su(t,e){const{placement:n,platform:a,elements:r}=t,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=zt(n),l=Rn(n),c=kt(n)==="y",d=ru.has(i)?-1:1,u=s&&c?-1:1,f=Fn(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof b=="number"&&(m=l==="end"?b*-1:b),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const iu=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,a;const{x:r,y:s,placement:i,middlewareData:l}=e,c=await su(e,t);return i===((n=l.offset)==null?void 0:n.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},lu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:a,placement:r,platform:s}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:y=>{let{x:B,y:D}=y;return{x:B,y:D}}},...d}=Fn(t,e),u={x:n,y:a},f=await s.detectOverflow(e,d),h=kt(zt(r)),m=us(h);let b=u[m],p=u[h];if(i){const y=m==="y"?"top":"left",B=m==="y"?"bottom":"right",D=b+f[y],M=b-f[B];b=ds(D,b,M)}if(l){const y=h==="y"?"top":"left",B=h==="y"?"bottom":"right",D=p+f[y],M=p-f[B];p=ds(D,p,M)}const g=c.fn({...e,[m]:b,[h]:p});return{...g,data:{x:g.x-n,y:g.y-a,enabled:{[m]:i,[h]:l}}}}}},cu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,a;const{placement:r,rects:s,platform:i,elements:l}=e,{apply:c=()=>{},...d}=Fn(t,e),u=await i.detectOverflow(e,d),f=zt(r),h=Rn(r),m=kt(r)==="y",{width:b,height:p}=s.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=f,g=h==="end"?"top":"bottom");const B=p-u.top-u.bottom,D=b-u.left-u.right,M=yn(p-u[g],B),S=yn(b-u[y],D),k=!e.middlewareData.shift;let C=M,x=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(x=D),(a=e.middlewareData.shift)!=null&&a.enabled.y&&(C=B),k&&!h){const E=Ke(u.left,0),A=Ke(u.right,0),T=Ke(u.top,0),F=Ke(u.bottom,0);m?x=b-2*(E!==0||A!==0?E+A:Ke(u.left,u.right)):C=p-2*(T!==0||F!==0?T+F:Ke(u.top,u.bottom))}await c({...e,availableWidth:x,availableHeight:C});const w=await i.getDimensions(l.floating);return b!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Eo(){return typeof window<"u"}function Zt(t){return $a(t)?(t.nodeName||"").toLowerCase():"#document"}function Xe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ut(t){var e;return(e=($a(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $a(t){return Eo()?t instanceof Node||t instanceof Xe(t).Node:!1}function rt(t){return Eo()?t instanceof Element||t instanceof Xe(t).Element:!1}function ft(t){return Eo()?t instanceof HTMLElement||t instanceof Xe(t).HTMLElement:!1}function bs(t){return!Eo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xe(t).ShadowRoot}const du=new Set(["inline","contents"]);function vn(t){const{overflow:e,overflowX:n,overflowY:a,display:r}=st(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+n)&&!du.has(r)}const uu=new Set(["table","td","th"]);function fu(t){return uu.has(Zt(t))}const hu=[":popover-open",":modal"];function Do(t){return hu.some(e=>{try{return t.matches(e)}catch{return!1}})}const mu=["transform","translate","scale","rotate","perspective"],pu=["transform","translate","scale","rotate","perspective","filter"],gu=["paint","layout","strict","content"];function Ta(t){const e=Oa(),n=rt(t)?st(t):t;return mu.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||pu.some(a=>(n.willChange||"").includes(a))||gu.some(a=>(n.contain||"").includes(a))}function bu(t){let e=Ft(t);for(;ft(e)&&!xn(e);){if(Ta(e))return e;if(Do(e))return null;e=Ft(e)}return null}function Oa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yu=new Set(["html","body","#document"]);function xn(t){return yu.has(Zt(t))}function st(t){return Xe(t).getComputedStyle(t)}function Vo(t){return rt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ft(t){if(Zt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||bs(t)&&t.host||ut(t);return bs(e)?e.host:e}function ys(t){const e=Ft(t);return xn(e)?t.ownerDocument?t.ownerDocument.body:t.body:ft(e)&&vn(e)?e:ys(e)}function Ln(t,e,n){var a;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=ys(t),s=r===((a=t.ownerDocument)==null?void 0:a.body),i=Xe(r);if(s){const l=za(i);return e.concat(i,i.visualViewport||[],vn(r)?r:[],l&&n?Ln(l):[])}return e.concat(r,Ln(r,[],n))}function za(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function xs(t){const e=st(t);let n=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const r=ft(t),s=r?t.offsetWidth:n,i=r?t.offsetHeight:a,l=_o(n)!==s||_o(a)!==i;return l&&(n=s,a=i),{width:n,height:a,$:l}}function Fa(t){return rt(t)?t:t.contextElement}function kn(t){const e=Fa(t);if(!ft(e))return dt(1);const n=e.getBoundingClientRect(),{width:a,height:r,$:s}=xs(e);let i=(s?_o(n.width):n.width)/a,l=(s?_o(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const xu=dt(0);function ks(t){const e=Xe(t);return!Oa()||!e.visualViewport?xu:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ku(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Xe(t)?!1:e}function en(t,e,n,a){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Fa(t);let i=dt(1);e&&(a?rt(a)&&(i=kn(a)):i=kn(t));const l=ku(s,n,a)?ks(s):dt(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=Xe(s),m=a&&rt(a)?Xe(a):a;let b=h,p=za(b);for(;p&&a&&m!==b;){const g=kn(p),y=p.getBoundingClientRect(),B=st(p),D=y.left+(p.clientLeft+parseFloat(B.paddingLeft))*g.x,M=y.top+(p.clientTop+parseFloat(B.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,f*=g.y,c+=D,d+=M,b=Xe(p),p=za(b)}}return So({width:u,height:f,x:c,y:d})}function Mo(t,e){const n=Vo(t).scrollLeft;return e?e.left+n:en(ut(t)).left+n}function ws(t,e){const n=t.getBoundingClientRect(),a=n.left+e.scrollLeft-Mo(t,n),r=n.top+e.scrollTop;return{x:a,y:r}}function wu(t){let{elements:e,rect:n,offsetParent:a,strategy:r}=t;const s=r==="fixed",i=ut(a),l=e?Do(e.floating):!1;if(a===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=dt(1);const u=dt(0),f=ft(a);if((f||!f&&!s)&&((Zt(a)!=="body"||vn(i))&&(c=Vo(a)),ft(a))){const m=en(a);d=kn(a),u.x=m.x+a.clientLeft,u.y=m.y+a.clientTop}const h=i&&!f&&!s?ws(i,c):dt(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:n.y*d.y-c.scrollTop*d.y+u.y+h.y}}function _u(t){return Array.from(t.getClientRects())}function Cu(t){const e=ut(t),n=Vo(t),a=t.ownerDocument.body,r=Ke(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),s=Ke(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+Mo(t);const l=-n.scrollTop;return st(a).direction==="rtl"&&(i+=Ke(e.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const _s=25;function Bu(t,e){const n=Xe(t),a=ut(t),r=n.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const u=Oa();(!u||u&&e==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Mo(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,b=Math.abs(a.clientWidth-f.clientWidth-m);b<=_s&&(s-=b)}else d<=_s&&(s+=d);return{width:s,height:i,x:l,y:c}}const Su=new Set(["absolute","fixed"]);function Eu(t,e){const n=en(t,!0,e==="fixed"),a=n.top+t.clientTop,r=n.left+t.clientLeft,s=ft(t)?kn(t):dt(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function Cs(t,e,n){let a;if(e==="viewport")a=Bu(t,n);else if(e==="document")a=Cu(ut(t));else if(rt(e))a=Eu(e,n);else{const r=ks(t);a={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return So(a)}function Bs(t,e){const n=Ft(t);return n===e||!rt(n)||xn(n)?!1:st(n).position==="fixed"||Bs(n,e)}function Du(t,e){const n=e.get(t);if(n)return n;let a=Ln(t,[],!1).filter(l=>rt(l)&&Zt(l)!=="body"),r=null;const s=st(t).position==="fixed";let i=s?Ft(t):t;for(;rt(i)&&!xn(i);){const l=st(i),c=Ta(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&Su.has(r.position)||vn(i)&&!c&&Bs(t,i))?a=a.filter(u=>u!==i):r=l,i=Ft(i)}return e.set(t,a),a}function Vu(t){let{element:e,boundary:n,rootBoundary:a,strategy:r}=t;const i=[...n==="clippingAncestors"?Do(e)?[]:Du(e,this._c):[].concat(n),a],l=i[0],c=i.reduce((d,u)=>{const f=Cs(e,u,r);return d.top=Ke(f.top,d.top),d.right=yn(f.right,d.right),d.bottom=yn(f.bottom,d.bottom),d.left=Ke(f.left,d.left),d},Cs(e,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Mu(t){const{width:e,height:n}=xs(t);return{width:e,height:n}}function Nu(t,e,n){const a=ft(e),r=ut(e),s=n==="fixed",i=en(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=dt(0);function d(){c.x=Mo(r)}if(a||!a&&!s)if((Zt(e)!=="body"||vn(r))&&(l=Vo(e)),a){const m=en(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else r&&d();s&&!a&&r&&d();const u=r&&!a&&!s?ws(r,l):dt(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 Ra(t){return st(t).position==="static"}function Ss(t,e){if(!ft(t)||st(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ut(t)===n&&(n=n.ownerDocument.body),n}function Es(t,e){const n=Xe(t);if(Do(t))return n;if(!ft(t)){let r=Ft(t);for(;r&&!xn(r);){if(rt(r)&&!Ra(r))return r;r=Ft(r)}return n}let a=Ss(t,e);for(;a&&fu(a)&&Ra(a);)a=Ss(a,e);return a&&xn(a)&&Ra(a)&&!Ta(a)?n:a||bu(t)||n}const Pu=async function(t){const e=this.getOffsetParent||Es,n=this.getDimensions,a=await n(t.floating);return{reference:Nu(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Au(t){return st(t).direction==="rtl"}const $u={convertOffsetParentRelativeRectToViewportRelativeRect:wu,getDocumentElement:ut,getClippingRect:Vu,getOffsetParent:Es,getElementRects:Pu,getClientRects:_u,getDimensions:Mu,getScale:kn,isElement:rt,isRTL:Au};function Ds(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Tu(t,e){let n=null,a;const r=ut(t);function s(){var l;clearTimeout(a),(l=n)==null||l.disconnect(),n=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||e(),!h||!m)return;const b=Co(f),p=Co(r.clientWidth-(u+h)),g=Co(r.clientHeight-(f+m)),y=Co(u),D={rootMargin:-b+"px "+-p+"px "+-g+"px "+-y+"px",threshold:Ke(0,yn(1,c))||1};let M=!0;function S(k){const C=k[0].intersectionRatio;if(C!==c){if(!M)return i();C?i(!1,C):a=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!Ds(d,t.getBoundingClientRect())&&i(),M=!1}try{n=new IntersectionObserver(S,{...D,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,D)}n.observe(t)}return i(!0),s}function va(t,e,n,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=Fa(t),u=r||s?[...d?Ln(d):[],...Ln(e)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=d&&l?Tu(d,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(y=>{let[B]=y;B&&B.target===d&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var D;(D=m)==null||D.observe(e)})),n()}),d&&!c&&m.observe(d),m.observe(e));let b,p=c?en(t):null;c&&g();function g(){const y=en(t);p&&!Ds(p,y)&&n(),p=y,b=requestAnimationFrame(g)}return n(),()=>{var y;u.forEach(B=>{r&&B.removeEventListener("scroll",n),s&&B.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(b)}}const La=iu,Ia=lu,ja=au,Wa=cu,Ou=(t,e,n)=>{const a=new Map,r={platform:$u,...n},s={...r.platform,_c:a};return ou(t,e,{...r,platform:s})};function zu(t){return t!=null&&typeof t=="object"&&"$el"in t}function Vs(t){if(zu(t)){const e=t.$el;return $a(e)&&Zt(e)==="#comment"?null:e}return t}function In(t){return typeof t=="function"?t():o.unref(t)}function Ms(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ns(t,e){const n=Ms(t);return Math.round(e*n)/n}function Ha(t,e,n){n===void 0&&(n={});const a=n.whileElementsMounted,r=o.computed(()=>{var C;return(C=In(n.open))!=null?C:!0}),s=o.computed(()=>In(n.middleware)),i=o.computed(()=>{var C;return(C=In(n.placement))!=null?C:"bottom"}),l=o.computed(()=>{var C;return(C=In(n.strategy))!=null?C:"absolute"}),c=o.computed(()=>{var C;return(C=In(n.transform))!=null?C:!0}),d=o.computed(()=>Vs(t.value)),u=o.computed(()=>Vs(e.value)),f=o.ref(0),h=o.ref(0),m=o.ref(l.value),b=o.ref(i.value),p=o.shallowRef({}),g=o.ref(!1),y=o.computed(()=>{const C={position:m.value,left:"0",top:"0"};if(!u.value)return C;const x=Ns(u.value,f.value),w=Ns(u.value,h.value);return c.value?{...C,transform:"translate("+x+"px, "+w+"px)",...Ms(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:x+"px",top:w+"px"}});let B;function D(){if(d.value==null||u.value==null)return;const C=r.value;Ou(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(x=>{f.value=x.x,h.value=x.y,m.value=x.strategy,b.value=x.placement,p.value=x.middlewareData,g.value=C!==!1})}function M(){typeof B=="function"&&(B(),B=void 0)}function S(){if(M(),a===void 0){D();return}if(d.value!=null&&u.value!=null){B=a(d.value,u.value,D);return}}function k(){r.value||(g.value=!1)}return o.watch([s,i,l,r],D,{flush:"sync"}),o.watch([d,u],S,{flush:"sync"}),o.watch(r,k,{flush:"sync"}),o.getCurrentScope()&&o.onScopeDispose(M),{x:o.shallowReadonly(f),y:o.shallowReadonly(h),strategy:o.shallowReadonly(m),placement:o.shallowReadonly(b),middlewareData:o.shallowReadonly(p),isPositioned:o.shallowReadonly(g),floatingStyles:y,update:D}}const Fu=["aria-busy"],Ru={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},vu=["for"],Lu={key:0,class:"ml-1 text-destructive"},Iu={class:"relative"},ju={key:0,class:"flex items-center text-gray-500 gap-2"},Wu=["id","placeholder","disabled","readonly","value"],Hu={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},qu=["disabled"],Uu={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},Yu=["onMouseenter","onClick"],Gu={key:0},Ku={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Xu={key:0},Ju={key:1},Qu={key:2},Zu={key:1,class:"mt-1 text-xs text-red-600"},qa=o.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:e}){const n=t,a=e,r=o.useAttrs(),s=o.computed(()=>r.label??void 0),i=R=>{const Z=r[R];return Z===""||Z===!0||Z==="true"||Z===1||Z==="1"},l=o.ref(!1),c=o.computed(()=>n.itemTitle||r["item-title"]||r.itemTitle||"name"),d=o.computed(()=>n.itemValue||r["item-value"]||r.itemValue||"id"),u=o.computed(()=>n.disabled),f=o.computed(()=>i("required")),h=o.computed(()=>i("readonly")),m=o.computed(()=>n.returnObject||i("return-object")||i("returnObject")),b=o.computed(()=>f.value||i("aria-required")),p=o.computed(()=>n.error||n.errorMessage||r["error-message"]),g=o.computed(()=>r.placeholder??""),y=o.computed(()=>{const R=r.minChars??r["min-chars"];if(R==null||R==="")return 0;const Z=typeof R=="number"?R:Number.parseInt(String(R),10);return Number.isFinite(Z)&&Z>0?Z:0}),B=o.computed(()=>{const R=r.rules;return Array.isArray(R)?R:[]}),D=o.computed(()=>{const R=r.id||r.label;return R?`app-autocomplete-${R}-${Math.random().toString(36).slice(2,7)}`:void 0}),M=o.ref(n.modelValue),S=o.ref([]),k=o.ref(!1),C=o.ref(!1),x=o.computed(()=>r.items),w=o.computed(()=>{const R=L.value;return R.apiModule&&R.apiAction||R.apiUrl||n.fetchItems?S.value:x.value??[]}),E=o.computed(()=>!!r.loading),A=o.computed(()=>E.value||k.value),T=o.computed(()=>{const{label:R,items:Z,loading:ce,rules:Ve,"item-title":Ae,"item-value":G,itemTitle:ee,itemValue:ae,minChars:me,"min-chars":$e,clearable:lt,required:Sd,"aria-required":qe,disabled:Ed,readonly:Sa,visible:Dd,"return-object":Ea,returnObject:Vd,class:as,"fetch-items":Md,fetchItems:Nd,error:rs,errorMessage:Pd,"error-message":Ad,...Da}=r||{};return Da}),F=()=>{if(n.apiOptions)return typeof n.apiOptions=="function"?n.apiOptions():n.apiOptions},L=o.computed(()=>{const R=n.endpoint||{};return{apiModule:n.apiModule||R.apiModule,apiAction:n.apiAction||R.apiAction,apiUrl:R.apiUrl,apiMethod:R.apiMethod||"GET"}}),Y=o.ref(null),z=o.ref(null),v=o.ref(null),{floatingStyles:W}=Ha(z,v,{placement:"bottom-start",whileElementsMounted:va,middleware:[La(4),ja(),Ia(),Wa({apply({rects:R,elements:Z,availableHeight:ce}){Object.assign(Z.floating.style,{width:`${R.reference.width}px`,maxHeight:`${ce}px`})}})]}),O=o.ref(!1),N=o.ref(""),H=o.ref(-1),j=o.ref(null),J=o.computed(()=>!y.value||(N.value||"").trim().length>=y.value?"":`Ketik minimal ${y.value} karakter`),te=R=>{if(R==null)return"";if(typeof R=="string"||typeof R=="number")return String(R);const Z=c.value;return typeof Z=="function"?Z(R):(R==null?void 0:R[Z])??(R==null?void 0:R.name)??(R==null?void 0:R.nama)??(R==null?void 0:R.label)??(R==null?void 0:R.title)??"-"},ue=R=>{if(R==null)return null;if(typeof R=="string"||typeof R=="number")return R;const Z=d.value;return typeof Z=="function"?Z(R):(R==null?void 0:R[Z])??(R==null?void 0:R.id)??(R==null?void 0:R.value)??(R==null?void 0:R.code)??null},fe=o.computed(()=>{const R=M.value;if(R==null||R==="")return"";if(Array.isArray(R))return R.length?R.map(Ve=>{if(m.value&&typeof Ve=="object"||typeof Ve=="object")return te(Ve);const Ae=w.value.find(G=>ue(G)==Ve);return Ae?te(Ae):String(Ve)}).join(", "):"";if(typeof R=="object")return te(R);const Z=w.value.find(ce=>ue(ce)==R);return Z?te(Z):String(R)}),pe=o.computed(()=>{const R=w.value||[],Z=(N.value||"").trim().toLowerCase(),ce=(fe.value||"").toLowerCase(),Ve=!Z||Z===ce;let Ae=R;if(Ve||(Ae=R.filter(G=>te(G).toLowerCase().includes(Z))),Ae.length>0){const G=ee=>{const ae=ue(ee);return Array.isArray(M.value)?M.value.some(me=>me==ae):M.value==ae};Ae=[...Ae].sort((ee,ae)=>{const me=G(ee),$e=G(ae);return me&&!$e?-1:!me&&$e?1:0})}return Ae}),Le=R=>Array.isArray(R)?R.length===0:R==null||R==="",be=R=>{if(j.value=null,f.value&&Le(R)&&!B.value.length)return j.value="This field is required",!1;for(const Z of B.value){const ce=Z(R);if(ce===!1)return j.value="Invalid value",!1;if(typeof ce=="string")return j.value=ce,!1}return!0},U=async()=>{if(u.value||h.value)return;O.value=!0,H.value=pe.value.length?0:-1,N.value=fe.value||"";const R=L.value,Z=R.apiModule&&R.apiAction||R.apiUrl||n.fetchItems;n.autoFetchOnOpen&&Z&&!C.value&&(await At(),H.value=pe.value.length?0:-1)},P=()=>{O.value=!1,H.value=-1,N.value=fe.value||""},q=R=>{const Z=m.value?R:ue(R);let ce=Z;Array.isArray(M.value)&&(ce=[Z]),M.value=ce,a("update:modelValue",ce),j.value=null,be(ce),N.value=te(R),P()},oe=()=>{S.value=[],C.value=!1,M.value=Array.isArray(M.value)?[]:null,a("update:modelValue",M.value),N.value="",j.value=null},he=()=>{l.value=!0,oe(),P(),setTimeout(()=>{l.value=!1},0)},ze=R=>{if(u.value||h.value)return;const Z=R.target.value;N.value=Z,j.value&&(j.value=null),O.value||(O.value=!0),H.value=pe.value.length?0:-1;const ce=L.value.apiModule&&L.value.apiAction||L.value.apiUrl||n.fetchItems;n.autoFetchOnOpen&&ce&&!A.value&&!C.value&&At()},ot=R=>{var ce;if(u.value||h.value)return;const Z={ArrowDown:()=>{if(R.preventDefault(),!O.value){U();return}pe.value.length&&(H.value=Math.min(H.value+1,pe.value.length-1))},ArrowUp:()=>{!O.value||!pe.value.length||(R.preventDefault(),H.value=Math.max(H.value-1,0))},Enter:()=>{if(!O.value)return;R.preventDefault();const Ve=pe.value[H.value];Ve&&q(Ve)},Escape:()=>{R.preventDefault(),P()},Tab:()=>{P()}};(ce=Z[R.key])==null||ce.call(Z)},At=async()=>{const R=L.value;if(R.apiModule&&R.apiAction||R.apiUrl||n.fetchItems){k.value=!0;try{let ce;if(n.fetchItems){const Ve=F()||{},Ae={page:1,perPage:100,search:(N.value||"").trim(),...Ve,...n.apiParams},G=await n.fetchItems(Ae),ee=(G==null?void 0:G.data)??G;ce=(ee==null?void 0:ee.data)??ee}else{const Ae=at().DCodeApi;if(typeof Ae!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const ee={page:1,perPage:100,...F()||{},...n.apiParams};let ae;R.apiUrl?ae=await Ae("","",ee,{_url:R.apiUrl,_method:R.apiMethod||"POST"}):ae=await Ae(R.apiModule,R.apiAction,ee);const me=(ae==null?void 0:ae.data)??ae;ce=(me==null?void 0:me.data)??me}S.value=Array.isArray(ce)?ce:[],C.value=!0}catch(ce){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",ce),j.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(ce==null?void 0:ce.message)||(ce==null?void 0:ce.toString())||"Failed to load options"}`,S.value=[],C.value=!0}finally{k.value=!1}}},$t=R=>{const Z=ue(R);return m.value?M.value?Array.isArray(M.value)?M.value.some(ce=>ue(ce)==Z):ue(M.value)==Z:!1:Array.isArray(M.value)?M.value.some(ce=>ce==Z):M.value==Z};o.watch(()=>[F(),L.value,n.apiParams],([R,Z,ce],[Ve,Ae,G])=>{const ee=L.value;if(!(ee.apiModule&&ee.apiAction||ee.apiUrl||n.fetchItems)){oe();return}const me=JSON.stringify(R??null)===JSON.stringify(Ve??null),$e=JSON.stringify(ce??null)===JSON.stringify(G??null);me&&$e||(oe(),$e||At())},{deep:!0}),o.watch(()=>n.modelValue,(R,Z)=>{M.value=R,!l.value&&(R==null||R==="")&&Z!=null&&n.apiModule&&n.apiAction&&(S.value=[],C.value=!1),N.value=fe.value||""},{immediate:!0});const bn=L.value;(bn.apiModule&&bn.apiAction||bn.apiUrl||n.fetchItems)&&(n.autoFetchOnMount||!Le(n.modelValue))&&At();const Qe=R=>{const Z=Y.value,ce=v.value,Ve=R.target;Z&&Z.contains(Ve)||ce&&ce.contains(Ve)||O.value&&P()},Tt=o.computed(()=>{const R=n.modelValue;return R==null?!1:typeof R=="string"?R.trim().length>0:Array.isArray(R)?R.length>0:typeof R=="object"?Object.keys(R).length>0:!0}),ko=o.computed(()=>!!n.clearable&&Tt.value&&!n.disabled);return o.onMounted(()=>{document.addEventListener("mousedown",Qe)}),o.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Qe)}),(R,Z)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:Y,class:o.normalizeClass(["w-full",o.unref(r).class]),"aria-busy":t.skeleton},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",Ru)):o.createCommentVNode("",!0),Z[6]||(Z[6]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createElementBlock("label",{key:0,for:D.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[o.createTextVNode(o.toDisplayString(s.value)+" ",1),b.value?(o.openBlock(),o.createElementBlock("span",Lu,"*")):o.createCommentVNode("",!0)],8,vu)):o.createCommentVNode("",!0),o.createElementVNode("div",Iu,[o.createElementVNode("div",{ref_key:"reference",ref:z,class:o.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||p.value?"border-red-500 focus-within:ring-red-500":""]])},[n.icon||R.$slots["prepend-inner"]?(o.openBlock(),o.createElementBlock("div",ju,[o.renderSlot(R.$slots,"prepend-inner",{},()=>[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-4 w-4"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),o.createElementVNode("input",o.mergeProps(T.value,{id:D.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||h.value?"cursor-not-allowed":"cursor-text"],placeholder:g.value,disabled:u.value,readonly:h.value,value:O.value?N.value:fe.value||N.value,onFocus:Z[0]||(Z[0]=()=>{O.value||U()}),onClick:Z[1]||(Z[1]=()=>{O.value||U()}),onInput:ze,onKeydown:ot,onBlur:Z[2]||(Z[2]=()=>be(M.value))}),null,16,Wu),A.value?(o.openBlock(),o.createElementBlock("svg",Hu,[...Z[7]||(Z[7]=[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):ko.value?(o.openBlock(),o.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:Z[3]||(Z[3]=o.withModifiers(()=>{},["prevent"])),onClick:o.withModifiers(he,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(o.openBlock(),o.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:Z[4]||(Z[4]=ce=>O.value?P():U()),"aria-label":"Toggle"},[o.createVNode(o.unref(ne.ChevronDown),{class:o.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":O.value}])},null,8,["class"])],8,qu))],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[O.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"floating",ref:v,style:o.normalizeStyle(o.unref(W)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[o.createElementVNode("div",Uu,[pe.value.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(pe.value,(ce,Ve)=>(o.openBlock(),o.createElementBlock("button",{key:ue(ce)??Ve,type:"button",class:o.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Ve===H.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ae=>H.value=Ve,onMousedown:Z[5]||(Z[5]=o.withModifiers(()=>{},["prevent"])),onClick:Ae=>q(ce)},[o.createTextVNode(o.toDisplayString(te(ce))+" ",1),$t(ce)?(o.openBlock(),o.createElementBlock("span",Gu," ✓ ")):o.createCommentVNode("",!0)],42,Yu))),128)):o.renderSlot(R.$slots,"no-data",{key:1},()=>[o.createElementVNode("div",Ku,[A.value?(o.openBlock(),o.createElementBlock("span",Xu,"Loading data…")):J.value?(o.openBlock(),o.createElementBlock("span",Ju,o.toDisplayString(J.value),1)):(o.openBlock(),o.createElementBlock("span",Qu,"No data available"))])])])],4)):o.createCommentVNode("",!0)]))]),j.value||p.value?(o.openBlock(),o.createElementBlock("p",Zu,o.toDisplayString(j.value||p.value),1)):o.createCommentVNode("",!0)],64))],10,Fu)),[[o.vShow,t.visible]])}}),ef=["aria-busy"],tf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},nf=["for"],of={key:0,class:"ml-1 text-destructive"},af={class:"relative"},rf={key:0,class:"flex items-center text-gray-500 gap-2"},sf=["id","placeholder","disabled","value"],lf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},cf=["disabled"],df={key:0,class:"p-3 space-y-2"},uf=["onMouseenter","onClick"],ff={class:"flex items-center space-x-3"},hf={class:"flex-1"},mf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},pf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},gf={key:0},bf={key:2,class:"p-3 text-center"},yf={class:"inline-flex items-center space-x-2"},xf={class:"text-sm text-gray-500"},kf={key:3,class:"p-3 text-center"},wf={class:"text-xs text-gray-400"},_f={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Cf={key:1,class:"mt-1 text-xs text-red-600"},Bf={key:2,class:"mt-1 text-xs text-gray-500"},Ps=o.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:e}){const n=t,a=e,r=o.useAttrs(),s=o.ref(),i=o.ref(),l=o.ref(),c=o.ref(),d=o.ref(),u=o.computed(()=>{const H=n.label||n.placeholder;return H?`app-infinite-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=o.ref(""),h=o.ref([]),m=o.ref(!1),b=o.ref(!1),p=o.ref(-1),g=o.ref(1),y=o.ref(!0),B=o.ref(0),D=o.ref(),{floatingStyles:M}=Ha(c,d,{placement:"bottom-start",whileElementsMounted:va,middleware:[La(4),ja(),Ia(),Wa({apply({rects:H,elements:j}){Object.assign(j.floating.style,{width:`${H.reference.width}px`})}})]});o.computed(()=>({"opacity-50 pointer-events-none":n.disabled,relative:!0})),o.computed(()=>({"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500":!0,"pl-10":n.icon,"pr-10":n.clearable&&n.modelValue||m.value,"bg-gray-50 text-gray-500":n.disabled,"border-red-500 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":n.error}));const S=o.computed(()=>f.value?h.value.filter(H=>w(H).toLowerCase().includes(f.value.toLowerCase())):h.value),k=o.computed(()=>{if(b.value&&f.value)return f.value;if(n.modelValue){if(n.returnObject)return w(n.modelValue);{const H=h.value.find(j=>E(j)===n.modelValue);return H?w(H):String(n.modelValue)}}return""}),C=()=>{b.value=!0},x=()=>{b.value=!1},w=H=>typeof n.itemTitle=="function"?n.itemTitle(H):H[n.itemTitle]||"",E=H=>typeof n.itemValue=="function"?n.itemValue(H):H[n.itemValue]||H,A=H=>n.itemSubtitle?typeof n.itemSubtitle=="function"?n.itemSubtitle(H):H[n.itemSubtitle]||"":"",T=H=>n.modelValue?n.returnObject?E(H)===E(n.modelValue):E(H)===n.modelValue:!1,F=H=>{var J;const j=n.returnObject?H:E(H);a("update:modelValue",j),a("select",H),b.value=!1,f.value="",(J=s.value)==null||J.blur()},L=()=>{var H;a("update:modelValue",null),f.value="",(H=s.value)==null||H.focus()},Y=H=>{b.value=!0,a("focus",H),n.autoFetchOnOpen&&!m.value&&(n.refreshOnOpen||h.value.length===0)&&N(!0)},z=H=>{setTimeout(()=>{b.value=!1,a("blur",H)},200)},v=H=>{const j=H.target;f.value=j.value,D.value&&clearTimeout(D.value),D.value=setTimeout(()=>{a("search",f.value),g.value=1,y.value=!0,N(!0)},n.debounceMs)},W=H=>{if(b.value)switch(H.key){case"ArrowDown":H.preventDefault(),p.value=Math.min(p.value+1,S.value.length-1);break;case"ArrowUp":H.preventDefault(),p.value=Math.max(p.value-1,0);break;case"Enter":H.preventDefault(),p.value>=0&&S.value[p.value]&&F(S.value[p.value]);break;case"Escape":b.value=!1;break}},O=H=>{if(!y.value||m.value)return;const j=H.target,{scrollTop:J,scrollHeight:te,clientHeight:ue}=j;J+ue>=te-n.threshold&&N()},N=async(H=!1)=>{var j,J;if(!m.value){m.value=!0;try{let te=[];if(n.fetchItems)te=await n.fetchItems();else{const ue=at(),fe=((j=n.endpoint)==null?void 0:j.apiModule)||n.apiModule,pe=((J=n.endpoint)==null?void 0:J.apiAction)||n.apiAction;if(!fe||!pe)throw new Error("API module and action are required");const Le={page:H?1:g.value,pageSize:n.pageSize,search:f.value,...n.apiParams},be=await ue.apiUrl(`/${fe}/${pe}`,"GET",Le);te=be.data||be.items||be||[],B.value=be.total||be.totalItems||te.length}H?(h.value=te,g.value=1):(h.value.push(...te),g.value++),y.value=te.length>=n.pageSize,y.value||a("end-of-results"),a("load-more",{items:te,page:g.value,hasMore:y.value,total:B.value})}catch(te){console.error("Error fetching items:",te),a("error",te)}finally{m.value=!1}}};return o.onMounted(()=>{n.autoFetchOnMount&&N()}),o.onUnmounted(()=>{D.value&&clearTimeout(D.value)}),o.watch(()=>n.modelValue,H=>{H||(f.value="")}),(H,j)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:l,class:o.normalizeClass(["w-full",o.unref(r).class]),"aria-busy":t.skeleton},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.label?(o.openBlock(),o.createElementBlock("div",tf)):o.createCommentVNode("",!0),j[3]||(j[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",of,"*")):o.createCommentVNode("",!0)],8,nf)):o.createCommentVNode("",!0),o.createElementVNode("div",af,[o.createElementVNode("div",{ref_key:"reference",ref:c,class:o.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",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[n.icon?(o.openBlock(),o.createElementBlock("div",rf,[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-4 w-4"})):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("input",o.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",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:k.value,onFocus:Y,onBlur:z,onInput:v,onKeydown:W}),null,16,sf),m.value?(o.openBlock(),o.createElementBlock("svg",lf,[...j[4]||(j[4]=[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),o.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?(o.openBlock(),o.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]=o.withModifiers(()=>{},["prevent"])),onClick:o.withModifiers(L,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(o.openBlock(),o.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:j[1]||(j[1]=J=>b.value?x():C()),"aria-label":"Toggle"},[o.createVNode(o.unref(ne.ChevronDown),{class:o.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":b.value}])},null,8,["class"])],8,cf))],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[b.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:o.normalizeStyle(o.unref(M)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[o.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:O},[m.value&&h.value.length===0?(o.openBlock(),o.createElementBlock("div",df,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(5,J=>o.createElementVNode("div",{key:J,class:"flex items-center space-x-3"},[...j[5]||(j[5]=[o.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),o.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):S.value.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(S.value,(J,te)=>(o.openBlock(),o.createElementBlock("button",{key:E(J)??te,type:"button",class:o.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",te===p.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ue=>p.value=te,onMousedown:j[2]||(j[2]=o.withModifiers(()=>{},["prevent"])),onClick:ue=>F(J)},[o.renderSlot(H.$slots,"item",{item:J,index:te},()=>[o.createElementVNode("div",ff,[o.createElementVNode("div",hf,[o.createElementVNode("div",mf,o.toDisplayString(w(J)),1),t.itemSubtitle?(o.openBlock(),o.createElementBlock("div",pf,o.toDisplayString(A(J)),1)):o.createCommentVNode("",!0)])])]),T(J)?(o.openBlock(),o.createElementBlock("span",gf," ✓ ")):o.createCommentVNode("",!0)],42,uf))),128)):o.createCommentVNode("",!0),m.value&&h.value.length>0?(o.openBlock(),o.createElementBlock("div",bf,[o.createElementVNode("div",yf,[j[6]||(j[6]=o.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),o.createElementVNode("span",xf,o.toDisplayString(t.loadingText),1)])])):o.createCommentVNode("",!0),!y.value&&h.value.length>0?(o.openBlock(),o.createElementBlock("div",kf,[o.createElementVNode("div",wf,o.toDisplayString(t.endOfResultsText),1)])):!m.value&&h.value.length===0?(o.openBlock(),o.createElementBlock("div",_f,o.toDisplayString(t.noResultsText),1)):o.createCommentVNode("",!0)],544)],4)):o.createCommentVNode("",!0)]))]),t.error?(o.openBlock(),o.createElementBlock("p",Cf,o.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(o.openBlock(),o.createElementBlock("p",Bf,o.toDisplayString(t.helperText),1)):o.createCommentVNode("",!0)],64))],10,ef)),[[o.vShow,t.visible]])}});function As(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=As(t[e]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function $s(){for(var t,e,n=0,a="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=As(t))&&(a&&(a+=" "),a+=e);return a}const Sf=(t,e)=>{const n=new Array(t.length+e.length);for(let a=0;a<t.length;a++)n[a]=t[a];for(let a=0;a<e.length;a++)n[t.length+a]=e[a];return n},Ef=(t,e)=>({classGroupId:t,validator:e}),Ts=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),No="-",Os=[],Df="arbitrary..",Vf=t=>{const e=Nf(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Mf(i);const l=i.split(No),c=l[0]===""&&l.length>1?1:0;return zs(l,c,e)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=n[i];return c?d?Sf(d,c):c:d||Os}return n[i]||Os}}},zs=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const d=zs(t,e+1,s);if(d)return d}const i=n.validators;if(i===null)return;const l=e===0?t.join(No):t.slice(e).join(No),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Mf=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),a=e.slice(0,n);return a?Df+a:void 0})(),Nf=t=>{const{theme:e,classGroups:n}=t;return Pf(n,e)},Pf=(t,e)=>{const n=Ts();for(const a in t){const r=t[a];Ua(r,n,a,e)}return n},Ua=(t,e,n,a)=>{const r=t.length;for(let s=0;s<r;s++){const i=t[s];Af(i,e,n,a)}},Af=(t,e,n,a)=>{if(typeof t=="string"){$f(t,e,n);return}if(typeof t=="function"){Tf(t,e,n,a);return}Of(t,e,n,a)},$f=(t,e,n)=>{const a=t===""?e:Fs(e,t);a.classGroupId=n},Tf=(t,e,n,a)=>{if(zf(t)){Ua(t(a),e,n,a);return}e.validators===null&&(e.validators=[]),e.validators.push(Ef(n,t))},Of=(t,e,n,a)=>{const r=Object.entries(t),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];Ua(c,Fs(e,l),n,a)}},Fs=(t,e)=>{let n=t;const a=e.split(No),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=n.nextPart.get(i);l||(l=Ts(),n.nextPart.set(i,l)),n=l}return n},zf=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Ff=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),a=Object.create(null);const r=(s,i)=>{n[s]=i,e++,e>t&&(e=0,a=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in n?n[s]=i:r(s,i)}}},Ya="!",Rs=":",Rf=[],vs=(t,e,n,a,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),vf=t=>{const{prefix:e,experimentalParseClassName:n}=t;let a=r=>{const s=[];let i=0,l=0,c=0,d;const u=r.length;for(let p=0;p<u;p++){const g=r[p];if(i===0&&l===0){if(g===Rs){s.push(r.slice(c,p)),c=p+1;continue}if(g==="/"){d=p;continue}}g==="["?i++:g==="]"?i--:g==="("?l++:g===")"&&l--}const f=s.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(Ya)?(h=f.slice(0,-1),m=!0):f.startsWith(Ya)&&(h=f.slice(1),m=!0);const b=d&&d>c?d-c:void 0;return vs(s,m,h,b)};if(e){const r=e+Rs,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):vs(Rf,!1,i,void 0,!0)}if(n){const r=a;a=s=>n({className:s,parseClassName:r})}return a},Lf=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,a)=>{e.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",c=e.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}},If=t=>({cache:Ff(t.cacheSize),parseClassName:vf(t),sortModifiers:Lf(t),...Vf(t)}),jf=/\s+/,Wf=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=e,i=[],l=t.trim().split(jf);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:p}=n(u);if(f){c=u+(c.length>0?" "+c:c);continue}let g=!!p,y=a(g?b.substring(0,p):b);if(!y){if(!g){c=u+(c.length>0?" "+c:c);continue}if(y=a(b),!y){c=u+(c.length>0?" "+c:c);continue}g=!1}const B=h.length===0?"":h.length===1?h[0]:s(h).join(":"),D=m?B+Ya:B,M=D+y;if(i.indexOf(M)>-1)continue;i.push(M);const S=r(y,g);for(let k=0;k<S.length;++k){const C=S[k];i.push(D+C)}c=u+(c.length>0?" "+c:c)}return c},Hf=(...t)=>{let e=0,n,a,r="";for(;e<t.length;)(n=t[e++])&&(a=Ls(n))&&(r&&(r+=" "),r+=a);return r},Ls=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=Ls(t[a]))&&(n&&(n+=" "),n+=e);return n},qf=(t,...e)=>{let n,a,r,s;const i=c=>{const d=e.reduce((u,f)=>f(u),t());return n=If(d),a=n.cache.get,r=n.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const u=Wf(c,n);return r(c,u),u};return s=i,(...c)=>s(Hf(...c))},Uf=[],Fe=t=>{const e=n=>n[t]||Uf;return e.isThemeGetter=!0,e},Is=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,js=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Yf=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Gf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kf=/\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$/,Xf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rt=t=>Yf.test(t),xe=t=>!!t&&!Number.isNaN(Number(t)),vt=t=>!!t&&Number.isInteger(Number(t)),Ga=t=>t.endsWith("%")&&xe(t.slice(0,-1)),wt=t=>Gf.test(t),Ws=()=>!0,Zf=t=>Kf.test(t)&&!Xf.test(t),Ka=()=>!1,eh=t=>Jf.test(t),th=t=>Qf.test(t),nh=t=>!re(t)&&!se(t),oh=t=>Lt(t,Ks,Ka),re=t=>Is.test(t),tn=t=>Lt(t,Xs,Zf),Hs=t=>Lt(t,uh,xe),ah=t=>Lt(t,Qs,Ws),rh=t=>Lt(t,Js,Ka),qs=t=>Lt(t,Ys,Ka),sh=t=>Lt(t,Gs,th),Po=t=>Lt(t,Zs,eh),se=t=>js.test(t),jn=t=>nn(t,Xs),ih=t=>nn(t,Js),Us=t=>nn(t,Ys),lh=t=>nn(t,Ks),ch=t=>nn(t,Gs),Ao=t=>nn(t,Zs,!0),dh=t=>nn(t,Qs,!0),Lt=(t,e,n)=>{const a=Is.exec(t);return a?a[1]?e(a[1]):n(a[2]):!1},nn=(t,e,n=!1)=>{const a=js.exec(t);return a?a[1]?e(a[1]):n:!1},Ys=t=>t==="position"||t==="percentage",Gs=t=>t==="image"||t==="url",Ks=t=>t==="length"||t==="size"||t==="bg-size",Xs=t=>t==="length",uh=t=>t==="number",Js=t=>t==="family-name",Qs=t=>t==="number"||t==="weight",Zs=t=>t==="shadow",fh=qf(()=>{const t=Fe("color"),e=Fe("font"),n=Fe("text"),a=Fe("font-weight"),r=Fe("tracking"),s=Fe("leading"),i=Fe("breakpoint"),l=Fe("container"),c=Fe("spacing"),d=Fe("radius"),u=Fe("shadow"),f=Fe("inset-shadow"),h=Fe("text-shadow"),m=Fe("drop-shadow"),b=Fe("blur"),p=Fe("perspective"),g=Fe("aspect"),y=Fe("ease"),B=Fe("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...M(),se,re],k=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],x=()=>[se,re,c],w=()=>[Rt,"full","auto",...x()],E=()=>[vt,"none","subgrid",se,re],A=()=>["auto",{span:["full",vt,se,re]},vt,se,re],T=()=>[vt,"auto",se,re],F=()=>["auto","min","max","fr",se,re],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...x()],v=()=>[Rt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],W=()=>[Rt,"screen","full","dvw","lvw","svw","min","max","fit",...x()],O=()=>[Rt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],N=()=>[t,se,re],H=()=>[...M(),Us,qs,{position:[se,re]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",lh,oh,{size:[se,re]}],te=()=>[Ga,jn,tn],ue=()=>["","none","full",d,se,re],fe=()=>["",xe,jn,tn],pe=()=>["solid","dashed","dotted","double"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[xe,Ga,Us,qs],U=()=>["","none",b,se,re],P=()=>["none",xe,se,re],q=()=>["none",xe,se,re],oe=()=>[xe,se,re],he=()=>[Rt,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wt],breakpoint:[wt],color:[Ws],container:[wt],"drop-shadow":[wt],ease:["in","out","in-out"],font:[nh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wt],shadow:[wt],spacing:["px",xe],text:[wt],"text-shadow":[wt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rt,re,se,g]}],container:["container"],columns:[{columns:[xe,re,se,l]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[vt,"auto",se,re]}],basis:[{basis:[Rt,"full","auto",l,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xe,Rt,"auto","initial","none",re]}],grow:[{grow:["",xe,se,re]}],shrink:[{shrink:["",xe,se,re]}],order:[{order:[vt,"first","last","none",se,re]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:v()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],w:[{w:[l,"screen",...v()]}],"min-w":[{"min-w":[l,"screen","none",...v()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...v()]}],h:[{h:["screen","lh",...v()]}],"min-h":[{"min-h":["screen","lh","none",...v()]}],"max-h":[{"max-h":["screen","lh",...v()]}],"font-size":[{text:["base",n,jn,tn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,dh,ah]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ga,re]}],"font-family":[{font:[ih,rh,e]}],"font-features":[{"font-features":[re]}],"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,se,re]}],"line-clamp":[{"line-clamp":[xe,"none",se,Hs]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",se,re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[xe,"from-font","auto",se,tn]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[xe,"auto",se,re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,re]}],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",se,re]}],"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:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,se,re],radial:["",se,re],conic:[vt,se,re]},ch,sh]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xe,se,re]}],"outline-w":[{outline:["",xe,jn,tn]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",u,Ao,Po]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",f,Ao,Po]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[xe,tn]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",h,Ao,Po]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[xe,se,re]}],"mix-blend":[{"mix-blend":[...Le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Le()}],"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":[xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[se,re]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"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:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,re]}],filter:[{filter:["","none",se,re]}],blur:[{blur:U()}],brightness:[{brightness:[xe,se,re]}],contrast:[{contrast:[xe,se,re]}],"drop-shadow":[{"drop-shadow":["","none",m,Ao,Po]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",xe,se,re]}],"hue-rotate":[{"hue-rotate":[xe,se,re]}],invert:[{invert:["",xe,se,re]}],saturate:[{saturate:[xe,se,re]}],sepia:[{sepia:["",xe,se,re]}],"backdrop-filter":[{"backdrop-filter":["","none",se,re]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[xe,se,re]}],"backdrop-contrast":[{"backdrop-contrast":[xe,se,re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xe,se,re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xe,se,re]}],"backdrop-invert":[{"backdrop-invert":["",xe,se,re]}],"backdrop-opacity":[{"backdrop-opacity":[xe,se,re]}],"backdrop-saturate":[{"backdrop-saturate":[xe,se,re]}],"backdrop-sepia":[{"backdrop-sepia":["",xe,se,re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xe,"initial",se,re]}],ease:[{ease:["linear","initial",y,se,re]}],delay:[{delay:[xe,se,re]}],animate:[{animate:["none",B,se,re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,se,re]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:P()}],"rotate-x":[{"rotate-x":P()}],"rotate-y":[{"rotate-y":P()}],"rotate-z":[{"rotate-z":P()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[se,re,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",se,re]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",se,re]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[xe,jn,tn,Hs]}],stroke:[{stroke:["none",...N()]}],"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 de(...t){return fh($s(t))}function hh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xa={},Ja={},$o={exports:{}},ei;function mh(){if(ei)return $o.exports;ei=1;var t=String,e=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 $o.exports=e(),$o.exports.createColors=e,$o.exports}var ti;function ph(){return ti||(ti=1,(function(t){var e={};Object.defineProperty(t,"__esModule",{value:!0});function n(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}n(t,{dim:function(){return l},default:function(){return c}});const a=r(mh());function r(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&e.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])}}})(Ja)),Ja}var ni;function gh(){return ni||(ni=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});const e=n(ph());function n(s){return s&&s.__esModule?s:{default:s}}function a({version:s,from:i,to:l}){e.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}}})(Xa)),Xa}var Qa,oi;function bh(){if(oi)return Qa;oi=1;let t=gh();return Qa=(t.__esModule?t:{default:t}).default,Qa}var yh=bh();const xh=hh(yh),ai=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,ri=$s,Wn=(t,e)=>n=>{var a;if((e==null?void 0:e.variants)==null)return ri(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:s}=e,i=Object.keys(r).map(d=>{const u=n==null?void 0:n[d],f=s==null?void 0:s[d];if(u===null)return null;const h=ai(u)||ai(f);return r[d][h]}),l=n&&Object.entries(n).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=e==null||(a=e.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(b=>{let[p,g]=b;return Array.isArray(g)?g.includes({...s,...l}[p]):{...s,...l}[p]===g})?[...d,f,h]:d},[]);return ri(t,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Ce=o.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.Primitive),{as:t.as,"as-child":t.asChild,class:o.normalizeClass(o.unref(de)(o.unref(_t)({variant:t.variant,size:t.size}),e.class))},{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),_t=Wn("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"}}),si=o.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:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),ii=o.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:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.TooltipContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("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",n.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),li=o.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipProvider),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),ci=o.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipTrigger),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),kh={key:1,class:"ml-1"},wh={class:"relative z-10"},_h={key:1,class:"ml-1"},Ch="rounded-lg 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",Bh=o.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},hoverBgColor:{default:""},borderColor:{default:""},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const e=o.useAttrs(),n=t,a=o.computed(()=>!!n.tooltip),r=o.computed(()=>n.visible??!0),s=o.computed(()=>{const O=String(n.variant||"default").toLowerCase();return O==="tonal"?"secondary":O==="elevated"?"default":O}),i=o.computed(()=>String(n.bgColor||"").toLowerCase()),l=o.computed(()=>String(n.type||"button").toLowerCase()),c=o.computed(()=>{const{class:O,...N}=e;return N}),d=o.computed(()=>de(e.class)),u=o.computed(()=>((d.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),f=o.computed(()=>n.size==="sm"?"h-9":n.size==="lg"?"h-11":n.size==="icon"?"h-10 w-10":"h-10"),h=o.computed(()=>n.size==="icon"?"":!n.text&&n.icon?"w-10":"w-28"),m=o.computed(()=>de("inline-flex items-center justify-center rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",f.value,h.value,u.value)),b=o.computed(()=>{const N=(d.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return N?N[0]:null}),p=o.computed(()=>{const N=(d.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return N?N[0]:null}),g=o.computed(()=>!!b.value),y=o.computed(()=>/\bborder-/.test(d.value??"")),B=o.computed(()=>/\bhover:/.test(d.value??"")),D=o.computed(()=>{const O=d.value??"";return s.value!=="outline"?O:O.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),M=o.ref(null),S=O=>{const N=O.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return N?{r:Number(N[1]),g:Number(N[2]),b:Number(N[3]),a:N[4]?Number(N[4]):1}:null},k=(O,N)=>{const H=S(O);if(!H)return O;const j=J=>Math.max(0,Math.min(255,Math.round(J)));return`rgba(${j(H.r*(1-N))}, ${j(H.g*(1-N))}, ${j(H.b*(1-N))}, ${H.a})`},C=O=>{if(globalThis.window===void 0)return null;const N=document.createElement("div");N.className=O,N.style.position="absolute",N.style.visibility="hidden",N.style.pointerEvents="none",N.style.width="1px",N.style.height="1px",document.body.appendChild(N);const H=globalThis.getComputedStyle(N).backgroundColor;return N.remove(),!H||H==="transparent"||H==="rgba(0, 0, 0, 0)"?null:H},x=[50,100,200,300,400,500,600,700,800,900,950],w=O=>{const N=x.indexOf(O);return N===-1?O:x[Math.min(x.length-1,N+2)]},E=(O,N)=>{const H=xh[O];if(!H)return null;if(typeof H=="string")return H;if(!N)return null;const j=H[N];return typeof j=="string"?j:null},A=(O,N=!1)=>{if(!O)return null;const H=N?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,j=O.match(H);return j?{colorName:j[1],shade:j[2]?Number.parseInt(j[2],10):null}:null},T=()=>{const O=b.value;if(!O){M.value=null;return}const N=A(O),H=N==null?void 0:N.colorName,j=(N==null?void 0:N.shade)??null,J=(H?E(H,j):null)??C(O);if(!J){M.value=null;return}let te;const ue=A(p.value,!0),fe=ue?E(ue.colorName,ue.shade??null):null;if(fe)te=fe;else if(H&&j){const pe=w(j);te=E(H,pe)??k(J,.2)}else te=k(J,.2);M.value={"--btn-color":J,"--btn-color-hover":te}};o.onMounted(()=>{T()}),o.watch([b,p],async()=>{await o.nextTick(),T()});const F=o.computed(()=>{const O=/\bdark:bg-/.test(d.value??"");return!g.value||s.value==="outline"||O?"":M.value?"dcode-btn--fill dcode-btn--fill-hover":B.value?"":"hover:brightness-90"}),L=o.computed(()=>{if(!g.value||s.value!=="outline")return"";const O=["dcode-btn--outline","dcode-btn--outline-hover"];return y.value||O.push("border"),!M.value&&!B.value&&O.push("hover:brightness-90"),O.join(" ")}),Y=o.computed(()=>M.value??void 0),z={primary:{bg:"bg-blue-600",text:"text-white",hover:"hover:bg-blue-700",border:"border-blue-600"},success:{bg:"bg-green-600",text:"text-white",hover:"hover:bg-green-700",border:"border-green-600"},warning:{bg:"bg-yellow-500",text:"text-white",hover:"hover:bg-yellow-600",border:"border-yellow-500"},danger:{bg:"bg-red-600",text:"text-white",hover:"hover:bg-red-700",border:"border-red-600"},info:{bg:"bg-cyan-600",text:"text-white",hover:"hover:bg-cyan-700",border:"border-cyan-600"},purple:{bg:"bg-purple-600",text:"text-white",hover:"hover:bg-purple-700",border:"border-purple-600"},pink:{bg:"bg-pink-600",text:"text-white",hover:"hover:bg-pink-700",border:"border-pink-600"},"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"}},v=o.computed(()=>{const O=[],N=i.value?z[i.value]:null;return N?(O.push(N.bg,N.text,N.hover),N.border&&s.value==="outline"&&O.push(N.border)):(i.value&&O.push(i.value),n.textColor&&O.push(n.textColor),n.hoverBgColor&&O.push(n.hoverBgColor),n.borderColor&&O.push(n.borderColor)),O.join(" ")}),W=o.computed(()=>de(Ch,D.value,F.value,L.value,v.value));return(O,N)=>r.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.skeleton?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(m.value),"aria-hidden":"true"},null,2)):(o.openBlock(),o.createBlock(o.unref(li),{key:1,"delay-duration":0},{default:o.withCtx(()=>[a.value?(o.openBlock(),o.createBlock(o.unref(si),{key:0},{default:o.withCtx(()=>[o.createVNode(o.unref(ci),{"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Ce),o.mergeProps({variant:s.value,size:n.size,disabled:n.disabled,type:l.value,class:W.value,style:Y.value},c.value),{default:o.withCtx(()=>[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-[18px] w-[18px]"})):o.createCommentVNode("",!0),n.text?(o.openBlock(),o.createElementBlock("span",kh,o.toDisplayString(n.text),1)):o.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),o.createVNode(o.unref(ii),{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:o.withCtx(()=>[o.createElementVNode("span",wh,o.toDisplayString(n.tooltip),1)]),_:1})]),_:1})):(o.openBlock(),o.createBlock(o.unref(Ce),o.mergeProps({key:1,variant:s.value,size:n.size,disabled:n.disabled,type:l.value,class:W.value,style:Y.value},c.value),{default:o.withCtx(()=>[o.renderSlot(O.$slots,"default",{},()=>[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-[18px] w-[18px]"})):o.createCommentVNode("",!0),n.text?(o.openBlock(),o.createElementBlock("span",_h,o.toDisplayString(n.text),1)):o.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):o.createCommentVNode("",!0)}}),Hn=(t,e)=>{const n=t.__vccOpts||t;for(const[a,r]of e)n[a]=r;return n},ht=Hn(Bh,[["__scopeId","data-v-fd0c8445"]]),Sh={key:0,class:"flex items-center justify-between mb-4"},Eh={class:"flex flex-col gap-1"},Dh={key:0,class:"text-lg font-semibold text-neutral-900 dark:text-neutral-50 leading-tight"},Vh={key:1,class:"text-sm text-neutral-500 dark:text-neutral-400"},Mh={key:0,class:"flex items-center gap-2"},Nh={class:"relative z-10"},Ph={key:1,class:"mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800"},Ah={name:"DCodeCard"},Za=o.defineComponent({...Ah,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const e=t,n=o.computed(()=>{switch(e.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)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["transition-shadow duration-300 dcode-card",[n.value,t.padding,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200 dark:border-neutral-800":t.border&&t.level===1},{"border-neutral-300 dark:border-neutral-700":t.border&&t.level!==1}]])},[t.title||a.$slots.header||a.$slots.actions?(o.openBlock(),o.createElementBlock("div",Sh,[o.createElementVNode("div",Eh,[o.renderSlot(a.$slots,"header",{},()=>[t.title?(o.openBlock(),o.createElementBlock("h3",Dh,o.toDisplayString(t.title),1)):o.createCommentVNode("",!0),t.subtitle?(o.openBlock(),o.createElementBlock("p",Vh,o.toDisplayString(t.subtitle),1)):o.createCommentVNode("",!0)])]),a.$slots.actions?(o.openBlock(),o.createElementBlock("div",Mh,[o.renderSlot(a.$slots,"actions")])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",Nh,[o.renderSlot(a.$slots,"default")]),a.$slots.footer?(o.openBlock(),o.createElementBlock("div",Ph,[o.renderSlot(a.$slots,"footer")])):o.createCommentVNode("",!0)],2))}});/*!
1
+ (function(le,o){typeof exports=="object"&&typeof module<"u"?o(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")):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"],o):(le=typeof globalThis<"u"?globalThis:le||self,o(le.DynamicUI={},le.Vue,le.LucideVueNext,le.RekaUI,le.VueUseCore,le.VueDatePicker,le.Uppy,le.UppyDashboard,le.UppyImageEditor,le.VueI18n,le.VueRouter))})(this,(function(le,o,ne,Q,ke,Fd,Rd,is,vd,wo,zn){"use strict";var e2=Object.defineProperty;var t2=(le,o,ne)=>o in le?e2(le,o,{enumerable:!0,configurable:!0,writable:!0,value:ne}):le[o]=ne;var ie=(le,o,ne)=>t2(le,typeof o!="symbol"?o+"":o,ne);var Ba;function Ld(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,a.get?a:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Qt=Ld(ne);let ct={};function Id(t){ct={...ct,...t}}function jd(){return ct.apiBaseUrl?ct.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function Wd(){const t={"Content-Type":"application/json",Accept:"application/json"};let e=null;if(ct.getAuthToken?e=ct.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?e=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(e=localStorage.getItem("token")||sessionStorage.getItem("token")),e&&(t.Authorization=`Bearer ${e}`),ct.getHeaders){const n=ct.getHeaders();return{...t,...n}}return t}function Hd(){ct.onUnauthorized&&ct.onUnauthorized()}async function ls(t,e,n){if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const a=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],r=(e||"").trim().toUpperCase(),s=a.includes(r)?r:"GET";a.includes(r)||console.warn(`[DynamicUI][useApi] HTTP method '${e}' tidak valid, fallback ke 'GET'.`);const i=jd(),l=t.startsWith("http")?t:`${i}${t}`,c={method:s,headers:Wd()};n&&!["GET","DELETE"].includes(s)&&(c.body=JSON.stringify(n));let d=l;if(n&&s==="GET"){const h=new URLSearchParams;Object.entries(n).forEach(([b,p])=>{p!=null&&h.append(b,String(p))});const m=h.toString();m&&(d=`${l}${l.includes("?")?"&":"?"}${m}`)}const u=await fetch(d,c);if(u.status===401&&Hd(),!u.ok){const h=await u.text();throw new Error(`HTTP ${u.status}: ${h}`)}return(u.headers.get("content-type")||"").includes("application/json")?u.json():{status:!0,data:await u.text()}}function at(){return{apiUrl:(n,a,r)=>ls(n,a,r),DCodeApi:(n,a,r,s)=>{let i=n,l=a,c=r;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):n&&a&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(a.toUpperCase())||(i=`${n.endsWith("/")?n.slice(0,-1):n}/${a}`,l="POST")),ls(i,l,c)}}}const yn=Math.min,Ke=Math.max,_o=Math.round,Co=Math.floor,dt=t=>({x:t,y:t}),qd={left:"right",right:"left",bottom:"top",top:"bottom"},Ud={start:"end",end:"start"};function cs(t,e,n){return Ke(t,yn(e,n))}function Fn(t,e){return typeof t=="function"?t(e):t}function zt(t){return t.split("-")[0]}function Rn(t){return t.split("-")[1]}function ds(t){return t==="x"?"y":"x"}function us(t){return t==="y"?"height":"width"}const Yd=new Set(["top","bottom"]);function kt(t){return Yd.has(zt(t))?"y":"x"}function fs(t){return ds(kt(t))}function Gd(t,e,n){n===void 0&&(n=!1);const a=Rn(t),r=fs(t),s=us(r);let i=r==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(i=Bo(i)),[i,Bo(i)]}function Kd(t){const e=Bo(t);return[Aa(t),e,Aa(e)]}function Aa(t){return t.replace(/start|end/g,e=>Ud[e])}const hs=["left","right"],ms=["right","left"],Xd=["top","bottom"],Jd=["bottom","top"];function Qd(t,e,n){switch(t){case"top":case"bottom":return n?e?ms:hs:e?hs:ms;case"left":case"right":return e?Xd:Jd;default:return[]}}function Zd(t,e,n,a){const r=Rn(t);let s=Qd(zt(t),n==="start",a);return r&&(s=s.map(i=>i+"-"+r),e&&(s=s.concat(s.map(Aa)))),s}function Bo(t){return t.replace(/left|right|bottom|top/g,e=>qd[e])}function eu(t){return{top:0,right:0,bottom:0,left:0,...t}}function tu(t){return typeof t!="number"?eu(t):{top:t,right:t,bottom:t,left:t}}function So(t){const{x:e,y:n,width:a,height:r}=t;return{width:a,height:r,top:n,left:e,right:e+a,bottom:n+r,x:e,y:n}}function ps(t,e,n){let{reference:a,floating:r}=t;const s=kt(e),i=fs(e),l=us(i),c=zt(e),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(Rn(e)){case"start":m[i]-=h*(n&&d?-1:1);break;case"end":m[i]+=h*(n&&d?-1:1);break}return m}async function nu(t,e){var n;e===void 0&&(e={});const{x:a,y:r,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Fn(e,t),b=tu(m),g=l[h?f==="floating"?"reference":"floating":f],y=So(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.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,D=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),M=await(s.isElement==null?void 0:s.isElement(D))?await(s.getScale==null?void 0:s.getScale(D))||{x:1,y:1}:{x:1,y:1},S=So(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:B,offsetParent:D,strategy:c}):B);return{top:(y.top-S.top+b.top)/M.y,bottom:(S.bottom-y.bottom+b.bottom)/M.y,left:(y.left-S.left+b.left)/M.x,right:(S.right-y.right+b.right)/M.x}}const ou=async(t,e,n)=>{const{placement:a="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,l=s.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(e));let d=await i.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=ps(d,a,c),h=a,m={},b=0;for(let g=0;g<l.length;g++){var p;const{name:y,fn:B}=l[g],{x:D,y:M,data:S,reset:k}=await B({x:u,y:f,initialPlacement:a,placement:h,strategy:r,middlewareData:m,rects:d,platform:{...i,detectOverflow:(p=i.detectOverflow)!=null?p:nu},elements:{reference:t,floating:e}});u=D??u,f=M??f,m={...m,[y]:{...m[y],...S}},k&&b<=50&&(b++,typeof k=="object"&&(k.placement&&(h=k.placement),k.rects&&(d=k.rects===!0?await i.getElementRects({reference:t,floating:e,strategy:r}):k.rects),{x:u,y:f}=ps(d,h,c)),g=-1)}return{x:u,y:f,placement:h,strategy:r,middlewareData:m}},au=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,a;const{placement:r,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...g}=Fn(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const y=zt(r),B=kt(l),D=zt(l)===l,M=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=h||(D||!p?[Bo(l)]:Kd(l)),k=b!=="none";!h&&k&&S.push(...Zd(l,p,b,M));const C=[l,...S],x=await c.detectOverflow(e,g),w=[];let E=((a=s.flip)==null?void 0:a.overflows)||[];if(u&&w.push(x[y]),f){const L=Gd(r,i,M);w.push(x[L[0]],x[L[1]])}if(E=[...E,{placement:r,overflows:w}],!w.every(L=>L<=0)){var A,T;const L=(((A=s.flip)==null?void 0:A.index)||0)+1,Y=C[L];if(Y&&(!(f==="alignment"?B!==kt(Y):!1)||E.every(W=>kt(W.placement)===B?W.overflows[0]>0:!0)))return{data:{index:L,overflows:E},reset:{placement:Y}};let z=(T=E.filter(v=>v.overflows[0]<=0).sort((v,W)=>v.overflows[1]-W.overflows[1])[0])==null?void 0:T.placement;if(!z)switch(m){case"bestFit":{var F;const v=(F=E.filter(W=>{if(k){const O=kt(W.placement);return O===B||O==="y"}return!0}).map(W=>[W.placement,W.overflows.filter(O=>O>0).reduce((O,N)=>O+N,0)]).sort((W,O)=>W[1]-O[1])[0])==null?void 0:F[0];v&&(z=v);break}case"initialPlacement":z=l;break}if(r!==z)return{reset:{placement:z}}}return{}}}},ru=new Set(["left","top"]);async function su(t,e){const{placement:n,platform:a,elements:r}=t,s=await(a.isRTL==null?void 0:a.isRTL(r.floating)),i=zt(n),l=Rn(n),c=kt(n)==="y",d=ru.has(i)?-1:1,u=s&&c?-1:1,f=Fn(e,t);let{mainAxis:h,crossAxis:m,alignmentAxis:b}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof b=="number"&&(m=l==="end"?b*-1:b),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const iu=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,a;const{x:r,y:s,placement:i,middlewareData:l}=e,c=await su(e,t);return i===((n=l.offset)==null?void 0:n.placement)&&(a=l.arrow)!=null&&a.alignmentOffset?{}:{x:r+c.x,y:s+c.y,data:{...c,placement:i}}}}},lu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:a,placement:r,platform:s}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:y=>{let{x:B,y:D}=y;return{x:B,y:D}}},...d}=Fn(t,e),u={x:n,y:a},f=await s.detectOverflow(e,d),h=kt(zt(r)),m=ds(h);let b=u[m],p=u[h];if(i){const y=m==="y"?"top":"left",B=m==="y"?"bottom":"right",D=b+f[y],M=b-f[B];b=cs(D,b,M)}if(l){const y=h==="y"?"top":"left",B=h==="y"?"bottom":"right",D=p+f[y],M=p-f[B];p=cs(D,p,M)}const g=c.fn({...e,[m]:b,[h]:p});return{...g,data:{x:g.x-n,y:g.y-a,enabled:{[m]:i,[h]:l}}}}}},cu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,a;const{placement:r,rects:s,platform:i,elements:l}=e,{apply:c=()=>{},...d}=Fn(t,e),u=await i.detectOverflow(e,d),f=zt(r),h=Rn(r),m=kt(r)==="y",{width:b,height:p}=s.floating;let g,y;f==="top"||f==="bottom"?(g=f,y=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(y=f,g=h==="end"?"top":"bottom");const B=p-u.top-u.bottom,D=b-u.left-u.right,M=yn(p-u[g],B),S=yn(b-u[y],D),k=!e.middlewareData.shift;let C=M,x=S;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(x=D),(a=e.middlewareData.shift)!=null&&a.enabled.y&&(C=B),k&&!h){const E=Ke(u.left,0),A=Ke(u.right,0),T=Ke(u.top,0),F=Ke(u.bottom,0);m?x=b-2*(E!==0||A!==0?E+A:Ke(u.left,u.right)):C=p-2*(T!==0||F!==0?T+F:Ke(u.top,u.bottom))}await c({...e,availableWidth:x,availableHeight:C});const w=await i.getDimensions(l.floating);return b!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Eo(){return typeof window<"u"}function Zt(t){return $a(t)?(t.nodeName||"").toLowerCase():"#document"}function Xe(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ut(t){var e;return(e=($a(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function $a(t){return Eo()?t instanceof Node||t instanceof Xe(t).Node:!1}function rt(t){return Eo()?t instanceof Element||t instanceof Xe(t).Element:!1}function ft(t){return Eo()?t instanceof HTMLElement||t instanceof Xe(t).HTMLElement:!1}function gs(t){return!Eo()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Xe(t).ShadowRoot}const du=new Set(["inline","contents"]);function vn(t){const{overflow:e,overflowX:n,overflowY:a,display:r}=st(t);return/auto|scroll|overlay|hidden|clip/.test(e+a+n)&&!du.has(r)}const uu=new Set(["table","td","th"]);function fu(t){return uu.has(Zt(t))}const hu=[":popover-open",":modal"];function Do(t){return hu.some(e=>{try{return t.matches(e)}catch{return!1}})}const mu=["transform","translate","scale","rotate","perspective"],pu=["transform","translate","scale","rotate","perspective","filter"],gu=["paint","layout","strict","content"];function Ta(t){const e=Oa(),n=rt(t)?st(t):t;return mu.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||pu.some(a=>(n.willChange||"").includes(a))||gu.some(a=>(n.contain||"").includes(a))}function bu(t){let e=Ft(t);for(;ft(e)&&!xn(e);){if(Ta(e))return e;if(Do(e))return null;e=Ft(e)}return null}function Oa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yu=new Set(["html","body","#document"]);function xn(t){return yu.has(Zt(t))}function st(t){return Xe(t).getComputedStyle(t)}function Vo(t){return rt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ft(t){if(Zt(t)==="html")return t;const e=t.assignedSlot||t.parentNode||gs(t)&&t.host||ut(t);return gs(e)?e.host:e}function bs(t){const e=Ft(t);return xn(e)?t.ownerDocument?t.ownerDocument.body:t.body:ft(e)&&vn(e)?e:bs(e)}function Ln(t,e,n){var a;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=bs(t),s=r===((a=t.ownerDocument)==null?void 0:a.body),i=Xe(r);if(s){const l=za(i);return e.concat(i,i.visualViewport||[],vn(r)?r:[],l&&n?Ln(l):[])}return e.concat(r,Ln(r,[],n))}function za(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ys(t){const e=st(t);let n=parseFloat(e.width)||0,a=parseFloat(e.height)||0;const r=ft(t),s=r?t.offsetWidth:n,i=r?t.offsetHeight:a,l=_o(n)!==s||_o(a)!==i;return l&&(n=s,a=i),{width:n,height:a,$:l}}function Fa(t){return rt(t)?t:t.contextElement}function kn(t){const e=Fa(t);if(!ft(e))return dt(1);const n=e.getBoundingClientRect(),{width:a,height:r,$:s}=ys(e);let i=(s?_o(n.width):n.width)/a,l=(s?_o(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const xu=dt(0);function xs(t){const e=Xe(t);return!Oa()||!e.visualViewport?xu:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ku(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Xe(t)?!1:e}function en(t,e,n,a){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),s=Fa(t);let i=dt(1);e&&(a?rt(a)&&(i=kn(a)):i=kn(t));const l=ku(s,n,a)?xs(s):dt(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=Xe(s),m=a&&rt(a)?Xe(a):a;let b=h,p=za(b);for(;p&&a&&m!==b;){const g=kn(p),y=p.getBoundingClientRect(),B=st(p),D=y.left+(p.clientLeft+parseFloat(B.paddingLeft))*g.x,M=y.top+(p.clientTop+parseFloat(B.paddingTop))*g.y;c*=g.x,d*=g.y,u*=g.x,f*=g.y,c+=D,d+=M,b=Xe(p),p=za(b)}}return So({width:u,height:f,x:c,y:d})}function Mo(t,e){const n=Vo(t).scrollLeft;return e?e.left+n:en(ut(t)).left+n}function ks(t,e){const n=t.getBoundingClientRect(),a=n.left+e.scrollLeft-Mo(t,n),r=n.top+e.scrollTop;return{x:a,y:r}}function wu(t){let{elements:e,rect:n,offsetParent:a,strategy:r}=t;const s=r==="fixed",i=ut(a),l=e?Do(e.floating):!1;if(a===i||l&&s)return n;let c={scrollLeft:0,scrollTop:0},d=dt(1);const u=dt(0),f=ft(a);if((f||!f&&!s)&&((Zt(a)!=="body"||vn(i))&&(c=Vo(a)),ft(a))){const m=en(a);d=kn(a),u.x=m.x+a.clientLeft,u.y=m.y+a.clientTop}const h=i&&!f&&!s?ks(i,c):dt(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:n.y*d.y-c.scrollTop*d.y+u.y+h.y}}function _u(t){return Array.from(t.getClientRects())}function Cu(t){const e=ut(t),n=Vo(t),a=t.ownerDocument.body,r=Ke(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),s=Ke(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let i=-n.scrollLeft+Mo(t);const l=-n.scrollTop;return st(a).direction==="rtl"&&(i+=Ke(e.clientWidth,a.clientWidth)-r),{width:r,height:s,x:i,y:l}}const ws=25;function Bu(t,e){const n=Xe(t),a=ut(t),r=n.visualViewport;let s=a.clientWidth,i=a.clientHeight,l=0,c=0;if(r){s=r.width,i=r.height;const u=Oa();(!u||u&&e==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}const d=Mo(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,b=Math.abs(a.clientWidth-f.clientWidth-m);b<=ws&&(s-=b)}else d<=ws&&(s+=d);return{width:s,height:i,x:l,y:c}}const Su=new Set(["absolute","fixed"]);function Eu(t,e){const n=en(t,!0,e==="fixed"),a=n.top+t.clientTop,r=n.left+t.clientLeft,s=ft(t)?kn(t):dt(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=r*s.x,d=a*s.y;return{width:i,height:l,x:c,y:d}}function _s(t,e,n){let a;if(e==="viewport")a=Bu(t,n);else if(e==="document")a=Cu(ut(t));else if(rt(e))a=Eu(e,n);else{const r=xs(t);a={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return So(a)}function Cs(t,e){const n=Ft(t);return n===e||!rt(n)||xn(n)?!1:st(n).position==="fixed"||Cs(n,e)}function Du(t,e){const n=e.get(t);if(n)return n;let a=Ln(t,[],!1).filter(l=>rt(l)&&Zt(l)!=="body"),r=null;const s=st(t).position==="fixed";let i=s?Ft(t):t;for(;rt(i)&&!xn(i);){const l=st(i),c=Ta(i);!c&&l.position==="fixed"&&(r=null),(s?!c&&!r:!c&&l.position==="static"&&!!r&&Su.has(r.position)||vn(i)&&!c&&Cs(t,i))?a=a.filter(u=>u!==i):r=l,i=Ft(i)}return e.set(t,a),a}function Vu(t){let{element:e,boundary:n,rootBoundary:a,strategy:r}=t;const i=[...n==="clippingAncestors"?Do(e)?[]:Du(e,this._c):[].concat(n),a],l=i[0],c=i.reduce((d,u)=>{const f=_s(e,u,r);return d.top=Ke(f.top,d.top),d.right=yn(f.right,d.right),d.bottom=yn(f.bottom,d.bottom),d.left=Ke(f.left,d.left),d},_s(e,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Mu(t){const{width:e,height:n}=ys(t);return{width:e,height:n}}function Nu(t,e,n){const a=ft(e),r=ut(e),s=n==="fixed",i=en(t,!0,s,e);let l={scrollLeft:0,scrollTop:0};const c=dt(0);function d(){c.x=Mo(r)}if(a||!a&&!s)if((Zt(e)!=="body"||vn(r))&&(l=Vo(e)),a){const m=en(e,!0,s,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else r&&d();s&&!a&&r&&d();const u=r&&!a&&!s?ks(r,l):dt(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 Ra(t){return st(t).position==="static"}function Bs(t,e){if(!ft(t)||st(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return ut(t)===n&&(n=n.ownerDocument.body),n}function Ss(t,e){const n=Xe(t);if(Do(t))return n;if(!ft(t)){let r=Ft(t);for(;r&&!xn(r);){if(rt(r)&&!Ra(r))return r;r=Ft(r)}return n}let a=Bs(t,e);for(;a&&fu(a)&&Ra(a);)a=Bs(a,e);return a&&xn(a)&&Ra(a)&&!Ta(a)?n:a||bu(t)||n}const Pu=async function(t){const e=this.getOffsetParent||Ss,n=this.getDimensions,a=await n(t.floating);return{reference:Nu(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Au(t){return st(t).direction==="rtl"}const $u={convertOffsetParentRelativeRectToViewportRelativeRect:wu,getDocumentElement:ut,getClippingRect:Vu,getOffsetParent:Ss,getElementRects:Pu,getClientRects:_u,getDimensions:Mu,getScale:kn,isElement:rt,isRTL:Au};function Es(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Tu(t,e){let n=null,a;const r=ut(t);function s(){var l;clearTimeout(a),(l=n)==null||l.disconnect(),n=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||e(),!h||!m)return;const b=Co(f),p=Co(r.clientWidth-(u+h)),g=Co(r.clientHeight-(f+m)),y=Co(u),D={rootMargin:-b+"px "+-p+"px "+-g+"px "+-y+"px",threshold:Ke(0,yn(1,c))||1};let M=!0;function S(k){const C=k[0].intersectionRatio;if(C!==c){if(!M)return i();C?i(!1,C):a=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!Es(d,t.getBoundingClientRect())&&i(),M=!1}try{n=new IntersectionObserver(S,{...D,root:r.ownerDocument})}catch{n=new IntersectionObserver(S,D)}n.observe(t)}return i(!0),s}function va(t,e,n,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=Fa(t),u=r||s?[...d?Ln(d):[],...Ln(e)]:[];u.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});const f=d&&l?Tu(d,n):null;let h=-1,m=null;i&&(m=new ResizeObserver(y=>{let[B]=y;B&&B.target===d&&m&&(m.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var D;(D=m)==null||D.observe(e)})),n()}),d&&!c&&m.observe(d),m.observe(e));let b,p=c?en(t):null;c&&g();function g(){const y=en(t);p&&!Es(p,y)&&n(),p=y,b=requestAnimationFrame(g)}return n(),()=>{var y;u.forEach(B=>{r&&B.removeEventListener("scroll",n),s&&B.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(b)}}const La=iu,Ia=lu,ja=au,Wa=cu,Ou=(t,e,n)=>{const a=new Map,r={platform:$u,...n},s={...r.platform,_c:a};return ou(t,e,{...r,platform:s})};function zu(t){return t!=null&&typeof t=="object"&&"$el"in t}function Ds(t){if(zu(t)){const e=t.$el;return $a(e)&&Zt(e)==="#comment"?null:e}return t}function In(t){return typeof t=="function"?t():o.unref(t)}function Vs(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ms(t,e){const n=Vs(t);return Math.round(e*n)/n}function Ha(t,e,n){n===void 0&&(n={});const a=n.whileElementsMounted,r=o.computed(()=>{var C;return(C=In(n.open))!=null?C:!0}),s=o.computed(()=>In(n.middleware)),i=o.computed(()=>{var C;return(C=In(n.placement))!=null?C:"bottom"}),l=o.computed(()=>{var C;return(C=In(n.strategy))!=null?C:"absolute"}),c=o.computed(()=>{var C;return(C=In(n.transform))!=null?C:!0}),d=o.computed(()=>Ds(t.value)),u=o.computed(()=>Ds(e.value)),f=o.ref(0),h=o.ref(0),m=o.ref(l.value),b=o.ref(i.value),p=o.shallowRef({}),g=o.ref(!1),y=o.computed(()=>{const C={position:m.value,left:"0",top:"0"};if(!u.value)return C;const x=Ms(u.value,f.value),w=Ms(u.value,h.value);return c.value?{...C,transform:"translate("+x+"px, "+w+"px)",...Vs(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:x+"px",top:w+"px"}});let B;function D(){if(d.value==null||u.value==null)return;const C=r.value;Ou(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(x=>{f.value=x.x,h.value=x.y,m.value=x.strategy,b.value=x.placement,p.value=x.middlewareData,g.value=C!==!1})}function M(){typeof B=="function"&&(B(),B=void 0)}function S(){if(M(),a===void 0){D();return}if(d.value!=null&&u.value!=null){B=a(d.value,u.value,D);return}}function k(){r.value||(g.value=!1)}return o.watch([s,i,l,r],D,{flush:"sync"}),o.watch([d,u],S,{flush:"sync"}),o.watch(r,k,{flush:"sync"}),o.getCurrentScope()&&o.onScopeDispose(M),{x:o.shallowReadonly(f),y:o.shallowReadonly(h),strategy:o.shallowReadonly(m),placement:o.shallowReadonly(b),middlewareData:o.shallowReadonly(p),isPositioned:o.shallowReadonly(g),floatingStyles:y,update:D}}const Fu=["aria-busy"],Ru={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},vu=["for"],Lu={key:0,class:"ml-1 text-destructive"},Iu={class:"relative"},ju={key:0,class:"flex items-center text-gray-500 gap-2"},Wu=["id","placeholder","disabled","readonly","value"],Hu={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},qu=["disabled"],Uu={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},Yu=["onMouseenter","onClick"],Gu={key:0},Ku={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Xu={key:0},Ju={key:1},Qu={key:2},Zu={key:1,class:"mt-1 text-xs text-red-600"},qa=o.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:e}){const n=t,a=e,r=o.useAttrs(),s=o.computed(()=>r.label??void 0),i=R=>{const Z=r[R];return Z===""||Z===!0||Z==="true"||Z===1||Z==="1"},l=o.ref(!1),c=o.computed(()=>n.itemTitle||r["item-title"]||r.itemTitle||"name"),d=o.computed(()=>n.itemValue||r["item-value"]||r.itemValue||"id"),u=o.computed(()=>n.disabled),f=o.computed(()=>i("required")),h=o.computed(()=>i("readonly")),m=o.computed(()=>n.returnObject||i("return-object")||i("returnObject")),b=o.computed(()=>f.value||i("aria-required")),p=o.computed(()=>n.error||n.errorMessage||r["error-message"]),g=o.computed(()=>r.placeholder??""),y=o.computed(()=>{const R=r.minChars??r["min-chars"];if(R==null||R==="")return 0;const Z=typeof R=="number"?R:Number.parseInt(String(R),10);return Number.isFinite(Z)&&Z>0?Z:0}),B=o.computed(()=>{const R=r.rules;return Array.isArray(R)?R:[]}),D=o.computed(()=>{const R=r.id||r.label;return R?`app-autocomplete-${R}-${Math.random().toString(36).slice(2,7)}`:void 0}),M=o.ref(n.modelValue),S=o.ref([]),k=o.ref(!1),C=o.ref(!1),x=o.computed(()=>r.items),w=o.computed(()=>{const R=L.value;return R.apiModule&&R.apiAction||R.apiUrl||n.fetchItems?S.value:x.value??[]}),E=o.computed(()=>!!r.loading),A=o.computed(()=>E.value||k.value),T=o.computed(()=>{const{label:R,items:Z,loading:ce,rules:Ve,"item-title":Ae,"item-value":G,itemTitle:ee,itemValue:ae,minChars:me,"min-chars":$e,clearable:lt,required:Bd,"aria-required":qe,disabled:Sd,readonly:Sa,visible:Ed,"return-object":Ea,returnObject:Dd,class:as,"fetch-items":Vd,fetchItems:Md,error:rs,errorMessage:Nd,"error-message":Pd,...Da}=r||{};return Da}),F=()=>{if(n.apiOptions)return typeof n.apiOptions=="function"?n.apiOptions():n.apiOptions},L=o.computed(()=>{const R=n.endpoint||{};return{apiModule:n.apiModule||R.apiModule,apiAction:n.apiAction||R.apiAction,apiUrl:R.apiUrl,apiMethod:R.apiMethod||"GET"}}),Y=o.ref(null),z=o.ref(null),v=o.ref(null),{floatingStyles:W}=Ha(z,v,{placement:"bottom-start",whileElementsMounted:va,middleware:[La(4),ja(),Ia(),Wa({apply({rects:R,elements:Z,availableHeight:ce}){Object.assign(Z.floating.style,{width:`${R.reference.width}px`,maxHeight:`${ce}px`})}})]}),O=o.ref(!1),N=o.ref(""),H=o.ref(-1),j=o.ref(null),J=o.computed(()=>!y.value||(N.value||"").trim().length>=y.value?"":`Ketik minimal ${y.value} karakter`),te=R=>{if(R==null)return"";if(typeof R=="string"||typeof R=="number")return String(R);const Z=c.value;return typeof Z=="function"?Z(R):(R==null?void 0:R[Z])??(R==null?void 0:R.name)??(R==null?void 0:R.nama)??(R==null?void 0:R.label)??(R==null?void 0:R.title)??"-"},ue=R=>{if(R==null)return null;if(typeof R=="string"||typeof R=="number")return R;const Z=d.value;return typeof Z=="function"?Z(R):(R==null?void 0:R[Z])??(R==null?void 0:R.id)??(R==null?void 0:R.value)??(R==null?void 0:R.code)??null},fe=o.computed(()=>{const R=M.value;if(R==null||R==="")return"";if(Array.isArray(R))return R.length?R.map(Ve=>{if(m.value&&typeof Ve=="object"||typeof Ve=="object")return te(Ve);const Ae=w.value.find(G=>ue(G)==Ve);return Ae?te(Ae):String(Ve)}).join(", "):"";if(typeof R=="object")return te(R);const Z=w.value.find(ce=>ue(ce)==R);return Z?te(Z):String(R)}),pe=o.computed(()=>{const R=w.value||[],Z=(N.value||"").trim().toLowerCase(),ce=(fe.value||"").toLowerCase(),Ve=!Z||Z===ce;let Ae=R;if(Ve||(Ae=R.filter(G=>te(G).toLowerCase().includes(Z))),Ae.length>0){const G=ee=>{const ae=ue(ee);return Array.isArray(M.value)?M.value.some(me=>me==ae):M.value==ae};Ae=[...Ae].sort((ee,ae)=>{const me=G(ee),$e=G(ae);return me&&!$e?-1:!me&&$e?1:0})}return Ae}),Le=R=>Array.isArray(R)?R.length===0:R==null||R==="",be=R=>{if(j.value=null,f.value&&Le(R)&&!B.value.length)return j.value="This field is required",!1;for(const Z of B.value){const ce=Z(R);if(ce===!1)return j.value="Invalid value",!1;if(typeof ce=="string")return j.value=ce,!1}return!0},U=async()=>{if(u.value||h.value)return;O.value=!0,H.value=pe.value.length?0:-1,N.value=fe.value||"";const R=L.value,Z=R.apiModule&&R.apiAction||R.apiUrl||n.fetchItems;n.autoFetchOnOpen&&Z&&!C.value&&(await At(),H.value=pe.value.length?0:-1)},P=()=>{O.value=!1,H.value=-1,N.value=fe.value||""},q=R=>{const Z=m.value?R:ue(R);let ce=Z;Array.isArray(M.value)&&(ce=[Z]),M.value=ce,a("update:modelValue",ce),j.value=null,be(ce),N.value=te(R),P()},oe=()=>{S.value=[],C.value=!1,M.value=Array.isArray(M.value)?[]:null,a("update:modelValue",M.value),N.value="",j.value=null},he=()=>{l.value=!0,oe(),P(),setTimeout(()=>{l.value=!1},0)},ze=R=>{if(u.value||h.value)return;const Z=R.target.value;N.value=Z,j.value&&(j.value=null),O.value||(O.value=!0),H.value=pe.value.length?0:-1;const ce=L.value.apiModule&&L.value.apiAction||L.value.apiUrl||n.fetchItems;n.autoFetchOnOpen&&ce&&!A.value&&!C.value&&At()},ot=R=>{var ce;if(u.value||h.value)return;const Z={ArrowDown:()=>{if(R.preventDefault(),!O.value){U();return}pe.value.length&&(H.value=Math.min(H.value+1,pe.value.length-1))},ArrowUp:()=>{!O.value||!pe.value.length||(R.preventDefault(),H.value=Math.max(H.value-1,0))},Enter:()=>{if(!O.value)return;R.preventDefault();const Ve=pe.value[H.value];Ve&&q(Ve)},Escape:()=>{R.preventDefault(),P()},Tab:()=>{P()}};(ce=Z[R.key])==null||ce.call(Z)},At=async()=>{const R=L.value;if(R.apiModule&&R.apiAction||R.apiUrl||n.fetchItems){k.value=!0;try{let ce;if(n.fetchItems){const Ve=F()||{},Ae={page:1,perPage:100,search:(N.value||"").trim(),...Ve,...n.apiParams},G=await n.fetchItems(Ae),ee=(G==null?void 0:G.data)??G;ce=(ee==null?void 0:ee.data)??ee}else{const Ae=at().DCodeApi;if(typeof Ae!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const ee={page:1,perPage:100,...F()||{},...n.apiParams};let ae;R.apiUrl?ae=await Ae("","",ee,{_url:R.apiUrl,_method:R.apiMethod||"POST"}):ae=await Ae(R.apiModule,R.apiAction,ee);const me=(ae==null?void 0:ae.data)??ae;ce=(me==null?void 0:me.data)??me}S.value=Array.isArray(ce)?ce:[],C.value=!0}catch(ce){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",ce),j.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(ce==null?void 0:ce.message)||(ce==null?void 0:ce.toString())||"Failed to load options"}`,S.value=[],C.value=!0}finally{k.value=!1}}},$t=R=>{const Z=ue(R);return m.value?M.value?Array.isArray(M.value)?M.value.some(ce=>ue(ce)==Z):ue(M.value)==Z:!1:Array.isArray(M.value)?M.value.some(ce=>ce==Z):M.value==Z};o.watch(()=>[F(),L.value,n.apiParams],([R,Z,ce],[Ve,Ae,G])=>{const ee=L.value;if(!(ee.apiModule&&ee.apiAction||ee.apiUrl||n.fetchItems)){oe();return}const me=JSON.stringify(R??null)===JSON.stringify(Ve??null),$e=JSON.stringify(ce??null)===JSON.stringify(G??null);me&&$e||(oe(),$e||At())},{deep:!0}),o.watch(()=>n.modelValue,(R,Z)=>{M.value=R,!l.value&&(R==null||R==="")&&Z!=null&&n.apiModule&&n.apiAction&&(S.value=[],C.value=!1),N.value=fe.value||""},{immediate:!0});const bn=L.value;(bn.apiModule&&bn.apiAction||bn.apiUrl||n.fetchItems)&&(n.autoFetchOnMount||!Le(n.modelValue))&&At();const Qe=R=>{const Z=Y.value,ce=v.value,Ve=R.target;Z&&Z.contains(Ve)||ce&&ce.contains(Ve)||O.value&&P()},Tt=o.computed(()=>{const R=n.modelValue;return R==null?!1:typeof R=="string"?R.trim().length>0:Array.isArray(R)?R.length>0:typeof R=="object"?Object.keys(R).length>0:!0}),ko=o.computed(()=>!!n.clearable&&Tt.value&&!n.disabled);return o.onMounted(()=>{document.addEventListener("mousedown",Qe)}),o.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Qe)}),(R,Z)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:Y,class:o.normalizeClass(["w-full",o.unref(r).class]),"aria-busy":t.skeleton},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",Ru)):o.createCommentVNode("",!0),Z[6]||(Z[6]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createElementBlock("label",{key:0,for:D.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[o.createTextVNode(o.toDisplayString(s.value)+" ",1),b.value?(o.openBlock(),o.createElementBlock("span",Lu,"*")):o.createCommentVNode("",!0)],8,vu)):o.createCommentVNode("",!0),o.createElementVNode("div",Iu,[o.createElementVNode("div",{ref_key:"reference",ref:z,class:o.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||p.value?"border-red-500 focus-within:ring-red-500":""]])},[n.icon||R.$slots["prepend-inner"]?(o.openBlock(),o.createElementBlock("div",ju,[o.renderSlot(R.$slots,"prepend-inner",{},()=>[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-4 w-4"})):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),o.createElementVNode("input",o.mergeProps(T.value,{id:D.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||h.value?"cursor-not-allowed":"cursor-text"],placeholder:g.value,disabled:u.value,readonly:h.value,value:O.value?N.value:fe.value||N.value,onFocus:Z[0]||(Z[0]=()=>{O.value||U()}),onClick:Z[1]||(Z[1]=()=>{O.value||U()}),onInput:ze,onKeydown:ot,onBlur:Z[2]||(Z[2]=()=>be(M.value))}),null,16,Wu),A.value?(o.openBlock(),o.createElementBlock("svg",Hu,[...Z[7]||(Z[7]=[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):ko.value?(o.openBlock(),o.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:Z[3]||(Z[3]=o.withModifiers(()=>{},["prevent"])),onClick:o.withModifiers(he,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(o.openBlock(),o.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:Z[4]||(Z[4]=ce=>O.value?P():U()),"aria-label":"Toggle"},[o.createVNode(o.unref(ne.ChevronDown),{class:o.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":O.value}])},null,8,["class"])],8,qu))],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[O.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"floating",ref:v,style:o.normalizeStyle(o.unref(W)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[o.createElementVNode("div",Uu,[pe.value.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(pe.value,(ce,Ve)=>(o.openBlock(),o.createElementBlock("button",{key:ue(ce)??Ve,type:"button",class:o.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Ve===H.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ae=>H.value=Ve,onMousedown:Z[5]||(Z[5]=o.withModifiers(()=>{},["prevent"])),onClick:Ae=>q(ce)},[o.createTextVNode(o.toDisplayString(te(ce))+" ",1),$t(ce)?(o.openBlock(),o.createElementBlock("span",Gu," ✓ ")):o.createCommentVNode("",!0)],42,Yu))),128)):o.renderSlot(R.$slots,"no-data",{key:1},()=>[o.createElementVNode("div",Ku,[A.value?(o.openBlock(),o.createElementBlock("span",Xu,"Loading data…")):J.value?(o.openBlock(),o.createElementBlock("span",Ju,o.toDisplayString(J.value),1)):(o.openBlock(),o.createElementBlock("span",Qu,"No data available"))])])])],4)):o.createCommentVNode("",!0)]))]),j.value||p.value?(o.openBlock(),o.createElementBlock("p",Zu,o.toDisplayString(j.value||p.value),1)):o.createCommentVNode("",!0)],64))],10,Fu)),[[o.vShow,t.visible]])}}),ef=["aria-busy"],tf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},nf=["for"],of={key:0,class:"ml-1 text-destructive"},af={class:"relative"},rf={key:0,class:"flex items-center text-gray-500 gap-2"},sf=["id","placeholder","disabled","value"],lf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},cf=["disabled"],df={key:0,class:"p-3 space-y-2"},uf=["onMouseenter","onClick"],ff={class:"flex items-center space-x-3"},hf={class:"flex-1"},mf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},pf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},gf={key:0},bf={key:2,class:"p-3 text-center"},yf={class:"inline-flex items-center space-x-2"},xf={class:"text-sm text-gray-500"},kf={key:3,class:"p-3 text-center"},wf={class:"text-xs text-gray-400"},_f={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Cf={key:1,class:"mt-1 text-xs text-red-600"},Bf={key:2,class:"mt-1 text-xs text-gray-500"},Ns=o.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:e}){const n=t,a=e,r=o.useAttrs(),s=o.ref(),i=o.ref(),l=o.ref(),c=o.ref(),d=o.ref(),u=o.computed(()=>{const H=n.label||n.placeholder;return H?`app-infinite-autocomplete-${H}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=o.ref(""),h=o.ref([]),m=o.ref(!1),b=o.ref(!1),p=o.ref(-1),g=o.ref(1),y=o.ref(!0),B=o.ref(0),D=o.ref(),{floatingStyles:M}=Ha(c,d,{placement:"bottom-start",whileElementsMounted:va,middleware:[La(4),ja(),Ia(),Wa({apply({rects:H,elements:j}){Object.assign(j.floating.style,{width:`${H.reference.width}px`})}})]});o.computed(()=>({"opacity-50 pointer-events-none":n.disabled,relative:!0})),o.computed(()=>({"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500":!0,"pl-10":n.icon,"pr-10":n.clearable&&n.modelValue||m.value,"bg-gray-50 text-gray-500":n.disabled,"border-red-500 text-red-900 placeholder-red-300 focus:ring-red-500 focus:border-red-500":n.error}));const S=o.computed(()=>f.value?h.value.filter(H=>w(H).toLowerCase().includes(f.value.toLowerCase())):h.value),k=o.computed(()=>{if(b.value&&f.value)return f.value;if(n.modelValue){if(n.returnObject)return w(n.modelValue);{const H=h.value.find(j=>E(j)===n.modelValue);return H?w(H):String(n.modelValue)}}return""}),C=()=>{b.value=!0},x=()=>{b.value=!1},w=H=>typeof n.itemTitle=="function"?n.itemTitle(H):H[n.itemTitle]||"",E=H=>typeof n.itemValue=="function"?n.itemValue(H):H[n.itemValue]||H,A=H=>n.itemSubtitle?typeof n.itemSubtitle=="function"?n.itemSubtitle(H):H[n.itemSubtitle]||"":"",T=H=>n.modelValue?n.returnObject?E(H)===E(n.modelValue):E(H)===n.modelValue:!1,F=H=>{var J;const j=n.returnObject?H:E(H);a("update:modelValue",j),a("select",H),b.value=!1,f.value="",(J=s.value)==null||J.blur()},L=()=>{var H;a("update:modelValue",null),f.value="",(H=s.value)==null||H.focus()},Y=H=>{b.value=!0,a("focus",H),n.autoFetchOnOpen&&!m.value&&(n.refreshOnOpen||h.value.length===0)&&N(!0)},z=H=>{setTimeout(()=>{b.value=!1,a("blur",H)},200)},v=H=>{const j=H.target;f.value=j.value,D.value&&clearTimeout(D.value),D.value=setTimeout(()=>{a("search",f.value),g.value=1,y.value=!0,N(!0)},n.debounceMs)},W=H=>{if(b.value)switch(H.key){case"ArrowDown":H.preventDefault(),p.value=Math.min(p.value+1,S.value.length-1);break;case"ArrowUp":H.preventDefault(),p.value=Math.max(p.value-1,0);break;case"Enter":H.preventDefault(),p.value>=0&&S.value[p.value]&&F(S.value[p.value]);break;case"Escape":b.value=!1;break}},O=H=>{if(!y.value||m.value)return;const j=H.target,{scrollTop:J,scrollHeight:te,clientHeight:ue}=j;J+ue>=te-n.threshold&&N()},N=async(H=!1)=>{var j,J;if(!m.value){m.value=!0;try{let te=[];if(n.fetchItems)te=await n.fetchItems();else{const ue=at(),fe=((j=n.endpoint)==null?void 0:j.apiModule)||n.apiModule,pe=((J=n.endpoint)==null?void 0:J.apiAction)||n.apiAction;if(!fe||!pe)throw new Error("API module and action are required");const Le={page:H?1:g.value,pageSize:n.pageSize,search:f.value,...n.apiParams},be=await ue.apiUrl(`/${fe}/${pe}`,"GET",Le);te=be.data||be.items||be||[],B.value=be.total||be.totalItems||te.length}H?(h.value=te,g.value=1):(h.value.push(...te),g.value++),y.value=te.length>=n.pageSize,y.value||a("end-of-results"),a("load-more",{items:te,page:g.value,hasMore:y.value,total:B.value})}catch(te){console.error("Error fetching items:",te),a("error",te)}finally{m.value=!1}}};return o.onMounted(()=>{n.autoFetchOnMount&&N()}),o.onUnmounted(()=>{D.value&&clearTimeout(D.value)}),o.watch(()=>n.modelValue,H=>{H||(f.value="")}),(H,j)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:l,class:o.normalizeClass(["w-full",o.unref(r).class]),"aria-busy":t.skeleton},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.label?(o.openBlock(),o.createElementBlock("div",tf)):o.createCommentVNode("",!0),j[3]||(j[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",of,"*")):o.createCommentVNode("",!0)],8,nf)):o.createCommentVNode("",!0),o.createElementVNode("div",af,[o.createElementVNode("div",{ref_key:"reference",ref:c,class:o.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",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[n.icon?(o.openBlock(),o.createElementBlock("div",rf,[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-4 w-4"})):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("input",o.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",t.disabled?"cursor-not-allowed":"cursor-text"],placeholder:t.placeholder,disabled:t.disabled,value:k.value,onFocus:Y,onBlur:z,onInput:v,onKeydown:W}),null,16,sf),m.value?(o.openBlock(),o.createElementBlock("svg",lf,[...j[4]||(j[4]=[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),o.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?(o.openBlock(),o.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]=o.withModifiers(()=>{},["prevent"])),onClick:o.withModifiers(L,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(o.openBlock(),o.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:j[1]||(j[1]=J=>b.value?x():C()),"aria-label":"Toggle"},[o.createVNode(o.unref(ne.ChevronDown),{class:o.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":b.value}])},null,8,["class"])],8,cf))],2),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[b.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:o.normalizeStyle(o.unref(M)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-gray-700 dark:bg-neutral-900"},[o.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:O},[m.value&&h.value.length===0?(o.openBlock(),o.createElementBlock("div",df,[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(5,J=>o.createElementVNode("div",{key:J,class:"flex items-center space-x-3"},[...j[5]||(j[5]=[o.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),o.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):S.value.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(S.value,(J,te)=>(o.openBlock(),o.createElementBlock("button",{key:E(J)??te,type:"button",class:o.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",te===p.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ue=>p.value=te,onMousedown:j[2]||(j[2]=o.withModifiers(()=>{},["prevent"])),onClick:ue=>F(J)},[o.renderSlot(H.$slots,"item",{item:J,index:te},()=>[o.createElementVNode("div",ff,[o.createElementVNode("div",hf,[o.createElementVNode("div",mf,o.toDisplayString(w(J)),1),t.itemSubtitle?(o.openBlock(),o.createElementBlock("div",pf,o.toDisplayString(A(J)),1)):o.createCommentVNode("",!0)])])]),T(J)?(o.openBlock(),o.createElementBlock("span",gf," ✓ ")):o.createCommentVNode("",!0)],42,uf))),128)):o.createCommentVNode("",!0),m.value&&h.value.length>0?(o.openBlock(),o.createElementBlock("div",bf,[o.createElementVNode("div",yf,[j[6]||(j[6]=o.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),o.createElementVNode("span",xf,o.toDisplayString(t.loadingText),1)])])):o.createCommentVNode("",!0),!y.value&&h.value.length>0?(o.openBlock(),o.createElementBlock("div",kf,[o.createElementVNode("div",wf,o.toDisplayString(t.endOfResultsText),1)])):!m.value&&h.value.length===0?(o.openBlock(),o.createElementBlock("div",_f,o.toDisplayString(t.noResultsText),1)):o.createCommentVNode("",!0)],544)],4)):o.createCommentVNode("",!0)]))]),t.error?(o.openBlock(),o.createElementBlock("p",Cf,o.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(o.openBlock(),o.createElementBlock("p",Bf,o.toDisplayString(t.helperText),1)):o.createCommentVNode("",!0)],64))],10,ef)),[[o.vShow,t.visible]])}});function Ps(t){var e,n,a="";if(typeof t=="string"||typeof t=="number")a+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=Ps(t[e]))&&(a&&(a+=" "),a+=n)}else for(n in t)t[n]&&(a&&(a+=" "),a+=n);return a}function As(){for(var t,e,n=0,a="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=Ps(t))&&(a&&(a+=" "),a+=e);return a}const Sf=(t,e)=>{const n=new Array(t.length+e.length);for(let a=0;a<t.length;a++)n[a]=t[a];for(let a=0;a<e.length;a++)n[t.length+a]=e[a];return n},Ef=(t,e)=>({classGroupId:t,validator:e}),$s=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),No="-",Ts=[],Df="arbitrary..",Vf=t=>{const e=Nf(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Mf(i);const l=i.split(No),c=l[0]===""&&l.length>1?1:0;return Os(l,c,e)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=a[i],d=n[i];return c?d?Sf(d,c):c:d||Ts}return n[i]||Ts}}},Os=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const r=t[e],s=n.nextPart.get(r);if(s){const d=Os(t,e+1,s);if(d)return d}const i=n.validators;if(i===null)return;const l=e===0?t.join(No):t.slice(e).join(No),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},Mf=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),a=e.slice(0,n);return a?Df+a:void 0})(),Nf=t=>{const{theme:e,classGroups:n}=t;return Pf(n,e)},Pf=(t,e)=>{const n=$s();for(const a in t){const r=t[a];Ua(r,n,a,e)}return n},Ua=(t,e,n,a)=>{const r=t.length;for(let s=0;s<r;s++){const i=t[s];Af(i,e,n,a)}},Af=(t,e,n,a)=>{if(typeof t=="string"){$f(t,e,n);return}if(typeof t=="function"){Tf(t,e,n,a);return}Of(t,e,n,a)},$f=(t,e,n)=>{const a=t===""?e:zs(e,t);a.classGroupId=n},Tf=(t,e,n,a)=>{if(zf(t)){Ua(t(a),e,n,a);return}e.validators===null&&(e.validators=[]),e.validators.push(Ef(n,t))},Of=(t,e,n,a)=>{const r=Object.entries(t),s=r.length;for(let i=0;i<s;i++){const[l,c]=r[i];Ua(c,zs(e,l),n,a)}},zs=(t,e)=>{let n=t;const a=e.split(No),r=a.length;for(let s=0;s<r;s++){const i=a[s];let l=n.nextPart.get(i);l||(l=$s(),n.nextPart.set(i,l)),n=l}return n},zf=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Ff=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),a=Object.create(null);const r=(s,i)=>{n[s]=i,e++,e>t&&(e=0,a=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=a[s])!==void 0)return r(s,i),i},set(s,i){s in n?n[s]=i:r(s,i)}}},Ya="!",Fs=":",Rf=[],Rs=(t,e,n,a,r)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:a,isExternal:r}),vf=t=>{const{prefix:e,experimentalParseClassName:n}=t;let a=r=>{const s=[];let i=0,l=0,c=0,d;const u=r.length;for(let p=0;p<u;p++){const g=r[p];if(i===0&&l===0){if(g===Fs){s.push(r.slice(c,p)),c=p+1;continue}if(g==="/"){d=p;continue}}g==="["?i++:g==="]"?i--:g==="("?l++:g===")"&&l--}const f=s.length===0?r:r.slice(c);let h=f,m=!1;f.endsWith(Ya)?(h=f.slice(0,-1),m=!0):f.startsWith(Ya)&&(h=f.slice(1),m=!0);const b=d&&d>c?d-c:void 0;return Rs(s,m,h,b)};if(e){const r=e+Fs,s=a;a=i=>i.startsWith(r)?s(i.slice(r.length)):Rs(Rf,!1,i,void 0,!0)}if(n){const r=a;a=s=>n({className:s,parseClassName:r})}return a},Lf=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,a)=>{e.set(n,1e6+a)}),n=>{const a=[];let r=[];for(let s=0;s<n.length;s++){const i=n[s],l=i[0]==="[",c=e.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}},If=t=>({cache:Ff(t.cacheSize),parseClassName:vf(t),sortModifiers:Lf(t),...Vf(t)}),jf=/\s+/,Wf=(t,e)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:r,sortModifiers:s}=e,i=[],l=t.trim().split(jf);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:p}=n(u);if(f){c=u+(c.length>0?" "+c:c);continue}let g=!!p,y=a(g?b.substring(0,p):b);if(!y){if(!g){c=u+(c.length>0?" "+c:c);continue}if(y=a(b),!y){c=u+(c.length>0?" "+c:c);continue}g=!1}const B=h.length===0?"":h.length===1?h[0]:s(h).join(":"),D=m?B+Ya:B,M=D+y;if(i.indexOf(M)>-1)continue;i.push(M);const S=r(y,g);for(let k=0;k<S.length;++k){const C=S[k];i.push(D+C)}c=u+(c.length>0?" "+c:c)}return c},Hf=(...t)=>{let e=0,n,a,r="";for(;e<t.length;)(n=t[e++])&&(a=vs(n))&&(r&&(r+=" "),r+=a);return r},vs=t=>{if(typeof t=="string")return t;let e,n="";for(let a=0;a<t.length;a++)t[a]&&(e=vs(t[a]))&&(n&&(n+=" "),n+=e);return n},qf=(t,...e)=>{let n,a,r,s;const i=c=>{const d=e.reduce((u,f)=>f(u),t());return n=If(d),a=n.cache.get,r=n.cache.set,s=l,l(c)},l=c=>{const d=a(c);if(d)return d;const u=Wf(c,n);return r(c,u),u};return s=i,(...c)=>s(Hf(...c))},Uf=[],Fe=t=>{const e=n=>n[t]||Uf;return e.isThemeGetter=!0,e},Ls=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Is=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Yf=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Gf=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kf=/\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$/,Xf=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Jf=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Qf=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rt=t=>Yf.test(t),xe=t=>!!t&&!Number.isNaN(Number(t)),vt=t=>!!t&&Number.isInteger(Number(t)),Ga=t=>t.endsWith("%")&&xe(t.slice(0,-1)),wt=t=>Gf.test(t),js=()=>!0,Zf=t=>Kf.test(t)&&!Xf.test(t),Ka=()=>!1,eh=t=>Jf.test(t),th=t=>Qf.test(t),nh=t=>!re(t)&&!se(t),oh=t=>Lt(t,Gs,Ka),re=t=>Ls.test(t),tn=t=>Lt(t,Ks,Zf),Ws=t=>Lt(t,uh,xe),ah=t=>Lt(t,Js,js),rh=t=>Lt(t,Xs,Ka),Hs=t=>Lt(t,Us,Ka),sh=t=>Lt(t,Ys,th),Po=t=>Lt(t,Qs,eh),se=t=>Is.test(t),jn=t=>nn(t,Ks),ih=t=>nn(t,Xs),qs=t=>nn(t,Us),lh=t=>nn(t,Gs),ch=t=>nn(t,Ys),Ao=t=>nn(t,Qs,!0),dh=t=>nn(t,Js,!0),Lt=(t,e,n)=>{const a=Ls.exec(t);return a?a[1]?e(a[1]):n(a[2]):!1},nn=(t,e,n=!1)=>{const a=Is.exec(t);return a?a[1]?e(a[1]):n:!1},Us=t=>t==="position"||t==="percentage",Ys=t=>t==="image"||t==="url",Gs=t=>t==="length"||t==="size"||t==="bg-size",Ks=t=>t==="length",uh=t=>t==="number",Xs=t=>t==="family-name",Js=t=>t==="number"||t==="weight",Qs=t=>t==="shadow",fh=qf(()=>{const t=Fe("color"),e=Fe("font"),n=Fe("text"),a=Fe("font-weight"),r=Fe("tracking"),s=Fe("leading"),i=Fe("breakpoint"),l=Fe("container"),c=Fe("spacing"),d=Fe("radius"),u=Fe("shadow"),f=Fe("inset-shadow"),h=Fe("text-shadow"),m=Fe("drop-shadow"),b=Fe("blur"),p=Fe("perspective"),g=Fe("aspect"),y=Fe("ease"),B=Fe("animate"),D=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...M(),se,re],k=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],x=()=>[se,re,c],w=()=>[Rt,"full","auto",...x()],E=()=>[vt,"none","subgrid",se,re],A=()=>["auto",{span:["full",vt,se,re]},vt,se,re],T=()=>[vt,"auto",se,re],F=()=>["auto","min","max","fr",se,re],L=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Y=()=>["start","end","center","stretch","center-safe","end-safe"],z=()=>["auto",...x()],v=()=>[Rt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],W=()=>[Rt,"screen","full","dvw","lvw","svw","min","max","fit",...x()],O=()=>[Rt,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],N=()=>[t,se,re],H=()=>[...M(),qs,Hs,{position:[se,re]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",lh,oh,{size:[se,re]}],te=()=>[Ga,jn,tn],ue=()=>["","none","full",d,se,re],fe=()=>["",xe,jn,tn],pe=()=>["solid","dashed","dotted","double"],Le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],be=()=>[xe,Ga,qs,Hs],U=()=>["","none",b,se,re],P=()=>["none",xe,se,re],q=()=>["none",xe,se,re],oe=()=>[xe,se,re],he=()=>[Rt,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[wt],breakpoint:[wt],color:[js],container:[wt],"drop-shadow":[wt],ease:["in","out","in-out"],font:[nh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[wt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[wt],shadow:[wt],spacing:["px",xe],text:[wt],"text-shadow":[wt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rt,re,se,g]}],container:["container"],columns:[{columns:[xe,re,se,l]}],"break-after":[{"break-after":D()}],"break-before":[{"break-before":D()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{"inset-s":w(),start:w()}],end:[{"inset-e":w(),end:w()}],"inset-bs":[{"inset-bs":w()}],"inset-be":[{"inset-be":w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[vt,"auto",se,re]}],basis:[{basis:[Rt,"full","auto",l,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[xe,Rt,"auto","initial","none",re]}],grow:[{grow:["",xe,se,re]}],shrink:[{shrink:["",xe,se,re]}],order:[{order:[vt,"first","last","none",se,re]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:A()}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:A()}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":F()}],"auto-rows":[{"auto-rows":F()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...L(),"normal"]}],"justify-items":[{"justify-items":[...Y(),"normal"]}],"justify-self":[{"justify-self":["auto",...Y()]}],"align-content":[{content:["normal",...L()]}],"align-items":[{items:[...Y(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Y(),{baseline:["","last"]}]}],"place-content":[{"place-content":L()}],"place-items":[{"place-items":[...Y(),"baseline"]}],"place-self":[{"place-self":["auto",...Y()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:z()}],mx:[{mx:z()}],my:[{my:z()}],ms:[{ms:z()}],me:[{me:z()}],mbs:[{mbs:z()}],mbe:[{mbe:z()}],mt:[{mt:z()}],mr:[{mr:z()}],mb:[{mb:z()}],ml:[{ml:z()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:v()}],"inline-size":[{inline:["auto",...W()]}],"min-inline-size":[{"min-inline":["auto",...W()]}],"max-inline-size":[{"max-inline":["none",...W()]}],"block-size":[{block:["auto",...O()]}],"min-block-size":[{"min-block":["auto",...O()]}],"max-block-size":[{"max-block":["none",...O()]}],w:[{w:[l,"screen",...v()]}],"min-w":[{"min-w":[l,"screen","none",...v()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...v()]}],h:[{h:["screen","lh",...v()]}],"min-h":[{"min-h":["screen","lh","none",...v()]}],"max-h":[{"max-h":["screen","lh",...v()]}],"font-size":[{text:["base",n,jn,tn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,dh,ah]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ga,re]}],"font-family":[{font:[ih,rh,e]}],"font-features":[{"font-features":[re]}],"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,se,re]}],"line-clamp":[{"line-clamp":[xe,"none",se,Ws]}],leading:[{leading:[s,...x()]}],"list-image":[{"list-image":["none",se,re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",se,re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[xe,"from-font","auto",se,tn]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[xe,"auto",se,re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",se,re]}],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",se,re]}],"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:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vt,se,re],radial:["",se,re],conic:[vt,se,re]},ch,sh]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:ue()}],"rounded-s":[{"rounded-s":ue()}],"rounded-e":[{"rounded-e":ue()}],"rounded-t":[{"rounded-t":ue()}],"rounded-r":[{"rounded-r":ue()}],"rounded-b":[{"rounded-b":ue()}],"rounded-l":[{"rounded-l":ue()}],"rounded-ss":[{"rounded-ss":ue()}],"rounded-se":[{"rounded-se":ue()}],"rounded-ee":[{"rounded-ee":ue()}],"rounded-es":[{"rounded-es":ue()}],"rounded-tl":[{"rounded-tl":ue()}],"rounded-tr":[{"rounded-tr":ue()}],"rounded-br":[{"rounded-br":ue()}],"rounded-bl":[{"rounded-bl":ue()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"hidden","none"]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[xe,se,re]}],"outline-w":[{outline:["",xe,jn,tn]}],"outline-color":[{outline:N()}],shadow:[{shadow:["","none",u,Ao,Po]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":["none",f,Ao,Po]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[xe,tn]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":["none",h,Ao,Po]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[xe,se,re]}],"mix-blend":[{"mix-blend":[...Le(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Le()}],"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":[xe]}],"mask-image-linear-from-pos":[{"mask-linear-from":be()}],"mask-image-linear-to-pos":[{"mask-linear-to":be()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":be()}],"mask-image-t-to-pos":[{"mask-t-to":be()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":be()}],"mask-image-r-to-pos":[{"mask-r-to":be()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":be()}],"mask-image-b-to-pos":[{"mask-b-to":be()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":be()}],"mask-image-l-to-pos":[{"mask-l-to":be()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":be()}],"mask-image-x-to-pos":[{"mask-x-to":be()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":be()}],"mask-image-y-to-pos":[{"mask-y-to":be()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[se,re]}],"mask-image-radial-from-pos":[{"mask-radial-from":be()}],"mask-image-radial-to-pos":[{"mask-radial-to":be()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":M()}],"mask-image-conic-pos":[{"mask-conic":[xe]}],"mask-image-conic-from-pos":[{"mask-conic-from":be()}],"mask-image-conic-to-pos":[{"mask-conic-to":be()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"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:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",se,re]}],filter:[{filter:["","none",se,re]}],blur:[{blur:U()}],brightness:[{brightness:[xe,se,re]}],contrast:[{contrast:[xe,se,re]}],"drop-shadow":[{"drop-shadow":["","none",m,Ao,Po]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:["",xe,se,re]}],"hue-rotate":[{"hue-rotate":[xe,se,re]}],invert:[{invert:["",xe,se,re]}],saturate:[{saturate:[xe,se,re]}],sepia:[{sepia:["",xe,se,re]}],"backdrop-filter":[{"backdrop-filter":["","none",se,re]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[xe,se,re]}],"backdrop-contrast":[{"backdrop-contrast":[xe,se,re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",xe,se,re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[xe,se,re]}],"backdrop-invert":[{"backdrop-invert":["",xe,se,re]}],"backdrop-opacity":[{"backdrop-opacity":[xe,se,re]}],"backdrop-saturate":[{"backdrop-saturate":[xe,se,re]}],"backdrop-sepia":[{"backdrop-sepia":["",xe,se,re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",se,re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[xe,"initial",se,re]}],ease:[{ease:["linear","initial",y,se,re]}],delay:[{delay:[xe,se,re]}],animate:[{animate:["none",B,se,re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[p,se,re]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:P()}],"rotate-x":[{"rotate-x":P()}],"rotate-y":[{"rotate-y":P()}],"rotate-z":[{"rotate-z":P()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:oe()}],"skew-x":[{"skew-x":oe()}],"skew-y":[{"skew-y":oe()}],transform:[{transform:[se,re,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:N()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:N()}],"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",se,re]}],"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":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"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",se,re]}],fill:[{fill:["none",...N()]}],"stroke-w":[{stroke:[xe,jn,tn,Ws]}],stroke:[{stroke:["none",...N()]}],"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 de(...t){return fh(As(t))}function hh(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xa={},Ja={},$o={exports:{}},Zs;function mh(){if(Zs)return $o.exports;Zs=1;var t=String,e=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 $o.exports=e(),$o.exports.createColors=e,$o.exports}var ei;function ph(){return ei||(ei=1,(function(t){var e={};Object.defineProperty(t,"__esModule",{value:!0});function n(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}n(t,{dim:function(){return l},default:function(){return c}});const a=r(mh());function r(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&e.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])}}})(Ja)),Ja}var ti;function gh(){return ti||(ti=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}});const e=n(ph());function n(s){return s&&s.__esModule?s:{default:s}}function a({version:s,from:i,to:l}){e.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}}})(Xa)),Xa}var Qa,ni;function bh(){if(ni)return Qa;ni=1;let t=gh();return Qa=(t.__esModule?t:{default:t}).default,Qa}var yh=bh();const xh=hh(yh),oi=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,ai=As,Wn=(t,e)=>n=>{var a;if((e==null?void 0:e.variants)==null)return ai(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:r,defaultVariants:s}=e,i=Object.keys(r).map(d=>{const u=n==null?void 0:n[d],f=s==null?void 0:s[d];if(u===null)return null;const h=oi(u)||oi(f);return r[d][h]}),l=n&&Object.entries(n).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=e==null||(a=e.compoundVariants)===null||a===void 0?void 0:a.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(b=>{let[p,g]=b;return Array.isArray(g)?g.includes({...s,...l}[p]):{...s,...l}[p]===g})?[...d,f,h]:d},[]);return ai(t,i,c,n==null?void 0:n.class,n==null?void 0:n.className)},Ce=o.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.Primitive),{as:t.as,"as-child":t.asChild,class:o.normalizeClass(o.unref(de)(o.unref(_t)({variant:t.variant,size:t.size}),e.class))},{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),_t=Wn("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"}}),ri=o.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:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),si=o.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:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.TooltipContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("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",n.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),ii=o.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipProvider),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),li=o.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.TooltipTrigger),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),kh={key:1,class:"ml-1"},wh={class:"relative z-10"},_h={key:1,class:"ml-1"},Ch="rounded-lg 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",Bh=o.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},hoverBgColor:{default:""},borderColor:{default:""},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const e=o.useAttrs(),n=t,a=o.computed(()=>!!n.tooltip),r=o.computed(()=>n.visible??!0),s=o.computed(()=>{const O=String(n.variant||"default").toLowerCase();return O==="tonal"?"secondary":O==="elevated"?"default":O}),i=o.computed(()=>String(n.bgColor||"").toLowerCase()),l=o.computed(()=>String(n.type||"button").toLowerCase()),c=o.computed(()=>{const{class:O,...N}=e;return N}),d=o.computed(()=>de(e.class)),u=o.computed(()=>((d.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),f=o.computed(()=>n.size==="sm"?"h-9":n.size==="lg"?"h-11":n.size==="icon"?"h-10 w-10":"h-10"),h=o.computed(()=>n.size==="icon"?"":!n.text&&n.icon?"w-10":"w-28"),m=o.computed(()=>de("inline-flex items-center justify-center rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",f.value,h.value,u.value)),b=o.computed(()=>{const N=(d.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return N?N[0]:null}),p=o.computed(()=>{const N=(d.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return N?N[0]:null}),g=o.computed(()=>!!b.value),y=o.computed(()=>/\bborder-/.test(d.value??"")),B=o.computed(()=>/\bhover:/.test(d.value??"")),D=o.computed(()=>{const O=d.value??"";return s.value!=="outline"?O:O.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),M=o.ref(null),S=O=>{const N=O.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return N?{r:Number(N[1]),g:Number(N[2]),b:Number(N[3]),a:N[4]?Number(N[4]):1}:null},k=(O,N)=>{const H=S(O);if(!H)return O;const j=J=>Math.max(0,Math.min(255,Math.round(J)));return`rgba(${j(H.r*(1-N))}, ${j(H.g*(1-N))}, ${j(H.b*(1-N))}, ${H.a})`},C=O=>{if(globalThis.window===void 0)return null;const N=document.createElement("div");N.className=O,N.style.position="absolute",N.style.visibility="hidden",N.style.pointerEvents="none",N.style.width="1px",N.style.height="1px",document.body.appendChild(N);const H=globalThis.getComputedStyle(N).backgroundColor;return N.remove(),!H||H==="transparent"||H==="rgba(0, 0, 0, 0)"?null:H},x=[50,100,200,300,400,500,600,700,800,900,950],w=O=>{const N=x.indexOf(O);return N===-1?O:x[Math.min(x.length-1,N+2)]},E=(O,N)=>{const H=xh[O];if(!H)return null;if(typeof H=="string")return H;if(!N)return null;const j=H[N];return typeof j=="string"?j:null},A=(O,N=!1)=>{if(!O)return null;const H=N?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,j=O.match(H);return j?{colorName:j[1],shade:j[2]?Number.parseInt(j[2],10):null}:null},T=()=>{const O=b.value;if(!O){M.value=null;return}const N=A(O),H=N==null?void 0:N.colorName,j=(N==null?void 0:N.shade)??null,J=(H?E(H,j):null)??C(O);if(!J){M.value=null;return}let te;const ue=A(p.value,!0),fe=ue?E(ue.colorName,ue.shade??null):null;if(fe)te=fe;else if(H&&j){const pe=w(j);te=E(H,pe)??k(J,.2)}else te=k(J,.2);M.value={"--btn-color":J,"--btn-color-hover":te}};o.onMounted(()=>{T()}),o.watch([b,p],async()=>{await o.nextTick(),T()});const F=o.computed(()=>{const O=/\bdark:bg-/.test(d.value??"");return!g.value||s.value==="outline"||O?"":M.value?"dcode-btn--fill dcode-btn--fill-hover":B.value?"":"hover:brightness-90"}),L=o.computed(()=>{if(!g.value||s.value!=="outline")return"";const O=["dcode-btn--outline","dcode-btn--outline-hover"];return y.value||O.push("border"),!M.value&&!B.value&&O.push("hover:brightness-90"),O.join(" ")}),Y=o.computed(()=>M.value??void 0),z={primary:{bg:"bg-blue-600",text:"text-white",hover:"hover:bg-blue-700",border:"border-blue-600"},success:{bg:"bg-green-600",text:"text-white",hover:"hover:bg-green-700",border:"border-green-600"},warning:{bg:"bg-yellow-500",text:"text-white",hover:"hover:bg-yellow-600",border:"border-yellow-500"},danger:{bg:"bg-red-600",text:"text-white",hover:"hover:bg-red-700",border:"border-red-600"},info:{bg:"bg-cyan-600",text:"text-white",hover:"hover:bg-cyan-700",border:"border-cyan-600"},purple:{bg:"bg-purple-600",text:"text-white",hover:"hover:bg-purple-700",border:"border-purple-600"},pink:{bg:"bg-pink-600",text:"text-white",hover:"hover:bg-pink-700",border:"border-pink-600"},"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"}},v=o.computed(()=>{const O=[],N=i.value?z[i.value]:null;return N?(O.push(N.bg,N.text,N.hover),N.border&&s.value==="outline"&&O.push(N.border)):(i.value&&O.push(i.value),n.textColor&&O.push(n.textColor),n.hoverBgColor&&O.push(n.hoverBgColor),n.borderColor&&O.push(n.borderColor)),O.join(" ")}),W=o.computed(()=>de(Ch,D.value,F.value,L.value,v.value));return(O,N)=>r.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.skeleton?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(m.value),"aria-hidden":"true"},null,2)):(o.openBlock(),o.createBlock(o.unref(ii),{key:1,"delay-duration":0},{default:o.withCtx(()=>[a.value?(o.openBlock(),o.createBlock(o.unref(ri),{key:0},{default:o.withCtx(()=>[o.createVNode(o.unref(li),{"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Ce),o.mergeProps({variant:s.value,size:n.size,disabled:n.disabled,type:l.value,class:W.value,style:Y.value},c.value),{default:o.withCtx(()=>[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-[18px] w-[18px]"})):o.createCommentVNode("",!0),n.text?(o.openBlock(),o.createElementBlock("span",kh,o.toDisplayString(n.text),1)):o.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),o.createVNode(o.unref(si),{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:o.withCtx(()=>[o.createElementVNode("span",wh,o.toDisplayString(n.tooltip),1)]),_:1})]),_:1})):(o.openBlock(),o.createBlock(o.unref(Ce),o.mergeProps({key:1,variant:s.value,size:n.size,disabled:n.disabled,type:l.value,class:W.value,style:Y.value},c.value),{default:o.withCtx(()=>[o.renderSlot(O.$slots,"default",{},()=>[n.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.icon),{key:0,class:"h-[18px] w-[18px]"})):o.createCommentVNode("",!0),n.text?(o.openBlock(),o.createElementBlock("span",_h,o.toDisplayString(n.text),1)):o.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):o.createCommentVNode("",!0)}}),Hn=(t,e)=>{const n=t.__vccOpts||t;for(const[a,r]of e)n[a]=r;return n},ht=Hn(Bh,[["__scopeId","data-v-fd0c8445"]]),Sh={key:0,class:"flex items-center justify-between mb-4"},Eh={class:"flex flex-col gap-1"},Dh={key:0,class:"text-lg font-semibold text-neutral-900 dark:text-neutral-50 leading-tight"},Vh={key:1,class:"text-sm text-neutral-500 dark:text-neutral-400"},Mh={key:0,class:"flex items-center gap-2"},Nh={class:"relative z-10"},Ph={key:1,class:"mt-6 pt-6 border-t border-neutral-200 dark:border-neutral-800"},Ah={name:"DCodeCard"},Za=o.defineComponent({...Ah,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const e=t,n=o.computed(()=>{switch(e.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)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["transition-shadow duration-300 dcode-card",[n.value,t.padding,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200 dark:border-neutral-800":t.border&&t.level===1},{"border-neutral-300 dark:border-neutral-700":t.border&&t.level!==1}]])},[t.title||a.$slots.header||a.$slots.actions?(o.openBlock(),o.createElementBlock("div",Sh,[o.createElementVNode("div",Eh,[o.renderSlot(a.$slots,"header",{},()=>[t.title?(o.openBlock(),o.createElementBlock("h3",Dh,o.toDisplayString(t.title),1)):o.createCommentVNode("",!0),t.subtitle?(o.openBlock(),o.createElementBlock("p",Vh,o.toDisplayString(t.subtitle),1)):o.createCommentVNode("",!0)])]),a.$slots.actions?(o.openBlock(),o.createElementBlock("div",Mh,[o.renderSlot(a.$slots,"actions")])):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",Nh,[o.renderSlot(a.$slots,"default")]),a.$slots.footer?(o.openBlock(),o.createElementBlock("div",Ph,[o.renderSlot(a.$slots,"footer")])):o.createCommentVNode("",!0)],2))}});/*!
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 qn(t){return t+.5|0}const It=(t,e,n)=>Math.max(Math.min(t,n),e);function Un(t){return It(qn(t*2.55),0,255)}function jt(t){return It(qn(t*255),0,255)}function Ct(t){return It(qn(t/2.55)/100,0,1)}function di(t){return It(qn(t*100),0,100)}const et={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},er=[..."0123456789ABCDEF"],$h=t=>er[t&15],Th=t=>er[(t&240)>>4]+er[t&15],To=t=>(t&240)>>4===(t&15),Oh=t=>To(t.r)&&To(t.g)&&To(t.b)&&To(t.a);function zh(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&et[t[1]]*17,g:255&et[t[2]]*17,b:255&et[t[3]]*17,a:e===5?et[t[4]]*17:255}:(e===7||e===9)&&(n={r:et[t[1]]<<4|et[t[2]],g:et[t[3]]<<4|et[t[4]],b:et[t[5]]<<4|et[t[6]],a:e===9?et[t[7]]<<4|et[t[8]]:255})),n}const Fh=(t,e)=>t<255?e(t):"";function Rh(t){var e=Oh(t)?$h:Th;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Fh(t.a,e):void 0}const vh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function ui(t,e,n){const a=e*Math.min(n,1-n),r=(s,i=(s+t/30)%12)=>n-a*Math.max(Math.min(i-3,9-i,1),-1);return[r(0),r(8),r(4)]}function Lh(t,e,n){const a=(r,s=(r+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[a(5),a(3),a(1)]}function Ih(t,e,n){const a=ui(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)a[r]*=1-e-n,a[r]+=e;return a}function jh(t,e,n,a,r){return t===r?(e-n)/a+(e<n?6:0):e===r?(n-t)/a+2:(t-e)/a+4}function tr(t){const n=t.r/255,a=t.g/255,r=t.b/255,s=Math.max(n,a,r),i=Math.min(n,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=jh(n,a,r,u,s),c=c*60+.5),[c|0,d||0,l]}function nr(t,e,n,a){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,a)).map(jt)}function or(t,e,n){return nr(ui,t,e,n)}function Wh(t,e,n){return nr(Ih,t,e,n)}function Hh(t,e,n){return nr(Lh,t,e,n)}function fi(t){return(t%360+360)%360}function qh(t){const e=vh.exec(t);let n=255,a;if(!e)return;e[5]!==a&&(n=e[6]?Un(+e[5]):jt(+e[5]));const r=fi(+e[2]),s=+e[3]/100,i=+e[4]/100;return e[1]==="hwb"?a=Wh(r,s,i):e[1]==="hsv"?a=Hh(r,s,i):a=or(r,s,i),{r:a[0],g:a[1],b:a[2],a:n}}function Uh(t,e){var n=tr(t);n[0]=fi(n[0]+e),n=or(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Yh(t){if(!t)return;const e=tr(t),n=e[0],a=di(e[1]),r=di(e[2]);return t.a<255?`hsla(${n}, ${a}%, ${r}%, ${Ct(t.a)})`:`hsl(${n}, ${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"},mi={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 Gh(){const t={},e=Object.keys(mi),n=Object.keys(hi);let a,r,s,i,l;for(a=0;a<e.length;a++){for(i=l=e[a],r=0;r<n.length;r++)s=n[r],l=l.replace(s,hi[s]);s=parseInt(mi[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let Oo;function Kh(t){Oo||(Oo=Gh(),Oo.transparent=[0,0,0,0]);const e=Oo[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Xh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Jh(t){const e=Xh.exec(t);let n=255,a,r,s;if(e){if(e[7]!==a){const i=+e[7];n=e[8]?Un(i):It(i*255,0,255)}return a=+e[1],r=+e[3],s=+e[5],a=255&(e[2]?Un(a):It(a,0,255)),r=255&(e[4]?Un(r):It(r,0,255)),s=255&(e[6]?Un(s):It(s,0,255)),{r:a,g:r,b:s,a:n}}}function Qh(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ct(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ar=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,wn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Zh(t,e,n){const a=wn(Ct(t.r)),r=wn(Ct(t.g)),s=wn(Ct(t.b));return{r:jt(ar(a+n*(wn(Ct(e.r))-a))),g:jt(ar(r+n*(wn(Ct(e.g))-r))),b:jt(ar(s+n*(wn(Ct(e.b))-s))),a:t.a+n*(e.a-t.a)}}function zo(t,e,n){if(t){let a=tr(t);a[e]=Math.max(0,Math.min(a[e]+a[e]*n,e===0?360:1)),a=or(a),t.r=a[0],t.g=a[1],t.b=a[2]}}function pi(t,e){return t&&Object.assign(e||{},t)}function gi(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=jt(t[3]))):(e=pi(t,{r:0,g:0,b:0,a:1}),e.a=jt(e.a)),e}function em(t){return t.charAt(0)==="r"?Jh(t):qh(t)}class Yn{constructor(e){if(e instanceof Yn)return e;const n=typeof e;let a;n==="object"?a=gi(e):n==="string"&&(a=zh(e)||Kh(e)||em(e)),this._rgb=a,this._valid=!!a}get valid(){return this._valid}get rgb(){var e=pi(this._rgb);return e&&(e.a=Ct(e.a)),e}set rgb(e){this._rgb=gi(e)}rgbString(){return this._valid?Qh(this._rgb):void 0}hexString(){return this._valid?Rh(this._rgb):void 0}hslString(){return this._valid?Yh(this._rgb):void 0}mix(e,n){if(e){const a=this.rgb,r=e.rgb;let s;const i=n===s?.5:n,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(e,n){return e&&(this._rgb=Zh(this._rgb,e._rgb,n)),this}clone(){return new Yn(this.rgb)}alpha(e){return this._rgb.a=jt(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=qn(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return zo(this._rgb,2,e),this}darken(e){return zo(this._rgb,2,-e),this}saturate(e){return zo(this._rgb,1,e),this}desaturate(e){return zo(this._rgb,1,-e),this}rotate(e){return Uh(this._rgb,e),this}}/*!
6
+ */function qn(t){return t+.5|0}const It=(t,e,n)=>Math.max(Math.min(t,n),e);function Un(t){return It(qn(t*2.55),0,255)}function jt(t){return It(qn(t*255),0,255)}function Ct(t){return It(qn(t/2.55)/100,0,1)}function ci(t){return It(qn(t*100),0,100)}const et={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},er=[..."0123456789ABCDEF"],$h=t=>er[t&15],Th=t=>er[(t&240)>>4]+er[t&15],To=t=>(t&240)>>4===(t&15),Oh=t=>To(t.r)&&To(t.g)&&To(t.b)&&To(t.a);function zh(t){var e=t.length,n;return t[0]==="#"&&(e===4||e===5?n={r:255&et[t[1]]*17,g:255&et[t[2]]*17,b:255&et[t[3]]*17,a:e===5?et[t[4]]*17:255}:(e===7||e===9)&&(n={r:et[t[1]]<<4|et[t[2]],g:et[t[3]]<<4|et[t[4]],b:et[t[5]]<<4|et[t[6]],a:e===9?et[t[7]]<<4|et[t[8]]:255})),n}const Fh=(t,e)=>t<255?e(t):"";function Rh(t){var e=Oh(t)?$h:Th;return t?"#"+e(t.r)+e(t.g)+e(t.b)+Fh(t.a,e):void 0}const vh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function di(t,e,n){const a=e*Math.min(n,1-n),r=(s,i=(s+t/30)%12)=>n-a*Math.max(Math.min(i-3,9-i,1),-1);return[r(0),r(8),r(4)]}function Lh(t,e,n){const a=(r,s=(r+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[a(5),a(3),a(1)]}function Ih(t,e,n){const a=di(t,1,.5);let r;for(e+n>1&&(r=1/(e+n),e*=r,n*=r),r=0;r<3;r++)a[r]*=1-e-n,a[r]+=e;return a}function jh(t,e,n,a,r){return t===r?(e-n)/a+(e<n?6:0):e===r?(n-t)/a+2:(t-e)/a+4}function tr(t){const n=t.r/255,a=t.g/255,r=t.b/255,s=Math.max(n,a,r),i=Math.min(n,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=jh(n,a,r,u,s),c=c*60+.5),[c|0,d||0,l]}function nr(t,e,n,a){return(Array.isArray(e)?t(e[0],e[1],e[2]):t(e,n,a)).map(jt)}function or(t,e,n){return nr(di,t,e,n)}function Wh(t,e,n){return nr(Ih,t,e,n)}function Hh(t,e,n){return nr(Lh,t,e,n)}function ui(t){return(t%360+360)%360}function qh(t){const e=vh.exec(t);let n=255,a;if(!e)return;e[5]!==a&&(n=e[6]?Un(+e[5]):jt(+e[5]));const r=ui(+e[2]),s=+e[3]/100,i=+e[4]/100;return e[1]==="hwb"?a=Wh(r,s,i):e[1]==="hsv"?a=Hh(r,s,i):a=or(r,s,i),{r:a[0],g:a[1],b:a[2],a:n}}function Uh(t,e){var n=tr(t);n[0]=ui(n[0]+e),n=or(n),t.r=n[0],t.g=n[1],t.b=n[2]}function Yh(t){if(!t)return;const e=tr(t),n=e[0],a=ci(e[1]),r=ci(e[2]);return t.a<255?`hsla(${n}, ${a}%, ${r}%, ${Ct(t.a)})`:`hsl(${n}, ${a}%, ${r}%)`}const fi={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"},hi={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 Gh(){const t={},e=Object.keys(hi),n=Object.keys(fi);let a,r,s,i,l;for(a=0;a<e.length;a++){for(i=l=e[a],r=0;r<n.length;r++)s=n[r],l=l.replace(s,fi[s]);s=parseInt(hi[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let Oo;function Kh(t){Oo||(Oo=Gh(),Oo.transparent=[0,0,0,0]);const e=Oo[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Xh=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Jh(t){const e=Xh.exec(t);let n=255,a,r,s;if(e){if(e[7]!==a){const i=+e[7];n=e[8]?Un(i):It(i*255,0,255)}return a=+e[1],r=+e[3],s=+e[5],a=255&(e[2]?Un(a):It(a,0,255)),r=255&(e[4]?Un(r):It(r,0,255)),s=255&(e[6]?Un(s):It(s,0,255)),{r:a,g:r,b:s,a:n}}}function Qh(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ct(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const ar=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,wn=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function Zh(t,e,n){const a=wn(Ct(t.r)),r=wn(Ct(t.g)),s=wn(Ct(t.b));return{r:jt(ar(a+n*(wn(Ct(e.r))-a))),g:jt(ar(r+n*(wn(Ct(e.g))-r))),b:jt(ar(s+n*(wn(Ct(e.b))-s))),a:t.a+n*(e.a-t.a)}}function zo(t,e,n){if(t){let a=tr(t);a[e]=Math.max(0,Math.min(a[e]+a[e]*n,e===0?360:1)),a=or(a),t.r=a[0],t.g=a[1],t.b=a[2]}}function mi(t,e){return t&&Object.assign(e||{},t)}function pi(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=jt(t[3]))):(e=mi(t,{r:0,g:0,b:0,a:1}),e.a=jt(e.a)),e}function em(t){return t.charAt(0)==="r"?Jh(t):qh(t)}class Yn{constructor(e){if(e instanceof Yn)return e;const n=typeof e;let a;n==="object"?a=pi(e):n==="string"&&(a=zh(e)||Kh(e)||em(e)),this._rgb=a,this._valid=!!a}get valid(){return this._valid}get rgb(){var e=mi(this._rgb);return e&&(e.a=Ct(e.a)),e}set rgb(e){this._rgb=pi(e)}rgbString(){return this._valid?Qh(this._rgb):void 0}hexString(){return this._valid?Rh(this._rgb):void 0}hslString(){return this._valid?Yh(this._rgb):void 0}mix(e,n){if(e){const a=this.rgb,r=e.rgb;let s;const i=n===s?.5:n,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(e,n){return e&&(this._rgb=Zh(this._rgb,e._rgb,n)),this}clone(){return new Yn(this.rgb)}alpha(e){return this._rgb.a=jt(e),this}clearer(e){const n=this._rgb;return n.a*=1-e,this}greyscale(){const e=this._rgb,n=qn(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=n,this}opaquer(e){const n=this._rgb;return n.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return zo(this._rgb,2,e),this}darken(e){return zo(this._rgb,2,-e),this}saturate(e){return zo(this._rgb,1,e),this}desaturate(e){return zo(this._rgb,1,-e),this}rotate(e){return Uh(this._rgb,e),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 Bt(){}const tm=(()=>{let t=0;return()=>t++})();function Be(t){return t==null}function Oe(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function we(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Ie(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function mt(t,e){return Ie(t)?t:e}function ye(t,e){return typeof t>"u"?e:t}const nm=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,bi=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Me(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Se(t,e,n,a){let r,s,i;if(Oe(t))for(s=t.length,r=0;r<s;r++)e.call(n,t[r],r);else if(we(t))for(i=Object.keys(t),s=i.length,r=0;r<s;r++)e.call(n,t[i[r]],i[r])}function Fo(t,e){let n,a,r,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,a=t.length;n<a;++n)if(r=t[n],s=e[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Ro(t){if(Oe(t))return t.map(Ro);if(we(t)){const e=Object.create(null),n=Object.keys(t),a=n.length;let r=0;for(;r<a;++r)e[n[r]]=Ro(t[n[r]]);return e}return t}function yi(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function om(t,e,n,a){if(!yi(t))return;const r=e[t],s=n[t];we(r)&&we(s)?Gn(r,s,a):e[t]=Ro(s)}function Gn(t,e,n){const a=Oe(e)?e:[e],r=a.length;if(!we(t))return t;n=n||{};const s=n.merger||om;let i;for(let l=0;l<r;++l){if(i=a[l],!we(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,n)}return t}function Kn(t,e){return Gn(t,e,{merger:am})}function am(t,e,n){if(!yi(t))return;const a=e[t],r=n[t];we(a)&&we(r)?Kn(a,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ro(r))}const xi={"":t=>t,x:t=>t.x,y:t=>t.y};function rm(t){const e=t.split("."),n=[];let a="";for(const r of e)a+=r,a.endsWith("\\")?a=a.slice(0,-1)+".":(n.push(a),a="");return n}function sm(t){const e=rm(t);return n=>{for(const a of e){if(a==="")break;n=n&&n[a]}return n}}function on(t,e){return(xi[e]||(xi[e]=sm(e)))(t)}function rr(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Xn=t=>typeof t<"u",Wt=t=>typeof t=="function",ki=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function im(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Ee=Math.PI,Pe=2*Ee,lm=Pe+Ee,vo=Number.POSITIVE_INFINITY,cm=Ee/180,Re=Ee/2,an=Ee/4,wi=Ee*2/3,_i=Math.log10,pt=Math.sign;function Jn(t,e,n){return Math.abs(t-e)<n}function Ci(t){const e=Math.round(t);t=Jn(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(_i(t))),a=t/n;return(a<=1?1:a<=2?2:a<=5?5:10)*n}function dm(t){const e=[],n=Math.sqrt(t);let a;for(a=1;a<n;a++)t%a===0&&(e.push(a),e.push(t/a));return n===(n|0)&&e.push(n),e.sort((r,s)=>r-s).pop(),e}function um(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Qn(t){return!um(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function fm(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function hm(t,e,n){let a,r,s;for(a=0,r=t.length;a<r;a++)s=t[a][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function St(t){return t*(Ee/180)}function mm(t){return t*(180/Ee)}function Bi(t){if(!Ie(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Si(t,e){const n=e.x-t.x,a=e.y-t.y,r=Math.sqrt(n*n+a*a);let s=Math.atan2(a,n);return s<-.5*Ee&&(s+=Pe),{angle:s,distance:r}}function sr(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pm(t,e){return(t-e+lm)%Pe-Ee}function Je(t){return(t%Pe+Pe)%Pe}function Zn(t,e,n,a){const r=Je(t),s=Je(e),i=Je(n),l=Je(s-r),c=Je(i-r),d=Je(r-s),u=Je(r-i);return r===s||r===i||a&&s===i||l>c&&d<u}function je(t,e,n){return Math.max(e,Math.min(n,t))}function gm(t){return je(t,-32768,32767)}function Et(t,e,n,a=1e-6){return t>=Math.min(e,n)-a&&t<=Math.max(e,n)+a}function ir(t,e,n){n=n||(i=>t[i]<e);let a=t.length-1,r=0,s;for(;a-r>1;)s=r+a>>1,n(s)?r=s:a=s;return{lo:r,hi:a}}const rn=(t,e,n,a)=>ir(t,n,a?r=>{const s=t[r][e];return s<n||s===n&&t[r+1][e]===n}:r=>t[r][e]<n),bm=(t,e,n)=>ir(t,n,a=>t[a][e]>=n);function ym(t,e,n){let a=0,r=t.length;for(;a<r&&t[a]<e;)a++;for(;r>a&&t[r-1]>n;)r--;return a>0||r<t.length?t.slice(a,r):t}const Ei=["push","pop","shift","splice","unshift"];function xm(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Ei.forEach(n=>{const a="_onData"+rr(n),r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const i=r.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[a]=="function"&&l[a](...s)}),i}})})}function Di(t,e){const n=t._chartjs;if(!n)return;const a=n.listeners,r=a.indexOf(e);r!==-1&&a.splice(r,1),!(a.length>0)&&(Ei.forEach(s=>{delete t[s]}),delete t._chartjs)}function Vi(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Mi=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Ni(t,e){let n=[],a=!1;return function(...r){n=r,a||(a=!0,Mi.call(window,()=>{a=!1,t.apply(e,n)}))}}function km(t,e){let n;return function(...a){return e?(clearTimeout(n),n=setTimeout(t,e,a)):t.apply(this,a),e}}const lr=t=>t==="start"?"left":t==="end"?"right":"center",We=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,wm=(t,e,n,a)=>t===(a?"left":"right")?n:t==="center"?(e+n)/2:e;function _m(t,e,n){const a=e.length;let r=0,s=a;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:b}=i.getUserBounds();if(m){if(r=Math.min(rn(c,u,f).lo,n?a:rn(e,u,i.getPixelForValue(f)).lo),d){const p=c.slice(0,r+1).reverse().findIndex(g=>!Be(g[l.axis]));r-=Math.max(0,p)}r=je(r,0,a-1)}if(b){let p=Math.max(rn(c,i.axis,h,!0).hi+1,n?0:rn(e,u,i.getPixelForValue(h),!0).hi+1);if(d){const g=c.slice(p-1).findIndex(y=>!Be(y[l.axis]));p+=Math.max(0,g)}s=je(p,r,a)-r}else s=a-r}return{start:r,count:s}}function Cm(t){const{xScale:e,yScale:n,_scaleRanges:a}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!a)return t._scaleRanges=r,!0;const s=a.xmin!==e.min||a.xmax!==e.max||a.ymin!==n.min||a.ymax!==n.max;return Object.assign(a,r),s}const Lo=t=>t===0||t===1,Pi=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Pe/n)),Ai=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Pe/n)+1,eo={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*Re)+1,easeOutSine:t=>Math.sin(t*Re),easeInOutSine:t=>-.5*(Math.cos(Ee*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=>Lo(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=>Lo(t)?t:Pi(t,.075,.3),easeOutElastic:t=>Lo(t)?t:Ai(t,.075,.3),easeInOutElastic(t){return Lo(t)?t:t<.5?.5*Pi(t*2,.1125,.45):.5+.5*Ai(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 e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-eo.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?eo.easeInBounce(t*2)*.5:eo.easeOutBounce(t*2-1)*.5+.5};function cr(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function $i(t){return cr(t)?t:new Yn(t)}function dr(t){return cr(t)?t:new Yn(t).saturate(.5).darken(.1).hexString()}const Bm=["x","y","borderWidth","radius","tension"],Sm=["color","borderColor","backgroundColor"];function Em(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Sm},numbers:{type:"number",properties:Bm}}),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:e=>e|0}}}})}function Dm(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ti=new Map;function Vm(t,e){e=e||{};const n=t+JSON.stringify(e);let a=Ti.get(n);return a||(a=new Intl.NumberFormat(t,e),Ti.set(n,a)),a}function ur(t,e,n){return Vm(e,n).format(t)}const Mm={values(t){return Oe(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const a=this.chart.options.locale;let r,s=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=Nm(t,n)}const i=_i(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),ur(t,a,c)}};function Nm(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Oi={formatters:Mm};function Pm(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:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.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:Oi.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const sn=Object.create(null),fr=Object.create(null);function to(t,e){if(!e)return t;const n=e.split(".");for(let a=0,r=n.length;a<r;++a){const s=n[a];t=t[s]||(t[s]=Object.create(null))}return t}function hr(t,e,n){return typeof e=="string"?Gn(to(t,e),n):Gn(to(t,""),e)}class Am{constructor(e,n){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)=>dr(r.backgroundColor),this.hoverBorderColor=(a,r)=>dr(r.borderColor),this.hoverColor=(a,r)=>dr(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(e),this.apply(n)}set(e,n){return hr(this,e,n)}get(e){return to(this,e)}describe(e,n){return hr(fr,e,n)}override(e,n){return hr(sn,e,n)}route(e,n,a,r){const s=to(this,e),i=to(this,a),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[l],d=i[r];return we(c)?Object.assign({},d,c):ye(c,d)},set(c){this[l]=c}}})}apply(e){e.forEach(n=>n(this))}}var Te=new Am({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Em,Dm,Pm]);function $m(t){return!t||Be(t.size)||Be(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function zi(t,e,n,a,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,n.push(r)),s>a&&(a=s),a}function ln(t,e,n){const a=t.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((e-r)*a)/a+r}function Fi(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function mr(t,e,n,a){Ri(t,e,n,a,null)}function Ri(t,e,n,a,r){let s,i,l,c,d,u,f,h;const m=e.pointStyle,b=e.rotation,p=e.radius;let g=(b||0)*cm;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,a),t.rotate(g),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(p)||p<=0)){switch(t.beginPath(),m){default:r?t.ellipse(n,a,r/2,p,0,0,Pe):t.arc(n,a,p,0,Pe),t.closePath();break;case"triangle":u=r?r/2:p,t.moveTo(n+Math.sin(g)*u,a-Math.cos(g)*p),g+=wi,t.lineTo(n+Math.sin(g)*u,a-Math.cos(g)*p),g+=wi,t.lineTo(n+Math.sin(g)*u,a-Math.cos(g)*p),t.closePath();break;case"rectRounded":d=p*.516,c=p-d,i=Math.cos(g+an)*c,f=Math.cos(g+an)*(r?r/2-d:c),l=Math.sin(g+an)*c,h=Math.sin(g+an)*(r?r/2-d:c),t.arc(n-f,a-l,d,g-Ee,g-Re),t.arc(n+h,a-i,d,g-Re,g),t.arc(n+f,a+l,d,g,g+Re),t.arc(n-h,a+i,d,g+Re,g+Ee),t.closePath();break;case"rect":if(!b){c=Math.SQRT1_2*p,u=r?r/2:c,t.rect(n-u,a-c,2*u,2*c);break}g+=an;case"rectRot":f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+h,a-i),t.lineTo(n+f,a+l),t.lineTo(n-h,a+i),t.closePath();break;case"crossRot":g+=an;case"cross":f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+f,a+l),t.moveTo(n+h,a-i),t.lineTo(n-h,a+i);break;case"star":f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+f,a+l),t.moveTo(n+h,a-i),t.lineTo(n-h,a+i),g+=an,f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+f,a+l),t.moveTo(n+h,a-i),t.lineTo(n-h,a+i);break;case"line":i=r?r/2:Math.cos(g)*p,l=Math.sin(g)*p,t.moveTo(n-i,a-l),t.lineTo(n+i,a+l);break;case"dash":t.moveTo(n,a),t.lineTo(n+Math.cos(g)*(r?r/2:p),a+Math.sin(g)*p);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function no(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Io(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function jo(t){t.restore()}function Tm(t,e,n,a,r){if(!e)return t.lineTo(n.x,n.y);if(r==="middle"){const s=(e.x+n.x)/2;t.lineTo(s,e.y),t.lineTo(s,n.y)}else r==="after"!=!!a?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Om(t,e,n,a){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(a?e.cp1x:e.cp2x,a?e.cp1y:e.cp2y,a?n.cp2x:n.cp1x,a?n.cp2y:n.cp1y,n.x,n.y)}function zm(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Be(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function Fm(t,e,n,a,r){if(r.strikethrough||r.underline){const s=t.measureText(a),i=e-s.actualBoundingBoxLeft,l=e+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,d=n+s.actualBoundingBoxDescent,u=r.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Rm(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function oo(t,e,n,a,r,s={}){const i=Oe(e)?e:[e],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=r.string,zm(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Rm(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Be(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,n,a,s.maxWidth)),t.fillText(d,n,a,s.maxWidth),Fm(t,n,a,d,s),a+=Number(r.lineHeight);t.restore()}function Wo(t,e){const{x:n,y:a,w:r,h:s,radius:i}=e;t.arc(n+i.topLeft,a+i.topLeft,i.topLeft,1.5*Ee,Ee,!0),t.lineTo(n,a+s-i.bottomLeft),t.arc(n+i.bottomLeft,a+s-i.bottomLeft,i.bottomLeft,Ee,Re,!0),t.lineTo(n+r-i.bottomRight,a+s),t.arc(n+r-i.bottomRight,a+s-i.bottomRight,i.bottomRight,Re,0,!0),t.lineTo(n+r,a+i.topRight),t.arc(n+r-i.topRight,a+i.topRight,i.topRight,0,-Re,!0),t.lineTo(n+i.topLeft,a)}const vm=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Lm=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Im(t,e){const n=(""+t).match(vm);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const jm=t=>+t||0;function pr(t,e){const n={},a=we(e),r=a?Object.keys(e):e,s=we(t)?a?i=>ye(t[i],t[e[i]]):i=>t[i]:()=>t;for(const i of r)n[i]=jm(s(i));return n}function vi(t){return pr(t,{top:"y",right:"x",bottom:"y",left:"x"})}function _n(t){return pr(t,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(t){const e=vi(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function He(t,e){t=t||{},e=e||Te.font;let n=ye(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let a=ye(t.style,e.style);a&&!(""+a).match(Lm)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const r={family:ye(t.family,e.family),lineHeight:Im(ye(t.lineHeight,e.lineHeight),n),size:n,style:a,weight:ye(t.weight,e.weight),string:""};return r.string=$m(r),r}function Ho(t,e,n,a){let r,s,i;for(r=0,s=t.length;r<s;++r)if(i=t[r],i!==void 0&&i!==void 0)return i}function Wm(t,e,n){const{min:a,max:r}=t,s=bi(e,(r-a)/2),i=(l,c)=>n&&l===0?0:l+c;return{min:i(a,-Math.abs(s)),max:i(r,s)}}function cn(t,e){return Object.assign(Object.create(t),e)}function gr(t,e=[""],n,a,r=()=>t[0]){const s=n||t;typeof a>"u"&&(a=Hi("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:a,_getTarget:r,override:l=>gr([l,...t],e,s,a)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return Ii(l,c,()=>Jm(c,e,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return qi(l).includes(c)},ownKeys(l){return qi(l)},set(l,c,d){const u=l._storage||(l._storage=r());return l[c]=u[c]=d,delete l._keys,!0}})}function Cn(t,e,n,a){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:Li(t,a),setContext:s=>Cn(t,s,n,a),override:s=>Cn(t.override(s),e,n,a)};return new Proxy(r,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return Ii(s,i,()=>qm(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 Li(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:a=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:a,isScriptable:Wt(n)?n:()=>n,isIndexable:Wt(a)?a:()=>a}}const Hm=(t,e)=>t?t+rr(e):e,br=(t,e)=>we(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Ii(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const a=n();return t[e]=a,a}function qm(t,e,n){const{_proxy:a,_context:r,_subProxy:s,_descriptors:i}=t;let l=a[e];return Wt(l)&&i.isScriptable(e)&&(l=Um(e,l,t,n)),Oe(l)&&l.length&&(l=Ym(e,l,t,i.isIndexable)),br(e,l)&&(l=Cn(l,r,s&&s[e],i)),l}function Um(t,e,n,a){const{_proxy:r,_context:s,_subProxy:i,_stack:l}=n;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=e(s,i||a);return l.delete(t),br(t,c)&&(c=yr(r._scopes,r,t,c)),c}function Ym(t,e,n,a){const{_proxy:r,_context:s,_subProxy:i,_descriptors:l}=n;if(typeof s.index<"u"&&a(t))return e[s.index%e.length];if(we(e[0])){const c=e,d=r._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=yr(d,r,t,u);e.push(Cn(f,s,i&&i[t],l))}}return e}function ji(t,e,n){return Wt(t)?t(e,n):t}const Gm=(t,e)=>t===!0?e:typeof t=="string"?on(e,t):void 0;function Km(t,e,n,a,r){for(const s of e){const i=Gm(n,s);if(i){t.add(i);const l=ji(i._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==a)return l}else if(i===!1&&typeof a<"u"&&n!==a)return null}return!1}function yr(t,e,n,a){const r=e._rootScopes,s=ji(e._fallback,n,a),i=[...t,...r],l=new Set;l.add(a);let c=Wi(l,i,n,s||n,a);return c===null||typeof s<"u"&&s!==n&&(c=Wi(l,i,s,c,a),c===null)?!1:gr(Array.from(l),[""],r,s,()=>Xm(e,n,a))}function Wi(t,e,n,a,r){for(;n;)n=Km(t,e,n,a,r);return n}function Xm(t,e,n){const a=t._getTarget();e in a||(a[e]={});const r=a[e];return Oe(r)&&we(n)?n:r||{}}function Jm(t,e,n,a){let r;for(const s of e)if(r=Hi(Hm(s,t),n),typeof r<"u")return br(t,r)?yr(n,a,t,r):r}function Hi(t,e){for(const n of e){if(!n)continue;const a=n[t];if(typeof a<"u")return a}}function qi(t){let e=t._keys;return e||(e=t._keys=Qm(t._scopes)),e}function Qm(t){const e=new Set;for(const n of t)for(const a of Object.keys(n).filter(r=>!r.startsWith("_")))e.add(a);return Array.from(e)}const Zm=Number.EPSILON||1e-14,Bn=(t,e)=>e<t.length&&!t[e].skip&&t[e],Ui=t=>t==="x"?"y":"x";function ep(t,e,n,a){const r=t.skip?e:t,s=e,i=n.skip?e:n,l=sr(s,r),c=sr(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 tp(t,e,n){const a=t.length;let r,s,i,l,c,d=Bn(t,0);for(let u=0;u<a-1;++u)if(c=d,d=Bn(t,u+1),!(!c||!d)){if(Jn(e[u],0,Zm)){n[u]=n[u+1]=0;continue}r=n[u]/e[u],s=n[u+1]/e[u],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),n[u]=r*i*e[u],n[u+1]=s*i*e[u])}}function np(t,e,n="x"){const a=Ui(n),r=t.length;let s,i,l,c=Bn(t,0);for(let d=0;d<r;++d){if(i=l,l=c,c=Bn(t,d+1),!l)continue;const u=l[n],f=l[a];i&&(s=(u-i[n])/3,l[`cp1${n}`]=u-s,l[`cp1${a}`]=f-s*e[d]),c&&(s=(c[n]-u)/3,l[`cp2${n}`]=u+s,l[`cp2${a}`]=f+s*e[d])}}function op(t,e="x"){const n=Ui(e),a=t.length,r=Array(a).fill(0),s=Array(a);let i,l,c,d=Bn(t,0);for(i=0;i<a;++i)if(l=c,c=d,d=Bn(t,i+1),!!c){if(d){const u=d[e]-c[e];r[i]=u!==0?(d[n]-c[n])/u:0}s[i]=l?d?pt(r[i-1])!==pt(r[i])?0:(r[i-1]+r[i])/2:r[i-1]:r[i]}tp(t,r,s),np(t,s,e)}function qo(t,e,n){return Math.max(Math.min(t,n),e)}function ap(t,e){let n,a,r,s,i,l=no(t[0],e);for(n=0,a=t.length;n<a;++n)i=s,s=l,l=n<a-1&&no(t[n+1],e),s&&(r=t[n],i&&(r.cp1x=qo(r.cp1x,e.left,e.right),r.cp1y=qo(r.cp1y,e.top,e.bottom)),l&&(r.cp2x=qo(r.cp2x,e.left,e.right),r.cp2y=qo(r.cp2y,e.top,e.bottom)))}function rp(t,e,n,a,r){let s,i,l,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")op(t,r);else{let d=a?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=ep(d,l,t[Math.min(s+1,i-(a?0:1))%i],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}e.capBezierPoints&&ap(t,n)}function xr(){return typeof window<"u"&&typeof document<"u"}function kr(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Uo(t,e,n){let a;return typeof t=="string"?(a=parseInt(t,10),t.indexOf("%")!==-1&&(a=a/100*e.parentNode[n])):a=t,a}const Yo=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function sp(t,e){return Yo(t).getPropertyValue(e)}const ip=["top","right","bottom","left"];function dn(t,e,n){const a={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=ip[r];a[s]=parseFloat(t[e+"-"+s+n])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const lp=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function cp(t,e){const n=t.touches,a=n&&n.length?n[0]:t,{offsetX:r,offsetY:s}=a;let i=!1,l,c;if(lp(r,s,t.target))l=r,c=s;else{const d=e.getBoundingClientRect();l=a.clientX-d.left,c=a.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function un(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:a}=e,r=Yo(n),s=r.boxSizing==="border-box",i=dn(r,"padding"),l=dn(r,"border","width"),{x:c,y:d,box:u}=cp(t,n),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:b}=e;return s&&(m-=i.width+l.width,b-=i.height+l.height),{x:Math.round((c-f)/m*n.width/a),y:Math.round((d-h)/b*n.height/a)}}function dp(t,e,n){let a,r;if(e===void 0||n===void 0){const s=t&&kr(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const i=s.getBoundingClientRect(),l=Yo(s),c=dn(l,"border","width"),d=dn(l,"padding");e=i.width-d.width-c.width,n=i.height-d.height-c.height,a=Uo(l.maxWidth,s,"clientWidth"),r=Uo(l.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:a||vo,maxHeight:r||vo}}const Ht=t=>Math.round(t*10)/10;function up(t,e,n,a){const r=Yo(t),s=dn(r,"margin"),i=Uo(r.maxWidth,t,"clientWidth")||vo,l=Uo(r.maxHeight,t,"clientHeight")||vo,c=dp(t,e,n);let{width:d,height:u}=c;if(r.boxSizing==="content-box"){const h=dn(r,"border","width"),m=dn(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=Ht(Math.min(d,i,c.maxWidth)),u=Ht(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Ht(d/2)),(e!==void 0||n!==void 0)&&a&&c.height&&u>c.height&&(u=c.height,d=Ht(Math.floor(u*a))),{width:d,height:u}}function Yi(t,e,n){const a=e||1,r=Ht(t.height*a),s=Ht(t.width*a);t.height=Ht(t.height),t.width=Ht(t.width);const i=t.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==a||i.height!==r||i.width!==s?(t.currentDevicePixelRatio=a,i.height=r,i.width=s,t.ctx.setTransform(a,0,0,a,0,0),!0):!1}const fp=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};xr()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function Gi(t,e){const n=sp(t,e),a=n&&n.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function fn(t,e,n,a){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function hp(t,e,n,a){return{x:t.x+n*(e.x-t.x),y:a==="middle"?n<.5?t.y:e.y:a==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function mp(t,e,n,a){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},i=fn(t,r,n),l=fn(r,s,n),c=fn(s,e,n),d=fn(i,l,n),u=fn(l,c,n);return fn(d,u,n)}const pp=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,a){return n-a},leftForLtr(n,a){return n-a}}},gp=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Sn(t,e,n){return t?pp(e,n):gp()}function Ki(t,e){let n,a;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,a=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=a)}function Xi(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Ji(t){return t==="angle"?{between:Zn,compare:pm,normalize:Je}:{between:Et,compare:(e,n)=>e-n,normalize:e=>e}}function Qi({start:t,end:e,count:n,loop:a,style:r}){return{start:t%n,end:e%n,loop:a&&(e-t+1)%n===0,style:r}}function bp(t,e,n){const{property:a,start:r,end:s}=n,{between:i,normalize:l}=Ji(a),c=e.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(e[d%c][a]),r,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Zi(t,e,n){if(!n)return[t];const{property:a,start:r,end:s}=n,i=e.length,{compare:l,between:c,normalize:d}=Ji(a),{start:u,end:f,loop:h,style:m}=bp(t,e,n),b=[];let p=!1,g=null,y,B,D;const M=()=>c(r,D,y)&&l(r,D)!==0,S=()=>l(s,y)===0||c(s,D,y),k=()=>p||M(),C=()=>!p||S();for(let x=u,w=u;x<=f;++x)B=e[x%i],!B.skip&&(y=d(B[a]),y!==D&&(p=c(y,r,s),g===null&&k()&&(g=l(y,r)===0?x:w),g!==null&&C()&&(b.push(Qi({start:g,end:x,loop:h,count:i,style:m})),g=null),w=x,D=y));return g!==null&&b.push(Qi({start:g,end:f,loop:h,count:i,style:m})),b}function el(t,e){const n=[],a=t.segments;for(let r=0;r<a.length;r++){const s=Zi(a[r],t.points,e);s.length&&n.push(...s)}return n}function yp(t,e,n,a){let r=0,s=e-1;if(n&&!a)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}function xp(t,e,n,a){const r=t.length,s=[];let i=e,l=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%r];d.skip||d.stop?l.skip||(a=!1,s.push({start:e%r,end:(c-1)%r,loop:a}),e=i=d.stop?c:null):(i=c,l.skip&&(e=c)),l=d}return i!==null&&s.push({start:e%r,end:i%r,loop:a}),s}function kp(t,e){const n=t.points,a=t.options.spanGaps,r=n.length;if(!r)return[];const s=!!t._loop,{start:i,end:l}=yp(n,r,s,a);if(a===!0)return tl(t,[{start:i,end:l,loop:s}],n,e);const c=l<i?l+r:l,d=!!t._fullLoop&&i===0&&l===r-1;return tl(t,xp(n,i,c,d),n,e)}function tl(t,e,n,a){return!a||!a.setContext||!n?e:wp(t,e,n,a)}function wp(t,e,n,a){const r=t._chart.getContext(),s=nl(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=n.length,d=[];let u=s,f=e[0].start,h=f;function m(b,p,g,y){const B=l?-1:1;if(b!==p){for(b+=c;n[b%c].skip;)b-=B;for(;n[p%c].skip;)p+=B;b%c!==p%c&&(d.push({start:b%c,end:p%c,loop:g,style:y}),u=y,f=p%c)}}for(const b of e){f=l?f:b.start;let p=n[f%c],g;for(h=f+1;h<=b.end;h++){const y=n[h%c];g=nl(a.setContext(cn(r,{type:"segment",p0:p,p1:y,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),_p(g,u)&&m(f,h-1,b.loop,u),p=y,u=g}f<h-1&&m(f,h-1,b.loop,u)}return d}function nl(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function _p(t,e){if(!e)return!1;const n=[],a=function(r,s){return cr(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,a)!==JSON.stringify(e,a)}function Go(t,e,n){return t.options.clip?t[n]:e[n]}function Cp(t,e){const{xScale:n,yScale:a}=t;return n&&a?{left:Go(n,e,"left"),right:Go(n,e,"right"),top:Go(a,e,"top"),bottom:Go(a,e,"bottom")}:e}function ol(t,e){const n=e._clip;if(n.disabled)return!1;const a=Cp(e,t.chartArea);return{left:n.left===!1?0:a.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:a.right+(n.right===!0?0:n.right),top:n.top===!1?0:a.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:a.bottom+(n.bottom===!0?0:n.bottom)}}/*!
11
+ */function Bt(){}const tm=(()=>{let t=0;return()=>t++})();function Be(t){return t==null}function Oe(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function we(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function Ie(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function mt(t,e){return Ie(t)?t:e}function ye(t,e){return typeof t>"u"?e:t}const nm=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/e,gi=(t,e)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*e:+t;function Me(t,e,n){if(t&&typeof t.call=="function")return t.apply(n,e)}function Se(t,e,n,a){let r,s,i;if(Oe(t))for(s=t.length,r=0;r<s;r++)e.call(n,t[r],r);else if(we(t))for(i=Object.keys(t),s=i.length,r=0;r<s;r++)e.call(n,t[i[r]],i[r])}function Fo(t,e){let n,a,r,s;if(!t||!e||t.length!==e.length)return!1;for(n=0,a=t.length;n<a;++n)if(r=t[n],s=e[n],r.datasetIndex!==s.datasetIndex||r.index!==s.index)return!1;return!0}function Ro(t){if(Oe(t))return t.map(Ro);if(we(t)){const e=Object.create(null),n=Object.keys(t),a=n.length;let r=0;for(;r<a;++r)e[n[r]]=Ro(t[n[r]]);return e}return t}function bi(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function om(t,e,n,a){if(!bi(t))return;const r=e[t],s=n[t];we(r)&&we(s)?Gn(r,s,a):e[t]=Ro(s)}function Gn(t,e,n){const a=Oe(e)?e:[e],r=a.length;if(!we(t))return t;n=n||{};const s=n.merger||om;let i;for(let l=0;l<r;++l){if(i=a[l],!we(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,n)}return t}function Kn(t,e){return Gn(t,e,{merger:am})}function am(t,e,n){if(!bi(t))return;const a=e[t],r=n[t];we(a)&&we(r)?Kn(a,r):Object.prototype.hasOwnProperty.call(e,t)||(e[t]=Ro(r))}const yi={"":t=>t,x:t=>t.x,y:t=>t.y};function rm(t){const e=t.split("."),n=[];let a="";for(const r of e)a+=r,a.endsWith("\\")?a=a.slice(0,-1)+".":(n.push(a),a="");return n}function sm(t){const e=rm(t);return n=>{for(const a of e){if(a==="")break;n=n&&n[a]}return n}}function on(t,e){return(yi[e]||(yi[e]=sm(e)))(t)}function rr(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Xn=t=>typeof t<"u",Wt=t=>typeof t=="function",xi=(t,e)=>{if(t.size!==e.size)return!1;for(const n of t)if(!e.has(n))return!1;return!0};function im(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Ee=Math.PI,Pe=2*Ee,lm=Pe+Ee,vo=Number.POSITIVE_INFINITY,cm=Ee/180,Re=Ee/2,an=Ee/4,ki=Ee*2/3,wi=Math.log10,pt=Math.sign;function Jn(t,e,n){return Math.abs(t-e)<n}function _i(t){const e=Math.round(t);t=Jn(t,e,t/1e3)?e:t;const n=Math.pow(10,Math.floor(wi(t))),a=t/n;return(a<=1?1:a<=2?2:a<=5?5:10)*n}function dm(t){const e=[],n=Math.sqrt(t);let a;for(a=1;a<n;a++)t%a===0&&(e.push(a),e.push(t/a));return n===(n|0)&&e.push(n),e.sort((r,s)=>r-s).pop(),e}function um(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Qn(t){return!um(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function fm(t,e){const n=Math.round(t);return n-e<=t&&n+e>=t}function hm(t,e,n){let a,r,s;for(a=0,r=t.length;a<r;a++)s=t[a][n],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function St(t){return t*(Ee/180)}function mm(t){return t*(180/Ee)}function Ci(t){if(!Ie(t))return;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n++;return n}function Bi(t,e){const n=e.x-t.x,a=e.y-t.y,r=Math.sqrt(n*n+a*a);let s=Math.atan2(a,n);return s<-.5*Ee&&(s+=Pe),{angle:s,distance:r}}function sr(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function pm(t,e){return(t-e+lm)%Pe-Ee}function Je(t){return(t%Pe+Pe)%Pe}function Zn(t,e,n,a){const r=Je(t),s=Je(e),i=Je(n),l=Je(s-r),c=Je(i-r),d=Je(r-s),u=Je(r-i);return r===s||r===i||a&&s===i||l>c&&d<u}function je(t,e,n){return Math.max(e,Math.min(n,t))}function gm(t){return je(t,-32768,32767)}function Et(t,e,n,a=1e-6){return t>=Math.min(e,n)-a&&t<=Math.max(e,n)+a}function ir(t,e,n){n=n||(i=>t[i]<e);let a=t.length-1,r=0,s;for(;a-r>1;)s=r+a>>1,n(s)?r=s:a=s;return{lo:r,hi:a}}const rn=(t,e,n,a)=>ir(t,n,a?r=>{const s=t[r][e];return s<n||s===n&&t[r+1][e]===n}:r=>t[r][e]<n),bm=(t,e,n)=>ir(t,n,a=>t[a][e]>=n);function ym(t,e,n){let a=0,r=t.length;for(;a<r&&t[a]<e;)a++;for(;r>a&&t[r-1]>n;)r--;return a>0||r<t.length?t.slice(a,r):t}const Si=["push","pop","shift","splice","unshift"];function xm(t,e){if(t._chartjs){t._chartjs.listeners.push(e);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Si.forEach(n=>{const a="_onData"+rr(n),r=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!1,value(...s){const i=r.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[a]=="function"&&l[a](...s)}),i}})})}function Ei(t,e){const n=t._chartjs;if(!n)return;const a=n.listeners,r=a.indexOf(e);r!==-1&&a.splice(r,1),!(a.length>0)&&(Si.forEach(s=>{delete t[s]}),delete t._chartjs)}function Di(t){const e=new Set(t);return e.size===t.length?t:Array.from(e)}const Vi=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Mi(t,e){let n=[],a=!1;return function(...r){n=r,a||(a=!0,Vi.call(window,()=>{a=!1,t.apply(e,n)}))}}function km(t,e){let n;return function(...a){return e?(clearTimeout(n),n=setTimeout(t,e,a)):t.apply(this,a),e}}const lr=t=>t==="start"?"left":t==="end"?"right":"center",We=(t,e,n)=>t==="start"?e:t==="end"?n:(e+n)/2,wm=(t,e,n,a)=>t===(a?"left":"right")?n:t==="center"?(e+n)/2:e;function _m(t,e,n){const a=e.length;let r=0,s=a;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:b}=i.getUserBounds();if(m){if(r=Math.min(rn(c,u,f).lo,n?a:rn(e,u,i.getPixelForValue(f)).lo),d){const p=c.slice(0,r+1).reverse().findIndex(g=>!Be(g[l.axis]));r-=Math.max(0,p)}r=je(r,0,a-1)}if(b){let p=Math.max(rn(c,i.axis,h,!0).hi+1,n?0:rn(e,u,i.getPixelForValue(h),!0).hi+1);if(d){const g=c.slice(p-1).findIndex(y=>!Be(y[l.axis]));p+=Math.max(0,g)}s=je(p,r,a)-r}else s=a-r}return{start:r,count:s}}function Cm(t){const{xScale:e,yScale:n,_scaleRanges:a}=t,r={xmin:e.min,xmax:e.max,ymin:n.min,ymax:n.max};if(!a)return t._scaleRanges=r,!0;const s=a.xmin!==e.min||a.xmax!==e.max||a.ymin!==n.min||a.ymax!==n.max;return Object.assign(a,r),s}const Lo=t=>t===0||t===1,Ni=(t,e,n)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-e)*Pe/n)),Pi=(t,e,n)=>Math.pow(2,-10*t)*Math.sin((t-e)*Pe/n)+1,eo={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*Re)+1,easeOutSine:t=>Math.sin(t*Re),easeInOutSine:t=>-.5*(Math.cos(Ee*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=>Lo(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=>Lo(t)?t:Ni(t,.075,.3),easeOutElastic:t=>Lo(t)?t:Pi(t,.075,.3),easeInOutElastic(t){return Lo(t)?t:t<.5?.5*Ni(t*2,.1125,.45):.5+.5*Pi(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 e=1.70158;return(t/=.5)<1?.5*(t*t*(((e*=1.525)+1)*t-e)):.5*((t-=2)*t*(((e*=1.525)+1)*t+e)+2)},easeInBounce:t=>1-eo.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?eo.easeInBounce(t*2)*.5:eo.easeOutBounce(t*2-1)*.5+.5};function cr(t){if(t&&typeof t=="object"){const e=t.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Ai(t){return cr(t)?t:new Yn(t)}function dr(t){return cr(t)?t:new Yn(t).saturate(.5).darken(.1).hexString()}const Bm=["x","y","borderWidth","radius","tension"],Sm=["color","borderColor","backgroundColor"];function Em(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),t.set("animations",{colors:{type:"color",properties:Sm},numbers:{type:"number",properties:Bm}}),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:e=>e|0}}}})}function Dm(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const $i=new Map;function Vm(t,e){e=e||{};const n=t+JSON.stringify(e);let a=$i.get(n);return a||(a=new Intl.NumberFormat(t,e),$i.set(n,a)),a}function ur(t,e,n){return Vm(e,n).format(t)}const Mm={values(t){return Oe(t)?t:""+t},numeric(t,e,n){if(t===0)return"0";const a=this.chart.options.locale;let r,s=t;if(n.length>1){const d=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(d<1e-4||d>1e15)&&(r="scientific"),s=Nm(t,n)}const i=wi(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),ur(t,a,c)}};function Nm(t,e){let n=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(n)>=1&&t!==Math.floor(t)&&(n=t-Math.floor(t)),n}var Ti={formatters:Mm};function Pm(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:(e,n)=>n.lineWidth,tickColor:(e,n)=>n.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:Ti.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const sn=Object.create(null),fr=Object.create(null);function to(t,e){if(!e)return t;const n=e.split(".");for(let a=0,r=n.length;a<r;++a){const s=n[a];t=t[s]||(t[s]=Object.create(null))}return t}function hr(t,e,n){return typeof e=="string"?Gn(to(t,e),n):Gn(to(t,""),e)}class Am{constructor(e,n){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)=>dr(r.backgroundColor),this.hoverBorderColor=(a,r)=>dr(r.borderColor),this.hoverColor=(a,r)=>dr(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(e),this.apply(n)}set(e,n){return hr(this,e,n)}get(e){return to(this,e)}describe(e,n){return hr(fr,e,n)}override(e,n){return hr(sn,e,n)}route(e,n,a,r){const s=to(this,e),i=to(this,a),l="_"+n;Object.defineProperties(s,{[l]:{value:s[n],writable:!0},[n]:{enumerable:!0,get(){const c=this[l],d=i[r];return we(c)?Object.assign({},d,c):ye(c,d)},set(c){this[l]=c}}})}apply(e){e.forEach(n=>n(this))}}var Te=new Am({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Em,Dm,Pm]);function $m(t){return!t||Be(t.size)||Be(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Oi(t,e,n,a,r){let s=e[r];return s||(s=e[r]=t.measureText(r).width,n.push(r)),s>a&&(a=s),a}function ln(t,e,n){const a=t.currentDevicePixelRatio,r=n!==0?Math.max(n/2,.5):0;return Math.round((e-r)*a)/a+r}function zi(t,e){!e&&!t||(e=e||t.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,t.width,t.height),e.restore())}function mr(t,e,n,a){Fi(t,e,n,a,null)}function Fi(t,e,n,a,r){let s,i,l,c,d,u,f,h;const m=e.pointStyle,b=e.rotation,p=e.radius;let g=(b||0)*cm;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(n,a),t.rotate(g),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(p)||p<=0)){switch(t.beginPath(),m){default:r?t.ellipse(n,a,r/2,p,0,0,Pe):t.arc(n,a,p,0,Pe),t.closePath();break;case"triangle":u=r?r/2:p,t.moveTo(n+Math.sin(g)*u,a-Math.cos(g)*p),g+=ki,t.lineTo(n+Math.sin(g)*u,a-Math.cos(g)*p),g+=ki,t.lineTo(n+Math.sin(g)*u,a-Math.cos(g)*p),t.closePath();break;case"rectRounded":d=p*.516,c=p-d,i=Math.cos(g+an)*c,f=Math.cos(g+an)*(r?r/2-d:c),l=Math.sin(g+an)*c,h=Math.sin(g+an)*(r?r/2-d:c),t.arc(n-f,a-l,d,g-Ee,g-Re),t.arc(n+h,a-i,d,g-Re,g),t.arc(n+f,a+l,d,g,g+Re),t.arc(n-h,a+i,d,g+Re,g+Ee),t.closePath();break;case"rect":if(!b){c=Math.SQRT1_2*p,u=r?r/2:c,t.rect(n-u,a-c,2*u,2*c);break}g+=an;case"rectRot":f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+h,a-i),t.lineTo(n+f,a+l),t.lineTo(n-h,a+i),t.closePath();break;case"crossRot":g+=an;case"cross":f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+f,a+l),t.moveTo(n+h,a-i),t.lineTo(n-h,a+i);break;case"star":f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+f,a+l),t.moveTo(n+h,a-i),t.lineTo(n-h,a+i),g+=an,f=Math.cos(g)*(r?r/2:p),i=Math.cos(g)*p,l=Math.sin(g)*p,h=Math.sin(g)*(r?r/2:p),t.moveTo(n-f,a-l),t.lineTo(n+f,a+l),t.moveTo(n+h,a-i),t.lineTo(n-h,a+i);break;case"line":i=r?r/2:Math.cos(g)*p,l=Math.sin(g)*p,t.moveTo(n-i,a-l),t.lineTo(n+i,a+l);break;case"dash":t.moveTo(n,a),t.lineTo(n+Math.cos(g)*(r?r/2:p),a+Math.sin(g)*p);break;case!1:t.closePath();break}t.fill(),e.borderWidth>0&&t.stroke()}}function no(t,e,n){return n=n||.5,!e||t&&t.x>e.left-n&&t.x<e.right+n&&t.y>e.top-n&&t.y<e.bottom+n}function Io(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()}function jo(t){t.restore()}function Tm(t,e,n,a,r){if(!e)return t.lineTo(n.x,n.y);if(r==="middle"){const s=(e.x+n.x)/2;t.lineTo(s,e.y),t.lineTo(s,n.y)}else r==="after"!=!!a?t.lineTo(e.x,n.y):t.lineTo(n.x,e.y);t.lineTo(n.x,n.y)}function Om(t,e,n,a){if(!e)return t.lineTo(n.x,n.y);t.bezierCurveTo(a?e.cp1x:e.cp2x,a?e.cp1y:e.cp2y,a?n.cp2x:n.cp1x,a?n.cp2y:n.cp1y,n.x,n.y)}function zm(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]),Be(e.rotation)||t.rotate(e.rotation),e.color&&(t.fillStyle=e.color),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline)}function Fm(t,e,n,a,r){if(r.strikethrough||r.underline){const s=t.measureText(a),i=e-s.actualBoundingBoxLeft,l=e+s.actualBoundingBoxRight,c=n-s.actualBoundingBoxAscent,d=n+s.actualBoundingBoxDescent,u=r.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=r.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Rm(t,e){const n=t.fillStyle;t.fillStyle=e.color,t.fillRect(e.left,e.top,e.width,e.height),t.fillStyle=n}function oo(t,e,n,a,r,s={}){const i=Oe(e)?e:[e],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=r.string,zm(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Rm(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Be(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,n,a,s.maxWidth)),t.fillText(d,n,a,s.maxWidth),Fm(t,n,a,d,s),a+=Number(r.lineHeight);t.restore()}function Wo(t,e){const{x:n,y:a,w:r,h:s,radius:i}=e;t.arc(n+i.topLeft,a+i.topLeft,i.topLeft,1.5*Ee,Ee,!0),t.lineTo(n,a+s-i.bottomLeft),t.arc(n+i.bottomLeft,a+s-i.bottomLeft,i.bottomLeft,Ee,Re,!0),t.lineTo(n+r-i.bottomRight,a+s),t.arc(n+r-i.bottomRight,a+s-i.bottomRight,i.bottomRight,Re,0,!0),t.lineTo(n+r,a+i.topRight),t.arc(n+r-i.topRight,a+i.topRight,i.topRight,0,-Re,!0),t.lineTo(n+i.topLeft,a)}const vm=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Lm=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Im(t,e){const n=(""+t).match(vm);if(!n||n[1]==="normal")return e*1.2;switch(t=+n[2],n[3]){case"px":return t;case"%":t/=100;break}return e*t}const jm=t=>+t||0;function pr(t,e){const n={},a=we(e),r=a?Object.keys(e):e,s=we(t)?a?i=>ye(t[i],t[e[i]]):i=>t[i]:()=>t;for(const i of r)n[i]=jm(s(i));return n}function Ri(t){return pr(t,{top:"y",right:"x",bottom:"y",left:"x"})}function _n(t){return pr(t,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(t){const e=Ri(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function He(t,e){t=t||{},e=e||Te.font;let n=ye(t.size,e.size);typeof n=="string"&&(n=parseInt(n,10));let a=ye(t.style,e.style);a&&!(""+a).match(Lm)&&(console.warn('Invalid font style specified: "'+a+'"'),a=void 0);const r={family:ye(t.family,e.family),lineHeight:Im(ye(t.lineHeight,e.lineHeight),n),size:n,style:a,weight:ye(t.weight,e.weight),string:""};return r.string=$m(r),r}function Ho(t,e,n,a){let r,s,i;for(r=0,s=t.length;r<s;++r)if(i=t[r],i!==void 0&&i!==void 0)return i}function Wm(t,e,n){const{min:a,max:r}=t,s=gi(e,(r-a)/2),i=(l,c)=>n&&l===0?0:l+c;return{min:i(a,-Math.abs(s)),max:i(r,s)}}function cn(t,e){return Object.assign(Object.create(t),e)}function gr(t,e=[""],n,a,r=()=>t[0]){const s=n||t;typeof a>"u"&&(a=Wi("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:a,_getTarget:r,override:l=>gr([l,...t],e,s,a)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return Li(l,c,()=>Jm(c,e,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Hi(l).includes(c)},ownKeys(l){return Hi(l)},set(l,c,d){const u=l._storage||(l._storage=r());return l[c]=u[c]=d,delete l._keys,!0}})}function Cn(t,e,n,a){const r={_cacheable:!1,_proxy:t,_context:e,_subProxy:n,_stack:new Set,_descriptors:vi(t,a),setContext:s=>Cn(t,s,n,a),override:s=>Cn(t.override(s),e,n,a)};return new Proxy(r,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return Li(s,i,()=>qm(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 vi(t,e={scriptable:!0,indexable:!0}){const{_scriptable:n=e.scriptable,_indexable:a=e.indexable,_allKeys:r=e.allKeys}=t;return{allKeys:r,scriptable:n,indexable:a,isScriptable:Wt(n)?n:()=>n,isIndexable:Wt(a)?a:()=>a}}const Hm=(t,e)=>t?t+rr(e):e,br=(t,e)=>we(e)&&t!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Li(t,e,n){if(Object.prototype.hasOwnProperty.call(t,e)||e==="constructor")return t[e];const a=n();return t[e]=a,a}function qm(t,e,n){const{_proxy:a,_context:r,_subProxy:s,_descriptors:i}=t;let l=a[e];return Wt(l)&&i.isScriptable(e)&&(l=Um(e,l,t,n)),Oe(l)&&l.length&&(l=Ym(e,l,t,i.isIndexable)),br(e,l)&&(l=Cn(l,r,s&&s[e],i)),l}function Um(t,e,n,a){const{_proxy:r,_context:s,_subProxy:i,_stack:l}=n;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=e(s,i||a);return l.delete(t),br(t,c)&&(c=yr(r._scopes,r,t,c)),c}function Ym(t,e,n,a){const{_proxy:r,_context:s,_subProxy:i,_descriptors:l}=n;if(typeof s.index<"u"&&a(t))return e[s.index%e.length];if(we(e[0])){const c=e,d=r._scopes.filter(u=>u!==c);e=[];for(const u of c){const f=yr(d,r,t,u);e.push(Cn(f,s,i&&i[t],l))}}return e}function Ii(t,e,n){return Wt(t)?t(e,n):t}const Gm=(t,e)=>t===!0?e:typeof t=="string"?on(e,t):void 0;function Km(t,e,n,a,r){for(const s of e){const i=Gm(n,s);if(i){t.add(i);const l=Ii(i._fallback,n,r);if(typeof l<"u"&&l!==n&&l!==a)return l}else if(i===!1&&typeof a<"u"&&n!==a)return null}return!1}function yr(t,e,n,a){const r=e._rootScopes,s=Ii(e._fallback,n,a),i=[...t,...r],l=new Set;l.add(a);let c=ji(l,i,n,s||n,a);return c===null||typeof s<"u"&&s!==n&&(c=ji(l,i,s,c,a),c===null)?!1:gr(Array.from(l),[""],r,s,()=>Xm(e,n,a))}function ji(t,e,n,a,r){for(;n;)n=Km(t,e,n,a,r);return n}function Xm(t,e,n){const a=t._getTarget();e in a||(a[e]={});const r=a[e];return Oe(r)&&we(n)?n:r||{}}function Jm(t,e,n,a){let r;for(const s of e)if(r=Wi(Hm(s,t),n),typeof r<"u")return br(t,r)?yr(n,a,t,r):r}function Wi(t,e){for(const n of e){if(!n)continue;const a=n[t];if(typeof a<"u")return a}}function Hi(t){let e=t._keys;return e||(e=t._keys=Qm(t._scopes)),e}function Qm(t){const e=new Set;for(const n of t)for(const a of Object.keys(n).filter(r=>!r.startsWith("_")))e.add(a);return Array.from(e)}const Zm=Number.EPSILON||1e-14,Bn=(t,e)=>e<t.length&&!t[e].skip&&t[e],qi=t=>t==="x"?"y":"x";function ep(t,e,n,a){const r=t.skip?e:t,s=e,i=n.skip?e:n,l=sr(s,r),c=sr(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 tp(t,e,n){const a=t.length;let r,s,i,l,c,d=Bn(t,0);for(let u=0;u<a-1;++u)if(c=d,d=Bn(t,u+1),!(!c||!d)){if(Jn(e[u],0,Zm)){n[u]=n[u+1]=0;continue}r=n[u]/e[u],s=n[u+1]/e[u],l=Math.pow(r,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),n[u]=r*i*e[u],n[u+1]=s*i*e[u])}}function np(t,e,n="x"){const a=qi(n),r=t.length;let s,i,l,c=Bn(t,0);for(let d=0;d<r;++d){if(i=l,l=c,c=Bn(t,d+1),!l)continue;const u=l[n],f=l[a];i&&(s=(u-i[n])/3,l[`cp1${n}`]=u-s,l[`cp1${a}`]=f-s*e[d]),c&&(s=(c[n]-u)/3,l[`cp2${n}`]=u+s,l[`cp2${a}`]=f+s*e[d])}}function op(t,e="x"){const n=qi(e),a=t.length,r=Array(a).fill(0),s=Array(a);let i,l,c,d=Bn(t,0);for(i=0;i<a;++i)if(l=c,c=d,d=Bn(t,i+1),!!c){if(d){const u=d[e]-c[e];r[i]=u!==0?(d[n]-c[n])/u:0}s[i]=l?d?pt(r[i-1])!==pt(r[i])?0:(r[i-1]+r[i])/2:r[i-1]:r[i]}tp(t,r,s),np(t,s,e)}function qo(t,e,n){return Math.max(Math.min(t,n),e)}function ap(t,e){let n,a,r,s,i,l=no(t[0],e);for(n=0,a=t.length;n<a;++n)i=s,s=l,l=n<a-1&&no(t[n+1],e),s&&(r=t[n],i&&(r.cp1x=qo(r.cp1x,e.left,e.right),r.cp1y=qo(r.cp1y,e.top,e.bottom)),l&&(r.cp2x=qo(r.cp2x,e.left,e.right),r.cp2y=qo(r.cp2y,e.top,e.bottom)))}function rp(t,e,n,a,r){let s,i,l,c;if(e.spanGaps&&(t=t.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")op(t,r);else{let d=a?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=ep(d,l,t[Math.min(s+1,i-(a?0:1))%i],e.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}e.capBezierPoints&&ap(t,n)}function xr(){return typeof window<"u"&&typeof document<"u"}function kr(t){let e=t.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Uo(t,e,n){let a;return typeof t=="string"?(a=parseInt(t,10),t.indexOf("%")!==-1&&(a=a/100*e.parentNode[n])):a=t,a}const Yo=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function sp(t,e){return Yo(t).getPropertyValue(e)}const ip=["top","right","bottom","left"];function dn(t,e,n){const a={};n=n?"-"+n:"";for(let r=0;r<4;r++){const s=ip[r];a[s]=parseFloat(t[e+"-"+s+n])||0}return a.width=a.left+a.right,a.height=a.top+a.bottom,a}const lp=(t,e,n)=>(t>0||e>0)&&(!n||!n.shadowRoot);function cp(t,e){const n=t.touches,a=n&&n.length?n[0]:t,{offsetX:r,offsetY:s}=a;let i=!1,l,c;if(lp(r,s,t.target))l=r,c=s;else{const d=e.getBoundingClientRect();l=a.clientX-d.left,c=a.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function un(t,e){if("native"in t)return t;const{canvas:n,currentDevicePixelRatio:a}=e,r=Yo(n),s=r.boxSizing==="border-box",i=dn(r,"padding"),l=dn(r,"border","width"),{x:c,y:d,box:u}=cp(t,n),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:b}=e;return s&&(m-=i.width+l.width,b-=i.height+l.height),{x:Math.round((c-f)/m*n.width/a),y:Math.round((d-h)/b*n.height/a)}}function dp(t,e,n){let a,r;if(e===void 0||n===void 0){const s=t&&kr(t);if(!s)e=t.clientWidth,n=t.clientHeight;else{const i=s.getBoundingClientRect(),l=Yo(s),c=dn(l,"border","width"),d=dn(l,"padding");e=i.width-d.width-c.width,n=i.height-d.height-c.height,a=Uo(l.maxWidth,s,"clientWidth"),r=Uo(l.maxHeight,s,"clientHeight")}}return{width:e,height:n,maxWidth:a||vo,maxHeight:r||vo}}const Ht=t=>Math.round(t*10)/10;function up(t,e,n,a){const r=Yo(t),s=dn(r,"margin"),i=Uo(r.maxWidth,t,"clientWidth")||vo,l=Uo(r.maxHeight,t,"clientHeight")||vo,c=dp(t,e,n);let{width:d,height:u}=c;if(r.boxSizing==="content-box"){const h=dn(r,"border","width"),m=dn(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=Ht(Math.min(d,i,c.maxWidth)),u=Ht(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Ht(d/2)),(e!==void 0||n!==void 0)&&a&&c.height&&u>c.height&&(u=c.height,d=Ht(Math.floor(u*a))),{width:d,height:u}}function Ui(t,e,n){const a=e||1,r=Ht(t.height*a),s=Ht(t.width*a);t.height=Ht(t.height),t.width=Ht(t.width);const i=t.canvas;return i.style&&(n||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==a||i.height!==r||i.width!==s?(t.currentDevicePixelRatio=a,i.height=r,i.width=s,t.ctx.setTransform(a,0,0,a,0,0),!0):!1}const fp=(function(){let t=!1;try{const e={get passive(){return t=!0,!1}};xr()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return t})();function Yi(t,e){const n=sp(t,e),a=n&&n.match(/^(\d+)(\.\d+)?px$/);return a?+a[1]:void 0}function fn(t,e,n,a){return{x:t.x+n*(e.x-t.x),y:t.y+n*(e.y-t.y)}}function hp(t,e,n,a){return{x:t.x+n*(e.x-t.x),y:a==="middle"?n<.5?t.y:e.y:a==="after"?n<1?t.y:e.y:n>0?e.y:t.y}}function mp(t,e,n,a){const r={x:t.cp2x,y:t.cp2y},s={x:e.cp1x,y:e.cp1y},i=fn(t,r,n),l=fn(r,s,n),c=fn(s,e,n),d=fn(i,l,n),u=fn(l,c,n);return fn(d,u,n)}const pp=function(t,e){return{x(n){return t+t+e-n},setWidth(n){e=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,a){return n-a},leftForLtr(n,a){return n-a}}},gp=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,e){return t+e},leftForLtr(t,e){return t}}};function Sn(t,e,n){return t?pp(e,n):gp()}function Gi(t,e){let n,a;(e==="ltr"||e==="rtl")&&(n=t.canvas.style,a=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",e,"important"),t.prevTextDirection=a)}function Ki(t,e){e!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Xi(t){return t==="angle"?{between:Zn,compare:pm,normalize:Je}:{between:Et,compare:(e,n)=>e-n,normalize:e=>e}}function Ji({start:t,end:e,count:n,loop:a,style:r}){return{start:t%n,end:e%n,loop:a&&(e-t+1)%n===0,style:r}}function bp(t,e,n){const{property:a,start:r,end:s}=n,{between:i,normalize:l}=Xi(a),c=e.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(e[d%c][a]),r,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function Qi(t,e,n){if(!n)return[t];const{property:a,start:r,end:s}=n,i=e.length,{compare:l,between:c,normalize:d}=Xi(a),{start:u,end:f,loop:h,style:m}=bp(t,e,n),b=[];let p=!1,g=null,y,B,D;const M=()=>c(r,D,y)&&l(r,D)!==0,S=()=>l(s,y)===0||c(s,D,y),k=()=>p||M(),C=()=>!p||S();for(let x=u,w=u;x<=f;++x)B=e[x%i],!B.skip&&(y=d(B[a]),y!==D&&(p=c(y,r,s),g===null&&k()&&(g=l(y,r)===0?x:w),g!==null&&C()&&(b.push(Ji({start:g,end:x,loop:h,count:i,style:m})),g=null),w=x,D=y));return g!==null&&b.push(Ji({start:g,end:f,loop:h,count:i,style:m})),b}function Zi(t,e){const n=[],a=t.segments;for(let r=0;r<a.length;r++){const s=Qi(a[r],t.points,e);s.length&&n.push(...s)}return n}function yp(t,e,n,a){let r=0,s=e-1;if(n&&!a)for(;r<e&&!t[r].skip;)r++;for(;r<e&&t[r].skip;)r++;for(r%=e,n&&(s+=r);s>r&&t[s%e].skip;)s--;return s%=e,{start:r,end:s}}function xp(t,e,n,a){const r=t.length,s=[];let i=e,l=t[e],c;for(c=e+1;c<=n;++c){const d=t[c%r];d.skip||d.stop?l.skip||(a=!1,s.push({start:e%r,end:(c-1)%r,loop:a}),e=i=d.stop?c:null):(i=c,l.skip&&(e=c)),l=d}return i!==null&&s.push({start:e%r,end:i%r,loop:a}),s}function kp(t,e){const n=t.points,a=t.options.spanGaps,r=n.length;if(!r)return[];const s=!!t._loop,{start:i,end:l}=yp(n,r,s,a);if(a===!0)return el(t,[{start:i,end:l,loop:s}],n,e);const c=l<i?l+r:l,d=!!t._fullLoop&&i===0&&l===r-1;return el(t,xp(n,i,c,d),n,e)}function el(t,e,n,a){return!a||!a.setContext||!n?e:wp(t,e,n,a)}function wp(t,e,n,a){const r=t._chart.getContext(),s=tl(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=n.length,d=[];let u=s,f=e[0].start,h=f;function m(b,p,g,y){const B=l?-1:1;if(b!==p){for(b+=c;n[b%c].skip;)b-=B;for(;n[p%c].skip;)p+=B;b%c!==p%c&&(d.push({start:b%c,end:p%c,loop:g,style:y}),u=y,f=p%c)}}for(const b of e){f=l?f:b.start;let p=n[f%c],g;for(h=f+1;h<=b.end;h++){const y=n[h%c];g=tl(a.setContext(cn(r,{type:"segment",p0:p,p1:y,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),_p(g,u)&&m(f,h-1,b.loop,u),p=y,u=g}f<h-1&&m(f,h-1,b.loop,u)}return d}function tl(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function _p(t,e){if(!e)return!1;const n=[],a=function(r,s){return cr(s)?(n.includes(s)||n.push(s),n.indexOf(s)):s};return JSON.stringify(t,a)!==JSON.stringify(e,a)}function Go(t,e,n){return t.options.clip?t[n]:e[n]}function Cp(t,e){const{xScale:n,yScale:a}=t;return n&&a?{left:Go(n,e,"left"),right:Go(n,e,"right"),top:Go(a,e,"top"),bottom:Go(a,e,"bottom")}:e}function nl(t,e){const n=e._clip;if(n.disabled)return!1;const a=Cp(e,t.chartArea);return{left:n.left===!1?0:a.left-(n.left===!0?0:n.left),right:n.right===!1?t.width:a.right+(n.right===!0?0:n.right),top:n.top===!1?0:a.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?t.height:a.bottom+(n.bottom===!0?0:n.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 Bp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,a,r){const s=n.listeners[r],i=n.duration;s.forEach(l=>l({chart:e,initial:n.initial,numSteps:i,currentStep:Math.min(a-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=Mi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=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(e),l=!0):(s[i]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,a,e,"progress")),s.length||(a.running=!1,this._notify(r,a,e,"complete"),a.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let a=n.get(e);return a||(a={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,a)),a}listen(e,n,a){this._getAnims(e).listeners[n].push(a)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((a,r)=>Math.max(a,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const a=n.items;let r=a.length-1;for(;r>=0;--r)a[r].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Dt=new Bp;const al="transparent",Sp={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const a=$i(t||al),r=a.valid&&$i(e||al);return r&&r.valid?r.mix(a,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Ep{constructor(e,n,a,r){const s=n[a];r=Ho([e.to,r,s,e.from]);const i=Ho([e.from,s,r]);this._active=!0,this._fn=e.fn||Sp[e.type||typeof i],this._easing=eo[e.easing]||eo.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=a,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(e,n,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,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Ho([e.to,n,r,e.from]),this._from=Ho([e.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-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||n<a),!this._active){this._target[r]=l,this._notify(!0);return}if(n<0){this._target[r]=s;return}c=n/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 e=this._promises||(this._promises=[]);return new Promise((n,a)=>{e.push({res:n,rej:a})})}_notify(e){const n=e?"res":"rej",a=this._promises||[];for(let r=0;r<a.length;r++)a[r][n]()}}class rl{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!we(e))return;const n=Object.keys(Te.animation),a=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const s=e[r];if(!we(s))return;const i={};for(const l of n)i[l]=s[l];(Oe(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!a.has(l))&&a.set(l,i)})})}_animateOptions(e,n){const a=n.options,r=Vp(e,a);if(!r)return[];const s=this._createAnimations(r,a);return a.$shared&&Dp(e.options.$animations,a).then(()=>{e.options=a},()=>{}),s}_createAnimations(e,n){const a=this._properties,r=[],s=e.$animations||(e.$animations={}),i=Object.keys(n),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(e,n));continue}const u=n[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){e[d]=u;continue}s[d]=f=new Ep(h,e,d,u),r.push(f)}return r}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const a=this._createAnimations(e,n);if(a.length)return Dt.add(this._chart,a),!0}}function Dp(t,e){const n=[],a=Object.keys(e);for(let r=0;r<a.length;r++){const s=t[a[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function Vp(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function sl(t,e){const n=t&&t.options||{},a=n.reverse,r=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:a?s:r,end:a?r:s}}function Mp(t,e,n){if(n===!1)return!1;const a=sl(t,n),r=sl(e,n);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Np(t){let e,n,a,r;return we(t)?(e=t.top,n=t.right,a=t.bottom,r=t.left):e=n=a=r=t,{top:e,right:n,bottom:a,left:r,disabled:t===!1}}function il(t,e){const n=[],a=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=a.length;r<s;++r)n.push(a[r].index);return n}function ll(t,e,n,a={}){const r=t.keys,s=a.mode==="single";let i,l,c,d;if(e===null)return;let u=!1;for(i=0,l=r.length;i<l;++i){if(c=+r[i],c===n){if(u=!0,a.all)continue;break}d=t.values[c],Ie(d)&&(s||e===0||pt(e)===pt(d))&&(e+=d)}return!u&&!a.all?0:e}function Pp(t,e){const{iScale:n,vScale:a}=e,r=n.axis==="x"?"x":"y",s=a.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]={[r]:u,[s]:t[u]};return l}function wr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function Ap(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function $p(t){const{min:e,max:n,minDefined:a,maxDefined:r}=t.getUserBounds();return{min:a?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function Tp(t,e,n){const a=t[e]||(t[e]={});return a[n]||(a[n]={})}function cl(t,e,n,a){for(const r of e.getMatchingVisibleMetas(a).reverse()){const s=t[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function dl(t,e){const{chart:n,_cachedMeta:a}=t,r=n._stacks||(n._stacks={}),{iScale:s,vScale:i,index:l}=a,c=s.axis,d=i.axis,u=Ap(s,i,a),f=e.length;let h;for(let m=0;m<f;++m){const b=e[m],{[c]:p,[d]:g}=b,y=b._stacks||(b._stacks={});h=y[d]=Tp(r,u,p),h[l]=g,h._top=cl(h,i,!0,a.type),h._bottom=cl(h,i,!1,a.type);const B=h._visualValues||(h._visualValues={});B[l]=g}}function _r(t,e){const n=t.scales;return Object.keys(n).filter(a=>n[a].axis===e).shift()}function Op(t,e){return cn(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function zp(t,e,n){return cn(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function ao(t,e){const n=t.controller.index,a=t.vScale&&t.vScale.axis;if(a){e=e||t._parsed;for(const r of e){const s=r._stacks;if(!s||s[a]===void 0||s[a][n]===void 0)return;delete s[a][n],s[a]._visualValues!==void 0&&s[a]._visualValues[n]!==void 0&&delete s[a]._visualValues[n]}}}const Cr=t=>t==="reset"||t==="none",ul=(t,e)=>e?t:Object.assign({},t),Fp=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:il(n,!0),values:null};class hn{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=wr(e.vScale,e),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(e){this.index!==e&&ao(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,a=this.getDataset(),r=(f,h,m,b)=>f==="x"?h:f==="r"?b:m,s=n.xAxisID=ye(a.xAxisID,_r(e,"x")),i=n.yAxisID=ye(a.yAxisID,_r(e,"y")),l=n.rAxisID=ye(a.rAxisID,_r(e,"r")),c=n.indexAxis,d=n.iAxisID=r(c,s,i,l),u=n.vAxisID=r(c,i,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Di(this._data,this),e._stacked&&ao(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),a=this._data;if(we(n)){const r=this._cachedMeta;this._data=Pp(n,r)}else if(a!==n){if(a){Di(a,this);const r=this._cachedMeta;ao(r),r._parsed=[]}n&&Object.isExtensible(n)&&xm(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,a=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=wr(n.vScale,n),n.stack!==a.stack&&(r=!0,ao(n),n.stack=a.stack),this._resyncElements(e),(r||s!==n._stacked)&&(dl(this,n._parsed),n._stacked=wr(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),a=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(a,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:a,_data:r}=this,{iScale:s,_stacked:i}=a,l=s.axis;let c=e===0&&n===r.length?!0:a._sorted,d=e>0&&a._parsed[e-1],u,f,h;if(this._parsing===!1)a._parsed=r,a._sorted=!0,h=r;else{Oe(r[e])?h=this.parseArrayData(a,r,e,n):we(r[e])?h=this.parseObjectData(a,r,e,n):h=this.parsePrimitiveData(a,r,e,n);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<n;++u)a._parsed[u+e]=f=h[u],c&&(m()&&(c=!1),d=f);a._sorted=c}i&&dl(this,h)}parsePrimitiveData(e,n,a,r){const{iScale:s,vScale:i}=e,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(r);let h,m,b;for(h=0,m=r;h<m;++h)b=h+a,f[h]={[l]:u||s.parse(d[b],b),[c]:i.parse(n[b],b)};return f}parseArrayData(e,n,a,r){const{xScale:s,yScale:i}=e,l=new Array(r);let c,d,u,f;for(c=0,d=r;c<d;++c)u=c+a,f=n[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(e,n,a,r){const{xScale:s,yScale:i}=e,{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=n[h],d[u]={x:s.parse(on(m,l),h),y:i.parse(on(m,c),h)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,a){const r=this.chart,s=this._cachedMeta,i=n[e.axis],l={keys:il(r,!0),values:n._stacks[e.axis]._visualValues};return ll(l,i,s.index,{mode:a})}updateRangeFromParsed(e,n,a,r){const s=a[n.axis];let i=s===null?NaN:s;const l=r&&a._stacks[n.axis];r&&l&&(r.values=l,i=ll(r,s,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,n){const a=this._cachedMeta,r=a._parsed,s=a._sorted&&e===a.iScale,i=r.length,l=this._getOtherScale(e),c=Fp(n,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=$p(l);let h,m;function b(){m=r[h];const p=m[l.axis];return!Ie(m[e.axis])||u>p||f<p}for(h=0;h<i&&!(!b()&&(this.updateRangeFromParsed(d,e,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!b()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,a=[];let r,s,i;for(r=0,s=n.length;r<s;++r)i=n[r][e.axis],Ie(i)&&a.push(i);return a}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,a=n.iScale,r=n.vScale,s=this.getParsed(e);return{label:a?""+a.getLabelForValue(s[a.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=Np(ye(this.options.clip,Mp(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,a=this._cachedMeta,r=a.data||[],s=n.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let u;for(a.dataset&&a.dataset.draw(e,s,l,c),u=l;u<l+c;++u){const f=r[u];f.hidden||(f.active&&d?i.push(f):f.draw(e,s))}for(u=0;u<i.length;++u)i[u].draw(e,s)}getStyle(e,n){const a=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(a):this.resolveDataElementOptions(e||0,a)}getContext(e,n,a){const r=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const i=this._cachedMeta.data[e];s=i.$context||(i.$context=zp(this.getContext(),e,i)),s.parsed=this.getParsed(e),s.raw=r.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=Op(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=a,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",a){const r=n==="active",s=this._cachedDataOpts,i=e+"-"+n,l=s[i],c=this.enableOptionSharing&&Xn(a);if(l)return ul(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=r?[`${e}Hover`,"hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Te.elements[e]),b=()=>this.getContext(a,r,n),p=d.resolveNamedOptions(h,m,b,f);return p.$shared&&(p.$shared=c,s[i]=Object.freeze(ul(p,c))),p}_resolveAnimations(e,n,a){const r=this.chart,s=this._cachedDataOpts,i=`animation-${n}`,l=s[i];if(l)return l;let c;if(r.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(e,a,n))}const d=new rl(r,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Cr(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const a=this.resolveDataElementOptions(e,n),r=this._sharedOptions,s=this.getSharedOptions(a),i=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,a),{sharedOptions:s,includeOptions:i}}updateElement(e,n,a,r){Cr(r)?Object.assign(e,a):this._resolveAnimations(n,r).update(e,a)}updateSharedOptions(e,n,a){e&&!Cr(n)&&this._resolveAnimations(void 0,n).update(e,a)}_setStyle(e,n,a,r){e.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,a,r).update(e,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,a){this._setStyle(e,a,"active",!1)}setHoverStyle(e,n,a){this._setStyle(e,a,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=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=n.length,i=Math.min(s,r);i&&this.parse(0,i),s>r?this._insertElements(r,s-r,e):s<r&&this._removeElements(s,r-s)}_insertElements(e,n,a=!0){const r=this._cachedMeta,s=r.data,i=e+n;let l;const c=d=>{for(d.length+=n,l=d.length-1;l>=i;l--)d[l]=d[l-n]};for(c(s),l=e;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(e,n),a&&this.updateElements(s,e,n,"reset")}updateElements(e,n,a,r){}_removeElements(e,n){const a=this._cachedMeta;if(this._parsing){const r=a._parsed.splice(e,n);a._stacked&&ao(a,r)}a.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,a,r]=e;this[n](a,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const a=arguments.length-2;a&&this._sync(["_insertElements",e,a])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ie(hn,"defaults",{}),ie(hn,"datasetElementType",null),ie(hn,"dataElementType",null);function Rp(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let a=[];for(let r=0,s=n.length;r<s;r++)a=a.concat(n[r].controller.getAllParsedValues(t));t._cache.$bar=Vi(a.sort((r,s)=>r-s))}return t._cache.$bar}function vp(t){const e=t.iScale,n=Rp(e,t.type);let a=e._length,r,s,i,l;const c=()=>{i===32767||i===-32768||(Xn(l)&&(a=Math.min(a,Math.abs(i-l)||a)),l=i)};for(r=0,s=n.length;r<s;++r)i=e.getPixelForValue(n[r]),c();for(l=void 0,r=0,s=e.ticks.length;r<s;++r)i=e.getPixelForTick(r),c();return a}function Lp(t,e,n,a){const r=n.barThickness;let s,i;return Be(r)?(s=e.min*n.categoryPercentage,i=n.barPercentage):(s=r*a,i=1),{chunk:s/a,ratio:i,start:e.pixels[t]-s/2}}function Ip(t,e,n,a){const r=e.pixels,s=r[t];let i=t>0?r[t-1]:null,l=t<r.length-1?r[t+1]:null;const c=n.categoryPercentage;i===null&&(i=s-(l===null?e.end-e.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:n.barPercentage,start:d}}function jp(t,e,n,a){const r=n.parse(t[0],a),s=n.parse(t[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),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:r,end:s,min:i,max:l}}function fl(t,e,n,a){return Oe(t)?jp(t,e,n,a):e[n.axis]=n.parse(t,a),e}function hl(t,e,n,a){const r=t.iScale,s=t.vScale,i=r.getLabels(),l=r===s,c=[];let d,u,f,h;for(d=n,u=n+a;d<u;++d)h=e[d],f={},f[r.axis]=l||r.parse(i[d],d),c.push(fl(h,f,s,d));return c}function Br(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Wp(t,e,n){return t!==0?pt(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function Hp(t){let e,n,a,r,s;return t.horizontal?(e=t.base>t.x,n="left",a="right"):(e=t.base<t.y,n="bottom",a="top"),e?(r="end",s="start"):(r="start",s="end"),{start:n,end:a,reverse:e,top:r,bottom:s}}function qp(t,e,n,a){let r=e.borderSkipped;const s={};if(!r){t.borderSkipped=s;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=Hp(t);r==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===a?r=d:(n._bottom||0)===a?r=u:(s[ml(u,i,l,c)]=!0,r=d)),s[ml(r,i,l,c)]=!0,t.borderSkipped=s}function ml(t,e,n,a){return a?(t=Up(t,e,n),t=pl(t,n,e)):t=pl(t,e,n),t}function Up(t,e,n){return t===e?n:t===n?e:t}function pl(t,e,n){return t==="start"?e:t==="end"?n:t}function Yp(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Ko extends hn{parsePrimitiveData(e,n,a,r){return hl(e,n,a,r)}parseArrayData(e,n,a,r){return hl(e,n,a,r)}parseObjectData(e,n,a,r){const{iScale:s,vScale:i}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,b,p;for(h=a,m=a+r;h<m;++h)p=n[h],b={},b[s.axis]=s.parse(on(p,d),h),f.push(fl(on(p,u),b,i,h));return f}updateRangeFromParsed(e,n,a,r){super.updateRangeFromParsed(e,n,a,r);const s=a._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:a,vScale:r}=n,s=this.getParsed(e),i=s._custom,l=Br(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 e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,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(n,r);for(let m=n;m<n+a;m++){const b=this.getParsed(m),p=s||Be(b[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),g=this._calculateBarIndexPixels(m,u),y=(b._stacks||{})[l.axis],B={horizontal:d,base:p.base,enableBorderRadius:!y||Br(b._custom)||i===y._top||i===y._bottom,x:d?p.head:g.center,y:d?g.center:p.head,height:d?g.size:Math.abs(p.size),width:d?Math.abs(p.size):g.size};h&&(B.options=f||this.resolveDataElementOptions(m,e[m].active?"active":r));const D=B.options||e[m].options;qp(B,D,y,i),Yp(B,D,u.ratio),this.updateElement(e[m],m,B,r)}}_getStacks(e,n){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(n),c=l&&l[a.axis],d=u=>{const f=u._parsed.find(m=>m[a.axis]===c),h=f&&f[u.vScale.axis];if(Be(h)||isNaN(h))return!0};for(const u of r)if(!(n!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(a=>e[a].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const a of this.chart.data.datasets)e[ye(this.chart.options.indexAxis==="x"?a.xAxisID:a.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,a){const r=this._getStacks(e,a),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,a=n.iScale,r=[];let s,i;for(s=0,i=n.data.length;s<i;++s)r.push(a.getPixelForValue(this.getParsed(s)[a.axis],s));const l=e.barThickness;return{min:l||vp(n),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:a,index:r},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(e),d=c._custom,u=Br(d);let f=c[n.axis],h=0,m=a?this.applyStack(n,c,a):f,b,p;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&pt(f)!==pt(d.barEnd)&&(h=0),h+=f);const g=!Be(s)&&!u?s:h;let y=n.getPixelForValue(g);if(this.chart.getDataVisibility(e)?b=n.getPixelForValue(h+m):b=y,p=b-y,Math.abs(p)<i){p=Wp(p,n,l)*i,f===l&&(y-=p/2);const B=n.getPixelForDecimal(0),D=n.getPixelForDecimal(1),M=Math.min(B,D),S=Math.max(B,D);y=Math.max(Math.min(y,S),M),b=y+p,a&&!u&&(c._stacks[n.axis]._visualValues[r]=n.getValueForPixel(b)-n.getValueForPixel(y))}if(y===n.getPixelForValue(l)){const B=pt(p)*n.getLineWidthForValue(l)/2;y+=B,p-=B}return{size:p,base:y,head:b,center:b+p/2}}_calculateBarIndexPixels(e,n){const a=n.scale,r=this.options,s=r.skipNull,i=ye(r.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(e):n.stackCount,f=r.barThickness==="flex"?Ip(e,n,r,u*d):Lp(e,n,r,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(ye(h,this.getFirstScaleIdForIndexAxis())),b=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0)+m;l=f.start+f.chunk*b+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=a.getPixelForValue(this.getParsed(e)[a.axis],e),c=Math.min(i,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,a=e.data,r=a.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!a[s].hidden&&a[s].draw(this._ctx)}}ie(Ko,"id","bar"),ie(Ko,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ie(Ko,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Gp(t,e,n){let a=1,r=1,s=0,i=0;if(e<Pe){const l=t,c=l+e,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(D,M,S)=>Zn(D,l,c,!0)?1:Math.max(M,M*n,S,S*n),b=(D,M,S)=>Zn(D,l,c,!0)?-1:Math.min(M,M*n,S,S*n),p=m(0,d,f),g=m(Re,u,h),y=b(Ee,d,f),B=b(Ee+Re,u,h);a=(p-y)/2,r=(g-B)/2,s=-(p+y)/2,i=-(g+B)/2}return{ratioX:a,ratioY:r,offsetX:s,offsetY:i}}class En extends hn{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const a=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=a;else{let s=c=>+a[c];if(we(a[e])){const{key:c="value"}=this._parsing;s=d=>+on(a[d],c)}let i,l;for(i=e,l=e+n;i<l;++i)r._parsed[i]=s(i)}}_getRotation(){return St(this.options.rotation-90)}_getCircumference(){return St(this.options.circumference)}_getRotationExtents(){let e=Pe,n=-Pe;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();e=Math.min(e,s),n=Math.max(n,s+i)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:a}=n,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(nm(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:b,offsetY:p}=Gp(f,u,c),g=(a.width-i)/h,y=(a.height-i)/m,B=Math.max(Math.min(g,y)/2,0),D=bi(this.options.radius,B),M=Math.max(D*c,0),S=(D-M)/this._getVisibleDatasetWeightTotal();this.offsetX=b*D,this.offsetY=p*D,r.total=this.calculateTotal(),this.outerRadius=D-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*d,0),this.updateElements(s,0,s.length,e)}_circumference(e,n){const a=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&a.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*s/Pe)}updateElements(e,n,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,b=h?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(n,r);let y=this._getRotation(),B;for(B=0;B<n;++B)y+=this._circumference(B,s);for(B=n;B<n+a;++B){const D=this._circumference(B,s),M=e[B],S={x:u+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+D,circumference:D,outerRadius:b,innerRadius:m};g&&(S.options=p||this.resolveDataElementOptions(B,M.active?"active":r)),y+=D,this.updateElement(M,B,S,r)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let a=0,r;for(r=0;r<n.length;r++){const s=e._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(a+=Math.abs(s))}return a}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?Pe*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,a=this.chart,r=a.data.labels||[],s=ur(n._parsed[e],a.options.locale);return{label:r[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const a=this.chart;let r,s,i,l,c;if(!e){for(r=0,s=a.data.datasets.length;r<s;++r)if(a.isDatasetVisible(r)){i=a.getDatasetMeta(r),e=i.data,l=i.controller;break}}if(!e)return 0;for(r=0,s=e.length;r<s;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let a=0,r=e.length;a<r;++a){const s=this.resolveDataElementOptions(a);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let a=0;a<e;++a)this.chart.isDatasetVisible(a)&&(n+=this._getRingWeight(a));return n}_getRingWeight(e){return Math.max(ye(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ie(En,"id","doughnut"),ie(En,"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"}),ie(En,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),ie(En,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data,{labels:{pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,d)=>{const f=e.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!e.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(e,n,a){a.chart.toggleDataVisibility(n.index),a.chart.update()}}}});class Xo extends hn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:a,data:r=[],_dataset:s}=n,i=this.chart._animationsDisabled;let{start:l,count:c}=_m(n,r,i);this._drawStart=l,this._drawCount=c,Cm(n)&&(l=0,c=r.length),a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=r;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},e),this.updateElements(r,l,c,e)}updateElements(e,n,a,r){const s=r==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,r),h=i.axis,m=l.axis,{spanGaps:b,segment:p}=this.options,g=Qn(b)?b:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||r==="none",B=n+a,D=e.length;let M=n>0&&this.getParsed(n-1);for(let S=0;S<D;++S){const k=e[S],C=y?k:{};if(S<n||S>=B){C.skip=!0;continue}const x=this.getParsed(S),w=Be(x[m]),E=C[h]=i.getPixelForValue(x[h],S),A=C[m]=s||w?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,x,c):x[m],S);C.skip=isNaN(E)||isNaN(A)||w,C.stop=S>0&&Math.abs(x[h]-M[h])>g,p&&(C.parsed=x,C.raw=d.data[S]),f&&(C.options=u||this.resolveDataElementOptions(S,k.active?"active":r)),y||this.updateElement(k,S,C,r),M=x}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,a=n.options&&n.options.borderWidth||0,r=e.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 e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ie(Xo,"id","line"),ie(Xo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ie(Xo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Sr extends En{}ie(Sr,"id","pie"),ie(Sr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function mn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Er{constructor(e){ie(this,"options");this.options=e||{}}static override(e){Object.assign(Er.prototype,e)}init(){}formats(){return mn()}parse(){return mn()}format(){return mn()}add(){return mn()}diff(){return mn()}startOf(){return mn()}endOf(){return mn()}}var Kp={_date:Er};function Xp(t,e,n,a){const{controller:r,data:s,_sorted:i}=t,l=r._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&e===l.axis&&e!=="r"&&i&&s.length){const d=l._reversePixels?bm:rn;if(a){if(r._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const h=d(s,e,n-f),m=d(s,e,n+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,e,n);if(c){const{vScale:f}=r._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(p=>!Be(p[f.axis]));u.lo-=Math.max(0,m);const b=h.slice(u.hi).findIndex(p=>!Be(p[f.axis]));u.hi+=Math.max(0,b)}return u}}return{lo:0,hi:s.length-1}}function Jo(t,e,n,a,r){const s=t.getSortedVisibleDatasetMetas(),i=n[e];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=Xp(s[l],e,i,r);for(let m=f;m<=h;++m){const b=u[m];b.skip||a(b,d,m)}}}function Jp(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(a,r){const s=e?Math.abs(a.x-r.x):0,i=n?Math.abs(a.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Dr(t,e,n,a,r){const s=[];return!r&&!t.isPointInArea(e)||Jo(t,n,e,function(l,c,d){!r&&!no(l,t.chartArea,0)||l.inRange(e.x,e.y,a)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function Qp(t,e,n,a){let r=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],a),{angle:f}=Si(i,{x:e.x,y:e.y});Zn(f,d,u)&&r.push({element:i,datasetIndex:l,index:c})}return Jo(t,n,e,s),r}function Zp(t,e,n,a,r,s){let i=[];const l=Jp(n);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(e.x,e.y,r);if(a&&!m)return;const b=u.getCenterPoint(r);if(!(!!s||t.isPointInArea(b))&&!m)return;const g=l(e,b);g<c?(i=[{element:u,datasetIndex:f,index:h}],c=g):g===c&&i.push({element:u,datasetIndex:f,index:h})}return Jo(t,n,e,d),i}function Vr(t,e,n,a,r,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!a?Qp(t,e,n,r):Zp(t,e,n,a,r,s)}function gl(t,e,n,a,r){const s=[],i=n==="x"?"inXRange":"inYRange";let l=!1;return Jo(t,n,e,(c,d,u)=>{c[i]&&c[i](e[n],r)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,r))}),a&&!l?[]:s}var eg={modes:{index(t,e,n,a){const r=un(e,t),s=n.axis||"x",i=n.includeInvisible||!1,l=n.intersect?Dr(t,r,s,a,i):Vr(t,r,s,!1,a,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,e,n,a){const r=un(e,t),s=n.axis||"xy",i=n.includeInvisible||!1;let l=n.intersect?Dr(t,r,s,a,i):Vr(t,r,s,!1,a,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,e,n,a){const r=un(e,t),s=n.axis||"xy",i=n.includeInvisible||!1;return Dr(t,r,s,a,i)},nearest(t,e,n,a){const r=un(e,t),s=n.axis||"xy",i=n.includeInvisible||!1;return Vr(t,r,s,n.intersect,a,i)},x(t,e,n,a){const r=un(e,t);return gl(t,r,"x",n.intersect,a)},y(t,e,n,a){const r=un(e,t);return gl(t,r,"y",n.intersect,a)}}};const bl=["left","top","right","bottom"];function ro(t,e){return t.filter(n=>n.pos===e)}function yl(t,e){return t.filter(n=>bl.indexOf(n.pos)===-1&&n.box.axis===e)}function so(t,e){return t.sort((n,a)=>{const r=e?a:n,s=e?n:a;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function tg(t){const e=[];let n,a,r,s,i,l;for(n=0,a=(t||[]).length;n<a;++n)r=t[n],{position:s,options:{stack:i,stackWeight:l=1}}=r,e.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&s+i,stackWeight:l});return e}function ng(t){const e={};for(const n of t){const{stack:a,pos:r,stackWeight:s}=n;if(!a||!bl.includes(r))continue;const i=e[a]||(e[a]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return e}function og(t,e){const n=ng(t),{vBoxMaxWidth:a,hBoxMaxHeight:r}=e;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=n[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*a:c&&e.availableWidth,l.height=r):(l.width=a,l.height=u?u*r:c&&e.availableHeight)}return n}function ag(t){const e=tg(t),n=so(e.filter(d=>d.box.fullSize),!0),a=so(ro(e,"left"),!0),r=so(ro(e,"right")),s=so(ro(e,"top"),!0),i=so(ro(e,"bottom")),l=yl(e,"x"),c=yl(e,"y");return{fullSize:n,leftAndTop:a.concat(s),rightAndBottom:r.concat(c).concat(i).concat(l),chartArea:ro(e,"chartArea"),vertical:a.concat(r).concat(c),horizontal:s.concat(i).concat(l)}}function xl(t,e,n,a){return Math.max(t[n],e[n])+Math.max(t[a],e[a])}function kl(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function rg(t,e,n,a){const{pos:r,box:s}=n,i=t.maxPadding;if(!we(r)){n.size&&(t[r]-=n.size);const f=a[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,t[r]+=n.size}s.getPadding&&kl(i,s.getPadding());const l=Math.max(0,e.outerWidth-xl(i,t,"left","right")),c=Math.max(0,e.outerHeight-xl(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function sg(t){const e=t.maxPadding;function n(a){const r=Math.max(e[a]-t[a],0);return t[a]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function ig(t,e){const n=e.maxPadding;function a(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(i=>{s[i]=Math.max(e[i],n[i])}),s}return a(t?["left","right"]:["top","bottom"])}function io(t,e,n,a){const r=[];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||e.w,l.height||e.h,ig(l.horizontal,e));const{same:f,other:h}=rg(e,n,l,a);d|=f&&r.length,u=u||h,c.fullSize||r.push(l)}return d&&io(r,e,n,a)||u}function Qo(t,e,n,a,r){t.top=n,t.left=e,t.right=e+a,t.bottom=n+r,t.width=a,t.height=r}function wl(t,e,n,a){const r=n.padding;let{x:s,y:i}=e;for(const l of t){const c=l.box,d=a[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=e.w*u,h=d.size||c.height;Xn(d.start)&&(i=d.start),c.fullSize?Qo(c,r.left,i,n.outerWidth-r.right-r.left,h):Qo(c,e.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=e.h*u,h=d.size||c.width;Xn(d.start)&&(s=d.start),c.fullSize?Qo(c,s,r.top,h,n.outerHeight-r.bottom-r.top):Qo(c,s,e.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}e.x=s,e.y=i}var nt={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,a){if(!t)return;const r=tt(t.options.layout.padding),s=Math.max(e-r.width,0),i=Math.max(n-r.height,0),l=ag(t.boxes),c=l.vertical,d=l.horizontal;Se(t.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=c.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},r);kl(h,tt(a));const m=Object.assign({maxPadding:h,w:s,h:i,x:r.left,y:r.top},r),b=og(c.concat(d),f);io(l.fullSize,m,f,b),io(c,m,f,b),io(d,m,f,b)&&io(c,m,f,b),sg(m),wl(l.leftAndTop,m,f,b),m.x+=m.w,m.y+=m.h,wl(l.rightAndBottom,m,f,b),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Se(l.chartArea,p=>{const g=p.box;Object.assign(g,t.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class _l{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,a){}removeEventListener(e,n,a){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,a,r){return n=Math.max(0,n||e.width),a=a||e.height,{width:n,height:Math.max(0,r?Math.floor(n/r):a)}}isAttached(e){return!0}updateConfig(e){}}class lg extends _l{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Zo="$chartjs",cg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Cl=t=>t===null||t==="";function dg(t,e){const n=t.style,a=t.getAttribute("height"),r=t.getAttribute("width");if(t[Zo]={initial:{height:a,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Cl(r)){const s=Gi(t,"width");s!==void 0&&(t.width=s)}if(Cl(a))if(t.style.height==="")t.height=t.width/(e||2);else{const s=Gi(t,"height");s!==void 0&&(t.height=s)}return t}const Bl=fp?{passive:!0}:!1;function ug(t,e,n){t&&t.addEventListener(e,n,Bl)}function fg(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,Bl)}function hg(t,e){const n=cg[t.type]||t.type,{x:a,y:r}=un(t,e);return{type:n,chart:e,native:t,x:a!==void 0?a:null,y:r!==void 0?r:null}}function ea(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function mg(t,e,n){const a=t.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ea(l.addedNodes,a),i=i&&!ea(l.removedNodes,a);i&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function pg(t,e,n){const a=t.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ea(l.removedNodes,a),i=i&&!ea(l.addedNodes,a);i&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const lo=new Map;let Sl=0;function El(){const t=window.devicePixelRatio;t!==Sl&&(Sl=t,lo.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function gg(t,e){lo.size||window.addEventListener("resize",El),lo.set(t,e)}function bg(t){lo.delete(t),lo.size||window.removeEventListener("resize",El)}function yg(t,e,n){const a=t.canvas,r=a&&kr(a);if(!r)return;const s=Ni((l,c)=>{const d=r.clientWidth;n(l,c),d<r.clientWidth&&n()},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),gg(t,s),i}function Mr(t,e,n){n&&n.disconnect(),e==="resize"&&bg(t)}function xg(t,e,n){const a=t.canvas,r=Ni(s=>{t.ctx!==null&&n(hg(s,t))},t);return ug(a,e,r),r}class kg extends _l{acquireContext(e,n){const a=e&&e.getContext&&e.getContext("2d");return a&&a.canvas===e?(dg(e,n),a):null}releaseContext(e){const n=e.canvas;if(!n[Zo])return!1;const a=n[Zo].initial;["height","width"].forEach(s=>{const i=a[s];Be(i)?n.removeAttribute(s):n.setAttribute(s,i)});const r=a.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Zo],!0}addEventListener(e,n,a){this.removeEventListener(e,n);const r=e.$proxies||(e.$proxies={}),i={attach:mg,detach:pg,resize:yg}[n]||xg;r[n]=i(e,n,a)}removeEventListener(e,n){const a=e.$proxies||(e.$proxies={}),r=a[n];if(!r)return;({attach:Mr,detach:Mr,resize:Mr}[n]||fg)(e,n,r),a[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,a,r){return up(e,n,a,r)}isAttached(e){const n=e&&kr(e);return!!(n&&n.isConnected)}}function wg(t){return!xr()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?lg:kg}let Vt=(Ba=class{constructor(){ie(this,"x");ie(this,"y");ie(this,"active",!1);ie(this,"options");ie(this,"$animations")}tooltipPosition(e){const{x:n,y:a}=this.getProps(["x","y"],e);return{x:n,y:a}}hasValue(){return Qn(this.x)&&Qn(this.y)}getProps(e,n){const a=this.$animations;if(!n||!a)return this;const r={};return e.forEach(s=>{r[s]=a[s]&&a[s].active()?a[s]._to:this[s]}),r}},ie(Ba,"defaults",{}),ie(Ba,"defaultRoutes"),Ba);function _g(t,e){const n=t.options.ticks,a=Cg(t),r=Math.min(n.maxTicksLimit||a,a),s=n.major.enabled?Sg(e):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>r)return Eg(e,d,s,i/r),d;const u=Bg(s,e,r);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(ta(e,d,u,Be(m)?0:l-m,l),f=0,h=i-1;f<h;f++)ta(e,d,u,s[f],s[f+1]);return ta(e,d,u,c,Be(m)?e.length:c+m),d}return ta(e,d,u),d}function Cg(t){const e=t.options.offset,n=t._tickSize(),a=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(a,r))}function Bg(t,e,n){const a=Dg(t),r=e.length/n;if(!a)return Math.max(r,1);const s=dm(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 Sg(t){const e=[];let n,a;for(n=0,a=t.length;n<a;n++)t[n].major&&e.push(n);return e}function Eg(t,e,n,a){let r=0,s=n[0],i;for(a=Math.ceil(a),i=0;i<t.length;i++)i===s&&(e.push(t[i]),r++,s=n[r*a])}function ta(t,e,n,a,r){const s=ye(a,0),i=Math.min(ye(r,t.length),t.length);let l=0,c,d,u;for(n=Math.ceil(n),r&&(c=r-a,n=c/Math.floor(c/n)),u=s;u<0;)l++,u=Math.round(s+l*n);for(d=Math.max(s,0);d<i;d++)d===u&&(e.push(t[d]),l++,u=Math.round(s+l*n))}function Dg(t){const e=t.length;let n,a;if(e<2)return!1;for(a=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==a)return!1;return a}const Vg=t=>t==="left"?"right":t==="right"?"left":t,Dl=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Vl=(t,e)=>Math.min(e||t,t);function Ml(t,e){const n=[],a=t.length/e,r=t.length;let s=0;for(;s<r;s+=a)n.push(t[Math.floor(s)]);return n}function Mg(t,e,n){const a=t.ticks.length,r=Math.min(e,a-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(r),d;if(!(n&&(a===1?d=Math.max(c-s,i-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(r-1))/2,c+=r<e?d:-d,c<s-l||c>i+l)))return c}function Ng(t,e){Se(t,n=>{const a=n.gc,r=a.length/2;let s;if(r>e){for(s=0;s<r;++s)delete n.data[a[s]];a.splice(0,r)}})}function co(t){return t.drawTicks?t.tickLength:0}function Nl(t,e){if(!t.display)return 0;const n=He(t.font,e),a=tt(t.padding);return(Oe(t.text)?t.text.length:1)*n.lineHeight+a.height}function Pg(t,e){return cn(t,{scale:e,type:"scale"})}function Ag(t,e,n){return cn(t,{tick:n,index:e,type:"tick"})}function $g(t,e,n){let a=lr(t);return(n&&e!=="right"||!n&&e==="right")&&(a=Vg(a)),a}function Tg(t,e,n,a){const{top:r,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,b;const p=i-r,g=l-s;if(t.isHorizontal()){if(m=We(a,s,l),we(n)){const y=Object.keys(n)[0],B=n[y];b=u[y].getPixelForValue(B)+p-e}else n==="center"?b=(d.bottom+d.top)/2+p-e:b=Dl(t,n,e);h=l-s}else{if(we(n)){const y=Object.keys(n)[0],B=n[y];m=u[y].getPixelForValue(B)-g+e}else n==="center"?m=(d.left+d.right)/2-g+e:m=Dl(t,n,e);b=We(a,i,r),f=n==="left"?-Re:Re}return{titleX:m,titleY:b,maxWidth:h,rotation:f}}class Dn extends Vt{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:a,_suggestedMax:r}=this;return e=mt(e,Number.POSITIVE_INFINITY),n=mt(n,Number.NEGATIVE_INFINITY),a=mt(a,Number.POSITIVE_INFINITY),r=mt(r,Number.NEGATIVE_INFINITY),{min:mt(e,a),max:mt(n,r),minDefined:Ie(e),maxDefined:Ie(n)}}getMinMax(e){let{min:n,max:a,minDefined:r,maxDefined:s}=this.getUserBounds(),i;if(r&&s)return{min:n,max:a};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,e),r||(n=Math.min(n,i.min)),s||(a=Math.max(a,i.max));return n=s&&n>a?a:n,a=r&&n>a?n:a,{min:mt(n,mt(a,n)),max:mt(a,mt(n,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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Me(this.options.beforeUpdate,[this])}update(e,n,a){const{beginAtZero:r,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,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=Wm(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Ml(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=_g(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,a;this.isHorizontal()?(n=this.left,a=this.right):(n=this.top,a=this.bottom,e=!e),this._startPixel=n,this._endPixel=a,this._reversePixels=e,this._length=a-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Me(this.options.afterUpdate,[this])}beforeSetDimensions(){Me(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(){Me(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Me(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Me(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let a,r,s;for(a=0,r=e.length;a<r;a++)s=e[a],s.label=Me(n.callback,[s.value,a,e],this)}afterTickToLabelConversion(){Me(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Me(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,a=Vl(this.ticks.length,e.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let i=r,l,c,d;if(!this._isVisible()||!n.display||r>=s||a<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=je(this.chart.width-f,0,this.maxWidth);l=e.offset?this.maxWidth/a:m/(a-1),f+6>l&&(l=m/(a-(e.offset?.5:1)),c=this.maxHeight-co(e.grid)-n.padding-Nl(e.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=mm(Math.min(Math.asin(je((u.highest.height+6)/l,-1,1)),Math.asin(je(c/d,-1,1))-Math.asin(je(h/d,-1,1)))),i=Math.max(r,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Me(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Me(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:a,title:r,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=Nl(r,n.options.font);if(l?(e.width=this.maxWidth,e.height=co(s)+c):(e.height=this.maxHeight,e.width=co(s)+c),a.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=a.padding*2,b=St(this.labelRotation),p=Math.cos(b),g=Math.sin(b);if(l){const y=a.mirror?0:g*f.width+p*h.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=a.mirror?0:p*f.width+g*h.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(d,u,g,p)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,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*e.width,m=a*n.height):(h=a*e.height,m=r*n.width):s==="start"?m=n.width:s==="end"?h=e.width:s!=="inner"&&(h=e.width/2,m=n.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=n.height/2,f=e.height/2;s==="start"?(u=0,f=e.height):s==="end"&&(u=n.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(){Me(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,a;for(n=0,a=e.length;n<a;n++)Be(e[n].label)&&(e.splice(n,1),a--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let a=this.ticks;n<a.length&&(a=Ml(a,n)),this._labelSizes=e=this._computeLabelSizes(a,a.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,a){const{ctx:r,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(n/Vl(n,a));let d=0,u=0,f,h,m,b,p,g,y,B,D,M,S;for(f=0;f<n;f+=c){if(b=e[f].label,p=this._resolveTickFontOptions(f),r.font=g=p.string,y=s[g]=s[g]||{data:{},gc:[]},B=p.lineHeight,D=M=0,!Be(b)&&!Oe(b))D=zi(r,y.data,y.gc,D,b),M=B;else if(Oe(b))for(h=0,m=b.length;h<m;++h)S=b[h],!Be(S)&&!Oe(S)&&(D=zi(r,y.data,y.gc,D,S),M+=B);i.push(D),l.push(M),d=Math.max(D,d),u=Math.max(M,u)}Ng(s,n);const k=i.indexOf(d),C=l.indexOf(u),x=w=>({width:i[w]||0,height:l[w]||0});return{first:x(0),last:x(n-1),widest:x(k),highest:x(C),widths:i,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return gm(this._alignToPixels?ln(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const a=n[e];return a.$context||(a.$context=Ag(this.getContext(),e,a))}return this.$context||(this.$context=Pg(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=St(this.labelRotation),a=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),i=e.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 e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=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=[],b=l.setContext(this.getContext()),p=b.display?b.width:0,g=p/2,y=function(z){return ln(a,z,p)};let B,D,M,S,k,C,x,w,E,A,T,F;if(i==="top")B=y(this.bottom),C=this.bottom-h,w=B-g,A=y(e.top)+g,F=e.bottom;else if(i==="bottom")B=y(this.top),A=e.top,F=y(e.bottom)-g,C=B+g,w=this.top+h;else if(i==="left")B=y(this.right),k=this.right-h,x=B-g,E=y(e.left)+g,T=e.right;else if(i==="right")B=y(this.left),E=e.left,T=y(e.right)-g,k=B+g,x=this.left+h;else if(n==="x"){if(i==="center")B=y((e.top+e.bottom)/2+.5);else if(we(i)){const z=Object.keys(i)[0],v=i[z];B=y(this.chart.scales[z].getPixelForValue(v))}A=e.top,F=e.bottom,C=B+g,w=C+h}else if(n==="y"){if(i==="center")B=y((e.left+e.right)/2);else if(we(i)){const z=Object.keys(i)[0],v=i[z];B=y(this.chart.scales[z].getPixelForValue(v))}k=B-g,x=k-h,E=e.left,T=e.right}const L=ye(r.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/L));for(D=0;D<f;D+=Y){const z=this.getContext(D),v=s.setContext(z),W=l.setContext(z),O=v.lineWidth,N=v.color,H=W.dash||[],j=W.dashOffset,J=v.tickWidth,te=v.tickColor,ue=v.tickBorderDash||[],fe=v.tickBorderDashOffset;M=Mg(this,D,c),M!==void 0&&(S=ln(a,M,O),d?k=x=E=T=S:C=w=A=F=S,m.push({tx1:k,ty1:C,tx2:x,ty2:w,x1:E,y1:A,x2:T,y2:F,width:O,color:N,borderDash:H,borderDashOffset:j,tickWidth:J,tickColor:te,tickBorderDash:ue,tickBorderDashOffset:fe}))}return this._ticksLength=f,this._borderValue=B,m}_computeLabelItems(e){const n=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,b=f?-u:m,p=-St(this.labelRotation),g=[];let y,B,D,M,S,k,C,x,w,E,A,T,F="middle";if(r==="top")k=this.bottom-b,C=this._getXAxisLabelAlignment();else if(r==="bottom")k=this.top+b,C=this._getXAxisLabelAlignment();else if(r==="left"){const Y=this._getYAxisLabelAlignment(h);C=Y.textAlign,S=Y.x}else if(r==="right"){const Y=this._getYAxisLabelAlignment(h);C=Y.textAlign,S=Y.x}else if(n==="x"){if(r==="center")k=(e.top+e.bottom)/2+m;else if(we(r)){const Y=Object.keys(r)[0],z=r[Y];k=this.chart.scales[Y].getPixelForValue(z)+m}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")S=(e.left+e.right)/2-m;else if(we(r)){const Y=Object.keys(r)[0],z=r[Y];S=this.chart.scales[Y].getPixelForValue(z)}C=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(c==="start"?F="top":c==="end"&&(F="bottom"));const L=this._getLabelSizes();for(y=0,B=l.length;y<B;++y){D=l[y],M=D.label;const Y=s.setContext(this.getContext(y));x=this.getPixelForTick(y)+s.labelOffset,w=this._resolveTickFontOptions(y),E=w.lineHeight,A=Oe(M)?M.length:1;const z=A/2,v=Y.color,W=Y.textStrokeColor,O=Y.textStrokeWidth;let N=C;i?(S=x,C==="inner"&&(y===B-1?N=this.options.reverse?"left":"right":y===0?N=this.options.reverse?"right":"left":N="center"),r==="top"?d==="near"||p!==0?T=-A*E+E/2:d==="center"?T=-L.highest.height/2-z*E+E:T=-L.highest.height+E/2:d==="near"||p!==0?T=E/2:d==="center"?T=L.highest.height/2-z*E:T=L.highest.height-A*E,f&&(T*=-1),p!==0&&!Y.showLabelBackdrop&&(S+=E/2*Math.sin(p))):(k=x,T=(1-A)*E/2);let H;if(Y.showLabelBackdrop){const j=tt(Y.backdropPadding),J=L.heights[y],te=L.widths[y];let ue=T-j.top,fe=0-j.left;switch(F){case"middle":ue-=J/2;break;case"bottom":ue-=J;break}switch(C){case"center":fe-=te/2;break;case"right":fe-=te;break;case"inner":y===B-1?fe-=te:y>0&&(fe-=te/2);break}H={left:fe,top:ue,width:te+j.width,height:J+j.height,color:Y.backdropColor}}g.push({label:M,font:w,textOffset:T,options:{rotation:p,color:v,strokeColor:W,strokeWidth:O,textAlign:N,textBaseline:F,translation:[S,k],backdrop:H}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-St(this.labelRotation))return e==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:a,mirror:r,padding:s}}=this.options,i=this._getLabelSizes(),l=e+s,c=i.widest.width;let d,u;return n==="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)):n==="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 e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:a,top:r,width:s,height:i}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(a,r,s,i),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===e);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const n=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));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(n.display)for(s=0,i=r.length;s<i;++s){const c=r[s];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.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:e,ctx:n,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=ln(e,this.left,i)-i/2,u=ln(e,this.right,l)+l/2,f=h=c):(f=ln(e,this.top,i)-i/2,h=ln(e,this.bottom,l)+l/2,d=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const a=this.ctx,r=this._computeLabelArea();r&&Io(a,r);const s=this.getLabelItems(e);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;oo(a,d,0,u,c,l)}r&&jo(a)}drawTitle(){const{ctx:e,options:{position:n,title:a,reverse:r}}=this;if(!a.display)return;const s=He(a.font),i=tt(a.padding),l=a.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||we(n)?(c+=i.bottom,Oe(a.text)&&(c+=s.lineHeight*(a.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=Tg(this,c,n,l);oo(e,a.text,0,0,s,{color:a.color,maxWidth:f,rotation:h,textAlign:$g(l,n,r),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,a=ye(e.grid&&e.grid.z,-1),r=ye(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Dn.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:a,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];let s,i;for(s=0,i=n.length;s<i;++s){const l=n[s];l[a]===this.id&&(!e||l.type===e)&&r.push(l)}return r}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return He(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class na{constructor(e,n,a){this.type=e,this.scope=n,this.override=a,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let a;Fg(n)&&(a=this.register(n));const r=this.items,s=e.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in r||(r[s]=e,Og(e,i,a),this.override&&Te.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const n=this.items,a=e.id,r=this.scope;a in n&&delete n[a],r&&a in Te[r]&&(delete Te[r][a],this.override&&delete sn[a])}}function Og(t,e,n){const a=Gn(Object.create(null),[n?Te.get(n):{},Te.get(e),t.defaults]);Te.set(e,a),t.defaultRoutes&&zg(e,t.defaultRoutes),t.descriptors&&Te.describe(e,t.descriptors)}function zg(t,e){Object.keys(e).forEach(n=>{const a=n.split("."),r=a.pop(),s=[t].concat(a).join("."),i=e[n].split("."),l=i.pop(),c=i.join(".");Te.route(s,r,c,l)})}function Fg(t){return"id"in t&&"defaults"in t}class Rg{constructor(){this.controllers=new na(hn,"datasets",!0),this.elements=new na(Vt,"elements"),this.plugins=new na(Object,"plugins"),this.scales=new na(Dn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,a){[...n].forEach(r=>{const s=a||this._getRegistryForType(r);a||s.isForType(r)||s===this.plugins&&r.id?this._exec(e,s,r):Se(r,i=>{const l=a||this._getRegistryForType(i);this._exec(e,l,i)})})}_exec(e,n,a){const r=rr(e);Me(a["before"+r],[],a),n[e](a),Me(a["after"+r],[],a)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const a=this._typedRegistries[n];if(a.isForType(e))return a}return this.plugins}_get(e,n,a){const r=n.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+a+".");return r}}var gt=new Rg;class vg{constructor(){this._init=void 0}notify(e,n,a,r){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const s=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(s,e,n,a);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),i}_notify(e,n,a,r){r=r||{};for(const s of e){const i=s.plugin,l=i[a],c=[n,r,s.options];if(Me(l,c,i)===!1&&r.cancelable)return!1}return!0}invalidate(){Be(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const a=e&&e.config,r=ye(a.options&&a.options.plugins,{}),s=Lg(a);return r===!1&&!n?[]:jg(e,s,r,n)}_notifyStateChanges(e){const n=this._oldCache||[],a=this._cache,r=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(r(n,a),e,"stop"),this._notify(r(a,n),e,"start")}}function Lg(t){const e={},n=[],a=Object.keys(gt.plugins.items);for(let s=0;s<a.length;s++)n.push(gt.getPlugin(a[s]));const r=t.plugins||[];for(let s=0;s<r.length;s++){const i=r[s];n.indexOf(i)===-1&&(n.push(i),e[i.id]=!0)}return{plugins:n,localIds:e}}function Ig(t,e){return!e&&t===!1?null:t===!0?{}:t}function jg(t,{plugins:e,localIds:n},a,r){const s=[],i=t.getContext();for(const l of e){const c=l.id,d=Ig(a[c],r);d!==null&&s.push({plugin:l,options:Wg(t.config,{plugin:l,local:n[c]},d,i)})}return s}function Wg(t,{plugin:e,local:n},a,r){const s=t.pluginScopeKeys(e),i=t.getOptionScopes(a,s);return n&&e.defaults&&i.push(e.defaults),t.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Nr(t,e){const n=Te.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Hg(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function qg(t,e){return t===e?"_index_":"_value_"}function Pl(t){if(t==="x"||t==="y"||t==="r")return t}function Ug(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Pr(t,...e){if(Pl(t))return t;for(const n of e){const a=n.axis||Ug(n.position)||t.length>1&&Pl(t[0].toLowerCase());if(a)return a}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Al(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Yg(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(a=>a.xAxisID===t||a.yAxisID===t);if(n.length)return Al(t,"x",n[0])||Al(t,"y",n[0])}return{}}function Gg(t,e){const n=sn[t.type]||{scales:{}},a=e.scales||{},r=Nr(t.type,e),s=Object.create(null);return Object.keys(a).forEach(i=>{const l=a[i];if(!we(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=Pr(i,l,Yg(i,t),Te.scales[l.type]),d=qg(c,r),u=n.scales||{};s[i]=Kn(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Nr(l,e),u=(sn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=Hg(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),Kn(s[m],[{axis:h},a[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Kn(l,[Te.scales[l.type],Te.scale])}),s}function $l(t){const e=t.options||(t.options={});e.plugins=ye(e.plugins,{}),e.scales=Gg(t,e)}function Tl(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Kg(t){return t=t||{},t.data=Tl(t.data),$l(t),t}const Ol=new Map,zl=new Set;function oa(t,e){let n=Ol.get(t);return n||(n=e(),Ol.set(t,n),zl.add(n)),n}const uo=(t,e,n)=>{const a=on(e,n);a!==void 0&&t.add(a)};class Xg{constructor(e){this._config=Kg(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Tl(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),$l(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return oa(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return oa(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return oa(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,a=this.type;return oa(`${a}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const a=this._scopeCache;let r=a.get(e);return(!r||n)&&(r=new Map,a.set(e,r)),r}getOptionScopes(e,n,a){const{options:r,type:s}=this,i=this._cachedScopes(e,a),l=i.get(n);if(l)return l;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>uo(c,e,f))),u.forEach(f=>uo(c,r,f)),u.forEach(f=>uo(c,sn[s]||{},f)),u.forEach(f=>uo(c,Te,f)),u.forEach(f=>uo(c,fr,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),zl.has(n)&&i.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,sn[n]||{},Te.datasets[n]||{},{type:n},Te,fr]}resolveNamedOptions(e,n,a,r=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Fl(this._resolverCache,e,r);let c=i;if(Qg(i,n)){s.$shared=!1,a=Wt(a)?a():a;const d=this.createResolver(e,a,l);c=Cn(i,a,d)}for(const d of n)s[d]=c[d];return s}createResolver(e,n,a=[""],r){const{resolver:s}=Fl(this._resolverCache,e,a);return we(n)?Cn(s,n,void 0,r):s}}function Fl(t,e,n){let a=t.get(e);a||(a=new Map,t.set(e,a));const r=n.join();let s=a.get(r);return s||(s={resolver:gr(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},a.set(r,s)),s}const Jg=t=>we(t)&&Object.getOwnPropertyNames(t).some(e=>Wt(t[e]));function Qg(t,e){const{isScriptable:n,isIndexable:a}=Li(t);for(const r of e){const s=n(r),i=a(r),l=(i||s)&&t[r];if(s&&(Wt(l)||Jg(l))||i&&Oe(l))return!0}return!1}var Zg="4.5.1";const e0=["top","bottom","left","right","chartArea"];function Rl(t,e){return t==="top"||t==="bottom"||e0.indexOf(t)===-1&&e==="x"}function vl(t,e){return function(n,a){return n[t]===a[t]?n[e]-a[e]:n[t]-a[t]}}function Ll(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Me(n&&n.onComplete,[t],e)}function t0(t){const e=t.chart,n=e.options.animation;Me(n&&n.onProgress,[t],e)}function Il(t){return xr()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const aa={},jl=t=>{const e=Il(t);return Object.values(aa).filter(n=>n.canvas===e).pop()};function n0(t,e,n){const a=Object.keys(t);for(const r of a){const s=+r;if(s>=e){const i=t[r];delete t[r],(n>0||s>e)&&(t[s+n]=i)}}}function o0(t,e,n,a){return!n||t.type==="mouseout"?null:a?e:t}class Mt{static register(...e){gt.add(...e),Wl()}static unregister(...e){gt.remove(...e),Wl()}constructor(e,n){const a=this.config=new Xg(n),r=Il(e),s=jl(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||wg(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=tm(),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 vg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=km(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],aa[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Dt.listen(this,"complete",Ll),Dt.listen(this,"progress",t0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:a,height:r,_aspectRatio:s}=this;return Be(e)?n&&s?s:r?a/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Fi(this.canvas,this.ctx),this}stop(){return Dt.stop(this),this}resize(e,n){Dt.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const a=this.options,r=this.canvas,s=a.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,n,s),l=a.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Yi(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Me(a.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Se(n,(a,r)=>{a.id=r})}buildOrUpdateScales(){const e=this.options,n=e.scales,a=this.scales,r=Object.keys(a).reduce((i,l)=>(i[l]=!1,i),{});let s=[];n&&(s=s.concat(Object.keys(n).map(i=>{const l=n[i],c=Pr(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Se(s,i=>{const l=i.options,c=l.id,d=Pr(c,l),u=ye(l.type,i.dtype);(l.position===void 0||Rl(l.position,d)!==Rl(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=gt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),a[f.id]=f}f.init(l,e)}),Se(r,(i,l)=>{i||delete a[l]}),Se(a,i=>{nt.configure(this,i,i.options),nt.addBox(this,i)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,a=e.length;if(e.sort((r,s)=>r.index-s.index),a>n){for(let r=n;r<a;++r)this._destroyDatasetMeta(r);e.splice(n,a-n)}this._sortedMetasets=e.slice(0).sort(vl("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((a,r)=>{n.filter(s=>s===a._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let a,r;for(this._removeUnreferencedMetasets(),a=0,r=n.length;a<r;a++){const s=n[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||Nr(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=gt.getController(l),{datasetElementType:d,dataElementType:u}=Te.datasets[l];Object.assign(c,{dataElementType:gt.getElement(u),datasetElementType:d&&gt.getElement(d)}),i.controller=new c(this,a),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){Se(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const a=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!a.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,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||Se(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(vl("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Se(this.scales,e=>{nt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),a=new Set(e.events);(!ki(n,a)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:a,start:r,count:s}of n){const i=a==="_removeElements"?-s:s;n0(e,r,i)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,a=s=>new Set(e.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),r=a(0);for(let s=1;s<n;s++)if(!ki(r,a(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;nt.update(this,this.width,this.height,e);const n=this.chartArea,a=n.width<=0||n.height<=0;this._layers=[],Se(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(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,a=this.data.datasets.length;n<a;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,a=this.data.datasets.length;n<a;++n)this._updateDataset(n,Wt(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const a=this.getDatasetMeta(e),r={meta:a,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(a.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Dt.has(this)?this.attached&&!Dt.running(this)&&Dt.start(this):(this.draw(),Ll({chart:this})))}draw(){let e;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 n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,a=[];let r,s;for(r=0,s=n.length;r<s;++r){const i=n[r];(!e||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,a={meta:e,index:e.index,cancelable:!0},r=ol(this,e);this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&Io(n,r),e.controller.draw(),r&&jo(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return no(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,a,r){const s=eg.modes[n];return typeof s=="function"?s(this,e,a,r):[]}getDatasetMeta(e){const n=this.data.datasets[e],a=this._metasets;let r=a.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_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(e){const n=this.data.datasets[e];if(!n)return!1;const a=this.getDatasetMeta(e);return typeof a.hidden=="boolean"?!a.hidden:!n.hidden}setDatasetVisibility(e,n){const a=this.getDatasetMeta(e);a.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,a){const r=a?"show":"hide",s=this.getDatasetMeta(e),i=s.controller._resolveAnimations(void 0,r);Xn(n)?(s.data[n].hidden=!a,this.update()):(this.setDatasetVisibility(e,a),i.update(s,{visible:a}),this.update(l=>l.datasetIndex===e?r:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Dt.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Fi(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete aa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,a=(s,i)=>{n.addEventListener(this,s,i),e[s]=i},r=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Se(this.options.events,s=>a(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,a=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},r=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[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)},n.isAttached(this.canvas)?l():i()}unbindEvents(){Se(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Se(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,a){const r=a?"set":"remove";let s,i,l,c;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){i=e[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],a=e.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}});!Fo(a,n)&&(this._active=a,this._lastEvent=null,this._updateHoverStyles(a,n))}notifyPlugins(e,n,a){return this._plugins.notify(this,e,n,a)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,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(n,e),l=a?e:s(e,n);i.length&&this.updateHoverStyle(i,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(e,n){const a={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},r=i=>(i.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",a,r)===!1)return;const s=this._handleEvent(e,n,a.inChartArea);return a.cancelable=!1,this.notifyPlugins("afterEvent",a,r),(s||a.changed)&&this.render(),this}_handleEvent(e,n,a){const{_active:r=[],options:s}=this,i=n,l=this._getActiveElements(e,r,a,i),c=im(e),d=o0(e,this._lastEvent,a,c);a&&(this._lastEvent=null,Me(s.onHover,[e,l,this],this),c&&Me(s.onClick,[e,l,this],this));const u=!Fo(l,r);return(u||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=d,u}_getActiveElements(e,n,a,r){if(e.type==="mouseout")return[];if(!a)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,r)}}ie(Mt,"defaults",Te),ie(Mt,"instances",aa),ie(Mt,"overrides",sn),ie(Mt,"registry",gt),ie(Mt,"version",Zg),ie(Mt,"getChart",jl);function Wl(){return Se(Mt.instances,t=>t._plugins.invalidate())}function a0(t,e,n){const{startAngle:a,x:r,y:s,outerRadius:i,innerRadius:l,options:c}=e,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Je(a-n));if(t.beginPath(),t.arc(r,s,i-d/2,a+f/2,n-f/2),l>0){const h=Math.min(d/l,Je(a-n));t.arc(r,s,l+d/2,n-h/2,a+h/2,!0)}else{const h=Math.min(d/2,i*Je(a-n));if(u==="round")t.arc(r,s,h,n-Ee/2,a+Ee/2,!0);else if(u==="bevel"){const m=2*h*h,b=-m*Math.cos(n+Ee/2)+r,p=-m*Math.sin(n+Ee/2)+s,g=m*Math.cos(a+Ee/2)+r,y=m*Math.sin(a+Ee/2)+s;t.lineTo(b,p),t.lineTo(g,y)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function r0(t,e,n){const{startAngle:a,pixelMargin:r,x:s,y:i,outerRadius:l,innerRadius:c}=e;let d=r/l;t.beginPath(),t.arc(s,i,l,a-d,n+d),c>r?(d=r/c,t.arc(s,i,c,n+d,a-d,!0)):t.arc(s,i,r,n+Re,a-Re),t.closePath(),t.clip()}function s0(t){return pr(t,["outerStart","outerEnd","innerStart","innerEnd"])}function i0(t,e,n,a){const r=s0(t.options.borderRadius),s=(n-e)/2,i=Math.min(s,a*e/2),l=c=>{const d=(n-Math.min(s,c))*a/2;return je(c,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:je(r.innerStart,0,i),innerEnd:je(r.innerEnd,0,i)}}function Vn(t,e,n,a){return{x:n+t*Math.cos(e),y:a+t*Math.sin(e)}}function ra(t,e,n,a,r,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+a+n-d,0),h=u>0?u+a+n+d:0;let m=0;const b=r-c;if(a){const Y=u>0?u-a:0,z=f>0?f-a:0,v=(Y+z)/2,W=v!==0?b*v/(v+a):b;m=(b-W)/2}const p=Math.max(.001,b*f-n/Ee)/f,g=(b-p)/2,y=c+g+m,B=r-g-m,{outerStart:D,outerEnd:M,innerStart:S,innerEnd:k}=i0(e,h,f,B-y),C=f-D,x=f-M,w=y+D/C,E=B-M/x,A=h+S,T=h+k,F=y+S/A,L=B-k/T;if(t.beginPath(),s){const Y=(w+E)/2;if(t.arc(i,l,f,w,Y),t.arc(i,l,f,Y,E),M>0){const O=Vn(x,E,i,l);t.arc(O.x,O.y,M,E,B+Re)}const z=Vn(T,B,i,l);if(t.lineTo(z.x,z.y),k>0){const O=Vn(T,L,i,l);t.arc(O.x,O.y,k,B+Re,L+Math.PI)}const v=(B-k/h+(y+S/h))/2;if(t.arc(i,l,h,B-k/h,v,!0),t.arc(i,l,h,v,y+S/h,!0),S>0){const O=Vn(A,F,i,l);t.arc(O.x,O.y,S,F+Math.PI,y-Re)}const W=Vn(C,y,i,l);if(t.lineTo(W.x,W.y),D>0){const O=Vn(C,w,i,l);t.arc(O.x,O.y,D,y-Re,w)}}else{t.moveTo(i,l);const Y=Math.cos(w)*f+i,z=Math.sin(w)*f+l;t.lineTo(Y,z);const v=Math.cos(E)*f+i,W=Math.sin(E)*f+l;t.lineTo(v,W)}t.closePath()}function l0(t,e,n,a,r){const{fullCircles:s,startAngle:i,circumference:l}=e;let c=e.endAngle;if(s){ra(t,e,n,a,c,r);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%Pe||Pe))}return ra(t,e,n,a,c,r),t.fill(),c}function c0(t,e,n,a,r){const{fullCircles:s,startAngle:i,circumference:l,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,b=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,b?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let p=e.endAngle;if(s){ra(t,e,n,a,p,r);for(let g=0;g<s;++g)t.stroke();isNaN(l)||(p=i+(l%Pe||Pe))}b&&r0(t,e,p),c.selfJoin&&p-i>=Ee&&m===0&&u!=="miter"&&a0(t,e,p),s||(ra(t,e,n,a,p,r),t.stroke())}class fo extends Vt{constructor(n){super();ie(this,"circumference");ie(this,"endAngle");ie(this,"fullCircles");ie(this,"innerRadius");ie(this,"outerRadius");ie(this,"pixelMargin");ie(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,n&&Object.assign(this,n)}inRange(n,a,r){const s=this.getProps(["x","y"],r),{angle:i,distance:l}=Si(s,{x:n,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,b=ye(h,d-c),p=Zn(i,c,d)&&c!==d,g=b>=Pe||p,y=Et(l,u+m,f+m);return g&&y}getCenterPoint(n){const{x:a,y:r,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{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(n){return this.getCenterPoint(n)}draw(n){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>Pe?Math.floor(r/Pe):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(Ee,r||0)),u=s*d;n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,l0(n,this,u,i,l),c0(n,this,u,i,l),n.restore()}}ie(fo,"id","arc"),ie(fo,"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}),ie(fo,"defaultRoutes",{backgroundColor:"backgroundColor"}),ie(fo,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Hl(t,e,n=e){t.lineCap=ye(n.borderCapStyle,e.borderCapStyle),t.setLineDash(ye(n.borderDash,e.borderDash)),t.lineDashOffset=ye(n.borderDashOffset,e.borderDashOffset),t.lineJoin=ye(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ye(n.borderWidth,e.borderWidth),t.strokeStyle=ye(n.borderColor,e.borderColor)}function d0(t,e,n){t.lineTo(n.x,n.y)}function u0(t){return t.stepped?Tm:t.tension||t.cubicInterpolationMode==="monotone"?Om:d0}function ql(t,e,n={}){const a=t.length,{start:r=0,end:s=a-1}=n,{start:i,end:l}=e,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:e.loop,ilen:d<c&&!u?a+d-c:d-c}}function f0(t,e,n,a){const{points:r,options:s}=e,{count:i,start:l,loop:c,ilen:d}=ql(r,n,a),u=u0(s);let{move:f=!0,reverse:h}=a||{},m,b,p;for(m=0;m<=d;++m)b=r[(l+(h?d-m:m))%i],!b.skip&&(f?(t.moveTo(b.x,b.y),f=!1):u(t,p,b,h,s.stepped),p=b);return c&&(b=r[(l+(h?d:0))%i],u(t,p,b,h,s.stepped)),!!c}function h0(t,e,n,a){const r=e.points,{count:s,start:i,ilen:l}=ql(r,n,a),{move:c=!0,reverse:d}=a||{};let u=0,f=0,h,m,b,p,g,y;const B=M=>(i+(d?l-M:M))%s,D=()=>{p!==g&&(t.lineTo(u,g),t.lineTo(u,p),t.lineTo(u,y))};for(c&&(m=r[B(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=r[B(h)],m.skip)continue;const M=m.x,S=m.y,k=M|0;k===b?(S<p?p=S:S>g&&(g=S),u=(f*u+M)/++f):(D(),t.lineTo(M,S),b=k,f=0,p=g=S),y=S}D()}function Ar(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?h0:f0}function m0(t){return t.stepped?hp:t.tension||t.cubicInterpolationMode==="monotone"?mp:fn}function p0(t,e,n,a){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,a)&&r.closePath()),Hl(t,e.options),t.stroke(r)}function g0(t,e,n,a){const{segments:r,options:s}=e,i=Ar(e);for(const l of r)Hl(t,s,l.style),t.beginPath(),i(t,e,l,{start:n,end:n+a-1})&&t.closePath(),t.stroke()}const b0=typeof Path2D=="function";function y0(t,e,n,a){b0&&!e.options.segment?p0(t,e,n,a):g0(t,e,n,a)}class qt extends Vt{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const a=this.options;if((a.tension||a.cubicInterpolationMode==="monotone")&&!a.stepped&&!this._pointsUpdated){const r=a.spanGaps?this._loop:this._fullLoop;rp(this._points,a,e,r,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=kp(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,a=e.length;return a&&n[e[a-1].end]}interpolate(e,n){const a=this.options,r=e[n],s=this.points,i=el(this,{property:n,start:r,end:r});if(!i.length)return;const l=[],c=m0(a);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],b=s[h];if(m===b){l.push(m);continue}const p=Math.abs((r-m[n])/(b[n]-m[n])),g=c(m,b,p,a.stepped);g[n]=e[n],l.push(g)}return l.length===1?l[0]:l}pathSegment(e,n,a){return Ar(this)(e,this,n,a)}path(e,n,a){const r=this.segments,s=Ar(this);let i=this._loop;n=n||0,a=a||this.points.length-n;for(const l of r)i&=s(e,this,l,{start:n,end:n+a-1});return!!i}draw(e,n,a,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),y0(e,this,a,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ie(qt,"id","line"),ie(qt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ie(qt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ie(qt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Ul(t,e,n,a){const r=t.options,{[n]:s}=t.getProps([n],a);return Math.abs(e-s)<r.radius+r.hitRadius}class sa extends Vt{constructor(n){super();ie(this,"parsed");ie(this,"skip");ie(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,a,r){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],r);return Math.pow(n-i,2)+Math.pow(a-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,a){return Ul(this,n,"x",a)}inYRange(n,a){return Ul(this,n,"y",a)}getCenterPoint(n){const{x:a,y:r}=this.getProps(["x","y"],n);return{x:a,y:r}}size(n){n=n||this.options||{};let a=n.radius||0;a=Math.max(a,a&&n.hoverRadius||0);const r=a&&n.borderWidth||0;return(a+r)*2}draw(n,a){const r=this.options;this.skip||r.radius<.1||!no(this,a,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,mr(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ie(sa,"id","point"),ie(sa,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ie(sa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Yl(t,e){const{x:n,y:a,base:r,width:s,height:i}=t.getProps(["x","y","base","width","height"],e);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(n,r),c=Math.max(n,r),d=a-f,u=a+f):(f=s/2,l=n-f,c=n+f,d=Math.min(a,r),u=Math.max(a,r)),{left:l,top:d,right:c,bottom:u}}function Ut(t,e,n,a){return t?0:je(e,n,a)}function x0(t,e,n){const a=t.options.borderWidth,r=t.borderSkipped,s=vi(a);return{t:Ut(r.top,s.top,0,n),r:Ut(r.right,s.right,0,e),b:Ut(r.bottom,s.bottom,0,n),l:Ut(r.left,s.left,0,e)}}function k0(t,e,n){const{enableBorderRadius:a}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=_n(r),i=Math.min(e,n),l=t.borderSkipped,c=a||we(r);return{topLeft:Ut(!c||l.top||l.left,s.topLeft,0,i),topRight:Ut(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Ut(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Ut(!c||l.bottom||l.right,s.bottomRight,0,i)}}function w0(t){const e=Yl(t),n=e.right-e.left,a=e.bottom-e.top,r=x0(t,n/2,a/2),s=k0(t,n/2,a/2);return{outer:{x:e.left,y:e.top,w:n,h:a,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:n-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 $r(t,e,n,a){const r=e===null,s=n===null,l=t&&!(r&&s)&&Yl(t,a);return l&&(r||Et(e,l.left,l.right))&&(s||Et(n,l.top,l.bottom))}function _0(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function C0(t,e){t.rect(e.x,e.y,e.w,e.h)}function Tr(t,e,n={}){const a=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-a,i=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+a,y:t.y+r,w:t.w+s,h:t.h+i,radius:t.radius}}class ia extends Vt{constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:a,backgroundColor:r}}=this,{inner:s,outer:i}=w0(this),l=_0(i.radius)?Wo:C0;e.save(),(i.w!==s.w||i.h!==s.h)&&(e.beginPath(),l(e,Tr(i,n,s)),e.clip(),l(e,Tr(s,-n,i)),e.fillStyle=a,e.fill("evenodd")),e.beginPath(),l(e,Tr(s,n)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,n,a){return $r(this,e,n,a)}inXRange(e,n){return $r(this,e,null,n)}inYRange(e,n){return $r(this,null,e,n)}getCenterPoint(e){const{x:n,y:a,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+r)/2:n,y:s?a:(a+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}ie(ia,"id","bar"),ie(ia,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ie(ia,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function B0(t,e,n){const a=t.segments,r=t.points,s=e.points,i=[];for(const l of a){let{start:c,end:d}=l;d=la(c,d,r);const u=Or(n,r[c],r[d],l.loop);if(!e.segments){i.push({source:l,target:u,start:r[c],end:r[d]});continue}const f=el(e,u);for(const h of f){const m=Or(n,s[h.start],s[h.end],h.loop),b=Zi(l,r,m);for(const p of b)i.push({source:p,target:h,start:{[n]:Gl(u,m,"start",Math.max)},end:{[n]:Gl(u,m,"end",Math.min)}})}}return i}function Or(t,e,n,a){if(a)return;let r=e[t],s=n[t];return t==="angle"&&(r=Je(r),s=Je(s)),{property:t,start:r,end:s}}function S0(t,e){const{x:n=null,y:a=null}=t||{},r=e.points,s=[];return e.segments.forEach(({start:i,end:l})=>{l=la(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})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:d.y}))}),s}function la(t,e,n){for(;e>t;e--){const a=n[e];if(!isNaN(a.x)&&!isNaN(a.y))break}return e}function Gl(t,e,n,a){return t&&e?a(t[n],e[n]):t?t[n]:e?e[n]:0}function Kl(t,e){let n=[],a=!1;return Oe(t)?(a=!0,n=t):n=S0(t,e),n.length?new qt({points:n,options:{tension:0},_loop:a,_fullLoop:a}):null}function Xl(t){return t&&t.fill!==!1}function E0(t,e,n){let r=t[e].fill;const s=[e];let i;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!Ie(r))return r;if(i=t[r],!i)return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function D0(t,e,n){const a=P0(t);if(we(a))return isNaN(a.value)?!1:a;let r=parseFloat(a);return Ie(r)&&Math.floor(r)===r?V0(a[0],e,r,n):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function V0(t,e,n,a){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=a?!1:n}function M0(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:we(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function N0(t,e,n){let a;return t==="start"?a=n:t==="end"?a=e.options.reverse?e.min:e.max:we(t)?a=t.value:a=e.getBaseValue(),a}function P0(t){const e=t.options,n=e.fill;let a=ye(n&&n.target,n);return a===void 0&&(a=!!e.backgroundColor),a===!1||a===null?!1:a===!0?"origin":a}function A0(t){const{scale:e,index:n,line:a}=t,r=[],s=a.segments,i=a.points,l=$0(e,n);l.push(Kl({x:null,y:e.bottom},a));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)T0(r,i[u],l)}return new qt({points:r,options:{}})}function $0(t,e){const n=[],a=t.getMatchingVisibleMetas("line");for(let r=0;r<a.length;r++){const s=a[r];if(s.index===e)break;s.hidden||n.unshift(s.dataset)}return n}function T0(t,e,n){const a=[];for(let r=0;r<n.length;r++){const s=n[r],{first:i,last:l,point:c}=O0(s,e,"x");if(!(!c||i&&l)){if(i)a.unshift(c);else if(t.push(c),!l)break}}t.push(...a)}function O0(t,e,n){const a=t.interpolate(e,n);if(!a)return{};const r=a[n],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][n],h=i[u.end][n];if(Et(r,f,h)){l=r===f,c=r===h;break}}return{first:l,last:c,point:a}}class Jl{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,a){const{x:r,y:s,radius:i}=this;return n=n||{start:0,end:Pe},e.arc(r,s,i,n.end,n.start,!0),!a.bounds}interpolate(e){const{x:n,y:a,radius:r}=this,s=e.angle;return{x:n+Math.cos(s)*r,y:a+Math.sin(s)*r,angle:s}}}function z0(t){const{chart:e,fill:n,line:a}=t;if(Ie(n))return F0(e,n);if(n==="stack")return A0(t);if(n==="shape")return!0;const r=R0(t);return r instanceof Jl?r:Kl(r,a)}function F0(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function R0(t){return(t.scale||{}).getPointPositionForValue?L0(t):v0(t)}function v0(t){const{scale:e={},fill:n}=t,a=M0(n,e);if(Ie(a)){const r=e.isHorizontal();return{x:r?a:null,y:r?null:a}}return null}function L0(t){const{scale:e,fill:n}=t,a=e.options,r=e.getLabels().length,s=a.reverse?e.max:e.min,i=N0(n,e,s),l=[];if(a.grid.circular){const c=e.getPointPositionForValue(0,s);return new Jl({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(i)})}for(let c=0;c<r;++c)l.push(e.getPointPositionForValue(c,i));return l}function zr(t,e,n){const a=z0(e),{chart:r,index:s,line:i,scale:l,axis:c}=e,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},b=r.getDatasetMeta(s),p=ol(r,b);a&&i.points.length&&(Io(t,n),I0(t,{line:i,target:a,above:h,below:m,area:n,scale:l,axis:c,clip:p}),jo(t))}function I0(t,e){const{line:n,target:a,above:r,below:s,area:i,scale:l,clip:c}=e,d=n._loop?"angle":e.axis;t.save();let u=s;s!==r&&(d==="x"?(Ql(t,a,i.top),Fr(t,{line:n,target:a,color:r,scale:l,property:d,clip:c}),t.restore(),t.save(),Ql(t,a,i.bottom)):d==="y"&&(Zl(t,a,i.left),Fr(t,{line:n,target:a,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Zl(t,a,i.right),u=r)),Fr(t,{line:n,target:a,color:u,scale:l,property:d,clip:c}),t.restore()}function Ql(t,e,n){const{segments:a,points:r}=e;let s=!0,i=!1;t.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[la(c,d,r)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),i=!!e.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Zl(t,e,n){const{segments:a,points:r}=e;let s=!0,i=!1;t.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[la(c,d,r)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(n,u.y),t.lineTo(u.x,u.y)),i=!!e.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(n,f.y)}t.lineTo(n,e.first().y),t.closePath(),t.clip()}function Fr(t,e){const{line:n,target:a,property:r,color:s,scale:i,clip:l}=e,c=B0(n,a,r);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,b=a!==!0;t.save(),t.fillStyle=m,j0(t,i,l,b&&Or(r,f,h)),t.beginPath();const p=!!n.pathSegment(t,d);let g;if(b){p?t.closePath():ec(t,a,h,r);const y=!!a.pathSegment(t,u,{move:p,reverse:!0});g=p&&y,g||ec(t,a,f,r)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function j0(t,e,n,a){const r=e.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),t.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),d=Math.max(d,n.top),f=Math.min(f,n.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function ec(t,e,n,a){const r=e.interpolate(n,a);r&&t.lineTo(r.x,r.y)}var W0={id:"filler",afterDatasetsUpdate(t,e,n){const a=(t.data.datasets||[]).length,r=[];let s,i,l,c;for(i=0;i<a;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof qt&&(c={visible:t.isDatasetVisible(i),index:i,fill:D0(l,i,a),chart:t,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=E0(r,i,n.propagate))},beforeDraw(t,e,n){const a=n.drawTime==="beforeDraw",r=t.getSortedVisibleDatasetMetas(),s=t.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&&zr(t.ctx,l,s))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const a=t.getSortedVisibleDatasetMetas();for(let r=a.length-1;r>=0;--r){const s=a[r].$filler;Xl(s)&&zr(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const a=e.meta.$filler;!Xl(a)||n.drawTime!=="beforeDatasetDraw"||zr(t.ctx,a,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const tc=(t,e)=>{let{boxHeight:n=e,boxWidth:a=e}=t;return t.usePointStyle&&(n=Math.min(n,e),a=t.pointStyleWidth||Math.min(a,e)),{boxWidth:a,boxHeight:n,itemHeight:Math.max(e,n)}},H0=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class nc extends Vt{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,a){this.maxWidth=e,this.maxHeight=n,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 e=this.options.labels||{};let n=Me(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(a=>e.filter(a,this.chart.data))),e.sort&&(n=n.sort((a,r)=>e.sort(a,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const a=e.labels,r=He(a.font),s=r.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=tc(a,s);let d,u;n.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,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,a,r){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=r+l;let f=e;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((b,p)=>{const g=a+n/2+s.measureText(b.text).width;(p===0||d[d.length-1]+g+2*l>i)&&(f+=u,d[d.length-(p>0?0:1)]=0,m+=u,h++),c[p]={left:0,top:m,row:h,width:g,height:r},d[d.length-1]+=g+l}),f}_fitCols(e,n,a,r){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-e;let f=l,h=0,m=0,b=0,p=0;return this.legendItems.forEach((g,y)=>{const{itemWidth:B,itemHeight:D}=q0(a,n,s,g,r);y>0&&m+D+2*l>u&&(f+=h+l,d.push({width:h,height:m}),b+=h+l,p++,h=m=0),c[y]={left:b,top:m,col:p,width:B,height:D},h=Math.max(h,B),m+=D+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:a,labels:{padding:r},rtl:s}}=this,i=Sn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=We(a,this.left+r,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,c=We(a,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+e+r,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+r}else{let l=0,c=We(a,this.top+e+r,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,c=We(a,this.top+e+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 e=this.ctx;Io(e,this),this._draw(),jo(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:a,ctx:r}=this,{align:s,labels:i}=e,l=Te.color,c=Sn(e.rtl,this.left,this.width),d=He(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:b,boxHeight:p,itemHeight:g}=tc(i,f),y=function(k,C,x){if(isNaN(b)||b<=0||isNaN(p)||p<0)return;r.save();const w=ye(x.lineWidth,1);if(r.fillStyle=ye(x.fillStyle,l),r.lineCap=ye(x.lineCap,"butt"),r.lineDashOffset=ye(x.lineDashOffset,0),r.lineJoin=ye(x.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=ye(x.strokeStyle,l),r.setLineDash(ye(x.lineDash,[])),i.usePointStyle){const E={radius:p*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:w},A=c.xPlus(k,b/2),T=C+h;Ri(r,E,A,T,i.pointStyleWidth&&b)}else{const E=C+Math.max((f-p)/2,0),A=c.leftForLtr(k,b),T=_n(x.borderRadius);r.beginPath(),Object.values(T).some(F=>F!==0)?Wo(r,{x:A,y:E,w:b,h:p,radius:T}):r.rect(A,E,b,p),r.fill(),w!==0&&r.stroke()}r.restore()},B=function(k,C,x){oo(r,x.text,k,C+g/2,d,{strikethrough:x.hidden,textAlign:c.textAlign(x.textAlign)})},D=this.isHorizontal(),M=this._computeTitleHeight();D?m={x:We(s,this.left+u,this.right-a[0]),y:this.top+u+M,line:0}:m={x:this.left+u,y:We(s,this.top+M+u,this.bottom-n[0].height),line:0},Ki(this.ctx,e.textDirection);const S=g+u;this.legendItems.forEach((k,C)=>{r.strokeStyle=k.fontColor,r.fillStyle=k.fontColor;const x=r.measureText(k.text).width,w=c.textAlign(k.textAlign||(k.textAlign=i.textAlign)),E=b+h+x;let A=m.x,T=m.y;c.setWidth(this.width),D?C>0&&A+E+u>this.right&&(T=m.y+=S,m.line++,A=m.x=We(s,this.left+u,this.right-a[m.line])):C>0&&T+S>this.bottom&&(A=m.x=A+n[m.line].width+u,m.line++,T=m.y=We(s,this.top+M+u,this.bottom-n[m.line].height));const F=c.x(A);if(y(F,T,k),A=wm(w,A+b+h,D?A+E:this.right,e.rtl),B(c.x(A),T,k),D)m.x+=E+u;else if(typeof k.text!="string"){const L=d.lineHeight;m.y+=oc(k,L)+u}else m.y+=S}),Xi(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,a=He(n.font),r=tt(n.padding);if(!n.display)return;const s=Sn(e.rtl,this.left,this.width),i=this.ctx,l=n.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=We(e.align,f,this.right-h);else{const b=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);u=d+We(e.align,this.top,this.bottom-b-e.labels.padding-this._computeTitleHeight())}const m=We(l,f,f+h);i.textAlign=s.textAlign(lr(l)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=a.string,oo(i,n.text,m,u,a)}_computeTitleHeight(){const e=this.options.title,n=He(e.font),a=tt(e.padding);return e.display?n.lineHeight+a.height:0}_getLegendItemAt(e,n){let a,r,s;if(Et(e,this.left,this.right)&&Et(n,this.top,this.bottom)){for(s=this.legendHitBoxes,a=0;a<s.length;++a)if(r=s[a],Et(e,r.left,r.left+r.width)&&Et(n,r.top,r.top+r.height))return this.legendItems[a]}return null}handleEvent(e){const n=this.options;if(!G0(e.type,n))return;const a=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,s=H0(r,a);r&&!s&&Me(n.onLeave,[e,r,this],this),this._hoveredItem=a,a&&!s&&Me(n.onHover,[e,a,this],this)}else a&&Me(n.onClick,[e,a,this],this)}}function q0(t,e,n,a,r){const s=U0(a,t,e,n),i=Y0(r,a,e.lineHeight);return{itemWidth:s,itemHeight:i}}function U0(t,e,n,a){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((s,i)=>s.length>i.length?s:i)),e+n.size/2+a.measureText(r).width}function Y0(t,e,n){let a=t;return typeof e.text!="string"&&(a=oc(e,n)),a}function oc(t,e){const n=t.text?t.text.length:0;return e*n}function G0(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var K0={id:"legend",_element:nc,start(t,e,n){const a=t.legend=new nc({ctx:t.ctx,options:n,chart:t});nt.configure(t,a,n),nt.addBox(t,a)},stop(t){nt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const a=t.legend;nt.configure(t,a,n),a.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const a=e.datasetIndex,r=n.chart;r.isDatasetVisible(a)?(r.hide(a),e.hidden=!0):(r.show(a),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=tt(d.borderWidth);return{text:e[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: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 ac extends Vt{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){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=e,this.height=this.bottom=n;const r=Oe(a.text)?a.text.length:1;this._padding=tt(a.padding);const s=r*He(a.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:a,bottom:r,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=We(l,a,s),f=n+e,d=s-a):(i.position==="left"?(u=a+e,f=We(l,r,n),c=Ee*-.5):(u=s-e,f=We(l,n,r),c=Ee*.5),d=r-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const a=He(n.font),s=a.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);oo(e,n.text,0,0,a,{color:n.color,maxWidth:c,rotation:d,textAlign:lr(n.align),textBaseline:"middle",translation:[i,l]})}}function X0(t,e){const n=new ac({ctx:t.ctx,options:e,chart:t});nt.configure(t,n,e),nt.addBox(t,n),t.titleBlock=n}var J0={id:"title",_element:ac,start(t,e,n){X0(t,n)},stop(t){const e=t.titleBlock;nt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const a=t.titleBlock;nt.configure(t,a,n),a.options=n},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 ho={average(t){if(!t.length)return!1;let e,n,a=new Set,r=0,s=0;for(e=0,n=t.length;e<n;++e){const l=t[e].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(t,e){if(!t.length)return!1;let n=e.x,a=e.y,r=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=sr(e,d);u<r&&(r=u,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,a=c.y}return{x:n,y:a}}};function bt(t,e){return e&&(Oe(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Nt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
16
+ */class Bp{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,n,a,r){const s=n.listeners[r],i=n.duration;s.forEach(l=>l({chart:e,initial:n.initial,numSteps:i,currentStep:Math.min(a-n.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=Vi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let n=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(e),l=!0):(s[i]=s[s.length-1],s.pop());l&&(r.draw(),this._notify(r,a,e,"progress")),s.length||(a.running=!1,this._notify(r,a,e,"complete"),a.initial=!1),n+=s.length}),this._lastDate=e,n===0&&(this._running=!1)}_getAnims(e){const n=this._charts;let a=n.get(e);return a||(a={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(e,a)),a}listen(e,n,a){this._getAnims(e).listeners[n].push(a)}add(e,n){!n||!n.length||this._getAnims(e).items.push(...n)}has(e){return this._getAnims(e).items.length>0}start(e){const n=this._charts.get(e);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((a,r)=>Math.max(a,r._duration),0),this._refresh())}running(e){if(!this._running)return!1;const n=this._charts.get(e);return!(!n||!n.running||!n.items.length)}stop(e){const n=this._charts.get(e);if(!n||!n.items.length)return;const a=n.items;let r=a.length-1;for(;r>=0;--r)a[r].cancel();n.items=[],this._notify(e,n,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var Dt=new Bp;const ol="transparent",Sp={boolean(t,e,n){return n>.5?e:t},color(t,e,n){const a=Ai(t||ol),r=a.valid&&Ai(e||ol);return r&&r.valid?r.mix(a,n).hexString():e},number(t,e,n){return t+(e-t)*n}};class Ep{constructor(e,n,a,r){const s=n[a];r=Ho([e.to,r,s,e.from]);const i=Ho([e.from,s,r]);this._active=!0,this._fn=e.fn||Sp[e.type||typeof i],this._easing=eo[e.easing]||eo.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=n,this._prop=a,this._from=i,this._to=r,this._promises=void 0}active(){return this._active}update(e,n,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,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Ho([e.to,n,r,e.from]),this._from=Ho([e.from,r,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const n=e-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||n<a),!this._active){this._target[r]=l,this._notify(!0);return}if(n<0){this._target[r]=s;return}c=n/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 e=this._promises||(this._promises=[]);return new Promise((n,a)=>{e.push({res:n,rej:a})})}_notify(e){const n=e?"res":"rej",a=this._promises||[];for(let r=0;r<a.length;r++)a[r][n]()}}class al{constructor(e,n){this._chart=e,this._properties=new Map,this.configure(n)}configure(e){if(!we(e))return;const n=Object.keys(Te.animation),a=this._properties;Object.getOwnPropertyNames(e).forEach(r=>{const s=e[r];if(!we(s))return;const i={};for(const l of n)i[l]=s[l];(Oe(s.properties)&&s.properties||[r]).forEach(l=>{(l===r||!a.has(l))&&a.set(l,i)})})}_animateOptions(e,n){const a=n.options,r=Vp(e,a);if(!r)return[];const s=this._createAnimations(r,a);return a.$shared&&Dp(e.options.$animations,a).then(()=>{e.options=a},()=>{}),s}_createAnimations(e,n){const a=this._properties,r=[],s=e.$animations||(e.$animations={}),i=Object.keys(n),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(e,n));continue}const u=n[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){e[d]=u;continue}s[d]=f=new Ep(h,e,d,u),r.push(f)}return r}update(e,n){if(this._properties.size===0){Object.assign(e,n);return}const a=this._createAnimations(e,n);if(a.length)return Dt.add(this._chart,a),!0}}function Dp(t,e){const n=[],a=Object.keys(e);for(let r=0;r<a.length;r++){const s=t[a[r]];s&&s.active()&&n.push(s.wait())}return Promise.all(n)}function Vp(t,e){if(!e)return;let n=t.options;if(!n){t.options=e;return}return n.$shared&&(t.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function rl(t,e){const n=t&&t.options||{},a=n.reverse,r=n.min===void 0?e:0,s=n.max===void 0?e:0;return{start:a?s:r,end:a?r:s}}function Mp(t,e,n){if(n===!1)return!1;const a=rl(t,n),r=rl(e,n);return{top:r.end,right:a.end,bottom:r.start,left:a.start}}function Np(t){let e,n,a,r;return we(t)?(e=t.top,n=t.right,a=t.bottom,r=t.left):e=n=a=r=t,{top:e,right:n,bottom:a,left:r,disabled:t===!1}}function sl(t,e){const n=[],a=t._getSortedDatasetMetas(e);let r,s;for(r=0,s=a.length;r<s;++r)n.push(a[r].index);return n}function il(t,e,n,a={}){const r=t.keys,s=a.mode==="single";let i,l,c,d;if(e===null)return;let u=!1;for(i=0,l=r.length;i<l;++i){if(c=+r[i],c===n){if(u=!0,a.all)continue;break}d=t.values[c],Ie(d)&&(s||e===0||pt(e)===pt(d))&&(e+=d)}return!u&&!a.all?0:e}function Pp(t,e){const{iScale:n,vScale:a}=e,r=n.axis==="x"?"x":"y",s=a.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]={[r]:u,[s]:t[u]};return l}function wr(t,e){const n=t&&t.options.stacked;return n||n===void 0&&e.stack!==void 0}function Ap(t,e,n){return`${t.id}.${e.id}.${n.stack||n.type}`}function $p(t){const{min:e,max:n,minDefined:a,maxDefined:r}=t.getUserBounds();return{min:a?e:Number.NEGATIVE_INFINITY,max:r?n:Number.POSITIVE_INFINITY}}function Tp(t,e,n){const a=t[e]||(t[e]={});return a[n]||(a[n]={})}function ll(t,e,n,a){for(const r of e.getMatchingVisibleMetas(a).reverse()){const s=t[r.index];if(n&&s>0||!n&&s<0)return r.index}return null}function cl(t,e){const{chart:n,_cachedMeta:a}=t,r=n._stacks||(n._stacks={}),{iScale:s,vScale:i,index:l}=a,c=s.axis,d=i.axis,u=Ap(s,i,a),f=e.length;let h;for(let m=0;m<f;++m){const b=e[m],{[c]:p,[d]:g}=b,y=b._stacks||(b._stacks={});h=y[d]=Tp(r,u,p),h[l]=g,h._top=ll(h,i,!0,a.type),h._bottom=ll(h,i,!1,a.type);const B=h._visualValues||(h._visualValues={});B[l]=g}}function _r(t,e){const n=t.scales;return Object.keys(n).filter(a=>n[a].axis===e).shift()}function Op(t,e){return cn(t,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function zp(t,e,n){return cn(t,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:n,index:e,mode:"default",type:"data"})}function ao(t,e){const n=t.controller.index,a=t.vScale&&t.vScale.axis;if(a){e=e||t._parsed;for(const r of e){const s=r._stacks;if(!s||s[a]===void 0||s[a][n]===void 0)return;delete s[a][n],s[a]._visualValues!==void 0&&s[a]._visualValues[n]!==void 0&&delete s[a]._visualValues[n]}}}const Cr=t=>t==="reset"||t==="none",dl=(t,e)=>e?t:Object.assign({},t),Fp=(t,e,n)=>t&&!e.hidden&&e._stacked&&{keys:sl(n,!0),values:null};class hn{constructor(e,n){this.chart=e,this._ctx=e.ctx,this.index=n,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=wr(e.vScale,e),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(e){this.index!==e&&ao(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,n=this._cachedMeta,a=this.getDataset(),r=(f,h,m,b)=>f==="x"?h:f==="r"?b:m,s=n.xAxisID=ye(a.xAxisID,_r(e,"x")),i=n.yAxisID=ye(a.yAxisID,_r(e,"y")),l=n.rAxisID=ye(a.rAxisID,_r(e,"r")),c=n.indexAxis,d=n.iAxisID=r(c,s,i,l),u=n.vAxisID=r(c,i,s,l);n.xScale=this.getScaleForId(s),n.yScale=this.getScaleForId(i),n.rScale=this.getScaleForId(l),n.iScale=this.getScaleForId(d),n.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const n=this._cachedMeta;return e===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Ei(this._data,this),e._stacked&&ao(e)}_dataCheck(){const e=this.getDataset(),n=e.data||(e.data=[]),a=this._data;if(we(n)){const r=this._cachedMeta;this._data=Pp(n,r)}else if(a!==n){if(a){Ei(a,this);const r=this._cachedMeta;ao(r),r._parsed=[]}n&&Object.isExtensible(n)&&xm(n,this),this._syncList=[],this._data=n}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const n=this._cachedMeta,a=this.getDataset();let r=!1;this._dataCheck();const s=n._stacked;n._stacked=wr(n.vScale,n),n.stack!==a.stack&&(r=!0,ao(n),n.stack=a.stack),this._resyncElements(e),(r||s!==n._stacked)&&(cl(this,n._parsed),n._stacked=wr(n.vScale,n))}configure(){const e=this.chart.config,n=e.datasetScopeKeys(this._type),a=e.getOptionScopes(this.getDataset(),n,!0);this.options=e.createResolver(a,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,n){const{_cachedMeta:a,_data:r}=this,{iScale:s,_stacked:i}=a,l=s.axis;let c=e===0&&n===r.length?!0:a._sorted,d=e>0&&a._parsed[e-1],u,f,h;if(this._parsing===!1)a._parsed=r,a._sorted=!0,h=r;else{Oe(r[e])?h=this.parseArrayData(a,r,e,n):we(r[e])?h=this.parseObjectData(a,r,e,n):h=this.parsePrimitiveData(a,r,e,n);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<n;++u)a._parsed[u+e]=f=h[u],c&&(m()&&(c=!1),d=f);a._sorted=c}i&&cl(this,h)}parsePrimitiveData(e,n,a,r){const{iScale:s,vScale:i}=e,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(r);let h,m,b;for(h=0,m=r;h<m;++h)b=h+a,f[h]={[l]:u||s.parse(d[b],b),[c]:i.parse(n[b],b)};return f}parseArrayData(e,n,a,r){const{xScale:s,yScale:i}=e,l=new Array(r);let c,d,u,f;for(c=0,d=r;c<d;++c)u=c+a,f=n[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(e,n,a,r){const{xScale:s,yScale:i}=e,{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=n[h],d[u]={x:s.parse(on(m,l),h),y:i.parse(on(m,c),h)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,n,a){const r=this.chart,s=this._cachedMeta,i=n[e.axis],l={keys:sl(r,!0),values:n._stacks[e.axis]._visualValues};return il(l,i,s.index,{mode:a})}updateRangeFromParsed(e,n,a,r){const s=a[n.axis];let i=s===null?NaN:s;const l=r&&a._stacks[n.axis];r&&l&&(r.values=l,i=il(r,s,this._cachedMeta.index)),e.min=Math.min(e.min,i),e.max=Math.max(e.max,i)}getMinMax(e,n){const a=this._cachedMeta,r=a._parsed,s=a._sorted&&e===a.iScale,i=r.length,l=this._getOtherScale(e),c=Fp(n,a,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=$p(l);let h,m;function b(){m=r[h];const p=m[l.axis];return!Ie(m[e.axis])||u>p||f<p}for(h=0;h<i&&!(!b()&&(this.updateRangeFromParsed(d,e,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!b()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const n=this._cachedMeta._parsed,a=[];let r,s,i;for(r=0,s=n.length;r<s;++r)i=n[r][e.axis],Ie(i)&&a.push(i);return a}getMaxOverflow(){return!1}getLabelAndValue(e){const n=this._cachedMeta,a=n.iScale,r=n.vScale,s=this.getParsed(e);return{label:a?""+a.getLabelForValue(s[a.axis]):"",value:r?""+r.getLabelForValue(s[r.axis]):""}}_update(e){const n=this._cachedMeta;this.update(e||"default"),n._clip=Np(ye(this.options.clip,Mp(n.xScale,n.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,n=this.chart,a=this._cachedMeta,r=a.data||[],s=n.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||r.length-l,d=this.options.drawActiveElementsOnTop;let u;for(a.dataset&&a.dataset.draw(e,s,l,c),u=l;u<l+c;++u){const f=r[u];f.hidden||(f.active&&d?i.push(f):f.draw(e,s))}for(u=0;u<i.length;++u)i[u].draw(e,s)}getStyle(e,n){const a=n?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(a):this.resolveDataElementOptions(e||0,a)}getContext(e,n,a){const r=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const i=this._cachedMeta.data[e];s=i.$context||(i.$context=zp(this.getContext(),e,i)),s.parsed=this.getParsed(e),s.raw=r.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=Op(this.chart.getContext(),this.index)),s.dataset=r,s.index=s.datasetIndex=this.index;return s.active=!!n,s.mode=a,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,n){return this._resolveElementOptions(this.dataElementType.id,n,e)}_resolveElementOptions(e,n="default",a){const r=n==="active",s=this._cachedDataOpts,i=e+"-"+n,l=s[i],c=this.enableOptionSharing&&Xn(a);if(l)return dl(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),f=r?[`${e}Hover`,"hover",e,""]:[e,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Te.elements[e]),b=()=>this.getContext(a,r,n),p=d.resolveNamedOptions(h,m,b,f);return p.$shared&&(p.$shared=c,s[i]=Object.freeze(dl(p,c))),p}_resolveAnimations(e,n,a){const r=this.chart,s=this._cachedDataOpts,i=`animation-${n}`,l=s[i];if(l)return l;let c;if(r.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,n),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(e,a,n))}const d=new al(r,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,n){return!n||Cr(e)||this.chart._animationsDisabled}_getSharedOptions(e,n){const a=this.resolveDataElementOptions(e,n),r=this._sharedOptions,s=this.getSharedOptions(a),i=this.includeOptions(n,s)||s!==r;return this.updateSharedOptions(s,n,a),{sharedOptions:s,includeOptions:i}}updateElement(e,n,a,r){Cr(r)?Object.assign(e,a):this._resolveAnimations(n,r).update(e,a)}updateSharedOptions(e,n,a){e&&!Cr(n)&&this._resolveAnimations(void 0,n).update(e,a)}_setStyle(e,n,a,r){e.active=r;const s=this.getStyle(n,r);this._resolveAnimations(n,a,r).update(e,{options:!r&&this.getSharedOptions(s)||s})}removeHoverStyle(e,n,a){this._setStyle(e,a,"active",!1)}setHoverStyle(e,n,a){this._setStyle(e,a,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const n=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=n.length,i=Math.min(s,r);i&&this.parse(0,i),s>r?this._insertElements(r,s-r,e):s<r&&this._removeElements(s,r-s)}_insertElements(e,n,a=!0){const r=this._cachedMeta,s=r.data,i=e+n;let l;const c=d=>{for(d.length+=n,l=d.length-1;l>=i;l--)d[l]=d[l-n]};for(c(s),l=e;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(r._parsed),this.parse(e,n),a&&this.updateElements(s,e,n,"reset")}updateElements(e,n,a,r){}_removeElements(e,n){const a=this._cachedMeta;if(this._parsing){const r=a._parsed.splice(e,n);a._stacked&&ao(a,r)}a.data.splice(e,n)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[n,a,r]=e;this[n](a,r)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,n){n&&this._sync(["_removeElements",e,n]);const a=arguments.length-2;a&&this._sync(["_insertElements",e,a])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}ie(hn,"defaults",{}),ie(hn,"datasetElementType",null),ie(hn,"dataElementType",null);function Rp(t,e){if(!t._cache.$bar){const n=t.getMatchingVisibleMetas(e);let a=[];for(let r=0,s=n.length;r<s;r++)a=a.concat(n[r].controller.getAllParsedValues(t));t._cache.$bar=Di(a.sort((r,s)=>r-s))}return t._cache.$bar}function vp(t){const e=t.iScale,n=Rp(e,t.type);let a=e._length,r,s,i,l;const c=()=>{i===32767||i===-32768||(Xn(l)&&(a=Math.min(a,Math.abs(i-l)||a)),l=i)};for(r=0,s=n.length;r<s;++r)i=e.getPixelForValue(n[r]),c();for(l=void 0,r=0,s=e.ticks.length;r<s;++r)i=e.getPixelForTick(r),c();return a}function Lp(t,e,n,a){const r=n.barThickness;let s,i;return Be(r)?(s=e.min*n.categoryPercentage,i=n.barPercentage):(s=r*a,i=1),{chunk:s/a,ratio:i,start:e.pixels[t]-s/2}}function Ip(t,e,n,a){const r=e.pixels,s=r[t];let i=t>0?r[t-1]:null,l=t<r.length-1?r[t+1]:null;const c=n.categoryPercentage;i===null&&(i=s-(l===null?e.end-e.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:n.barPercentage,start:d}}function jp(t,e,n,a){const r=n.parse(t[0],a),s=n.parse(t[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),e[n.axis]=d,e._custom={barStart:c,barEnd:d,start:r,end:s,min:i,max:l}}function ul(t,e,n,a){return Oe(t)?jp(t,e,n,a):e[n.axis]=n.parse(t,a),e}function fl(t,e,n,a){const r=t.iScale,s=t.vScale,i=r.getLabels(),l=r===s,c=[];let d,u,f,h;for(d=n,u=n+a;d<u;++d)h=e[d],f={},f[r.axis]=l||r.parse(i[d],d),c.push(ul(h,f,s,d));return c}function Br(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function Wp(t,e,n){return t!==0?pt(t):(e.isHorizontal()?1:-1)*(e.min>=n?1:-1)}function Hp(t){let e,n,a,r,s;return t.horizontal?(e=t.base>t.x,n="left",a="right"):(e=t.base<t.y,n="bottom",a="top"),e?(r="end",s="start"):(r="start",s="end"),{start:n,end:a,reverse:e,top:r,bottom:s}}function qp(t,e,n,a){let r=e.borderSkipped;const s={};if(!r){t.borderSkipped=s;return}if(r===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=Hp(t);r==="middle"&&n&&(t.enableBorderRadius=!0,(n._top||0)===a?r=d:(n._bottom||0)===a?r=u:(s[hl(u,i,l,c)]=!0,r=d)),s[hl(r,i,l,c)]=!0,t.borderSkipped=s}function hl(t,e,n,a){return a?(t=Up(t,e,n),t=ml(t,n,e)):t=ml(t,e,n),t}function Up(t,e,n){return t===e?n:t===n?e:t}function ml(t,e,n){return t==="start"?e:t==="end"?n:t}function Yp(t,{inflateAmount:e},n){t.inflateAmount=e==="auto"?n===1?.33:0:e}class Ko extends hn{parsePrimitiveData(e,n,a,r){return fl(e,n,a,r)}parseArrayData(e,n,a,r){return fl(e,n,a,r)}parseObjectData(e,n,a,r){const{iScale:s,vScale:i}=e,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,b,p;for(h=a,m=a+r;h<m;++h)p=n[h],b={},b[s.axis]=s.parse(on(p,d),h),f.push(ul(on(p,u),b,i,h));return f}updateRangeFromParsed(e,n,a,r){super.updateRangeFromParsed(e,n,a,r);const s=a._custom;s&&n===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const n=this._cachedMeta,{iScale:a,vScale:r}=n,s=this.getParsed(e),i=s._custom,l=Br(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 e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,e)}updateElements(e,n,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(n,r);for(let m=n;m<n+a;m++){const b=this.getParsed(m),p=s||Be(b[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),g=this._calculateBarIndexPixels(m,u),y=(b._stacks||{})[l.axis],B={horizontal:d,base:p.base,enableBorderRadius:!y||Br(b._custom)||i===y._top||i===y._bottom,x:d?p.head:g.center,y:d?g.center:p.head,height:d?g.size:Math.abs(p.size),width:d?Math.abs(p.size):g.size};h&&(B.options=f||this.resolveDataElementOptions(m,e[m].active?"active":r));const D=B.options||e[m].options;qp(B,D,y,i),Yp(B,D,u.ratio),this.updateElement(e[m],m,B,r)}}_getStacks(e,n){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(n),c=l&&l[a.axis],d=u=>{const f=u._parsed.find(m=>m[a.axis]===c),h=f&&f[u.vScale.axis];if(Be(h)||isNaN(h))return!0};for(const u of r)if(!(n!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===e))break;return i.length||i.push(void 0),i}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(e).filter(a=>e[a].axis===n).shift()}_getAxis(){const e={},n=this.getFirstScaleIdForIndexAxis();for(const a of this.chart.data.datasets)e[ye(this.chart.options.indexAxis==="x"?a.xAxisID:a.yAxisID,n)]=!0;return Object.keys(e)}_getStackIndex(e,n,a){const r=this._getStacks(e,a),s=n!==void 0?r.indexOf(n):-1;return s===-1?r.length-1:s}_getRuler(){const e=this.options,n=this._cachedMeta,a=n.iScale,r=[];let s,i;for(s=0,i=n.data.length;s<i;++s)r.push(a.getPixelForValue(this.getParsed(s)[a.axis],s));const l=e.barThickness;return{min:l||vp(n),pixels:r,start:a._startPixel,end:a._endPixel,stackCount:this._getStackCount(),scale:a,grouped:e.grouped,ratio:l?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:n,_stacked:a,index:r},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(e),d=c._custom,u=Br(d);let f=c[n.axis],h=0,m=a?this.applyStack(n,c,a):f,b,p;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&pt(f)!==pt(d.barEnd)&&(h=0),h+=f);const g=!Be(s)&&!u?s:h;let y=n.getPixelForValue(g);if(this.chart.getDataVisibility(e)?b=n.getPixelForValue(h+m):b=y,p=b-y,Math.abs(p)<i){p=Wp(p,n,l)*i,f===l&&(y-=p/2);const B=n.getPixelForDecimal(0),D=n.getPixelForDecimal(1),M=Math.min(B,D),S=Math.max(B,D);y=Math.max(Math.min(y,S),M),b=y+p,a&&!u&&(c._stacks[n.axis]._visualValues[r]=n.getValueForPixel(b)-n.getValueForPixel(y))}if(y===n.getPixelForValue(l)){const B=pt(p)*n.getLineWidthForValue(l)/2;y+=B,p-=B}return{size:p,base:y,head:b,center:b+p/2}}_calculateBarIndexPixels(e,n){const a=n.scale,r=this.options,s=r.skipNull,i=ye(r.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(n.grouped){const u=s?this._getStackCount(e):n.stackCount,f=r.barThickness==="flex"?Ip(e,n,r,u*d):Lp(e,n,r,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(ye(h,this.getFirstScaleIdForIndexAxis())),b=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0)+m;l=f.start+f.chunk*b+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=a.getPixelForValue(this.getParsed(e)[a.axis],e),c=Math.min(i,n.min*n.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const e=this._cachedMeta,n=e.vScale,a=e.data,r=a.length;let s=0;for(;s<r;++s)this.getParsed(s)[n.axis]!==null&&!a[s].hidden&&a[s].draw(this._ctx)}}ie(Ko,"id","bar"),ie(Ko,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),ie(Ko,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Gp(t,e,n){let a=1,r=1,s=0,i=0;if(e<Pe){const l=t,c=l+e,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(D,M,S)=>Zn(D,l,c,!0)?1:Math.max(M,M*n,S,S*n),b=(D,M,S)=>Zn(D,l,c,!0)?-1:Math.min(M,M*n,S,S*n),p=m(0,d,f),g=m(Re,u,h),y=b(Ee,d,f),B=b(Ee+Re,u,h);a=(p-y)/2,r=(g-B)/2,s=-(p+y)/2,i=-(g+B)/2}return{ratioX:a,ratioY:r,offsetX:s,offsetY:i}}class En extends hn{constructor(e,n){super(e,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,n){const a=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=a;else{let s=c=>+a[c];if(we(a[e])){const{key:c="value"}=this._parsing;s=d=>+on(a[d],c)}let i,l;for(i=e,l=e+n;i<l;++i)r._parsed[i]=s(i)}}_getRotation(){return St(this.options.rotation-90)}_getCircumference(){return St(this.options.circumference)}_getRotationExtents(){let e=Pe,n=-Pe;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();e=Math.min(e,s),n=Math.max(n,s+i)}return{rotation:e,circumference:n-e}}update(e){const n=this.chart,{chartArea:a}=n,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(nm(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:b,offsetY:p}=Gp(f,u,c),g=(a.width-i)/h,y=(a.height-i)/m,B=Math.max(Math.min(g,y)/2,0),D=gi(this.options.radius,B),M=Math.max(D*c,0),S=(D-M)/this._getVisibleDatasetWeightTotal();this.offsetX=b*D,this.offsetY=p*D,r.total=this.calculateTotal(),this.outerRadius=D-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*d,0),this.updateElements(s,0,s.length,e)}_circumference(e,n){const a=this.options,r=this._cachedMeta,s=this._getCircumference();return n&&a.animation.animateRotate||!this.chart.getDataVisibility(e)||r._parsed[e]===null||r.data[e].hidden?0:this.calculateCircumference(r._parsed[e]*s/Pe)}updateElements(e,n,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,b=h?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(n,r);let y=this._getRotation(),B;for(B=0;B<n;++B)y+=this._circumference(B,s);for(B=n;B<n+a;++B){const D=this._circumference(B,s),M=e[B],S={x:u+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+D,circumference:D,outerRadius:b,innerRadius:m};g&&(S.options=p||this.resolveDataElementOptions(B,M.active?"active":r)),y+=D,this.updateElement(M,B,S,r)}}calculateTotal(){const e=this._cachedMeta,n=e.data;let a=0,r;for(r=0;r<n.length;r++){const s=e._parsed[r];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(r)&&!n[r].hidden&&(a+=Math.abs(s))}return a}calculateCircumference(e){const n=this._cachedMeta.total;return n>0&&!isNaN(e)?Pe*(Math.abs(e)/n):0}getLabelAndValue(e){const n=this._cachedMeta,a=this.chart,r=a.data.labels||[],s=ur(n._parsed[e],a.options.locale);return{label:r[e]||"",value:s}}getMaxBorderWidth(e){let n=0;const a=this.chart;let r,s,i,l,c;if(!e){for(r=0,s=a.data.datasets.length;r<s;++r)if(a.isDatasetVisible(r)){i=a.getDatasetMeta(r),e=i.data,l=i.controller;break}}if(!e)return 0;for(r=0,s=e.length;r<s;++r)c=l.resolveDataElementOptions(r),c.borderAlign!=="inner"&&(n=Math.max(n,c.borderWidth||0,c.hoverBorderWidth||0));return n}getMaxOffset(e){let n=0;for(let a=0,r=e.length;a<r;++a){const s=this.resolveDataElementOptions(a);n=Math.max(n,s.offset||0,s.hoverOffset||0)}return n}_getRingWeightOffset(e){let n=0;for(let a=0;a<e;++a)this.chart.isDatasetVisible(a)&&(n+=this._getRingWeight(a));return n}_getRingWeight(e){return Math.max(ye(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}ie(En,"id","doughnut"),ie(En,"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"}),ie(En,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),ie(En,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const n=e.data,{labels:{pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=e.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((c,d)=>{const f=e.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!e.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(e,n,a){a.chart.toggleDataVisibility(n.index),a.chart.update()}}}});class Xo extends hn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const n=this._cachedMeta,{dataset:a,data:r=[],_dataset:s}=n,i=this.chart._animationsDisabled;let{start:l,count:c}=_m(n,r,i);this._drawStart=l,this._drawCount=c,Cm(n)&&(l=0,c=r.length),a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!s._decimated,a.points=r;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(a,void 0,{animated:!i,options:d},e),this.updateElements(r,l,c,e)}updateElements(e,n,a,r){const s=r==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(n,r),h=i.axis,m=l.axis,{spanGaps:b,segment:p}=this.options,g=Qn(b)?b:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||r==="none",B=n+a,D=e.length;let M=n>0&&this.getParsed(n-1);for(let S=0;S<D;++S){const k=e[S],C=y?k:{};if(S<n||S>=B){C.skip=!0;continue}const x=this.getParsed(S),w=Be(x[m]),E=C[h]=i.getPixelForValue(x[h],S),A=C[m]=s||w?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,x,c):x[m],S);C.skip=isNaN(E)||isNaN(A)||w,C.stop=S>0&&Math.abs(x[h]-M[h])>g,p&&(C.parsed=x,C.raw=d.data[S]),f&&(C.options=u||this.resolveDataElementOptions(S,k.active?"active":r)),y||this.updateElement(k,S,C,r),M=x}}getMaxOverflow(){const e=this._cachedMeta,n=e.dataset,a=n.options&&n.options.borderWidth||0,r=e.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 e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}ie(Xo,"id","line"),ie(Xo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),ie(Xo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Sr extends En{}ie(Sr,"id","pie"),ie(Sr,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function mn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Er{constructor(e){ie(this,"options");this.options=e||{}}static override(e){Object.assign(Er.prototype,e)}init(){}formats(){return mn()}parse(){return mn()}format(){return mn()}add(){return mn()}diff(){return mn()}startOf(){return mn()}endOf(){return mn()}}var Kp={_date:Er};function Xp(t,e,n,a){const{controller:r,data:s,_sorted:i}=t,l=r._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&e===l.axis&&e!=="r"&&i&&s.length){const d=l._reversePixels?bm:rn;if(a){if(r._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(e);if(f){const h=d(s,e,n-f),m=d(s,e,n+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,e,n);if(c){const{vScale:f}=r._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(p=>!Be(p[f.axis]));u.lo-=Math.max(0,m);const b=h.slice(u.hi).findIndex(p=>!Be(p[f.axis]));u.hi+=Math.max(0,b)}return u}}return{lo:0,hi:s.length-1}}function Jo(t,e,n,a,r){const s=t.getSortedVisibleDatasetMetas(),i=n[e];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=Xp(s[l],e,i,r);for(let m=f;m<=h;++m){const b=u[m];b.skip||a(b,d,m)}}}function Jp(t){const e=t.indexOf("x")!==-1,n=t.indexOf("y")!==-1;return function(a,r){const s=e?Math.abs(a.x-r.x):0,i=n?Math.abs(a.y-r.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Dr(t,e,n,a,r){const s=[];return!r&&!t.isPointInArea(e)||Jo(t,n,e,function(l,c,d){!r&&!no(l,t.chartArea,0)||l.inRange(e.x,e.y,a)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function Qp(t,e,n,a){let r=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],a),{angle:f}=Bi(i,{x:e.x,y:e.y});Zn(f,d,u)&&r.push({element:i,datasetIndex:l,index:c})}return Jo(t,n,e,s),r}function Zp(t,e,n,a,r,s){let i=[];const l=Jp(n);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(e.x,e.y,r);if(a&&!m)return;const b=u.getCenterPoint(r);if(!(!!s||t.isPointInArea(b))&&!m)return;const g=l(e,b);g<c?(i=[{element:u,datasetIndex:f,index:h}],c=g):g===c&&i.push({element:u,datasetIndex:f,index:h})}return Jo(t,n,e,d),i}function Vr(t,e,n,a,r,s){return!s&&!t.isPointInArea(e)?[]:n==="r"&&!a?Qp(t,e,n,r):Zp(t,e,n,a,r,s)}function pl(t,e,n,a,r){const s=[],i=n==="x"?"inXRange":"inYRange";let l=!1;return Jo(t,n,e,(c,d,u)=>{c[i]&&c[i](e[n],r)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(e.x,e.y,r))}),a&&!l?[]:s}var eg={modes:{index(t,e,n,a){const r=un(e,t),s=n.axis||"x",i=n.includeInvisible||!1,l=n.intersect?Dr(t,r,s,a,i):Vr(t,r,s,!1,a,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,e,n,a){const r=un(e,t),s=n.axis||"xy",i=n.includeInvisible||!1;let l=n.intersect?Dr(t,r,s,a,i):Vr(t,r,s,!1,a,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,e,n,a){const r=un(e,t),s=n.axis||"xy",i=n.includeInvisible||!1;return Dr(t,r,s,a,i)},nearest(t,e,n,a){const r=un(e,t),s=n.axis||"xy",i=n.includeInvisible||!1;return Vr(t,r,s,n.intersect,a,i)},x(t,e,n,a){const r=un(e,t);return pl(t,r,"x",n.intersect,a)},y(t,e,n,a){const r=un(e,t);return pl(t,r,"y",n.intersect,a)}}};const gl=["left","top","right","bottom"];function ro(t,e){return t.filter(n=>n.pos===e)}function bl(t,e){return t.filter(n=>gl.indexOf(n.pos)===-1&&n.box.axis===e)}function so(t,e){return t.sort((n,a)=>{const r=e?a:n,s=e?n:a;return r.weight===s.weight?r.index-s.index:r.weight-s.weight})}function tg(t){const e=[];let n,a,r,s,i,l;for(n=0,a=(t||[]).length;n<a;++n)r=t[n],{position:s,options:{stack:i,stackWeight:l=1}}=r,e.push({index:n,box:r,pos:s,horizontal:r.isHorizontal(),weight:r.weight,stack:i&&s+i,stackWeight:l});return e}function ng(t){const e={};for(const n of t){const{stack:a,pos:r,stackWeight:s}=n;if(!a||!gl.includes(r))continue;const i=e[a]||(e[a]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return e}function og(t,e){const n=ng(t),{vBoxMaxWidth:a,hBoxMaxHeight:r}=e;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=n[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*a:c&&e.availableWidth,l.height=r):(l.width=a,l.height=u?u*r:c&&e.availableHeight)}return n}function ag(t){const e=tg(t),n=so(e.filter(d=>d.box.fullSize),!0),a=so(ro(e,"left"),!0),r=so(ro(e,"right")),s=so(ro(e,"top"),!0),i=so(ro(e,"bottom")),l=bl(e,"x"),c=bl(e,"y");return{fullSize:n,leftAndTop:a.concat(s),rightAndBottom:r.concat(c).concat(i).concat(l),chartArea:ro(e,"chartArea"),vertical:a.concat(r).concat(c),horizontal:s.concat(i).concat(l)}}function yl(t,e,n,a){return Math.max(t[n],e[n])+Math.max(t[a],e[a])}function xl(t,e){t.top=Math.max(t.top,e.top),t.left=Math.max(t.left,e.left),t.bottom=Math.max(t.bottom,e.bottom),t.right=Math.max(t.right,e.right)}function rg(t,e,n,a){const{pos:r,box:s}=n,i=t.maxPadding;if(!we(r)){n.size&&(t[r]-=n.size);const f=a[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?s.height:s.width),n.size=f.size/f.count,t[r]+=n.size}s.getPadding&&xl(i,s.getPadding());const l=Math.max(0,e.outerWidth-yl(i,t,"left","right")),c=Math.max(0,e.outerHeight-yl(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,n.horizontal?{same:d,other:u}:{same:u,other:d}}function sg(t){const e=t.maxPadding;function n(a){const r=Math.max(e[a]-t[a],0);return t[a]+=r,r}t.y+=n("top"),t.x+=n("left"),n("right"),n("bottom")}function ig(t,e){const n=e.maxPadding;function a(r){const s={left:0,top:0,right:0,bottom:0};return r.forEach(i=>{s[i]=Math.max(e[i],n[i])}),s}return a(t?["left","right"]:["top","bottom"])}function io(t,e,n,a){const r=[];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||e.w,l.height||e.h,ig(l.horizontal,e));const{same:f,other:h}=rg(e,n,l,a);d|=f&&r.length,u=u||h,c.fullSize||r.push(l)}return d&&io(r,e,n,a)||u}function Qo(t,e,n,a,r){t.top=n,t.left=e,t.right=e+a,t.bottom=n+r,t.width=a,t.height=r}function kl(t,e,n,a){const r=n.padding;let{x:s,y:i}=e;for(const l of t){const c=l.box,d=a[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=e.w*u,h=d.size||c.height;Xn(d.start)&&(i=d.start),c.fullSize?Qo(c,r.left,i,n.outerWidth-r.right-r.left,h):Qo(c,e.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=e.h*u,h=d.size||c.width;Xn(d.start)&&(s=d.start),c.fullSize?Qo(c,s,r.top,h,n.outerHeight-r.bottom-r.top):Qo(c,s,e.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}e.x=s,e.y=i}var nt={addBox(t,e){t.boxes||(t.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(n){e.draw(n)}}]},t.boxes.push(e)},removeBox(t,e){const n=t.boxes?t.boxes.indexOf(e):-1;n!==-1&&t.boxes.splice(n,1)},configure(t,e,n){e.fullSize=n.fullSize,e.position=n.position,e.weight=n.weight},update(t,e,n,a){if(!t)return;const r=tt(t.options.layout.padding),s=Math.max(e-r.width,0),i=Math.max(n-r.height,0),l=ag(t.boxes),c=l.vertical,d=l.horizontal;Se(t.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const u=c.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,f=Object.freeze({outerWidth:e,outerHeight:n,padding:r,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},r);xl(h,tt(a));const m=Object.assign({maxPadding:h,w:s,h:i,x:r.left,y:r.top},r),b=og(c.concat(d),f);io(l.fullSize,m,f,b),io(c,m,f,b),io(d,m,f,b)&&io(c,m,f,b),sg(m),kl(l.leftAndTop,m,f,b),m.x+=m.w,m.y+=m.h,kl(l.rightAndBottom,m,f,b),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Se(l.chartArea,p=>{const g=p.box;Object.assign(g,t.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class wl{acquireContext(e,n){}releaseContext(e){return!1}addEventListener(e,n,a){}removeEventListener(e,n,a){}getDevicePixelRatio(){return 1}getMaximumSize(e,n,a,r){return n=Math.max(0,n||e.width),a=a||e.height,{width:n,height:Math.max(0,r?Math.floor(n/r):a)}}isAttached(e){return!0}updateConfig(e){}}class lg extends wl{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const Zo="$chartjs",cg={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},_l=t=>t===null||t==="";function dg(t,e){const n=t.style,a=t.getAttribute("height"),r=t.getAttribute("width");if(t[Zo]={initial:{height:a,width:r,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",_l(r)){const s=Yi(t,"width");s!==void 0&&(t.width=s)}if(_l(a))if(t.style.height==="")t.height=t.width/(e||2);else{const s=Yi(t,"height");s!==void 0&&(t.height=s)}return t}const Cl=fp?{passive:!0}:!1;function ug(t,e,n){t&&t.addEventListener(e,n,Cl)}function fg(t,e,n){t&&t.canvas&&t.canvas.removeEventListener(e,n,Cl)}function hg(t,e){const n=cg[t.type]||t.type,{x:a,y:r}=un(t,e);return{type:n,chart:e,native:t,x:a!==void 0?a:null,y:r!==void 0?r:null}}function ea(t,e){for(const n of t)if(n===e||n.contains(e))return!0}function mg(t,e,n){const a=t.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ea(l.addedNodes,a),i=i&&!ea(l.removedNodes,a);i&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}function pg(t,e,n){const a=t.canvas,r=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||ea(l.removedNodes,a),i=i&&!ea(l.addedNodes,a);i&&n()});return r.observe(document,{childList:!0,subtree:!0}),r}const lo=new Map;let Bl=0;function Sl(){const t=window.devicePixelRatio;t!==Bl&&(Bl=t,lo.forEach((e,n)=>{n.currentDevicePixelRatio!==t&&e()}))}function gg(t,e){lo.size||window.addEventListener("resize",Sl),lo.set(t,e)}function bg(t){lo.delete(t),lo.size||window.removeEventListener("resize",Sl)}function yg(t,e,n){const a=t.canvas,r=a&&kr(a);if(!r)return;const s=Mi((l,c)=>{const d=r.clientWidth;n(l,c),d<r.clientWidth&&n()},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),gg(t,s),i}function Mr(t,e,n){n&&n.disconnect(),e==="resize"&&bg(t)}function xg(t,e,n){const a=t.canvas,r=Mi(s=>{t.ctx!==null&&n(hg(s,t))},t);return ug(a,e,r),r}class kg extends wl{acquireContext(e,n){const a=e&&e.getContext&&e.getContext("2d");return a&&a.canvas===e?(dg(e,n),a):null}releaseContext(e){const n=e.canvas;if(!n[Zo])return!1;const a=n[Zo].initial;["height","width"].forEach(s=>{const i=a[s];Be(i)?n.removeAttribute(s):n.setAttribute(s,i)});const r=a.style||{};return Object.keys(r).forEach(s=>{n.style[s]=r[s]}),n.width=n.width,delete n[Zo],!0}addEventListener(e,n,a){this.removeEventListener(e,n);const r=e.$proxies||(e.$proxies={}),i={attach:mg,detach:pg,resize:yg}[n]||xg;r[n]=i(e,n,a)}removeEventListener(e,n){const a=e.$proxies||(e.$proxies={}),r=a[n];if(!r)return;({attach:Mr,detach:Mr,resize:Mr}[n]||fg)(e,n,r),a[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,n,a,r){return up(e,n,a,r)}isAttached(e){const n=e&&kr(e);return!!(n&&n.isConnected)}}function wg(t){return!xr()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?lg:kg}let Vt=(Ba=class{constructor(){ie(this,"x");ie(this,"y");ie(this,"active",!1);ie(this,"options");ie(this,"$animations")}tooltipPosition(e){const{x:n,y:a}=this.getProps(["x","y"],e);return{x:n,y:a}}hasValue(){return Qn(this.x)&&Qn(this.y)}getProps(e,n){const a=this.$animations;if(!n||!a)return this;const r={};return e.forEach(s=>{r[s]=a[s]&&a[s].active()?a[s]._to:this[s]}),r}},ie(Ba,"defaults",{}),ie(Ba,"defaultRoutes"),Ba);function _g(t,e){const n=t.options.ticks,a=Cg(t),r=Math.min(n.maxTicksLimit||a,a),s=n.major.enabled?Sg(e):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>r)return Eg(e,d,s,i/r),d;const u=Bg(s,e,r);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(ta(e,d,u,Be(m)?0:l-m,l),f=0,h=i-1;f<h;f++)ta(e,d,u,s[f],s[f+1]);return ta(e,d,u,c,Be(m)?e.length:c+m),d}return ta(e,d,u),d}function Cg(t){const e=t.options.offset,n=t._tickSize(),a=t._length/n+(e?0:1),r=t._maxLength/n;return Math.floor(Math.min(a,r))}function Bg(t,e,n){const a=Dg(t),r=e.length/n;if(!a)return Math.max(r,1);const s=dm(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 Sg(t){const e=[];let n,a;for(n=0,a=t.length;n<a;n++)t[n].major&&e.push(n);return e}function Eg(t,e,n,a){let r=0,s=n[0],i;for(a=Math.ceil(a),i=0;i<t.length;i++)i===s&&(e.push(t[i]),r++,s=n[r*a])}function ta(t,e,n,a,r){const s=ye(a,0),i=Math.min(ye(r,t.length),t.length);let l=0,c,d,u;for(n=Math.ceil(n),r&&(c=r-a,n=c/Math.floor(c/n)),u=s;u<0;)l++,u=Math.round(s+l*n);for(d=Math.max(s,0);d<i;d++)d===u&&(e.push(t[d]),l++,u=Math.round(s+l*n))}function Dg(t){const e=t.length;let n,a;if(e<2)return!1;for(a=t[0],n=1;n<e;++n)if(t[n]-t[n-1]!==a)return!1;return a}const Vg=t=>t==="left"?"right":t==="right"?"left":t,El=(t,e,n)=>e==="top"||e==="left"?t[e]+n:t[e]-n,Dl=(t,e)=>Math.min(e||t,t);function Vl(t,e){const n=[],a=t.length/e,r=t.length;let s=0;for(;s<r;s+=a)n.push(t[Math.floor(s)]);return n}function Mg(t,e,n){const a=t.ticks.length,r=Math.min(e,a-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(r),d;if(!(n&&(a===1?d=Math.max(c-s,i-c):e===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(r-1))/2,c+=r<e?d:-d,c<s-l||c>i+l)))return c}function Ng(t,e){Se(t,n=>{const a=n.gc,r=a.length/2;let s;if(r>e){for(s=0;s<r;++s)delete n.data[a[s]];a.splice(0,r)}})}function co(t){return t.drawTicks?t.tickLength:0}function Ml(t,e){if(!t.display)return 0;const n=He(t.font,e),a=tt(t.padding);return(Oe(t.text)?t.text.length:1)*n.lineHeight+a.height}function Pg(t,e){return cn(t,{scale:e,type:"scale"})}function Ag(t,e,n){return cn(t,{tick:n,index:e,type:"tick"})}function $g(t,e,n){let a=lr(t);return(n&&e!=="right"||!n&&e==="right")&&(a=Vg(a)),a}function Tg(t,e,n,a){const{top:r,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,b;const p=i-r,g=l-s;if(t.isHorizontal()){if(m=We(a,s,l),we(n)){const y=Object.keys(n)[0],B=n[y];b=u[y].getPixelForValue(B)+p-e}else n==="center"?b=(d.bottom+d.top)/2+p-e:b=El(t,n,e);h=l-s}else{if(we(n)){const y=Object.keys(n)[0],B=n[y];m=u[y].getPixelForValue(B)-g+e}else n==="center"?m=(d.left+d.right)/2-g+e:m=El(t,n,e);b=We(a,i,r),f=n==="left"?-Re:Re}return{titleX:m,titleY:b,maxWidth:h,rotation:f}}class Dn extends Vt{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,n){return e}getUserBounds(){let{_userMin:e,_userMax:n,_suggestedMin:a,_suggestedMax:r}=this;return e=mt(e,Number.POSITIVE_INFINITY),n=mt(n,Number.NEGATIVE_INFINITY),a=mt(a,Number.POSITIVE_INFINITY),r=mt(r,Number.NEGATIVE_INFINITY),{min:mt(e,a),max:mt(n,r),minDefined:Ie(e),maxDefined:Ie(n)}}getMinMax(e){let{min:n,max:a,minDefined:r,maxDefined:s}=this.getUserBounds(),i;if(r&&s)return{min:n,max:a};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,e),r||(n=Math.min(n,i.min)),s||(a=Math.max(a,i.max));return n=s&&n>a?a:n,a=r&&n>a?n:a,{min:mt(n,mt(a,n)),max:mt(a,mt(n,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 e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Me(this.options.beforeUpdate,[this])}update(e,n,a){const{beginAtZero:r,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=n,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=Wm(this,s,r),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Vl(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=_g(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,n,a;this.isHorizontal()?(n=this.left,a=this.right):(n=this.top,a=this.bottom,e=!e),this._startPixel=n,this._endPixel=a,this._reversePixels=e,this._length=a-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Me(this.options.afterUpdate,[this])}beforeSetDimensions(){Me(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(){Me(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Me(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Me(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const n=this.options.ticks;let a,r,s;for(a=0,r=e.length;a<r;a++)s=e[a],s.label=Me(n.callback,[s.value,a,e],this)}afterTickToLabelConversion(){Me(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Me(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,n=e.ticks,a=Dl(this.ticks.length,e.ticks.maxTicksLimit),r=n.minRotation||0,s=n.maxRotation;let i=r,l,c,d;if(!this._isVisible()||!n.display||r>=s||a<=1||!this.isHorizontal()){this.labelRotation=r;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=je(this.chart.width-f,0,this.maxWidth);l=e.offset?this.maxWidth/a:m/(a-1),f+6>l&&(l=m/(a-(e.offset?.5:1)),c=this.maxHeight-co(e.grid)-n.padding-Ml(e.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=mm(Math.min(Math.asin(je((u.highest.height+6)/l,-1,1)),Math.asin(je(c/d,-1,1))-Math.asin(je(h/d,-1,1)))),i=Math.max(r,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){Me(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Me(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:n,options:{ticks:a,title:r,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=Ml(r,n.options.font);if(l?(e.width=this.maxWidth,e.height=co(s)+c):(e.height=this.maxHeight,e.width=co(s)+c),a.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=a.padding*2,b=St(this.labelRotation),p=Math.cos(b),g=Math.sin(b);if(l){const y=a.mirror?0:g*f.width+p*h.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=a.mirror?0:p*f.width+g*h.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(d,u,g,p)}}this._handleMargins(),l?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,n,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*e.width,m=a*n.height):(h=a*e.height,m=r*n.width):s==="start"?m=n.width:s==="end"?h=e.width:s!=="inner"&&(h=e.width/2,m=n.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=n.height/2,f=e.height/2;s==="start"?(u=0,f=e.height):s==="end"&&(u=n.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(){Me(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:n}=this.options;return n==="top"||n==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let n,a;for(n=0,a=e.length;n<a;n++)Be(e[n].label)&&(e.splice(n,1),a--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const n=this.options.ticks.sampleSize;let a=this.ticks;n<a.length&&(a=Vl(a,n)),this._labelSizes=e=this._computeLabelSizes(a,a.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,n,a){const{ctx:r,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(n/Dl(n,a));let d=0,u=0,f,h,m,b,p,g,y,B,D,M,S;for(f=0;f<n;f+=c){if(b=e[f].label,p=this._resolveTickFontOptions(f),r.font=g=p.string,y=s[g]=s[g]||{data:{},gc:[]},B=p.lineHeight,D=M=0,!Be(b)&&!Oe(b))D=Oi(r,y.data,y.gc,D,b),M=B;else if(Oe(b))for(h=0,m=b.length;h<m;++h)S=b[h],!Be(S)&&!Oe(S)&&(D=Oi(r,y.data,y.gc,D,S),M+=B);i.push(D),l.push(M),d=Math.max(D,d),u=Math.max(M,u)}Ng(s,n);const k=i.indexOf(d),C=l.indexOf(u),x=w=>({width:i[w]||0,height:l[w]||0});return{first:x(0),last:x(n-1),widest:x(k),highest:x(C),widths:i,heights:l}}getLabelForValue(e){return e}getPixelForValue(e,n){return NaN}getValueForPixel(e){}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const n=this._startPixel+e*this._length;return gm(this._alignToPixels?ln(this.chart,n,0):n)}getDecimalForPixel(e){const n=(e-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:n}=this;return e<0&&n<0?n:e>0&&n>0?e:0}getContext(e){const n=this.ticks||[];if(e>=0&&e<n.length){const a=n[e];return a.$context||(a.$context=Ag(this.getContext(),e,a))}return this.$context||(this.$context=Pg(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,n=St(this.labelRotation),a=Math.abs(Math.cos(n)),r=Math.abs(Math.sin(n)),s=this._getLabelSizes(),i=e.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 e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const n=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=[],b=l.setContext(this.getContext()),p=b.display?b.width:0,g=p/2,y=function(z){return ln(a,z,p)};let B,D,M,S,k,C,x,w,E,A,T,F;if(i==="top")B=y(this.bottom),C=this.bottom-h,w=B-g,A=y(e.top)+g,F=e.bottom;else if(i==="bottom")B=y(this.top),A=e.top,F=y(e.bottom)-g,C=B+g,w=this.top+h;else if(i==="left")B=y(this.right),k=this.right-h,x=B-g,E=y(e.left)+g,T=e.right;else if(i==="right")B=y(this.left),E=e.left,T=y(e.right)-g,k=B+g,x=this.left+h;else if(n==="x"){if(i==="center")B=y((e.top+e.bottom)/2+.5);else if(we(i)){const z=Object.keys(i)[0],v=i[z];B=y(this.chart.scales[z].getPixelForValue(v))}A=e.top,F=e.bottom,C=B+g,w=C+h}else if(n==="y"){if(i==="center")B=y((e.left+e.right)/2);else if(we(i)){const z=Object.keys(i)[0],v=i[z];B=y(this.chart.scales[z].getPixelForValue(v))}k=B-g,x=k-h,E=e.left,T=e.right}const L=ye(r.ticks.maxTicksLimit,f),Y=Math.max(1,Math.ceil(f/L));for(D=0;D<f;D+=Y){const z=this.getContext(D),v=s.setContext(z),W=l.setContext(z),O=v.lineWidth,N=v.color,H=W.dash||[],j=W.dashOffset,J=v.tickWidth,te=v.tickColor,ue=v.tickBorderDash||[],fe=v.tickBorderDashOffset;M=Mg(this,D,c),M!==void 0&&(S=ln(a,M,O),d?k=x=E=T=S:C=w=A=F=S,m.push({tx1:k,ty1:C,tx2:x,ty2:w,x1:E,y1:A,x2:T,y2:F,width:O,color:N,borderDash:H,borderDashOffset:j,tickWidth:J,tickColor:te,tickBorderDash:ue,tickBorderDashOffset:fe}))}return this._ticksLength=f,this._borderValue=B,m}_computeLabelItems(e){const n=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,b=f?-u:m,p=-St(this.labelRotation),g=[];let y,B,D,M,S,k,C,x,w,E,A,T,F="middle";if(r==="top")k=this.bottom-b,C=this._getXAxisLabelAlignment();else if(r==="bottom")k=this.top+b,C=this._getXAxisLabelAlignment();else if(r==="left"){const Y=this._getYAxisLabelAlignment(h);C=Y.textAlign,S=Y.x}else if(r==="right"){const Y=this._getYAxisLabelAlignment(h);C=Y.textAlign,S=Y.x}else if(n==="x"){if(r==="center")k=(e.top+e.bottom)/2+m;else if(we(r)){const Y=Object.keys(r)[0],z=r[Y];k=this.chart.scales[Y].getPixelForValue(z)+m}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(r==="center")S=(e.left+e.right)/2-m;else if(we(r)){const Y=Object.keys(r)[0],z=r[Y];S=this.chart.scales[Y].getPixelForValue(z)}C=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(c==="start"?F="top":c==="end"&&(F="bottom"));const L=this._getLabelSizes();for(y=0,B=l.length;y<B;++y){D=l[y],M=D.label;const Y=s.setContext(this.getContext(y));x=this.getPixelForTick(y)+s.labelOffset,w=this._resolveTickFontOptions(y),E=w.lineHeight,A=Oe(M)?M.length:1;const z=A/2,v=Y.color,W=Y.textStrokeColor,O=Y.textStrokeWidth;let N=C;i?(S=x,C==="inner"&&(y===B-1?N=this.options.reverse?"left":"right":y===0?N=this.options.reverse?"right":"left":N="center"),r==="top"?d==="near"||p!==0?T=-A*E+E/2:d==="center"?T=-L.highest.height/2-z*E+E:T=-L.highest.height+E/2:d==="near"||p!==0?T=E/2:d==="center"?T=L.highest.height/2-z*E:T=L.highest.height-A*E,f&&(T*=-1),p!==0&&!Y.showLabelBackdrop&&(S+=E/2*Math.sin(p))):(k=x,T=(1-A)*E/2);let H;if(Y.showLabelBackdrop){const j=tt(Y.backdropPadding),J=L.heights[y],te=L.widths[y];let ue=T-j.top,fe=0-j.left;switch(F){case"middle":ue-=J/2;break;case"bottom":ue-=J;break}switch(C){case"center":fe-=te/2;break;case"right":fe-=te;break;case"inner":y===B-1?fe-=te:y>0&&(fe-=te/2);break}H={left:fe,top:ue,width:te+j.width,height:J+j.height,color:Y.backdropColor}}g.push({label:M,font:w,textOffset:T,options:{rotation:p,color:v,strokeColor:W,strokeWidth:O,textAlign:N,textBaseline:F,translation:[S,k],backdrop:H}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:n}=this.options;if(-St(this.labelRotation))return e==="top"?"left":"right";let r="center";return n.align==="start"?r="left":n.align==="end"?r="right":n.align==="inner"&&(r="inner"),r}_getYAxisLabelAlignment(e){const{position:n,ticks:{crossAlign:a,mirror:r,padding:s}}=this.options,i=this._getLabelSizes(),l=e+s,c=i.widest.width;let d,u;return n==="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)):n==="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 e=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:n},left:a,top:r,width:s,height:i}=this;n&&(e.save(),e.fillStyle=n,e.fillRect(a,r,s,i),e.restore())}getLineWidthForValue(e){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const r=this.ticks.findIndex(s=>s.value===e);return r>=0?n.setContext(this.getContext(r)).lineWidth:0}drawGrid(e){const n=this.options.grid,a=this.ctx,r=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));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(n.display)for(s=0,i=r.length;s<i;++s){const c=r[s];n.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),n.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:e,ctx:n,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=ln(e,this.left,i)-i/2,u=ln(e,this.right,l)+l/2,f=h=c):(f=ln(e,this.top,i)-i/2,h=ln(e,this.bottom,l)+l/2,d=u=c),n.save(),n.lineWidth=s.width,n.strokeStyle=s.color,n.beginPath(),n.moveTo(d,f),n.lineTo(u,h),n.stroke(),n.restore()}drawLabels(e){if(!this.options.ticks.display)return;const a=this.ctx,r=this._computeLabelArea();r&&Io(a,r);const s=this.getLabelItems(e);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;oo(a,d,0,u,c,l)}r&&jo(a)}drawTitle(){const{ctx:e,options:{position:n,title:a,reverse:r}}=this;if(!a.display)return;const s=He(a.font),i=tt(a.padding),l=a.align;let c=s.lineHeight/2;n==="bottom"||n==="center"||we(n)?(c+=i.bottom,Oe(a.text)&&(c+=s.lineHeight*(a.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=Tg(this,c,n,l);oo(e,a.text,0,0,s,{color:a.color,maxWidth:f,rotation:h,textAlign:$g(l,n,r),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,n=e.ticks&&e.ticks.z||0,a=ye(e.grid&&e.grid.z,-1),r=ye(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Dn.prototype.draw?[{z:n,draw:s=>{this.draw(s)}}]:[{z:a,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:r,draw:()=>{this.drawBorder()}},{z:n,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const n=this.chart.getSortedVisibleDatasetMetas(),a=this.axis+"AxisID",r=[];let s,i;for(s=0,i=n.length;s<i;++s){const l=n[s];l[a]===this.id&&(!e||l.type===e)&&r.push(l)}return r}_resolveTickFontOptions(e){const n=this.options.ticks.setContext(this.getContext(e));return He(n.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class na{constructor(e,n,a){this.type=e,this.scope=n,this.override=a,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const n=Object.getPrototypeOf(e);let a;Fg(n)&&(a=this.register(n));const r=this.items,s=e.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in r||(r[s]=e,Og(e,i,a),this.override&&Te.override(e.id,e.overrides)),i}get(e){return this.items[e]}unregister(e){const n=this.items,a=e.id,r=this.scope;a in n&&delete n[a],r&&a in Te[r]&&(delete Te[r][a],this.override&&delete sn[a])}}function Og(t,e,n){const a=Gn(Object.create(null),[n?Te.get(n):{},Te.get(e),t.defaults]);Te.set(e,a),t.defaultRoutes&&zg(e,t.defaultRoutes),t.descriptors&&Te.describe(e,t.descriptors)}function zg(t,e){Object.keys(e).forEach(n=>{const a=n.split("."),r=a.pop(),s=[t].concat(a).join("."),i=e[n].split("."),l=i.pop(),c=i.join(".");Te.route(s,r,c,l)})}function Fg(t){return"id"in t&&"defaults"in t}class Rg{constructor(){this.controllers=new na(hn,"datasets",!0),this.elements=new na(Vt,"elements"),this.plugins=new na(Object,"plugins"),this.scales=new na(Dn,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,n,a){[...n].forEach(r=>{const s=a||this._getRegistryForType(r);a||s.isForType(r)||s===this.plugins&&r.id?this._exec(e,s,r):Se(r,i=>{const l=a||this._getRegistryForType(i);this._exec(e,l,i)})})}_exec(e,n,a){const r=rr(e);Me(a["before"+r],[],a),n[e](a),Me(a["after"+r],[],a)}_getRegistryForType(e){for(let n=0;n<this._typedRegistries.length;n++){const a=this._typedRegistries[n];if(a.isForType(e))return a}return this.plugins}_get(e,n,a){const r=n.get(e);if(r===void 0)throw new Error('"'+e+'" is not a registered '+a+".");return r}}var gt=new Rg;class vg{constructor(){this._init=void 0}notify(e,n,a,r){if(n==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const s=r?this._descriptors(e).filter(r):this._descriptors(e),i=this._notify(s,e,n,a);return n==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),i}_notify(e,n,a,r){r=r||{};for(const s of e){const i=s.plugin,l=i[a],c=[n,r,s.options];if(Me(l,c,i)===!1&&r.cancelable)return!1}return!0}invalidate(){Be(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),n}_createDescriptors(e,n){const a=e&&e.config,r=ye(a.options&&a.options.plugins,{}),s=Lg(a);return r===!1&&!n?[]:jg(e,s,r,n)}_notifyStateChanges(e){const n=this._oldCache||[],a=this._cache,r=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(r(n,a),e,"stop"),this._notify(r(a,n),e,"start")}}function Lg(t){const e={},n=[],a=Object.keys(gt.plugins.items);for(let s=0;s<a.length;s++)n.push(gt.getPlugin(a[s]));const r=t.plugins||[];for(let s=0;s<r.length;s++){const i=r[s];n.indexOf(i)===-1&&(n.push(i),e[i.id]=!0)}return{plugins:n,localIds:e}}function Ig(t,e){return!e&&t===!1?null:t===!0?{}:t}function jg(t,{plugins:e,localIds:n},a,r){const s=[],i=t.getContext();for(const l of e){const c=l.id,d=Ig(a[c],r);d!==null&&s.push({plugin:l,options:Wg(t.config,{plugin:l,local:n[c]},d,i)})}return s}function Wg(t,{plugin:e,local:n},a,r){const s=t.pluginScopeKeys(e),i=t.getOptionScopes(a,s);return n&&e.defaults&&i.push(e.defaults),t.createResolver(i,r,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Nr(t,e){const n=Te.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||n.indexAxis||"x"}function Hg(t,e){let n=t;return t==="_index_"?n=e:t==="_value_"&&(n=e==="x"?"y":"x"),n}function qg(t,e){return t===e?"_index_":"_value_"}function Nl(t){if(t==="x"||t==="y"||t==="r")return t}function Ug(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Pr(t,...e){if(Nl(t))return t;for(const n of e){const a=n.axis||Ug(n.position)||t.length>1&&Nl(t[0].toLowerCase());if(a)return a}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Pl(t,e,n){if(n[e+"AxisID"]===t)return{axis:e}}function Yg(t,e){if(e.data&&e.data.datasets){const n=e.data.datasets.filter(a=>a.xAxisID===t||a.yAxisID===t);if(n.length)return Pl(t,"x",n[0])||Pl(t,"y",n[0])}return{}}function Gg(t,e){const n=sn[t.type]||{scales:{}},a=e.scales||{},r=Nr(t.type,e),s=Object.create(null);return Object.keys(a).forEach(i=>{const l=a[i];if(!we(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=Pr(i,l,Yg(i,t),Te.scales[l.type]),d=qg(c,r),u=n.scales||{};s[i]=Kn(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Nr(l,e),u=(sn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=Hg(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),Kn(s[m],[{axis:h},a[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Kn(l,[Te.scales[l.type],Te.scale])}),s}function Al(t){const e=t.options||(t.options={});e.plugins=ye(e.plugins,{}),e.scales=Gg(t,e)}function $l(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function Kg(t){return t=t||{},t.data=$l(t.data),Al(t),t}const Tl=new Map,Ol=new Set;function oa(t,e){let n=Tl.get(t);return n||(n=e(),Tl.set(t,n),Ol.add(n)),n}const uo=(t,e,n)=>{const a=on(e,n);a!==void 0&&t.add(a)};class Xg{constructor(e){this._config=Kg(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=$l(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Al(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return oa(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,n){return oa(`${e}.transition.${n}`,()=>[[`datasets.${e}.transitions.${n}`,`transitions.${n}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,n){return oa(`${e}-${n}`,()=>[[`datasets.${e}.elements.${n}`,`datasets.${e}`,`elements.${n}`,""]])}pluginScopeKeys(e){const n=e.id,a=this.type;return oa(`${a}-plugin-${n}`,()=>[[`plugins.${n}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,n){const a=this._scopeCache;let r=a.get(e);return(!r||n)&&(r=new Map,a.set(e,r)),r}getOptionScopes(e,n,a){const{options:r,type:s}=this,i=this._cachedScopes(e,a),l=i.get(n);if(l)return l;const c=new Set;n.forEach(u=>{e&&(c.add(e),u.forEach(f=>uo(c,e,f))),u.forEach(f=>uo(c,r,f)),u.forEach(f=>uo(c,sn[s]||{},f)),u.forEach(f=>uo(c,Te,f)),u.forEach(f=>uo(c,fr,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Ol.has(n)&&i.set(n,d),d}chartOptionScopes(){const{options:e,type:n}=this;return[e,sn[n]||{},Te.datasets[n]||{},{type:n},Te,fr]}resolveNamedOptions(e,n,a,r=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=zl(this._resolverCache,e,r);let c=i;if(Qg(i,n)){s.$shared=!1,a=Wt(a)?a():a;const d=this.createResolver(e,a,l);c=Cn(i,a,d)}for(const d of n)s[d]=c[d];return s}createResolver(e,n,a=[""],r){const{resolver:s}=zl(this._resolverCache,e,a);return we(n)?Cn(s,n,void 0,r):s}}function zl(t,e,n){let a=t.get(e);a||(a=new Map,t.set(e,a));const r=n.join();let s=a.get(r);return s||(s={resolver:gr(e,n),subPrefixes:n.filter(l=>!l.toLowerCase().includes("hover"))},a.set(r,s)),s}const Jg=t=>we(t)&&Object.getOwnPropertyNames(t).some(e=>Wt(t[e]));function Qg(t,e){const{isScriptable:n,isIndexable:a}=vi(t);for(const r of e){const s=n(r),i=a(r),l=(i||s)&&t[r];if(s&&(Wt(l)||Jg(l))||i&&Oe(l))return!0}return!1}var Zg="4.5.1";const e0=["top","bottom","left","right","chartArea"];function Fl(t,e){return t==="top"||t==="bottom"||e0.indexOf(t)===-1&&e==="x"}function Rl(t,e){return function(n,a){return n[t]===a[t]?n[e]-a[e]:n[t]-a[t]}}function vl(t){const e=t.chart,n=e.options.animation;e.notifyPlugins("afterRender"),Me(n&&n.onComplete,[t],e)}function t0(t){const e=t.chart,n=e.options.animation;Me(n&&n.onProgress,[t],e)}function Ll(t){return xr()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const aa={},Il=t=>{const e=Ll(t);return Object.values(aa).filter(n=>n.canvas===e).pop()};function n0(t,e,n){const a=Object.keys(t);for(const r of a){const s=+r;if(s>=e){const i=t[r];delete t[r],(n>0||s>e)&&(t[s+n]=i)}}}function o0(t,e,n,a){return!n||t.type==="mouseout"?null:a?e:t}class Mt{static register(...e){gt.add(...e),jl()}static unregister(...e){gt.remove(...e),jl()}constructor(e,n){const a=this.config=new Xg(n),r=Ll(e),s=Il(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||wg(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=tm(),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 vg,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=km(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],aa[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Dt.listen(this,"complete",vl),Dt.listen(this,"progress",t0),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:n},width:a,height:r,_aspectRatio:s}=this;return Be(e)?n&&s?s:r?a/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ui(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return Dt.stop(this),this}resize(e,n){Dt.running(this)?this._resizeBeforeDraw={width:e,height:n}:this._resize(e,n)}_resize(e,n){const a=this.options,r=this.canvas,s=a.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(r,e,n,s),l=a.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,Ui(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),Me(a.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Se(n,(a,r)=>{a.id=r})}buildOrUpdateScales(){const e=this.options,n=e.scales,a=this.scales,r=Object.keys(a).reduce((i,l)=>(i[l]=!1,i),{});let s=[];n&&(s=s.concat(Object.keys(n).map(i=>{const l=n[i],c=Pr(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Se(s,i=>{const l=i.options,c=l.id,d=Pr(c,l),u=ye(l.type,i.dtype);(l.position===void 0||Fl(l.position,d)!==Fl(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=gt.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),a[f.id]=f}f.init(l,e)}),Se(r,(i,l)=>{i||delete a[l]}),Se(a,i=>{nt.configure(this,i,i.options),nt.addBox(this,i)})}_updateMetasets(){const e=this._metasets,n=this.data.datasets.length,a=e.length;if(e.sort((r,s)=>r.index-s.index),a>n){for(let r=n;r<a;++r)this._destroyDatasetMeta(r);e.splice(n,a-n)}this._sortedMetasets=e.slice(0).sort(Rl("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:n}}=this;e.length>n.length&&delete this._stacks,e.forEach((a,r)=>{n.filter(s=>s===a._dataset).length===0&&this._destroyDatasetMeta(r)})}buildOrUpdateControllers(){const e=[],n=this.data.datasets;let a,r;for(this._removeUnreferencedMetasets(),a=0,r=n.length;a<r;a++){const s=n[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||Nr(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=gt.getController(l),{datasetElementType:d,dataElementType:u}=Te.datasets[l];Object.assign(c,{dataElementType:gt.getElement(u),datasetElementType:d&&gt.getElement(d)}),i.controller=new c(this,a),e.push(i.controller)}}return this._updateMetasets(),e}_resetElements(){Se(this.data.datasets,(e,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const n=this.config;n.update();const a=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!a.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,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||Se(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Rl("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Se(this.scales,e=>{nt.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,n=new Set(Object.keys(this._listeners)),a=new Set(e.events);(!xi(n,a)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,n=this._getUniformDataChanges()||[];for(const{method:a,start:r,count:s}of n){const i=a==="_removeElements"?-s:s;n0(e,r,i)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const n=this.data.datasets.length,a=s=>new Set(e.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),r=a(0);for(let s=1;s<n;s++)if(!xi(r,a(s)))return;return Array.from(r).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;nt.update(this,this.width,this.height,e);const n=this.chartArea,a=n.width<=0||n.height<=0;this._layers=[],Se(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(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let n=0,a=this.data.datasets.length;n<a;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,a=this.data.datasets.length;n<a;++n)this._updateDataset(n,Wt(e)?e({datasetIndex:n}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,n){const a=this.getDatasetMeta(e),r={meta:a,index:e,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",r)!==!1&&(a.controller._update(n),r.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",r))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Dt.has(this)?this.attached&&!Dt.running(this)&&Dt.start(this):(this.draw(),vl({chart:this})))}draw(){let e;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 n=this._layers;for(e=0;e<n.length&&n[e].z<=0;++e)n[e].draw(this.chartArea);for(this._drawDatasets();e<n.length;++e)n[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const n=this._sortedMetasets,a=[];let r,s;for(r=0,s=n.length;r<s;++r){const i=n[r];(!e||i.visible)&&a.push(i)}return a}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let n=e.length-1;n>=0;--n)this._drawDataset(e[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const n=this.ctx,a={meta:e,index:e.index,cancelable:!0},r=nl(this,e);this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(r&&Io(n,r),e.controller.draw(),r&&jo(n),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(e){return no(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,n,a,r){const s=eg.modes[n];return typeof s=="function"?s(this,e,a,r):[]}getDatasetMeta(e){const n=this.data.datasets[e],a=this._metasets;let r=a.filter(s=>s&&s._dataset===n).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:e,_dataset:n,_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(e){const n=this.data.datasets[e];if(!n)return!1;const a=this.getDatasetMeta(e);return typeof a.hidden=="boolean"?!a.hidden:!n.hidden}setDatasetVisibility(e,n){const a=this.getDatasetMeta(e);a.hidden=!n}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,n,a){const r=a?"show":"hide",s=this.getDatasetMeta(e),i=s.controller._resolveAnimations(void 0,r);Xn(n)?(s.data[n].hidden=!a,this.update()):(this.setDatasetVisibility(e,a),i.update(s,{visible:a}),this.update(l=>l.datasetIndex===e?r:void 0))}hide(e,n){this._updateVisibility(e,n,!1)}show(e,n){this._updateVisibility(e,n,!0)}_destroyDatasetMeta(e){const n=this._metasets[e];n&&n.controller&&n.controller._destroy(),delete this._metasets[e]}_stop(){let e,n;for(this.stop(),Dt.remove(this),e=0,n=this.data.datasets.length;e<n;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:n}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),zi(e,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete aa[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,n=this.platform,a=(s,i)=>{n.addEventListener(this,s,i),e[s]=i},r=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Se(this.options.events,s=>a(s,r))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,n=this.platform,a=(c,d)=>{n.addEventListener(this,c,d),e[c]=d},r=(c,d)=>{e[c]&&(n.removeEventListener(this,c,d),delete e[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)},n.isAttached(this.canvas)?l():i()}unbindEvents(){Se(this._listeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._listeners={},Se(this._responsiveListeners,(e,n)=>{this.platform.removeEventListener(this,n,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,n,a){const r=a?"set":"remove";let s,i,l,c;for(n==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+r+"DatasetHoverStyle"]()),l=0,c=e.length;l<c;++l){i=e[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[r+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const n=this._active||[],a=e.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}});!Fo(a,n)&&(this._active=a,this._lastEvent=null,this._updateHoverStyles(a,n))}notifyPlugins(e,n,a){return this._plugins.notify(this,e,n,a)}isPluginEnabled(e){return this._plugins._cache.filter(n=>n.plugin.id===e).length===1}_updateHoverStyles(e,n,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(n,e),l=a?e:s(e,n);i.length&&this.updateHoverStyle(i,r.mode,!1),l.length&&r.mode&&this.updateHoverStyle(l,r.mode,!0)}_eventHandler(e,n){const a={event:e,replay:n,cancelable:!0,inChartArea:this.isPointInArea(e)},r=i=>(i.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",a,r)===!1)return;const s=this._handleEvent(e,n,a.inChartArea);return a.cancelable=!1,this.notifyPlugins("afterEvent",a,r),(s||a.changed)&&this.render(),this}_handleEvent(e,n,a){const{_active:r=[],options:s}=this,i=n,l=this._getActiveElements(e,r,a,i),c=im(e),d=o0(e,this._lastEvent,a,c);a&&(this._lastEvent=null,Me(s.onHover,[e,l,this],this),c&&Me(s.onClick,[e,l,this],this));const u=!Fo(l,r);return(u||n)&&(this._active=l,this._updateHoverStyles(l,r,n)),this._lastEvent=d,u}_getActiveElements(e,n,a,r){if(e.type==="mouseout")return[];if(!a)return n;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,r)}}ie(Mt,"defaults",Te),ie(Mt,"instances",aa),ie(Mt,"overrides",sn),ie(Mt,"registry",gt),ie(Mt,"version",Zg),ie(Mt,"getChart",Il);function jl(){return Se(Mt.instances,t=>t._plugins.invalidate())}function a0(t,e,n){const{startAngle:a,x:r,y:s,outerRadius:i,innerRadius:l,options:c}=e,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Je(a-n));if(t.beginPath(),t.arc(r,s,i-d/2,a+f/2,n-f/2),l>0){const h=Math.min(d/l,Je(a-n));t.arc(r,s,l+d/2,n-h/2,a+h/2,!0)}else{const h=Math.min(d/2,i*Je(a-n));if(u==="round")t.arc(r,s,h,n-Ee/2,a+Ee/2,!0);else if(u==="bevel"){const m=2*h*h,b=-m*Math.cos(n+Ee/2)+r,p=-m*Math.sin(n+Ee/2)+s,g=m*Math.cos(a+Ee/2)+r,y=m*Math.sin(a+Ee/2)+s;t.lineTo(b,p),t.lineTo(g,y)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function r0(t,e,n){const{startAngle:a,pixelMargin:r,x:s,y:i,outerRadius:l,innerRadius:c}=e;let d=r/l;t.beginPath(),t.arc(s,i,l,a-d,n+d),c>r?(d=r/c,t.arc(s,i,c,n+d,a-d,!0)):t.arc(s,i,r,n+Re,a-Re),t.closePath(),t.clip()}function s0(t){return pr(t,["outerStart","outerEnd","innerStart","innerEnd"])}function i0(t,e,n,a){const r=s0(t.options.borderRadius),s=(n-e)/2,i=Math.min(s,a*e/2),l=c=>{const d=(n-Math.min(s,c))*a/2;return je(c,0,Math.min(s,d))};return{outerStart:l(r.outerStart),outerEnd:l(r.outerEnd),innerStart:je(r.innerStart,0,i),innerEnd:je(r.innerEnd,0,i)}}function Vn(t,e,n,a){return{x:n+t*Math.cos(e),y:a+t*Math.sin(e)}}function ra(t,e,n,a,r,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=e,f=Math.max(e.outerRadius+a+n-d,0),h=u>0?u+a+n+d:0;let m=0;const b=r-c;if(a){const Y=u>0?u-a:0,z=f>0?f-a:0,v=(Y+z)/2,W=v!==0?b*v/(v+a):b;m=(b-W)/2}const p=Math.max(.001,b*f-n/Ee)/f,g=(b-p)/2,y=c+g+m,B=r-g-m,{outerStart:D,outerEnd:M,innerStart:S,innerEnd:k}=i0(e,h,f,B-y),C=f-D,x=f-M,w=y+D/C,E=B-M/x,A=h+S,T=h+k,F=y+S/A,L=B-k/T;if(t.beginPath(),s){const Y=(w+E)/2;if(t.arc(i,l,f,w,Y),t.arc(i,l,f,Y,E),M>0){const O=Vn(x,E,i,l);t.arc(O.x,O.y,M,E,B+Re)}const z=Vn(T,B,i,l);if(t.lineTo(z.x,z.y),k>0){const O=Vn(T,L,i,l);t.arc(O.x,O.y,k,B+Re,L+Math.PI)}const v=(B-k/h+(y+S/h))/2;if(t.arc(i,l,h,B-k/h,v,!0),t.arc(i,l,h,v,y+S/h,!0),S>0){const O=Vn(A,F,i,l);t.arc(O.x,O.y,S,F+Math.PI,y-Re)}const W=Vn(C,y,i,l);if(t.lineTo(W.x,W.y),D>0){const O=Vn(C,w,i,l);t.arc(O.x,O.y,D,y-Re,w)}}else{t.moveTo(i,l);const Y=Math.cos(w)*f+i,z=Math.sin(w)*f+l;t.lineTo(Y,z);const v=Math.cos(E)*f+i,W=Math.sin(E)*f+l;t.lineTo(v,W)}t.closePath()}function l0(t,e,n,a,r){const{fullCircles:s,startAngle:i,circumference:l}=e;let c=e.endAngle;if(s){ra(t,e,n,a,c,r);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%Pe||Pe))}return ra(t,e,n,a,c,r),t.fill(),c}function c0(t,e,n,a,r){const{fullCircles:s,startAngle:i,circumference:l,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,b=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,b?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let p=e.endAngle;if(s){ra(t,e,n,a,p,r);for(let g=0;g<s;++g)t.stroke();isNaN(l)||(p=i+(l%Pe||Pe))}b&&r0(t,e,p),c.selfJoin&&p-i>=Ee&&m===0&&u!=="miter"&&a0(t,e,p),s||(ra(t,e,n,a,p,r),t.stroke())}class fo extends Vt{constructor(n){super();ie(this,"circumference");ie(this,"endAngle");ie(this,"fullCircles");ie(this,"innerRadius");ie(this,"outerRadius");ie(this,"pixelMargin");ie(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,n&&Object.assign(this,n)}inRange(n,a,r){const s=this.getProps(["x","y"],r),{angle:i,distance:l}=Bi(s,{x:n,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,b=ye(h,d-c),p=Zn(i,c,d)&&c!==d,g=b>=Pe||p,y=Et(l,u+m,f+m);return g&&y}getCenterPoint(n){const{x:a,y:r,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{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(n){return this.getCenterPoint(n)}draw(n){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>Pe?Math.floor(r/Pe):0,r===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const c=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(Ee,r||0)),u=s*d;n.fillStyle=a.backgroundColor,n.strokeStyle=a.borderColor,l0(n,this,u,i,l),c0(n,this,u,i,l),n.restore()}}ie(fo,"id","arc"),ie(fo,"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}),ie(fo,"defaultRoutes",{backgroundColor:"backgroundColor"}),ie(fo,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function Wl(t,e,n=e){t.lineCap=ye(n.borderCapStyle,e.borderCapStyle),t.setLineDash(ye(n.borderDash,e.borderDash)),t.lineDashOffset=ye(n.borderDashOffset,e.borderDashOffset),t.lineJoin=ye(n.borderJoinStyle,e.borderJoinStyle),t.lineWidth=ye(n.borderWidth,e.borderWidth),t.strokeStyle=ye(n.borderColor,e.borderColor)}function d0(t,e,n){t.lineTo(n.x,n.y)}function u0(t){return t.stepped?Tm:t.tension||t.cubicInterpolationMode==="monotone"?Om:d0}function Hl(t,e,n={}){const a=t.length,{start:r=0,end:s=a-1}=n,{start:i,end:l}=e,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:e.loop,ilen:d<c&&!u?a+d-c:d-c}}function f0(t,e,n,a){const{points:r,options:s}=e,{count:i,start:l,loop:c,ilen:d}=Hl(r,n,a),u=u0(s);let{move:f=!0,reverse:h}=a||{},m,b,p;for(m=0;m<=d;++m)b=r[(l+(h?d-m:m))%i],!b.skip&&(f?(t.moveTo(b.x,b.y),f=!1):u(t,p,b,h,s.stepped),p=b);return c&&(b=r[(l+(h?d:0))%i],u(t,p,b,h,s.stepped)),!!c}function h0(t,e,n,a){const r=e.points,{count:s,start:i,ilen:l}=Hl(r,n,a),{move:c=!0,reverse:d}=a||{};let u=0,f=0,h,m,b,p,g,y;const B=M=>(i+(d?l-M:M))%s,D=()=>{p!==g&&(t.lineTo(u,g),t.lineTo(u,p),t.lineTo(u,y))};for(c&&(m=r[B(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=r[B(h)],m.skip)continue;const M=m.x,S=m.y,k=M|0;k===b?(S<p?p=S:S>g&&(g=S),u=(f*u+M)/++f):(D(),t.lineTo(M,S),b=k,f=0,p=g=S),y=S}D()}function Ar(t){const e=t.options,n=e.borderDash&&e.borderDash.length;return!t._decimated&&!t._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!n?h0:f0}function m0(t){return t.stepped?hp:t.tension||t.cubicInterpolationMode==="monotone"?mp:fn}function p0(t,e,n,a){let r=e._path;r||(r=e._path=new Path2D,e.path(r,n,a)&&r.closePath()),Wl(t,e.options),t.stroke(r)}function g0(t,e,n,a){const{segments:r,options:s}=e,i=Ar(e);for(const l of r)Wl(t,s,l.style),t.beginPath(),i(t,e,l,{start:n,end:n+a-1})&&t.closePath(),t.stroke()}const b0=typeof Path2D=="function";function y0(t,e,n,a){b0&&!e.options.segment?p0(t,e,n,a):g0(t,e,n,a)}class qt extends Vt{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,n){const a=this.options;if((a.tension||a.cubicInterpolationMode==="monotone")&&!a.stepped&&!this._pointsUpdated){const r=a.spanGaps?this._loop:this._fullLoop;rp(this._points,a,e,r,n),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=kp(this,this.options.segment))}first(){const e=this.segments,n=this.points;return e.length&&n[e[0].start]}last(){const e=this.segments,n=this.points,a=e.length;return a&&n[e[a-1].end]}interpolate(e,n){const a=this.options,r=e[n],s=this.points,i=Zi(this,{property:n,start:r,end:r});if(!i.length)return;const l=[],c=m0(a);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],b=s[h];if(m===b){l.push(m);continue}const p=Math.abs((r-m[n])/(b[n]-m[n])),g=c(m,b,p,a.stepped);g[n]=e[n],l.push(g)}return l.length===1?l[0]:l}pathSegment(e,n,a){return Ar(this)(e,this,n,a)}path(e,n,a){const r=this.segments,s=Ar(this);let i=this._loop;n=n||0,a=a||this.points.length-n;for(const l of r)i&=s(e,this,l,{start:n,end:n+a-1});return!!i}draw(e,n,a,r){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),y0(e,this,a,r),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}ie(qt,"id","line"),ie(qt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),ie(qt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),ie(qt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function ql(t,e,n,a){const r=t.options,{[n]:s}=t.getProps([n],a);return Math.abs(e-s)<r.radius+r.hitRadius}class sa extends Vt{constructor(n){super();ie(this,"parsed");ie(this,"skip");ie(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,n&&Object.assign(this,n)}inRange(n,a,r){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],r);return Math.pow(n-i,2)+Math.pow(a-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(n,a){return ql(this,n,"x",a)}inYRange(n,a){return ql(this,n,"y",a)}getCenterPoint(n){const{x:a,y:r}=this.getProps(["x","y"],n);return{x:a,y:r}}size(n){n=n||this.options||{};let a=n.radius||0;a=Math.max(a,a&&n.hoverRadius||0);const r=a&&n.borderWidth||0;return(a+r)*2}draw(n,a){const r=this.options;this.skip||r.radius<.1||!no(this,a,this.size(r)/2)||(n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.fillStyle=r.backgroundColor,mr(n,r,this.x,this.y))}getRange(){const n=this.options||{};return n.radius+n.hitRadius}}ie(sa,"id","point"),ie(sa,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),ie(sa,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ul(t,e){const{x:n,y:a,base:r,width:s,height:i}=t.getProps(["x","y","base","width","height"],e);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(n,r),c=Math.max(n,r),d=a-f,u=a+f):(f=s/2,l=n-f,c=n+f,d=Math.min(a,r),u=Math.max(a,r)),{left:l,top:d,right:c,bottom:u}}function Ut(t,e,n,a){return t?0:je(e,n,a)}function x0(t,e,n){const a=t.options.borderWidth,r=t.borderSkipped,s=Ri(a);return{t:Ut(r.top,s.top,0,n),r:Ut(r.right,s.right,0,e),b:Ut(r.bottom,s.bottom,0,n),l:Ut(r.left,s.left,0,e)}}function k0(t,e,n){const{enableBorderRadius:a}=t.getProps(["enableBorderRadius"]),r=t.options.borderRadius,s=_n(r),i=Math.min(e,n),l=t.borderSkipped,c=a||we(r);return{topLeft:Ut(!c||l.top||l.left,s.topLeft,0,i),topRight:Ut(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Ut(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Ut(!c||l.bottom||l.right,s.bottomRight,0,i)}}function w0(t){const e=Ul(t),n=e.right-e.left,a=e.bottom-e.top,r=x0(t,n/2,a/2),s=k0(t,n/2,a/2);return{outer:{x:e.left,y:e.top,w:n,h:a,radius:s},inner:{x:e.left+r.l,y:e.top+r.t,w:n-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 $r(t,e,n,a){const r=e===null,s=n===null,l=t&&!(r&&s)&&Ul(t,a);return l&&(r||Et(e,l.left,l.right))&&(s||Et(n,l.top,l.bottom))}function _0(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function C0(t,e){t.rect(e.x,e.y,e.w,e.h)}function Tr(t,e,n={}){const a=t.x!==n.x?-e:0,r=t.y!==n.y?-e:0,s=(t.x+t.w!==n.x+n.w?e:0)-a,i=(t.y+t.h!==n.y+n.h?e:0)-r;return{x:t.x+a,y:t.y+r,w:t.w+s,h:t.h+i,radius:t.radius}}class ia extends Vt{constructor(e){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,e&&Object.assign(this,e)}draw(e){const{inflateAmount:n,options:{borderColor:a,backgroundColor:r}}=this,{inner:s,outer:i}=w0(this),l=_0(i.radius)?Wo:C0;e.save(),(i.w!==s.w||i.h!==s.h)&&(e.beginPath(),l(e,Tr(i,n,s)),e.clip(),l(e,Tr(s,-n,i)),e.fillStyle=a,e.fill("evenodd")),e.beginPath(),l(e,Tr(s,n)),e.fillStyle=r,e.fill(),e.restore()}inRange(e,n,a){return $r(this,e,n,a)}inXRange(e,n){return $r(this,e,null,n)}inYRange(e,n){return $r(this,null,e,n)}getCenterPoint(e){const{x:n,y:a,base:r,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(n+r)/2:n,y:s?a:(a+r)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}ie(ia,"id","bar"),ie(ia,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),ie(ia,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function B0(t,e,n){const a=t.segments,r=t.points,s=e.points,i=[];for(const l of a){let{start:c,end:d}=l;d=la(c,d,r);const u=Or(n,r[c],r[d],l.loop);if(!e.segments){i.push({source:l,target:u,start:r[c],end:r[d]});continue}const f=Zi(e,u);for(const h of f){const m=Or(n,s[h.start],s[h.end],h.loop),b=Qi(l,r,m);for(const p of b)i.push({source:p,target:h,start:{[n]:Yl(u,m,"start",Math.max)},end:{[n]:Yl(u,m,"end",Math.min)}})}}return i}function Or(t,e,n,a){if(a)return;let r=e[t],s=n[t];return t==="angle"&&(r=Je(r),s=Je(s)),{property:t,start:r,end:s}}function S0(t,e){const{x:n=null,y:a=null}=t||{},r=e.points,s=[];return e.segments.forEach(({start:i,end:l})=>{l=la(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})):n!==null&&(s.push({x:n,y:c.y}),s.push({x:n,y:d.y}))}),s}function la(t,e,n){for(;e>t;e--){const a=n[e];if(!isNaN(a.x)&&!isNaN(a.y))break}return e}function Yl(t,e,n,a){return t&&e?a(t[n],e[n]):t?t[n]:e?e[n]:0}function Gl(t,e){let n=[],a=!1;return Oe(t)?(a=!0,n=t):n=S0(t,e),n.length?new qt({points:n,options:{tension:0},_loop:a,_fullLoop:a}):null}function Kl(t){return t&&t.fill!==!1}function E0(t,e,n){let r=t[e].fill;const s=[e];let i;if(!n)return r;for(;r!==!1&&s.indexOf(r)===-1;){if(!Ie(r))return r;if(i=t[r],!i)return!1;if(i.visible)return r;s.push(r),r=i.fill}return!1}function D0(t,e,n){const a=P0(t);if(we(a))return isNaN(a.value)?!1:a;let r=parseFloat(a);return Ie(r)&&Math.floor(r)===r?V0(a[0],e,r,n):["origin","start","end","stack","shape"].indexOf(a)>=0&&a}function V0(t,e,n,a){return(t==="-"||t==="+")&&(n=e+n),n===e||n<0||n>=a?!1:n}function M0(t,e){let n=null;return t==="start"?n=e.bottom:t==="end"?n=e.top:we(t)?n=e.getPixelForValue(t.value):e.getBasePixel&&(n=e.getBasePixel()),n}function N0(t,e,n){let a;return t==="start"?a=n:t==="end"?a=e.options.reverse?e.min:e.max:we(t)?a=t.value:a=e.getBaseValue(),a}function P0(t){const e=t.options,n=e.fill;let a=ye(n&&n.target,n);return a===void 0&&(a=!!e.backgroundColor),a===!1||a===null?!1:a===!0?"origin":a}function A0(t){const{scale:e,index:n,line:a}=t,r=[],s=a.segments,i=a.points,l=$0(e,n);l.push(Gl({x:null,y:e.bottom},a));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)T0(r,i[u],l)}return new qt({points:r,options:{}})}function $0(t,e){const n=[],a=t.getMatchingVisibleMetas("line");for(let r=0;r<a.length;r++){const s=a[r];if(s.index===e)break;s.hidden||n.unshift(s.dataset)}return n}function T0(t,e,n){const a=[];for(let r=0;r<n.length;r++){const s=n[r],{first:i,last:l,point:c}=O0(s,e,"x");if(!(!c||i&&l)){if(i)a.unshift(c);else if(t.push(c),!l)break}}t.push(...a)}function O0(t,e,n){const a=t.interpolate(e,n);if(!a)return{};const r=a[n],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][n],h=i[u.end][n];if(Et(r,f,h)){l=r===f,c=r===h;break}}return{first:l,last:c,point:a}}class Xl{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,n,a){const{x:r,y:s,radius:i}=this;return n=n||{start:0,end:Pe},e.arc(r,s,i,n.end,n.start,!0),!a.bounds}interpolate(e){const{x:n,y:a,radius:r}=this,s=e.angle;return{x:n+Math.cos(s)*r,y:a+Math.sin(s)*r,angle:s}}}function z0(t){const{chart:e,fill:n,line:a}=t;if(Ie(n))return F0(e,n);if(n==="stack")return A0(t);if(n==="shape")return!0;const r=R0(t);return r instanceof Xl?r:Gl(r,a)}function F0(t,e){const n=t.getDatasetMeta(e);return n&&t.isDatasetVisible(e)?n.dataset:null}function R0(t){return(t.scale||{}).getPointPositionForValue?L0(t):v0(t)}function v0(t){const{scale:e={},fill:n}=t,a=M0(n,e);if(Ie(a)){const r=e.isHorizontal();return{x:r?a:null,y:r?null:a}}return null}function L0(t){const{scale:e,fill:n}=t,a=e.options,r=e.getLabels().length,s=a.reverse?e.max:e.min,i=N0(n,e,s),l=[];if(a.grid.circular){const c=e.getPointPositionForValue(0,s);return new Xl({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(i)})}for(let c=0;c<r;++c)l.push(e.getPointPositionForValue(c,i));return l}function zr(t,e,n){const a=z0(e),{chart:r,index:s,line:i,scale:l,axis:c}=e,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},b=r.getDatasetMeta(s),p=nl(r,b);a&&i.points.length&&(Io(t,n),I0(t,{line:i,target:a,above:h,below:m,area:n,scale:l,axis:c,clip:p}),jo(t))}function I0(t,e){const{line:n,target:a,above:r,below:s,area:i,scale:l,clip:c}=e,d=n._loop?"angle":e.axis;t.save();let u=s;s!==r&&(d==="x"?(Jl(t,a,i.top),Fr(t,{line:n,target:a,color:r,scale:l,property:d,clip:c}),t.restore(),t.save(),Jl(t,a,i.bottom)):d==="y"&&(Ql(t,a,i.left),Fr(t,{line:n,target:a,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),Ql(t,a,i.right),u=r)),Fr(t,{line:n,target:a,color:u,scale:l,property:d,clip:c}),t.restore()}function Jl(t,e,n){const{segments:a,points:r}=e;let s=!0,i=!1;t.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[la(c,d,r)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,n),t.lineTo(u.x,u.y)),i=!!e.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,n)}t.lineTo(e.first().x,n),t.closePath(),t.clip()}function Ql(t,e,n){const{segments:a,points:r}=e;let s=!0,i=!1;t.beginPath();for(const l of a){const{start:c,end:d}=l,u=r[c],f=r[la(c,d,r)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(n,u.y),t.lineTo(u.x,u.y)),i=!!e.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(n,f.y)}t.lineTo(n,e.first().y),t.closePath(),t.clip()}function Fr(t,e){const{line:n,target:a,property:r,color:s,scale:i,clip:l}=e,c=B0(n,a,r);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,b=a!==!0;t.save(),t.fillStyle=m,j0(t,i,l,b&&Or(r,f,h)),t.beginPath();const p=!!n.pathSegment(t,d);let g;if(b){p?t.closePath():Zl(t,a,h,r);const y=!!a.pathSegment(t,u,{move:p,reverse:!0});g=p&&y,g||Zl(t,a,f,r)}t.closePath(),t.fill(g?"evenodd":"nonzero"),t.restore()}}function j0(t,e,n,a){const r=e.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),t.beginPath(),n&&(c=Math.max(c,n.left),u=Math.min(u,n.right),d=Math.max(d,n.top),f=Math.min(f,n.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function Zl(t,e,n,a){const r=e.interpolate(n,a);r&&t.lineTo(r.x,r.y)}var W0={id:"filler",afterDatasetsUpdate(t,e,n){const a=(t.data.datasets||[]).length,r=[];let s,i,l,c;for(i=0;i<a;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof qt&&(c={visible:t.isDatasetVisible(i),index:i,fill:D0(l,i,a),chart:t,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=E0(r,i,n.propagate))},beforeDraw(t,e,n){const a=n.drawTime==="beforeDraw",r=t.getSortedVisibleDatasetMetas(),s=t.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&&zr(t.ctx,l,s))}},beforeDatasetsDraw(t,e,n){if(n.drawTime!=="beforeDatasetsDraw")return;const a=t.getSortedVisibleDatasetMetas();for(let r=a.length-1;r>=0;--r){const s=a[r].$filler;Kl(s)&&zr(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,e,n){const a=e.meta.$filler;!Kl(a)||n.drawTime!=="beforeDatasetDraw"||zr(t.ctx,a,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ec=(t,e)=>{let{boxHeight:n=e,boxWidth:a=e}=t;return t.usePointStyle&&(n=Math.min(n,e),a=t.pointStyleWidth||Math.min(a,e)),{boxWidth:a,boxHeight:n,itemHeight:Math.max(e,n)}},H0=(t,e)=>t!==null&&e!==null&&t.datasetIndex===e.datasetIndex&&t.index===e.index;class tc extends Vt{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n,a){this.maxWidth=e,this.maxHeight=n,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 e=this.options.labels||{};let n=Me(e.generateLabels,[this.chart],this)||[];e.filter&&(n=n.filter(a=>e.filter(a,this.chart.data))),e.sort&&(n=n.sort((a,r)=>e.sort(a,r,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:e,ctx:n}=this;if(!e.display){this.width=this.height=0;return}const a=e.labels,r=He(a.font),s=r.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=ec(a,s);let d,u;n.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,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,n,a,r){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=r+l;let f=e;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((b,p)=>{const g=a+n/2+s.measureText(b.text).width;(p===0||d[d.length-1]+g+2*l>i)&&(f+=u,d[d.length-(p>0?0:1)]=0,m+=u,h++),c[p]={left:0,top:m,row:h,width:g,height:r},d[d.length-1]+=g+l}),f}_fitCols(e,n,a,r){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-e;let f=l,h=0,m=0,b=0,p=0;return this.legendItems.forEach((g,y)=>{const{itemWidth:B,itemHeight:D}=q0(a,n,s,g,r);y>0&&m+D+2*l>u&&(f+=h+l,d.push({width:h,height:m}),b+=h+l,p++,h=m=0),c[y]={left:b,top:m,col:p,width:B,height:D},h=Math.max(h,B),m+=D+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:a,labels:{padding:r},rtl:s}}=this,i=Sn(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=We(a,this.left+r,this.right-this.lineWidths[l]);for(const d of n)l!==d.row&&(l=d.row,c=We(a,this.left+r,this.right-this.lineWidths[l])),d.top+=this.top+e+r,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+r}else{let l=0,c=We(a,this.top+e+r,this.bottom-this.columnSizes[l].height);for(const d of n)d.col!==l&&(l=d.col,c=We(a,this.top+e+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 e=this.ctx;Io(e,this),this._draw(),jo(e)}}_draw(){const{options:e,columnSizes:n,lineWidths:a,ctx:r}=this,{align:s,labels:i}=e,l=Te.color,c=Sn(e.rtl,this.left,this.width),d=He(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:b,boxHeight:p,itemHeight:g}=ec(i,f),y=function(k,C,x){if(isNaN(b)||b<=0||isNaN(p)||p<0)return;r.save();const w=ye(x.lineWidth,1);if(r.fillStyle=ye(x.fillStyle,l),r.lineCap=ye(x.lineCap,"butt"),r.lineDashOffset=ye(x.lineDashOffset,0),r.lineJoin=ye(x.lineJoin,"miter"),r.lineWidth=w,r.strokeStyle=ye(x.strokeStyle,l),r.setLineDash(ye(x.lineDash,[])),i.usePointStyle){const E={radius:p*Math.SQRT2/2,pointStyle:x.pointStyle,rotation:x.rotation,borderWidth:w},A=c.xPlus(k,b/2),T=C+h;Fi(r,E,A,T,i.pointStyleWidth&&b)}else{const E=C+Math.max((f-p)/2,0),A=c.leftForLtr(k,b),T=_n(x.borderRadius);r.beginPath(),Object.values(T).some(F=>F!==0)?Wo(r,{x:A,y:E,w:b,h:p,radius:T}):r.rect(A,E,b,p),r.fill(),w!==0&&r.stroke()}r.restore()},B=function(k,C,x){oo(r,x.text,k,C+g/2,d,{strikethrough:x.hidden,textAlign:c.textAlign(x.textAlign)})},D=this.isHorizontal(),M=this._computeTitleHeight();D?m={x:We(s,this.left+u,this.right-a[0]),y:this.top+u+M,line:0}:m={x:this.left+u,y:We(s,this.top+M+u,this.bottom-n[0].height),line:0},Gi(this.ctx,e.textDirection);const S=g+u;this.legendItems.forEach((k,C)=>{r.strokeStyle=k.fontColor,r.fillStyle=k.fontColor;const x=r.measureText(k.text).width,w=c.textAlign(k.textAlign||(k.textAlign=i.textAlign)),E=b+h+x;let A=m.x,T=m.y;c.setWidth(this.width),D?C>0&&A+E+u>this.right&&(T=m.y+=S,m.line++,A=m.x=We(s,this.left+u,this.right-a[m.line])):C>0&&T+S>this.bottom&&(A=m.x=A+n[m.line].width+u,m.line++,T=m.y=We(s,this.top+M+u,this.bottom-n[m.line].height));const F=c.x(A);if(y(F,T,k),A=wm(w,A+b+h,D?A+E:this.right,e.rtl),B(c.x(A),T,k),D)m.x+=E+u;else if(typeof k.text!="string"){const L=d.lineHeight;m.y+=nc(k,L)+u}else m.y+=S}),Ki(this.ctx,e.textDirection)}drawTitle(){const e=this.options,n=e.title,a=He(n.font),r=tt(n.padding);if(!n.display)return;const s=Sn(e.rtl,this.left,this.width),i=this.ctx,l=n.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=We(e.align,f,this.right-h);else{const b=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);u=d+We(e.align,this.top,this.bottom-b-e.labels.padding-this._computeTitleHeight())}const m=We(l,f,f+h);i.textAlign=s.textAlign(lr(l)),i.textBaseline="middle",i.strokeStyle=n.color,i.fillStyle=n.color,i.font=a.string,oo(i,n.text,m,u,a)}_computeTitleHeight(){const e=this.options.title,n=He(e.font),a=tt(e.padding);return e.display?n.lineHeight+a.height:0}_getLegendItemAt(e,n){let a,r,s;if(Et(e,this.left,this.right)&&Et(n,this.top,this.bottom)){for(s=this.legendHitBoxes,a=0;a<s.length;++a)if(r=s[a],Et(e,r.left,r.left+r.width)&&Et(n,r.top,r.top+r.height))return this.legendItems[a]}return null}handleEvent(e){const n=this.options;if(!G0(e.type,n))return;const a=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const r=this._hoveredItem,s=H0(r,a);r&&!s&&Me(n.onLeave,[e,r,this],this),this._hoveredItem=a,a&&!s&&Me(n.onHover,[e,a,this],this)}else a&&Me(n.onClick,[e,a,this],this)}}function q0(t,e,n,a,r){const s=U0(a,t,e,n),i=Y0(r,a,e.lineHeight);return{itemWidth:s,itemHeight:i}}function U0(t,e,n,a){let r=t.text;return r&&typeof r!="string"&&(r=r.reduce((s,i)=>s.length>i.length?s:i)),e+n.size/2+a.measureText(r).width}function Y0(t,e,n){let a=t;return typeof e.text!="string"&&(a=nc(e,n)),a}function nc(t,e){const n=t.text?t.text.length:0;return e*n}function G0(t,e){return!!((t==="mousemove"||t==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(t==="click"||t==="mouseup"))}var K0={id:"legend",_element:tc,start(t,e,n){const a=t.legend=new tc({ctx:t.ctx,options:n,chart:t});nt.configure(t,a,n),nt.addBox(t,a)},stop(t){nt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,e,n){const a=t.legend;nt.configure(t,a,n),a.options=n},afterUpdate(t){const e=t.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(t,e){e.replay||t.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,e,n){const a=e.datasetIndex,r=n.chart;r.isDatasetVisible(a)?(r.hide(a),e.hidden=!0):(r.show(a),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:n,pointStyle:a,textAlign:r,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(n?0:void 0),u=tt(d.borderWidth);return{text:e[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: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 oc extends Vt{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,n){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=e,this.height=this.bottom=n;const r=Oe(a.text)?a.text.length:1;this._padding=tt(a.padding);const s=r*He(a.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:n,left:a,bottom:r,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=We(l,a,s),f=n+e,d=s-a):(i.position==="left"?(u=a+e,f=We(l,r,n),c=Ee*-.5):(u=s-e,f=We(l,n,r),c=Ee*.5),d=r-n),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const e=this.ctx,n=this.options;if(!n.display)return;const a=He(n.font),s=a.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);oo(e,n.text,0,0,a,{color:n.color,maxWidth:c,rotation:d,textAlign:lr(n.align),textBaseline:"middle",translation:[i,l]})}}function X0(t,e){const n=new oc({ctx:t.ctx,options:e,chart:t});nt.configure(t,n,e),nt.addBox(t,n),t.titleBlock=n}var J0={id:"title",_element:oc,start(t,e,n){X0(t,n)},stop(t){const e=t.titleBlock;nt.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,n){const a=t.titleBlock;nt.configure(t,a,n),a.options=n},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 ho={average(t){if(!t.length)return!1;let e,n,a=new Set,r=0,s=0;for(e=0,n=t.length;e<n;++e){const l=t[e].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(t,e){if(!t.length)return!1;let n=e.x,a=e.y,r=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=sr(e,d);u<r&&(r=u,l=c)}}if(l){const c=l.tooltipPosition();n=c.x,a=c.y}return{x:n,y:a}}};function bt(t,e){return e&&(Oe(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Nt(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
17
17
  `)>-1?t.split(`
18
- `):t}function Q0(t,e){const{element:n,datasetIndex:a,index:r}=e,s=t.getDatasetMeta(a).controller,{label:i,value:l}=s.getLabelAndValue(r);return{chart:t,label:i,parsed:s.getParsed(r),raw:t.data.datasets[a].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:a,element:n}}function rc(t,e){const n=t.chart.ctx,{body:a,footer:r,title:s}=t,{boxWidth:i,boxHeight:l}=e,c=He(e.bodyFont),d=He(e.titleFont),u=He(e.footerFont),f=s.length,h=r.length,m=a.length,b=tt(e.padding);let p=b.height,g=0,y=a.reduce((M,S)=>M+S.before.length+S.lines.length+S.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(p+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){const M=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;p+=m*M+(y-m)*c.lineHeight+(y-1)*e.bodySpacing}h&&(p+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let B=0;const D=function(M){g=Math.max(g,n.measureText(M).width+B)};return n.save(),n.font=d.string,Se(t.title,D),n.font=c.string,Se(t.beforeBody.concat(t.afterBody),D),B=e.displayColors?i+2+e.boxPadding:0,Se(a,M=>{Se(M.before,D),Se(M.lines,D),Se(M.after,D)}),B=0,n.font=u.string,Se(t.footer,D),n.restore(),g+=b.width,{width:g,height:p}}function Z0(t,e){const{y:n,height:a}=e;return n<a/2?"top":n>t.height-a/2?"bottom":"center"}function eb(t,e,n,a){const{x:r,width:s}=a,i=n.caretSize+n.caretPadding;if(t==="left"&&r+s+i>e.width||t==="right"&&r-s-i<0)return!0}function tb(t,e,n,a){const{x:r,width:s}=n,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return a==="center"?d=r<=(l+c)/2?"left":"right":r<=s/2?d="left":r>=i-s/2&&(d="right"),eb(d,t,e,n)&&(d="center"),d}function sc(t,e,n){const a=n.yAlign||e.yAlign||Z0(t,n);return{xAlign:n.xAlign||e.xAlign||tb(t,e,n,a),yAlign:a}}function nb(t,e){let{x:n,width:a}=t;return e==="right"?n-=a:e==="center"&&(n-=a/2),n}function ob(t,e,n){let{y:a,height:r}=t;return e==="top"?a+=n:e==="bottom"?a-=r+n:a-=r/2,a}function ic(t,e,n,a){const{caretSize:r,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=n,d=r+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=_n(i);let b=nb(e,l);const p=ob(e,c,d);return c==="center"?l==="left"?b+=d:l==="right"&&(b-=d):l==="left"?b-=Math.max(u,h)+r:l==="right"&&(b+=Math.max(f,m)+r),{x:je(b,0,a.width-e.width),y:je(p,0,a.height-e.height)}}function ca(t,e,n){const a=tt(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-a.right:t.x+a.left}function lc(t){return bt([],Nt(t))}function ab(t,e,n){return cn(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function cc(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const dc={beforeTitle:Bt,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,a=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(a>0&&e.dataIndex<a)return n[e.dataIndex]}return""},afterTitle:Bt,beforeBody:Bt,beforeLabel:Bt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Be(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Bt,afterBody:Bt,beforeFooter:Bt,footer:Bt,afterFooter:Bt};function Ye(t,e,n,a){const r=t[e].call(n,a);return typeof r>"u"?dc[e].call(n,a):r}class Rr extends Vt{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,a=this.options.setContext(this.getContext()),r=a.enabled&&n.options.animation&&a.animations,s=new rl(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ab(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:a}=n,r=Ye(a,"beforeTitle",this,e),s=Ye(a,"title",this,e),i=Ye(a,"afterTitle",this,e);let l=[];return l=bt(l,Nt(r)),l=bt(l,Nt(s)),l=bt(l,Nt(i)),l}getBeforeBody(e,n){return lc(Ye(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:a}=n,r=[];return Se(e,s=>{const i={before:[],lines:[],after:[]},l=cc(a,s);bt(i.before,Nt(Ye(l,"beforeLabel",this,s))),bt(i.lines,Ye(l,"label",this,s)),bt(i.after,Nt(Ye(l,"afterLabel",this,s))),r.push(i)}),r}getAfterBody(e,n){return lc(Ye(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:a}=n,r=Ye(a,"beforeFooter",this,e),s=Ye(a,"footer",this,e),i=Ye(a,"afterFooter",this,e);let l=[];return l=bt(l,Nt(r)),l=bt(l,Nt(s)),l=bt(l,Nt(i)),l}_createItems(e){const n=this._active,a=this.chart.data,r=[],s=[],i=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(Q0(this.chart,n[c]));return e.filter&&(l=l.filter((u,f,h)=>e.filter(u,f,h,a))),e.itemSort&&(l=l.sort((u,f)=>e.itemSort(u,f,a))),Se(l,u=>{const f=cc(e.callbacks,u);r.push(Ye(f,"labelColor",this,u)),s.push(Ye(f,"labelPointStyle",this,u)),i.push(Ye(f,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(e,n){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=ho[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=rc(this,a),d=Object.assign({},l,c),u=sc(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),e&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,a,r){const s=this.getCaretPosition(e,a,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,a){const{xAlign:r,yAlign:s}=this,{caretSize:i,cornerRadius:l}=a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=_n(l),{x:h,y:m}=e,{width:b,height:p}=n;let g,y,B,D,M,S;return s==="center"?(M=m+p/2,r==="left"?(g=h,y=g-i,D=M+i,S=M-i):(g=h+b,y=g+i,D=M-i,S=M+i),B=g):(r==="left"?y=h+Math.max(c,u)+i:r==="right"?y=h+b-Math.max(d,f)-i:y=this.caretX,s==="top"?(D=m,M=D-i,g=y-i,B=y+i):(D=m+p,M=D+i,g=y+i,B=y-i),S=D),{x1:g,x2:y,x3:B,y1:D,y2:M,y3:S}}drawTitle(e,n,a){const r=this.title,s=r.length;let i,l,c;if(s){const d=Sn(a.rtl,this.x,this.width);for(e.x=ca(this,a.titleAlign,a),n.textAlign=d.textAlign(a.titleAlign),n.textBaseline="middle",i=He(a.titleFont),l=a.titleSpacing,n.fillStyle=a.titleColor,n.font=i.string,c=0;c<s;++c)n.fillText(r[c],d.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+l,c+1===s&&(e.y+=a.titleMarginBottom-l)}}_drawColorBox(e,n,a,r,s){const i=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:c,boxWidth:d}=s,u=He(s.bodyFont),f=ca(this,"left",s),h=r.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,b=n.y+m;if(s.usePointStyle){const p={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},g=r.leftForLtr(h,d)+d/2,y=b+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,mr(e,p,g,y),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,mr(e,p,g,y)}else{e.lineWidth=we(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const p=r.leftForLtr(h,d),g=r.leftForLtr(r.xPlus(h,1),d-2),y=_n(i.borderRadius);Object.values(y).some(B=>B!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Wo(e,{x:p,y:b,w:d,h:c,radius:y}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),Wo(e,{x:g,y:b+1,w:d-2,h:c-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(p,b,d,c),e.strokeRect(p,b,d,c),e.fillStyle=i.backgroundColor,e.fillRect(g,b+1,d-2,c-2))}e.fillStyle=this.labelTextColors[a]}drawBody(e,n,a){const{body:r}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=a,f=He(a.bodyFont);let h=f.lineHeight,m=0;const b=Sn(a.rtl,this.x,this.width),p=function(x){n.fillText(x,b.x(e.x+m),e.y+h/2),e.y+=h+s},g=b.textAlign(i);let y,B,D,M,S,k,C;for(n.textAlign=i,n.textBaseline="middle",n.font=f.string,e.x=ca(this,g,a),n.fillStyle=a.bodyColor,Se(this.beforeBody,p),m=l&&g!=="right"?i==="center"?d/2+u:d+2+u:0,M=0,k=r.length;M<k;++M){for(y=r[M],B=this.labelTextColors[M],n.fillStyle=B,Se(y.before,p),D=y.lines,l&&D.length&&(this._drawColorBox(n,e,M,b,a),h=Math.max(f.lineHeight,c)),S=0,C=D.length;S<C;++S)p(D[S]),h=f.lineHeight;Se(y.after,p)}m=0,h=f.lineHeight,Se(this.afterBody,p),e.y-=s}drawFooter(e,n,a){const r=this.footer,s=r.length;let i,l;if(s){const c=Sn(a.rtl,this.x,this.width);for(e.x=ca(this,a.footerAlign,a),e.y+=a.footerMarginTop,n.textAlign=c.textAlign(a.footerAlign),n.textBaseline="middle",i=He(a.footerFont),n.fillStyle=a.footerColor,n.font=i.string,l=0;l<s;++l)n.fillText(r[l],c.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a.footerSpacing}}drawBackground(e,n,a,r){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=e,{width:d,height:u}=a,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:b}=_n(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(l+f,c),i==="top"&&this.drawCaret(e,n,a,r),n.lineTo(l+d-h,c),n.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(e,n,a,r),n.lineTo(l+d,c+u-b),n.quadraticCurveTo(l+d,c+u,l+d-b,c+u),i==="bottom"&&this.drawCaret(e,n,a,r),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(e,n,a,r),n.lineTo(l,c+f),n.quadraticCurveTo(l,c,l+f,c),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,a=this.$animations,r=a&&a.x,s=a&&a.y;if(r||s){const i=ho[e.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=rc(this,e),c=Object.assign({},i,this._size),d=sc(n,e,c),u=ic(e,c,d,n);(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(e){const n=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const i=tt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=a,this.drawBackground(s,e,r,n),Ki(e,n.textDirection),s.y+=i.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Xi(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const a=this._active,r=e.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=!Fo(a,r),i=this._positionChanged(r,n);(s||i)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,a=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],i=this._getActiveElements(e,s,n,a),l=this._positionChanged(i,e),c=n||!Fo(i,s)||l;return c&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,a,r){const s=this.options;if(e.type==="mouseout")return[];if(!r)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(e,s.mode,s,a);return s.reverse&&i.reverse(),i}_positionChanged(e,n){const{caretX:a,caretY:r,options:s}=this,i=ho[s.position].call(this,e,n);return i!==!1&&(a!==i.x||r!==i.y)}}ie(Rr,"positioners",ho);var rb={id:"tooltip",_element:Rr,positioners:ho,afterInit(t,e,n){n&&(t.tooltip=new Rr({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:dc},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 sb=(t,e,n,a)=>(typeof e=="string"?(n=t.push(e)-1,a.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function ib(t,e,n,a){const r=t.indexOf(e);if(r===-1)return sb(t,e,n,a);const s=t.lastIndexOf(e);return r!==s?n:r}const lb=(t,e)=>t===null?null:je(Math.round(t),0,e);function uc(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class vr extends Dn{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const a=this.getLabels();for(const{index:r,label:s}of n)a[r]===s&&a.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Be(e))return null;const a=this.getLabels();return n=isFinite(n)&&a[n]===e?n:ib(a,e,ye(n,e),this._addedLabels),lb(n,a.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:a,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(a=0),n||(r=this.getLabels().length-1)),this.min=a,this.max=r}buildTicks(){const e=this.min,n=this.max,a=this.options.offset,r=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let i=e;i<=n;i++)r.push({value:i});return r}getLabelForValue(e){return uc.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}ie(vr,"id","category"),ie(vr,"defaults",{ticks:{callback:uc}});function cb(t,e){const n=[],{bounds:r,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,b=u-1,{min:p,max:g}=e,y=!Be(i),B=!Be(l),D=!Be(d),M=(g-p)/(f+1);let S=Ci((g-p)/b/m)*m,k,C,x,w;if(S<1e-14&&!y&&!B)return[{value:p},{value:g}];w=Math.ceil(g/S)-Math.floor(p/S),w>b&&(S=Ci(w*S/b/m)*m),Be(c)||(k=Math.pow(10,c),S=Math.ceil(S*k)/k),r==="ticks"?(C=Math.floor(p/S)*S,x=Math.ceil(g/S)*S):(C=p,x=g),y&&B&&s&&fm((l-i)/s,S/1e3)?(w=Math.round(Math.min((l-i)/S,u)),S=(l-i)/w,C=i,x=l):D?(C=y?i:C,x=B?l:x,w=d-1,S=(x-C)/w):(w=(x-C)/S,Jn(w,Math.round(w),S/1e3)?w=Math.round(w):w=Math.ceil(w));const E=Math.max(Bi(S),Bi(C));k=Math.pow(10,Be(c)?E:c),C=Math.round(C*k)/k,x=Math.round(x*k)/k;let A=0;for(y&&(h&&C!==i?(n.push({value:i}),C<i&&A++,Jn(Math.round((C+A*S)*k)/k,i,fc(i,M,t))&&A++):C<i&&A++);A<w;++A){const T=Math.round((C+A*S)*k)/k;if(B&&T>l)break;n.push({value:T})}return B&&h&&x!==l?n.length&&Jn(n[n.length-1].value,l,fc(l,M,t))?n[n.length-1].value=l:n.push({value:l}):(!B||x===l)&&n.push({value:x}),n}function fc(t,e,{horizontal:n,minRotation:a}){const r=St(a),s=(n?Math.sin(r):Math.cos(r))||.001,i=.75*e*(""+t).length;return Math.min(e/s,i)}class db extends Dn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Be(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:a}=this.getUserBounds();let{min:r,max:s}=this;const i=c=>r=n?r:c,l=c=>s=a?s:c;if(e){const c=pt(r),d=pt(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),e||i(r-c)}this.min=r,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:a}=e,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(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let a=this.getTickLimit();a=Math.max(2,a);const r={maxTicks:a,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,i=cb(r,s);return e.bounds==="ticks"&&hm(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const e=this.ticks;let n=this.min,a=this.max;if(super.configure(),this.options.offset&&e.length){const r=(a-n)/Math.max(e.length-1,1)/2;n-=r,a+=r}this._startValue=n,this._endValue=a,this._valueRange=a-n}getLabelForValue(e){return ur(e,this.chart.options.locale,this.options.ticks.format)}}class Lr extends db{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Ie(e)?e:0,this.max=Ie(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,a=St(this.options.ticks.minRotation),r=(e?Math.sin(a):Math.cos(a))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ie(Lr,"id","linear"),ie(Lr,"defaults",{ticks:{callback:Oi.formatters.numeric}});const da={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}},Ge=Object.keys(da);function hc(t,e){return t-e}function mc(t,e){if(Be(e))return null;const n=t._adapter,{parser:a,round:r,isoWeekday:s}=t._parseOpts;let i=e;return typeof a=="function"&&(i=a(i)),Ie(i)||(i=typeof a=="string"?n.parse(i,a):n.parse(i)),i===null?null:(r&&(i=r==="week"&&(Qn(s)||s===!0)?n.startOf(i,"isoWeek",s):n.startOf(i,r)),+i)}function pc(t,e,n,a){const r=Ge.length;for(let s=Ge.indexOf(t);s<r-1;++s){const i=da[Ge[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-e)/(l*i.size))<=a)return Ge[s]}return Ge[r-1]}function ub(t,e,n,a,r){for(let s=Ge.length-1;s>=Ge.indexOf(n);s--){const i=Ge[s];if(da[i].common&&t._adapter.diff(r,a,i)>=e-1)return i}return Ge[n?Ge.indexOf(n):0]}function fb(t){for(let e=Ge.indexOf(t)+1,n=Ge.length;e<n;++e)if(da[Ge[e]].common)return Ge[e]}function gc(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:a,hi:r}=ir(n,e),s=n[a]>=e?n[a]:n[r];t[s]=!0}}function hb(t,e,n,a){const r=t._adapter,s=+r.startOf(e[0].value,a),i=e[e.length-1].value;let l,c;for(l=s;l<=i;l=+r.add(l,1,a))c=n[l],c>=0&&(e[c].major=!0);return e}function bc(t,e,n){const a=[],r={},s=e.length;let i,l;for(i=0;i<s;++i)l=e[i],r[l]=i,a.push({value:l,major:!1});return s===0||!n?a:hb(t,a,r,n)}class ua extends Dn{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const a=e.time||(e.time={}),r=this._adapter=new Kp._date(e.adapters.date);r.init(n),Kn(a.displayFormats,r.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:mc(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,a=e.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()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=Ie(r)&&!isNaN(r)?r:+n.startOf(Date.now(),a),s=Ie(s)&&!isNaN(s)?s:+n.endOf(Date.now(),a)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],a=e[e.length-1]),{min:n,max:a}}buildTicks(){const e=this.options,n=e.time,a=e.ticks,r=a.source==="labels"?this.getLabelTimestamps():this._generate();e.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=ym(r,s,i);return this._unit=n.unit||(a.autoSkip?pc(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):ub(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:fb(this._unit),this.initOffsets(r),e.reverse&&l.reverse(),bc(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,a=0,r,s;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?n=1-r:n=(this.getDecimalForValue(e[1])-r)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?a=s:a=(s-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;n=je(n,0,i),a=je(a,0,i),this._offsets={start:n,end:a,factor:1/(n+1+a)}}_generate(){const e=this._adapter,n=this.min,a=this.max,r=this.options,s=r.time,i=s.unit||pc(s.minUnit,n,a,this._getLabelCapacity(n)),l=ye(r.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Qn(c)||c===!0,u={};let f=n,h,m;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":i),e.diff(a,n,i)>1e5*l)throw new Error(n+" and "+a+" are too far apart with stepSize of "+l+" "+i);const b=r.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<a;h=+e.add(h,l,i),m++)gc(u,h,b);return(h===a||r.bounds==="ticks"||m===1)&&gc(u,h,b),Object.keys(u).sort(hc).map(p=>+p)}getLabelForValue(e){const n=this._adapter,a=this.options.time;return a.tooltipFormat?n.format(e,a.tooltipFormat):n.format(e,a.displayFormats.datetime)}format(e,n){const r=this.options.time.displayFormats,s=this._unit,i=n||r[s];return this._adapter.format(e,i)}_tickFormatFunction(e,n,a,r){const s=this.options,i=s.ticks.callback;if(i)return Me(i,[e,n,a],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=a[n],m=d&&f&&h&&h.major;return this._adapter.format(e,r||(m?f:u))}generateTickLabels(e){let n,a,r;for(n=0,a=e.length;n<a;++n)r=e[n],r.label=this._tickFormatFunction(r.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,a=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+a)*n.factor)}getValueForPixel(e){const n=this._offsets,a=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+a*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,a=this.ctx.measureText(e).width,r=St(this.isHorizontal()?n.maxRotation:n.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(e){const n=this.options.time,a=n.displayFormats,r=a[n.unit]||a.millisecond,s=this._tickFormatFunction(e,0,bc(this,[e],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 e=this._cache.data||[],n,a;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,a=r.length;n<a;++n)e=e.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,a;if(e.length)return e;const r=this.getLabels();for(n=0,a=r.length;n<a;++n)e.push(mc(this,r[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Vi(e.sort(hc))}}ie(ua,"id","time"),ie(ua,"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 fa(t,e,n){let a=0,r=t.length-1,s,i,l,c;n?(e>=t[a].pos&&e<=t[r].pos&&({lo:a,hi:r}=rn(t,"pos",e)),{pos:s,time:l}=t[a],{pos:i,time:c}=t[r]):(e>=t[a].time&&e<=t[r].time&&({lo:a,hi:r}=rn(t,"time",e)),{time:s,pos:l}=t[a],{time:i,pos:c}=t[r]);const d=i-s;return d?l+(c-l)*(e-s)/d:l}class yc extends ua{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=fa(n,this.min),this._tableRange=fa(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:a}=this,r=[],s=[];let i,l,c,d,u;for(i=0,l=e.length;i<l;++i)d=e[i],d>=n&&d<=a&&r.push(d);if(r.length<2)return[{time:n,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 e=this.min,n=this.max;let a=super.getDataTimestamps();return(!a.includes(e)||!a.length)&&a.splice(0,0,e),(!a.includes(n)||a.length===1)&&a.push(n),a.sort((r,s)=>r-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),a=this.getLabelTimestamps();return n.length&&a.length?e=this.normalize(n.concat(a)):e=n.length?n:a,e=this._cache.all=e,e}getDecimalForValue(e){return(fa(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,a=this.getDecimalForPixel(e)/n.factor-n.end;return fa(this._table,a*this._tableRange+this._minPos,!0)}}ie(yc,"id","timeseries"),ie(yc,"defaults",ua.defaults);const mb={key:0,class:"mb-2 text-sm font-medium text-gray-700"},pb={key:0,class:"text-red-500 ml-1"},gb={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},bb={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},yb={class:"text-red-600 text-sm"},xb={key:1,class:"mt-2 text-xs text-gray-500"},kb={key:0},xc=Hn(o.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:e,emit:n}){Mt.register(vr,Lr,sa,qt,ia,fo,J0,rb,K0,W0,Xo,Ko,Sr,En);const a=t,r=n,s=o.ref(null),i=o.ref(null),l=o.computed(()=>({"opacity-50 pointer-events-none":a.loading||a.error})),c=()=>{const f=a.theme==="dark";return{responsive:a.responsive,maintainAspectRatio:a.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:h=>{let m=0;return h.type==="data"&&h.mode==="default"&&(m=h.dataIndex*100+h.datasetIndex*50),m},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:f?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:f?"#1F2937":"#FFFFFF",titleColor:f?"#F3F4F6":"#111827",bodyColor:f?"#D1D5DB":"#4B5563",borderColor:f?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:a.type!=="pie"&&a.type!=="doughnut"&&a.type!=="polarArea"?{x:{grid:{color:f?"#374151":"#E5E7EB"},ticks:{color:f?"#D1D5DB":"#6B7280"}},y:{grid:{color:f?"#374151":"#E5E7EB"},ticks:{color:f?"#D1D5DB":"#6B7280"}}}:void 0}},d=f=>!f||!f.datasets?f:{...f,datasets:f.datasets.map((h,m)=>({...h,borderColor:h.borderColor||a.colors[m%a.colors.length],backgroundColor:h.backgroundColor||a.colors[m%a.colors.length]+"20",pointBackgroundColor:h.pointBackgroundColor||a.colors[m%a.colors.length],pointBorderColor:h.pointBorderColor||a.colors[m%a.colors.length],hoverBackgroundColor:h.hoverBackgroundColor||a.colors[m%a.colors.length]+"40",hoverBorderColor:h.hoverBorderColor||a.colors[m%a.colors.length]}))},u=async()=>{if(!s.value)return;await o.nextTick(),i.value&&i.value.destroy();const f=d(a.data||a.modelValue);if(!f)return;const h={...c(),...a.options};i.value=new Mt(s.value,{type:a.type,data:f,options:h,onClick:(m,b)=>{r("click",m,b),a.onClick&&a.onClick(m,b)},onHover:(m,b)=>{r("hover",m,b),a.onHover&&a.onHover(m,b)}}),r("ready",i.value)};return o.watch(()=>[a.data,a.modelValue,a.type,a.options,a.theme],()=>{u()},{deep:!0}),o.watch(()=>[a.width,a.height],()=>{i.value&&i.value.resize()}),o.onMounted(()=>{u()}),o.onUnmounted(()=>{i.value&&i.value.destroy()}),e({chart:i,updateChart:u}),(f,h)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["d-code-chart",l.value])},[t.label?(o.openBlock(),o.createElementBlock("div",mb,[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",pb,"*")):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"relative",style:o.normalizeStyle({height:t.height+"px"})},[o.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(o.openBlock(),o.createElementBlock("div",gb,[...h[0]||(h[0]=[o.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):o.createCommentVNode("",!0),t.error?(o.openBlock(),o.createElementBlock("div",bb,[o.createElementVNode("div",yb,o.toDisplayString(t.error),1)])):o.createCommentVNode("",!0)],4),t.showInfo&&f.chartData?(o.openBlock(),o.createElementBlock("div",xb,[f.chartData.datasets?(o.openBlock(),o.createElementBlock("div",kb,o.toDisplayString(f.chartData.datasets.length)+" dataset(s) • "+o.toDisplayString(f.chartData.labels?f.chartData.labels.length:0)+" data points ",1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-5b6eaeb4"]]),Pt=o.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.Label),o.mergeProps(o.unref(n),{class:o.unref(de)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),wb=["aria-busy"],_b={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Cb={key:1,class:"flex items-center gap-2.5"},Bb=["id","checked","indeterminate","disabled","required"],Sb={key:0,class:"ml-1 text-red-500 dark:text-red-400","aria-label":"required"},mo=Hn(o.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{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:e}){const n=o.useAttrs(),a=e,r=t,s=o.computed(()=>n.label),i=o.computed(()=>n.placeholder),l=o.computed(()=>n.title),c=o.computed(()=>r.visible??!0),d=o.computed(()=>n.required===""||n.required===!0||n.required==="true"),u=Math.random().toString(36).slice(2,7),f=o.computed(()=>`dcode-checkbox-${n.id||s.value||"checkbox"}-${u}`),h=o.ref(!!r.modelValue);o.watch(()=>r.modelValue,p=>{h.value=!!p},{immediate:!0});const m=()=>{if(r.disabled)return;const p=!h.value;h.value=p,a("update:modelValue",p)},b=p=>{(p.key===" "||p.key==="Enter")&&(p.preventDefault(),m())};return(p,g)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["",[o.unref(n).class,{"opacity-60 cursor-not-allowed":t.disabled}]]),"aria-busy":t.skeleton},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",_b)):o.createCommentVNode("",!0),g[0]||(g[0]=o.createElementVNode("div",{class:"flex items-center gap-2.5"},[o.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),o.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(o.openBlock(),o.createElementBlock("div",Cb,[o.createElementVNode("label",{class:o.normalizeClass(["flex items-start gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[o.createElementVNode("input",{type:"checkbox",id:f.value,class:"sr-only",checked:h.value,indeterminate:t.indeterminate,disabled:t.disabled,required:d.value,onChange:m,onKeydown:b},null,40,Bb),o.createElementVNode("div",{class:o.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-colors flex items-center justify-center mt-0.5",[h.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[h.value&&!t.indeterminate?(o.openBlock(),o.createBlock(o.unref(ne.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(o.openBlock(),o.createBlock(o.unref(ne.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):o.createCommentVNode("",!0)],2),i.value||l.value?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.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"]])},o.toDisplayString(i.value||l.value),3)):o.createCommentVNode("",!0)],2),s.value?(o.openBlock(),o.createBlock(Pt,{key:0,for:f.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300 select-none cursor-pointer"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.value)+" ",1),d.value?(o.openBlock(),o.createElementBlock("span",Sb," * ")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0)]))],10,wb)),[[o.vShow,c.value]])}}),[["__scopeId","data-v-938d0f92"]]),Eb=["aria-busy"],Db={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Vb={key:1,class:"flex justify-end"},Mb={key:0,class:"ml-1 text-destructive"},Nb={class:"relative w-full group"},Pb={class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none"},Ab={class:"font-medium text-xs mr-1"},$b=["id","disabled","readonly","placeholder","maxlength"],Tb={key:0,class:"absolute inset-y-0 right-3 flex items-center"},Ob={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"},zb={key:1,class:"text-xs text-destructive"},kc=o.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:e}){const n=o.useAttrs(),a=e,r=t,s=Math.random().toString(36).slice(2,7),i=o.computed(()=>`app-currency-field-${n.id||r.label||"currency-field"}-${s}`),l=o.computed(()=>{const x=n.required,w=n["aria-required"];return x===""||x===!0||x==="true"||(w==="true"||w===!0)}),c=o.computed(()=>{const x=n.maxlength??n.maxLength;let w=Number.NaN;return typeof x=="number"?w=x:typeof x=="string"&&(w=Number.parseInt(x,10)),Number.isFinite(w)&&w>0?w:void 0}),d=o.computed(()=>r.locale?r.locale:"en-US"),u=o.computed(()=>r.prependInner?r.prependInner:r.currency==="USD"?"$":r.currency==="IDR"?"Rp":r.currency),f=o.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=x=>{const w=x.replaceAll(/\D/g,"");return w?Number(w):null},m=x=>f.value.format(x),b=o.ref("");o.watch(()=>r.modelValue,x=>{x==null?b.value="":h(b.value)!==x&&(b.value=m(x))},{immediate:!0});const p=x=>{const w=b.value,E=h(w);if(E===null){b.value!==""&&(b.value=""),a("update:modelValue",null);return}const A=m(E);w!==A&&(b.value=A),a("update:modelValue",E)},g=()=>{b.value="",a("update:modelValue",null),a("clear")},y=o.computed(()=>!r.clearable||r.disabled||r.readonly?!1:r.hideClearWhenEmpty?b.value.length>0:!0),B=o.computed(()=>!!r.error),D=o.computed(()=>{const{class:x,maxlength:w,maxLength:E,...A}=n;return A}),M=o.computed(()=>b.value.length),S=o.computed(()=>r.showCharCount?(c.value??0)>0:!1),k=o.computed(()=>S.value&&M.value>0),C=o.computed(()=>`${M.value} / ${c.value}`);return(x,w)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.label?(o.openBlock(),o.createElementBlock("div",Db)):o.createCommentVNode("",!0),w[2]||(w[2]=o.createElementVNode("div",{class:"relative w-full"},[o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),S.value?(o.openBlock(),o.createElementBlock("div",Vb,[...w[1]||(w[1]=[o.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:i.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",Mb,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",Nb,[o.createElementVNode("div",Pb,[o.createElementVNode("span",Ab,o.toDisplayString(u.value),1)]),o.withDirectives(o.createElementVNode("input",o.mergeProps({id:i.value,"onUpdate:modelValue":w[0]||(w[0]=E=>b.value=E),onInput:p,type:"text",inputmode:"numeric"},D.value,{disabled:r.disabled,readonly:r.readonly,placeholder:r.placeholder,maxlength:c.value,class:["w-full h-10 flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-sm text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-within:ring-1 focus-within:ring-white","pl-10",y.value?"pr-10":"",B.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px] outline-none":"outline-none"]}),null,16,$b),[[o.vModelText,b.value]]),y.value?(o.openBlock(),o.createElementBlock("div",Tb,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:g}," ✕ ")])):o.createCommentVNode("",!0),k.value&&!B.value?(o.openBlock(),o.createElementBlock("p",Ob,o.toDisplayString(C.value),1)):o.createCommentVNode("",!0)]),B.value?(o.openBlock(),o.createElementBlock("p",zb,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,Eb))}}),pn=o.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,r=ke.useVModel(n,"modelValue",a,{passive:!0,defaultValue:n.defaultValue});return(s,i)=>o.withDirectives((o.openBlock(),o.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>o.isRef(r)?r.value=l:null),class:o.normalizeClass(o.unref(de)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n.class))},null,2)),[[o.vModelText,o.unref(r)]])}}),wc=6048e5,Fb=864e5,_c=Symbol.for("constructDateFrom");function Yt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&_c in t?t[_c](e):t instanceof Date?new t.constructor(e):new Date(e)}function it(t,e){return Yt(e||t,t)}let Rb={};function ha(){return Rb}function po(t,e){var l,c,d,u;const n=ha(),a=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,r=it(t,e==null?void 0:e.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 ma(t,e){return po(t,{...e,weekStartsOn:1})}function Cc(t,e){const n=it(t,e==null?void 0:e.in),a=n.getFullYear(),r=Yt(n,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const s=ma(r),i=Yt(n,0);i.setFullYear(a,0,4),i.setHours(0,0,0,0);const l=ma(i);return n.getTime()>=s.getTime()?a+1:n.getTime()>=l.getTime()?a:a-1}function Bc(t){const e=it(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function vb(t,...e){const n=Yt.bind(null,e.find(a=>typeof a=="object"));return e.map(n)}function Sc(t,e){const n=it(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function Lb(t,e,n){const[a,r]=vb(n==null?void 0:n.in,t,e),s=Sc(a),i=Sc(r),l=+s-Bc(s),c=+i-Bc(i);return Math.round((l-c)/Fb)}function Ib(t,e){const n=Cc(t,e),a=Yt(t,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),ma(a)}function jb(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Wb(t){return!(!jb(t)&&typeof t!="number"||isNaN(+it(t)))}function Hb(t,e){const n=it(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const qb={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"}},Ub=(t,e,n)=>{let a;const r=qb[t];return typeof r=="string"?a=r:e===1?a=r.one:a=r.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Mn(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Yb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xb={date:Mn({formats:Yb,defaultWidth:"full"}),time:Mn({formats:Gb,defaultWidth:"full"}),dateTime:Mn({formats:Kb,defaultWidth:"full"})},Jb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qb=(t,e,n,a)=>Jb[t];function yt(t){return(e,n)=>{const a=n!=null&&n.context?String(n.context):"standalone";let r;if(a==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):i;r=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;r=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(e):e;return r[s]}}const Zb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ey={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ty={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"]},ny={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"]},oy={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"}},ay={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"}},ry={ordinalNumber:(t,e)=>{const n=Number(t),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:yt({values:Zb,defaultWidth:"wide"}),quarter:yt({values:ey,defaultWidth:"wide",argumentCallback:t=>t-1}),month:yt({values:ty,defaultWidth:"wide"}),day:yt({values:ny,defaultWidth:"wide"}),dayPeriod:yt({values:oy,defaultWidth:"wide",formattingValues:ay,defaultFormattingWidth:"wide"})};function xt(t){return(e,n={})=>{const a=n.width,r=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],s=e.match(r);if(!s)return null;const i=s[0],l=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?iy(l,f=>f.test(i)):sy(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(i.length);return{value:d,rest:u}}}function sy(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function iy(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Ec(t){return(e,n={})=>{const a=e.match(t.matchPattern);if(!a)return null;const r=a[0],s=e.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const l=e.slice(r.length);return{value:i,rest:l}}}const ly=/^(\d+)(th|st|nd|rd)?/i,cy=/\d+/i,dy={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},uy={any:[/^b/i,/^(a|c)/i]},fy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hy={any:[/1/i,/2/i,/3/i,/4/i]},my={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]},gy={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},by={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]},yy={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},xy={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}},ky={ordinalNumber:Ec({matchPattern:ly,parsePattern:cy,valueCallback:t=>parseInt(t,10)}),era:xt({matchPatterns:dy,defaultMatchWidth:"wide",parsePatterns:uy,defaultParseWidth:"any"}),quarter:xt({matchPatterns:fy,defaultMatchWidth:"wide",parsePatterns:hy,defaultParseWidth:"any",valueCallback:t=>t+1}),month:xt({matchPatterns:my,defaultMatchWidth:"wide",parsePatterns:py,defaultParseWidth:"any"}),day:xt({matchPatterns:gy,defaultMatchWidth:"wide",parsePatterns:by,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:yy,defaultMatchWidth:"any",parsePatterns:xy,defaultParseWidth:"any"})},Dc={code:"en-US",formatDistance:Ub,formatLong:Xb,formatRelative:Qb,localize:ry,match:ky,options:{weekStartsOn:0,firstWeekContainsDate:1}};function wy(t,e){const n=it(t,e==null?void 0:e.in);return Lb(n,Hb(n))+1}function _y(t,e){const n=it(t,e==null?void 0:e.in),a=+ma(n)-+Ib(n);return Math.round(a/wc)+1}function Vc(t,e){var u,f,h,m;const n=it(t,e==null?void 0:e.in),a=n.getFullYear(),r=ha(),s=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.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=Yt((e==null?void 0:e.in)||t,0);i.setFullYear(a+1,0,s),i.setHours(0,0,0,0);const l=po(i,e),c=Yt((e==null?void 0:e.in)||t,0);c.setFullYear(a,0,s),c.setHours(0,0,0,0);const d=po(c,e);return+n>=+l?a+1:+n>=+d?a:a-1}function Cy(t,e){var l,c,d,u;const n=ha(),a=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,r=Vc(t,e),s=Yt((e==null?void 0:e.in)||t,0);return s.setFullYear(r,0,a),s.setHours(0,0,0,0),po(s,e)}function By(t,e){const n=it(t,e==null?void 0:e.in),a=+po(n,e)-+Cy(n,e);return Math.round(a/wc)+1}function De(t,e){const n=t<0?"-":"",a=Math.abs(t).toString().padStart(e,"0");return n+a}const Gt={y(t,e){const n=t.getFullYear(),a=n>0?n:1-n;return De(e==="yy"?a%100:a,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):De(n+1,2)},d(t,e){return De(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return De(t.getHours()%12||12,e.length)},H(t,e){return De(t.getHours(),e.length)},m(t,e){return De(t.getMinutes(),e.length)},s(t,e){return De(t.getSeconds(),e.length)},S(t,e){const n=e.length,a=t.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return De(r,e.length)}},Nn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Mc={G:function(t,e,n){const a=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const a=t.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return Gt.y(t,e)},Y:function(t,e,n,a){const r=Vc(t,a),s=r>0?r:1-r;if(e==="YY"){const i=s%100;return De(i,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):De(s,e.length)},R:function(t,e){const n=Cc(t);return De(n,e.length)},u:function(t,e){const n=t.getFullYear();return De(n,e.length)},Q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return De(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return De(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,n){const a=t.getMonth();switch(e){case"M":case"MM":return Gt.M(t,e);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,n){const a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return De(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,n,a){const r=By(t,a);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):De(r,e.length)},I:function(t,e,n){const a=_y(t);return e==="Io"?n.ordinalNumber(a,{unit:"week"}):De(a,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Gt.d(t,e)},D:function(t,e,n){const a=wy(t);return e==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):De(a,e.length)},E:function(t,e,n){const a=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,n,a){const r=t.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return De(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,a){const r=t.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return De(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const a=t.getDay(),r=a===0?7:a;switch(e){case"i":return String(r);case"ii":return De(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const a=t.getHours();let r;switch(a===12?r=Nn.noon:a===0?r=Nn.midnight:r=a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const a=t.getHours();let r;switch(a>=17?r=Nn.evening:a>=12?r=Nn.afternoon:a>=4?r=Nn.morning:r=Nn.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let a=t.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Gt.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Gt.H(t,e)},K:function(t,e,n){const a=t.getHours()%12;return e==="Ko"?n.ordinalNumber(a,{unit:"hour"}):De(a,e.length)},k:function(t,e,n){let a=t.getHours();return a===0&&(a=24),e==="ko"?n.ordinalNumber(a,{unit:"hour"}):De(a,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Gt.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Gt.s(t,e)},S:function(t,e){return Gt.S(t,e)},X:function(t,e,n){const a=t.getTimezoneOffset();if(a===0)return"Z";switch(e){case"X":return Pc(a);case"XXXX":case"XX":return gn(a);case"XXXXX":case"XXX":default:return gn(a,":")}},x:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"x":return Pc(a);case"xxxx":case"xx":return gn(a);case"xxxxx":case"xxx":default:return gn(a,":")}},O:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Nc(a,":");case"OOOO":default:return"GMT"+gn(a,":")}},z:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Nc(a,":");case"zzzz":default:return"GMT"+gn(a,":")}},t:function(t,e,n){const a=Math.trunc(+t/1e3);return De(a,e.length)},T:function(t,e,n){return De(+t,e.length)}};function Nc(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),r=Math.trunc(a/60),s=a%60;return s===0?n+String(r):n+String(r)+e+De(s,2)}function Pc(t,e){return t%60===0?(t>0?"-":"+")+De(Math.abs(t)/60,2):gn(t,e)}function gn(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),r=De(Math.trunc(a/60),2),s=De(a%60,2);return n+r+e+s}const Ac=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},$c=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Sy={p:$c,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return Ac(t,e);let s;switch(a){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Ac(a,e)).replace("{{time}}",$c(r,e))}},Ey=/^D+$/,Dy=/^Y+$/,Vy=["D","DD","YY","YYYY"];function My(t){return Ey.test(t)}function Ny(t){return Dy.test(t)}function Py(t,e,n){const a=Ay(t,e,n);if(console.warn(a),Vy.includes(t))throw new RangeError(a)}function Ay(t,e,n){const a=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $y=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ty=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Oy=/^'([^]*?)'?$/,zy=/''/g,Fy=/[a-zA-Z]/;function Tc(t,e,n){var u,f,h,m;const a=ha(),r=a.locale??Dc,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=it(t,n==null?void 0:n.in);if(!Wb(l))throw new RangeError("Invalid time value");let c=e.match(Ty).map(b=>{const p=b[0];if(p==="p"||p==="P"){const g=Sy[p];return g(b,r.formatLong)}return b}).join("").match($y).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const p=b[0];if(p==="'")return{isToken:!1,value:Ry(b)};if(Mc[p])return{isToken:!0,value:b};if(p.match(Fy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:b}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return c.map(b=>{if(!b.isToken)return b.value;const p=b.value;(Ny(p)||My(p))&&Py(p,e,String(t));const g=Mc[p[0]];return g(l,p,r.localize,d)}).join("")}function Ry(t){const e=t.match(Oy);return e?e[1].replace(zy,"'"):t}const vy={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"}},Ly=(t,e,n)=>{let a;const r=vy[t];return typeof r=="string"?a=r:e===1?a=r.one:a=r.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+a:a+" yang lalu":a},Iy={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},jy={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},Wy={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hy={date:Mn({formats:Iy,defaultWidth:"full"}),time:Mn({formats:jy,defaultWidth:"full"}),dateTime:Mn({formats:Wy,defaultWidth:"full"})},qy={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},Uy=(t,e,n,a)=>qy[t],Yy={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},Gy={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},Ky={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"]},Xy={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"]},Jy={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"}},Qy={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"}},Zy={ordinalNumber:(t,e)=>"ke-"+Number(t),era:yt({values:Yy,defaultWidth:"wide"}),quarter:yt({values:Gy,defaultWidth:"wide",argumentCallback:t=>t-1}),month:yt({values:Ky,defaultWidth:"wide"}),day:yt({values:Xy,defaultWidth:"wide"}),dayPeriod:yt({values:Jy,defaultWidth:"wide",formattingValues:Qy,defaultFormattingWidth:"wide"})},ex=/^ke-(\d+)?/i,tx=/\d+/i,nx={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},ox={any:[/^s/i,/^(m|e)/i]},ax={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},rx={any:[/1/i,/2/i,/3/i,/4/i]},sx={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},ix={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]},lx={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},cx={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]},dx={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},ux={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}},fx={ordinalNumber:Ec({matchPattern:ex,parsePattern:tx,valueCallback:t=>parseInt(t,10)}),era:xt({matchPatterns:nx,defaultMatchWidth:"wide",parsePatterns:ox,defaultParseWidth:"any"}),quarter:xt({matchPatterns:ax,defaultMatchWidth:"wide",parsePatterns:rx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:xt({matchPatterns:sx,defaultMatchWidth:"wide",parsePatterns:ix,defaultParseWidth:"any"}),day:xt({matchPatterns:lx,defaultMatchWidth:"wide",parsePatterns:cx,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:dx,defaultMatchWidth:"any",parsePatterns:ux,defaultParseWidth:"any"})},hx={code:"id",formatDistance:Ly,formatLong:Hy,formatRelative:Uy,localize:Zy,match:fx,options:{weekStartsOn:1,firstWeekContainsDate:1}},Oc={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)"}}},zc="dcode-dp-theme-forced";function mx(t,e=zc){const n=Oc[t]??Oc.primary,a=`
18
+ `):t}function Q0(t,e){const{element:n,datasetIndex:a,index:r}=e,s=t.getDatasetMeta(a).controller,{label:i,value:l}=s.getLabelAndValue(r);return{chart:t,label:i,parsed:s.getParsed(r),raw:t.data.datasets[a].data[r],formattedValue:l,dataset:s.getDataset(),dataIndex:r,datasetIndex:a,element:n}}function ac(t,e){const n=t.chart.ctx,{body:a,footer:r,title:s}=t,{boxWidth:i,boxHeight:l}=e,c=He(e.bodyFont),d=He(e.titleFont),u=He(e.footerFont),f=s.length,h=r.length,m=a.length,b=tt(e.padding);let p=b.height,g=0,y=a.reduce((M,S)=>M+S.before.length+S.lines.length+S.after.length,0);if(y+=t.beforeBody.length+t.afterBody.length,f&&(p+=f*d.lineHeight+(f-1)*e.titleSpacing+e.titleMarginBottom),y){const M=e.displayColors?Math.max(l,c.lineHeight):c.lineHeight;p+=m*M+(y-m)*c.lineHeight+(y-1)*e.bodySpacing}h&&(p+=e.footerMarginTop+h*u.lineHeight+(h-1)*e.footerSpacing);let B=0;const D=function(M){g=Math.max(g,n.measureText(M).width+B)};return n.save(),n.font=d.string,Se(t.title,D),n.font=c.string,Se(t.beforeBody.concat(t.afterBody),D),B=e.displayColors?i+2+e.boxPadding:0,Se(a,M=>{Se(M.before,D),Se(M.lines,D),Se(M.after,D)}),B=0,n.font=u.string,Se(t.footer,D),n.restore(),g+=b.width,{width:g,height:p}}function Z0(t,e){const{y:n,height:a}=e;return n<a/2?"top":n>t.height-a/2?"bottom":"center"}function eb(t,e,n,a){const{x:r,width:s}=a,i=n.caretSize+n.caretPadding;if(t==="left"&&r+s+i>e.width||t==="right"&&r-s-i<0)return!0}function tb(t,e,n,a){const{x:r,width:s}=n,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return a==="center"?d=r<=(l+c)/2?"left":"right":r<=s/2?d="left":r>=i-s/2&&(d="right"),eb(d,t,e,n)&&(d="center"),d}function rc(t,e,n){const a=n.yAlign||e.yAlign||Z0(t,n);return{xAlign:n.xAlign||e.xAlign||tb(t,e,n,a),yAlign:a}}function nb(t,e){let{x:n,width:a}=t;return e==="right"?n-=a:e==="center"&&(n-=a/2),n}function ob(t,e,n){let{y:a,height:r}=t;return e==="top"?a+=n:e==="bottom"?a-=r+n:a-=r/2,a}function sc(t,e,n,a){const{caretSize:r,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=n,d=r+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=_n(i);let b=nb(e,l);const p=ob(e,c,d);return c==="center"?l==="left"?b+=d:l==="right"&&(b-=d):l==="left"?b-=Math.max(u,h)+r:l==="right"&&(b+=Math.max(f,m)+r),{x:je(b,0,a.width-e.width),y:je(p,0,a.height-e.height)}}function ca(t,e,n){const a=tt(n.padding);return e==="center"?t.x+t.width/2:e==="right"?t.x+t.width-a.right:t.x+a.left}function ic(t){return bt([],Nt(t))}function ab(t,e,n){return cn(t,{tooltip:e,tooltipItems:n,type:"tooltip"})}function lc(t,e){const n=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return n?t.override(n):t}const cc={beforeTitle:Bt,title(t){if(t.length>0){const e=t[0],n=e.chart.data.labels,a=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(a>0&&e.dataIndex<a)return n[e.dataIndex]}return""},afterTitle:Bt,beforeBody:Bt,beforeLabel:Bt,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let e=t.dataset.label||"";e&&(e+=": ");const n=t.formattedValue;return Be(n)||(e+=n),e},labelColor(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const n=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Bt,afterBody:Bt,beforeFooter:Bt,footer:Bt,afterFooter:Bt};function Ye(t,e,n,a){const r=t[e].call(n,a);return typeof r>"u"?cc[e].call(n,a):r}class Rr extends Vt{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const n=this.chart,a=this.options.setContext(this.getContext()),r=a.enabled&&n.options.animation&&a.animations,s=new al(this.chart,r);return r._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=ab(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,n){const{callbacks:a}=n,r=Ye(a,"beforeTitle",this,e),s=Ye(a,"title",this,e),i=Ye(a,"afterTitle",this,e);let l=[];return l=bt(l,Nt(r)),l=bt(l,Nt(s)),l=bt(l,Nt(i)),l}getBeforeBody(e,n){return ic(Ye(n.callbacks,"beforeBody",this,e))}getBody(e,n){const{callbacks:a}=n,r=[];return Se(e,s=>{const i={before:[],lines:[],after:[]},l=lc(a,s);bt(i.before,Nt(Ye(l,"beforeLabel",this,s))),bt(i.lines,Ye(l,"label",this,s)),bt(i.after,Nt(Ye(l,"afterLabel",this,s))),r.push(i)}),r}getAfterBody(e,n){return ic(Ye(n.callbacks,"afterBody",this,e))}getFooter(e,n){const{callbacks:a}=n,r=Ye(a,"beforeFooter",this,e),s=Ye(a,"footer",this,e),i=Ye(a,"afterFooter",this,e);let l=[];return l=bt(l,Nt(r)),l=bt(l,Nt(s)),l=bt(l,Nt(i)),l}_createItems(e){const n=this._active,a=this.chart.data,r=[],s=[],i=[];let l=[],c,d;for(c=0,d=n.length;c<d;++c)l.push(Q0(this.chart,n[c]));return e.filter&&(l=l.filter((u,f,h)=>e.filter(u,f,h,a))),e.itemSort&&(l=l.sort((u,f)=>e.itemSort(u,f,a))),Se(l,u=>{const f=lc(e.callbacks,u);r.push(Ye(f,"labelColor",this,u)),s.push(Ye(f,"labelPointStyle",this,u)),i.push(Ye(f,"labelTextColor",this,u))}),this.labelColors=r,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(e,n){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=ho[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=ac(this,a),d=Object.assign({},l,c),u=rc(this.chart,a,d),f=sc(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),e&&a.external&&a.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(e,n,a,r){const s=this.getCaretPosition(e,a,r);n.lineTo(s.x1,s.y1),n.lineTo(s.x2,s.y2),n.lineTo(s.x3,s.y3)}getCaretPosition(e,n,a){const{xAlign:r,yAlign:s}=this,{caretSize:i,cornerRadius:l}=a,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=_n(l),{x:h,y:m}=e,{width:b,height:p}=n;let g,y,B,D,M,S;return s==="center"?(M=m+p/2,r==="left"?(g=h,y=g-i,D=M+i,S=M-i):(g=h+b,y=g+i,D=M-i,S=M+i),B=g):(r==="left"?y=h+Math.max(c,u)+i:r==="right"?y=h+b-Math.max(d,f)-i:y=this.caretX,s==="top"?(D=m,M=D-i,g=y-i,B=y+i):(D=m+p,M=D+i,g=y+i,B=y-i),S=D),{x1:g,x2:y,x3:B,y1:D,y2:M,y3:S}}drawTitle(e,n,a){const r=this.title,s=r.length;let i,l,c;if(s){const d=Sn(a.rtl,this.x,this.width);for(e.x=ca(this,a.titleAlign,a),n.textAlign=d.textAlign(a.titleAlign),n.textBaseline="middle",i=He(a.titleFont),l=a.titleSpacing,n.fillStyle=a.titleColor,n.font=i.string,c=0;c<s;++c)n.fillText(r[c],d.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+l,c+1===s&&(e.y+=a.titleMarginBottom-l)}}_drawColorBox(e,n,a,r,s){const i=this.labelColors[a],l=this.labelPointStyles[a],{boxHeight:c,boxWidth:d}=s,u=He(s.bodyFont),f=ca(this,"left",s),h=r.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,b=n.y+m;if(s.usePointStyle){const p={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},g=r.leftForLtr(h,d)+d/2,y=b+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,mr(e,p,g,y),e.strokeStyle=i.borderColor,e.fillStyle=i.backgroundColor,mr(e,p,g,y)}else{e.lineWidth=we(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,e.strokeStyle=i.borderColor,e.setLineDash(i.borderDash||[]),e.lineDashOffset=i.borderDashOffset||0;const p=r.leftForLtr(h,d),g=r.leftForLtr(r.xPlus(h,1),d-2),y=_n(i.borderRadius);Object.values(y).some(B=>B!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,Wo(e,{x:p,y:b,w:d,h:c,radius:y}),e.fill(),e.stroke(),e.fillStyle=i.backgroundColor,e.beginPath(),Wo(e,{x:g,y:b+1,w:d-2,h:c-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(p,b,d,c),e.strokeRect(p,b,d,c),e.fillStyle=i.backgroundColor,e.fillRect(g,b+1,d-2,c-2))}e.fillStyle=this.labelTextColors[a]}drawBody(e,n,a){const{body:r}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=a,f=He(a.bodyFont);let h=f.lineHeight,m=0;const b=Sn(a.rtl,this.x,this.width),p=function(x){n.fillText(x,b.x(e.x+m),e.y+h/2),e.y+=h+s},g=b.textAlign(i);let y,B,D,M,S,k,C;for(n.textAlign=i,n.textBaseline="middle",n.font=f.string,e.x=ca(this,g,a),n.fillStyle=a.bodyColor,Se(this.beforeBody,p),m=l&&g!=="right"?i==="center"?d/2+u:d+2+u:0,M=0,k=r.length;M<k;++M){for(y=r[M],B=this.labelTextColors[M],n.fillStyle=B,Se(y.before,p),D=y.lines,l&&D.length&&(this._drawColorBox(n,e,M,b,a),h=Math.max(f.lineHeight,c)),S=0,C=D.length;S<C;++S)p(D[S]),h=f.lineHeight;Se(y.after,p)}m=0,h=f.lineHeight,Se(this.afterBody,p),e.y-=s}drawFooter(e,n,a){const r=this.footer,s=r.length;let i,l;if(s){const c=Sn(a.rtl,this.x,this.width);for(e.x=ca(this,a.footerAlign,a),e.y+=a.footerMarginTop,n.textAlign=c.textAlign(a.footerAlign),n.textBaseline="middle",i=He(a.footerFont),n.fillStyle=a.footerColor,n.font=i.string,l=0;l<s;++l)n.fillText(r[l],c.x(e.x),e.y+i.lineHeight/2),e.y+=i.lineHeight+a.footerSpacing}}drawBackground(e,n,a,r){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=e,{width:d,height:u}=a,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:b}=_n(r.cornerRadius);n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,n.lineWidth=r.borderWidth,n.beginPath(),n.moveTo(l+f,c),i==="top"&&this.drawCaret(e,n,a,r),n.lineTo(l+d-h,c),n.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(e,n,a,r),n.lineTo(l+d,c+u-b),n.quadraticCurveTo(l+d,c+u,l+d-b,c+u),i==="bottom"&&this.drawCaret(e,n,a,r),n.lineTo(l+m,c+u),n.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(e,n,a,r),n.lineTo(l,c+f),n.quadraticCurveTo(l,c,l+f,c),n.closePath(),n.fill(),r.borderWidth>0&&n.stroke()}_updateAnimationTarget(e){const n=this.chart,a=this.$animations,r=a&&a.x,s=a&&a.y;if(r||s){const i=ho[e.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=ac(this,e),c=Object.assign({},i,this._size),d=rc(n,e,c),u=sc(e,c,d,n);(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(e){const n=this.options.setContext(this.getContext());let a=this.opacity;if(!a)return;this._updateAnimationTarget(n);const r={width:this.width,height:this.height},s={x:this.x,y:this.y};a=Math.abs(a)<.001?0:a;const i=tt(n.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&l&&(e.save(),e.globalAlpha=a,this.drawBackground(s,e,r,n),Gi(e,n.textDirection),s.y+=i.top,this.drawTitle(s,e,n),this.drawBody(s,e,n),this.drawFooter(s,e,n),Ki(e,n.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,n){const a=this._active,r=e.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=!Fo(a,r),i=this._positionChanged(r,n);(s||i)&&(this._active=r,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,n,a=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const r=this.options,s=this._active||[],i=this._getActiveElements(e,s,n,a),l=this._positionChanged(i,e),c=n||!Fo(i,s)||l;return c&&(this._active=i,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,n))),c}_getActiveElements(e,n,a,r){const s=this.options;if(e.type==="mouseout")return[];if(!r)return n.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(e,s.mode,s,a);return s.reverse&&i.reverse(),i}_positionChanged(e,n){const{caretX:a,caretY:r,options:s}=this,i=ho[s.position].call(this,e,n);return i!==!1&&(a!==i.x||r!==i.y)}}ie(Rr,"positioners",ho);var rb={id:"tooltip",_element:Rr,positioners:ho,afterInit(t,e,n){n&&(t.tooltip=new Rr({chart:t,options:n}))},beforeUpdate(t,e,n){t.tooltip&&t.tooltip.initialize(n)},reset(t,e,n){t.tooltip&&t.tooltip.initialize(n)},afterDraw(t){const e=t.tooltip;if(e&&e._willRender()){const n={tooltip:e};if(t.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",n)}},afterEvent(t,e){if(t.tooltip){const n=e.replay;t.tooltip.handleEvent(e.event,n,e.inChartArea)&&(e.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,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.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:cc},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 sb=(t,e,n,a)=>(typeof e=="string"?(n=t.push(e)-1,a.unshift({index:n,label:e})):isNaN(e)&&(n=null),n);function ib(t,e,n,a){const r=t.indexOf(e);if(r===-1)return sb(t,e,n,a);const s=t.lastIndexOf(e);return r!==s?n:r}const lb=(t,e)=>t===null?null:je(Math.round(t),0,e);function dc(t){const e=this.getLabels();return t>=0&&t<e.length?e[t]:t}class vr extends Dn{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const n=this._addedLabels;if(n.length){const a=this.getLabels();for(const{index:r,label:s}of n)a[r]===s&&a.splice(r,1);this._addedLabels=[]}super.init(e)}parse(e,n){if(Be(e))return null;const a=this.getLabels();return n=isFinite(n)&&a[n]===e?n:ib(a,e,ye(n,e),this._addedLabels),lb(n,a.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:a,max:r}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(a=0),n||(r=this.getLabels().length-1)),this.min=a,this.max=r}buildTicks(){const e=this.min,n=this.max,a=this.options.offset,r=[];let s=this.getLabels();s=e===0&&n===s.length-1?s:s.slice(e,n+1),this._valueRange=Math.max(s.length-(a?0:1),1),this._startValue=this.min-(a?.5:0);for(let i=e;i<=n;i++)r.push({value:i});return r}getLabelForValue(e){return dc.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const n=this.ticks;return e<0||e>n.length-1?null:this.getPixelForValue(n[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}ie(vr,"id","category"),ie(vr,"defaults",{ticks:{callback:dc}});function cb(t,e){const n=[],{bounds:r,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,b=u-1,{min:p,max:g}=e,y=!Be(i),B=!Be(l),D=!Be(d),M=(g-p)/(f+1);let S=_i((g-p)/b/m)*m,k,C,x,w;if(S<1e-14&&!y&&!B)return[{value:p},{value:g}];w=Math.ceil(g/S)-Math.floor(p/S),w>b&&(S=_i(w*S/b/m)*m),Be(c)||(k=Math.pow(10,c),S=Math.ceil(S*k)/k),r==="ticks"?(C=Math.floor(p/S)*S,x=Math.ceil(g/S)*S):(C=p,x=g),y&&B&&s&&fm((l-i)/s,S/1e3)?(w=Math.round(Math.min((l-i)/S,u)),S=(l-i)/w,C=i,x=l):D?(C=y?i:C,x=B?l:x,w=d-1,S=(x-C)/w):(w=(x-C)/S,Jn(w,Math.round(w),S/1e3)?w=Math.round(w):w=Math.ceil(w));const E=Math.max(Ci(S),Ci(C));k=Math.pow(10,Be(c)?E:c),C=Math.round(C*k)/k,x=Math.round(x*k)/k;let A=0;for(y&&(h&&C!==i?(n.push({value:i}),C<i&&A++,Jn(Math.round((C+A*S)*k)/k,i,uc(i,M,t))&&A++):C<i&&A++);A<w;++A){const T=Math.round((C+A*S)*k)/k;if(B&&T>l)break;n.push({value:T})}return B&&h&&x!==l?n.length&&Jn(n[n.length-1].value,l,uc(l,M,t))?n[n.length-1].value=l:n.push({value:l}):(!B||x===l)&&n.push({value:x}),n}function uc(t,e,{horizontal:n,minRotation:a}){const r=St(a),s=(n?Math.sin(r):Math.cos(r))||.001,i=.75*e*(""+t).length;return Math.min(e/s,i)}class db extends Dn{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,n){return Be(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:n,maxDefined:a}=this.getUserBounds();let{min:r,max:s}=this;const i=c=>r=n?r:c,l=c=>s=a?s:c;if(e){const c=pt(r),d=pt(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),e||i(r-c)}this.min=r,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:n,stepSize:a}=e,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(),n=n||11),n&&(r=Math.min(n,r)),r}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,n=e.ticks;let a=this.getTickLimit();a=Math.max(2,a);const r={maxTicks:a,bounds:e.bounds,min:e.min,max:e.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},s=this._range||this,i=cb(r,s);return e.bounds==="ticks"&&hm(i,this,"value"),e.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const e=this.ticks;let n=this.min,a=this.max;if(super.configure(),this.options.offset&&e.length){const r=(a-n)/Math.max(e.length-1,1)/2;n-=r,a+=r}this._startValue=n,this._endValue=a,this._valueRange=a-n}getLabelForValue(e){return ur(e,this.chart.options.locale,this.options.ticks.format)}}class Lr extends db{determineDataLimits(){const{min:e,max:n}=this.getMinMax(!0);this.min=Ie(e)?e:0,this.max=Ie(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),n=e?this.width:this.height,a=St(this.options.ticks.minRotation),r=(e?Math.sin(a):Math.cos(a))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,s.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}ie(Lr,"id","linear"),ie(Lr,"defaults",{ticks:{callback:Ti.formatters.numeric}});const da={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}},Ge=Object.keys(da);function fc(t,e){return t-e}function hc(t,e){if(Be(e))return null;const n=t._adapter,{parser:a,round:r,isoWeekday:s}=t._parseOpts;let i=e;return typeof a=="function"&&(i=a(i)),Ie(i)||(i=typeof a=="string"?n.parse(i,a):n.parse(i)),i===null?null:(r&&(i=r==="week"&&(Qn(s)||s===!0)?n.startOf(i,"isoWeek",s):n.startOf(i,r)),+i)}function mc(t,e,n,a){const r=Ge.length;for(let s=Ge.indexOf(t);s<r-1;++s){const i=da[Ge[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((n-e)/(l*i.size))<=a)return Ge[s]}return Ge[r-1]}function ub(t,e,n,a,r){for(let s=Ge.length-1;s>=Ge.indexOf(n);s--){const i=Ge[s];if(da[i].common&&t._adapter.diff(r,a,i)>=e-1)return i}return Ge[n?Ge.indexOf(n):0]}function fb(t){for(let e=Ge.indexOf(t)+1,n=Ge.length;e<n;++e)if(da[Ge[e]].common)return Ge[e]}function pc(t,e,n){if(!n)t[e]=!0;else if(n.length){const{lo:a,hi:r}=ir(n,e),s=n[a]>=e?n[a]:n[r];t[s]=!0}}function hb(t,e,n,a){const r=t._adapter,s=+r.startOf(e[0].value,a),i=e[e.length-1].value;let l,c;for(l=s;l<=i;l=+r.add(l,1,a))c=n[l],c>=0&&(e[c].major=!0);return e}function gc(t,e,n){const a=[],r={},s=e.length;let i,l;for(i=0;i<s;++i)l=e[i],r[l]=i,a.push({value:l,major:!1});return s===0||!n?a:hb(t,a,r,n)}class ua extends Dn{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,n={}){const a=e.time||(e.time={}),r=this._adapter=new Kp._date(e.adapters.date);r.init(n),Kn(a.displayFormats,r.formats()),this._parseOpts={parser:a.parser,round:a.round,isoWeekday:a.isoWeekday},super.init(e),this._normalized=n.normalized}parse(e,n){return e===void 0?null:hc(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,n=this._adapter,a=e.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()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),r=Ie(r)&&!isNaN(r)?r:+n.startOf(Date.now(),a),s=Ie(s)&&!isNaN(s)?s:+n.endOf(Date.now(),a)+1,this.min=Math.min(r,s-1),this.max=Math.max(r+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return e.length&&(n=e[0],a=e[e.length-1]),{min:n,max:a}}buildTicks(){const e=this.options,n=e.time,a=e.ticks,r=a.source==="labels"?this.getLabelTimestamps():this._generate();e.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=ym(r,s,i);return this._unit=n.unit||(a.autoSkip?mc(n.minUnit,this.min,this.max,this._getLabelCapacity(s)):ub(this,l.length,n.minUnit,this.min,this.max)),this._majorUnit=!a.major.enabled||this._unit==="year"?void 0:fb(this._unit),this.initOffsets(r),e.reverse&&l.reverse(),gc(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let n=0,a=0,r,s;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),e.length===1?n=1-r:n=(this.getDecimalForValue(e[1])-r)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?a=s:a=(s-this.getDecimalForValue(e[e.length-2]))/2);const i=e.length<3?.5:.25;n=je(n,0,i),a=je(a,0,i),this._offsets={start:n,end:a,factor:1/(n+1+a)}}_generate(){const e=this._adapter,n=this.min,a=this.max,r=this.options,s=r.time,i=s.unit||mc(s.minUnit,n,a,this._getLabelCapacity(n)),l=ye(r.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Qn(c)||c===!0,u={};let f=n,h,m;if(d&&(f=+e.startOf(f,"isoWeek",c)),f=+e.startOf(f,d?"day":i),e.diff(a,n,i)>1e5*l)throw new Error(n+" and "+a+" are too far apart with stepSize of "+l+" "+i);const b=r.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<a;h=+e.add(h,l,i),m++)pc(u,h,b);return(h===a||r.bounds==="ticks"||m===1)&&pc(u,h,b),Object.keys(u).sort(fc).map(p=>+p)}getLabelForValue(e){const n=this._adapter,a=this.options.time;return a.tooltipFormat?n.format(e,a.tooltipFormat):n.format(e,a.displayFormats.datetime)}format(e,n){const r=this.options.time.displayFormats,s=this._unit,i=n||r[s];return this._adapter.format(e,i)}_tickFormatFunction(e,n,a,r){const s=this.options,i=s.ticks.callback;if(i)return Me(i,[e,n,a],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=a[n],m=d&&f&&h&&h.major;return this._adapter.format(e,r||(m?f:u))}generateTickLabels(e){let n,a,r;for(n=0,a=e.length;n<a;++n)r=e[n],r.label=this._tickFormatFunction(r.value,n,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const n=this._offsets,a=this.getDecimalForValue(e);return this.getPixelForDecimal((n.start+a)*n.factor)}getValueForPixel(e){const n=this._offsets,a=this.getDecimalForPixel(e)/n.factor-n.end;return this.min+a*(this.max-this.min)}_getLabelSize(e){const n=this.options.ticks,a=this.ctx.measureText(e).width,r=St(this.isHorizontal()?n.maxRotation:n.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(e){const n=this.options.time,a=n.displayFormats,r=a[n.unit]||a.millisecond,s=this._tickFormatFunction(e,0,gc(this,[e],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 e=this._cache.data||[],n,a;if(e.length)return e;const r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(n=0,a=r.length;n<a;++n)e=e.concat(r[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let n,a;if(e.length)return e;const r=this.getLabels();for(n=0,a=r.length;n<a;++n)e.push(hc(this,r[n]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Di(e.sort(fc))}}ie(ua,"id","time"),ie(ua,"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 fa(t,e,n){let a=0,r=t.length-1,s,i,l,c;n?(e>=t[a].pos&&e<=t[r].pos&&({lo:a,hi:r}=rn(t,"pos",e)),{pos:s,time:l}=t[a],{pos:i,time:c}=t[r]):(e>=t[a].time&&e<=t[r].time&&({lo:a,hi:r}=rn(t,"time",e)),{time:s,pos:l}=t[a],{time:i,pos:c}=t[r]);const d=i-s;return d?l+(c-l)*(e-s)/d:l}class bc extends ua{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(e);this._minPos=fa(n,this.min),this._tableRange=fa(n,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:n,max:a}=this,r=[],s=[];let i,l,c,d,u;for(i=0,l=e.length;i<l;++i)d=e[i],d>=n&&d<=a&&r.push(d);if(r.length<2)return[{time:n,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 e=this.min,n=this.max;let a=super.getDataTimestamps();return(!a.includes(e)||!a.length)&&a.splice(0,0,e),(!a.includes(n)||a.length===1)&&a.push(n),a.sort((r,s)=>r-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const n=this.getDataTimestamps(),a=this.getLabelTimestamps();return n.length&&a.length?e=this.normalize(n.concat(a)):e=n.length?n:a,e=this._cache.all=e,e}getDecimalForValue(e){return(fa(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const n=this._offsets,a=this.getDecimalForPixel(e)/n.factor-n.end;return fa(this._table,a*this._tableRange+this._minPos,!0)}}ie(bc,"id","timeseries"),ie(bc,"defaults",ua.defaults);const mb={key:0,class:"mb-2 text-sm font-medium text-gray-700"},pb={key:0,class:"text-red-500 ml-1"},gb={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},bb={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},yb={class:"text-red-600 text-sm"},xb={key:1,class:"mt-2 text-xs text-gray-500"},kb={key:0},yc=Hn(o.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:e,emit:n}){Mt.register(vr,Lr,sa,qt,ia,fo,J0,rb,K0,W0,Xo,Ko,Sr,En);const a=t,r=n,s=o.ref(null),i=o.ref(null),l=o.computed(()=>({"opacity-50 pointer-events-none":a.loading||a.error})),c=()=>{const f=a.theme==="dark";return{responsive:a.responsive,maintainAspectRatio:a.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:h=>{let m=0;return h.type==="data"&&h.mode==="default"&&(m=h.dataIndex*100+h.datasetIndex*50),m},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:f?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:f?"#1F2937":"#FFFFFF",titleColor:f?"#F3F4F6":"#111827",bodyColor:f?"#D1D5DB":"#4B5563",borderColor:f?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:a.type!=="pie"&&a.type!=="doughnut"&&a.type!=="polarArea"?{x:{grid:{color:f?"#374151":"#E5E7EB"},ticks:{color:f?"#D1D5DB":"#6B7280"}},y:{grid:{color:f?"#374151":"#E5E7EB"},ticks:{color:f?"#D1D5DB":"#6B7280"}}}:void 0}},d=f=>!f||!f.datasets?f:{...f,datasets:f.datasets.map((h,m)=>({...h,borderColor:h.borderColor||a.colors[m%a.colors.length],backgroundColor:h.backgroundColor||a.colors[m%a.colors.length]+"20",pointBackgroundColor:h.pointBackgroundColor||a.colors[m%a.colors.length],pointBorderColor:h.pointBorderColor||a.colors[m%a.colors.length],hoverBackgroundColor:h.hoverBackgroundColor||a.colors[m%a.colors.length]+"40",hoverBorderColor:h.hoverBorderColor||a.colors[m%a.colors.length]}))},u=async()=>{if(!s.value)return;await o.nextTick(),i.value&&i.value.destroy();const f=d(a.data||a.modelValue);if(!f)return;const h={...c(),...a.options};i.value=new Mt(s.value,{type:a.type,data:f,options:h,onClick:(m,b)=>{r("click",m,b),a.onClick&&a.onClick(m,b)},onHover:(m,b)=>{r("hover",m,b),a.onHover&&a.onHover(m,b)}}),r("ready",i.value)};return o.watch(()=>[a.data,a.modelValue,a.type,a.options,a.theme],()=>{u()},{deep:!0}),o.watch(()=>[a.width,a.height],()=>{i.value&&i.value.resize()}),o.onMounted(()=>{u()}),o.onUnmounted(()=>{i.value&&i.value.destroy()}),e({chart:i,updateChart:u}),(f,h)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["d-code-chart",l.value])},[t.label?(o.openBlock(),o.createElementBlock("div",mb,[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",pb,"*")):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"relative",style:o.normalizeStyle({height:t.height+"px"})},[o.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(o.openBlock(),o.createElementBlock("div",gb,[...h[0]||(h[0]=[o.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):o.createCommentVNode("",!0),t.error?(o.openBlock(),o.createElementBlock("div",bb,[o.createElementVNode("div",yb,o.toDisplayString(t.error),1)])):o.createCommentVNode("",!0)],4),t.showInfo&&f.chartData?(o.openBlock(),o.createElementBlock("div",xb,[f.chartData.datasets?(o.openBlock(),o.createElementBlock("div",kb,o.toDisplayString(f.chartData.datasets.length)+" dataset(s) • "+o.toDisplayString(f.chartData.labels?f.chartData.labels.length:0)+" data points ",1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-5b6eaeb4"]]),Pt=o.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.Label),o.mergeProps(o.unref(n),{class:o.unref(de)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),wb=["aria-busy"],_b={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Cb={key:1,class:"flex items-center gap-2.5"},Bb=["id","checked","indeterminate","disabled","required"],Sb={key:0,class:"ml-1 text-red-500 dark:text-red-400","aria-label":"required"},mo=Hn(o.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{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:e}){const n=o.useAttrs(),a=e,r=t,s=o.computed(()=>n.label),i=o.computed(()=>n.placeholder),l=o.computed(()=>n.title),c=o.computed(()=>r.visible??!0),d=o.computed(()=>n.required===""||n.required===!0||n.required==="true"),u=Math.random().toString(36).slice(2,7),f=o.computed(()=>`dcode-checkbox-${n.id||s.value||"checkbox"}-${u}`),h=o.ref(!!r.modelValue);o.watch(()=>r.modelValue,p=>{h.value=!!p},{immediate:!0});const m=()=>{if(r.disabled)return;const p=!h.value;h.value=p,a("update:modelValue",p)},b=p=>{(p.key===" "||p.key==="Enter")&&(p.preventDefault(),m())};return(p,g)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["",[o.unref(n).class,{"opacity-60 cursor-not-allowed":t.disabled}]]),"aria-busy":t.skeleton},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",_b)):o.createCommentVNode("",!0),g[0]||(g[0]=o.createElementVNode("div",{class:"flex items-center gap-2.5"},[o.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),o.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(o.openBlock(),o.createElementBlock("div",Cb,[o.createElementVNode("label",{class:o.normalizeClass(["flex items-start gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[o.createElementVNode("input",{type:"checkbox",id:f.value,class:"sr-only",checked:h.value,indeterminate:t.indeterminate,disabled:t.disabled,required:d.value,onChange:m,onKeydown:b},null,40,Bb),o.createElementVNode("div",{class:o.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-colors flex items-center justify-center mt-0.5",[h.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-900",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[h.value&&!t.indeterminate?(o.openBlock(),o.createBlock(o.unref(ne.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(o.openBlock(),o.createBlock(o.unref(ne.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):o.createCommentVNode("",!0)],2),i.value||l.value?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.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"]])},o.toDisplayString(i.value||l.value),3)):o.createCommentVNode("",!0)],2),s.value?(o.openBlock(),o.createBlock(Pt,{key:0,for:f.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300 select-none cursor-pointer"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.value)+" ",1),d.value?(o.openBlock(),o.createElementBlock("span",Sb," * ")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0)]))],10,wb)),[[o.vShow,c.value]])}}),[["__scopeId","data-v-938d0f92"]]),Eb=["aria-busy"],Db={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Vb={key:1,class:"flex justify-end"},Mb={key:0,class:"ml-1 text-destructive"},Nb={class:"relative w-full group"},Pb={class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none"},Ab={class:"font-medium text-xs mr-1"},$b=["id","disabled","readonly","placeholder","maxlength"],Tb={key:0,class:"absolute inset-y-0 right-3 flex items-center"},Ob={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"},zb={key:1,class:"text-xs text-destructive"},xc=o.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:e}){const n=o.useAttrs(),a=e,r=t,s=Math.random().toString(36).slice(2,7),i=o.computed(()=>`app-currency-field-${n.id||r.label||"currency-field"}-${s}`),l=o.computed(()=>{const x=n.required,w=n["aria-required"];return x===""||x===!0||x==="true"||(w==="true"||w===!0)}),c=o.computed(()=>{const x=n.maxlength??n.maxLength;let w=Number.NaN;return typeof x=="number"?w=x:typeof x=="string"&&(w=Number.parseInt(x,10)),Number.isFinite(w)&&w>0?w:void 0}),d=o.computed(()=>r.locale?r.locale:"en-US"),u=o.computed(()=>r.prependInner?r.prependInner:r.currency==="USD"?"$":r.currency==="IDR"?"Rp":r.currency),f=o.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=x=>{const w=x.replaceAll(/\D/g,"");return w?Number(w):null},m=x=>f.value.format(x),b=o.ref("");o.watch(()=>r.modelValue,x=>{x==null?b.value="":h(b.value)!==x&&(b.value=m(x))},{immediate:!0});const p=x=>{const w=b.value,E=h(w);if(E===null){b.value!==""&&(b.value=""),a("update:modelValue",null);return}const A=m(E);w!==A&&(b.value=A),a("update:modelValue",E)},g=()=>{b.value="",a("update:modelValue",null),a("clear")},y=o.computed(()=>!r.clearable||r.disabled||r.readonly?!1:r.hideClearWhenEmpty?b.value.length>0:!0),B=o.computed(()=>!!r.error),D=o.computed(()=>{const{class:x,maxlength:w,maxLength:E,...A}=n;return A}),M=o.computed(()=>b.value.length),S=o.computed(()=>r.showCharCount?(c.value??0)>0:!1),k=o.computed(()=>S.value&&M.value>0),C=o.computed(()=>`${M.value} / ${c.value}`);return(x,w)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.label?(o.openBlock(),o.createElementBlock("div",Db)):o.createCommentVNode("",!0),w[2]||(w[2]=o.createElementVNode("div",{class:"relative w-full"},[o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),S.value?(o.openBlock(),o.createElementBlock("div",Vb,[...w[1]||(w[1]=[o.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:i.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",Mb,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",Nb,[o.createElementVNode("div",Pb,[o.createElementVNode("span",Ab,o.toDisplayString(u.value),1)]),o.withDirectives(o.createElementVNode("input",o.mergeProps({id:i.value,"onUpdate:modelValue":w[0]||(w[0]=E=>b.value=E),onInput:p,type:"text",inputmode:"numeric"},D.value,{disabled:r.disabled,readonly:r.readonly,placeholder:r.placeholder,maxlength:c.value,class:["w-full h-10 flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-sm text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-within:ring-1 focus-within:ring-white","pl-10",y.value?"pr-10":"",B.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px] outline-none":"outline-none"]}),null,16,$b),[[o.vModelText,b.value]]),y.value?(o.openBlock(),o.createElementBlock("div",Tb,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:g}," ✕ ")])):o.createCommentVNode("",!0),k.value&&!B.value?(o.openBlock(),o.createElementBlock("p",Ob,o.toDisplayString(C.value),1)):o.createCommentVNode("",!0)]),B.value?(o.openBlock(),o.createElementBlock("p",zb,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,Eb))}}),pn=o.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,r=ke.useVModel(n,"modelValue",a,{passive:!0,defaultValue:n.defaultValue});return(s,i)=>o.withDirectives((o.openBlock(),o.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>o.isRef(r)?r.value=l:null),class:o.normalizeClass(o.unref(de)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n.class))},null,2)),[[o.vModelText,o.unref(r)]])}}),kc=6048e5,Fb=864e5,wc=Symbol.for("constructDateFrom");function Yt(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&wc in t?t[wc](e):t instanceof Date?new t.constructor(e):new Date(e)}function it(t,e){return Yt(e||t,t)}let Rb={};function ha(){return Rb}function po(t,e){var l,c,d,u;const n=ha(),a=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,r=it(t,e==null?void 0:e.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 ma(t,e){return po(t,{...e,weekStartsOn:1})}function _c(t,e){const n=it(t,e==null?void 0:e.in),a=n.getFullYear(),r=Yt(n,0);r.setFullYear(a+1,0,4),r.setHours(0,0,0,0);const s=ma(r),i=Yt(n,0);i.setFullYear(a,0,4),i.setHours(0,0,0,0);const l=ma(i);return n.getTime()>=s.getTime()?a+1:n.getTime()>=l.getTime()?a:a-1}function Cc(t){const e=it(t),n=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return n.setUTCFullYear(e.getFullYear()),+t-+n}function vb(t,...e){const n=Yt.bind(null,e.find(a=>typeof a=="object"));return e.map(n)}function Bc(t,e){const n=it(t,e==null?void 0:e.in);return n.setHours(0,0,0,0),n}function Lb(t,e,n){const[a,r]=vb(n==null?void 0:n.in,t,e),s=Bc(a),i=Bc(r),l=+s-Cc(s),c=+i-Cc(i);return Math.round((l-c)/Fb)}function Ib(t,e){const n=_c(t,e),a=Yt(t,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),ma(a)}function jb(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Wb(t){return!(!jb(t)&&typeof t!="number"||isNaN(+it(t)))}function Hb(t,e){const n=it(t,e==null?void 0:e.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const qb={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"}},Ub=(t,e,n)=>{let a;const r=qb[t];return typeof r=="string"?a=r:e===1?a=r.one:a=r.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Mn(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const Yb={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Gb={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Kb={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xb={date:Mn({formats:Yb,defaultWidth:"full"}),time:Mn({formats:Gb,defaultWidth:"full"}),dateTime:Mn({formats:Kb,defaultWidth:"full"})},Jb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Qb=(t,e,n,a)=>Jb[t];function yt(t){return(e,n)=>{const a=n!=null&&n.context?String(n.context):"standalone";let r;if(a==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):i;r=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;r=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(e):e;return r[s]}}const Zb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ey={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ty={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"]},ny={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"]},oy={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"}},ay={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"}},ry={ordinalNumber:(t,e)=>{const n=Number(t),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:yt({values:Zb,defaultWidth:"wide"}),quarter:yt({values:ey,defaultWidth:"wide",argumentCallback:t=>t-1}),month:yt({values:ty,defaultWidth:"wide"}),day:yt({values:ny,defaultWidth:"wide"}),dayPeriod:yt({values:oy,defaultWidth:"wide",formattingValues:ay,defaultFormattingWidth:"wide"})};function xt(t){return(e,n={})=>{const a=n.width,r=a&&t.matchPatterns[a]||t.matchPatterns[t.defaultMatchWidth],s=e.match(r);if(!s)return null;const i=s[0],l=a&&t.parsePatterns[a]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?iy(l,f=>f.test(i)):sy(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(i.length);return{value:d,rest:u}}}function sy(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function iy(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Sc(t){return(e,n={})=>{const a=e.match(t.matchPattern);if(!a)return null;const r=a[0],s=e.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=n.valueCallback?n.valueCallback(i):i;const l=e.slice(r.length);return{value:i,rest:l}}}const ly=/^(\d+)(th|st|nd|rd)?/i,cy=/\d+/i,dy={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},uy={any:[/^b/i,/^(a|c)/i]},fy={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},hy={any:[/1/i,/2/i,/3/i,/4/i]},my={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]},gy={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},by={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]},yy={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},xy={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}},ky={ordinalNumber:Sc({matchPattern:ly,parsePattern:cy,valueCallback:t=>parseInt(t,10)}),era:xt({matchPatterns:dy,defaultMatchWidth:"wide",parsePatterns:uy,defaultParseWidth:"any"}),quarter:xt({matchPatterns:fy,defaultMatchWidth:"wide",parsePatterns:hy,defaultParseWidth:"any",valueCallback:t=>t+1}),month:xt({matchPatterns:my,defaultMatchWidth:"wide",parsePatterns:py,defaultParseWidth:"any"}),day:xt({matchPatterns:gy,defaultMatchWidth:"wide",parsePatterns:by,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:yy,defaultMatchWidth:"any",parsePatterns:xy,defaultParseWidth:"any"})},Ec={code:"en-US",formatDistance:Ub,formatLong:Xb,formatRelative:Qb,localize:ry,match:ky,options:{weekStartsOn:0,firstWeekContainsDate:1}};function wy(t,e){const n=it(t,e==null?void 0:e.in);return Lb(n,Hb(n))+1}function _y(t,e){const n=it(t,e==null?void 0:e.in),a=+ma(n)-+Ib(n);return Math.round(a/kc)+1}function Dc(t,e){var u,f,h,m;const n=it(t,e==null?void 0:e.in),a=n.getFullYear(),r=ha(),s=(e==null?void 0:e.firstWeekContainsDate)??((f=(u=e==null?void 0:e.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=Yt((e==null?void 0:e.in)||t,0);i.setFullYear(a+1,0,s),i.setHours(0,0,0,0);const l=po(i,e),c=Yt((e==null?void 0:e.in)||t,0);c.setFullYear(a,0,s),c.setHours(0,0,0,0);const d=po(c,e);return+n>=+l?a+1:+n>=+d?a:a-1}function Cy(t,e){var l,c,d,u;const n=ha(),a=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((u=(d=n.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,r=Dc(t,e),s=Yt((e==null?void 0:e.in)||t,0);return s.setFullYear(r,0,a),s.setHours(0,0,0,0),po(s,e)}function By(t,e){const n=it(t,e==null?void 0:e.in),a=+po(n,e)-+Cy(n,e);return Math.round(a/kc)+1}function De(t,e){const n=t<0?"-":"",a=Math.abs(t).toString().padStart(e,"0");return n+a}const Gt={y(t,e){const n=t.getFullYear(),a=n>0?n:1-n;return De(e==="yy"?a%100:a,e.length)},M(t,e){const n=t.getMonth();return e==="M"?String(n+1):De(n+1,2)},d(t,e){return De(t.getDate(),e.length)},a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(t,e){return De(t.getHours()%12||12,e.length)},H(t,e){return De(t.getHours(),e.length)},m(t,e){return De(t.getMinutes(),e.length)},s(t,e){return De(t.getSeconds(),e.length)},S(t,e){const n=e.length,a=t.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return De(r,e.length)}},Nn={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Vc={G:function(t,e,n){const a=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){const a=t.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return Gt.y(t,e)},Y:function(t,e,n,a){const r=Dc(t,a),s=r>0?r:1-r;if(e==="YY"){const i=s%100;return De(i,2)}return e==="Yo"?n.ordinalNumber(s,{unit:"year"}):De(s,e.length)},R:function(t,e){const n=_c(t);return De(n,e.length)},u:function(t,e){const n=t.getFullYear();return De(n,e.length)},Q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(a);case"QQ":return De(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(t,e,n){const a=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(a);case"qq":return De(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(t,e,n){const a=t.getMonth();switch(e){case"M":case"MM":return Gt.M(t,e);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(t,e,n){const a=t.getMonth();switch(e){case"L":return String(a+1);case"LL":return De(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(t,e,n,a){const r=By(t,a);return e==="wo"?n.ordinalNumber(r,{unit:"week"}):De(r,e.length)},I:function(t,e,n){const a=_y(t);return e==="Io"?n.ordinalNumber(a,{unit:"week"}):De(a,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getDate(),{unit:"date"}):Gt.d(t,e)},D:function(t,e,n){const a=wy(t);return e==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):De(a,e.length)},E:function(t,e,n){const a=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(t,e,n,a){const r=t.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return De(s,2);case"eo":return n.ordinalNumber(s,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,n,a){const r=t.getDay(),s=(r-a.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return De(s,e.length);case"co":return n.ordinalNumber(s,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,n){const a=t.getDay(),r=a===0?7:a;switch(e){case"i":return String(r);case"ii":return De(r,e.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const a=t.getHours();let r;switch(a===12?r=Nn.noon:a===0?r=Nn.midnight:r=a/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){const a=t.getHours();let r;switch(a>=17?r=Nn.evening:a>=12?r=Nn.afternoon:a>=4?r=Nn.morning:r=Nn.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){let a=t.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Gt.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getHours(),{unit:"hour"}):Gt.H(t,e)},K:function(t,e,n){const a=t.getHours()%12;return e==="Ko"?n.ordinalNumber(a,{unit:"hour"}):De(a,e.length)},k:function(t,e,n){let a=t.getHours();return a===0&&(a=24),e==="ko"?n.ordinalNumber(a,{unit:"hour"}):De(a,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):Gt.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getSeconds(),{unit:"second"}):Gt.s(t,e)},S:function(t,e){return Gt.S(t,e)},X:function(t,e,n){const a=t.getTimezoneOffset();if(a===0)return"Z";switch(e){case"X":return Nc(a);case"XXXX":case"XX":return gn(a);case"XXXXX":case"XXX":default:return gn(a,":")}},x:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"x":return Nc(a);case"xxxx":case"xx":return gn(a);case"xxxxx":case"xxx":default:return gn(a,":")}},O:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Mc(a,":");case"OOOO":default:return"GMT"+gn(a,":")}},z:function(t,e,n){const a=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Mc(a,":");case"zzzz":default:return"GMT"+gn(a,":")}},t:function(t,e,n){const a=Math.trunc(+t/1e3);return De(a,e.length)},T:function(t,e,n){return De(+t,e.length)}};function Mc(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),r=Math.trunc(a/60),s=a%60;return s===0?n+String(r):n+String(r)+e+De(s,2)}function Nc(t,e){return t%60===0?(t>0?"-":"+")+De(Math.abs(t)/60,2):gn(t,e)}function gn(t,e=""){const n=t>0?"-":"+",a=Math.abs(t),r=De(Math.trunc(a/60),2),s=De(a%60,2);return n+r+e+s}const Pc=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Ac=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Sy={p:Ac,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return Pc(t,e);let s;switch(a){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",Pc(a,e)).replace("{{time}}",Ac(r,e))}},Ey=/^D+$/,Dy=/^Y+$/,Vy=["D","DD","YY","YYYY"];function My(t){return Ey.test(t)}function Ny(t){return Dy.test(t)}function Py(t,e,n){const a=Ay(t,e,n);if(console.warn(a),Vy.includes(t))throw new RangeError(a)}function Ay(t,e,n){const a=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $y=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ty=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Oy=/^'([^]*?)'?$/,zy=/''/g,Fy=/[a-zA-Z]/;function $c(t,e,n){var u,f,h,m;const a=ha(),r=a.locale??Ec,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=it(t,n==null?void 0:n.in);if(!Wb(l))throw new RangeError("Invalid time value");let c=e.match(Ty).map(b=>{const p=b[0];if(p==="p"||p==="P"){const g=Sy[p];return g(b,r.formatLong)}return b}).join("").match($y).map(b=>{if(b==="''")return{isToken:!1,value:"'"};const p=b[0];if(p==="'")return{isToken:!1,value:Ry(b)};if(Vc[p])return{isToken:!0,value:b};if(p.match(Fy))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:b}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return c.map(b=>{if(!b.isToken)return b.value;const p=b.value;(Ny(p)||My(p))&&Py(p,e,String(t));const g=Vc[p[0]];return g(l,p,r.localize,d)}).join("")}function Ry(t){const e=t.match(Oy);return e?e[1].replace(zy,"'"):t}const vy={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"}},Ly=(t,e,n)=>{let a;const r=vy[t];return typeof r=="string"?a=r:e===1?a=r.one:a=r.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"dalam waktu "+a:a+" yang lalu":a},Iy={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},jy={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},Wy={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Hy={date:Mn({formats:Iy,defaultWidth:"full"}),time:Mn({formats:jy,defaultWidth:"full"}),dateTime:Mn({formats:Wy,defaultWidth:"full"})},qy={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},Uy=(t,e,n,a)=>qy[t],Yy={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},Gy={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},Ky={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"]},Xy={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"]},Jy={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"}},Qy={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"}},Zy={ordinalNumber:(t,e)=>"ke-"+Number(t),era:yt({values:Yy,defaultWidth:"wide"}),quarter:yt({values:Gy,defaultWidth:"wide",argumentCallback:t=>t-1}),month:yt({values:Ky,defaultWidth:"wide"}),day:yt({values:Xy,defaultWidth:"wide"}),dayPeriod:yt({values:Jy,defaultWidth:"wide",formattingValues:Qy,defaultFormattingWidth:"wide"})},ex=/^ke-(\d+)?/i,tx=/\d+/i,nx={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},ox={any:[/^s/i,/^(m|e)/i]},ax={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},rx={any:[/1/i,/2/i,/3/i,/4/i]},sx={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},ix={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]},lx={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},cx={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]},dx={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},ux={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}},fx={ordinalNumber:Sc({matchPattern:ex,parsePattern:tx,valueCallback:t=>parseInt(t,10)}),era:xt({matchPatterns:nx,defaultMatchWidth:"wide",parsePatterns:ox,defaultParseWidth:"any"}),quarter:xt({matchPatterns:ax,defaultMatchWidth:"wide",parsePatterns:rx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:xt({matchPatterns:sx,defaultMatchWidth:"wide",parsePatterns:ix,defaultParseWidth:"any"}),day:xt({matchPatterns:lx,defaultMatchWidth:"wide",parsePatterns:cx,defaultParseWidth:"any"}),dayPeriod:xt({matchPatterns:dx,defaultMatchWidth:"any",parsePatterns:ux,defaultParseWidth:"any"})},hx={code:"id",formatDistance:Ly,formatLong:Hy,formatRelative:Uy,localize:Zy,match:fx,options:{weekStartsOn:1,firstWeekContainsDate:1}},Tc={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)"}}},Oc="dcode-dp-theme-forced";function mx(t,e=Oc){const n=Tc[t]??Tc.primary,a=`
19
19
  .dp__theme_light {
20
20
  --dp-primary-color: ${n.light.primary} !important;
21
21
  --dp-primary-text-color: ${n.light.text} !important;
@@ -60,7 +60,7 @@
60
60
  .dcode-datepicker-menu .dp__menu_inner {
61
61
  padding: 0 !important;
62
62
  }
63
- `.trim();let r=document.getElementById(e);r||(r=document.createElement("style"),r.id=e,document.head.appendChild(r)),r.textContent=a}function px(t,e=zc){o.watch(t,n=>mx(n,e),{immediate:!0})}const gx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},bx={key:0,class:"ml-1 text-destructive"},yx={class:"relative w-full group"},xx={class:"absolute inset-y-0 left-3 flex items-center pointer-events-none"},kx={key:0,class:"absolute inset-y-0 left-9 flex items-center text-muted-foreground"},wx={class:"h-full p-2 flex flex-col gap-3 w-32"},_x={class:"flex items-center justify-end gap-2 w-full p-2"},Cx={key:1,class:"text-xs text-destructive"},Ir=o.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:e}){const n=o.useAttrs(),a=t,r=e,s=Math.random().toString(36).slice(2,7),i=o.computed(()=>`dcode-datepicker-${n.id||a.label||"date-picker"}-${s}`),l=o.computed(()=>{const F=n.required,L=n["aria-required"];return F===""||F===!0||F==="true"||L==="true"||L===!0}),c=o.computed(()=>!!a.error),d=o.computed({get:()=>a.modelValue,set:F=>{r("update:modelValue",F),r("change",F)}}),u=o.computed(()=>a.locale==="en"?Dc:hx),f=o.computed(()=>a.range?2:!1),h=o.computed(()=>a.range?{partialRange:!1}:!1),m=F=>{const L=new Date(F);return L.setHours(0,0,0,0),L},b=F=>{const L=new Date(F);return L.setHours(23,59,59,999),L},p=(F,L)=>{const Y=new Date(F);return Y.setDate(Y.getDate()+L),Y},g=o.computed(()=>{}),y=o.computed(()=>{if(a.maxDaysAhead&&a.maxDaysAhead>0)return b(p(new Date,a.maxDaysAhead))}),B=o.ref(null),D=o.ref(null),M=F=>{D.value={month:F.month,year:F.year}},S=o.ref(!1);let k=null;o.onMounted(()=>{const F=document.documentElement,L=()=>S.value=F.classList.contains("dark");L(),k=new MutationObserver(L),k.observe(F,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{k==null||k.disconnect(),k=null}),px(o.toRef(a,"tone"));const C=F=>{const L=new Date(F),Y=L.getDay(),z=L.getDate()-Y+(Y===0?-6:1);return L.setDate(z),m(L)},x=F=>{const L=C(F);return L.setDate(L.getDate()+6),b(L)},w=F=>{const L=new Date(F);return L.setDate(1),m(L)},E=F=>{const L=new Date(F);return L.setMonth(L.getMonth()+1),L.setDate(0),b(L)},A=o.computed(()=>{if(!a.range)return[];const F=new Date;return[{label:a.locale==="id"?"Minggu Ini":"This Week",range:[C(F),x(F)]},{label:a.locale==="id"?"Bulan Ini":"This Month",range:[w(F),E(F)]}]}),T=async F=>{var H,j;const L=a.modelType||"yyyy-MM-dd";if(F.length===0){d.value=null;return}if(F.length<2)return;const Y=Tc(F[0],L),z=Tc(F[1],L);d.value=[Y,z],await o.nextTick();const v=F[0],W=v.getMonth(),O=v.getFullYear();D.value&&D.value.month===W&&D.value.year===O||(H=B.value)==null||H.setMonthYear({month:W,year:O}),(j=B.value)==null||j.openMenu()};return(F,L)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class])},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.label?(o.openBlock(),o.createElementBlock("div",gx)):o.createCommentVNode("",!0),L[2]||(L[2]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:i.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",bx,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Rd.VueDatePicker),{ref_key:"dpRef",ref:B,modelValue:d.value,"onUpdate:modelValue":L[1]||(L[1]=Y=>d.value=Y),dark:S.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":g.value,"max-date":y.value,"preset-ranges":A.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:M},o.createSlots({"dp-input":o.withCtx(({value:Y,onInput:z,onEnter:v,onTab:W,onBlur:O,onFocus:N,onKeypress:H,onPaste:j,toggleMenu:J})=>[o.createElementVNode("div",yx,[o.createElementVNode("div",xx,[o.createVNode(o.unref(ne.Calendar),{class:"w-4 h-4 text-muted-foreground"})]),t.prependInner?(o.openBlock(),o.createElementBlock("div",kx,[o.createElementVNode("span",null,o.toDisplayString(t.prependInner),1)])):o.createCommentVNode("",!0),o.createVNode(o.unref(pn),{id:i.value,modelValue:Y,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",onClick:te=>J(),onFocus:te=>N(),onBlur:te=>O(),onInput:te=>z(te),onKeydown:[o.withKeys(te=>v(te),["enter"]),o.withKeys(te=>W(te),["tab"])],onKeypress:te=>H(te),onPaste:te=>j(),class:o.normalizeClass(["w-full h-10 flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-within:ring-1 focus-within:ring-white",t.prependInner?"pl-20":"pl-10",c.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""])},null,8,["id","modelValue","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste","class"])])]),"action-buttons":o.withCtx(({selectDate:Y,selectionDisabled:z})=>[o.createElementVNode("div",_x,[o.createVNode(o.unref(Ce),{type:"button",variant:"outline",onClick:L[0]||(L[0]=v=>{var W;return(W=B.value)==null?void 0:W.closeMenu()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.cancelLabel),1)]),_:1}),o.createVNode(o.unref(Ce),{type:"button",variant:"default",disabled:z,onClick:v=>Y()},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.selectLabel),1)]),_:1},8,["disabled","onClick"])])]),_:2},[t.range?{name:"left-sidebar",fn:o.withCtx(()=>[o.createElementVNode("div",wx,[A.value.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(A.value,Y=>(o.openBlock(),o.createBlock(o.unref(Ce),{key:Y.label,type:"button",variant:"default",class:"w-full",onClick:z=>T(Y.range)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y.label),1)]),_:2},1032,["onClick"]))),128)):o.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?(o.openBlock(),o.createElementBlock("p",Cx,o.toDisplayString(a.error),1)):o.createCommentVNode("",!0)],64))],2))}}),Bx={class:"flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0"},Sx=o.defineComponent({__name:"Calendar",props:{defaultValue:{},defaultPlaceholder:{},placeholder:{},pagedNavigation:{type:Boolean},preventDeselect:{type:Boolean},weekStartsOn:{},weekdayFormat:{},calendarLabel:{},fixedWeeks:{type:Boolean},maxValue:{},minValue:{},locale:{},numberOfMonths:{},disabled:{type:Boolean},readonly:{type:Boolean},initialFocus:{type:Boolean},isDateDisabled:{type:Function},isDateUnavailable:{type:Function},dir:{},nextPage:{type:Function},prevPage:{type:Function},modelValue:{},multiple:{type:Boolean},disableDaysOutsideCurrentView:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","update:placeholder"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarRoot),o.mergeProps({class:o.unref(de)("p-3",n.class)},o.unref(s)),{default:o.withCtx(({grid:c,weekDays:d})=>[o.createVNode(o.unref(Ax),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Ox)),o.createVNode(o.unref($x)),o.createVNode(o.unref(Tx))]),_:1}),o.createElementVNode("div",Bx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,u=>(o.openBlock(),o.createBlock(o.unref(Vx),{key:u.value.toString()},{default:o.withCtx(()=>[o.createVNode(o.unref(Nx),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Fc),null,{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d,f=>(o.openBlock(),o.createBlock(o.unref(Px),{key:f},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(f),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),o.createVNode(o.unref(Mx),null,{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.rows,(f,h)=>(o.openBlock(),o.createBlock(o.unref(Fc),{key:`weekDate-${h}`,class:"mt-2 w-full"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f,m=>(o.openBlock(),o.createBlock(o.unref(Ex),{key:m.toString(),date:m},{default:o.withCtx(()=>[o.createVNode(o.unref(Dx),{day:m,month:u.value},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))])]),_:1},16,["class"]))}}),Ex=o.defineComponent({__name:"CalendarCell",props:{date:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarCell),o.mergeProps({class:o.unref(de)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-md [&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-view])]:bg-accent/50",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Dx=o.defineComponent({__name:"CalendarCellTrigger",props:{day:{},month:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarCellTrigger),o.mergeProps({class:o.unref(de)(o.unref(_t)({variant:"ghost"}),"h-8 w-8 p-0 font-normal","[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground","data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:opacity-100 data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground","data-[disabled]:text-muted-foreground data-[disabled]:opacity-50","data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through","data-[outside-view]:text-muted-foreground data-[outside-view]:opacity-50 [&[data-outside-view][data-selected]]:bg-accent/50 [&[data-outside-view][data-selected]]:text-muted-foreground [&[data-outside-view][data-selected]]:opacity-30",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Vx=o.defineComponent({__name:"CalendarGrid",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGrid),o.mergeProps({class:o.unref(de)("w-full border-collapse space-y-1",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Mx=o.defineComponent({__name:"CalendarGridBody",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGridBody),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),Nx=o.defineComponent({__name:"CalendarGridHead",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGridHead),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),Fc=o.defineComponent({__name:"CalendarGridRow",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGridRow),o.mergeProps({class:o.unref(de)("flex",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Px=o.defineComponent({__name:"CalendarHeadCell",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarHeadCell),o.mergeProps({class:o.unref(de)("w-8 rounded-md text-[0.8rem] font-normal text-muted-foreground",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ax=o.defineComponent({__name:"CalendarHeader",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarHeader),o.mergeProps({class:o.unref(de)("relative flex w-full items-center justify-between pt-1",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),$x=o.defineComponent({__name:"CalendarHeading",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarHeading),o.mergeProps({class:o.unref(de)("text-sm font-medium",e.class)},o.unref(a)),{default:o.withCtx(({headingValue:i})=>[o.renderSlot(r.$slots,"default",{headingValue:i},()=>[o.createTextVNode(o.toDisplayString(i),1)])]),_:3},16,["class"]))}}),Tx=o.defineComponent({__name:"CalendarNextButton",props:{nextPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarNext),o.mergeProps({class:o.unref(de)(o.unref(_t)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronRight),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),Ox=o.defineComponent({__name:"CalendarPrevButton",props:{prevPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarPrev),o.mergeProps({class:o.unref(de)(o.unref(_t)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronLeft),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),zx=o.defineComponent({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.PopoverRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),Fx=o.defineComponent({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:"center"},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:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.PopoverPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.PopoverContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",n.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Rx=o.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.PopoverTrigger),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}});function jr(t,e){return t-e*Math.floor(t/e)}const Rc=1721426;function pa(t,e,n,a){e=Wr(t,e);let r=e-1,s=-2;return n<=2?s=0:ga(e)&&(s=-1),Rc-1+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Math.floor((367*n-362)/12+s+a)}function ga(t){return t%4===0&&(t%100!==0||t%400===0)}function Wr(t,e){return t==="BC"?1-e:e}function vx(t){let e="AD";return t<=0&&(e="BC",t=1-t),[e,t]}const Lx={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class ba{fromJulianDay(e){let n=e,a=n-Rc,r=Math.floor(a/146097),s=jr(a,146097),i=Math.floor(s/36524),l=jr(s,36524),c=Math.floor(l/1461),d=jr(l,1461),u=Math.floor(d/365),f=r*400+i*100+c*4+u+(i!==4&&u!==4?1:0),[h,m]=vx(f),b=n-pa(h,m,1,1),p=2;n<pa(h,m,3,1)?p=0:ga(m)&&(p=1);let g=Math.floor(((b+p)*12+373)/367),y=n-pa(h,m,g,1)+1;return new go(h,m,g,y)}toJulianDay(e){return pa(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return Lx[ga(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return ga(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}function Ix(t,e){var n,a,r,s;return(s=(r=(n=t.isEqual)===null||n===void 0?void 0:n.call(t,e))!==null&&r!==void 0?r:(a=e.isEqual)===null||a===void 0?void 0:a.call(e,t))!==null&&s!==void 0?s:t.identifier===e.identifier}function vc(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)}function jx(t,e){return Lc(t)-Lc(e)}function Lc(t){return t.hour*36e5+t.minute*6e4+t.second*1e3+t.millisecond}let Hr=null;function Pn(){return Hr==null&&(Hr=new Intl.DateTimeFormat().resolvedOptions().timeZone),Hr}function Ic(t){t=qr(t,new ba);let e=Wr(t.era,t.year);return jc(e,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}function jc(t,e,n,a,r,s,i){let l=new Date;return l.setUTCHours(a,r,s,i),l.setUTCFullYear(t,e-1,n),l.getTime()}function Wc(t,e){if(e==="UTC")return 0;if(t>0&&e===Pn())return new Date(t).getTimezoneOffset()*-6e4;let{year:n,month:a,day:r,hour:s,minute:i,second:l}=qc(t,e);return jc(n,a,r,s,i,l,0)-Math.floor(t/1e3)*1e3}const Hc=new Map;function qc(t,e){let n=Hc.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Hc.set(e,n));let a=n.formatToParts(new Date(t)),r={};for(let s of a)s.type!=="literal"&&(r[s.type]=s.value);return{year:r.era==="BC"||r.era==="B"?-r.year+1:+r.year,month:+r.month,day:+r.day,hour:r.hour==="24"?0:+r.hour,minute:+r.minute,second:+r.second}}const Uc=864e5;function Wx(t,e,n,a){return(n===a?[n]:[n,a]).filter(s=>Hx(t,e,s))}function Hx(t,e,n){let a=qc(n,e);return t.year===a.year&&t.month===a.month&&t.day===a.day&&t.hour===a.hour&&t.minute===a.minute&&t.second===a.second}function qx(t,e,n="compatible"){let a=Gc(t);if(e==="UTC")return Ic(a);if(e===Pn()&&n==="compatible"){a=qr(a,new ba);let c=new Date,d=Wr(a.era,a.year);return c.setFullYear(d,a.month-1,a.day),c.setHours(a.hour,a.minute,a.second,a.millisecond),c.getTime()}let r=Ic(a),s=Wc(r-Uc,e),i=Wc(r+Uc,e),l=Wx(a,e,r-s,r-i);if(l.length===1)return l[0];if(l.length>1)switch(n){case"compatible":case"earlier":return l[0];case"later":return l[l.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(r-s,r-i);case"compatible":case"later":return Math.max(r-s,r-i);case"reject":throw new RangeError("No such absolute time found")}}function Yc(t,e,n="compatible"){return new Date(qx(t,e,n))}function Gc(t,e){let n=0,a=0,r=0,s=0;if("timeZone"in t)({hour:n,minute:a,second:r,millisecond:s}=t);else if("hour"in t&&!e)return t;return e&&({hour:n,minute:a,second:r,millisecond:s}=e),new xa(t.calendar,t.era,t.year,t.month,t.day,n,a,r,s)}function qr(t,e){if(Ix(t.calendar,e))return t;let n=e.fromJulianDay(t.calendar.toJulianDay(t)),a=t.copy();return a.calendar=e,a.era=n.era,a.year=n.year,a.month=n.month,a.day=n.day,An(a),a}function Ur(t,e){let n=t.copy(),a="hour"in n?Jx(n,e):0;Yr(n,e.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,t),n.month+=e.months||0,Gr(n),Kc(n),n.day+=(e.weeks||0)*7,n.day+=e.days||0,n.day+=a,Ux(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let r=n.calendar.getYearsInEra(n);if(n.year>r){var s,i;let c=(s=(i=n.calendar).isInverseEra)===null||s===void 0?void 0:s.call(i,n);n.year=r,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let l=n.calendar.getMonthsInYear(n);return n.month>l&&(n.month=l,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Yr(t,e){var n,a;!((n=(a=t.calendar).isInverseEra)===null||n===void 0)&&n.call(a,t)&&(e=-e),t.year+=e}function Gr(t){for(;t.month<1;)Yr(t,-1),t.month+=t.calendar.getMonthsInYear(t);let e=0;for(;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,Yr(t,1)}function Ux(t){for(;t.day<1;)t.month--,Gr(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,Gr(t)}function Kc(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))}function An(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),Kc(t)}function Yx(t){let e={};for(let n in t)typeof t[n]=="number"&&(e[n]=-t[n]);return e}function Xc(t,e){return Ur(t,Yx(e))}function Jc(t,e){let n=t.copy();return e.era!=null&&(n.era=e.era),e.year!=null&&(n.year=e.year),e.month!=null&&(n.month=e.month),e.day!=null&&(n.day=e.day),An(n),n}function Gx(t,e){let n=t.copy();return e.hour!=null&&(n.hour=e.hour),e.minute!=null&&(n.minute=e.minute),e.second!=null&&(n.second=e.second),e.millisecond!=null&&(n.millisecond=e.millisecond),Xx(n),n}function Kx(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=ya(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=ya(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=ya(t.minute,60);let e=Math.floor(t.hour/24);return t.hour=ya(t.hour,24),e}function Xx(t){t.millisecond=Math.max(0,Math.min(t.millisecond,1e3)),t.second=Math.max(0,Math.min(t.second,59)),t.minute=Math.max(0,Math.min(t.minute,59)),t.hour=Math.max(0,Math.min(t.hour,23))}function ya(t,e){let n=t%e;return n<0&&(n+=e),n}function Jx(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,Kx(t)}function Qc(t,e,n,a){let r=t.copy();switch(e){case"era":{let l=t.calendar.getEras(),c=l.indexOf(t.era);if(c<0)throw new Error("Invalid era: "+t.era);c=Kt(c,n,0,l.length-1,a==null?void 0:a.round),r.era=l[c],An(r);break}case"year":var s,i;!((s=(i=r.calendar).isInverseEra)===null||s===void 0)&&s.call(i,r)&&(n=-n),r.year=Kt(t.year,n,-1/0,9999,a==null?void 0:a.round),r.year===-1/0&&(r.year=1),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,t);break;case"month":r.month=Kt(t.month,n,1,t.calendar.getMonthsInYear(t),a==null?void 0:a.round);break;case"day":r.day=Kt(t.day,n,1,t.calendar.getDaysInMonth(t),a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(r),An(r),r}function Qx(t,e,n,a){let r=t.copy();switch(e){case"hour":{let s=t.hour,i=0,l=23;if((a==null?void 0:a.hourCycle)===12){let c=s>=12;i=c?12:0,l=c?23:11}r.hour=Kt(s,n,i,l,a==null?void 0:a.round);break}case"minute":r.minute=Kt(t.minute,n,0,59,a==null?void 0:a.round);break;case"second":r.second=Kt(t.second,n,0,59,a==null?void 0:a.round);break;case"millisecond":r.millisecond=Kt(t.millisecond,n,0,999,a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return r}function Kt(t,e,n,a,r=!1){if(r){t+=Math.sign(e),t<n&&(t=a);let s=Math.abs(e);e>0?t=Math.ceil(t/s)*s:t=Math.floor(t/s)*s,t>a&&(t=n)}else t+=e,t<n?t=a-(n-t-1):t>a&&(t=n+(t-a-1));return t}function Zx(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}${t.millisecond?String(t.millisecond/1e3).slice(1):""}`}function Zc(t){let e=qr(t,new ba),n;return e.era==="BC"?n=e.year===1?"0000":"-"+String(Math.abs(1-e.year)).padStart(6,"00"):n=String(e.year).padStart(4,"0"),`${n}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`}function ek(t){return`${Zc(t)}T${Zx(t)}`}function tk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ed(t,e,n){tk(t,e),e.set(t,n)}function td(t){let e=typeof t[0]=="object"?t.shift():new ba,n;if(typeof t[0]=="string")n=t.shift();else{let i=e.getEras();n=i[i.length-1]}let a=t.shift(),r=t.shift(),s=t.shift();return[e,n,a,r,s]}var nk=new WeakMap;class go{copy(){return this.era?new go(this.calendar,this.era,this.year,this.month,this.day):new go(this.calendar,this.year,this.month,this.day)}add(e){return Ur(this,e)}subtract(e){return Xc(this,e)}set(e){return Jc(this,e)}cycle(e,n,a){return Qc(this,e,n,a)}toDate(e){return Yc(this,e)}toString(){return Zc(this)}compare(e){return vc(this,e)}constructor(...e){ed(this,nk,{writable:!0,value:void 0});let[n,a,r,s,i]=td(e);this.calendar=n,this.era=a,this.year=r,this.month=s,this.day=i,An(this)}}var ok=new WeakMap;class xa{copy(){return this.era?new xa(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new xa(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Ur(this,e)}subtract(e){return Xc(this,e)}set(e){return Jc(Gx(this,e),e)}cycle(e,n,a){switch(e){case"era":case"year":case"month":case"day":return Qc(this,e,n,a);default:return Qx(this,e,n,a)}}toDate(e,n){return Yc(this,e,n)}toString(){return ek(this)}compare(e){let n=vc(this,e);return n===0?jx(this,Gc(e)):n}constructor(...e){ed(this,ok,{writable:!0,value:void 0});let[n,a,r,s,i]=td(e);this.calendar=n,this.era=a,this.year=r,this.month=s,this.day=i,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,An(this)}}const ak={class:"relative w-full"},rk={class:"mt-2 flex justify-end gap-2"},sk={name:"DCodeDateRangePicker"},Kr=o.defineComponent({...sk,props:{modelValue:{},placeholder:{default:"YYYY-MM-DD - YYYY-MM-DD"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},returnType:{default:"yyyy-mm-dd"},requireBoth:{type:Boolean,default:!1}},emits:["update:modelValue","change","invalid"],setup(t,{emit:e}){const n=t,a=e,r=o.ref(!1),s=o.ref(null),i=o.ref(""),l=o.ref(null),c=o.ref("");function d(w){return String(w).padStart(2,"0")}function u(w){return`${w.getFullYear()}-${d(w.getMonth()+1)}-${d(w.getDate())}`}function f(w){return new go(w.getFullYear(),w.getMonth()+1,w.getDate())}function h(w){const E=w.trim();if(!E)return null;const A=E.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(A){const L=new Date(Number(A[1]),Number(A[2])-1,Number(A[3]));return Number.isNaN(L.getTime())?null:L}const T=E.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(T){const L=new Date(Number(T[3]),Number(T[2])-1,Number(T[1]));return Number.isNaN(L.getTime())?null:L}const F=new Date(E);return Number.isNaN(F.getTime())?null:F}function m(w){return w?w instanceof Date?Number.isNaN(w.getTime())?null:w:typeof w=="string"?h(w):null:null}function b(w){return w?(w.setHours(0,0,0,0),n.returnType==="iso"?w.toISOString():n.returnType==="yyyy-mm-dd"?u(w):w):null}function p(w){const E=w!=null&&w.start?u(w.start.toDate(Pn())):"",A=w!=null&&w.end?u(w.end.toDate(Pn())):"";return E&&A?`${E} - ${A}`:E&&!A?`${E} - `:""}function g(){const w=n.modelValue,E=w!=null&&w.start?m(w.start):null,A=w!=null&&w.end?m(w.end):null;let T={start:E?f(E):void 0,end:A?f(A):void 0};!T.start&&!T.end&&(T=null),s.value=T,i.value=s.value?p(s.value):""}function y(){l.value=s.value,c.value=i.value}function B(w){const E=w.trim();if(!E)return{a:"",b:null};if(E.includes(" - ")){const[A,T]=E.split(" - ");return{a:(A??"").trim(),b:(T??"").trim()||null}}if(E.toLowerCase().includes(" to ")){const[A,T]=E.toLowerCase().split(" to ");return{a:(A??"").trim(),b:(T??"").trim()||null}}if(E.includes(" – ")){const[A,T]=E.split(" – ");return{a:(A??"").trim(),b:(T??"").trim()||null}}return{a:E,b:null}}function D(){const{a:w,b:E}=B(c.value);if(!w&&!E)return l.value=null,!0;const A=w?m(w):null;if(w&&!A)return a("invalid","Format tanggal start tidak valid. Pakai YYYY-MM-DD atau DD/MM/YYYY."),!1;const T=E?m(E):null;if(E&&!T)return a("invalid","Format tanggal end tidak valid. Pakai YYYY-MM-DD atau DD/MM/YYYY."),!1;const F=A?f(A):void 0,L=T?f(T):void 0;let Y;return A&&T&&T.getTime()<A.getTime()?Y={start:L,end:F}:Y={start:F,end:L},l.value=Y,!l.value.start&&!l.value.end?(l.value=null,c.value="",!0):(c.value=p(l.value),!0)}function M(w){const E=w!=null&&w.start?w.start.toDate(Pn()):null,A=w!=null&&w.end?w.end.toDate(Pn()):null;E&&E.setHours(0,0,0,0),A&&A.setHours(0,0,0,0);const T=E||A?{start:b(E),end:b(A)}:null;a("update:modelValue",T),a("change",T)}function S(w){const E=w?{start:w.start,end:w.end}:null;l.value=E,c.value=E?p(E):""}function k(){if(!D())return;const E=l.value;if(n.requireBoth&&(!(E!=null&&E.start)||!(E!=null&&E.end))){a("invalid","Pilih tanggal start dan end dulu sebelum Apply.");return}s.value=E,i.value=E?p(E):"",l.value=s.value,c.value=i.value,M(E),r.value=!1}function C(){y(),r.value=!1}function x(){l.value=null,c.value=""}return o.watch(()=>n.modelValue,()=>{g(),r.value||y()},{immediate:!0}),o.watch(r,w=>{w&&y()}),(w,E)=>(o.openBlock(),o.createBlock(o.unref(zx),{open:r.value,"onUpdate:open":E[5]||(E[5]=A=>r.value=A)},{default:o.withCtx(()=>[o.createVNode(o.unref(Rx),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",ak,[o.createVNode(o.unref(pn),{modelValue:c.value,"onUpdate:modelValue":E[0]||(E[0]=A=>c.value=A),disabled:t.disabled,placeholder:t.placeholder,class:"pr-20",onFocus:E[1]||(E[1]=A=>!t.disabled&&(r.value=!0)),onKeydown:E[2]||(E[2]=o.withKeys(o.withModifiers(A=>D(),["prevent"]),["enter"])),onBlur:E[3]||(E[3]=A=>D())},null,8,["modelValue","disabled","placeholder"]),t.clearable&&c.value?(o.openBlock(),o.createBlock(o.unref(Ce),{key:0,type:"button",variant:"ghost",size:"icon",class:"absolute right-10 top-1/2 -translate-y-1/2 h-8 w-8",disabled:t.disabled,onClick:x},{default:o.withCtx(()=>[...E[6]||(E[6]=[o.createTextVNode(" ✕ ",-1)])]),_:1},8,["disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Ce),{type:"button",variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",disabled:t.disabled,onClick:E[4]||(E[4]=A=>r.value=!r.value)},{default:o.withCtx(()=>[...E[7]||(E[7]=[o.createTextVNode(" 📅 ",-1)])]),_:1},8,["disabled"])])]),_:1}),o.createVNode(o.unref(Fx),{class:"p-2 w-auto",align:"start"},{default:o.withCtx(()=>[o.createVNode(o.unref(Sx),{mode:"range",selected:l.value??void 0,"onUpdate:selected":S,"initial-focus":""},null,8,["selected"]),o.createElementVNode("div",rk,[o.createVNode(o.unref(Ce),{variant:"outline",type:"button",onClick:C},{default:o.withCtx(()=>[...E[8]||(E[8]=[o.createTextVNode("Cancel",-1)])]),_:1}),o.createVNode(o.unref(Ce),{type:"button",onClick:k},{default:o.withCtx(()=>[...E[9]||(E[9]=[o.createTextVNode("Apply",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),nd=o.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),od=o.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),o.createVNode(o.unref(Q.DialogContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default"),o.createVNode(o.unref(Q.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.X),{class:"w-4 h-4"}),l[0]||(l[0]=o.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),ik=o.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogDescription),o.mergeProps(o.unref(a),{class:o.unref(de)("text-sm text-muted-foreground",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),lk=o.defineComponent({__name:"DialogHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),ck=o.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogTitle),o.mergeProps(o.unref(a),{class:o.unref(de)("text-lg font-medium leading-none tracking-tight",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),dk={class:"flex items-center gap-3"},uk={class:"flex justify-end gap-3"},ka=o.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:()=>({})}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,r=o.useAttrs(),s=o.computed(()=>{const{style:d,...u}=r;return u}),i=o.computed(()=>({maxWidth:typeof n.maxWidth=="number"?`${n.maxWidth}px`:n.maxWidth,width:"100%"})),l=o.computed(()=>n.icon?Qt[n.icon]??null:null),c=d=>{if(!d&&n.persistent){a("update:modelValue",!0);return}a("update:modelValue",d)};return(d,u)=>(o.openBlock(),o.createBlock(o.unref(nd),{open:t.modelValue,"onUpdate:open":c},{default:o.withCtx(()=>[o.createVNode(o.unref(od),o.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:o.withCtx(()=>[o.createVNode(Za,{padding:t.contentClass,border:"",shadow:"",class:"w-full !rounded-xl !border-0",level:1},o.createSlots({header:o.withCtx(()=>[o.createElementVNode("div",dk,[l.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),{key:0,class:"h-5 w-5"})):o.createCommentVNode("",!0),o.createVNode(o.unref(ck),{class:"text-base font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),o.createVNode(o.unref(ik),{class:"hidden"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),actions:o.withCtx(()=>[o.renderSlot(d.$slots,"header-append")]),default:o.withCtx(()=>[o.createElementVNode("div",{style:o.normalizeStyle(t.contentStyle)},[o.renderSlot(d.$slots,"default")],4)]),_:2},[d.$slots.actions?{name:"footer",fn:o.withCtx(()=>[o.createElementVNode("div",uk,[o.renderSlot(d.$slots,"actions")])]),key:"0"}:void 0]),1032,["padding"])]),_:3},16,["style"])]),_:3},8,["open"]))}}),ad=o.defineComponent({__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const e=t,n=o.computed(()=>Qt[e.icon]??Qt.X);return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Ce),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),fk=o.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)(o.unref(mk)({variant:t.variant}),e.class)),role:"alert"},[o.renderSlot(n.$slots,"default")],2))}}),hk=o.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("text-sm [&_p]:leading-relaxed",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),mk=Wn("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"}}),Xt=o.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)(o.unref(pk)({variant:t.variant}),e.class))},[o.renderSlot(n.$slots,"default")],2))}}),pk=Wn("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"}}),$n=o.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("rounded-xl border bg-card text-card-foreground shadow",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),Tn=o.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("p-6 pt-0",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),gk=o.defineComponent({__name:"CardFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex items-center p-6 pt-0",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),bo=o.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col gap-y-1.5 p-6",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),wa=o.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("h3",{class:o.normalizeClass(o.unref(de)("font-medium leading-none tracking-tight",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),bk={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},yk={class:"flex flex-wrap items-center justify-center gap-2"},xk=["accept","multiple"],_a=o.defineComponent({__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"image/*"},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:e}){const n=t,a=e,r=o.ref(null),s=o.ref(!1),i=o.ref(null),l=o.ref(null),c=o.ref(null);o.computed(()=>n.accept||"file/*");const d=o.computed(()=>n.error??i.value);function u(){var S;n.disabled||(S=r.value)==null||S.click()}function f(S){const k=S/1024,C=k/1024;return C>=1?`${C.toFixed(2)} MB`:k>=1?`${k.toFixed(1)} KB`:`${S} B`}function h(S){var C;if(!S)return"File tidak valid";if((C=n.accept)!=null&&C.includes("image/")&&!S.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const k=(n.maxSizeMb??2)*1024*1024;return S.size>k?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:null}function m(S){l.value=S.name,c.value=S.size}function b(S){if(i.value=null,!S.length)return;if(n.mode==="single"){const C=S[0],x=h(C);if(x){i.value=x,a("error",x);return}n.showSelected&&m(C),a("picked",C);return}const k=[];for(const C of S){const x=h(C);if(x){i.value=x,a("error",x);return}k.push(C)}k.length&&(n.showSelected&&m(k[0]),a("picked:multiple",k))}function p(S){const k=S.target,C=Array.from(k.files??[]);b(C),k.value=""}function g(){n.disabled||(s.value=!0)}function y(){n.disabled||(s.value=!0)}function B(){s.value=!1}function D(S){var x,w;if(n.disabled)return;s.value=!1;const k=Array.from(((x=S.dataTransfer)==null?void 0:x.files)??[]),C=(w=n.accept)!=null&&w.includes("image/")?k.filter(E=>E.type.startsWith("image/")):k;b(C)}const M=o.computed(()=>(n.accept||"file/*").split(",").map(S=>S.trim()).filter(Boolean).map(S=>S==="image/*"?"IMAGE":S.replace(/^image\//,"").replace(/^\./,"")).join(", "));return o.computed(()=>`${n.maxSizeMb??0}MB`),(S,k)=>(o.openBlock(),o.createBlock(o.unref($n),{class:o.normalizeClass(t.disabled?"opacity-60":"")},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(wa),{class:"text-sm font-semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label),1)]),_:1})]),_:1}),o.createVNode(o.unref(Tn),{class:"pt-2"},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(["flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"border-primary bg-primary/10 -translate-y-[1px]":"border-border bg-muted/30",t.disabled?"cursor-not-allowed":"hover:border-primary/60 hover:bg-primary/5"]]),style:{"min-height":"190px"},onClick:u,onDragenter:o.withModifiers(g,["prevent"]),onDragover:o.withModifiers(y,["prevent"]),onDragleave:o.withModifiers(B,["prevent"]),onDrop:o.withModifiers(D,["prevent"])},[o.createElementVNode("div",bk,[k[0]||(k[0]=o.createElementVNode("div",{class:"text-sm font-medium"},"Drag & drop file di sini",-1)),k[1]||(k[1]=o.createElementVNode("div",{class:"text-xs text-muted-foreground"},"atau klik area ini untuk memilih file",-1)),o.createElementVNode("div",yk,[o.createVNode(o.unref(Xt),{variant:"secondary",class:"text-[11px]"},{default:o.withCtx(()=>[o.createTextVNode(" Allowed: "+o.toDisplayString(M.value),1)]),_:1}),o.createVNode(o.unref(Xt),{variant:"secondary",class:"text-[11px]"},{default:o.withCtx(()=>[o.createTextVNode(" Max: "+o.toDisplayString(n.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(o.openBlock(),o.createBlock(o.unref(Xt),{key:0,variant:"secondary",class:"mt-2"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.value)+" • "+o.toDisplayString(c.value?f(c.value):""),1)]),_:1})):o.createCommentVNode("",!0)]),o.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:p},null,40,xk)],34),d.value?(o.openBlock(),o.createBlock(o.unref(fk),{key:0,variant:"destructive",class:"mt-3"},{default:o.withCtx(()=>[o.createVNode(o.unref(hk),{class:"text-sm"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value),1)]),_:1})]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),kk={key:0,class:"text-xs text-muted-foreground"},wk=["src"],_k={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground gap-2 p-4 text-center"},Ck={class:"space-y-0.5"},Bk={class:"text-sm font-medium truncate max-w-[180px]"},Sk={class:"text-xs opacity-70"},Ek={class:"absolute top-2 inset-x-2 flex items-center justify-between"},Dk={key:1},Vk={class:"absolute left-2 bottom-2 z-10 inline-block max-w-[calc(100%-16px)] rounded-xl border px-3 py-2 shadow-lg backdrop-blur opacity-0 translate-y-1 scale-[0.99] transition-all duration-200 group-hover:opacity-100 group-hover:translate-y-0 group-hover:scale-100 border-border/60 dark:border-border/50 bg-background/80 dark:bg-background/30"},Mk={class:"text-[11px] text-foreground/90 space-y-1 whitespace-nowrap"},Nk={class:"flex gap-2"},Pk={class:"font-medium truncate"},Ak={class:"flex gap-2"},$k={class:"font-medium"},Tk={class:"flex gap-2"},Ok={class:"font-medium truncate"},Xr=o.defineComponent({__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:e}){const n=t,a=e,r=o.ref(null),s=o.computed(()=>n.forceFileIcon||!n.file?!1:(n.file.type||"").startsWith("image/"));o.watch(()=>n.file,c=>{r.value&&URL.revokeObjectURL(r.value),r.value=c?URL.createObjectURL(c):null},{immediate:!0}),o.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value)});function i(c){const d=c/1024,u=d/1024;return u>=1?`${u.toFixed(2)} MB`:d>=1?`${d.toFixed(1)} KB`:`${c} B`}const l=o.computed(()=>n.file?{name:n.file.name,size:i(n.file.size),type:n.file.type||"unknown"}:null);return(c,d)=>t.file?(o.openBlock(),o.createBlock($n,{key:0,class:o.normalizeClass(t.disabled?"opacity-60 pointer-events-none":"")},{default:o.withCtx(()=>[o.createVNode(bo,{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(wa,{class:"text-sm font-semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),t.description?(o.openBlock(),o.createElementBlock("div",kk,o.toDisplayString(t.description),1)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(Tn,{class:"pt-2"},{default:o.withCtx(()=>{var u,f,h,m,b;return[o.createElementVNode("div",{class:"group relative rounded-xl overflow-hidden bg-muted border-2 border-dashed border-border w-full transition-colors duration-200 hover:border-primary/50 hover:bg-primary/5",style:o.normalizeStyle({height:`${t.previewHeight}px`})},[s.value&&r.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,wk)):(o.openBlock(),o.createElementBlock("div",_k,[o.createVNode(o.unref(ne.FileText),{class:"w-10 h-10"}),o.createElementVNode("div",Ck,[o.createElementVNode("p",Bk,o.toDisplayString((u=l.value)==null?void 0:u.name),1),o.createElementVNode("p",Sk,o.toDisplayString((f=l.value)==null?void 0:f.size),1)])])),o.createElementVNode("div",Ek,[t.showEdit&&s.value?(o.openBlock(),o.createBlock(ht,{key:0,icon:o.unref(ne.Pencil),size:"icon",variant:"secondary",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:d[0]||(d[0]=p=>a("edit"))},null,8,["icon","disabled"])):(o.openBlock(),o.createElementBlock("div",Dk)),t.showRemove?(o.openBlock(),o.createBlock(ht,{key:2,icon:o.unref(ne.Trash2),size:"icon",variant:"destructive",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:d[1]||(d[1]=p=>a("remove"))},null,8,["icon","disabled"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Vk,[o.createElementVNode("div",Mk,[o.createElementVNode("div",Nk,[d[2]||(d[2]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Nama",-1)),o.createElementVNode("span",Pk,o.toDisplayString((h=l.value)==null?void 0:h.name),1)]),o.createElementVNode("div",Ak,[d[3]||(d[3]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Ukuran",-1)),o.createElementVNode("span",$k,o.toDisplayString((m=l.value)==null?void 0:m.size),1)]),o.createElementVNode("div",Tk,[d[4]||(d[4]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Tipe",-1)),o.createElementVNode("span",Ok,o.toDisplayString((b=l.value)==null?void 0:b.type),1)])])])],4)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}});function rd(){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 zk={class:"space-y-3"},Fk={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30"},Rk={name:"DCodeFileField"},sd=o.defineComponent({...Rk,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:void 0},minSizeMb:{default:null},maxSizeMb:{default:5},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:k=>a("update:modelValue",k)}),s=o.ref(null),i=o.ref(null);function l(k){i.value=k,a("error",k)}function c(){i.value=null}const d=o.computed(()=>{const k=(n.allowedTypes??"").trim();return k?k.split(/[,\s;]+/g).map(x=>x.trim().toLowerCase()).filter(Boolean).map(x=>x.includes("/")||x.startsWith(".")?x:`.${x}`):[]});function u(k){const C=k.lastIndexOf(".");return C>=0?k.slice(C).toLowerCase():""}const f=o.computed(()=>{if(d.value.length){const k=d.value.filter(x=>x.startsWith("."));return[...d.value.filter(x=>x.includes("/")),...k].join(",")}return n.accept}),h=o.computed(()=>d.value.length?d.value.join(", "):n.accept||"Semua File");function m(k){if(d.value.length){const C=(k.type||"").toLowerCase(),x=u(k.name);return d.value.some(w=>w.includes("/")?C===w:w.startsWith(".")?x===w:x===`.${w}`)}if(n.accept){if(n.accept==="*/*")return!0;const C=n.accept.split(",").map(E=>E.trim().toLowerCase()),x=(k.type||"").toLowerCase(),w=u(k.name);return C.some(E=>{if(E.endsWith("/*")){const A=E.slice(0,-2);return x.startsWith(A)}return E.startsWith(".")?w===E:x===E})}return!0}function b(k){return k*1024*1024}async function p(k){return k?m(k)?n.minSizeMb!=null&&k.size<b(n.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${n.minSizeMb}MB`:n.maxSizeMb!=null&&k.size>b(n.maxSizeMb)?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:g}=at(),y=rd(),B=o.ref(!1);async function D(k){var C;if(n.uploadFn){try{B.value=!0;const x=await n.uploadFn(k);r.value=k,a("uploaded",x)}catch(x){console.error("Upload Error",x),y.error("Upload Failed",(x==null?void 0:x.message)||"Unknown error"),l((x==null?void 0:x.message)||"Upload Failed")}finally{B.value=!1}return}if(!((C=n.endpoint)!=null&&C.apiUrl)){r.value=k;return}if(typeof g!="function"){l("useApi() must expose DCodeApi()");return}try{B.value=!0;const x=new FormData;x.append("doc",k);const w=(n.endpoint.apiMethod||"POST").toUpperCase(),E=n.endpoint.apiUrl,A=await g("","",x,{_url:E,_method:w,withCredentials:!0,transformRequest:[(F,L)=>(L&&(delete L["Content-Type"],delete L["content-type"]),F)]}),T=(A==null?void 0:A.data)??A;r.value=k,a("uploaded",T)}catch(x){console.error("Upload Error",x),y.error("Upload Failed",(x==null?void 0:x.message)||"Unknown error"),l((x==null?void 0:x.message)||"Upload Failed")}finally{B.value=!1}}async function M(k){var x;if(n.disabled)return;c();const C=await p(k);if(C){l(C);return}s.value=k,n.uploadFn||(x=n.endpoint)!=null&&x.apiUrl?await D(k):r.value=k}function S(){c(),r.value=null,s.value=null}return o.watch(()=>n.modelValue,k=>{k&&!s.value&&(s.value=k),k||(s.value=null)},{immediate:!0}),(k,C)=>(o.openBlock(),o.createElementBlock("div",zk,[r.value?B.value?(o.openBlock(),o.createElementBlock("div",Fk,[...C[1]||(C[1]=[o.createElementVNode("span",{class:"text-sm text-muted-foreground animate-pulse"},"Uploading...",-1)])])):(o.openBlock(),o.createBlock(Xr,{key:2,file:r.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:S},null,8,["file","title","description","disabled","preview-height","preview-width"])):(o.openBlock(),o.createBlock(_a,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||B.value,onPicked:M,error:i.value,onError:C[0]||(C[0]=x=>l(x))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),vk={key:0,class:"ml-1 text-destructive"},Lk={class:"relative w-full"},Ik={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground"},jk={key:1,class:"absolute inset-y-0 right-4 flex items-center"},Wk={key:2,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg"},Hk={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},qk={key:1,class:"text-sm text-muted-foreground text-center"},Uk=["onClick","title"],Yk={class:"flex flex-col items-center gap-1"},Gk={class:"text-[10px] text-muted-foreground truncate w-full text-center"},Kk={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},id=o.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:e}){const n=t,a=e,r=Qt,s=o.ref(null),i=o.ref(null),l=Math.random().toString(36).slice(2,7),c=o.computed(()=>`dcode-icon-dropdown-${n.label||"icon-dropdown"}-${l}`),d=o.ref(!1),u=o.computed(()=>(n.modelValue??"").trim()||""),f=o.ref(""),h=o.ref(!1),m=o.ref(!1),b=o.ref(!1),p=o.shallowRef([]),g=o.ref(n.pageSize),y=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),B=async()=>{if(m.value||b.value)return;b.value=!0,await new Promise(J=>setTimeout(J,0));const j=Object.keys(r).filter(J=>!y.has(J)).filter(J=>/^[A-Z]/.test(J)).filter(J=>typeof r[J]=="function"||typeof r[J]=="object"&&r[J]).sort((J,te)=>J.localeCompare(te));p.value=j,m.value=!0,b.value=!1},D=o.computed(()=>!m.value||!u.value||!p.value.includes(u.value)?null:r[u.value]),M=o.ref("");o.watch(u,j=>{d.value||(M.value=j)});const S=o.computed(()=>!!u.value&&!d.value),k=o.computed(()=>{if(!m.value)return[];const j=(f.value??"").trim().toLowerCase();return j?p.value.filter(J=>J.toLowerCase().includes(j)):p.value}),C=o.computed(()=>k.value.slice(0,g.value));o.watch(()=>f.value,()=>{g.value=n.pageSize});const x=o.computed(()=>{const j=n.columns;return j<=2?"grid-cols-2":j===3?"grid-cols-3":j===4?"grid-cols-4":j===5?"grid-cols-5":j>=8?"grid-cols-8":"grid-cols-6"}),w=o.computed(()=>n.clearable?"pr-12":"pr-3"),E=o.computed(()=>D.value&&!d.value?"pl-12":"pl-3"),A=async()=>{var j;await o.nextTick(),(j=i.value)==null||j.focus()},T=async j=>{if(n.disabled)return;const J=j!==!1;if(h.value){h.value=!1;return}d.value=!0,await B(),J&&(f.value="",M.value=""),g.value=n.pageSize,await A()},F=()=>{d.value=!1,f.value="",M.value=u.value,g.value=n.pageSize},L=async()=>{n.disabled||(d.value?F():await T())};let Y=null;const z=async j=>{if(n.disabled)return;a("update:modelValue",null),d.value||await T(!1),Y&&clearTimeout(Y);const J=M.value;Y=setTimeout(()=>{f.value=J},300)},v=j=>{n.disabled||(a("update:modelValue",j),F(),queueMicrotask(()=>{var J;return(J=i.value)==null?void 0:J.blur()}))},W=()=>{n.disabled||(a("update:modelValue",null),a("clear"),h.value=!0,F(),queueMicrotask(()=>{var j;return(j=i.value)==null?void 0:j.focus()}))},O=j=>{if(j.key==="Escape"){j.preventDefault(),F();return}if(j.key==="Enter"&&d.value){const J=k.value[0];J&&(j.preventDefault(),v(J))}},N=j=>{if(!d.value)return;const J=j.target;s.value&&!s.value.contains(J)&&F()},H=j=>{const J=j.target;J.scrollTop+J.clientHeight>=J.scrollHeight-24&&g.value<k.value.length&&(g.value=Math.min(g.value+n.pageSize,k.value.length))};return o.onMounted(()=>{document.addEventListener("mousedown",N),queueMicrotask(()=>{var j;i.value=((j=s.value)==null?void 0:j.querySelector("input"))??null})}),o.onBeforeUnmount(()=>{document.removeEventListener("mousedown",N),Y&&clearTimeout(Y)}),(j,J)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"w-full"},[n.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium mb-1 block"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.label)+" ",1),n.required?(o.openBlock(),o.createElementBlock("span",vk,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",Lk,[D.value&&!d.value?(o.openBlock(),o.createElementBlock("div",Ik,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(D.value),{size:18}))])):o.createCommentVNode("",!0),o.createVNode(o.unref(pn),{id:c.value,modelValue:M.value,"onUpdate:modelValue":J[0]||(J[0]=te=>M.value=te),readonly:S.value,disabled:n.disabled,placeholder:n.placeholder,class:o.normalizeClass(["w-full h-10 rounded-lg border bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700",[w.value,E.value,S.value?"cursor-pointer select-none":""]]),onClick:T,onFocus:T,onInput:z,onKeydown:O},null,8,["id","modelValue","readonly","disabled","placeholder","class"]),n.clearable?(o.openBlock(),o.createElementBlock("div",jk,[u.value?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"text-muted-foreground hover:text-foreground transition",onMousedown:J[1]||(J[1]=o.withModifiers(()=>{},["prevent"])),onClick:W,title:"Clear"}," ✕ ",32)):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",class:"text-muted-foreground hover:text-foreground transition-transform",onMousedown:J[2]||(J[2]=o.withModifiers(()=>{},["prevent"])),onClick:L,title:"Open"},[o.createVNode(o.unref(ne.ChevronDown),{class:"h-4 w-4"})],32))])):o.createCommentVNode("",!0),d.value?(o.openBlock(),o.createElementBlock("div",Wk,[o.createElementVNode("div",{class:"p-2 overflow-auto",style:o.normalizeStyle({maxHeight:n.maxHeight}),onScroll:H},[b.value?(o.openBlock(),o.createElementBlock("div",Hk,[o.createVNode(o.unref(ne.Loader2),{class:"h-4 w-4 animate-spin"}),J[3]||(J[3]=o.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&k.value.length===0?(o.openBlock(),o.createElementBlock("div",qk," Icon tidak ditemukan ")):(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["grid gap-2",x.value])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.value,te=>(o.openBlock(),o.createElementBlock("button",{key:te,type:"button",class:o.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===te?"ring-1 ring-primary":""]),onClick:ue=>v(te),title:te},[o.createElementVNode("div",Yk,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(r)[te]),{size:n.iconSize},null,8,["size"])),o.createElementVNode("span",Gk,o.toDisplayString(te),1)])],10,Uk))),128))],2)),m.value&&k.value.length>0?(o.openBlock(),o.createElementBlock("div",Kk," Showing "+o.toDisplayString(C.value.length)+" / "+o.toDisplayString(k.value.length),1)):o.createCommentVNode("",!0)],36)])):o.createCommentVNode("",!0)])],512))}}),yo=o.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.Separator),o.mergeProps(o.unref(n),{class:o.unref(de)("shrink-0 bg-border",e.orientation==="horizontal"?"h-px w-full":"w-px h-full",e.class)}),null,16,["class"]))}}),Xk={class:"ps-3 pt-2"},Jk={class:"bg-warning -mt-5"},Jr=o.defineComponent({__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:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:g=>a("update:modelValue",g)}),s=o.ref(null),i=o.ref(null);let l=null,c=!1,d=0;function u(){if(l){try{l.close()}catch{}l=null,s.value&&(s.value.innerHTML=""),i.value=null}}async function f(g,y,B,D,M){const S=await new Promise((x,w)=>{const E=URL.createObjectURL(g),A=new Image;A.onload=()=>{URL.revokeObjectURL(E),x(A)},A.onerror=T=>{URL.revokeObjectURL(E),w(T)},A.src=E}),k=document.createElement("canvas");k.width=y,k.height=B;const C=k.getContext("2d");return C?(C.drawImage(S,0,0,y,B),await new Promise(x=>{k.toBlob(w=>x(w||g),D,M)})):g}function h(){if(!l||!i.value)return;const g=l.getPlugin("Dashboard"),y=l.getFile(i.value);!g||!y||requestAnimationFrame(()=>{try{g.openFileEditor(y)}catch{try{g.openFileEditor(i.value)}catch{}}})}async function m(g){if(l){l.cancelAll(),i.value=null;try{const y=l.addFile({name:g.name,type:g.type,data:g,source:"Local",isRemote:!1});i.value=String(y)}catch{}}}function b(){s.value&&(l&&u(),l=new vd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}}),l.use(is,{target:s.value,inline:!0,height:480,proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),l.use(Ld,{target:is,quality:n.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:n.aspectRatio==null?Number.NaN:n.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",g=>{i.value=(g==null?void 0:g.id)??null,n.autoOpenEditor&&setTimeout(()=>h(),80)}),l.on("file-editor:complete",async g=>{const y=++d;try{const B=g.data,D=B.type||g.type||"image/jpeg";let M=B;if(n.outputWidth&&n.outputHeight&&(M=await f(B,n.outputWidth,n.outputHeight,D,n.quality)),c||y!==d)return;const S=g.name||"edited-image.jpg",k=new File([M],S,{type:D});await p(k,"UPPY_EDITOR_COMPLETE"),a("done",k),r.value=!1}catch{}}))}async function p(g,y="CROP_RESULT"){const B=URL.createObjectURL(g);try{const D=await new Promise((M,S)=>{const k=new Image;k.onload=()=>M(k),k.onerror=S,k.src=B});console.group(y),console.log("file:",g),console.table({name:g.name,type:g.type,sizeBytes:g.size,sizeMB:+(g.size/1024/1024).toFixed(3),width:D.naturalWidth,height:D.naturalHeight,ratio:+(D.naturalWidth/D.naturalHeight).toFixed(4)}),console.log("previewUrl:",B),console.groupEnd()}finally{URL.revokeObjectURL(B)}}return o.watch(r,async g=>{c=!g,d++,g?(await o.nextTick(),b(),n.file&&await m(n.file)):u()},{flush:"post"}),o.watch(()=>n.file,async g=>{r.value&&g&&(await o.nextTick(),await m(g))}),o.onBeforeUnmount(()=>{c=!0,d++,u()}),(g,y)=>(o.openBlock(),o.createBlock(o.unref(nd),{open:r.value,"onUpdate:open":y[2]||(y[2]=B=>r.value=B)},{default:o.withCtx(()=>[o.createVNode(o.unref(od),{class:"max-w-[750px] p-0 overflow-hidden",onInteractOutside:y[0]||(y[0]=o.withModifiers(()=>{},["prevent"])),onEscapeKeyDown:y[1]||(y[1]=o.withModifiers(()=>{},["prevent"]))},{default:o.withCtx(()=>[o.createElementVNode("div",Xk,[o.createVNode(o.unref(lk),{class:""},{default:o.withCtx(()=>[...y[3]||(y[3]=[o.createTextVNode(" Crop & Resize ",-1)])]),_:1}),y[4]||(y[4]=o.createElementVNode("div",{class:"flex items-center justify-end"},null,-1))]),o.createVNode(o.unref(yo)),o.createElementVNode("div",Jk,[o.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])]),_:1})]),_:1},8,["open"]))}}),Qk={key:0,class:"text-xs text-muted-foreground"},Zk=["src"],ew={class:"absolute top-2 inset-x-2 flex items-center justify-between"},tw={class:"absolute left-2 bottom-2 z-10 inline-block max-w-[calc(100%-16px)] rounded-xl border px-3 py-2 shadow-lg backdrop-blur opacity-0 translate-y-1 scale-[0.99] transition-all duration-200 group-hover:opacity-100 group-hover:translate-y-0 group-hover:scale-100 border-border/60 dark:border-border/50 bg-background/80 dark:bg-background/30"},nw={class:"text-[11px] text-foreground/90 space-y-1 whitespace-nowrap"},ow={class:"flex gap-2"},aw={class:"font-medium truncate"},rw={class:"flex gap-2"},sw={class:"font-medium"},iw={class:"flex gap-2"},lw={class:"font-medium truncate"},Qr=o.defineComponent({__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:e}){const n=t,a=e,r=o.ref(null);o.watch(()=>n.file,l=>{r.value&&URL.revokeObjectURL(r.value),r.value=l?URL.createObjectURL(l):null},{immediate:!0}),o.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value)});function s(l){const c=l/1024,d=c/1024;return d>=1?`${d.toFixed(2)} MB`:c>=1?`${c.toFixed(1)} KB`:`${l} B`}const i=o.computed(()=>n.file?{name:n.file.name,size:s(n.file.size),type:n.file.type||"unknown"}:null);return(l,c)=>t.file?(o.openBlock(),o.createBlock($n,{key:0,class:o.normalizeClass(t.disabled?"opacity-60 pointer-events-none":"")},{default:o.withCtx(()=>[o.createVNode(bo,{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(wa,{class:"text-sm font-semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),t.description?(o.openBlock(),o.createElementBlock("div",Qk,o.toDisplayString(t.description),1)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(Tn,{class:"pt-2"},{default:o.withCtx(()=>{var d,u,f;return[o.createElementVNode("div",{class:"group relative rounded-xl overflow-hidden bg-muted border-2 border-dashed border-border w-full transition-colors duration-200 hover:border-primary/50 hover:bg-primary/5",style:o.normalizeStyle({height:`${t.previewHeight}px`})},[r.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Zk)):o.createCommentVNode("",!0),o.createElementVNode("div",ew,[t.showEdit?(o.openBlock(),o.createBlock(ht,{key:0,icon:o.unref(ne.Pencil),size:"icon",variant:"secondary",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:c[0]||(c[0]=h=>a("edit"))},null,8,["icon","disabled"])):o.createCommentVNode("",!0),t.showRemove?(o.openBlock(),o.createBlock(ht,{key:1,icon:o.unref(ne.Trash2),size:"icon",variant:"destructive",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:c[1]||(c[1]=h=>a("remove"))},null,8,["icon","disabled"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",tw,[o.createElementVNode("div",nw,[o.createElementVNode("div",ow,[c[2]||(c[2]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Nama",-1)),o.createElementVNode("span",aw,o.toDisplayString((d=i.value)==null?void 0:d.name),1)]),o.createElementVNode("div",rw,[c[3]||(c[3]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Ukuran",-1)),o.createElementVNode("span",sw,o.toDisplayString((u=i.value)==null?void 0:u.size),1)]),o.createElementVNode("div",iw,[c[4]||(c[4]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Tipe",-1)),o.createElementVNode("span",lw,o.toDisplayString((f=i.value)==null?void 0:f.type),1)])])])],4)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}}),cw={class:"space-y-3"},dw={name:"DCodeImageField"},Zr=o.defineComponent({...dw,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:2},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:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:z=>a("update:modelValue",z)}),s=o.ref(!1),i=o.ref(null),l=o.ref(null),c=o.ref(null);function d(z){c.value=z,a("error",z)}function u(){c.value=null}const f=o.computed(()=>{const z=(n.allowedTypes??"").trim();return z?z.split(/[,\s;]+/g).map(W=>W.trim().toLowerCase()).filter(Boolean).map(W=>W.includes("/")||W.startsWith(".")?W:`.${W}`):[]});function h(z){const v=z.lastIndexOf(".");return v>=0?z.slice(v).toLowerCase():""}const m=o.computed(()=>{if(f.value.length){const z=f.value.filter(W=>W.startsWith("."));return[...f.value.filter(W=>W.includes("/")),...z].join(",")}return n.accept||"image/*"}),b=o.computed(()=>f.value.length?f.value.join(", "):n.accept||"image/*");function p(z){if(f.value.length){const W=(z.type||"").toLowerCase(),O=h(z.name);return f.value.some(N=>N.includes("/")?W===N:N.startsWith(".")?O===N:O===`.${N}`)}return(n.accept||"image/*").toLowerCase().includes("image/")?(z.type||"").toLowerCase().startsWith("image/"):!0}function g(z){return z*1024*1024}async function y(z){var v;return(v=z.type)!=null&&v.startsWith("image/")?await new Promise(W=>{const O=URL.createObjectURL(z),N=new Image;N.onload=()=>{URL.revokeObjectURL(O),W({w:N.naturalWidth,h:N.naturalHeight})},N.onerror=()=>{URL.revokeObjectURL(O),W(null)},N.src=O}):null}async function B(z){if(!(n.minWidth!=null||n.minHeight!=null||n.maxWidth!=null||n.maxHeight!=null))return null;const W=await y(z);return W?n.minWidth!=null&&W.w<n.minWidth?`Lebar gambar minimal ${n.minWidth}px`:n.minHeight!=null&&W.h<n.minHeight?`Tinggi gambar minimal ${n.minHeight}px`:n.maxWidth!=null&&W.w>n.maxWidth?`Lebar gambar maksimal ${n.maxWidth}px`:n.maxHeight!=null&&W.h>n.maxHeight?`Tinggi gambar maksimal ${n.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function D(z){return z?p(z)?n.minSizeMb!=null&&z.size<g(n.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${n.minSizeMb}MB`:n.maxSizeMb!=null&&z.size>g(n.maxSizeMb)?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:await B(z):`only Allowed: ${b.value}`:"File tidak valid"}function M(z){n.disabled||(i.value=z,s.value=!0)}async function S(z){if(n.disabled)return;u();const v=await D(z);if(v){d(v);return}l.value=z,M(z)}const{DCodeApi:k}=at(),C=rd(),x=o.ref(!1);o.ref(null);function w(z,v){return!z||!v?null:z.replace(/\/+$/,"")+"/"+v.replace(/^\/+/,"")}function E(z){var N;const v=(z==null?void 0:z.data)??z,W=(N=v==null?void 0:v.data)==null?void 0:N[0];if(!W)return null;const O=w(W.server,W.url);return{...W,fullUrl:O?encodeURI(O):null}}async function A(z){var v;if(n.uploadFn){try{x.value=!0;const W=await n.uploadFn(z);r.value=z,a("uploaded",W)}catch(W){console.error("Upload Error",W),C.error("Upload Failed",(W==null?void 0:W.message)||"Unknown error"),d((W==null?void 0:W.message)||"Upload Failed")}finally{x.value=!1}return}if(!((v=n.endpoint)!=null&&v.apiUrl)){r.value=z;return}if(typeof k!="function"){d("useApi() must expose DCodeApi()");return}try{x.value=!0;const W=new FormData;W.append("doc",z);const O=(n.endpoint.apiMethod||"POST").toUpperCase(),N=n.endpoint.apiUrl,H=await k("","",W,{_url:N,_method:O,withCredentials:!0,transformRequest:[(J,te)=>(te&&(delete te["Content-Type"],delete te["content-type"]),J)]}),j=(H==null?void 0:H.data)??H;E(j),r.value=z,a("uploaded",j)}catch(W){console.error("Upload Error",W),C.error("Upload Failed",(W==null?void 0:W.message)||"Unknown error"),d((W==null?void 0:W.message)||"Upload Failed")}finally{x.value=!1}}async function T(z){var v;u(),n.uploadFn||(v=n.endpoint)!=null&&v.apiUrl?await A(z):r.value=z,s.value=!1,i.value=null}function F(){s.value=!1,i.value=null}async function L(){if(!r.value)return;u();const z=n.editUseOriginal?l.value??r.value:r.value,v=await D(z);if(v){d(v);return}M(z)}function Y(){u(),r.value=null,i.value=null,s.value=!1,l.value=null}return o.watch(()=>n.modelValue,z=>{z&&!l.value&&(l.value=z),z||(l.value=null)},{immediate:!0}),(z,v)=>(o.openBlock(),o.createElementBlock("div",cw,[r.value?(o.openBlock(),o.createBlock(Qr,{key:1,file:r.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:L,onRemove:Y,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(o.openBlock(),o.createBlock(_a,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:S,error:c.value,onError:v[0]||(v[0]=W=>d(W))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),o.createVNode(Jr,{modelValue:s.value,"onUpdate:modelValue":v[1]||(v[1]=W=>s.value=W),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:T,onCancel:F},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),uw={key:0,class:"text-red-500"},es=o.defineComponent({__name:"DCodeLabel",props:{label:{},text:{},required:{type:Boolean},customClass:{},htmlFor:{}},setup(t){return(e,n)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.htmlFor?"label":"span"),{for:t.htmlFor,class:o.normalizeClass(["text-xs font-medium text-slate-600 ml-1",t.customClass])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label||t.text)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",uw,"*")):o.createCommentVNode("",!0)]),_:1},8,["for","class"]))}}),fw=["aria-busy"],hw={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},mw={key:0,class:"ml-1 text-destructive"},pw={class:"min-w-0 flex-1 text-left"},gw={key:0,class:"flex flex-wrap gap-1.5"},bw={class:"max-w-[220px] truncate"},yw=["onClick"],xw={key:1,class:"text-muted-foreground truncate"},kw={class:"flex items-center gap-2 shrink-0"},ww={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},_w={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},Cw=["disabled","onClick"],Bw={class:"truncate"},Sw={key:0,class:"text-primary-600 dark:text-primary-400"},Ew={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},Dw={key:0},Vw={key:1},Mw={key:1,class:"text-xs text-destructive"},Nw={name:"DCodeMultiSelect"},ld=o.defineComponent({...Nw,name:"DCodeMultiSelect",inheritAttrs:!1,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:2},maxSelected:{default:3},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:e}){const n=o.useAttrs(),a=e,r=t,s=o.computed(()=>(r.label||n.label)??void 0),i=o.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=o.computed(()=>`app-multiselect-${n.id||s.value||"field"}-${l}`),d=o.computed(()=>{if(r.required)return!0;const G=n.required,ee=n["aria-required"];return G===""||G===!0||G==="true"||(ee==="true"||ee===!0)}),u=o.computed(()=>!!r.error);function f(G){return G?typeof r.itemTitle=="function"?r.itemTitle(G)??"":String((G==null?void 0:G[r.itemTitle])??""):""}function h(G){return G?typeof r.itemValue=="function"?r.itemValue(G):G==null?void 0:G[r.itemValue]:null}function m(G,ee){return h(G)??ee}const b=o.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),p=o.computed(()=>{var G;return!!((G=r.endpoint)!=null&&G.apiUrl)||!!r.fetchItems}),g=o.ref([]),y=o.ref(!1),B=o.ref(!1),D=o.computed(()=>{var ee;const G=(ee=r.endpoint)==null?void 0:ee.apiOptions;if(G)return typeof G=="function"?G():G}),M=o.computed(()=>{var me,$e;const G=((me=r.endpoint)==null?void 0:me.apiUrl)??"",ee=((($e=r.endpoint)==null?void 0:$e.apiMethod)??"GET").toUpperCase(),ae=JSON.stringify(D.value??null);return`${ee} ${G} :: ${ae}`}),S=o.computed(()=>p.value?g.value:r.items||[]);async function k(){var G;if(p.value&&!(!((G=r.endpoint)!=null&&G.apiUrl)&&!r.fetchItems)&&!y.value){y.value=!0;try{let ee;if(r.fetchItems){const ae=await r.fetchItems(),me=(ae==null?void 0:ae.data)??ae;ee=(me==null?void 0:me.data)??me}else{const{DCodeApi:ae}=at();if(typeof ae!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const me={page:1,perPage:100,...D.value||{}},$e=await ae("","",me,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),lt=($e==null?void 0:$e.data)??$e;ee=(lt==null?void 0:lt.data)??lt}g.value=Array.isArray(ee)?ee:[],B.value=!0}catch(ee){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",ee),g.value=[]}finally{y.value=!1}}}o.watch(()=>M.value,()=>{g.value=[],B.value=!1}),o.onMounted(()=>{r.autoFetchOnMount&&p.value&&k()});const C=o.computed(()=>{const G=b.value;if(r.returnObject)return G;const ee=new Map;for(const ae of S.value)ee.set(h(ae),ae);return G.map(ae=>ee.get(ae)??{[r.itemValue]:ae,[r.itemTitle]:String(ae)})}),x=o.computed(()=>r.maxChips===null?C.value:C.value.slice(0,r.maxChips));function w(G){const ee=b.value;if(r.returnObject){const ae=h(G);return ee.some(me=>h(me)===ae)}return ee.includes(h(G))}const E=o.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const G=Number(r.maxSelected);return Number.isFinite(G)&&G>0?G:null}),A=o.computed(()=>{const G=E.value;return G===null?!1:b.value.length>=G});function T(G){return!w(G)&&A.value}const F=o.computed(()=>{const G=b.value,ee=new Set;if(r.returnObject)for(const ae of G)ee.add(h(ae));else for(const ae of G)ee.add(ae);return ee}),L=o.computed(()=>{const G=F.value;return(S.value||[]).filter(ee=>!G.has(h(ee)))}),Y=o.computed(()=>S.value.length===0?!1:L.value.length===0),z=o.ref(null),v=o.ref(null),W=o.ref(null),O=o.ref(!1),N=o.ref(""),H=o.ref(0),j=o.ref(0),{floatingStyles:J}=Ha(z,v,{whileElementsMounted:va,placement:"bottom-start",middleware:[La(8),ja(),Ia({padding:8}),Wa({apply({rects:G,elements:ee}){Object.assign(ee.floating.style,{width:`${G.reference.width}px`,"--floating-width":`${G.reference.width}px`})}})]}),te=o.computed(()=>J.value),ue=o.computed(()=>{const G=Number(r.maxRows);return Number.isFinite(G)&&G>0?G:5});async function fe(){r.disabled||(O.value=!0,j.value=0,requestAnimationFrame(()=>{W.value&&(W.value.scrollTop=0),H.value=0}),p.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!B.value)&&!y.value&&await k())}function pe(){O.value=!1}function Le(){O.value?pe():fe()}function be(G){var ae,me;if(!O.value)return;const ee=G.target;(ae=z.value)!=null&&ae.contains(ee)||(me=v.value)!=null&&me.contains(ee)||pe()}o.onMounted(()=>document.addEventListener("mousedown",be)),o.onBeforeUnmount(()=>document.removeEventListener("mousedown",be));function U(G){if(r.disabled)return;if(T(G)){a("max");return}const ee=[...b.value];if(r.returnObject){const ae=h(G);if(ee.some($e=>h($e)===ae))return;a("update:modelValue",[...ee,G])}else{const ae=h(G);if(ee.includes(ae))return;a("update:modelValue",[...ee,ae])}N.value="",j.value=0,requestAnimationFrame(()=>{W.value&&(W.value.scrollTop=0),H.value=0})}function P(G){if(r.disabled)return;const ee=[...b.value];if(r.returnObject){const ae=h(G);a("update:modelValue",ee.filter(me=>h(me)!==ae))}else{const ae=h(G);a("update:modelValue",ee.filter(me=>me!==ae))}}function q(){r.disabled||(a("update:modelValue",[]),a("clear"),pe())}const oe=o.computed(()=>{const G=N.value.trim().toLowerCase(),ee=L.value;return G?ee.filter(ae=>f(ae).toLowerCase().includes(G)):ee}),he=o.computed(()=>oe.value.length);o.watch(O,G=>{G||(N.value="")});const ze=o.computed(()=>{if(Y.value)return r.itemHeight;const G=he.value;return(G<=0?1:Math.min(G,ue.value))*r.itemHeight}),ot=o.computed(()=>r.virtual?he.value*r.itemHeight:0),At=o.computed(()=>r.virtual?Math.ceil(ze.value/r.itemHeight)+r.overscan:he.value),$t=o.computed(()=>{if(!r.virtual)return 0;const G=Math.floor(H.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,G)}),bn=o.computed(()=>r.virtual?Math.min(he.value,$t.value+At.value):he.value),On=o.computed(()=>r.virtual?$t.value*r.itemHeight:0),Qe=o.computed(()=>{const G=oe.value;return r.virtual?G.slice($t.value,bn.value):G});function Tt(G){const ee=G.target;H.value=ee.scrollTop}function ko(G){return G===j.value}function R(G){const ee=W.value;if(!ee||!r.virtual)return;const ae=G*r.itemHeight,me=ae+r.itemHeight,$e=ee.scrollTop,lt=ee.scrollTop+ee.clientHeight;ae<$e?ee.scrollTop=ae:me>lt&&(ee.scrollTop=me-ee.clientHeight)}function Z(G){const ee=Math.max(0,he.value-1);j.value=Math.min(ee,Math.max(0,j.value+G)),R(j.value)}function ce(){const G=oe.value[j.value];G&&U(G)}const Ve=o.computed(()=>r.clearable&&!r.disabled&&C.value.length>0),Ae=o.computed(()=>u.value?"border-red-500 ring-[0.5px] ring-red-500":O.value?"border-gray-700 ring-[0.5px] ring-gray-700 dark:border-gray-300 dark:ring-gray-300":"");return(G,ee)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",hw)):o.createCommentVNode("",!0),ee[3]||(ee[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.value)+" ",1),d.value?(o.openBlock(),o.createElementBlock("span",mw,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"referenceEl",ref:z,class:"relative"},[o.createVNode(o.unref(Ce),{id:c.value,type:"button",variant:"outline",class:o.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border",["bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 text-foreground dark:text-gray-300",Ae.value]]),disabled:r.disabled,onClick:Le},{default:o.withCtx(()=>[o.createElementVNode("div",pw,[C.value.length?(o.openBlock(),o.createElementBlock("div",gw,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(x.value,(ae,me)=>(o.openBlock(),o.createBlock(o.unref(Xt),{key:`chip-${m(ae,me)}`,variant:"secondary",class:"gap-1"},{default:o.withCtx(()=>[o.createElementVNode("span",bw,o.toDisplayString(f(ae)),1),r.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:o.withModifiers($e=>P(ae),["stop"]),"aria-label":"Remove"}," ✕ ",8,yw))]),_:2},1024))),128)),r.maxChips!==null&&C.value.length>r.maxChips?(o.openBlock(),o.createBlock(o.unref(Xt),{key:0,variant:"secondary"},{default:o.withCtx(()=>[o.createTextVNode(" +"+o.toDisplayString(C.value.length-(r.maxChips??0)),1)]),_:1})):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",xw,o.toDisplayString(r.placeholder),1))]),o.createElementVNode("div",kw,[Ve.value?(o.openBlock(),o.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:o.withModifiers(q,["stop"]),"aria-label":"Clear"}," ✕ ")):o.createCommentVNode("",!0),o.createVNode(o.unref(ne.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])]),_:1},8,["id","disabled","class"]),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[O.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:v,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:o.normalizeStyle(te.value)},[r.searchable&&!Y.value?(o.openBlock(),o.createElementBlock("div",ww,[o.createVNode(o.unref(pn),{modelValue:N.value,"onUpdate:modelValue":ee[0]||(ee[0]=ae=>N.value=ae),placeholder:r.searchPlaceholder,class:"h-10",onKeydown:[ee[1]||(ee[1]=o.withKeys(o.withModifiers(ae=>Z(1),["prevent"]),["down"])),ee[2]||(ee[2]=o.withKeys(o.withModifiers(ae=>Z(-1),["prevent"]),["up"])),o.withKeys(o.withModifiers(ce,["prevent"]),["enter"]),o.withKeys(o.withModifiers(pe,["prevent"]),["esc"])]},null,8,["modelValue","placeholder","onKeydown"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"listEl",ref:W,class:"relative overflow-auto",style:o.normalizeStyle({height:ze.value+"px"}),onScroll:Tt},[Y.value?(o.openBlock(),o.createElementBlock("div",_w," All items have been selected ")):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[r.virtual?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({height:ot.value+"px"})},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:o.normalizeStyle(r.virtual?{transform:`translateY(${On.value}px)`}:void 0)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Qe.value,(ae,me)=>(o.openBlock(),o.createElementBlock("button",{key:String(m(ae,$t.value+me)),type:"button",class:o.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[T(ae)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",ko($t.value+me)?"bg-neutral-50 dark:bg-neutral-800/60":"",w(ae)?"font-semibold":"font-normal"]]),style:o.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||T(ae),onClick:$e=>U(ae)},[o.createElementVNode("span",Bw,o.toDisplayString(f(ae)),1),w(ae)?(o.openBlock(),o.createElementBlock("span",Sw,"✓")):o.createCommentVNode("",!0)],14,Cw))),128))],6),he.value===0?(o.openBlock(),o.createElementBlock("div",Ew,[y.value?(o.openBlock(),o.createElementBlock("span",Dw,"Loading data…")):(o.openBlock(),o.createElementBlock("span",Vw,"Tidak ada data"))])):o.createCommentVNode("",!0)],64))],36)],4)):o.createCommentVNode("",!0)]))],512),u.value?(o.openBlock(),o.createElementBlock("p",Mw,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,fw)),[[o.vShow,i.value]])}}),Pw={class:"space-y-3"},Aw={key:0,class:"text-lg font-medium"},$w={class:"flex flex-wrap items-center gap-2 sm:gap-4"},ts=o.defineComponent({name:"DCodeOtpInput",__name:"DCodeOtpInput",props:{totalInput:{default:6},default:{default:""},label:{default:""}},emits:["updateOtp"],setup(t,{emit:e}){const n=t,a=e,r=o.ref([]),s=o.ref([]),i=o.computed(()=>{const p=Number(n.totalInput);return p&&p>0?p:6}),l=()=>{s.value=Array.from({length:i.value},(p,g)=>{var y;return((y=n.default)==null?void 0:y[g])??""}),a("updateOtp",s.value.join(""))};l(),o.watch(()=>[n.totalInput,n.default],()=>l());const c=p=>{p<0||p>=i.value||o.nextTick(()=>{var g;return(g=r.value[p])==null?void 0:g.focus()})},d=p=>p.match(/[a-zA-Z0-9]/)?p.match(/[a-zA-Z0-9]/)[0]:"",u=(p,g)=>{s.value[p]=d(g),a("updateOtp",s.value.join(""))},f=(p,g)=>{const y=p.key,B=/^\d$/.test(y),D=/^[a-zA-Z]$/.test(y);if(y==="Backspace"){if(p.preventDefault(),s.value[g]){u(g,"");return}g>0&&(u(g-1,""),c(g-1));return}if(y==="ArrowLeft"){p.preventDefault(),c(g-1);return}if(y==="ArrowRight"){p.preventDefault(),c(g+1);return}if(B||D){p.preventDefault(),u(g,y),g<i.value-1&&c(g+1);return}y.length===1&&p.preventDefault()},h=(p,g)=>{const y=p.target,B=y.value??"",D=d(B);y.value=D,u(g,D),D&&g<i.value-1&&c(g+1)},m=(p,g)=>{var M;p.preventDefault();const B=(((M=p.clipboardData)==null?void 0:M.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!B)return;let D=g;for(const S of B){if(D>=i.value)break;s.value[D]=S,D++}a("updateOtp",s.value.join("")),c(Math.min(D,i.value-1))},b=p=>g=>{const y=(g==null?void 0:g.$el)??null;r.value[p]=y};return(p,g)=>(o.openBlock(),o.createElementBlock("div",Pw,[n.label||i.value?(o.openBlock(),o.createElementBlock("h6",Aw,o.toDisplayString(n.label||`Type your ${i.value} digit security code`),1)):o.createCommentVNode("",!0),o.createElementVNode("div",$w,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,y=>(o.openBlock(),o.createBlock(o.unref(pn),{key:y,ref_for:!0,ref:b(y-1),value:s.value[y-1]||"",type:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"OTP digit",class:"flex-1 w-auto min-w-8 max-w-14 aspect-square h-auto p-0 text-center text-lg sm:text-xl font-medium",onKeydown:B=>f(B,y-1),onInput:B=>h(B,y-1),onPaste:B=>m(B,y-1)},null,8,["value","onKeydown","onInput","onPaste"]))),128))])]))}}),Tw={class:"w-full"},Ow={key:0,class:"flex items-center justify-between mb-2"},zw={key:0,class:"text-sm font-medium text-gray-700"},Fw={key:1,class:"text-sm text-gray-600"},Rw={name:"DCodeProgress"},cd=o.defineComponent({...Rw,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:e}){const n=t,a=o.computed(()=>Math.min(n.modelValue/n.max*100,100)),r=o.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[n.size],"bg-gray-200"].join(" ")),s=o.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[n.color]||l.blue];return n.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),n.animated&&c.push("animate-pulse"),c.join(" ")}),i=o.computed(()=>`${Math.round(a.value)}%`);return(l,c)=>(o.openBlock(),o.createElementBlock("div",Tw,[t.label||t.showValue?(o.openBlock(),o.createElementBlock("div",Ow,[t.label?(o.openBlock(),o.createElementBlock("span",zw,o.toDisplayString(t.label),1)):o.createCommentVNode("",!0),t.showValue?(o.openBlock(),o.createElementBlock("span",Fw,o.toDisplayString(i.value),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(r.value)},[o.createElementVNode("div",{class:o.normalizeClass(s.value),style:o.normalizeStyle({width:`${a.value}%`})},null,6)],2)]))}}),vw={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},dd=Hn(o.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(e,n)=>(o.openBlock(),o.createBlock(o.Transition,{name:"fade"},{default:o.withCtx(()=>[t.isApiLoading?(o.openBlock(),o.createElementBlock("div",vw,[o.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:o.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-5a7c62fb"]]),Lw={class:"flex flex-col"},Iw={class:"relative flex-shrink-0 mt-0.5"},jw=["id","name","value","checked","disabled","required"],Ww={class:"flex-1 min-w-0"},Hw={key:0,class:"ml-1 text-red-500"},qw={key:0,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Uw={name:"DCodeRadio"},ud=o.defineComponent({...Uw,name:"DCodeRadio",inheritAttrs:!1,props:{modelValue:{default:void 0},value:{default:void 0},label:{default:""},description:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},name:{default:""},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:e}){o.useAttrs();const n=e,a=t,r=o.computed(()=>a.id||`radio-${Math.random().toString(36).substr(2,9)}`),s=o.computed(()=>a.name||`radio-group-${Math.random().toString(36).substr(2,9)}`),i=o.computed(()=>!!a.error),l=o.computed(()=>a.modelValue===a.value),c=o.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),d=o.computed(()=>{const m={blue:{border:"border-blue-500",bg:"bg-blue-500",text:"text-blue-600",focus:"focus:ring-blue-500",checked:"bg-blue-500 border-blue-500"},green:{border:"border-green-500",bg:"bg-green-500",text:"text-green-600",focus:"focus:ring-green-500",checked:"bg-green-500 border-green-500"},red:{border:"border-red-500",bg:"bg-red-500",text:"text-red-600",focus:"focus:ring-red-500",checked:"bg-red-500 border-red-500"},yellow:{border:"border-yellow-500",bg:"bg-yellow-500",text:"text-yellow-600",focus:"focus:ring-yellow-500",checked:"bg-yellow-500 border-yellow-500"},purple:{border:"border-purple-500",bg:"bg-purple-500",text:"text-purple-600",focus:"focus:ring-purple-500",checked:"bg-purple-500 border-purple-500"},gray:{border:"border-gray-500",bg:"bg-gray-500",text:"text-gray-600",focus:"focus:ring-gray-500",checked:"bg-gray-500 border-gray-500"}};return m[a.color]||m.blue}),u=o.computed(()=>["relative rounded-full border-2 transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-offset-2",c.value.radio,i.value?"border-red-500 focus:ring-red-500":d.value.border,l.value?d.value.checked:"bg-white",a.disabled?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer pointer-events-auto"]),f=o.computed(()=>["absolute inset-0 m-auto rounded-full transition-all duration-200",{"w-3 h-3":"w-2 h-2","w-4 h-4":"w-2.5 h-2.5","w-5 h-5":"w-3 h-3"}[c.value.radio]||"w-2.5 h-2.5",l.value?d.value.bg:"bg-transparent"]),h=m=>{m.target.checked&&(n("update:modelValue",a.value),n("change",a.value))};return(m,b)=>(o.openBlock(),o.createElementBlock("div",Lw,[o.createElementVNode("div",{class:o.normalizeClass(["flex items-start",c.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[o.createElementVNode("div",Iw,[o.createElementVNode("input",{id:r.value,name:s.value,type:"radio",value:t.value,checked:l.value,disabled:t.disabled,required:t.required,class:o.normalizeClass(["sr-only",{peer:!t.disabled}]),onChange:h},null,42,jw),o.createElementVNode("div",{class:o.normalizeClass(u.value),onClick:b[0]||(b[0]=p=>!t.disabled&&(l.value?null:n("update:modelValue",a.value)))},[o.createElementVNode("div",{class:o.normalizeClass(f.value)},null,2)],2)]),o.createElementVNode("div",Ww,[t.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:r.value,class:o.normalizeClass([c.value.label,"font-medium cursor-pointer select-none text-gray-900",t.disabled?"cursor-not-allowed opacity-50":""])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",Hw,"*")):o.createCommentVNode("",!0)]),_:1},8,["for","class"])):o.createCommentVNode("",!0),t.description?(o.openBlock(),o.createElementBlock("p",{key:1,class:o.normalizeClass(["text-sm text-gray-600 mt-1",t.disabled?"opacity-50":""])},o.toDisplayString(t.description),3)):o.createCommentVNode("",!0)])],2),i.value?(o.openBlock(),o.createElementBlock("div",qw,[b[1]||(b[1]=o.createElementVNode("svg",{class:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),o.createTextVNode(" "+o.toDisplayString(t.error),1)])):o.createCommentVNode("",!0)]))}}),Yw={class:"cursor-pointer block relative h-full"},Gw=["name","value","checked"],Kw={class:"h-24 flex flex-col items-center justify-center gap-3 rounded-xl border-2 p-4 text-center transition-all duration-300 ease-out border-gray-200 bg-white dark:bg-zinc-900 dark:border-zinc-700 hover:-translate-y-1 hover:shadow-lg hover:border-blue-300 peer-checked:border-blue-500 peer-checked:bg-blue-50 dark:peer-checked:bg-blue-900/20 peer-checked:ring-2 peer-checked:ring-blue-200 dark:peer-checked:ring-blue-800 peer-checked:scale-[1.02]"},Xw={key:0,class:"flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-zinc-800 text-gray-500 dark:text-gray-400 transition-colors duration-300 peer-checked:bg-blue-100 dark:peer-checked:bg-blue-800 peer-checked:text-blue-600 dark:peer-checked:text-blue-200"},Jw={class:"flex flex-col gap-1"},Qw={class:"font-medium text-sm text-gray-800 dark:text-gray-200 transition-colors duration-300 peer-checked:text-blue-700 dark:peer-checked:text-blue-300"},Zw={key:0,class:"text-xs text-gray-400"},e1={name:"DCodeRadioCustom"},fd=o.defineComponent({...e1,props:{modelValue:{},value:{},labelID:{default:""},labelEN:{default:""},placeholderID:{default:""},placeholderEN:{default:""},icon:{default:""},name:{default:"radio-custom"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,{locale:a}=wo.useI18n(),r=o.computed(()=>{const d=a.value.toLowerCase(),u=d==="en"||d.startsWith("en-"),f=n.labelEN,h=n.labelID;return u?f||h:h||f}),s=o.computed(()=>{const d=a.value.toLowerCase(),u=d==="en"||d.startsWith("en-"),f=n.placeholderEN,h=n.placeholderID;return u?f||h:h||f}),i=e,l=()=>{i("update:modelValue",n.value)},c=d=>d?typeof d!="string"?d:Qt[d]||null:null;return o.watch(()=>n.modelValue===n.value,(d,u)=>{},{immediate:!0}),(d,u)=>(o.openBlock(),o.createElementBlock("label",Yw,[o.createElementVNode("input",{type:"radio",class:"hidden peer",name:t.name,value:t.value,checked:t.modelValue===t.value,onChange:l},null,40,Gw),o.createElementVNode("div",Kw,[t.icon?(o.openBlock(),o.createElementBlock("div",Xw,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(c(t.icon)),{class:"h-5 w-5"}))])):o.createCommentVNode("",!0),o.createElementVNode("div",Jw,[o.createElementVNode("p",Qw,o.toDisplayString(r.value),1),s.value?(o.openBlock(),o.createElementBlock("p",Zw,o.toDisplayString(s.value),1)):o.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"},hd=o.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(t,{emit:e}){const n=o.useAttrs(),a=e,r=t,s=o.ref(),i=o.ref(!1),l=o.computed(()=>!!r.error),c=o.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=o.computed(()=>(r.label||n.label)??void 0),u=o.computed(()=>!0),f=o.computed(()=>{const S={sm:"h-2",md:"h-2.5",lg:"h-3"},k={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-gray-200 rounded-lg outline-none transition-all cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed",S[r.size],k[r.color]||k.blue,l.value?"accent-red-500":"",n.class].filter(Boolean).join(" ")}),h=o.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=o.computed(()=>`${r.valuePrefix}${r.modelValue}${r.valueSuffix}`),b=o.computed(()=>{const S=r.max-r.min;return(r.modelValue-r.min)/S*100}),p=S=>{const k=S.target,C=parseFloat(k.value);a("update:modelValue",C),a("input",C)},g=S=>{const k=S.target,C=parseFloat(k.value);a("change",C)},y=()=>{i.value=!0},B=()=>{i.value=!1},D=S=>{const k=r.max-r.min;return(S-r.min)/k*100},M=o.computed(()=>{const S={sm:16,md:20,lg:24};return`
63
+ `.trim();let r=document.getElementById(e);r||(r=document.createElement("style"),r.id=e,document.head.appendChild(r)),r.textContent=a}function px(t,e=Oc){o.watch(t,n=>mx(n,e),{immediate:!0})}const gx={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},bx={key:0,class:"ml-1 text-destructive"},yx={class:"relative w-full group"},xx={class:"absolute inset-y-0 left-3 flex items-center pointer-events-none"},kx={key:0,class:"absolute inset-y-0 left-9 flex items-center text-muted-foreground"},wx={class:"h-full p-2 flex flex-col gap-3 w-32"},_x={class:"flex items-center justify-end gap-2 w-full p-2"},Cx={key:1,class:"text-xs text-destructive"},Ir=o.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:e}){const n=o.useAttrs(),a=t,r=e,s=Math.random().toString(36).slice(2,7),i=o.computed(()=>`dcode-datepicker-${n.id||a.label||"date-picker"}-${s}`),l=o.computed(()=>{const F=n.required,L=n["aria-required"];return F===""||F===!0||F==="true"||L==="true"||L===!0}),c=o.computed(()=>!!a.error),d=o.computed({get:()=>a.modelValue,set:F=>{r("update:modelValue",F),r("change",F)}}),u=o.computed(()=>a.locale==="en"?Ec:hx),f=o.computed(()=>a.range?2:!1),h=o.computed(()=>a.range?{partialRange:!1}:!1),m=F=>{const L=new Date(F);return L.setHours(0,0,0,0),L},b=F=>{const L=new Date(F);return L.setHours(23,59,59,999),L},p=(F,L)=>{const Y=new Date(F);return Y.setDate(Y.getDate()+L),Y},g=o.computed(()=>{}),y=o.computed(()=>{if(a.maxDaysAhead&&a.maxDaysAhead>0)return b(p(new Date,a.maxDaysAhead))}),B=o.ref(null),D=o.ref(null),M=F=>{D.value={month:F.month,year:F.year}},S=o.ref(!1);let k=null;o.onMounted(()=>{const F=document.documentElement,L=()=>S.value=F.classList.contains("dark");L(),k=new MutationObserver(L),k.observe(F,{attributes:!0,attributeFilter:["class"]})}),o.onBeforeUnmount(()=>{k==null||k.disconnect(),k=null}),px(o.toRef(a,"tone"));const C=F=>{const L=new Date(F),Y=L.getDay(),z=L.getDate()-Y+(Y===0?-6:1);return L.setDate(z),m(L)},x=F=>{const L=C(F);return L.setDate(L.getDate()+6),b(L)},w=F=>{const L=new Date(F);return L.setDate(1),m(L)},E=F=>{const L=new Date(F);return L.setMonth(L.getMonth()+1),L.setDate(0),b(L)},A=o.computed(()=>{if(!a.range)return[];const F=new Date;return[{label:a.locale==="id"?"Minggu Ini":"This Week",range:[C(F),x(F)]},{label:a.locale==="id"?"Bulan Ini":"This Month",range:[w(F),E(F)]}]}),T=async F=>{var H,j;const L=a.modelType||"yyyy-MM-dd";if(F.length===0){d.value=null;return}if(F.length<2)return;const Y=$c(F[0],L),z=$c(F[1],L);d.value=[Y,z],await o.nextTick();const v=F[0],W=v.getMonth(),O=v.getFullYear();D.value&&D.value.month===W&&D.value.year===O||(H=B.value)==null||H.setMonthYear({month:W,year:O}),(j=B.value)==null||j.openMenu()};return(F,L)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class])},[t.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[t.label?(o.openBlock(),o.createElementBlock("div",gx)):o.createCommentVNode("",!0),L[2]||(L[2]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[t.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:i.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label)+" ",1),l.value?(o.openBlock(),o.createElementBlock("span",bx,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Fd.VueDatePicker),{ref_key:"dpRef",ref:B,modelValue:d.value,"onUpdate:modelValue":L[1]||(L[1]=Y=>d.value=Y),dark:S.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":g.value,"max-date":y.value,"preset-ranges":A.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:M},o.createSlots({"dp-input":o.withCtx(({value:Y,onInput:z,onEnter:v,onTab:W,onBlur:O,onFocus:N,onKeypress:H,onPaste:j,toggleMenu:J})=>[o.createElementVNode("div",yx,[o.createElementVNode("div",xx,[o.createVNode(o.unref(ne.Calendar),{class:"w-4 h-4 text-muted-foreground"})]),t.prependInner?(o.openBlock(),o.createElementBlock("div",kx,[o.createElementVNode("span",null,o.toDisplayString(t.prependInner),1)])):o.createCommentVNode("",!0),o.createVNode(o.unref(pn),{id:i.value,modelValue:Y,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",onClick:te=>J(),onFocus:te=>N(),onBlur:te=>O(),onInput:te=>z(te),onKeydown:[o.withKeys(te=>v(te),["enter"]),o.withKeys(te=>W(te),["tab"])],onKeypress:te=>H(te),onPaste:te=>j(),class:o.normalizeClass(["w-full h-10 flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-within:ring-1 focus-within:ring-white",t.prependInner?"pl-20":"pl-10",c.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""])},null,8,["id","modelValue","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste","class"])])]),"action-buttons":o.withCtx(({selectDate:Y,selectionDisabled:z})=>[o.createElementVNode("div",_x,[o.createVNode(o.unref(Ce),{type:"button",variant:"outline",onClick:L[0]||(L[0]=v=>{var W;return(W=B.value)==null?void 0:W.closeMenu()})},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.cancelLabel),1)]),_:1}),o.createVNode(o.unref(Ce),{type:"button",variant:"default",disabled:z,onClick:v=>Y()},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.selectLabel),1)]),_:1},8,["disabled","onClick"])])]),_:2},[t.range?{name:"left-sidebar",fn:o.withCtx(()=>[o.createElementVNode("div",wx,[A.value.length?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(A.value,Y=>(o.openBlock(),o.createBlock(o.unref(Ce),{key:Y.label,type:"button",variant:"default",class:"w-full",onClick:z=>T(Y.range)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Y.label),1)]),_:2},1032,["onClick"]))),128)):o.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?(o.openBlock(),o.createElementBlock("p",Cx,o.toDisplayString(a.error),1)):o.createCommentVNode("",!0)],64))],2))}}),Bx={class:"flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0"},Sx=o.defineComponent({__name:"Calendar",props:{defaultValue:{},defaultPlaceholder:{},placeholder:{},pagedNavigation:{type:Boolean},preventDeselect:{type:Boolean},weekStartsOn:{},weekdayFormat:{},calendarLabel:{},fixedWeeks:{type:Boolean},maxValue:{},minValue:{},locale:{},numberOfMonths:{},disabled:{type:Boolean},readonly:{type:Boolean},initialFocus:{type:Boolean},isDateDisabled:{type:Function},isDateUnavailable:{type:Function},dir:{},nextPage:{type:Function},prevPage:{type:Function},modelValue:{},multiple:{type:Boolean},disableDaysOutsideCurrentView:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue","update:placeholder"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarRoot),o.mergeProps({class:o.unref(de)("p-3",n.class)},o.unref(s)),{default:o.withCtx(({grid:c,weekDays:d})=>[o.createVNode(o.unref(Ax),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Ox)),o.createVNode(o.unref($x)),o.createVNode(o.unref(Tx))]),_:1}),o.createElementVNode("div",Bx,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c,u=>(o.openBlock(),o.createBlock(o.unref(Vx),{key:u.value.toString()},{default:o.withCtx(()=>[o.createVNode(o.unref(Nx),null,{default:o.withCtx(()=>[o.createVNode(o.unref(zc),null,{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(d,f=>(o.openBlock(),o.createBlock(o.unref(Px),{key:f},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(f),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),o.createVNode(o.unref(Mx),null,{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(u.rows,(f,h)=>(o.openBlock(),o.createBlock(o.unref(zc),{key:`weekDate-${h}`,class:"mt-2 w-full"},{default:o.withCtx(()=>[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(f,m=>(o.openBlock(),o.createBlock(o.unref(Ex),{key:m.toString(),date:m},{default:o.withCtx(()=>[o.createVNode(o.unref(Dx),{day:m,month:u.value},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))])]),_:1},16,["class"]))}}),Ex=o.defineComponent({__name:"CalendarCell",props:{date:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarCell),o.mergeProps({class:o.unref(de)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([data-selected])]:rounded-md [&:has([data-selected])]:bg-accent [&:has([data-selected][data-outside-view])]:bg-accent/50",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Dx=o.defineComponent({__name:"CalendarCellTrigger",props:{day:{},month:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarCellTrigger),o.mergeProps({class:o.unref(de)(o.unref(_t)({variant:"ghost"}),"h-8 w-8 p-0 font-normal","[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground","data-[selected]:bg-primary data-[selected]:text-primary-foreground data-[selected]:opacity-100 data-[selected]:hover:bg-primary data-[selected]:hover:text-primary-foreground data-[selected]:focus:bg-primary data-[selected]:focus:text-primary-foreground","data-[disabled]:text-muted-foreground data-[disabled]:opacity-50","data-[unavailable]:text-destructive-foreground data-[unavailable]:line-through","data-[outside-view]:text-muted-foreground data-[outside-view]:opacity-50 [&[data-outside-view][data-selected]]:bg-accent/50 [&[data-outside-view][data-selected]]:text-muted-foreground [&[data-outside-view][data-selected]]:opacity-30",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Vx=o.defineComponent({__name:"CalendarGrid",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGrid),o.mergeProps({class:o.unref(de)("w-full border-collapse space-y-1",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Mx=o.defineComponent({__name:"CalendarGridBody",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGridBody),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),Nx=o.defineComponent({__name:"CalendarGridHead",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGridHead),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),zc=o.defineComponent({__name:"CalendarGridRow",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarGridRow),o.mergeProps({class:o.unref(de)("flex",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Px=o.defineComponent({__name:"CalendarHeadCell",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarHeadCell),o.mergeProps({class:o.unref(de)("w-8 rounded-md text-[0.8rem] font-normal text-muted-foreground",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ax=o.defineComponent({__name:"CalendarHeader",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarHeader),o.mergeProps({class:o.unref(de)("relative flex w-full items-center justify-between pt-1",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),$x=o.defineComponent({__name:"CalendarHeading",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarHeading),o.mergeProps({class:o.unref(de)("text-sm font-medium",e.class)},o.unref(a)),{default:o.withCtx(({headingValue:i})=>[o.renderSlot(r.$slots,"default",{headingValue:i},()=>[o.createTextVNode(o.toDisplayString(i),1)])]),_:3},16,["class"]))}}),Tx=o.defineComponent({__name:"CalendarNextButton",props:{nextPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarNext),o.mergeProps({class:o.unref(de)(o.unref(_t)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronRight),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),Ox=o.defineComponent({__name:"CalendarPrevButton",props:{prevPage:{type:Function},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.CalendarPrev),o.mergeProps({class:o.unref(de)(o.unref(_t)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronLeft),{class:"h-4 w-4"})])]),_:3},16,["class"]))}}),zx=o.defineComponent({__name:"Popover",props:{defaultOpen:{type:Boolean},open:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.PopoverRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),Fx=o.defineComponent({inheritAttrs:!1,__name:"PopoverContent",props:{forceMount:{type:Boolean},side:{},sideOffset:{default:4},sideFlip:{type:Boolean},align:{default:"center"},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:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.PopoverPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.PopoverContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",n.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),Rx=o.defineComponent({__name:"PopoverTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.PopoverTrigger),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}});function jr(t,e){return t-e*Math.floor(t/e)}const Fc=1721426;function pa(t,e,n,a){e=Wr(t,e);let r=e-1,s=-2;return n<=2?s=0:ga(e)&&(s=-1),Fc-1+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Math.floor((367*n-362)/12+s+a)}function ga(t){return t%4===0&&(t%100!==0||t%400===0)}function Wr(t,e){return t==="BC"?1-e:e}function vx(t){let e="AD";return t<=0&&(e="BC",t=1-t),[e,t]}const Lx={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class ba{fromJulianDay(e){let n=e,a=n-Fc,r=Math.floor(a/146097),s=jr(a,146097),i=Math.floor(s/36524),l=jr(s,36524),c=Math.floor(l/1461),d=jr(l,1461),u=Math.floor(d/365),f=r*400+i*100+c*4+u+(i!==4&&u!==4?1:0),[h,m]=vx(f),b=n-pa(h,m,1,1),p=2;n<pa(h,m,3,1)?p=0:ga(m)&&(p=1);let g=Math.floor(((b+p)*12+373)/367),y=n-pa(h,m,g,1)+1;return new go(h,m,g,y)}toJulianDay(e){return pa(e.era,e.year,e.month,e.day)}getDaysInMonth(e){return Lx[ga(e.year)?"leapyear":"standard"][e.month-1]}getMonthsInYear(e){return 12}getDaysInYear(e){return ga(e.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(e){return 9999}getEras(){return["BC","AD"]}isInverseEra(e){return e.era==="BC"}balanceDate(e){e.year<=0&&(e.era=e.era==="BC"?"AD":"BC",e.year=1-e.year)}constructor(){this.identifier="gregory"}}function Ix(t,e){var n,a,r,s;return(s=(r=(n=t.isEqual)===null||n===void 0?void 0:n.call(t,e))!==null&&r!==void 0?r:(a=e.isEqual)===null||a===void 0?void 0:a.call(e,t))!==null&&s!==void 0?s:t.identifier===e.identifier}function Rc(t,e){return t.calendar.toJulianDay(t)-e.calendar.toJulianDay(e)}function jx(t,e){return vc(t)-vc(e)}function vc(t){return t.hour*36e5+t.minute*6e4+t.second*1e3+t.millisecond}let Hr=null;function Pn(){return Hr==null&&(Hr=new Intl.DateTimeFormat().resolvedOptions().timeZone),Hr}function Lc(t){t=qr(t,new ba);let e=Wr(t.era,t.year);return Ic(e,t.month,t.day,t.hour,t.minute,t.second,t.millisecond)}function Ic(t,e,n,a,r,s,i){let l=new Date;return l.setUTCHours(a,r,s,i),l.setUTCFullYear(t,e-1,n),l.getTime()}function jc(t,e){if(e==="UTC")return 0;if(t>0&&e===Pn())return new Date(t).getTimezoneOffset()*-6e4;let{year:n,month:a,day:r,hour:s,minute:i,second:l}=Hc(t,e);return Ic(n,a,r,s,i,l,0)-Math.floor(t/1e3)*1e3}const Wc=new Map;function Hc(t,e){let n=Wc.get(e);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:e,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Wc.set(e,n));let a=n.formatToParts(new Date(t)),r={};for(let s of a)s.type!=="literal"&&(r[s.type]=s.value);return{year:r.era==="BC"||r.era==="B"?-r.year+1:+r.year,month:+r.month,day:+r.day,hour:r.hour==="24"?0:+r.hour,minute:+r.minute,second:+r.second}}const qc=864e5;function Wx(t,e,n,a){return(n===a?[n]:[n,a]).filter(s=>Hx(t,e,s))}function Hx(t,e,n){let a=Hc(n,e);return t.year===a.year&&t.month===a.month&&t.day===a.day&&t.hour===a.hour&&t.minute===a.minute&&t.second===a.second}function qx(t,e,n="compatible"){let a=Yc(t);if(e==="UTC")return Lc(a);if(e===Pn()&&n==="compatible"){a=qr(a,new ba);let c=new Date,d=Wr(a.era,a.year);return c.setFullYear(d,a.month-1,a.day),c.setHours(a.hour,a.minute,a.second,a.millisecond),c.getTime()}let r=Lc(a),s=jc(r-qc,e),i=jc(r+qc,e),l=Wx(a,e,r-s,r-i);if(l.length===1)return l[0];if(l.length>1)switch(n){case"compatible":case"earlier":return l[0];case"later":return l[l.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(r-s,r-i);case"compatible":case"later":return Math.max(r-s,r-i);case"reject":throw new RangeError("No such absolute time found")}}function Uc(t,e,n="compatible"){return new Date(qx(t,e,n))}function Yc(t,e){let n=0,a=0,r=0,s=0;if("timeZone"in t)({hour:n,minute:a,second:r,millisecond:s}=t);else if("hour"in t&&!e)return t;return e&&({hour:n,minute:a,second:r,millisecond:s}=e),new xa(t.calendar,t.era,t.year,t.month,t.day,n,a,r,s)}function qr(t,e){if(Ix(t.calendar,e))return t;let n=e.fromJulianDay(t.calendar.toJulianDay(t)),a=t.copy();return a.calendar=e,a.era=n.era,a.year=n.year,a.month=n.month,a.day=n.day,An(a),a}function Ur(t,e){let n=t.copy(),a="hour"in n?Jx(n,e):0;Yr(n,e.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,t),n.month+=e.months||0,Gr(n),Gc(n),n.day+=(e.weeks||0)*7,n.day+=e.days||0,n.day+=a,Ux(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let r=n.calendar.getYearsInEra(n);if(n.year>r){var s,i;let c=(s=(i=n.calendar).isInverseEra)===null||s===void 0?void 0:s.call(i,n);n.year=r,n.month=c?1:n.calendar.getMonthsInYear(n),n.day=c?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let l=n.calendar.getMonthsInYear(n);return n.month>l&&(n.month=l,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function Yr(t,e){var n,a;!((n=(a=t.calendar).isInverseEra)===null||n===void 0)&&n.call(a,t)&&(e=-e),t.year+=e}function Gr(t){for(;t.month<1;)Yr(t,-1),t.month+=t.calendar.getMonthsInYear(t);let e=0;for(;t.month>(e=t.calendar.getMonthsInYear(t));)t.month-=e,Yr(t,1)}function Ux(t){for(;t.day<1;)t.month--,Gr(t),t.day+=t.calendar.getDaysInMonth(t);for(;t.day>t.calendar.getDaysInMonth(t);)t.day-=t.calendar.getDaysInMonth(t),t.month++,Gr(t)}function Gc(t){t.month=Math.max(1,Math.min(t.calendar.getMonthsInYear(t),t.month)),t.day=Math.max(1,Math.min(t.calendar.getDaysInMonth(t),t.day))}function An(t){t.calendar.constrainDate&&t.calendar.constrainDate(t),t.year=Math.max(1,Math.min(t.calendar.getYearsInEra(t),t.year)),Gc(t)}function Yx(t){let e={};for(let n in t)typeof t[n]=="number"&&(e[n]=-t[n]);return e}function Kc(t,e){return Ur(t,Yx(e))}function Xc(t,e){let n=t.copy();return e.era!=null&&(n.era=e.era),e.year!=null&&(n.year=e.year),e.month!=null&&(n.month=e.month),e.day!=null&&(n.day=e.day),An(n),n}function Gx(t,e){let n=t.copy();return e.hour!=null&&(n.hour=e.hour),e.minute!=null&&(n.minute=e.minute),e.second!=null&&(n.second=e.second),e.millisecond!=null&&(n.millisecond=e.millisecond),Xx(n),n}function Kx(t){t.second+=Math.floor(t.millisecond/1e3),t.millisecond=ya(t.millisecond,1e3),t.minute+=Math.floor(t.second/60),t.second=ya(t.second,60),t.hour+=Math.floor(t.minute/60),t.minute=ya(t.minute,60);let e=Math.floor(t.hour/24);return t.hour=ya(t.hour,24),e}function Xx(t){t.millisecond=Math.max(0,Math.min(t.millisecond,1e3)),t.second=Math.max(0,Math.min(t.second,59)),t.minute=Math.max(0,Math.min(t.minute,59)),t.hour=Math.max(0,Math.min(t.hour,23))}function ya(t,e){let n=t%e;return n<0&&(n+=e),n}function Jx(t,e){return t.hour+=e.hours||0,t.minute+=e.minutes||0,t.second+=e.seconds||0,t.millisecond+=e.milliseconds||0,Kx(t)}function Jc(t,e,n,a){let r=t.copy();switch(e){case"era":{let l=t.calendar.getEras(),c=l.indexOf(t.era);if(c<0)throw new Error("Invalid era: "+t.era);c=Kt(c,n,0,l.length-1,a==null?void 0:a.round),r.era=l[c],An(r);break}case"year":var s,i;!((s=(i=r.calendar).isInverseEra)===null||s===void 0)&&s.call(i,r)&&(n=-n),r.year=Kt(t.year,n,-1/0,9999,a==null?void 0:a.round),r.year===-1/0&&(r.year=1),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,t);break;case"month":r.month=Kt(t.month,n,1,t.calendar.getMonthsInYear(t),a==null?void 0:a.round);break;case"day":r.day=Kt(t.day,n,1,t.calendar.getDaysInMonth(t),a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return t.calendar.balanceDate&&t.calendar.balanceDate(r),An(r),r}function Qx(t,e,n,a){let r=t.copy();switch(e){case"hour":{let s=t.hour,i=0,l=23;if((a==null?void 0:a.hourCycle)===12){let c=s>=12;i=c?12:0,l=c?23:11}r.hour=Kt(s,n,i,l,a==null?void 0:a.round);break}case"minute":r.minute=Kt(t.minute,n,0,59,a==null?void 0:a.round);break;case"second":r.second=Kt(t.second,n,0,59,a==null?void 0:a.round);break;case"millisecond":r.millisecond=Kt(t.millisecond,n,0,999,a==null?void 0:a.round);break;default:throw new Error("Unsupported field "+e)}return r}function Kt(t,e,n,a,r=!1){if(r){t+=Math.sign(e),t<n&&(t=a);let s=Math.abs(e);e>0?t=Math.ceil(t/s)*s:t=Math.floor(t/s)*s,t>a&&(t=n)}else t+=e,t<n?t=a-(n-t-1):t>a&&(t=n+(t-a-1));return t}function Zx(t){return`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}${t.millisecond?String(t.millisecond/1e3).slice(1):""}`}function Qc(t){let e=qr(t,new ba),n;return e.era==="BC"?n=e.year===1?"0000":"-"+String(Math.abs(1-e.year)).padStart(6,"00"):n=String(e.year).padStart(4,"0"),`${n}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`}function ek(t){return`${Qc(t)}T${Zx(t)}`}function tk(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Zc(t,e,n){tk(t,e),e.set(t,n)}function ed(t){let e=typeof t[0]=="object"?t.shift():new ba,n;if(typeof t[0]=="string")n=t.shift();else{let i=e.getEras();n=i[i.length-1]}let a=t.shift(),r=t.shift(),s=t.shift();return[e,n,a,r,s]}var nk=new WeakMap;class go{copy(){return this.era?new go(this.calendar,this.era,this.year,this.month,this.day):new go(this.calendar,this.year,this.month,this.day)}add(e){return Ur(this,e)}subtract(e){return Kc(this,e)}set(e){return Xc(this,e)}cycle(e,n,a){return Jc(this,e,n,a)}toDate(e){return Uc(this,e)}toString(){return Qc(this)}compare(e){return Rc(this,e)}constructor(...e){Zc(this,nk,{writable:!0,value:void 0});let[n,a,r,s,i]=ed(e);this.calendar=n,this.era=a,this.year=r,this.month=s,this.day=i,An(this)}}var ok=new WeakMap;class xa{copy(){return this.era?new xa(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new xa(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(e){return Ur(this,e)}subtract(e){return Kc(this,e)}set(e){return Xc(Gx(this,e),e)}cycle(e,n,a){switch(e){case"era":case"year":case"month":case"day":return Jc(this,e,n,a);default:return Qx(this,e,n,a)}}toDate(e,n){return Uc(this,e,n)}toString(){return ek(this)}compare(e){let n=Rc(this,e);return n===0?jx(this,Yc(e)):n}constructor(...e){Zc(this,ok,{writable:!0,value:void 0});let[n,a,r,s,i]=ed(e);this.calendar=n,this.era=a,this.year=r,this.month=s,this.day=i,this.hour=e.shift()||0,this.minute=e.shift()||0,this.second=e.shift()||0,this.millisecond=e.shift()||0,An(this)}}const ak={class:"relative w-full"},rk={class:"mt-2 flex justify-end gap-2"},sk={name:"DCodeDateRangePicker"},Kr=o.defineComponent({...sk,props:{modelValue:{},placeholder:{default:"YYYY-MM-DD - YYYY-MM-DD"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},returnType:{default:"yyyy-mm-dd"},requireBoth:{type:Boolean,default:!1}},emits:["update:modelValue","change","invalid"],setup(t,{emit:e}){const n=t,a=e,r=o.ref(!1),s=o.ref(null),i=o.ref(""),l=o.ref(null),c=o.ref("");function d(w){return String(w).padStart(2,"0")}function u(w){return`${w.getFullYear()}-${d(w.getMonth()+1)}-${d(w.getDate())}`}function f(w){return new go(w.getFullYear(),w.getMonth()+1,w.getDate())}function h(w){const E=w.trim();if(!E)return null;const A=E.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(A){const L=new Date(Number(A[1]),Number(A[2])-1,Number(A[3]));return Number.isNaN(L.getTime())?null:L}const T=E.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(T){const L=new Date(Number(T[3]),Number(T[2])-1,Number(T[1]));return Number.isNaN(L.getTime())?null:L}const F=new Date(E);return Number.isNaN(F.getTime())?null:F}function m(w){return w?w instanceof Date?Number.isNaN(w.getTime())?null:w:typeof w=="string"?h(w):null:null}function b(w){return w?(w.setHours(0,0,0,0),n.returnType==="iso"?w.toISOString():n.returnType==="yyyy-mm-dd"?u(w):w):null}function p(w){const E=w!=null&&w.start?u(w.start.toDate(Pn())):"",A=w!=null&&w.end?u(w.end.toDate(Pn())):"";return E&&A?`${E} - ${A}`:E&&!A?`${E} - `:""}function g(){const w=n.modelValue,E=w!=null&&w.start?m(w.start):null,A=w!=null&&w.end?m(w.end):null;let T={start:E?f(E):void 0,end:A?f(A):void 0};!T.start&&!T.end&&(T=null),s.value=T,i.value=s.value?p(s.value):""}function y(){l.value=s.value,c.value=i.value}function B(w){const E=w.trim();if(!E)return{a:"",b:null};if(E.includes(" - ")){const[A,T]=E.split(" - ");return{a:(A??"").trim(),b:(T??"").trim()||null}}if(E.toLowerCase().includes(" to ")){const[A,T]=E.toLowerCase().split(" to ");return{a:(A??"").trim(),b:(T??"").trim()||null}}if(E.includes(" – ")){const[A,T]=E.split(" – ");return{a:(A??"").trim(),b:(T??"").trim()||null}}return{a:E,b:null}}function D(){const{a:w,b:E}=B(c.value);if(!w&&!E)return l.value=null,!0;const A=w?m(w):null;if(w&&!A)return a("invalid","Format tanggal start tidak valid. Pakai YYYY-MM-DD atau DD/MM/YYYY."),!1;const T=E?m(E):null;if(E&&!T)return a("invalid","Format tanggal end tidak valid. Pakai YYYY-MM-DD atau DD/MM/YYYY."),!1;const F=A?f(A):void 0,L=T?f(T):void 0;let Y;return A&&T&&T.getTime()<A.getTime()?Y={start:L,end:F}:Y={start:F,end:L},l.value=Y,!l.value.start&&!l.value.end?(l.value=null,c.value="",!0):(c.value=p(l.value),!0)}function M(w){const E=w!=null&&w.start?w.start.toDate(Pn()):null,A=w!=null&&w.end?w.end.toDate(Pn()):null;E&&E.setHours(0,0,0,0),A&&A.setHours(0,0,0,0);const T=E||A?{start:b(E),end:b(A)}:null;a("update:modelValue",T),a("change",T)}function S(w){const E=w?{start:w.start,end:w.end}:null;l.value=E,c.value=E?p(E):""}function k(){if(!D())return;const E=l.value;if(n.requireBoth&&(!(E!=null&&E.start)||!(E!=null&&E.end))){a("invalid","Pilih tanggal start dan end dulu sebelum Apply.");return}s.value=E,i.value=E?p(E):"",l.value=s.value,c.value=i.value,M(E),r.value=!1}function C(){y(),r.value=!1}function x(){l.value=null,c.value=""}return o.watch(()=>n.modelValue,()=>{g(),r.value||y()},{immediate:!0}),o.watch(r,w=>{w&&y()}),(w,E)=>(o.openBlock(),o.createBlock(o.unref(zx),{open:r.value,"onUpdate:open":E[5]||(E[5]=A=>r.value=A)},{default:o.withCtx(()=>[o.createVNode(o.unref(Rx),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("div",ak,[o.createVNode(o.unref(pn),{modelValue:c.value,"onUpdate:modelValue":E[0]||(E[0]=A=>c.value=A),disabled:t.disabled,placeholder:t.placeholder,class:"pr-20",onFocus:E[1]||(E[1]=A=>!t.disabled&&(r.value=!0)),onKeydown:E[2]||(E[2]=o.withKeys(o.withModifiers(A=>D(),["prevent"]),["enter"])),onBlur:E[3]||(E[3]=A=>D())},null,8,["modelValue","disabled","placeholder"]),t.clearable&&c.value?(o.openBlock(),o.createBlock(o.unref(Ce),{key:0,type:"button",variant:"ghost",size:"icon",class:"absolute right-10 top-1/2 -translate-y-1/2 h-8 w-8",disabled:t.disabled,onClick:x},{default:o.withCtx(()=>[...E[6]||(E[6]=[o.createTextVNode(" ✕ ",-1)])]),_:1},8,["disabled"])):o.createCommentVNode("",!0),o.createVNode(o.unref(Ce),{type:"button",variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-8 w-8",disabled:t.disabled,onClick:E[4]||(E[4]=A=>r.value=!r.value)},{default:o.withCtx(()=>[...E[7]||(E[7]=[o.createTextVNode(" 📅 ",-1)])]),_:1},8,["disabled"])])]),_:1}),o.createVNode(o.unref(Fx),{class:"p-2 w-auto",align:"start"},{default:o.withCtx(()=>[o.createVNode(o.unref(Sx),{mode:"range",selected:l.value??void 0,"onUpdate:selected":S,"initial-focus":""},null,8,["selected"]),o.createElementVNode("div",rk,[o.createVNode(o.unref(Ce),{variant:"outline",type:"button",onClick:C},{default:o.withCtx(()=>[...E[8]||(E[8]=[o.createTextVNode("Cancel",-1)])]),_:1}),o.createVNode(o.unref(Ce),{type:"button",onClick:k},{default:o.withCtx(()=>[...E[9]||(E[9]=[o.createTextVNode("Apply",-1)])]),_:1})])]),_:1})]),_:1},8,["open"]))}}),td=o.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),nd=o.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),o.createVNode(o.unref(Q.DialogContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n.class)}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default"),o.createVNode(o.unref(Q.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.X),{class:"w-4 h-4"}),l[0]||(l[0]=o.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),ik=o.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogDescription),o.mergeProps(o.unref(a),{class:o.unref(de)("text-sm text-muted-foreground",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),lk=o.defineComponent({__name:"DialogHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col gap-y-1.5 text-center sm:text-left",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),ck=o.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogTitle),o.mergeProps(o.unref(a),{class:o.unref(de)("text-lg font-medium leading-none tracking-tight",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),dk={class:"flex items-center gap-3"},uk={class:"flex justify-end gap-3"},ka=o.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:()=>({})}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,a=e,r=o.useAttrs(),s=o.computed(()=>{const{style:d,...u}=r;return u}),i=o.computed(()=>({maxWidth:typeof n.maxWidth=="number"?`${n.maxWidth}px`:n.maxWidth,width:"100%"})),l=o.computed(()=>n.icon?Qt[n.icon]??null:null),c=d=>{if(!d&&n.persistent){a("update:modelValue",!0);return}a("update:modelValue",d)};return(d,u)=>(o.openBlock(),o.createBlock(o.unref(td),{open:t.modelValue,"onUpdate:open":c},{default:o.withCtx(()=>[o.createVNode(o.unref(nd),o.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:o.withCtx(()=>[o.createVNode(Za,{padding:t.contentClass,border:"",shadow:"",class:"w-full !rounded-xl !border-0",level:1},o.createSlots({header:o.withCtx(()=>[o.createElementVNode("div",dk,[l.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),{key:0,class:"h-5 w-5"})):o.createCommentVNode("",!0),o.createVNode(o.unref(ck),{class:"text-base font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),o.createVNode(o.unref(ik),{class:"hidden"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),actions:o.withCtx(()=>[o.renderSlot(d.$slots,"header-append")]),default:o.withCtx(()=>[o.createElementVNode("div",{style:o.normalizeStyle(t.contentStyle)},[o.renderSlot(d.$slots,"default")],4)]),_:2},[d.$slots.actions?{name:"footer",fn:o.withCtx(()=>[o.createElementVNode("div",uk,[o.renderSlot(d.$slots,"actions")])]),key:"0"}:void 0]),1032,["padding"])]),_:3},16,["style"])]),_:3},8,["open"]))}}),od=o.defineComponent({__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const e=t,n=o.computed(()=>Qt[e.icon]??Qt.X);return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Ce),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(n.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),fk=o.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)(o.unref(mk)({variant:t.variant}),e.class)),role:"alert"},[o.renderSlot(n.$slots,"default")],2))}}),hk=o.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("text-sm [&_p]:leading-relaxed",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),mk=Wn("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"}}),Xt=o.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)(o.unref(pk)({variant:t.variant}),e.class))},[o.renderSlot(n.$slots,"default")],2))}}),pk=Wn("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"}}),$n=o.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("rounded-xl border bg-card text-card-foreground shadow",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),Tn=o.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("p-6 pt-0",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),gk=o.defineComponent({__name:"CardFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex items-center p-6 pt-0",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),bo=o.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col gap-y-1.5 p-6",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),wa=o.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("h3",{class:o.normalizeClass(o.unref(de)("font-medium leading-none tracking-tight",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),bk={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},yk={class:"flex flex-wrap items-center justify-center gap-2"},xk=["accept","multiple"],_a=o.defineComponent({__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"image/*"},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:e}){const n=t,a=e,r=o.ref(null),s=o.ref(!1),i=o.ref(null),l=o.ref(null),c=o.ref(null);o.computed(()=>n.accept||"file/*");const d=o.computed(()=>n.error??i.value);function u(){var S;n.disabled||(S=r.value)==null||S.click()}function f(S){const k=S/1024,C=k/1024;return C>=1?`${C.toFixed(2)} MB`:k>=1?`${k.toFixed(1)} KB`:`${S} B`}function h(S){var C;if(!S)return"File tidak valid";if((C=n.accept)!=null&&C.includes("image/")&&!S.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const k=(n.maxSizeMb??2)*1024*1024;return S.size>k?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:null}function m(S){l.value=S.name,c.value=S.size}function b(S){if(i.value=null,!S.length)return;if(n.mode==="single"){const C=S[0],x=h(C);if(x){i.value=x,a("error",x);return}n.showSelected&&m(C),a("picked",C);return}const k=[];for(const C of S){const x=h(C);if(x){i.value=x,a("error",x);return}k.push(C)}k.length&&(n.showSelected&&m(k[0]),a("picked:multiple",k))}function p(S){const k=S.target,C=Array.from(k.files??[]);b(C),k.value=""}function g(){n.disabled||(s.value=!0)}function y(){n.disabled||(s.value=!0)}function B(){s.value=!1}function D(S){var x,w;if(n.disabled)return;s.value=!1;const k=Array.from(((x=S.dataTransfer)==null?void 0:x.files)??[]),C=(w=n.accept)!=null&&w.includes("image/")?k.filter(E=>E.type.startsWith("image/")):k;b(C)}const M=o.computed(()=>(n.accept||"file/*").split(",").map(S=>S.trim()).filter(Boolean).map(S=>S==="image/*"?"IMAGE":S.replace(/^image\//,"").replace(/^\./,"")).join(", "));return o.computed(()=>`${n.maxSizeMb??0}MB`),(S,k)=>(o.openBlock(),o.createBlock(o.unref($n),{class:o.normalizeClass(t.disabled?"opacity-60":"")},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(wa),{class:"text-sm font-semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label),1)]),_:1})]),_:1}),o.createVNode(o.unref(Tn),{class:"pt-2"},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass(["flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"border-primary bg-primary/10 -translate-y-[1px]":"border-border bg-muted/30",t.disabled?"cursor-not-allowed":"hover:border-primary/60 hover:bg-primary/5"]]),style:{"min-height":"190px"},onClick:u,onDragenter:o.withModifiers(g,["prevent"]),onDragover:o.withModifiers(y,["prevent"]),onDragleave:o.withModifiers(B,["prevent"]),onDrop:o.withModifiers(D,["prevent"])},[o.createElementVNode("div",bk,[k[0]||(k[0]=o.createElementVNode("div",{class:"text-sm font-medium"},"Drag & drop file di sini",-1)),k[1]||(k[1]=o.createElementVNode("div",{class:"text-xs text-muted-foreground"},"atau klik area ini untuk memilih file",-1)),o.createElementVNode("div",yk,[o.createVNode(o.unref(Xt),{variant:"secondary",class:"text-[11px]"},{default:o.withCtx(()=>[o.createTextVNode(" Allowed: "+o.toDisplayString(M.value),1)]),_:1}),o.createVNode(o.unref(Xt),{variant:"secondary",class:"text-[11px]"},{default:o.withCtx(()=>[o.createTextVNode(" Max: "+o.toDisplayString(n.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(o.openBlock(),o.createBlock(o.unref(Xt),{key:0,variant:"secondary",class:"mt-2"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(l.value)+" • "+o.toDisplayString(c.value?f(c.value):""),1)]),_:1})):o.createCommentVNode("",!0)]),o.createElementVNode("input",{ref_key:"fileInputEl",ref:r,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:p},null,40,xk)],34),d.value?(o.openBlock(),o.createBlock(o.unref(fk),{key:0,variant:"destructive",class:"mt-3"},{default:o.withCtx(()=>[o.createVNode(o.unref(hk),{class:"text-sm"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value),1)]),_:1})]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),kk={key:0,class:"text-xs text-muted-foreground"},wk=["src"],_k={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground gap-2 p-4 text-center"},Ck={class:"space-y-0.5"},Bk={class:"text-sm font-medium truncate max-w-[180px]"},Sk={class:"text-xs opacity-70"},Ek={class:"absolute top-2 inset-x-2 flex items-center justify-between"},Dk={key:1},Vk={class:"absolute left-2 bottom-2 z-10 inline-block max-w-[calc(100%-16px)] rounded-xl border px-3 py-2 shadow-lg backdrop-blur opacity-0 translate-y-1 scale-[0.99] transition-all duration-200 group-hover:opacity-100 group-hover:translate-y-0 group-hover:scale-100 border-border/60 dark:border-border/50 bg-background/80 dark:bg-background/30"},Mk={class:"text-[11px] text-foreground/90 space-y-1 whitespace-nowrap"},Nk={class:"flex gap-2"},Pk={class:"font-medium truncate"},Ak={class:"flex gap-2"},$k={class:"font-medium"},Tk={class:"flex gap-2"},Ok={class:"font-medium truncate"},Xr=o.defineComponent({__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:e}){const n=t,a=e,r=o.ref(null),s=o.computed(()=>n.forceFileIcon||!n.file?!1:(n.file.type||"").startsWith("image/"));o.watch(()=>n.file,c=>{r.value&&URL.revokeObjectURL(r.value),r.value=c?URL.createObjectURL(c):null},{immediate:!0}),o.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value)});function i(c){const d=c/1024,u=d/1024;return u>=1?`${u.toFixed(2)} MB`:d>=1?`${d.toFixed(1)} KB`:`${c} B`}const l=o.computed(()=>n.file?{name:n.file.name,size:i(n.file.size),type:n.file.type||"unknown"}:null);return(c,d)=>t.file?(o.openBlock(),o.createBlock($n,{key:0,class:o.normalizeClass(t.disabled?"opacity-60 pointer-events-none":"")},{default:o.withCtx(()=>[o.createVNode(bo,{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(wa,{class:"text-sm font-semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),t.description?(o.openBlock(),o.createElementBlock("div",kk,o.toDisplayString(t.description),1)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(Tn,{class:"pt-2"},{default:o.withCtx(()=>{var u,f,h,m,b;return[o.createElementVNode("div",{class:"group relative rounded-xl overflow-hidden bg-muted border-2 border-dashed border-border w-full transition-colors duration-200 hover:border-primary/50 hover:bg-primary/5",style:o.normalizeStyle({height:`${t.previewHeight}px`})},[s.value&&r.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,wk)):(o.openBlock(),o.createElementBlock("div",_k,[o.createVNode(o.unref(ne.FileText),{class:"w-10 h-10"}),o.createElementVNode("div",Ck,[o.createElementVNode("p",Bk,o.toDisplayString((u=l.value)==null?void 0:u.name),1),o.createElementVNode("p",Sk,o.toDisplayString((f=l.value)==null?void 0:f.size),1)])])),o.createElementVNode("div",Ek,[t.showEdit&&s.value?(o.openBlock(),o.createBlock(ht,{key:0,icon:o.unref(ne.Pencil),size:"icon",variant:"secondary",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:d[0]||(d[0]=p=>a("edit"))},null,8,["icon","disabled"])):(o.openBlock(),o.createElementBlock("div",Dk)),t.showRemove?(o.openBlock(),o.createBlock(ht,{key:2,icon:o.unref(ne.Trash2),size:"icon",variant:"destructive",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:d[1]||(d[1]=p=>a("remove"))},null,8,["icon","disabled"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",Vk,[o.createElementVNode("div",Mk,[o.createElementVNode("div",Nk,[d[2]||(d[2]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Nama",-1)),o.createElementVNode("span",Pk,o.toDisplayString((h=l.value)==null?void 0:h.name),1)]),o.createElementVNode("div",Ak,[d[3]||(d[3]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Ukuran",-1)),o.createElementVNode("span",$k,o.toDisplayString((m=l.value)==null?void 0:m.size),1)]),o.createElementVNode("div",Tk,[d[4]||(d[4]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Tipe",-1)),o.createElementVNode("span",Ok,o.toDisplayString((b=l.value)==null?void 0:b.type),1)])])])],4)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}});function ad(){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 zk={class:"space-y-3"},Fk={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30"},Rk={name:"DCodeFileField"},rd=o.defineComponent({...Rk,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:void 0},minSizeMb:{default:null},maxSizeMb:{default:5},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:k=>a("update:modelValue",k)}),s=o.ref(null),i=o.ref(null);function l(k){i.value=k,a("error",k)}function c(){i.value=null}const d=o.computed(()=>{const k=(n.allowedTypes??"").trim();return k?k.split(/[,\s;]+/g).map(x=>x.trim().toLowerCase()).filter(Boolean).map(x=>x.includes("/")||x.startsWith(".")?x:`.${x}`):[]});function u(k){const C=k.lastIndexOf(".");return C>=0?k.slice(C).toLowerCase():""}const f=o.computed(()=>{if(d.value.length){const k=d.value.filter(x=>x.startsWith("."));return[...d.value.filter(x=>x.includes("/")),...k].join(",")}return n.accept}),h=o.computed(()=>d.value.length?d.value.join(", "):n.accept||"Semua File");function m(k){if(d.value.length){const C=(k.type||"").toLowerCase(),x=u(k.name);return d.value.some(w=>w.includes("/")?C===w:w.startsWith(".")?x===w:x===`.${w}`)}if(n.accept){if(n.accept==="*/*")return!0;const C=n.accept.split(",").map(E=>E.trim().toLowerCase()),x=(k.type||"").toLowerCase(),w=u(k.name);return C.some(E=>{if(E.endsWith("/*")){const A=E.slice(0,-2);return x.startsWith(A)}return E.startsWith(".")?w===E:x===E})}return!0}function b(k){return k*1024*1024}async function p(k){return k?m(k)?n.minSizeMb!=null&&k.size<b(n.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${n.minSizeMb}MB`:n.maxSizeMb!=null&&k.size>b(n.maxSizeMb)?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:g}=at(),y=ad(),B=o.ref(!1);async function D(k){var C;if(n.uploadFn){try{B.value=!0;const x=await n.uploadFn(k);r.value=k,a("uploaded",x)}catch(x){console.error("Upload Error",x),y.error("Upload Failed",(x==null?void 0:x.message)||"Unknown error"),l((x==null?void 0:x.message)||"Upload Failed")}finally{B.value=!1}return}if(!((C=n.endpoint)!=null&&C.apiUrl)){r.value=k;return}if(typeof g!="function"){l("useApi() must expose DCodeApi()");return}try{B.value=!0;const x=new FormData;x.append("doc",k);const w=(n.endpoint.apiMethod||"POST").toUpperCase(),E=n.endpoint.apiUrl,A=await g("","",x,{_url:E,_method:w,withCredentials:!0,transformRequest:[(F,L)=>(L&&(delete L["Content-Type"],delete L["content-type"]),F)]}),T=(A==null?void 0:A.data)??A;r.value=k,a("uploaded",T)}catch(x){console.error("Upload Error",x),y.error("Upload Failed",(x==null?void 0:x.message)||"Unknown error"),l((x==null?void 0:x.message)||"Upload Failed")}finally{B.value=!1}}async function M(k){var x;if(n.disabled)return;c();const C=await p(k);if(C){l(C);return}s.value=k,n.uploadFn||(x=n.endpoint)!=null&&x.apiUrl?await D(k):r.value=k}function S(){c(),r.value=null,s.value=null}return o.watch(()=>n.modelValue,k=>{k&&!s.value&&(s.value=k),k||(s.value=null)},{immediate:!0}),(k,C)=>(o.openBlock(),o.createElementBlock("div",zk,[r.value?B.value?(o.openBlock(),o.createElementBlock("div",Fk,[...C[1]||(C[1]=[o.createElementVNode("span",{class:"text-sm text-muted-foreground animate-pulse"},"Uploading...",-1)])])):(o.openBlock(),o.createBlock(Xr,{key:2,file:r.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:S},null,8,["file","title","description","disabled","preview-height","preview-width"])):(o.openBlock(),o.createBlock(_a,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||B.value,onPicked:M,error:i.value,onError:C[0]||(C[0]=x=>l(x))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),vk={key:0,class:"ml-1 text-destructive"},Lk={class:"relative w-full"},Ik={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground"},jk={key:1,class:"absolute inset-y-0 right-4 flex items-center"},Wk={key:2,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-900 shadow-lg"},Hk={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},qk={key:1,class:"text-sm text-muted-foreground text-center"},Uk=["onClick","title"],Yk={class:"flex flex-col items-center gap-1"},Gk={class:"text-[10px] text-muted-foreground truncate w-full text-center"},Kk={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},sd=o.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:e}){const n=t,a=e,r=Qt,s=o.ref(null),i=o.ref(null),l=Math.random().toString(36).slice(2,7),c=o.computed(()=>`dcode-icon-dropdown-${n.label||"icon-dropdown"}-${l}`),d=o.ref(!1),u=o.computed(()=>(n.modelValue??"").trim()||""),f=o.ref(""),h=o.ref(!1),m=o.ref(!1),b=o.ref(!1),p=o.shallowRef([]),g=o.ref(n.pageSize),y=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),B=async()=>{if(m.value||b.value)return;b.value=!0,await new Promise(J=>setTimeout(J,0));const j=Object.keys(r).filter(J=>!y.has(J)).filter(J=>/^[A-Z]/.test(J)).filter(J=>typeof r[J]=="function"||typeof r[J]=="object"&&r[J]).sort((J,te)=>J.localeCompare(te));p.value=j,m.value=!0,b.value=!1},D=o.computed(()=>!m.value||!u.value||!p.value.includes(u.value)?null:r[u.value]),M=o.ref("");o.watch(u,j=>{d.value||(M.value=j)});const S=o.computed(()=>!!u.value&&!d.value),k=o.computed(()=>{if(!m.value)return[];const j=(f.value??"").trim().toLowerCase();return j?p.value.filter(J=>J.toLowerCase().includes(j)):p.value}),C=o.computed(()=>k.value.slice(0,g.value));o.watch(()=>f.value,()=>{g.value=n.pageSize});const x=o.computed(()=>{const j=n.columns;return j<=2?"grid-cols-2":j===3?"grid-cols-3":j===4?"grid-cols-4":j===5?"grid-cols-5":j>=8?"grid-cols-8":"grid-cols-6"}),w=o.computed(()=>n.clearable?"pr-12":"pr-3"),E=o.computed(()=>D.value&&!d.value?"pl-12":"pl-3"),A=async()=>{var j;await o.nextTick(),(j=i.value)==null||j.focus()},T=async j=>{if(n.disabled)return;const J=j!==!1;if(h.value){h.value=!1;return}d.value=!0,await B(),J&&(f.value="",M.value=""),g.value=n.pageSize,await A()},F=()=>{d.value=!1,f.value="",M.value=u.value,g.value=n.pageSize},L=async()=>{n.disabled||(d.value?F():await T())};let Y=null;const z=async j=>{if(n.disabled)return;a("update:modelValue",null),d.value||await T(!1),Y&&clearTimeout(Y);const J=M.value;Y=setTimeout(()=>{f.value=J},300)},v=j=>{n.disabled||(a("update:modelValue",j),F(),queueMicrotask(()=>{var J;return(J=i.value)==null?void 0:J.blur()}))},W=()=>{n.disabled||(a("update:modelValue",null),a("clear"),h.value=!0,F(),queueMicrotask(()=>{var j;return(j=i.value)==null?void 0:j.focus()}))},O=j=>{if(j.key==="Escape"){j.preventDefault(),F();return}if(j.key==="Enter"&&d.value){const J=k.value[0];J&&(j.preventDefault(),v(J))}},N=j=>{if(!d.value)return;const J=j.target;s.value&&!s.value.contains(J)&&F()},H=j=>{const J=j.target;J.scrollTop+J.clientHeight>=J.scrollHeight-24&&g.value<k.value.length&&(g.value=Math.min(g.value+n.pageSize,k.value.length))};return o.onMounted(()=>{document.addEventListener("mousedown",N),queueMicrotask(()=>{var j;i.value=((j=s.value)==null?void 0:j.querySelector("input"))??null})}),o.onBeforeUnmount(()=>{document.removeEventListener("mousedown",N),Y&&clearTimeout(Y)}),(j,J)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"w-full"},[n.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium mb-1 block"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(n.label)+" ",1),n.required?(o.openBlock(),o.createElementBlock("span",vk,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",Lk,[D.value&&!d.value?(o.openBlock(),o.createElementBlock("div",Ik,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(D.value),{size:18}))])):o.createCommentVNode("",!0),o.createVNode(o.unref(pn),{id:c.value,modelValue:M.value,"onUpdate:modelValue":J[0]||(J[0]=te=>M.value=te),readonly:S.value,disabled:n.disabled,placeholder:n.placeholder,class:o.normalizeClass(["w-full h-10 rounded-lg border bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700",[w.value,E.value,S.value?"cursor-pointer select-none":""]]),onClick:T,onFocus:T,onInput:z,onKeydown:O},null,8,["id","modelValue","readonly","disabled","placeholder","class"]),n.clearable?(o.openBlock(),o.createElementBlock("div",jk,[u.value?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"text-muted-foreground hover:text-foreground transition",onMousedown:J[1]||(J[1]=o.withModifiers(()=>{},["prevent"])),onClick:W,title:"Clear"}," ✕ ",32)):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",class:"text-muted-foreground hover:text-foreground transition-transform",onMousedown:J[2]||(J[2]=o.withModifiers(()=>{},["prevent"])),onClick:L,title:"Open"},[o.createVNode(o.unref(ne.ChevronDown),{class:"h-4 w-4"})],32))])):o.createCommentVNode("",!0),d.value?(o.openBlock(),o.createElementBlock("div",Wk,[o.createElementVNode("div",{class:"p-2 overflow-auto",style:o.normalizeStyle({maxHeight:n.maxHeight}),onScroll:H},[b.value?(o.openBlock(),o.createElementBlock("div",Hk,[o.createVNode(o.unref(ne.Loader2),{class:"h-4 w-4 animate-spin"}),J[3]||(J[3]=o.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&k.value.length===0?(o.openBlock(),o.createElementBlock("div",qk," Icon tidak ditemukan ")):(o.openBlock(),o.createElementBlock("div",{key:2,class:o.normalizeClass(["grid gap-2",x.value])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(C.value,te=>(o.openBlock(),o.createElementBlock("button",{key:te,type:"button",class:o.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===te?"ring-1 ring-primary":""]),onClick:ue=>v(te),title:te},[o.createElementVNode("div",Yk,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(o.unref(r)[te]),{size:n.iconSize},null,8,["size"])),o.createElementVNode("span",Gk,o.toDisplayString(te),1)])],10,Uk))),128))],2)),m.value&&k.value.length>0?(o.openBlock(),o.createElementBlock("div",Kk," Showing "+o.toDisplayString(C.value.length)+" / "+o.toDisplayString(k.value.length),1)):o.createCommentVNode("",!0)],36)])):o.createCommentVNode("",!0)])],512))}}),yo=o.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.Separator),o.mergeProps(o.unref(n),{class:o.unref(de)("shrink-0 bg-border",e.orientation==="horizontal"?"h-px w-full":"w-px h-full",e.class)}),null,16,["class"]))}}),Xk={class:"ps-3 pt-2"},Jk={class:"bg-warning -mt-5"},Jr=o.defineComponent({__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:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:g=>a("update:modelValue",g)}),s=o.ref(null),i=o.ref(null);let l=null,c=!1,d=0;function u(){if(l){try{l.close()}catch{}l=null,s.value&&(s.value.innerHTML=""),i.value=null}}async function f(g,y,B,D,M){const S=await new Promise((x,w)=>{const E=URL.createObjectURL(g),A=new Image;A.onload=()=>{URL.revokeObjectURL(E),x(A)},A.onerror=T=>{URL.revokeObjectURL(E),w(T)},A.src=E}),k=document.createElement("canvas");k.width=y,k.height=B;const C=k.getContext("2d");return C?(C.drawImage(S,0,0,y,B),await new Promise(x=>{k.toBlob(w=>x(w||g),D,M)})):g}function h(){if(!l||!i.value)return;const g=l.getPlugin("Dashboard"),y=l.getFile(i.value);!g||!y||requestAnimationFrame(()=>{try{g.openFileEditor(y)}catch{try{g.openFileEditor(i.value)}catch{}}})}async function m(g){if(l){l.cancelAll(),i.value=null;try{const y=l.addFile({name:g.name,type:g.type,data:g,source:"Local",isRemote:!1});i.value=String(y)}catch{}}}function b(){s.value&&(l&&u(),l=new Rd({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}}),l.use(is,{target:s.value,inline:!0,height:480,proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),l.use(vd,{target:is,quality:n.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:n.aspectRatio==null?Number.NaN:n.aspectRatio}}),l.on("file-editor:cancel",()=>{r.value=!1}),l.on("file-added",g=>{i.value=(g==null?void 0:g.id)??null,n.autoOpenEditor&&setTimeout(()=>h(),80)}),l.on("file-editor:complete",async g=>{const y=++d;try{const B=g.data,D=B.type||g.type||"image/jpeg";let M=B;if(n.outputWidth&&n.outputHeight&&(M=await f(B,n.outputWidth,n.outputHeight,D,n.quality)),c||y!==d)return;const S=g.name||"edited-image.jpg",k=new File([M],S,{type:D});await p(k,"UPPY_EDITOR_COMPLETE"),a("done",k),r.value=!1}catch{}}))}async function p(g,y="CROP_RESULT"){const B=URL.createObjectURL(g);try{const D=await new Promise((M,S)=>{const k=new Image;k.onload=()=>M(k),k.onerror=S,k.src=B});console.group(y),console.log("file:",g),console.table({name:g.name,type:g.type,sizeBytes:g.size,sizeMB:+(g.size/1024/1024).toFixed(3),width:D.naturalWidth,height:D.naturalHeight,ratio:+(D.naturalWidth/D.naturalHeight).toFixed(4)}),console.log("previewUrl:",B),console.groupEnd()}finally{URL.revokeObjectURL(B)}}return o.watch(r,async g=>{c=!g,d++,g?(await o.nextTick(),b(),n.file&&await m(n.file)):u()},{flush:"post"}),o.watch(()=>n.file,async g=>{r.value&&g&&(await o.nextTick(),await m(g))}),o.onBeforeUnmount(()=>{c=!0,d++,u()}),(g,y)=>(o.openBlock(),o.createBlock(o.unref(td),{open:r.value,"onUpdate:open":y[2]||(y[2]=B=>r.value=B)},{default:o.withCtx(()=>[o.createVNode(o.unref(nd),{class:"max-w-[750px] p-0 overflow-hidden",onInteractOutside:y[0]||(y[0]=o.withModifiers(()=>{},["prevent"])),onEscapeKeyDown:y[1]||(y[1]=o.withModifiers(()=>{},["prevent"]))},{default:o.withCtx(()=>[o.createElementVNode("div",Xk,[o.createVNode(o.unref(lk),{class:""},{default:o.withCtx(()=>[...y[3]||(y[3]=[o.createTextVNode(" Crop & Resize ",-1)])]),_:1}),y[4]||(y[4]=o.createElementVNode("div",{class:"flex items-center justify-end"},null,-1))]),o.createVNode(o.unref(yo)),o.createElementVNode("div",Jk,[o.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])]),_:1})]),_:1},8,["open"]))}}),Qk={key:0,class:"text-xs text-muted-foreground"},Zk=["src"],ew={class:"absolute top-2 inset-x-2 flex items-center justify-between"},tw={class:"absolute left-2 bottom-2 z-10 inline-block max-w-[calc(100%-16px)] rounded-xl border px-3 py-2 shadow-lg backdrop-blur opacity-0 translate-y-1 scale-[0.99] transition-all duration-200 group-hover:opacity-100 group-hover:translate-y-0 group-hover:scale-100 border-border/60 dark:border-border/50 bg-background/80 dark:bg-background/30"},nw={class:"text-[11px] text-foreground/90 space-y-1 whitespace-nowrap"},ow={class:"flex gap-2"},aw={class:"font-medium truncate"},rw={class:"flex gap-2"},sw={class:"font-medium"},iw={class:"flex gap-2"},lw={class:"font-medium truncate"},Qr=o.defineComponent({__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:e}){const n=t,a=e,r=o.ref(null);o.watch(()=>n.file,l=>{r.value&&URL.revokeObjectURL(r.value),r.value=l?URL.createObjectURL(l):null},{immediate:!0}),o.onBeforeUnmount(()=>{r.value&&URL.revokeObjectURL(r.value)});function s(l){const c=l/1024,d=c/1024;return d>=1?`${d.toFixed(2)} MB`:c>=1?`${c.toFixed(1)} KB`:`${l} B`}const i=o.computed(()=>n.file?{name:n.file.name,size:s(n.file.size),type:n.file.type||"unknown"}:null);return(l,c)=>t.file?(o.openBlock(),o.createBlock($n,{key:0,class:o.normalizeClass(t.disabled?"opacity-60 pointer-events-none":"")},{default:o.withCtx(()=>[o.createVNode(bo,{class:"pb-2"},{default:o.withCtx(()=>[o.createVNode(wa,{class:"text-sm font-semibold"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),t.description?(o.openBlock(),o.createElementBlock("div",Qk,o.toDisplayString(t.description),1)):o.createCommentVNode("",!0)]),_:1}),o.createVNode(Tn,{class:"pt-2"},{default:o.withCtx(()=>{var d,u,f;return[o.createElementVNode("div",{class:"group relative rounded-xl overflow-hidden bg-muted border-2 border-dashed border-border w-full transition-colors duration-200 hover:border-primary/50 hover:bg-primary/5",style:o.normalizeStyle({height:`${t.previewHeight}px`})},[r.value?(o.openBlock(),o.createElementBlock("img",{key:0,src:r.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Zk)):o.createCommentVNode("",!0),o.createElementVNode("div",ew,[t.showEdit?(o.openBlock(),o.createBlock(ht,{key:0,icon:o.unref(ne.Pencil),size:"icon",variant:"secondary",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:c[0]||(c[0]=h=>a("edit"))},null,8,["icon","disabled"])):o.createCommentVNode("",!0),t.showRemove?(o.openBlock(),o.createBlock(ht,{key:1,icon:o.unref(ne.Trash2),size:"icon",variant:"destructive",disabled:t.disabled,class:"h-8 w-8 shadow transition-transform duration-200 group-hover:scale-[1.02]",onClick:c[1]||(c[1]=h=>a("remove"))},null,8,["icon","disabled"])):o.createCommentVNode("",!0)]),o.createElementVNode("div",tw,[o.createElementVNode("div",nw,[o.createElementVNode("div",ow,[c[2]||(c[2]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Nama",-1)),o.createElementVNode("span",aw,o.toDisplayString((d=i.value)==null?void 0:d.name),1)]),o.createElementVNode("div",rw,[c[3]||(c[3]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Ukuran",-1)),o.createElementVNode("span",sw,o.toDisplayString((u=i.value)==null?void 0:u.size),1)]),o.createElementVNode("div",iw,[c[4]||(c[4]=o.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground"},"Tipe",-1)),o.createElementVNode("span",lw,o.toDisplayString((f=i.value)==null?void 0:f.type),1)])])])],4)]}),_:1})]),_:1},8,["class"])):o.createCommentVNode("",!0)}}),cw={class:"space-y-3"},dw={name:"DCodeImageField"},Zr=o.defineComponent({...dw,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:2},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:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:z=>a("update:modelValue",z)}),s=o.ref(!1),i=o.ref(null),l=o.ref(null),c=o.ref(null);function d(z){c.value=z,a("error",z)}function u(){c.value=null}const f=o.computed(()=>{const z=(n.allowedTypes??"").trim();return z?z.split(/[,\s;]+/g).map(W=>W.trim().toLowerCase()).filter(Boolean).map(W=>W.includes("/")||W.startsWith(".")?W:`.${W}`):[]});function h(z){const v=z.lastIndexOf(".");return v>=0?z.slice(v).toLowerCase():""}const m=o.computed(()=>{if(f.value.length){const z=f.value.filter(W=>W.startsWith("."));return[...f.value.filter(W=>W.includes("/")),...z].join(",")}return n.accept||"image/*"}),b=o.computed(()=>f.value.length?f.value.join(", "):n.accept||"image/*");function p(z){if(f.value.length){const W=(z.type||"").toLowerCase(),O=h(z.name);return f.value.some(N=>N.includes("/")?W===N:N.startsWith(".")?O===N:O===`.${N}`)}return(n.accept||"image/*").toLowerCase().includes("image/")?(z.type||"").toLowerCase().startsWith("image/"):!0}function g(z){return z*1024*1024}async function y(z){var v;return(v=z.type)!=null&&v.startsWith("image/")?await new Promise(W=>{const O=URL.createObjectURL(z),N=new Image;N.onload=()=>{URL.revokeObjectURL(O),W({w:N.naturalWidth,h:N.naturalHeight})},N.onerror=()=>{URL.revokeObjectURL(O),W(null)},N.src=O}):null}async function B(z){if(!(n.minWidth!=null||n.minHeight!=null||n.maxWidth!=null||n.maxHeight!=null))return null;const W=await y(z);return W?n.minWidth!=null&&W.w<n.minWidth?`Lebar gambar minimal ${n.minWidth}px`:n.minHeight!=null&&W.h<n.minHeight?`Tinggi gambar minimal ${n.minHeight}px`:n.maxWidth!=null&&W.w>n.maxWidth?`Lebar gambar maksimal ${n.maxWidth}px`:n.maxHeight!=null&&W.h>n.maxHeight?`Tinggi gambar maksimal ${n.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function D(z){return z?p(z)?n.minSizeMb!=null&&z.size<g(n.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${n.minSizeMb}MB`:n.maxSizeMb!=null&&z.size>g(n.maxSizeMb)?`Ukuran file terlalu besar. Maks ${n.maxSizeMb}MB`:await B(z):`only Allowed: ${b.value}`:"File tidak valid"}function M(z){n.disabled||(i.value=z,s.value=!0)}async function S(z){if(n.disabled)return;u();const v=await D(z);if(v){d(v);return}l.value=z,M(z)}const{DCodeApi:k}=at(),C=ad(),x=o.ref(!1);o.ref(null);function w(z,v){return!z||!v?null:z.replace(/\/+$/,"")+"/"+v.replace(/^\/+/,"")}function E(z){var N;const v=(z==null?void 0:z.data)??z,W=(N=v==null?void 0:v.data)==null?void 0:N[0];if(!W)return null;const O=w(W.server,W.url);return{...W,fullUrl:O?encodeURI(O):null}}async function A(z){var v;if(n.uploadFn){try{x.value=!0;const W=await n.uploadFn(z);r.value=z,a("uploaded",W)}catch(W){console.error("Upload Error",W),C.error("Upload Failed",(W==null?void 0:W.message)||"Unknown error"),d((W==null?void 0:W.message)||"Upload Failed")}finally{x.value=!1}return}if(!((v=n.endpoint)!=null&&v.apiUrl)){r.value=z;return}if(typeof k!="function"){d("useApi() must expose DCodeApi()");return}try{x.value=!0;const W=new FormData;W.append("doc",z);const O=(n.endpoint.apiMethod||"POST").toUpperCase(),N=n.endpoint.apiUrl,H=await k("","",W,{_url:N,_method:O,withCredentials:!0,transformRequest:[(J,te)=>(te&&(delete te["Content-Type"],delete te["content-type"]),J)]}),j=(H==null?void 0:H.data)??H;E(j),r.value=z,a("uploaded",j)}catch(W){console.error("Upload Error",W),C.error("Upload Failed",(W==null?void 0:W.message)||"Unknown error"),d((W==null?void 0:W.message)||"Upload Failed")}finally{x.value=!1}}async function T(z){var v;u(),n.uploadFn||(v=n.endpoint)!=null&&v.apiUrl?await A(z):r.value=z,s.value=!1,i.value=null}function F(){s.value=!1,i.value=null}async function L(){if(!r.value)return;u();const z=n.editUseOriginal?l.value??r.value:r.value,v=await D(z);if(v){d(v);return}M(z)}function Y(){u(),r.value=null,i.value=null,s.value=!1,l.value=null}return o.watch(()=>n.modelValue,z=>{z&&!l.value&&(l.value=z),z||(l.value=null)},{immediate:!0}),(z,v)=>(o.openBlock(),o.createElementBlock("div",cw,[r.value?(o.openBlock(),o.createBlock(Qr,{key:1,file:r.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:L,onRemove:Y,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(o.openBlock(),o.createBlock(_a,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:S,error:c.value,onError:v[0]||(v[0]=W=>d(W))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),o.createVNode(Jr,{modelValue:s.value,"onUpdate:modelValue":v[1]||(v[1]=W=>s.value=W),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:T,onCancel:F},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),uw={key:0,class:"text-red-500"},es=o.defineComponent({__name:"DCodeLabel",props:{label:{},text:{},required:{type:Boolean},customClass:{},htmlFor:{}},setup(t){return(e,n)=>(o.openBlock(),o.createBlock(o.resolveDynamicComponent(t.htmlFor?"label":"span"),{for:t.htmlFor,class:o.normalizeClass(["text-xs font-medium text-slate-600 ml-1",t.customClass])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label||t.text)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",uw,"*")):o.createCommentVNode("",!0)]),_:1},8,["for","class"]))}}),fw=["aria-busy"],hw={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},mw={key:0,class:"ml-1 text-destructive"},pw={class:"min-w-0 flex-1 text-left"},gw={key:0,class:"flex flex-wrap gap-1.5"},bw={class:"max-w-[220px] truncate"},yw=["onClick"],xw={key:1,class:"text-muted-foreground truncate"},kw={class:"flex items-center gap-2 shrink-0"},ww={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},_w={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},Cw=["disabled","onClick"],Bw={class:"truncate"},Sw={key:0,class:"text-primary-600 dark:text-primary-400"},Ew={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},Dw={key:0},Vw={key:1},Mw={key:1,class:"text-xs text-destructive"},Nw={name:"DCodeMultiSelect"},id=o.defineComponent({...Nw,name:"DCodeMultiSelect",inheritAttrs:!1,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:2},maxSelected:{default:3},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:e}){const n=o.useAttrs(),a=e,r=t,s=o.computed(()=>(r.label||n.label)??void 0),i=o.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=o.computed(()=>`app-multiselect-${n.id||s.value||"field"}-${l}`),d=o.computed(()=>{if(r.required)return!0;const G=n.required,ee=n["aria-required"];return G===""||G===!0||G==="true"||(ee==="true"||ee===!0)}),u=o.computed(()=>!!r.error);function f(G){return G?typeof r.itemTitle=="function"?r.itemTitle(G)??"":String((G==null?void 0:G[r.itemTitle])??""):""}function h(G){return G?typeof r.itemValue=="function"?r.itemValue(G):G==null?void 0:G[r.itemValue]:null}function m(G,ee){return h(G)??ee}const b=o.computed(()=>Array.isArray(r.modelValue)?r.modelValue:[]),p=o.computed(()=>{var G;return!!((G=r.endpoint)!=null&&G.apiUrl)||!!r.fetchItems}),g=o.ref([]),y=o.ref(!1),B=o.ref(!1),D=o.computed(()=>{var ee;const G=(ee=r.endpoint)==null?void 0:ee.apiOptions;if(G)return typeof G=="function"?G():G}),M=o.computed(()=>{var me,$e;const G=((me=r.endpoint)==null?void 0:me.apiUrl)??"",ee=((($e=r.endpoint)==null?void 0:$e.apiMethod)??"GET").toUpperCase(),ae=JSON.stringify(D.value??null);return`${ee} ${G} :: ${ae}`}),S=o.computed(()=>p.value?g.value:r.items||[]);async function k(){var G;if(p.value&&!(!((G=r.endpoint)!=null&&G.apiUrl)&&!r.fetchItems)&&!y.value){y.value=!0;try{let ee;if(r.fetchItems){const ae=await r.fetchItems(),me=(ae==null?void 0:ae.data)??ae;ee=(me==null?void 0:me.data)??me}else{const{DCodeApi:ae}=at();if(typeof ae!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const me={page:1,perPage:100,...D.value||{}},$e=await ae("","",me,{_url:r.endpoint.apiUrl,_method:(r.endpoint.apiMethod||"GET").toUpperCase()}),lt=($e==null?void 0:$e.data)??$e;ee=(lt==null?void 0:lt.data)??lt}g.value=Array.isArray(ee)?ee:[],B.value=!0}catch(ee){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",ee),g.value=[]}finally{y.value=!1}}}o.watch(()=>M.value,()=>{g.value=[],B.value=!1}),o.onMounted(()=>{r.autoFetchOnMount&&p.value&&k()});const C=o.computed(()=>{const G=b.value;if(r.returnObject)return G;const ee=new Map;for(const ae of S.value)ee.set(h(ae),ae);return G.map(ae=>ee.get(ae)??{[r.itemValue]:ae,[r.itemTitle]:String(ae)})}),x=o.computed(()=>r.maxChips===null?C.value:C.value.slice(0,r.maxChips));function w(G){const ee=b.value;if(r.returnObject){const ae=h(G);return ee.some(me=>h(me)===ae)}return ee.includes(h(G))}const E=o.computed(()=>{if(r.maxSelected===null||r.maxSelected===void 0)return null;const G=Number(r.maxSelected);return Number.isFinite(G)&&G>0?G:null}),A=o.computed(()=>{const G=E.value;return G===null?!1:b.value.length>=G});function T(G){return!w(G)&&A.value}const F=o.computed(()=>{const G=b.value,ee=new Set;if(r.returnObject)for(const ae of G)ee.add(h(ae));else for(const ae of G)ee.add(ae);return ee}),L=o.computed(()=>{const G=F.value;return(S.value||[]).filter(ee=>!G.has(h(ee)))}),Y=o.computed(()=>S.value.length===0?!1:L.value.length===0),z=o.ref(null),v=o.ref(null),W=o.ref(null),O=o.ref(!1),N=o.ref(""),H=o.ref(0),j=o.ref(0),{floatingStyles:J}=Ha(z,v,{whileElementsMounted:va,placement:"bottom-start",middleware:[La(8),ja(),Ia({padding:8}),Wa({apply({rects:G,elements:ee}){Object.assign(ee.floating.style,{width:`${G.reference.width}px`,"--floating-width":`${G.reference.width}px`})}})]}),te=o.computed(()=>J.value),ue=o.computed(()=>{const G=Number(r.maxRows);return Number.isFinite(G)&&G>0?G:5});async function fe(){r.disabled||(O.value=!0,j.value=0,requestAnimationFrame(()=>{W.value&&(W.value.scrollTop=0),H.value=0}),p.value&&r.autoFetchOnOpen&&(r.refreshOnOpen||!B.value)&&!y.value&&await k())}function pe(){O.value=!1}function Le(){O.value?pe():fe()}function be(G){var ae,me;if(!O.value)return;const ee=G.target;(ae=z.value)!=null&&ae.contains(ee)||(me=v.value)!=null&&me.contains(ee)||pe()}o.onMounted(()=>document.addEventListener("mousedown",be)),o.onBeforeUnmount(()=>document.removeEventListener("mousedown",be));function U(G){if(r.disabled)return;if(T(G)){a("max");return}const ee=[...b.value];if(r.returnObject){const ae=h(G);if(ee.some($e=>h($e)===ae))return;a("update:modelValue",[...ee,G])}else{const ae=h(G);if(ee.includes(ae))return;a("update:modelValue",[...ee,ae])}N.value="",j.value=0,requestAnimationFrame(()=>{W.value&&(W.value.scrollTop=0),H.value=0})}function P(G){if(r.disabled)return;const ee=[...b.value];if(r.returnObject){const ae=h(G);a("update:modelValue",ee.filter(me=>h(me)!==ae))}else{const ae=h(G);a("update:modelValue",ee.filter(me=>me!==ae))}}function q(){r.disabled||(a("update:modelValue",[]),a("clear"),pe())}const oe=o.computed(()=>{const G=N.value.trim().toLowerCase(),ee=L.value;return G?ee.filter(ae=>f(ae).toLowerCase().includes(G)):ee}),he=o.computed(()=>oe.value.length);o.watch(O,G=>{G||(N.value="")});const ze=o.computed(()=>{if(Y.value)return r.itemHeight;const G=he.value;return(G<=0?1:Math.min(G,ue.value))*r.itemHeight}),ot=o.computed(()=>r.virtual?he.value*r.itemHeight:0),At=o.computed(()=>r.virtual?Math.ceil(ze.value/r.itemHeight)+r.overscan:he.value),$t=o.computed(()=>{if(!r.virtual)return 0;const G=Math.floor(H.value/r.itemHeight)-Math.floor(r.overscan/2);return Math.max(0,G)}),bn=o.computed(()=>r.virtual?Math.min(he.value,$t.value+At.value):he.value),On=o.computed(()=>r.virtual?$t.value*r.itemHeight:0),Qe=o.computed(()=>{const G=oe.value;return r.virtual?G.slice($t.value,bn.value):G});function Tt(G){const ee=G.target;H.value=ee.scrollTop}function ko(G){return G===j.value}function R(G){const ee=W.value;if(!ee||!r.virtual)return;const ae=G*r.itemHeight,me=ae+r.itemHeight,$e=ee.scrollTop,lt=ee.scrollTop+ee.clientHeight;ae<$e?ee.scrollTop=ae:me>lt&&(ee.scrollTop=me-ee.clientHeight)}function Z(G){const ee=Math.max(0,he.value-1);j.value=Math.min(ee,Math.max(0,j.value+G)),R(j.value)}function ce(){const G=oe.value[j.value];G&&U(G)}const Ve=o.computed(()=>r.clearable&&!r.disabled&&C.value.length>0),Ae=o.computed(()=>u.value?"border-red-500 ring-[0.5px] ring-red-500":O.value?"border-gray-700 ring-[0.5px] ring-gray-700 dark:border-gray-300 dark:ring-gray-300":"");return(G,ee)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",hw)):o.createCommentVNode("",!0),ee[3]||(ee[3]=o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.value)+" ",1),d.value?(o.openBlock(),o.createElementBlock("span",mw,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"referenceEl",ref:z,class:"relative"},[o.createVNode(o.unref(Ce),{id:c.value,type:"button",variant:"outline",class:o.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border",["bg-white dark:bg-neutral-900 border-gray-300 dark:border-gray-700 text-foreground dark:text-gray-300",Ae.value]]),disabled:r.disabled,onClick:Le},{default:o.withCtx(()=>[o.createElementVNode("div",pw,[C.value.length?(o.openBlock(),o.createElementBlock("div",gw,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(x.value,(ae,me)=>(o.openBlock(),o.createBlock(o.unref(Xt),{key:`chip-${m(ae,me)}`,variant:"secondary",class:"gap-1"},{default:o.withCtx(()=>[o.createElementVNode("span",bw,o.toDisplayString(f(ae)),1),r.disabled?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:o.withModifiers($e=>P(ae),["stop"]),"aria-label":"Remove"}," ✕ ",8,yw))]),_:2},1024))),128)),r.maxChips!==null&&C.value.length>r.maxChips?(o.openBlock(),o.createBlock(o.unref(Xt),{key:0,variant:"secondary"},{default:o.withCtx(()=>[o.createTextVNode(" +"+o.toDisplayString(C.value.length-(r.maxChips??0)),1)]),_:1})):o.createCommentVNode("",!0)])):(o.openBlock(),o.createElementBlock("div",xw,o.toDisplayString(r.placeholder),1))]),o.createElementVNode("div",kw,[Ve.value?(o.openBlock(),o.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:o.withModifiers(q,["stop"]),"aria-label":"Clear"}," ✕ ")):o.createCommentVNode("",!0),o.createVNode(o.unref(ne.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])]),_:1},8,["id","disabled","class"]),(o.openBlock(),o.createBlock(o.Teleport,{to:"body"},[O.value?(o.openBlock(),o.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:v,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:o.normalizeStyle(te.value)},[r.searchable&&!Y.value?(o.openBlock(),o.createElementBlock("div",ww,[o.createVNode(o.unref(pn),{modelValue:N.value,"onUpdate:modelValue":ee[0]||(ee[0]=ae=>N.value=ae),placeholder:r.searchPlaceholder,class:"h-10",onKeydown:[ee[1]||(ee[1]=o.withKeys(o.withModifiers(ae=>Z(1),["prevent"]),["down"])),ee[2]||(ee[2]=o.withKeys(o.withModifiers(ae=>Z(-1),["prevent"]),["up"])),o.withKeys(o.withModifiers(ce,["prevent"]),["enter"]),o.withKeys(o.withModifiers(pe,["prevent"]),["esc"])]},null,8,["modelValue","placeholder","onKeydown"])])):o.createCommentVNode("",!0),o.createElementVNode("div",{ref_key:"listEl",ref:W,class:"relative overflow-auto",style:o.normalizeStyle({height:ze.value+"px"}),onScroll:Tt},[Y.value?(o.openBlock(),o.createElementBlock("div",_w," All items have been selected ")):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[r.virtual?(o.openBlock(),o.createElementBlock("div",{key:0,style:o.normalizeStyle({height:ot.value+"px"})},null,4)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(r.virtual?"absolute left-0 top-0 w-full":""),style:o.normalizeStyle(r.virtual?{transform:`translateY(${On.value}px)`}:void 0)},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(Qe.value,(ae,me)=>(o.openBlock(),o.createElementBlock("button",{key:String(m(ae,$t.value+me)),type:"button",class:o.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[T(ae)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",ko($t.value+me)?"bg-neutral-50 dark:bg-neutral-800/60":"",w(ae)?"font-semibold":"font-normal"]]),style:o.normalizeStyle({height:r.itemHeight+"px"}),disabled:r.disabled||T(ae),onClick:$e=>U(ae)},[o.createElementVNode("span",Bw,o.toDisplayString(f(ae)),1),w(ae)?(o.openBlock(),o.createElementBlock("span",Sw,"✓")):o.createCommentVNode("",!0)],14,Cw))),128))],6),he.value===0?(o.openBlock(),o.createElementBlock("div",Ew,[y.value?(o.openBlock(),o.createElementBlock("span",Dw,"Loading data…")):(o.openBlock(),o.createElementBlock("span",Vw,"Tidak ada data"))])):o.createCommentVNode("",!0)],64))],36)],4)):o.createCommentVNode("",!0)]))],512),u.value?(o.openBlock(),o.createElementBlock("p",Mw,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,fw)),[[o.vShow,i.value]])}}),Pw={class:"space-y-3"},Aw={key:0,class:"text-lg font-medium"},$w={class:"flex flex-wrap items-center gap-2 sm:gap-4"},ts=o.defineComponent({name:"DCodeOtpInput",__name:"DCodeOtpInput",props:{totalInput:{default:6},default:{default:""},label:{default:""}},emits:["updateOtp"],setup(t,{emit:e}){const n=t,a=e,r=o.ref([]),s=o.ref([]),i=o.computed(()=>{const p=Number(n.totalInput);return p&&p>0?p:6}),l=()=>{s.value=Array.from({length:i.value},(p,g)=>{var y;return((y=n.default)==null?void 0:y[g])??""}),a("updateOtp",s.value.join(""))};l(),o.watch(()=>[n.totalInput,n.default],()=>l());const c=p=>{p<0||p>=i.value||o.nextTick(()=>{var g;return(g=r.value[p])==null?void 0:g.focus()})},d=p=>p.match(/[a-zA-Z0-9]/)?p.match(/[a-zA-Z0-9]/)[0]:"",u=(p,g)=>{s.value[p]=d(g),a("updateOtp",s.value.join(""))},f=(p,g)=>{const y=p.key,B=/^\d$/.test(y),D=/^[a-zA-Z]$/.test(y);if(y==="Backspace"){if(p.preventDefault(),s.value[g]){u(g,"");return}g>0&&(u(g-1,""),c(g-1));return}if(y==="ArrowLeft"){p.preventDefault(),c(g-1);return}if(y==="ArrowRight"){p.preventDefault(),c(g+1);return}if(B||D){p.preventDefault(),u(g,y),g<i.value-1&&c(g+1);return}y.length===1&&p.preventDefault()},h=(p,g)=>{const y=p.target,B=y.value??"",D=d(B);y.value=D,u(g,D),D&&g<i.value-1&&c(g+1)},m=(p,g)=>{var M;p.preventDefault();const B=(((M=p.clipboardData)==null?void 0:M.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!B)return;let D=g;for(const S of B){if(D>=i.value)break;s.value[D]=S,D++}a("updateOtp",s.value.join("")),c(Math.min(D,i.value-1))},b=p=>g=>{const y=(g==null?void 0:g.$el)??null;r.value[p]=y};return(p,g)=>(o.openBlock(),o.createElementBlock("div",Pw,[n.label||i.value?(o.openBlock(),o.createElementBlock("h6",Aw,o.toDisplayString(n.label||`Type your ${i.value} digit security code`),1)):o.createCommentVNode("",!0),o.createElementVNode("div",$w,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(i.value,y=>(o.openBlock(),o.createBlock(o.unref(pn),{key:y,ref_for:!0,ref:b(y-1),value:s.value[y-1]||"",type:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"OTP digit",class:"flex-1 w-auto min-w-8 max-w-14 aspect-square h-auto p-0 text-center text-lg sm:text-xl font-medium",onKeydown:B=>f(B,y-1),onInput:B=>h(B,y-1),onPaste:B=>m(B,y-1)},null,8,["value","onKeydown","onInput","onPaste"]))),128))])]))}}),Tw={class:"w-full"},Ow={key:0,class:"flex items-center justify-between mb-2"},zw={key:0,class:"text-sm font-medium text-gray-700"},Fw={key:1,class:"text-sm text-gray-600"},Rw={name:"DCodeProgress"},ld=o.defineComponent({...Rw,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:e}){const n=t,a=o.computed(()=>Math.min(n.modelValue/n.max*100,100)),r=o.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[n.size],"bg-gray-200"].join(" ")),s=o.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[n.color]||l.blue];return n.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),n.animated&&c.push("animate-pulse"),c.join(" ")}),i=o.computed(()=>`${Math.round(a.value)}%`);return(l,c)=>(o.openBlock(),o.createElementBlock("div",Tw,[t.label||t.showValue?(o.openBlock(),o.createElementBlock("div",Ow,[t.label?(o.openBlock(),o.createElementBlock("span",zw,o.toDisplayString(t.label),1)):o.createCommentVNode("",!0),t.showValue?(o.openBlock(),o.createElementBlock("span",Fw,o.toDisplayString(i.value),1)):o.createCommentVNode("",!0)])):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(r.value)},[o.createElementVNode("div",{class:o.normalizeClass(s.value),style:o.normalizeStyle({width:`${a.value}%`})},null,6)],2)]))}}),vw={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},cd=Hn(o.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(e,n)=>(o.openBlock(),o.createBlock(o.Transition,{name:"fade"},{default:o.withCtx(()=>[t.isApiLoading?(o.openBlock(),o.createElementBlock("div",vw,[o.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:o.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):o.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-5a7c62fb"]]),Lw={class:"flex flex-col"},Iw={class:"relative flex-shrink-0 mt-0.5"},jw=["id","name","value","checked","disabled","required"],Ww={class:"flex-1 min-w-0"},Hw={key:0,class:"ml-1 text-red-500"},qw={key:0,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},dd=o.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},value:{default:void 0},label:{default:""},description:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},name:{default:""},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:e}){o.useAttrs();const n=e,a=t,r=o.computed(()=>a.id||`radio-${Math.random().toString(36).substr(2,9)}`),s=o.computed(()=>a.name||`radio-group-${Math.random().toString(36).substr(2,9)}`),i=o.computed(()=>!!a.error),l=o.computed(()=>a.modelValue===a.value),c=o.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),d=o.computed(()=>{const m={blue:{border:"border-blue-500",bg:"bg-blue-500",text:"text-blue-600",focus:"focus:ring-blue-500",checked:"bg-blue-500 border-blue-500"},green:{border:"border-green-500",bg:"bg-green-500",text:"text-green-600",focus:"focus:ring-green-500",checked:"bg-green-500 border-green-500"},red:{border:"border-red-500",bg:"bg-red-500",text:"text-red-600",focus:"focus:ring-red-500",checked:"bg-red-500 border-red-500"},yellow:{border:"border-yellow-500",bg:"bg-yellow-500",text:"text-yellow-600",focus:"focus:ring-yellow-500",checked:"bg-yellow-500 border-yellow-500"},purple:{border:"border-purple-500",bg:"bg-purple-500",text:"text-purple-600",focus:"focus:ring-purple-500",checked:"bg-purple-500 border-purple-500"},gray:{border:"border-gray-500",bg:"bg-gray-500",text:"text-gray-600",focus:"focus:ring-gray-500",checked:"bg-gray-500 border-gray-500"}};return m[a.color]||m.blue}),u=o.computed(()=>["relative rounded-full border-2 transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-offset-2",c.value.radio,i.value?"border-red-500 focus:ring-red-500":d.value.border,l.value?d.value.checked:"bg-white",a.disabled?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer pointer-events-auto"]),f=o.computed(()=>["absolute inset-0 m-auto rounded-full transition-all duration-200",{"w-3 h-3":"w-2 h-2","w-4 h-4":"w-2.5 h-2.5","w-5 h-5":"w-3 h-3"}[c.value.radio]||"w-2.5 h-2.5",l.value?d.value.bg:"bg-transparent"]),h=m=>{m.target.checked&&(n("update:modelValue",a.value),n("change",a.value))};return(m,b)=>(o.openBlock(),o.createElementBlock("div",Lw,[o.createElementVNode("div",{class:o.normalizeClass(["flex items-start",c.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[o.createElementVNode("div",Iw,[o.createElementVNode("input",{id:r.value,name:s.value,type:"radio",value:t.value,checked:l.value,disabled:t.disabled,required:t.required,class:o.normalizeClass(["sr-only",{peer:!t.disabled}]),onChange:h},null,42,jw),o.createElementVNode("div",{class:o.normalizeClass(u.value),onClick:b[0]||(b[0]=p=>!t.disabled&&(l.value?null:n("update:modelValue",a.value)))},[o.createElementVNode("div",{class:o.normalizeClass(f.value)},null,2)],2)]),o.createElementVNode("div",Ww,[t.label?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:r.value,class:o.normalizeClass([c.value.label,"font-medium cursor-pointer select-none text-gray-900",t.disabled?"cursor-not-allowed opacity-50":""])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",Hw,"*")):o.createCommentVNode("",!0)]),_:1},8,["for","class"])):o.createCommentVNode("",!0),t.description?(o.openBlock(),o.createElementBlock("p",{key:1,class:o.normalizeClass(["text-sm text-gray-600 mt-1",t.disabled?"opacity-50":""])},o.toDisplayString(t.description),3)):o.createCommentVNode("",!0)])],2),i.value?(o.openBlock(),o.createElementBlock("div",qw,[b[1]||(b[1]=o.createElementVNode("svg",{class:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),o.createTextVNode(" "+o.toDisplayString(t.error),1)])):o.createCommentVNode("",!0)]))}}),Uw={class:"cursor-pointer block relative h-full"},Yw=["name","value","checked"],Gw={class:"h-24 flex flex-col items-center justify-center gap-3 rounded-xl border-2 p-4 text-center transition-all duration-300 ease-out border-gray-200 bg-white dark:bg-zinc-900 dark:border-zinc-700 hover:-translate-y-1 hover:shadow-lg hover:border-blue-300 peer-checked:border-blue-500 peer-checked:bg-blue-50 dark:peer-checked:bg-blue-900/20 peer-checked:ring-2 peer-checked:ring-blue-200 dark:peer-checked:ring-blue-800 peer-checked:scale-[1.02]"},Kw={key:0,class:"flex h-10 w-10 items-center justify-center rounded-lg bg-gray-100 dark:bg-zinc-800 text-gray-500 dark:text-gray-400 transition-colors duration-300 peer-checked:bg-blue-100 dark:peer-checked:bg-blue-800 peer-checked:text-blue-600 dark:peer-checked:text-blue-200"},Xw={class:"flex flex-col gap-1"},Jw={class:"font-medium text-sm text-gray-800 dark:text-gray-200 transition-colors duration-300 peer-checked:text-blue-700 dark:peer-checked:text-blue-300"},Qw={key:0,class:"text-xs text-gray-400"},ud=o.defineComponent({name:"DCodeRadioCustom",__name:"DCodeRadioCustom",props:{modelValue:{},value:{},labelID:{default:""},labelEN:{default:""},placeholderID:{default:""},placeholderEN:{default:""},icon:{default:""},name:{default:"radio-custom"}},emits:["update:modelValue"],setup(t,{emit:e}){const n=t,{locale:a}=wo.useI18n(),r=o.computed(()=>{const d=a.value.toLowerCase(),u=d==="en"||d.startsWith("en-"),f=n.labelEN,h=n.labelID;return u?f||h:h||f}),s=o.computed(()=>{const d=a.value.toLowerCase(),u=d==="en"||d.startsWith("en-"),f=n.placeholderEN,h=n.placeholderID;return u?f||h:h||f}),i=e,l=()=>{i("update:modelValue",n.value)},c=d=>d?typeof d!="string"?d:Qt[d]||null:null;return o.watch(()=>n.modelValue===n.value,(d,u)=>{},{immediate:!0}),(d,u)=>(o.openBlock(),o.createElementBlock("label",Uw,[o.createElementVNode("input",{type:"radio",class:"hidden peer",name:t.name,value:t.value,checked:t.modelValue===t.value,onChange:l},null,40,Yw),o.createElementVNode("div",Gw,[t.icon?(o.openBlock(),o.createElementBlock("div",Kw,[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(c(t.icon)),{class:"h-5 w-5"}))])):o.createCommentVNode("",!0),o.createElementVNode("div",Xw,[o.createElementVNode("p",Jw,o.toDisplayString(r.value),1),s.value?(o.openBlock(),o.createElementBlock("p",Qw,o.toDisplayString(s.value),1)):o.createCommentVNode("",!0)])])]))}}),Zw={key:0,class:"ml-1 text-destructive"},e1={class:"relative w-full"},t1={key:0,class:"mb-2 flex items-center justify-between"},n1={class:"text-sm text-muted-foreground"},o1={class:"text-sm font-medium text-foreground"},a1={class:"text-sm text-muted-foreground"},r1={class:"relative"},s1=["id","value","min","max","step","disabled","placeholder"],i1={key:1,class:"relative mt-2"},l1={class:"text-xs text-muted-foreground mt-1"},c1={key:1,class:"flex items-center gap-1 text-sm text-destructive"},d1={name:"DCodeSlider"},fd=o.defineComponent({...d1,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:e}){const n=o.useAttrs(),a=e,r=t,s=o.ref(),i=o.ref(!1),l=o.computed(()=>!!r.error),c=o.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=o.computed(()=>(r.label||n.label)??void 0),u=o.computed(()=>!0),f=o.computed(()=>{const S={sm:"h-2",md:"h-2.5",lg:"h-3"},k={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-gray-200 rounded-lg outline-none transition-all cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed",S[r.size],k[r.color]||k.blue,l.value?"accent-red-500":"",n.class].filter(Boolean).join(" ")}),h=o.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=o.computed(()=>`${r.valuePrefix}${r.modelValue}${r.valueSuffix}`),b=o.computed(()=>{const S=r.max-r.min;return(r.modelValue-r.min)/S*100}),p=S=>{const k=S.target,C=parseFloat(k.value);a("update:modelValue",C),a("input",C)},g=S=>{const k=S.target,C=parseFloat(k.value);a("change",C)},y=()=>{i.value=!0},B=()=>{i.value=!1},D=S=>{const k=r.max-r.min;return(S-r.min)/k*100},M=o.computed(()=>{const S={sm:16,md:20,lg:24};return`
64
64
  input[type="range"]::-webkit-slider-thumb {
65
65
  ${h.value}
66
66
  width: ${S[r.size]}px;
@@ -89,6 +89,6 @@
89
89
  input[type="range"]:focus::-moz-range-thumb {
90
90
  transform: scale(1.1);
91
91
  }
92
- `});return(S,k)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-2 w-full",o.unref(n).class]),"aria-busy":!1},[d.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",t1,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",n1,[t.showValue?(o.openBlock(),o.createElementBlock("div",o1,[o.createElementVNode("span",a1,o.toDisplayString(r.valuePrefix)+o.toDisplayString(t.min)+o.toDisplayString(r.valueSuffix),1),o.createElementVNode("span",r1,o.toDisplayString(m.value),1),o.createElementVNode("span",s1,o.toDisplayString(r.valuePrefix)+o.toDisplayString(t.max)+o.toDisplayString(r.valueSuffix),1)])):o.createCommentVNode("",!0),o.createElementVNode("div",i1,[o.createElementVNode("div",{class:o.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[o.createElementVNode("div",{class:o.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:o.normalizeStyle({width:`${b.value}%`})},null,6)],2),o.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:o.normalizeClass(f.value),onInput:p,onChange:g,onMousedown:y,onMouseup:B,onTouchstart:y,onTouchend:B},null,42,l1)]),t.marks.length>0?(o.openBlock(),o.createElementBlock("div",c1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.marks,C=>(o.openBlock(),o.createElementBlock("div",{key:C.value,class:"absolute flex flex-col items-center",style:o.normalizeStyle({left:`${D(C.value)}%`,transform:"translateX(-50%)"})},[k[0]||(k[0]=o.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),o.createElementVNode("span",d1,o.toDisplayString(C.label),1)],4))),128))])):o.createCommentVNode("",!0)]),l.value?(o.openBlock(),o.createElementBlock("div",u1,[k[1]||(k[1]=o.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),o.createTextVNode(" "+o.toDisplayString(t.error),1)])):o.createCommentVNode("",!0),M.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent("style"),{key:2},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(M.value),1)]),_:1})):o.createCommentVNode("",!0)],2)),[[o.vShow,u.value]])}}),h1={class:"inline-flex items-center gap-3"},m1=["for"],p1={key:0,class:"text-red-500 ml-1"},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=["for"],_1={key:0,class:"text-red-500 ml-1"},C1={name:"DCodeSwitch"},ns=o.defineComponent({...C1,props:{modelValue:{type:Boolean,default:!1},label:{default:""},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:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:f=>{!n.disabled&&!n.loading&&(a("update:modelValue",f),a("change",f))}}),s=o.computed(()=>{switch(n.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=o.computed(()=>{switch(n.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=o.computed(()=>{switch(n.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=o.computed(()=>{if(n.disabled)return"bg-gray-300";if(!r.value)return"bg-gray-200";switch(n.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{r.value=!r.value},u=o.computed(()=>r.value?n.tooltipActiveText:n.tooltipInactiveText);return(f,h)=>(o.openBlock(),o.createElementBlock("div",h1,[t.label&&t.labelPosition==="left"?(o.openBlock(),o.createElementBlock("label",{key:0,for:t.id,class:o.normalizeClass(["text-sm font-medium text-gray-700 cursor-pointer",{"opacity-50":t.disabled}])},[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",p1,"*")):o.createCommentVNode("",!0)],10,m1)):o.createCommentVNode("",!0),o.createVNode(o.unref(li),null,{default:o.withCtx(()=>[t.showTooltip?(o.openBlock(),o.createBlock(o.unref(si),{key:0,"delay-duration":200},{default:o.withCtx(()=>[o.createVNode(o.unref(ci),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":r.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[o.createElementVNode("span",{class:o.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"])},[t.loading?(o.openBlock(),o.createElementBlock("span",b1,[...h[0]||(h[0]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.Check),{key:0,class:o.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"])):!r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.X),{key:1,class:o.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"])):o.createCommentVNode("",!0)]),_:1})],2)],10,g1)]),_:1}),o.createVNode(o.unref(ii),{side:"top","side-offset":8,class:o.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:o.withCtx(()=>[o.createElementVNode("span",y1,[o.createElementVNode("span",{class:o.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),o.createTextVNode(" "+o.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":r.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[o.createElementVNode("span",{class:o.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"])},[t.loading?(o.openBlock(),o.createElementBlock("span",k1,[...h[1]||(h[1]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.Check),{key:0,class:o.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"])):!r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.X),{key:1,class:o.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"])):o.createCommentVNode("",!0)]),_:1})],2)],10,x1))]),_:1}),t.label&&t.labelPosition==="right"?(o.openBlock(),o.createElementBlock("label",{key:1,for:t.id,class:o.normalizeClass(["text-sm font-medium text-gray-700 cursor-pointer",{"opacity-50":t.disabled}])},[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",_1,"*")):o.createCommentVNode("",!0)],10,w1)):o.createCommentVNode("",!0)]))}}),B1=["aria-busy"],S1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},E1={key:1,class:"flex justify-end"},D1={key:0,class:"ml-1 text-destructive"},V1={class:"relative w-full group"},M1={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},N1={key:1},P1={key:1,class:"absolute inset-y-0 right-3 flex items-center"},A1={key:2,class:"absolute inset-y-0 right-3 flex items-center"},$1={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"},os=o.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}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=o.useAttrs(),a=o.computed(()=>l.valueType==="password"||n.type==="password"),r=o.ref(!1),s=()=>{r.value=!r.value},i=e,l=t,c=o.computed(()=>n.label);o.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=o.computed(()=>`app-text-field-${n.id||c.value||"field"}-${d}`),f=o.computed(()=>{const P=n.required,q=n["aria-required"];return P===""||P===!0||P==="true"||(q==="true"||q===!0)}),h=o.computed(()=>{const{label:P,class:q,id:oe,required:he,"aria-required":ze,...ot}=n;return ot}),m=o.computed(()=>{const P={...h.value};return l.valueType==="number"&&(P.type="text",P.inputmode="numeric",P.pattern="[0-9]*"),l.valueType==="email"&&(P.type="email",P.inputmode="email"),a.value&&(P.type=r.value?"text":"password"),l.disabled&&(P.disabled=!0),P}),b=o.computed(()=>{const P=l.modelValue;return P==null||String(P).length===0}),p=o.computed(()=>l.clearable?l.hideClearWhenEmpty?!b.value:!0:!1),g=o.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),y=o.ref(String(l.modelValue??""));o.watch(()=>l.modelValue,P=>{const q=String(P??"");q!==y.value&&(y.value=q)});const B=o.ref(!1),D=o.ref(!1),M=P=>P.split(/(\s+)/).map(q=>{if(q.trim()==="")return q;const oe=q.toLowerCase();return oe.charAt(0).toUpperCase()+oe.slice(1)}).join(""),S=P=>{const q=P.toLowerCase(),oe=q.search(new RegExp("\\p{L}","u"));return oe<0?q:q.slice(0,oe)+q.charAt(oe).toUpperCase()+q.slice(oe+1)},k=P=>{switch(l.textCase){case"uppercase":return P.toUpperCase();case"lowercase":return P.toLowerCase();case"titlecase":return M(P);case"sentencecase":return S(P);case"none":default:return P}},C=P=>{if(!P)return null;const q=Array.isArray(P)?P.join(""):P;return q?new Set(q):null},x=o.computed(()=>C(l.allowChars)),w=(P,q)=>(P.lastIndex=0,P.test(q)),E=P=>{if(l.valueType==="free"||l.valueType==="email"||l.valueType==="password")return!0;const q=P===" ",oe=/\d/.test(P),he=new RegExp("\\p{L}","u").test(P),ze=new RegExp("\\p{N}","u").test(P);return l.valueType==="number"?oe:l.valueType==="letter"?he||l.allowSpaces&&q:l.valueType==="letternumber"?he||ze||l.allowSpaces&&q:!0},A=P=>{let q="";for(const oe of P){const he=!!x.value&&x.value.has(oe);l.pattern&&!he&&!w(l.pattern,oe)||!he&&!E(oe)||(q+=oe)}return q},T=o.computed(()=>{const P=n.maxlength??n.maxLength;let q=Number.NaN;return typeof P=="number"?q=P:typeof P=="string"&&(q=Number.parseInt(P,10)),Number.isFinite(q)&&q>0?q:-1}),F=o.computed(()=>y.value.length),L=o.computed(()=>l.showCharCount?T.value>0:!1),Y=P=>T.value>0?P.slice(0,T.value):P,z=P=>{const q=A(P),oe=l.applyTextCaseToValue?k(q):q;return Y(oe)};let v=null;const W=P=>{if(P==="")return null;if(l.valueType==="number"&&l.returnNumber){const q=Number(P);return Number.isFinite(q)?q:null}return P},O=P=>{y.value=P,i("update:modelValue",W(P))},N=(P,q)=>{const oe=Y(q);D.value=!0,P.value=oe,O(oe),queueMicrotask(()=>D.value=!1)},H=(P,q)=>{const oe=P.selectionStart??P.value.length,he=P.selectionEnd??P.value.length;if(T.value>0){const ze=P.value.length-(he-oe),ot=T.value-ze;if(ot<=0)return;q=q.slice(0,ot)}P.setRangeText(q,oe,he,"end"),N(P,z(P.value))},j=P=>{var he;if(!v||B.value||D.value||!((he=P.inputType)!=null&&he.startsWith("insert")))return;const q=P.data;if(q==null)return;const oe=z(q);oe!==q&&(P.preventDefault(),oe.length>0&&H(v,oe))},J=P=>{var he;if(!v||B.value||D.value)return;const q=((he=P.clipboardData)==null?void 0:he.getData("text"))??"",oe=z(q);oe!==q&&(P.preventDefault(),oe.length>0&&H(v,oe))},te=P=>{if(!v||B.value||D.value)return;const q=P.target,oe=q.value??"",he=z(oe);he===oe?O(he):N(q,he)},ue=()=>B.value=!0,fe=()=>{if(B.value=!1,!v)return;const P=v.value??"",q=z(P);q===P?O(q):N(v,q)};o.onMounted(()=>{if(v=document.getElementById(u.value),!v)return;v.addEventListener("beforeinput",j),v.addEventListener("paste",J),v.addEventListener("input",te),v.addEventListener("compositionstart",ue),v.addEventListener("compositionend",fe);const P=v.value??"",q=z(P);q===P?O(q):N(v,q)}),o.onBeforeUnmount(()=>{v&&(v.removeEventListener("beforeinput",j),v.removeEventListener("paste",J),v.removeEventListener("input",te),v.removeEventListener("compositionstart",ue),v.removeEventListener("compositionend",fe),v=null)});const pe=()=>{y.value="",v&&(v.value=""),i("update:modelValue",null),i("clear")},Le=o.computed(()=>L.value&&F.value>0),be=o.computed(()=>`${F.value} / ${T.value}`),U=o.computed(()=>!!l.error);return(P,q)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":l.skeleton},[l.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[c.value?(o.openBlock(),o.createElementBlock("div",S1)):o.createCommentVNode("",!0),q[1]||(q[1]=o.createElementVNode("div",{class:"relative w-full"},[o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),L.value?(o.openBlock(),o.createElementBlock("div",E1,[...q[0]||(q[0]=[o.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[c.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:u.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.value)+" ",1),f.value?(o.openBlock(),o.createElementBlock("span",D1,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",V1,[l.icon||l.prependInner||P.$slots["prepend-inner"]?(o.openBlock(),o.createElementBlock("div",M1,[o.renderSlot(P.$slots,"prepend-inner",{},()=>[l.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(o.openBlock(),o.createElementBlock("span",N1,o.toDisplayString(l.prependInner),1)):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),o.createVNode(o.unref(pn),o.mergeProps({id:u.value,modelValue:y.value},m.value,{placeholder:l.placeholder,style:{textTransform:g.value},class:["w-full h-10 flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-within:ring-1 focus-within:ring-white",l.icon||l.prependInner||P.$slots["prepend-inner"]?"pl-10":"",p.value?"pr-10":"",a.value?"pr-10":"",U.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,["id","modelValue","placeholder","style","class"]),a.value?(o.openBlock(),o.createElementBlock("div",P1,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.value?o.unref(ne.Eye):o.unref(ne.EyeOff)),{class:"w-4 h-4"}))])])):o.createCommentVNode("",!0),p.value&&!a.value?(o.openBlock(),o.createElementBlock("div",A1,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:pe}," ✕ ")])):o.createCommentVNode("",!0),Le.value&&!U.value?(o.openBlock(),o.createElementBlock("p",$1,o.toDisplayString(be.value),1)):o.createCommentVNode("",!0)]),U.value?(o.openBlock(),o.createElementBlock("p",T1,o.toDisplayString(l.error),1)):o.createCommentVNode("",!0)],64))],10,B1)),[[o.vShow,t.visible]])}}),O1=["aria-busy"],z1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},F1={key:0,class:"ml-1 text-destructive"},R1={class:"relative w-full group"},v1=["id","value"],L1={key:0,class:"absolute top-1 right-2"},I1={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"},Ca=o.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:e}){const n=o.useAttrs(),a=e,r=t,s=o.computed(()=>n.label),i=o.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=o.computed(()=>`app-textarea-${n.id||s.value||"field"}-${l}`),d=o.computed(()=>{const U=n.required,P=n["aria-required"];return U===""||U===!0||U==="true"||(P==="true"||P===!0)}),u=o.computed(()=>{const{label:U,class:P,id:q,required:oe,"aria-required":he,...ze}=n;return ze}),f=o.computed(()=>{const U=n.maxlength;let P=Number.NaN;return typeof U=="number"?P=U:typeof U=="string"&&(P=Number.parseInt(U,10)),Number.isFinite(P)&&P>0?P:-1}),h=U=>f.value>0?U.slice(0,f.value):U,m=o.computed(()=>{const U=r.modelValue;return U==null||String(U).length===0}),b=o.computed(()=>r.clearable?r.hideClearWhenEmpty?!m.value:!0:!1),p=o.ref(String(r.modelValue??""));o.watch(()=>r.modelValue,U=>{const P=String(U??"");P!==p.value&&(p.value=P)});const g=o.ref(!1),y=o.ref(!1),B=U=>U.split(/(\s+)/).map(P=>{if(P.trim()==="")return P;const q=P.toLowerCase();return q.charAt(0).toUpperCase()+q.slice(1)}).join(""),D=U=>{const P=U.toLowerCase(),q=P.search(new RegExp("\\p{L}","u"));return q<0?P:P.slice(0,q)+P.charAt(q).toUpperCase()+P.slice(q+1)},M=U=>{switch(r.textCase){case"uppercase":return U.toUpperCase();case"lowercase":return U.toLowerCase();case"titlecase":return B(U);case"sentencecase":return D(U);case"none":default:return U}},S=o.computed(()=>{switch(r.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),k=U=>{if(!U)return null;const P=Array.isArray(U)?U.join(""):U;return P?new Set(P):null},C=o.computed(()=>k(r.allowChars)),x=(U,P)=>(U.lastIndex=0,U.test(P)),w=U=>{if(U===`
92
+ `});return(S,k)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-2 w-full",o.unref(n).class]),"aria-busy":!1},[d.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(d.value)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",Zw,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",e1,[t.showValue?(o.openBlock(),o.createElementBlock("div",t1,[o.createElementVNode("span",n1,o.toDisplayString(r.valuePrefix)+o.toDisplayString(t.min)+o.toDisplayString(r.valueSuffix),1),o.createElementVNode("span",o1,o.toDisplayString(m.value),1),o.createElementVNode("span",a1,o.toDisplayString(r.valuePrefix)+o.toDisplayString(t.max)+o.toDisplayString(r.valueSuffix),1)])):o.createCommentVNode("",!0),o.createElementVNode("div",r1,[o.createElementVNode("div",{class:o.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[o.createElementVNode("div",{class:o.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:o.normalizeStyle({width:`${b.value}%`})},null,6)],2),o.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:o.normalizeClass(f.value),onInput:p,onChange:g,onMousedown:y,onMouseup:B,onTouchstart:y,onTouchend:B},null,42,s1)]),t.marks.length>0?(o.openBlock(),o.createElementBlock("div",i1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.marks,C=>(o.openBlock(),o.createElementBlock("div",{key:C.value,class:"absolute flex flex-col items-center",style:o.normalizeStyle({left:`${D(C.value)}%`,transform:"translateX(-50%)"})},[k[0]||(k[0]=o.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),o.createElementVNode("span",l1,o.toDisplayString(C.label),1)],4))),128))])):o.createCommentVNode("",!0)]),l.value?(o.openBlock(),o.createElementBlock("div",c1,[k[1]||(k[1]=o.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),o.createTextVNode(" "+o.toDisplayString(t.error),1)])):o.createCommentVNode("",!0),M.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent("style"),{key:2},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(M.value),1)]),_:1})):o.createCommentVNode("",!0)],2)),[[o.vShow,u.value]])}}),u1={class:"inline-flex items-center gap-3"},f1=["for"],h1={key:0,class:"text-red-500 ml-1"},m1=["id","name","aria-checked","aria-label","disabled"],p1={key:0,class:"absolute inset-0 flex items-center justify-center"},g1={class:"relative z-10 flex items-center gap-2"},b1=["id","name","aria-checked","aria-label","disabled"],y1={key:0,class:"absolute inset-0 flex items-center justify-center"},x1=["for"],k1={key:0,class:"text-red-500 ml-1"},w1={name:"DCodeSwitch"},ns=o.defineComponent({...w1,props:{modelValue:{type:Boolean,default:!1},label:{default:""},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:e}){const n=t,a=e,r=o.computed({get:()=>n.modelValue,set:f=>{!n.disabled&&!n.loading&&(a("update:modelValue",f),a("change",f))}}),s=o.computed(()=>{switch(n.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=o.computed(()=>{switch(n.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=o.computed(()=>{switch(n.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=o.computed(()=>{if(n.disabled)return"bg-gray-300";if(!r.value)return"bg-gray-200";switch(n.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{r.value=!r.value},u=o.computed(()=>r.value?n.tooltipActiveText:n.tooltipInactiveText);return(f,h)=>(o.openBlock(),o.createElementBlock("div",u1,[t.label&&t.labelPosition==="left"?(o.openBlock(),o.createElementBlock("label",{key:0,for:t.id,class:o.normalizeClass(["text-sm font-medium text-gray-700 cursor-pointer",{"opacity-50":t.disabled}])},[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",h1,"*")):o.createCommentVNode("",!0)],10,f1)):o.createCommentVNode("",!0),o.createVNode(o.unref(ii),null,{default:o.withCtx(()=>[t.showTooltip?(o.openBlock(),o.createBlock(o.unref(ri),{key:0,"delay-duration":200},{default:o.withCtx(()=>[o.createVNode(o.unref(li),{"as-child":""},{default:o.withCtx(()=>[o.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":r.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[o.createElementVNode("span",{class:o.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"])},[t.loading?(o.openBlock(),o.createElementBlock("span",p1,[...h[0]||(h[0]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.Check),{key:0,class:o.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"])):!r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.X),{key:1,class:o.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"])):o.createCommentVNode("",!0)]),_:1})],2)],10,m1)]),_:1}),o.createVNode(o.unref(si),{side:"top","side-offset":8,class:o.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[r.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:o.withCtx(()=>[o.createElementVNode("span",g1,[o.createElementVNode("span",{class:o.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",r.value?"bg-green-200":"bg-gray-300"])},null,2),o.createTextVNode(" "+o.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":r.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:o.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[o.createElementVNode("span",{class:o.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"])},[t.loading?(o.openBlock(),o.createElementBlock("span",y1,[...h[1]||(h[1]=[o.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[o.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),o.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):o.createCommentVNode("",!0),o.createVNode(o.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:o.withCtx(()=>[r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.Check),{key:0,class:o.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"])):!r.value&&!t.loading?(o.openBlock(),o.createBlock(o.unref(ne.X),{key:1,class:o.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"])):o.createCommentVNode("",!0)]),_:1})],2)],10,b1))]),_:1}),t.label&&t.labelPosition==="right"?(o.openBlock(),o.createElementBlock("label",{key:1,for:t.id,class:o.normalizeClass(["text-sm font-medium text-gray-700 cursor-pointer",{"opacity-50":t.disabled}])},[o.createTextVNode(o.toDisplayString(t.label)+" ",1),t.required?(o.openBlock(),o.createElementBlock("span",k1,"*")):o.createCommentVNode("",!0)],10,x1)):o.createCommentVNode("",!0)]))}}),_1=["aria-busy"],C1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},B1={key:1,class:"flex justify-end"},S1={key:0,class:"ml-1 text-destructive"},E1={class:"relative w-full group"},D1={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},V1={key:1},M1={key:1,class:"absolute inset-y-0 right-3 flex items-center"},N1={key:2,class:"absolute inset-y-0 right-3 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"},A1={key:1,class:"text-xs text-destructive"},os=o.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}},emits:["update:modelValue","clear"],setup(t,{emit:e}){const n=o.useAttrs(),a=o.computed(()=>l.valueType==="password"||n.type==="password"),r=o.ref(!1),s=()=>{r.value=!r.value},i=e,l=t,c=o.computed(()=>n.label);o.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=o.computed(()=>`app-text-field-${n.id||c.value||"field"}-${d}`),f=o.computed(()=>{const P=n.required,q=n["aria-required"];return P===""||P===!0||P==="true"||(q==="true"||q===!0)}),h=o.computed(()=>{const{label:P,class:q,id:oe,required:he,"aria-required":ze,...ot}=n;return ot}),m=o.computed(()=>{const P={...h.value};return l.valueType==="number"&&(P.type="text",P.inputmode="numeric",P.pattern="[0-9]*"),l.valueType==="email"&&(P.type="email",P.inputmode="email"),a.value&&(P.type=r.value?"text":"password"),l.disabled&&(P.disabled=!0),P}),b=o.computed(()=>{const P=l.modelValue;return P==null||String(P).length===0}),p=o.computed(()=>l.clearable?l.hideClearWhenEmpty?!b.value:!0:!1),g=o.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),y=o.ref(String(l.modelValue??""));o.watch(()=>l.modelValue,P=>{const q=String(P??"");q!==y.value&&(y.value=q)});const B=o.ref(!1),D=o.ref(!1),M=P=>P.split(/(\s+)/).map(q=>{if(q.trim()==="")return q;const oe=q.toLowerCase();return oe.charAt(0).toUpperCase()+oe.slice(1)}).join(""),S=P=>{const q=P.toLowerCase(),oe=q.search(new RegExp("\\p{L}","u"));return oe<0?q:q.slice(0,oe)+q.charAt(oe).toUpperCase()+q.slice(oe+1)},k=P=>{switch(l.textCase){case"uppercase":return P.toUpperCase();case"lowercase":return P.toLowerCase();case"titlecase":return M(P);case"sentencecase":return S(P);case"none":default:return P}},C=P=>{if(!P)return null;const q=Array.isArray(P)?P.join(""):P;return q?new Set(q):null},x=o.computed(()=>C(l.allowChars)),w=(P,q)=>(P.lastIndex=0,P.test(q)),E=P=>{if(l.valueType==="free"||l.valueType==="email"||l.valueType==="password")return!0;const q=P===" ",oe=/\d/.test(P),he=new RegExp("\\p{L}","u").test(P),ze=new RegExp("\\p{N}","u").test(P);return l.valueType==="number"?oe:l.valueType==="letter"?he||l.allowSpaces&&q:l.valueType==="letternumber"?he||ze||l.allowSpaces&&q:!0},A=P=>{let q="";for(const oe of P){const he=!!x.value&&x.value.has(oe);l.pattern&&!he&&!w(l.pattern,oe)||!he&&!E(oe)||(q+=oe)}return q},T=o.computed(()=>{const P=n.maxlength??n.maxLength;let q=Number.NaN;return typeof P=="number"?q=P:typeof P=="string"&&(q=Number.parseInt(P,10)),Number.isFinite(q)&&q>0?q:-1}),F=o.computed(()=>y.value.length),L=o.computed(()=>l.showCharCount?T.value>0:!1),Y=P=>T.value>0?P.slice(0,T.value):P,z=P=>{const q=A(P),oe=l.applyTextCaseToValue?k(q):q;return Y(oe)};let v=null;const W=P=>{if(P==="")return null;if(l.valueType==="number"&&l.returnNumber){const q=Number(P);return Number.isFinite(q)?q:null}return P},O=P=>{y.value=P,i("update:modelValue",W(P))},N=(P,q)=>{const oe=Y(q);D.value=!0,P.value=oe,O(oe),queueMicrotask(()=>D.value=!1)},H=(P,q)=>{const oe=P.selectionStart??P.value.length,he=P.selectionEnd??P.value.length;if(T.value>0){const ze=P.value.length-(he-oe),ot=T.value-ze;if(ot<=0)return;q=q.slice(0,ot)}P.setRangeText(q,oe,he,"end"),N(P,z(P.value))},j=P=>{var he;if(!v||B.value||D.value||!((he=P.inputType)!=null&&he.startsWith("insert")))return;const q=P.data;if(q==null)return;const oe=z(q);oe!==q&&(P.preventDefault(),oe.length>0&&H(v,oe))},J=P=>{var he;if(!v||B.value||D.value)return;const q=((he=P.clipboardData)==null?void 0:he.getData("text"))??"",oe=z(q);oe!==q&&(P.preventDefault(),oe.length>0&&H(v,oe))},te=P=>{if(!v||B.value||D.value)return;const q=P.target,oe=q.value??"",he=z(oe);he===oe?O(he):N(q,he)},ue=()=>B.value=!0,fe=()=>{if(B.value=!1,!v)return;const P=v.value??"",q=z(P);q===P?O(q):N(v,q)};o.onMounted(()=>{if(v=document.getElementById(u.value),!v)return;v.addEventListener("beforeinput",j),v.addEventListener("paste",J),v.addEventListener("input",te),v.addEventListener("compositionstart",ue),v.addEventListener("compositionend",fe);const P=v.value??"",q=z(P);q===P?O(q):N(v,q)}),o.onBeforeUnmount(()=>{v&&(v.removeEventListener("beforeinput",j),v.removeEventListener("paste",J),v.removeEventListener("input",te),v.removeEventListener("compositionstart",ue),v.removeEventListener("compositionend",fe),v=null)});const pe=()=>{y.value="",v&&(v.value=""),i("update:modelValue",null),i("clear")},Le=o.computed(()=>L.value&&F.value>0),be=o.computed(()=>`${F.value} / ${T.value}`),U=o.computed(()=>!!l.error);return(P,q)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":l.skeleton},[l.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[c.value?(o.openBlock(),o.createElementBlock("div",C1)):o.createCommentVNode("",!0),q[1]||(q[1]=o.createElementVNode("div",{class:"relative w-full"},[o.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),L.value?(o.openBlock(),o.createElementBlock("div",B1,[...q[0]||(q[0]=[o.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):o.createCommentVNode("",!0)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[c.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:u.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.value)+" ",1),f.value?(o.openBlock(),o.createElementBlock("span",S1,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",E1,[l.icon||l.prependInner||P.$slots["prepend-inner"]?(o.openBlock(),o.createElementBlock("div",D1,[o.renderSlot(P.$slots,"prepend-inner",{},()=>[l.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(o.openBlock(),o.createElementBlock("span",V1,o.toDisplayString(l.prependInner),1)):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0),o.createVNode(o.unref(pn),o.mergeProps({id:u.value,modelValue:y.value},m.value,{placeholder:l.placeholder,style:{textTransform:g.value},class:["w-full h-10 flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-within:ring-1 focus-within:ring-white",l.icon||l.prependInner||P.$slots["prepend-inner"]?"pl-10":"",p.value?"pr-10":"",a.value?"pr-10":"",U.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,["id","modelValue","placeholder","style","class"]),a.value?(o.openBlock(),o.createElementBlock("div",M1,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.value?o.unref(ne.Eye):o.unref(ne.EyeOff)),{class:"w-4 h-4"}))])])):o.createCommentVNode("",!0),p.value&&!a.value?(o.openBlock(),o.createElementBlock("div",N1,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:pe}," ✕ ")])):o.createCommentVNode("",!0),Le.value&&!U.value?(o.openBlock(),o.createElementBlock("p",P1,o.toDisplayString(be.value),1)):o.createCommentVNode("",!0)]),U.value?(o.openBlock(),o.createElementBlock("p",A1,o.toDisplayString(l.error),1)):o.createCommentVNode("",!0)],64))],10,_1)),[[o.vShow,t.visible]])}}),$1=["aria-busy"],T1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},O1={key:0,class:"ml-1 text-destructive"},z1={class:"relative w-full group"},F1=["id","value"],R1={key:0,class:"absolute top-1 right-2"},v1={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"},L1={key:1,class:"text-xs text-destructive"},Ca=o.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:e}){const n=o.useAttrs(),a=e,r=t,s=o.computed(()=>n.label),i=o.computed(()=>r.visible??!0),l=Math.random().toString(36).slice(2,7),c=o.computed(()=>`app-textarea-${n.id||s.value||"field"}-${l}`),d=o.computed(()=>{const U=n.required,P=n["aria-required"];return U===""||U===!0||U==="true"||(P==="true"||P===!0)}),u=o.computed(()=>{const{label:U,class:P,id:q,required:oe,"aria-required":he,...ze}=n;return ze}),f=o.computed(()=>{const U=n.maxlength;let P=Number.NaN;return typeof U=="number"?P=U:typeof U=="string"&&(P=Number.parseInt(U,10)),Number.isFinite(P)&&P>0?P:-1}),h=U=>f.value>0?U.slice(0,f.value):U,m=o.computed(()=>{const U=r.modelValue;return U==null||String(U).length===0}),b=o.computed(()=>r.clearable?r.hideClearWhenEmpty?!m.value:!0:!1),p=o.ref(String(r.modelValue??""));o.watch(()=>r.modelValue,U=>{const P=String(U??"");P!==p.value&&(p.value=P)});const g=o.ref(!1),y=o.ref(!1),B=U=>U.split(/(\s+)/).map(P=>{if(P.trim()==="")return P;const q=P.toLowerCase();return q.charAt(0).toUpperCase()+q.slice(1)}).join(""),D=U=>{const P=U.toLowerCase(),q=P.search(new RegExp("\\p{L}","u"));return q<0?P:P.slice(0,q)+P.charAt(q).toUpperCase()+P.slice(q+1)},M=U=>{switch(r.textCase){case"uppercase":return U.toUpperCase();case"lowercase":return U.toLowerCase();case"titlecase":return B(U);case"sentencecase":return D(U);case"none":default:return U}},S=o.computed(()=>{switch(r.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),k=U=>{if(!U)return null;const P=Array.isArray(U)?U.join(""):U;return P?new Set(P):null},C=o.computed(()=>k(r.allowChars)),x=(U,P)=>(U.lastIndex=0,U.test(P)),w=U=>{if(U===`
93
93
  `)return r.valueType!=="number";if(r.valueType==="free")return!0;const P=U===" ",q=/\d/.test(U),oe=new RegExp("\\p{L}","u").test(U),he=new RegExp("\\p{N}","u").test(U);return r.valueType==="number"?q:r.valueType==="letter"?oe||r.allowSpaces&&P:r.valueType==="letternumber"?oe||he||r.allowSpaces&&P:!0},E=U=>{let P="";for(const q of U){const oe=!!C.value&&C.value.has(q);r.pattern&&!oe&&!x(r.pattern,q)||!oe&&!w(q)||(P+=q)}return P},A=U=>{const P=E(U),q=r.applyTextCaseToValue?M(P):P;return h(q)};let T=null;const F=U=>{if(U==="")return null;if(r.valueType==="number"&&r.returnNumber){const P=U.replaceAll(`
94
- `,""),q=Number(P);return Number.isFinite(q)?q:null}return U},L=U=>{p.value=U,a("update:modelValue",F(U))},Y=(U,P)=>{const q=h(P);y.value=!0,U.value=q,L(q),queueMicrotask(()=>y.value=!1)},z=(U,P)=>{const q=U.selectionStart??U.value.length,oe=U.selectionEnd??U.value.length;if(f.value>0){const he=U.value.length-(oe-q),ze=f.value-he;if(ze<=0)return;P=P.slice(0,ze)}U.setRangeText(P,q,oe,"end"),Y(U,A(U.value))},v=U=>{var oe;if(!T||g.value||y.value||!((oe=U.inputType)!=null&&oe.startsWith("insert")))return;const P=U.data;if(P==null)return;const q=A(P);q!==P&&(U.preventDefault(),q.length>0&&z(T,q))},W=U=>{var oe;if(!T||g.value||y.value)return;const P=((oe=U.clipboardData)==null?void 0:oe.getData("text"))??"",q=A(P);q!==P&&(U.preventDefault(),q.length>0&&z(T,q))},O=async U=>{if(!T||g.value||y.value)return;const P=U.target,q=P.value??"",oe=A(q);if(oe===q){const he=P.selectionStart??oe.length,ze=P.selectionEnd??oe.length;Y(P,oe),await o.nextTick();try{P.setSelectionRange(he,ze)}catch{}L(oe)}else{const he=P.selectionStart??oe.length,ze=P.selectionEnd??oe.length;Y(P,oe),await o.nextTick();try{P.setSelectionRange(he,ze)}catch{}}},N=()=>g.value=!0,H=()=>{if(g.value=!1,!T)return;const U=T.value??"",P=A(U);P===U?L(P):Y(T,P)};o.onMounted(()=>{if(T=document.getElementById(c.value),!T)return;T.addEventListener("beforeinput",v),T.addEventListener("paste",W),T.addEventListener("input",O),T.addEventListener("compositionstart",N),T.addEventListener("compositionend",H);const U=T.value??"",P=A(U);P===U?L(P):Y(T,P)}),o.onBeforeUnmount(()=>{T&&(T.removeEventListener("beforeinput",v),T.removeEventListener("paste",W),T.removeEventListener("input",O),T.removeEventListener("compositionstart",N),T.removeEventListener("compositionend",H),T=null)});const j=()=>{p.value="",T&&(T.value=""),a("update:modelValue",null),a("clear")},J=o.computed(()=>p.value.length),te=o.computed(()=>r.showCharCount?f.value>0:!1),ue=o.computed(()=>te.value&&J.value>0),fe=o.computed(()=>`${J.value} / ${f.value}`),pe=o.computed(()=>!!r.error),Le=o.computed(()=>{const U=n.rows,P=typeof U=="number"?U:Number.parseInt(String(U??""),10);return Number.isFinite(P)&&P>0?P:3}),be=o.computed(()=>({height:`${Le.value*24+16}px`}));return(U,P)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",z1)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:o.normalizeStyle(be.value)},null,4)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.value)+" ",1),d.value?(o.openBlock(),o.createElementBlock("span",F1,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",R1,[o.createElementVNode("textarea",o.mergeProps({id:c.value,value:p.value},u.value,{style:{textTransform:S.value},class:["flex min-h-[120px] w-full pr-10 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",pe.value?"border-destructive focus-visible:ring-destructive":""]}),null,16,v1),b.value?(o.openBlock(),o.createElementBlock("div",L1,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:j}," ✕ ")])):o.createCommentVNode("",!0),ue.value&&!pe.value?(o.openBlock(),o.createElementBlock("p",I1,o.toDisplayString(fe.value),1)):o.createCommentVNode("",!0)]),pe.value?(o.openBlock(),o.createElementBlock("p",j1,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,O1)),[[o.vShow,i.value]])}}),md=o.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.AvatarRoot),{class:o.normalizeClass(o.unref(de)(o.unref(W1)({size:t.size,shape:t.shape}),e.class))},{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},8,["class"]))}}),pd=o.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.AvatarFallback),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),gd=o.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.AvatarImage),o.mergeProps(e,{class:"h-full w-full object-cover"}),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),W1=Wn("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"}}}),H1={class:"relative"},q1={class:"space-y-6"},U1={class:"flex items-center justify-between gap-3"},Y1={class:"font-medium"},G1={class:"text-xs text-muted-foreground"},K1={class:"mt-1 text-sm text-muted-foreground"},X1={class:"text-foreground"},J1={class:"text-foreground"},Q1={class:"mt-1 text-xs text-muted-foreground"},Z1={key:0,class:"mt-3 flex items-center gap-2 text-sm"},e_={class:"flex items-center justify-between gap-3"},t_={class:"font-medium"},n_={class:"text-xs text-muted-foreground"},o_={class:"mt-2 text-sm text-muted-foreground"},a_={class:"flex flex-wrap items-center justify-between gap-3"},r_={class:"flex items-center gap-3"},s_={class:"leading-tight"},i_={class:"text-sm font-medium"},l_={class:"text-xs text-muted-foreground"},c_={class:"flex items-center gap-2"},d_={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},u_={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},f_=["src"],h_={class:"flex-1"},m_={class:"flex items-center justify-between gap-3"},p_={class:"font-medium"},g_={class:"text-xs text-muted-foreground"},b_={class:"mt-1 text-sm text-muted-foreground"},y_={class:"text-left sm:text-center"},x_={class:"text-xs text-muted-foreground"},k_={class:"text-left sm:text-center"},w_={class:"text-xs text-muted-foreground"},__={class:"text-left sm:text-center"},C_={class:"text-xs text-muted-foreground"},B_={class:"flex items-center justify-between gap-3"},S_={class:"font-medium"},E_={class:"text-xs text-muted-foreground"},D_={class:"mt-2 text-sm text-muted-foreground"},V_={class:"mt-3 flex items-center gap-3"},M_={class:"text-sm font-medium"},N_={class:"flex items-start justify-between gap-3"},P_={class:"font-medium"},A_={class:"mt-3 grid gap-2 text-sm"},$_={class:"flex items-center justify-between gap-3"},T_={class:"flex items-center gap-2 text-muted-foreground"},O_={class:"font-medium"},z_={class:"flex items-center justify-between gap-3"},F_={class:"flex items-center gap-2 text-muted-foreground"},R_={class:"font-medium"},v_={class:"flex items-center justify-between gap-3"},L_={class:"flex items-center gap-2 text-muted-foreground"},I_={class:"font-medium"},j_={class:"flex items-center justify-between"},W_={class:"flex items-center gap-2"},H_={class:"flex items-start justify-between gap-3"},q_={class:"flex items-center gap-2"},U_={class:"font-medium"},Y_={class:"mt-2 text-sm text-muted-foreground"},G_={key:0,class:"mt-1 text-sm text-muted-foreground"},K_={class:"flex flex-wrap items-center justify-between gap-3"},X_={class:"flex items-center gap-2"},J_={class:"text-xs text-muted-foreground"},Q_={name:"DCodeTimelineWithIcons"},bd=o.defineComponent({...Q_,setup(t){const n=ke.useBreakpoints(ke.breakpointsTailwind).smaller("md");o.ref(!1);const a=o.computed(()=>[{type:"flight",title:"Get on the flight",meta:"Wednesday",from:"Charles de Gaulle Airport, Paris",to:"Heathrow Airport, London",time:"6:30 AM",fileName:"booking-card.pdf",fileIcon:"pdf"},{type:"interview",title:"Interview Schedule",meta:"April, 18",desc:"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Possimus quos, voluptates voluptas rem veniam expedita.",personName:"Rebecca Godman",personRole:"Javascript Developer"},{type:"product",title:"Sold Puma POPX Blue Color",meta:"January, 10",desc:"PUMA presents the latest shoes from its collection. Light & comfortable made with highly durable material.",customer:"Micheal Scott",price:"$375.00",qty:"1"},{type:"design",title:"Design Review",meta:"September, 20",desc:"Weekly review of freshly prepared design for our new application.",personName:"John Doe (Client)"},{type:"server",title:"Ubuntu Server",chipText:"Inactive",ip:"192.654.8.566",cpu:"4 Cores",memory:"2 GB"},{type:"location",title:"Location",chipText:"High",desc1:"Find location for the company celebration.",desc2:"Lorem ipsum, dolor sit amet consectetur adipisicing elit.",due:"15th Jan"}]),r=i=>{switch(i){case"flight":return{Icon:ne.Plane,ring:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ne.Clock,ring:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ne.ShoppingCart,ring:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ne.Pencil,ring:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ne.Server,ring:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ne.MapPin,ring:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"}}},s=i=>i.split(" ").filter(Boolean).slice(0,2).map(l=>{var c;return(c=l[0])==null?void 0:c.toUpperCase()}).join("");return(i,l)=>(o.openBlock(),o.createBlock(o.unref($n),{class:"border-none shadow-none"},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{class:"px-0"},{default:o.withCtx(()=>[o.createVNode(o.unref(wa),{class:"text-lg font-medium"},{default:o.withCtx(()=>[...l[0]||(l[0]=[o.createTextVNode("Timeline With Icons",-1)])]),_:1})]),_:1}),o.createVNode(o.unref(Tn),{class:"px-0"},{default:o.withCtx(()=>[o.createElementVNode("div",H1,[l[7]||(l[7]=o.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),o.createElementVNode("div",q1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(c,d)=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"relative pl-14"},[o.createElementVNode("div",{class:o.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",r(c.type).ring])},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r(c.type).Icon),{class:"h-4 w-4"}))],2),o.createVNode(o.unref($n),{class:"rounded-xl"},{default:o.withCtx(()=>[o.createVNode(o.unref(Tn),{class:"p-4"},{default:o.withCtx(()=>[c.type==="flight"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",U1,[o.createElementVNode("p",Y1,o.toDisplayString(c.title),1),o.createElementVNode("p",G1,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",K1,[o.createElementVNode("span",X1,o.toDisplayString(c.from),1),o.createVNode(o.unref(ne.ArrowRight),{class:"mx-2 inline h-4 w-4"}),o.createElementVNode("span",J1,o.toDisplayString(c.to),1)]),o.createElementVNode("p",Q1,o.toDisplayString(c.time),1),c.fileName?(o.openBlock(),o.createElementBlock("div",Z1,[o.createVNode(o.unref(ne.FileText),{class:"h-4 w-4 text-muted-foreground"}),o.createElementVNode("span",null,o.toDisplayString(c.fileName),1)])):o.createCommentVNode("",!0)],64)):c.type==="interview"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",e_,[o.createElementVNode("p",t_,o.toDisplayString(c.title),1),o.createElementVNode("p",n_,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",o_,o.toDisplayString(c.desc),1),o.createVNode(o.unref(yo),{class:"my-4"}),o.createElementVNode("div",a_,[o.createElementVNode("div",r_,[o.createVNode(o.unref(md),{class:"h-10 w-10"},{default:o.withCtx(()=>[c.avatarUrl?(o.openBlock(),o.createBlock(o.unref(gd),{key:0,src:c.avatarUrl},null,8,["src"])):o.createCommentVNode("",!0),o.createVNode(o.unref(pd),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s(c.personName)),1)]),_:2},1024)]),_:2},1024),o.createElementVNode("div",s_,[o.createElementVNode("p",i_,o.toDisplayString(c.personName),1),o.createElementVNode("p",l_,o.toDisplayString(c.personRole),1)])]),o.createElementVNode("div",c_,[o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.MessageSquare),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):c.type==="product"?(o.openBlock(),o.createElementBlock("div",d_,[o.createElementVNode("div",u_,[c.imgUrl?(o.openBlock(),o.createElementBlock("img",{key:0,src:c.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,f_)):(o.openBlock(),o.createBlock(o.unref(ne.ShoppingCart),{key:1,class:"h-5 w-5 text-muted-foreground"}))]),o.createElementVNode("div",h_,[o.createElementVNode("div",m_,[o.createElementVNode("p",p_,o.toDisplayString(c.title),1),o.createElementVNode("p",g_,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",b_,o.toDisplayString(c.desc),1),o.createElementVNode("div",{class:o.normalizeClass(["mt-4 grid gap-3",o.unref(n)?"grid-cols-1":"grid-cols-3"])},[o.createElementVNode("div",y_,[l[1]||(l[1]=o.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),o.createElementVNode("p",x_,o.toDisplayString(c.customer),1)]),o.createElementVNode("div",k_,[l[2]||(l[2]=o.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),o.createElementVNode("p",w_,o.toDisplayString(c.price),1)]),o.createElementVNode("div",__,[l[3]||(l[3]=o.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),o.createElementVNode("p",C_,o.toDisplayString(c.qty),1)])],2)])])):c.type==="design"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createElementVNode("div",B_,[o.createElementVNode("p",S_,o.toDisplayString(c.title),1),o.createElementVNode("p",E_,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",D_,o.toDisplayString(c.desc),1),o.createElementVNode("div",V_,[o.createVNode(o.unref(md),{class:"h-10 w-10"},{default:o.withCtx(()=>[c.avatarUrl?(o.openBlock(),o.createBlock(o.unref(gd),{key:0,src:c.avatarUrl},null,8,["src"])):o.createCommentVNode("",!0),o.createVNode(o.unref(pd),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s(c.personName)),1)]),_:2},1024)]),_:2},1024),o.createElementVNode("p",M_,o.toDisplayString(c.personName),1)])],64)):c.type==="server"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:4},[o.createElementVNode("div",N_,[o.createElementVNode("p",P_,o.toDisplayString(c.title),1),o.createVNode(o.unref(Xt),{variant:"destructive",class:"h-6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.chipText),1)]),_:2},1024)]),o.createElementVNode("div",A_,[o.createElementVNode("div",$_,[o.createElementVNode("div",T_,[o.createVNode(o.unref(ne.Globe),{class:"h-4 w-4"}),l[4]||(l[4]=o.createElementVNode("span",null,"IP Address",-1))]),o.createElementVNode("span",O_,o.toDisplayString(c.ip),1)]),o.createElementVNode("div",z_,[o.createElementVNode("div",F_,[o.createVNode(o.unref(ne.Cpu),{class:"h-4 w-4"}),l[5]||(l[5]=o.createElementVNode("span",null,"CPU",-1))]),o.createElementVNode("span",R_,o.toDisplayString(c.cpu),1)]),o.createElementVNode("div",v_,[o.createElementVNode("div",L_,[o.createVNode(o.unref(ne.CpuIcon),{class:"h-4 w-4"}),l[6]||(l[6]=o.createElementVNode("span",null,"Memory",-1))]),o.createElementVNode("span",I_,o.toDisplayString(c.memory),1)])]),o.createVNode(o.unref(yo),{class:"my-4"}),o.createElementVNode("div",j_,[o.createElementVNode("div",W_,[o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Share2),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.RefreshCcw),{class:"h-4 w-4"})]),_:1})])])],64)):c.type==="location"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:5},[o.createElementVNode("div",H_,[o.createElementVNode("div",q_,[o.createVNode(o.unref(ne.MapPin),{class:"h-4 w-4 text-muted-foreground"}),o.createElementVNode("p",U_,o.toDisplayString(c.title),1)]),o.createVNode(o.unref(Xt),{variant:"destructive",class:"h-6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.chipText),1)]),_:2},1024)]),o.createElementVNode("p",Y_,o.toDisplayString(c.desc1),1),c.desc2?(o.openBlock(),o.createElementBlock("p",G_,o.toDisplayString(c.desc2),1)):o.createCommentVNode("",!0),o.createVNode(o.unref(yo),{class:"my-4"}),o.createElementVNode("div",K_,[o.createElementVNode("div",X_,[o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Link),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.MessageSquare),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.User),{class:"h-4 w-4"})]),_:1})]),o.createElementVNode("p",J_,"Due date: "+o.toDisplayString(c.due),1)])],64)):o.createCommentVNode("",!0)]),_:2},1024)]),_:2},1024)]))),128))])])]),_:1})]),_:1}))}}),Z_={class:"dcode-upload-file"},eC={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"},tC={key:0,class:"text-xs text-gray-500 mt-1"},nC=["accept"],oC={key:1,class:"text-xs text-red-600 mt-1"},yd=o.defineComponent({__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,a=r=>{var i;const s=(i=r.target.files)==null?void 0:i[0];s&&n("update:modelValue",s)};return(r,s)=>(o.openBlock(),o.createElementBlock("div",Z_,[t.label?(o.openBlock(),o.createBlock(es,{key:0,label:t.label},null,8,["label"])):o.createCommentVNode("",!0),o.createElementVNode("div",eC,[o.createVNode(o.unref(ne.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=o.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[o.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),o.createTextVNode(" or drag and drop ")],-1)),t.accept?(o.openBlock(),o.createElementBlock("p",tC,o.toDisplayString(t.accept),1)):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"file",class:"hidden",onChange:a,accept:t.accept},null,40,nC)]),t.errorMessage?(o.openBlock(),o.createElementBlock("p",oC,o.toDisplayString(t.errorMessage),1)):o.createCommentVNode("",!0)]))}}),aC=["onClick"],rC={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},sC={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},iC={key:1},lC={key:0,class:"text-primary-700"},cC={key:1},dC={key:2},uC={key:1,class:"mr-2 text-sm font-bold opacity-70"},fC={class:"whitespace-normal text-sm text-center leading-tight"},hC={class:"flex flex-col flex-1 min-w-0"},mC={class:"text-sm text-muted-foreground"},pC={class:"px-1"},gC={name:"DCodeWizard"},xd=o.defineComponent({...gC,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}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:e}){const n=t,a=e,r=at(),s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=o.ref(n.defaultTab),l=o.computed({get(){var k;if(typeof n.modelValue=="string"){const C=(k=n.tabs)==null?void 0:k.findIndex(x=>x.key===n.modelValue);if(C!==void 0&&C>=0)return C}return(typeof n.modelValue=="number"?n.modelValue:void 0)??i.value},set(k){var C;if(i.value=k,typeof n.modelValue=="string"){const x=(C=n.tabs)==null?void 0:C[k];x?a("update:modelValue",x.key):a("update:modelValue",k)}else a("update:modelValue",k)}}),c=o.computed(()=>{var k;return((k=n.tabs)==null?void 0:k.length)??0}),d=o.computed(()=>{var k;return(k=n.tabs)==null?void 0:k[l.value]});function u(k){return c.value<=0?0:Math.min(Math.max(k,0),c.value-1)}const f=o.reactive({});function h(k){return f[k.key]||(f[k.key]={loaded:!1,loading:!1,data:null,error:null}),f[k.key]}function m(){if(n.apiOptions)return typeof n.apiOptions=="function"?n.apiOptions():n.apiOptions}function b(k){const C=k.endpoint||{};return{apiModule:k.apiModule||C.apiModule,apiAction:k.apiAction||C.apiAction,apiUrl:C.apiUrl,apiMethod:C.apiMethod||"GET",apiParams:k.apiParams}}function p(k){if(n.isWizard||!n.allowTabClick||n.disabled)return!1;const C=n.tabs[k];return!(!C||C.disabled)}async function g(k){if(typeof k.tab.fetchData=="function"){const F=await k.tab.fetchData(),L=(F==null?void 0:F.data)??F;return(L==null?void 0:L.data)??L}const C=b(k.tab);if(!(C.apiModule&&C.apiAction||C.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const w=m();let E;if(C.apiUrl)E=await s("","",w,{_url:C.apiUrl,_method:C.apiMethod,_data:C.apiParams??void 0});else{const F={...w,...C.apiParams};E=await s(C.apiModule,C.apiAction,F)}const A=(E==null?void 0:E.data)??E;return(A==null?void 0:A.data)??A}async function y(k,{force:C=!1}={}){const x=u(k),w=n.tabs[x];if(!w)return;const E=h(w);if(!(n.cache&&E.loaded&&!C)&&!E.loading){E.loading=!0,E.error=null;try{const A=await g({tabIndex:x,tab:w});E.data=A,E.loaded=!0,a("loaded",{tabIndex:x,tab:w,data:A})}catch(A){const T=typeof(A==null?void 0:A.message)=="string"&&A.message||typeof A=="string"&&A||"Failed to load tab data.";E.error=T,a("error",{tabIndex:x,tab:w,message:T})}finally{E.loading=!1}}}function B(k){const C=u(k);p(C)&&C!==l.value&&(l.value=C)}function D(k=l.value){return y(k,{force:!0})}function M(){const k=u(l.value-1);k!==l.value&&(l.value=k)}function S(){const k=u(l.value+1);k!==l.value&&(l.value=k)}return o.watch(()=>n.tabs,k=>{for(const C of k??[])h(C)},{immediate:!0}),o.watch(()=>l.value,async k=>{var x;const C=(x=n.tabs)==null?void 0:x[k];C&&a("change",{tabIndex:k,tab:C}),await y(k)},{immediate:!0}),o.watch(()=>n.autoFetchOnMount,async k=>{k&&await y(l.value)},{immediate:!0}),(k,C)=>(o.openBlock(),o.createBlock(o.unref($n),{class:o.normalizeClass(["w-full",{"flex flex-row":t.isVertical}])},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{class:o.normalizeClass({"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(t.tabs,(x,w)=>(o.openBlock(),o.createElementBlock("div",{key:x.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[o.createElementVNode("div",{class:o.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-white dark:bg-zinc-800",[w<l.value?"border-primary bg-primary text-white border-primary-500":"",w===l.value?"border-primary text-primary border-primary-500 ring-2 ring-primary/20":"border-slate-300 dark:border-zinc-600 text-slate-500"]])},[t.typeWizard==="icon"&&x.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.icon),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!x.icon&&t.typeWizard!=="none"?(o.openBlock(),o.createElementBlock("span",iC,[w<l.value?(o.openBlock(),o.createElementBlock("span",lC,"✓")):(o.openBlock(),o.createElementBlock("span",cC,o.toDisplayString(w+1),1))])):(o.openBlock(),o.createElementBlock("span",dC))],2),o.createElementVNode("span",{class:o.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",w===l.value?"text-primary":"text-slate-500"])},o.toDisplayString(x.title),3)]))),128)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(t.tabs,(x,w)=>(o.openBlock(),o.createElementBlock("div",{key:x.key,onClick:E=>B(w),style:o.normalizeStyle({zIndex:t.tabs.length-w}),class:"relative flex-1 group"},[o.createElementVNode("div",{class:o.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[w>0?"pl-8":"",w===l.value?"bg-primary text-primary-foreground":w<l.value?"bg-primary/20 text-primary hover:bg-primary/30":"bg-slate-100 dark:bg-zinc-800 text-slate-500 group-hover:bg-slate-200 dark:group-hover:bg-zinc-700"]])},[t.typeWizard==="icon"&&x.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.icon),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",rC,o.toDisplayString(w+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",sC,o.toDisplayString(x.title),1)],2),w<t.tabs.length-1?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["absolute top-0 -right-4 w-0 h-0 border-t-[24px] border-t-transparent border-b-[24px] border-b-transparent border-l-[16px] transition-colors",[w===l.value?"border-l-primary":w<l.value?"border-l-primary/20 group-hover:border-l-primary/30":"border-l-slate-100 dark:border-l-zinc-800 group-hover:border-l-slate-200 dark:group-hover:border-l-zinc-700"]])},null,2)):o.createCommentVNode("",!0)],12,aC))),128))],2)):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tabs,(x,w)=>(o.openBlock(),o.createBlock(o.unref(Ce),{key:x.key,type:"button",variant:"ghost",disabled:!p(w),onClick:E=>B(w),class:o.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none",o.unref(de)("border-b border-r border-slate-200 dark:border-zinc-700",!t.isVertical&&w===t.tabs.length-1&&"border-r-0",w===l.value?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300 font-semibold":"bg-white dark:bg-zinc-900 text-slate-600 dark:text-zinc-400 hover:bg-slate-50 dark:hover:bg-zinc-800",!p(w)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},{default:o.withCtx(()=>[t.typeWizard==="icon"&&x.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.icon),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",uC,o.toDisplayString(w+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",fC,o.toDisplayString(x.title),1)]),_:2},1032,["disabled","onClick","class"]))),128))],2))],2)]),_:1},8,["class"]),t.isVertical?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(yo),{key:0})),o.createElementVNode("div",hC,[o.createVNode(o.unref(Tn),{class:o.normalizeClass(["pt-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},{default:o.withCtx(()=>{var x,w,E;return[d.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(x=f[d.value.key])!=null&&x.loading?o.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[C[0]||(C[0]=o.createElementVNode("div",{class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground"},"Loading...",-1))]):o.renderSlot(k.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(w=f[d.value.key])==null?void 0:w.data,loaded:(E=f[d.value.key])==null?void 0:E.loaded,reload:D},()=>[o.createElementVNode("div",mC,[C[1]||(C[1]=o.createTextVNode(" Slot ",-1)),o.createElementVNode("code",pC,"tab-"+o.toDisplayString(d.value.key),1),C[2]||(C[2]=o.createTextVNode(" belum dibuat. ",-1))])])],64)):o.createCommentVNode("",!0)]}),_:3},8,["class"]),t.isWizard||t.showNavigation?(o.openBlock(),o.createBlock(o.unref(gk),{key:0,class:o.normalizeClass(["flex justify-between p-6 pt-0",{"pl-6":t.isVertical}])},{default:o.withCtx(()=>[o.createVNode(o.unref(Ce),{type:"button",variant:"outline",onClick:M,disabled:l.value<=0},{default:o.withCtx(()=>[...C[3]||(C[3]=[o.createTextVNode(" Sebelumnya ",-1)])]),_:1},8,["disabled"]),l.value<c.value-1?(o.openBlock(),o.createBlock(o.unref(Ce),{key:0,type:"button",onClick:S},{default:o.withCtx(()=>[...C[4]||(C[4]=[o.createTextVNode(" Selanjutnya ",-1)])]),_:1})):(o.openBlock(),o.createBlock(o.unref(Ce),{key:1,type:"submit",disabled:t.loading},{default:o.withCtx(()=>[t.loading?(o.openBlock(),o.createBlock(o.unref(ne.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.submitText),1)]),_:1},8,["disabled"]))]),_:1},8,["class"])):o.createCommentVNode("",!0)])]),_:3},8,["class"]))}}),xo=new Map;function bC(t,e){xo.set(t,e)}function kd(t){if(xo.has(t))return xo.get(t);if(typeof window<"u"&&window.__MICRO_LOGIC_REGISTRY__){const e=window.__MICRO_LOGIC_REGISTRY__;if(e[t])return xo.set(t,e[t]),e[t]}return null}function yC(t){xo.delete(t)}function wd(t){const e=o.ref(kd(t));return{logicModule:e,onReady:r=>{var s;if((s=e.value)!=null&&s.onReady)try{e.value.onReady(r)}catch(i){console.error(`[AutoLayout] Error in onReady for "${t}":`,i)}},handleAction:(r,s)=>{var i;if((i=e.value)!=null&&i.handleAction)try{return e.value.handleAction(r,s)!==!1}catch(l){console.error(`[AutoLayout] Error in handleAction "${r}":`,l)}return!1}}}function xC(){return{setPageTitle:n=>{typeof document<"u"&&(document.title=n||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:n},bubbles:!0,composed:!0}))},setBreadcrumb:n=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:n},bubbles:!0,composed:!0}))}}}const kC={class:"w-full"},wC={class:"relative mx-auto min-h-[37.5rem]"},_C={key:"content",class:"w-full"},CC={class:"mb-6"},BC={class:"text-neutral-500 dark:text-neutral-400"},SC={key:"skeleton",class:"w-full"},EC={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},DC=Hn(o.defineComponent({__name:"AutoLayoutForm",props:{layoutCode:{}},setup(t){var C,x;const e=t,n=(x=(C=o.getCurrentInstance())==null?void 0:C.appContext)==null?void 0:x.app;n&&!n._context.provides[Symbol.for("vue-router-route-location")]&&n.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let a;try{a=zn.useRoute()}catch{a={query:{},params:{},path:""}}let r;try{r=zn.useRouter()}catch{r={back:()=>console.warn("Router back() not available in custom element"),push:()=>console.warn("Router push() not available in custom element")}}const{apiUrl:s,DCodeApi:i}=at();let l;try{l=wo.useI18n().locale}catch{l=o.ref("en")}const{setPageTitle:c}=xC(),d=o.computed(()=>a.params&&"id"in a.params?!0:a.path?/\/edit\/[^\/]+$/.test(a.path):!1),u=o.computed(()=>{if(a.params&&"id"in a.params)return a.params.id;if(!a.path)return null;const w=a.path.match(/\/edit\/([^\/]+)$/);return w?w[1]:null}),f=o.ref({}),h=o.ref(null),m=o.ref(!0),b=o.ref(!1),{onReady:p,handleAction:g}=wd(e.layoutCode),y=o.ref(e.layoutCode),B=o.computed(()=>{var A;if(!h.value)return"";const w=((A=l==null?void 0:l.value)==null?void 0:A.toLowerCase())||"en";return(w==="en"||w.startsWith("en-")?h.value.titleEN:h.value.titleID)||h.value.title||e.layoutCode});o.watch(B,w=>{w&&c(w)},{immediate:!0});const D=async()=>{var w,E,A;m.value=!0;try{let T=e.layoutCode;a&&a.query&&typeof a.query=="object"&&"code"in a.query&&(T=a.query.code||e.layoutCode);let F=await s(`/api/auto-layout/form/form-dynamic?code=${T}`,"GET");if(!F.status||!F.data||Array.isArray(F.data)&&F.data.length===0)try{const L=await s(`/api/auto-layout/datatable/form-dynamic?code=${T}`,"GET");if(L.status){const Y=Array.isArray(L.data)?L.data[0]:L.data;Y&&Y.code&&(T=Y.code,y.value=T,F=await s(`/api/auto-layout/form/form-dynamic?code=${T}`,"GET"))}}catch(L){console.warn("Failed to resolve layout code via datatable",L)}if(F.status){h.value=Array.isArray(F.data)?F.data[0]:F.data;const L={};if((w=h.value)!=null&&w.sections&&h.value.sections.forEach(Y=>{((Y.propsForm||Y.props||{}).fields||Y.fields||[]).forEach(W=>{var N;const O=W.model||((N=W.props)==null?void 0:N.model)||W.key;O&&(L[O]=null)})}),f.value=L,m.value=!1,d.value&&u.value){b.value=!0;try{if((E=h.value.endpointGlobal)!=null&&E.apiUrl){const Y=h.value.endpointGlobal.apiUrl,z=h.value.endpointGlobal.apiMethod||"GET",v={id:u.value},W=await i(Y,z,v);if(W.status){const O=Array.isArray(W.data)?W.data[0]:W.data;f.value={...f.value,...O}}}else{const Y=((A=h.value.endpoint)==null?void 0:A.detailUrl)||`/api/${y.value}/detail/${u.value}`,z=await s(Y,"GET");if(z.status){let v=Array.isArray(z.data)?z.data[0]:z.data;if(z.payload){const O={...z.payload};if(Object.keys(O).forEach(N=>{v[N]!==void 0&&v[N]!==null&&(O[N]=v[N])}),!("id"in O)&&v.id){const N=Object.keys(O).find(H=>H.startsWith("id")&&H.length>2&&!O[H]);N&&(O[N]=v.id)}v=O}const W={...v};Object.keys(f.value).forEach(O=>{if(W[O]===void 0||W[O]===null){if(O.toLowerCase().startsWith("id")&&O.length>2){const H=O.substring(2).toLowerCase(),j=Array.isArray(z.data)?z.data[0]:z.data,J=Object.keys(j).find(te=>te.toLowerCase()===H);J&&j[J]&&typeof j[J]=="object"&&"id"in j[J]&&(W[O]=j[J].id)}if(O==="idSupervisor"){const H=Array.isArray(z.data)?z.data[0]:z.data;H.supervisorId&&(W[O]=H.supervisorId)}}}),f.value={...f.value,...W}}}}catch(Y){console.error("Failed to fetch record data:",Y)}finally{b.value=!1}}}}catch(T){console.error("Failed to load form layout:",T),m.value=!1}finally{p({config:h.value,formValues:f})}},M=async w=>{var A,T,F;if(!g("submit",w))try{const L=(F=(T=(A=h.value.sections)==null?void 0:A[0])==null?void 0:T.propsForm)==null?void 0:F.endpointForm,Y=h.value.endpointGlobal||h.value.endpoint,z=(L==null?void 0:L.submitUrl)||(Y==null?void 0:Y.submitUrl)||`/api/generic/${e.layoutCode}`,v=(L==null?void 0:L.submitMethod)||(Y==null?void 0:Y.submitMethod)||(d.value?"PUT":"POST"),W={...w};d.value&&u.value&&!W.id&&(W.id=u.value),await s(z,v,W),r.back()}catch(L){console.error("Submit failed:",L)}},S=async(w,E)=>{if(w==="cancel"){k();return}const A=E.endpointPropAction||E.propsActionGlobal&&E.propsActionGlobal.endpointPropAction;if(A)try{m.value=!0;const T={...f.value};d.value&&E.model&&u.value&&(T[E.model]=u.value);const F=A.apiUrl,L=A.apiMethod||"POST";(await i(F,L,T)).status&&r.back()}catch(T){console.error("Action failed:",T)}finally{m.value=!1}},k=()=>{r.back()};return o.onMounted(()=>{D()}),o.onUnmounted(()=>{c("")}),(w,E)=>{const A=o.resolveComponent("DynamicForm"),T=o.resolveComponent("AutoLayoutSkeleton");return o.openBlock(),o.createElementBlock("div",kC,[o.createElementVNode("div",wC,[o.createVNode(o.Transition,{name:"fade",mode:"out-in"},{default:o.withCtx(()=>[!m.value&&h.value?(o.openBlock(),o.createElementBlock("div",_C,[o.createElementVNode("div",CC,[o.createElementVNode("p",BC,o.toDisplayString(h.value.description),1)]),o.createVNode(A,{schema:h.value,model:f.value,"is-edit-mode":d.value,loading:b.value,onSubmit:M,onCancel:k,onAction:S,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):m.value?(o.openBlock(),o.createElementBlock("div",SC,[o.createVNode(T)])):(o.openBlock(),o.createElementBlock("div",EC," Failed to load form configuration for "+o.toDisplayString(e.layoutCode),1))]),_:1})])])}}}),[["__scopeId","data-v-e7db8668"]]),VC=(t,e="short",n="id-ID")=>{const a=typeof t=="string"?new Date(t):t,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"}[n]||n;return e==="time"?s(a):e==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a):e==="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)},MC=o.defineComponent({__name:"Sheet",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),NC=o.defineComponent({inheritAttrs:!1,__name:"SheetContent",props:{class:{type:[Boolean,null,String,Object,Array]},side:{},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class","side"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),o.createVNode(o.unref(Q.DialogContent),o.mergeProps({class:o.unref(de)(o.unref(zC)({side:t.side}),n.class)},{...o.unref(s),...i.$attrs}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default"),o.createVNode(o.unref(Q.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-secondary"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.X),{class:"w-4 h-4"})]),_:1})]),_:3},16,["class"])]),_:3}))}}),PC=o.defineComponent({__name:"SheetDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogDescription),o.mergeProps({class:o.unref(de)("text-sm text-muted-foreground",e.class)},o.unref(n)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),AC=o.defineComponent({__name:"SheetFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),$C=o.defineComponent({__name:"SheetHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col gap-y-2 text-center sm:text-left",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),TC=o.defineComponent({__name:"SheetTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogTitle),o.mergeProps({class:o.unref(de)("text-lg font-medium text-foreground",e.class)},o.unref(n)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),OC=o.defineComponent({__name:"SheetTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogTrigger),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),zC=Wn("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),FC={class:"flex-1 overflow-hidden"},RC=o.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t){return(e,n)=>(o.openBlock(),o.createBlock(o.unref(MC),null,{default:o.withCtx(()=>[o.createVNode(o.unref(OC),{"as-child":""},{default:o.withCtx(()=>[o.renderSlot(e.$slots,"trigger",{},()=>[o.createVNode(o.unref(Ce),{variant:"outline",class:"gap-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Search),{class:"w-4 h-4"}),n[0]||(n[0]=o.createElementVNode("span",null,"Pencarian",-1))]),_:1})])]),_:3}),o.createVNode(o.unref(NC),{class:"flex flex-col h-full"},{default:o.withCtx(()=>[o.createVNode(o.unref($C),{class:"flex-shrink-0"},{default:o.withCtx(()=>[o.createVNode(o.unref(TC),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),o.createVNode(o.unref(PC),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.description),1)]),_:1})]),_:1}),o.createElementVNode("div",FC,[o.renderSlot(e.$slots,"default")]),o.createVNode(o.unref(AC),{class:"flex-shrink-0"},{default:o.withCtx(()=>[o.renderSlot(e.$slots,"footer")]),_:3})]),_:3})]),_:3}))}}),vC={key:0},LC=["value","name"],_d=o.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=wo.useI18n(),a=t,r=e,s=o.ref(a.modelValue);o.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:os,DCodeAutoComplete:qa,DCodeDatePicker:Ir,DCodeDateRangePicker:Kr,DCodeTextarea:Ca,DCodeTextArea:Ca,DCodeCheckbox:mo,DCodeSwitch:ns,DCodeOtpInput:ts,DCodeImageField:Zr},l=o.computed(()=>{const u=a.field.component;return i[u]||null}),c=o.computed(()=>{const u=a.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=n.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=n.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)=>t.field.isHidden?(o.openBlock(),o.createElementBlock("div",vC,[o.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,LC)])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),o.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),IC=o.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationRoot),o.mergeProps({"data-slot":"pagination"},o.unref(s),{class:n.class}),{default:o.withCtx(c=>[o.renderSlot(i.$slots,"default",o.normalizeProps(o.guardReactiveProps(c)))]),_:3},16,["class"]))}}),jC=o.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationList),o.mergeProps({"data-slot":"pagination-content"},o.unref(n),{class:o.unref(de)("flex flex-row items-center gap-1",e.class)}),{default:o.withCtx(s=>[o.renderSlot(a.$slots,"default",o.normalizeProps(o.guardReactiveProps(s)))]),_:3},16,["class"]))}}),WC=o.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationEllipsis),o.mergeProps({"data-slot":"pagination-ellipsis"},o.unref(n),{class:o.unref(de)("flex size-9 items-center justify-center",e.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default",{},()=>[o.createVNode(o.unref(ne.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=o.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),HC=o.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationFirst),o.mergeProps({"data-slot":"pagination-first",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronLeftIcon)),s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),qC=o.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 e=t,n=ke.reactiveOmit(e,"class","size","isActive");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationListItem),o.mergeProps({"data-slot":"pagination-item"},o.unref(n),{class:o.unref(de)(o.unref(_t)({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":"",e.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),UC=o.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationLast),o.mergeProps({"data-slot":"pagination-last",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),o.createVNode(o.unref(ne.ChevronRightIcon))])]),_:3},16,["class"]))}}),YC=o.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationNext),o.mergeProps({"data-slot":"pagination-next",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),o.createVNode(o.unref(ne.ChevronRightIcon))])]),_:3},16,["class"]))}}),GC=o.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationPrev),o.mergeProps({"data-slot":"pagination-previous",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronLeftIcon)),s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),KC=o.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:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),XC=o.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:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.SelectContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("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",n.class)}),{default:o.withCtx(()=>[o.createVNode(o.unref(eB)),o.createVNode(o.unref(Q.SelectViewport),{class:o.normalizeClass(o.unref(de)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},8,["class"]),o.createVNode(o.unref(ZC))]),_:3},16,["class"])]),_:3}))}}),JC={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},QC=o.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectItem),o.mergeProps(o.unref(a),{class:o.unref(de)("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",e.class)}),{default:o.withCtx(()=>[o.createElementVNode("span",JC,[o.createVNode(o.unref(Q.SelectItemIndicator),null,{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Check),{class:"h-4 w-4"})]),_:1})]),o.createVNode(o.unref(Q.SelectItemText),null,{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),ZC=o.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectScrollDownButton),o.mergeProps(o.unref(a),{class:o.unref(de)("flex cursor-default items-center justify-center py-1",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronDown))])]),_:3},16,["class"]))}}),eB=o.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectScrollUpButton),o.mergeProps(o.unref(a),{class:o.unref(de)("flex cursor-default items-center justify-center py-1",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronUp))])]),_:3},16,["class"]))}}),tB=o.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectTrigger),o.mergeProps(o.unref(a),{class:o.unref(de)("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",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default"),o.createVNode(o.unref(Q.SelectIcon),{"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),nB=o.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectValue),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),oB={class:"dcode-card animate-slide-up"},aB={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"},rB={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},sB={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 max-w-2xl"},iB={class:"relative w-full sm:w-64"},lB={key:0,class:"relative"},cB={class:"flex flex-col h-full"},dB={key:0,class:"flex-1 overflow-y-auto py-4"},uB={class:"grid grid-cols-1 md:grid-cols-2 gap-4 px-1"},fB={key:0,class:"sticky bottom-0 left-0 right-0 bg-white dark:bg-zinc-900 border-t border-neutral-200 dark:border-neutral-700 p-4 flex gap-2"},hB={class:"flex justify-end gap-2 w-full"},mB={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},pB={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},gB={class:"dcode-table w-full"},bB={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},yB=["onClick"],xB={key:0,class:"flex items-center justify-center w-full"},kB={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},wB={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},_B={key:0,class:"px-3 py-0.5"},CB={key:1},BB=["colspan"],SB={class:"flex flex-col items-center gap-4"},EB={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},DB={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},VB={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},MB={key:0,class:"flex items-center justify-center"},NB={key:0,class:"px-3 py-0.5 !text-center"},PB={key:0,class:"flex items-center justify-center gap-1.5"},AB={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},$B=["colspan"],TB={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"},OB={class:"flex items-center gap-4"},zB={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},FB={class:"text-neutral-900 dark:text-neutral-100 font-medium"},RB={class:"text-neutral-900 dark:text-neutral-100 font-medium"},vB={class:"text-neutral-900 dark:text-neutral-100 font-medium"},LB={class:"flex-shrink-0"},IB={class:"space-y-4"},jB={class:"text-gray-600 dark:text-gray-400"},WB={class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-4 px-1"},HB=o.defineComponent({__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}},emits:["update:search","update:sort","update:page","create","export","action","update:selection"],setup(t,{expose:e,emit:n}){const a=t,r=n,{apiUrl:s}=at(),i=zn.useRoute(),l=zn.useRouter(),{locale:c}=wo.useI18n(),d=o.ref(""),u=o.ref(1),f=o.ref(a.perPage),h=o.ref({key:"",direction:"asc"}),m=o.ref([]),b=o.ref(!1),p=o.ref(0),g=o.ref({}),y=o.ref([]),B=o.ref(null),D=o.ref(!0),M=o.ref([]),S=o.ref([]),k=o.ref([]),C=o.ref(!1),x=o.ref(!1),w=o.ref({}),E=o.ref(null),A=o.ref(null),T=o.ref(null),F=o.ref([]),L=o.computed(()=>{if(Qe.value.length===0)return!1;const _=Qe.value.map($=>{const K=pe.value.find(I=>I.type==="CHECKBOX"),V=(K==null?void 0:K.keyCheckbox)||"id";return $[V]}).filter($=>$!=null);return _.length===0?!1:_.every($=>F.value.includes($))}),Y=o.computed(()=>{if(Qe.value.length===0)return!1;const _=pe.value.find(I=>I.type==="CHECKBOX"),$=(_==null?void 0:_.keyCheckbox)||"id",K=Qe.value.map(I=>I[$]).filter(I=>I!=null),V=K.filter(I=>F.value.includes(I)).length;return V>0&&V<K.length}),z=_=>{const $=pe.value.find(I=>I.type==="CHECKBOX"),K=($==null?void 0:$.keyCheckbox)||"id",V=_[K];return V!==void 0&&F.value.includes(V)},v=_=>{const $=pe.value.find(I=>I.type==="CHECKBOX"),K=($==null?void 0:$.keyCheckbox)||"id",V=Qe.value.map(I=>I[K]).filter(I=>I!=null);if(_){const I=new Set([...F.value,...V]);F.value=Array.from(I)}else F.value=F.value.filter(I=>!V.includes(I))},W=(_,$)=>{const K=pe.value.find(X=>X.type==="CHECKBOX"),V=(K==null?void 0:K.keyCheckbox)||"id",I=_[V];I!=null&&($?F.value.includes(I)||F.value.push(I):F.value=F.value.filter(X=>X!==I))};o.watch(F,_=>{var K;r("update:selection",_);const $=L.value||_.length>1;(K=S.value)!=null&&K.length&&S.value.forEach(V=>{var I;(I=V.fieldActionGlobal)!=null&&I.length&&V.fieldActionGlobal.forEach(X=>{var Ue,Ze;const ge=V.endpoint||((Ue=V.propsActionGlobal)==null?void 0:Ue.endpointPropAction)||V.propsActionGlobal,_e=(Ze=ge==null?void 0:ge.keyParam)==null?void 0:Ze[0];(_e&&X.model===_e||!_e&&/^(id|ids|idAuditTrail)/i.test(X.model))&&$&&X.model&&(w.value[X.model]=_)})})},{deep:!0});const O=_=>_&&typeof _=="string"&&_.trim()?_:void 0,N=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiModule)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiModule)||a.apiModule}),H=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiAction)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiAction)||a.apiAction}),j=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiMethod)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiMethod)||a.apiMethod||"POST"}),J=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiUrl)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiUrl)||a.apiUrl});o.computed(()=>a.permissionBase?a.permissionBase:i.meta.permissionPath?i.meta.permissionPath:i.path);const te=o.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((_,$)=>(_.seq||0)-($.seq||0))),ue=_=>{if(!_)return"col-span-1";const $=_.toLowerCase();return{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"}[$]||"col-span-1"},fe=()=>{let _=null;if(a.tableConfig&&(_=a.tableConfig),_){B.value=_,_.headers&&(y.value=_.headers.map(V=>{var ge,_e,Ne,Ue,Ze,Ma,Td,Od,zd,Fd;if(V.key==="action"||((ge=V.custom)==null?void 0:ge.type)==="ACTION"||((_e=V.custom)==null?void 0:_e.type)==="action"){const Jt=((Ne=V.custom)==null?void 0:Ne.actionCustom)||((Ue=V.custom)==null?void 0:Ue.action);return Jt&&(M.value=Jt.map(Ot=>{const ve=Ot.propsActionCustom||Ot.props||{},Na=Ot.propCustomMessage||{};return{permission:Ot.permission,label:c.value==="id"?ve.labelID:ve.labelEN,tooltip:c.value==="id"?ve.tooltipID||ve.labelID:ve.tooltipEN||ve.labelEN,icon:ve.icon,variant:ve.variant||"ghost",bgColor:ve.bgColor,action:ve.actionType||ve.key,route:ve.route,path:ve.path,endpoint:ve.endpointPropAction,requiredCondition:Ot.requiredCondition||!1,propCustomCondition:Ot.propCustomCondition||[],openDialog:Ot.openDialog||!1,fieldActionCustom:(Ot.fieldActionCustom||[]).map(Pa=>{const ss=Pa.propsFieldCustom||Pa.propsFieldGlobal||Pa.props||{};return{...Pa,props:{...ss,endpoint:ss.endpointComponent||ss.endpoint}}}),requireConfirm:Ot.requireConfirm||ve.requireConfirm||!1,confirmTitle:c.value==="id"?Na.titleID||ve.confirmTitleID||"Konfirmasi":Na.titleEN||ve.confirmTitleEN||"Confirm",confirmMessage:c.value==="id"?Na.messageID||ve.confirmMessageID||"Apakah Anda yakin?":Na.messageEN||ve.confirmMessageEN||"Are you sure?"}})),null}let I;const X=((Ze=V.custom)==null?void 0:Ze.conditionBadge)||((Ma=V.custom)==null?void 0:Ma.condition);return(((Td=V.custom)==null?void 0:Td.type)==="BADGE"||((Od=V.custom)==null?void 0:Od.type)==="badge")&&X&&(I=X.map(Jt=>({value:Jt.value,label:c.value==="id"?Jt.labelID:Jt.labelEN,color:Jt.color,variant:Jt.variant}))),{key:V.key,label:c.value==="id"?V.labelID:V.labelEN,width:V.width,align:V.align,sortable:!0,type:(zd=V.custom)==null?void 0:zd.type,condition:I,keyCheckbox:(Fd=V.custom)==null?void 0:Fd.keyCheckbox}}).filter(V=>V!==null));const $=_.filters||_.filter;$&&Array.isArray($)&&(k.value=$.map(V=>({...V,props:V.propsFilters||V.props||{}})),k.value.forEach(V=>{g.value[V.model]=""}));const K=_.actionGlobal||_.action;K&&Array.isArray(K)&&(S.value=K.map(V=>{const I=V.propsActionGlobal||V.props||{};return{permission:V.permission,label:c.value==="id"?I.labelID||"Action":I.labelEN||"Action",tooltip:c.value==="id"?I.tooltipID||I.labelID:I.tooltipEN||I.labelEN,icon:I.icon,variant:I.variant||"default",bgColor:I.bgColor,textColor:I.textColor,route:I.route,path:I.path,endpoint:I.endpointPropAction||V.endpoint,openDialog:V.openDialog||!1,fieldActionGlobal:(V.fieldActionGlobal||V.field||[]).map(X=>{const ge=X.propsFieldGlobal||X.props||{};return{...X,props:{...ge,endpoint:ge.endpointComponent||ge.endpoint}}})}})),_.pagination!==void 0&&(D.value=_.pagination)}};o.watch(()=>a.tableConfig,()=>{fe()},{deep:!0,immediate:!0});const pe=o.computed(()=>a.dynamicColumns||a.configKey||a.tableConfig?y.value:a.columns||[]),Le=o.computed(()=>a.hasActions||M.value.length>0),be=o.computed(()=>N.value||J.value?b.value:a.loading),U=o.computed(()=>!!N.value||!!J.value),P=o.computed(()=>[]),q=_=>P.value.some($=>$.code===_),oe=(_,$)=>{if(!_.visibilityCondition)return!0;const{field:K,operator:V,value:I}=_.visibilityCondition,X=Z($,K);switch(V){case"equals":return X===I;case"notEquals":return X!==I;case"in":return Array.isArray(I)&&I.includes(X);case"notIn":return Array.isArray(I)&&!I.includes(X);case"greaterThan":return X>I;case"lessThan":return X<I;case"contains":return String(X).includes(String(I));default:return!0}},he=o.computed(()=>S.value.length===0?S.value:S.value.filter(_=>a.ignorePermissions||!_.permission?!0:q(_.permission))),ze=o.computed(()=>M.value.length===0?M.value:M.value.filter(_=>a.ignorePermissions||!_.permission?!0:q(_.permission))),ot=_=>ze.value.filter($=>oe($,_)),At=(_,$)=>{var I,X;if(_.requiredCondition&&((I=_.propCustomCondition)==null?void 0:I.length)>0){const ge=Z($,"status"),_e=_.propCustomCondition.find(Ne=>Ne.value===ge);if(_e)return _e.bgColor||_.bgColor||"primary"}if(!_.dynamicColor||!_.colorCondition)return _.bgColor||"primary";const K=Z($,_.colorCondition.field),V=(X=_.colorCondition.conditions)==null?void 0:X.find(ge=>ge.value===K);return(V==null?void 0:V.bgColor)||_.bgColor||"primary"},$t=_=>{const $=(_||"left").toLowerCase();return $==="center"?"justify-center":$==="right"?"justify-end":"justify-start"},bn={ToggleLeft:ne.ToggleLeft,SquarePen:ne.SquarePen,Trash2:ne.Trash2,Eye:ne.Eye,CheckCircle:ne.CheckCircle,Plus:ne.Plus,Download:ne.Download,RefreshCw:ne.RefreshCw,Search:ne.Search,SlidersHorizontal:ne.SlidersHorizontal},On=_=>_?Qt[_]?Qt[_]:bn[_]||null:null,Qe=o.computed(()=>U.value?m.value.map((_,$)=>({..._,no:(u.value-1)*f.value+$+1})):Ae.value),Tt=o.computed(()=>U.value?p.value:ce.value.length),ko=o.computed(()=>Tt.value===0?0:(u.value-1)*f.value+1),R=o.computed(()=>{const _=u.value*f.value;return _>Tt.value?Tt.value:_}),Z=(_,$)=>{if(!(!_||!$))return $ in _?_[$]:$.split(".").reduce((K,V)=>K&&K[V],_)},ce=o.computed(()=>{if(U.value)return[];if(!d.value)return a.data;const _=d.value.toLowerCase();return a.data.filter($=>pe.value.some(K=>{const V=Z($,K.key);return V==null?!1:String(V).toLowerCase().includes(_)}))}),Ve=o.computed(()=>U.value?[]:h.value.key?[...ce.value].sort(($,K)=>{const V=Z($,h.value.key),I=Z(K,h.value.key);if(V===I)return 0;let X=0;return typeof V=="number"&&typeof I=="number"?X=V-I:X=String(V).localeCompare(String(I)),h.value.direction==="asc"?X:-X}):ce.value),Ae=o.computed(()=>{if(U.value)return[];const _=(u.value-1)*f.value,$=_+f.value;return Ve.value.slice(_,$).map((K,V)=>({...K,no:_+V+1}))}),G=o.computed(()=>U.value?Object.values(g.value).some(_=>!!_):!!d.value),ee=[10,25,50,100],ae=()=>{U.value&&(g.value={...g.value,keyword:d.value},u.value=1,qe())};let me;const $e=()=>{a.enableQuickSearch&&(clearTimeout(me),me=setTimeout(()=>{ae()},500))};let lt;const Sd=()=>{clearTimeout(lt),lt=setTimeout(()=>{U.value&&qe()},1e3)};o.watch(d,()=>{a.enableQuickSearch&&U.value&&$e()});const qe=async()=>{if(U.value&&!(!N.value&&!J.value))try{b.value=!0;const _={page:u.value,perPage:f.value,...g.value,...a.apiParams};d.value&&(_.keyword=d.value),Object.keys(_).forEach(K=>{(_[K]===""||_[K]===null||_[K]===void 0)&&delete _[K]});let $;N.value?$=await s(N.value,H.value,_):J.value&&($=await s(J.value,j.value,_)),Ed($)}catch(_){console.error("DataTable fetch error",_),b.value=!1}},Ed=_=>{console.log("DataTable handleResponseData:",_),_&&(a.dynamicColumns&&_.columns&&Array.isArray(_.columns)&&(y.value=_.columns.map($=>({key:$.key||$.field||$.name,label:$.label||$.header||$.name,width:$.width,align:$.align||"LEFT",sortable:$.sortable!==!1,type:$.type,condition:$.condition,format:$.format}))),_.data&&Array.isArray(_.data)?(m.value=_.data,_.totalData?p.value=_.totalData:_.maxPage?p.value=_.maxPage*f.value:p.value=_.data.length*(_.maxPage||1)):Array.isArray(_)?(m.value=_,p.value=_.length):_.users?(m.value=_.users,p.value=_.users.length):_.items&&Array.isArray(_.items)?(m.value=_.items,p.value=_.total||_.totalItems||_.items.length):_.list&&Array.isArray(_.list)?(m.value=_.list,p.value=_.total||_.list.length):_.rows&&Array.isArray(_.rows)?(m.value=_.rows,p.value=_.count||_.total||_.rows.length):_.result&&Array.isArray(_.result)?(m.value=_.result,p.value=_.total||_.count||_.result.length):(console.warn("DataTable: Unknown response format",_),m.value=[],p.value=0)),b.value=!1};o.onUnmounted(()=>{clearTimeout(me),clearTimeout(lt)});const Sa=()=>{Object.keys(g.value).forEach(_=>{g.value[_]=""}),d.value="",u.value=1,qe()},Dd=()=>{u.value=1,qe()},Ea=(_,$)=>{const K=Z(_,$.key);let V={variant:"secondary",class:"",label:K};if($.condition){const I=$.condition.find(X=>{const ge=(_e,Ne)=>typeof _e=="string"&&typeof Ne=="string"?_e.toLowerCase().trim()===Ne.toLowerCase().trim():_e==Ne;return typeof K=="object"&&K!==null?ge(X.value,K.code)||ge(X.value,K.id):ge(X.value,K)});if(I){if(I.variant&&(V.variant=I.variant),V.label=I.label||(typeof K=="object"?K.name||K.code:K),I.color){const X=I.color.toLowerCase(),ge=V.variant==="outline",_e={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"},Ne={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"},Ue={danger:"destructive",secondary:"secondary",primary:"default"};ge?Ne[X]&&(V.class=Ne[X]):Ue[X]?V.variant=Ue[X]:_e[X]&&(V.class=_e[X])}}else V.label=typeof K=="object"?(K==null?void 0:K.name)||(K==null?void 0:K.code)||"-":K}else V.label=typeof K=="object"?(K==null?void 0:K.name)||(K==null?void 0:K.code)||"-":K;return V},Vd=_=>{h.value.key===_?h.value.direction=h.value.direction==="asc"?"desc":"asc":(h.value.key=_,h.value.direction="asc"),r("update:sort",h.value)},as=_=>{_!==u.value&&(u.value=_,U.value&&qe(),r("update:page",_))},Md=_=>{f.value=_,u.value=1,U.value&&qe()},Nd=_=>{const $=Math.random()*15+75;if(_.width){const K=parseInt(String(_.width));return K<100?`${Math.floor(K*(Math.random()*.2+.7))}px`:`${$}%`}return`${$}%`},rs=()=>{d.value="",g.value={},u.value=1,qe()},Pd=_=>{var $;if(_.route){if(_.path){const K=_.route.startsWith("/")?_.route:"/"+_.route;sessionStorage.setItem(`layout_${K}`,_.path)}l.push(_.route)}else if(_.openDialog){A.value=_,T.value=null,w.value={};const K=_.fieldActionGlobal||_.field||[];K.length&&K.forEach(V=>{var ge;const I=_.endpoint||((ge=_.propsActionGlobal)==null?void 0:ge.endpointPropAction)||_.propsActionGlobal,X=I!=null&&I.keyParam&&I.keyParam.length>0?I.keyParam[0]:null;X&&V.model===X||!X&&/^(id|ids|idAuditTrail)/i.test(V.model)?w.value[V.model]=F.value:w.value[V.model]||(w.value[V.model]="")}),x.value=!0}else r("action",{action:(($=_.propsActionCustom)==null?void 0:$.key)||_.key||"create",row:null,selection:F.value})},Ad=(_,$)=>{if(_.requireConfirm){E.value={button:_,row:$},C.value=!0;return}if(_.openDialog){A.value=_,T.value=$,w.value={};const K=pe.value.find(I=>I.type==="CHECKBOX"),V=(K==null?void 0:K.keyCheckbox)||"id";_.fieldActionCustom&&_.fieldActionCustom.forEach(I=>{/^(id|ids|idAuditTrail)/i.test(I.model)?w.value[I.model]=[$[V]]:w.value[I.model]=""}),x.value=!0;return}Da(_,$)},Da=(_,$)=>{if(_.route){if(_.path){const I=_.route.startsWith("/")?_.route:"/"+_.route;sessionStorage.setItem(`layout_${I}`,_.path)}let K=_.route;K.includes(":")?K=K.replaceAll(/:([a-zA-Z0-9_]+)/g,(I,X)=>$[X]||$.id||X):$.id&&(K=`${K.replace(/\/$/,"")}/${$.id}`);const V={};_.path&&(V.code=_.path),l.push({path:K,query:V})}else if(_.endpoint&&_.endpoint.apiUrl){b.value=!0;const{apiUrl:K}=at(),V=_.endpoint.apiUrl,I=_.endpoint.apiMethod||"POST",X={};_.endpoint.keyParam&&Array.isArray(_.endpoint.keyParam)&&_.endpoint.keyParam.forEach((ge,_e)=>{const Ne=_.endpoint.model&&_e===0?_.endpoint.model:ge;$[ge]!==void 0&&(X[Ne]=$[ge])}),Object.keys(X).length===0&&$.id&&(X.id=$.id),K(V,I,X).then(()=>{qe(),r("action",{action:_.action||"success",row:$})}).catch(ge=>{console.error("Action Failed",ge)}).finally(()=>{b.value=!1})}else r("action",{action:_.action,row:$})},JB=()=>{E.value&&(Da(E.value.button,E.value.row),$d())},QB=()=>{var _,$;if(A.value){const K=A.value,V=K.endpoint||((_=K.propsActionGlobal)==null?void 0:_.endpointPropAction)||K.propsActionGlobal;let I=(V==null?void 0:V.model)||(V!=null&&V.keyParam&&V.keyParam.length>0?V.keyParam[0]:null);if(!I){const Ne=(K.fieldActionGlobal||K.fieldActionCustom||K.field||[]).find(Ue=>/^(id|ids|idAuditTrail)/i.test(Ue.model));I=Ne?Ne.model:"ids"}let X=null,ge=!1;if(T.value){const _e=pe.value.find(Ze=>Ze.type==="CHECKBOX"),Ne=(_e==null?void 0:_e.keyCheckbox)||"id",Ue=T.value[Ne];V!=null&&V.apiUrl&&(X={...w.value},X[I]||(X[I]=[Ue]),ge=!0)}else V!=null&&V.apiUrl&&(X={...w.value},X[I]||(X[I]=F.value||[]),ge=!0);if(ge&&X&&(V!=null&&V.apiUrl)){const{apiUrl:_e}=at(),Ne=V.apiUrl,Ue=V.apiMethod||"POST";_e(Ne,Ue,X).then(()=>{x.value=!1,T.value||(F.value=[]),qe(),r("action",{action:"success",row:null})}).catch(Ze=>{console.error("Action Failed",Ze)})}else if(T.value){const _e=pe.value.find(Ma=>Ma.type==="CHECKBOX"),Ne=(_e==null?void 0:_e.keyCheckbox)||"id",Ue=T.value[Ne],Ze={...w.value};Ze[I]||(Ze[I]=[Ue]),r("action",{action:A.value.action,row:Ze}),x.value=!1}else{const _e={...w.value};_e[I]||(_e[I]=F.value);const Ne={action:(($=A.value.propsActionGlobal)==null?void 0:$.key)||A.value.key,row:_e,selection:F.value};r("action",Ne),x.value=!1}}},$d=()=>{C.value=!1,E.value=null},ZB=o.computed(()=>E.value?E.value.button.confirmTitle||"Confirm":""),e2=o.computed(()=>E.value?E.value.button.confirmMessage||"Confirm":"");e({fetchData:qe,filters:g,resetFilters:Sa,handleRefresh:rs});const Va=o.ref(""),t2=_=>{if(!_)return"";const $=_.endpoint||_.endpointGlobal||{};return JSON.stringify({url:$.apiUrl||_.apiUrl,module:$.apiModule||_.apiModule,action:$.apiAction||_.apiAction,method:$.apiMethod||_.apiMethod,params:_.apiParams,socket:$.socket||_.socketEndpoint,socketParams:_.socketParams})};return o.watch(()=>a.tableConfig,()=>{if(a.tableConfig){fe();const _=t2(a.tableConfig);_!==Va.value&&(!Va.value&&(U.value||isSocketMode.value)?(Va.value=_,qe()):(Va.value=_,(U.value||isSocketMode.value)&&Sd()))}},{deep:!0,immediate:!0}),o.watch(()=>a.apiModule,()=>{U.value&&qe()}),o.watch(()=>a.apiParams,()=>{U.value&&qe()},{deep:!0}),o.onMounted(()=>{fe(),U.value&&(a.tableConfig||(b.value=!0,qe()))}),(_,$)=>{var K;return o.openBlock(),o.createElementBlock("div",oB,[o.createElementVNode("div",aB,[o.createElementVNode("div",rB,[t.nested?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",sB,[o.createElementVNode("div",iB,[o.createVNode(o.unref(ne.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),o.createVNode(o.unref(pn),{modelValue:d.value,"onUpdate:modelValue":$[0]||($[0]=V=>d.value=V),placeholder:"Search...",class:"pl-9 h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:o.withKeys(ae,["enter"])},null,8,["modelValue"])]),k.value.length>0?(o.openBlock(),o.createElementBlock("div",lB,[o.createVNode(RC,null,{trigger:o.withCtx(()=>[o.createVNode(ht,{variant:"secondary",icon:o.unref(ne.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"},null,8,["icon"])]),footer:o.withCtx(()=>[o.createElementVNode("div",hB,[o.renderSlot(_.$slots,"filter-footer",{fetch:qe,reset:Sa})])]),default:o.withCtx(()=>[o.createElementVNode("div",cB,[o.renderSlot(_.$slots,"filter-form",{filters:g.value},()=>[k.value.length>0?(o.openBlock(),o.createElementBlock("div",dB,[o.createElementVNode("div",uB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(te.value,(V,I)=>(o.openBlock(),o.createElementBlock("div",{key:I,class:o.normalizeClass(ue(V.column))},[o.createVNode(_d,{field:V,modelValue:g.value[V.model],"onUpdate:modelValue":X=>g.value[V.model]=X},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):o.createCommentVNode("",!0)]),k.value.length>0?(o.openBlock(),o.createElementBlock("div",fB,[o.createVNode(o.unref(Ce),{variant:"outline",onClick:Sa,disabled:be.value,class:"flex-1 w-full"},{default:o.withCtx(()=>[...$[8]||($[8]=[o.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"]),o.createVNode(o.unref(Ce),{onClick:Dd,disabled:be.value,class:"flex-1 w-full"},{default:o.withCtx(()=>[...$[9]||($[9]=[o.createTextVNode(" Search ",-1)])]),_:1},8,["disabled"])])):o.createCommentVNode("",!0)])]),_:3})])):o.createCommentVNode("",!0)])),o.createElementVNode("div",{class:o.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(o.openBlock(),o.createElementBlock("span",mB)):o.createCommentVNode("",!0),t.nested?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(ht,{key:1,variant:"secondary",icon:o.unref(ne.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:rs,disabled:be.value},{icon:o.withCtx(()=>[o.createVNode(o.unref(ne.RefreshCw),{class:o.normalizeClass(["w-3.5 h-3.5",{"animate-spin":be.value}])},null,8,["class"])]),_:1},8,["icon","disabled"])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(he.value,(V,I)=>(o.openBlock(),o.createBlock(ht,{key:I,icon:On(V.icon),text:V.label,tooltip:V.tooltip,variant:V.variant,"bg-color":V.bgColor,"text-color":V.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:X=>Pd(V)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),o.renderSlot(_.$slots,"header-actions")],2)])]),o.createElementVNode("div",pB,[o.createElementVNode("table",gB,[o.createElementVNode("thead",bB,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(pe.value,V=>(o.openBlock(),o.createElementBlock("th",{key:V.key,class:o.normalizeClass([V.align?`text-${V.align.toLowerCase()}`:"",V.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:o.normalizeStyle(V.width?{width:V.width}:{}),onClick:I=>V.sortable&&Vd(V.key)},[V.type==="CHECKBOX"?(o.openBlock(),o.createElementBlock("div",xB,[o.createVNode(mo,{"model-value":L.value,indeterminate:Y.value,"onUpdate:modelValue":$[1]||($[1]=I=>v(!!I)),onClick:$[2]||($[2]=o.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-2 w-full",$t(V.align)])},[o.createElementVNode("span",null,o.toDisplayString(V.label),1)],2))],14,yB))),128)),Le.value?(o.openBlock(),o.createElementBlock("th",kB,[...$[10]||($[10]=[o.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):o.createCommentVNode("",!0)])]),o.createElementVNode("tbody",wB,[be.value?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(f.value,V=>(o.openBlock(),o.createElementBlock("tr",{key:`skeleton-${V}`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(pe.value,I=>{var X,ge;return o.openBlock(),o.createElementBlock("td",{key:I.key,class:o.normalizeClass([I.align?`text-${I.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[o.createElementVNode("div",{class:o.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(I.type??"")||I.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((X=I.align)==null?void 0:X.toLowerCase())==="center"?"mx-auto":"",((ge=I.align)==null?void 0:ge.toLowerCase())==="right"?"ml-auto":""]]),style:o.normalizeStyle({width:["badge","BADGE"].includes(I.type??"")||I.condition?void 0:Nd(I),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(o.openBlock(),o.createElementBlock("td",_B,[...$[11]||($[11]=[o.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[o.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),o.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),o.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):o.createCommentVNode("",!0)]))),128)):Qe.value.length===0?(o.openBlock(),o.createElementBlock("tr",CB,[o.createElementVNode("td",{colspan:pe.value.length+(Le.value?1:0),class:"text-center py-16"},[o.createElementVNode("div",SB,[o.createElementVNode("div",null,[o.createElementVNode("p",EB,o.toDisplayString(G.value?"No search results":"No data"),1),o.createElementVNode("p",DB,o.toDisplayString(G.value?"Try changing keywords":"No data added"),1)])])],8,BB)])):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:2},o.renderList(Qe.value,(V,I)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:I},[o.createElementVNode("tr",VB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(pe.value,X=>(o.openBlock(),o.createElementBlock("td",{key:X.key,class:o.normalizeClass([X.align?`text-${X.align}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[o.renderSlot(_.$slots,`cell-${X.key}`,{row:V,value:Z(V,X.key)},()=>[X.type==="CHECKBOX"?(o.openBlock(),o.createElementBlock("div",MB,[o.createVNode(mo,{"model-value":z(V),"onUpdate:modelValue":ge=>W(V,!!ge),onClick:$[3]||($[3]=o.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):X.type==="badge"||X.type==="BADGE"||X.condition?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[X.align?`justify-${X.align}`:"justify-start"]])},[o.createVNode(o.unref(Xt),{variant:Ea(V,X).variant,class:o.normalizeClass([Ea(V,X).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Ea(V,X).label),1)]),_:2},1032,["variant","class"])],2)):X.key==="no"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString((u.value-1)*f.value+I+1),1)],64)):X.type==="date"||X.type==="DATE"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createTextVNode(o.toDisplayString(Z(V,X.key)?o.unref(VC)(Z(V,X.key),"long"):"-"),1)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:4},[o.createTextVNode(o.toDisplayString(X.format?X.format(Z(V,X.key)):Z(V,X.key)),1)],64))])],2))),128)),Le.value?(o.openBlock(),o.createElementBlock("td",NB,[o.renderSlot(_.$slots,"actions",{row:V,buttons:ot(V),getButtonColor:At,getIconComponent:On},()=>[ot(V).length>0?(o.openBlock(),o.createElementBlock("div",PB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ot(V),(X,ge)=>(o.openBlock(),o.createElementBlock("div",{key:ge,class:"group relative"},[o.createVNode(ht,{tooltip:X.tooltip||X.label,icon:On(X.icon),size:"icon",variant:X.variant||"ghost","bg-color":At(X,V),onClick:_e=>Ad(X,V)},null,8,["tooltip","icon","variant","bg-color","onClick"])]))),128))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),_.$slots["expanded-row"]?(o.openBlock(),o.createElementBlock("tr",AB,[o.createElementVNode("td",{colspan:pe.value.length+(Le.value?1:0),class:"px-0 py-0"},[o.renderSlot(_.$slots,"expanded-row",{row:V,index:I})],8,$B)])):o.createCommentVNode("",!0)],64))),128))])])]),!be.value&&Qe.value.length>0&&t.showPagination&&D.value?(o.openBlock(),o.createElementBlock("div",TB,[o.createElementVNode("div",OB,[o.createVNode(o.unref(KC),{"model-value":String(f.value),"onUpdate:modelValue":$[4]||($[4]=V=>Md(Number(V)))},{default:o.withCtx(()=>[o.createVNode(o.unref(tB),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:o.withCtx(()=>[o.createVNode(o.unref(nB),{placeholder:String(f.value)},null,8,["placeholder"])]),_:1}),o.createVNode(o.unref(XC),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(ee,V=>o.createVNode(o.unref(QC),{key:V,value:String(V)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(V),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),$[16]||($[16]=o.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),o.createElementVNode("span",zB,[$[12]||($[12]=o.createTextVNode(" Showing ",-1)),o.createElementVNode("span",FB,o.toDisplayString(ko.value),1),$[13]||($[13]=o.createTextVNode(" to ",-1)),o.createElementVNode("span",RB,o.toDisplayString(R.value),1),$[14]||($[14]=o.createTextVNode(" of ",-1)),o.createElementVNode("span",vB,o.toDisplayString(Tt.value),1),$[15]||($[15]=o.createTextVNode(" items ",-1))])]),o.createElementVNode("div",LB,[o.createVNode(o.unref(IC),{total:Tt.value,"items-per-page":f.value,"sibling-count":1,"show-edges":"",page:u.value,"onUpdate:page":as,class:"scale-90 origin-right"},{default:o.withCtx(()=>[o.createVNode(o.unref(jC),{class:"flex items-center gap-1"},{default:o.withCtx(({items:V})=>[o.createVNode(o.unref(HC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(GC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(V,(I,X)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[I.type==="page"?(o.openBlock(),o.createBlock(o.unref(qC),{key:X,value:I.value,"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Ce),{class:"w-8 h-8 p-0 text-sm",variant:I.value===u.value?"default":"outline",disabled:I.value===u.value,onClick:ge=>as(I.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(I.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(o.openBlock(),o.createBlock(o.unref(WC),{key:I.type,index:X},null,8,["index"]))],64))),256)),o.createVNode(o.unref(YC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronRight),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(UC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):o.createCommentVNode("",!0),o.createVNode(ka,{modelValue:C.value,"onUpdate:modelValue":$[5]||($[5]=V=>C.value=V),title:ZB.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:o.withCtx(()=>[o.createVNode(o.unref(Ce),{variant:"outline",onClick:$d},{default:o.withCtx(()=>[...$[17]||($[17]=[o.createTextVNode(" Cancel ",-1)])]),_:1}),o.createVNode(o.unref(Ce),{onClick:JB},{default:o.withCtx(()=>[...$[18]||($[18]=[o.createTextVNode(" Yes ",-1)])]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("div",IB,[o.createElementVNode("p",jB,o.toDisplayString(e2.value),1)])]),_:1},8,["modelValue","title"]),o.createVNode(ka,{modelValue:x.value,"onUpdate:modelValue":$[7]||($[7]=V=>x.value=V),title:((K=A.value)==null?void 0:K.label)||"Action",icon:"AlertCircle","max-width":450},{actions:o.withCtx(()=>[o.createVNode(o.unref(Ce),{variant:"outline",onClick:$[6]||($[6]=V=>x.value=!1)},{default:o.withCtx(()=>[...$[19]||($[19]=[o.createTextVNode(" Cancel ",-1)])]),_:1}),o.createVNode(o.unref(Ce),{onClick:QB},{default:o.withCtx(()=>[...$[20]||($[20]=[o.createTextVNode(" Save ",-1)])]),_:1})]),default:o.withCtx(()=>{var V,I;return[o.createElementVNode("div",WB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((V=A.value)==null?void 0:V.fieldActionCustom)||((I=A.value)==null?void 0:I.fieldActionGlobal)||[],(X,ge)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:ge},[X.isHidden?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(ue(X.column))},[o.createVNode(_d,{field:X,modelValue:w.value[X.model],"onUpdate:modelValue":_e=>w.value[X.model]=_e},null,8,["field","modelValue","onUpdate:modelValue"])],2))],64))),128))])]}),_:1},8,["modelValue","title"])])}}}),qB={class:"h-full flex flex-col"},UB={key:1,class:"flex-1 flex items-center justify-center"},YB={key:2,class:"flex-1 flex items-center justify-center text-red-500"},GB=o.defineComponent({__name:"AutoLayoutDatatable",props:{layoutCode:{}},setup(t){const e=t,n=zn.useRoute(),{apiUrl:a}=at(),{onReady:r,handleAction:s}=wd(e.layoutCode),i=o.ref(null),l=o.ref(!0),c=o.ref(null),d=async()=>{l.value=!0;try{const f=await a(`/api/auto-layout/datatable/form-dinamic?code=${e.layoutCode}`,"GET");f.status&&(i.value=Array.isArray(f.data)?f.data[0]:f.data)}catch(f){console.error("Gagal Menampilkan Datatable:",f)}finally{l.value=!1,r({config:i.value,datatable:c})}},u=f=>{s(f.action,f.row)||console.log("Aksi tidak terdaftar:",f.action)};return o.onMounted(()=>{d()}),(f,h)=>(o.openBlock(),o.createElementBlock("div",qB,[!l.value&&i.value?(o.openBlock(),o.createBlock(HB,{key:0,ref_key:"dtRef",ref:c,"api-url":`/api/auto-layout/datatable/form-dinamic?code=${e.layoutCode}`,"api-method":"GET","table-config":i.value,"permission-base":o.unref(n).path,onAction:u},{"header-actions":o.withCtx(()=>[...h[0]||(h[0]=[])]),_:1},8,["api-url","table-config","permission-base"])):l.value?(o.openBlock(),o.createElementBlock("div",UB,[...h[1]||(h[1]=[o.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(o.openBlock(),o.createElementBlock("div",YB," Failed to load configuration for "+o.toDisplayString(e.layoutCode),1))]))}}),Cd=o.defineCustomElement(DC),Bd=o.defineCustomElement(GB);customElements.define("micro-dynamic-form",Cd),customElements.define("micro-dynamic-datatable",Bd);const KB=[qa,Ps,ht,Za,xc,mo,kc,Ir,Kr,ka,ad,_a,sd,Xr,id,Jr,Zr,Qr,es,ld,ts,cd,dd,ud,fd,hd,ns,os,Ca,bd,yd,xd],XB={install(t,e={}){e&&Object.keys(e).length>0&&ls(e),KB.forEach(n=>{n.name&&t.component(n.name,n)})}};le.DCodeAutoComplete=qa,le.DCodeButton=ht,le.DCodeCard=Za,le.DCodeChart=xc,le.DCodeCheckbox=mo,le.DCodeCurrencyField=kc,le.DCodeDatePicker=Ir,le.DCodeDateRangePicker=Kr,le.DCodeDialog=ka,le.DCodeDialogCloseBtn=ad,le.DCodeDropzone=_a,le.DCodeFileField=sd,le.DCodeFileResult=Xr,le.DCodeIconDropdown=id,le.DCodeImageCropperDialog=Jr,le.DCodeImageField=Zr,le.DCodeImageResult=Qr,le.DCodeInfiniteAutoComplete=Ps,le.DCodeLabel=es,le.DCodeMultiSelect=ld,le.DCodeOtpInput=ts,le.DCodeProgress=cd,le.DCodeProgressBar=dd,le.DCodeRadio=ud,le.DCodeRadioCustom=fd,le.DCodeSlider=hd,le.DCodeSwitch=ns,le.DCodeTextField=os,le.DCodeTextarea=Ca,le.DCodeTimelineWithIcons=bd,le.DCodeUploadFile=yd,le.DCodeWizard=xd,le.MicroDynamicDatatable=Bd,le.MicroDynamicForm=Cd,le.cn=de,le.default=XB,le.getLogicModule=kd,le.registerLogic=bC,le.setApiConfig=ls,le.unregisterLogic=yC,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
94
+ `,""),q=Number(P);return Number.isFinite(q)?q:null}return U},L=U=>{p.value=U,a("update:modelValue",F(U))},Y=(U,P)=>{const q=h(P);y.value=!0,U.value=q,L(q),queueMicrotask(()=>y.value=!1)},z=(U,P)=>{const q=U.selectionStart??U.value.length,oe=U.selectionEnd??U.value.length;if(f.value>0){const he=U.value.length-(oe-q),ze=f.value-he;if(ze<=0)return;P=P.slice(0,ze)}U.setRangeText(P,q,oe,"end"),Y(U,A(U.value))},v=U=>{var oe;if(!T||g.value||y.value||!((oe=U.inputType)!=null&&oe.startsWith("insert")))return;const P=U.data;if(P==null)return;const q=A(P);q!==P&&(U.preventDefault(),q.length>0&&z(T,q))},W=U=>{var oe;if(!T||g.value||y.value)return;const P=((oe=U.clipboardData)==null?void 0:oe.getData("text"))??"",q=A(P);q!==P&&(U.preventDefault(),q.length>0&&z(T,q))},O=async U=>{if(!T||g.value||y.value)return;const P=U.target,q=P.value??"",oe=A(q);if(oe===q){const he=P.selectionStart??oe.length,ze=P.selectionEnd??oe.length;Y(P,oe),await o.nextTick();try{P.setSelectionRange(he,ze)}catch{}L(oe)}else{const he=P.selectionStart??oe.length,ze=P.selectionEnd??oe.length;Y(P,oe),await o.nextTick();try{P.setSelectionRange(he,ze)}catch{}}},N=()=>g.value=!0,H=()=>{if(g.value=!1,!T)return;const U=T.value??"",P=A(U);P===U?L(P):Y(T,P)};o.onMounted(()=>{if(T=document.getElementById(c.value),!T)return;T.addEventListener("beforeinput",v),T.addEventListener("paste",W),T.addEventListener("input",O),T.addEventListener("compositionstart",N),T.addEventListener("compositionend",H);const U=T.value??"",P=A(U);P===U?L(P):Y(T,P)}),o.onBeforeUnmount(()=>{T&&(T.removeEventListener("beforeinput",v),T.removeEventListener("paste",W),T.removeEventListener("input",O),T.removeEventListener("compositionstart",N),T.removeEventListener("compositionend",H),T=null)});const j=()=>{p.value="",T&&(T.value=""),a("update:modelValue",null),a("clear")},J=o.computed(()=>p.value.length),te=o.computed(()=>r.showCharCount?f.value>0:!1),ue=o.computed(()=>te.value&&J.value>0),fe=o.computed(()=>`${J.value} / ${f.value}`),pe=o.computed(()=>!!r.error),Le=o.computed(()=>{const U=n.rows,P=typeof U=="number"?U:Number.parseInt(String(U??""),10);return Number.isFinite(P)&&P>0?P:3}),be=o.computed(()=>({height:`${Le.value*24+16}px`}));return(U,P)=>o.withDirectives((o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(["flex flex-col gap-1 w-full",o.unref(n).class]),"aria-busy":r.skeleton},[r.skeleton?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[s.value?(o.openBlock(),o.createElementBlock("div",T1)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:o.normalizeStyle(be.value)},null,4)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[s.value?(o.openBlock(),o.createBlock(o.unref(Pt),{key:0,for:c.value,class:"text-sm font-medium"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.value)+" ",1),d.value?(o.openBlock(),o.createElementBlock("span",O1,"*")):o.createCommentVNode("",!0)]),_:1},8,["for"])):o.createCommentVNode("",!0),o.createElementVNode("div",z1,[o.createElementVNode("textarea",o.mergeProps({id:c.value,value:p.value},u.value,{style:{textTransform:S.value},class:["flex min-h-[120px] w-full pr-10 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-900 text-foreground dark:text-gray-300 border-gray-300 dark:border-gray-700 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",pe.value?"border-destructive focus-visible:ring-destructive":""]}),null,16,F1),b.value?(o.openBlock(),o.createElementBlock("div",R1,[o.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:j}," ✕ ")])):o.createCommentVNode("",!0),ue.value&&!pe.value?(o.openBlock(),o.createElementBlock("p",v1,o.toDisplayString(fe.value),1)):o.createCommentVNode("",!0)]),pe.value?(o.openBlock(),o.createElementBlock("p",L1,o.toDisplayString(r.error),1)):o.createCommentVNode("",!0)],64))],10,$1)),[[o.vShow,i.value]])}}),hd=o.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.AvatarRoot),{class:o.normalizeClass(o.unref(de)(o.unref(I1)({size:t.size,shape:t.shape}),e.class))},{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},8,["class"]))}}),md=o.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.AvatarFallback),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),pd=o.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.AvatarImage),o.mergeProps(e,{class:"h-full w-full object-cover"}),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),I1=Wn("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"}}}),j1={class:"relative"},W1={class:"space-y-6"},H1={class:"flex items-center justify-between gap-3"},q1={class:"font-medium"},U1={class:"text-xs text-muted-foreground"},Y1={class:"mt-1 text-sm text-muted-foreground"},G1={class:"text-foreground"},K1={class:"text-foreground"},X1={class:"mt-1 text-xs text-muted-foreground"},J1={key:0,class:"mt-3 flex items-center gap-2 text-sm"},Q1={class:"flex items-center justify-between gap-3"},Z1={class:"font-medium"},e_={class:"text-xs text-muted-foreground"},t_={class:"mt-2 text-sm text-muted-foreground"},n_={class:"flex flex-wrap items-center justify-between gap-3"},o_={class:"flex items-center gap-3"},a_={class:"leading-tight"},r_={class:"text-sm font-medium"},s_={class:"text-xs text-muted-foreground"},i_={class:"flex items-center gap-2"},l_={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},c_={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},d_=["src"],u_={class:"flex-1"},f_={class:"flex items-center justify-between gap-3"},h_={class:"font-medium"},m_={class:"text-xs text-muted-foreground"},p_={class:"mt-1 text-sm text-muted-foreground"},g_={class:"text-left sm:text-center"},b_={class:"text-xs text-muted-foreground"},y_={class:"text-left sm:text-center"},x_={class:"text-xs text-muted-foreground"},k_={class:"text-left sm:text-center"},w_={class:"text-xs text-muted-foreground"},__={class:"flex items-center justify-between gap-3"},C_={class:"font-medium"},B_={class:"text-xs text-muted-foreground"},S_={class:"mt-2 text-sm text-muted-foreground"},E_={class:"mt-3 flex items-center gap-3"},D_={class:"text-sm font-medium"},V_={class:"flex items-start justify-between gap-3"},M_={class:"font-medium"},N_={class:"mt-3 grid gap-2 text-sm"},P_={class:"flex items-center justify-between gap-3"},A_={class:"flex items-center gap-2 text-muted-foreground"},$_={class:"font-medium"},T_={class:"flex items-center justify-between gap-3"},O_={class:"flex items-center gap-2 text-muted-foreground"},z_={class:"font-medium"},F_={class:"flex items-center justify-between gap-3"},R_={class:"flex items-center gap-2 text-muted-foreground"},v_={class:"font-medium"},L_={class:"flex items-center justify-between"},I_={class:"flex items-center gap-2"},j_={class:"flex items-start justify-between gap-3"},W_={class:"flex items-center gap-2"},H_={class:"font-medium"},q_={class:"mt-2 text-sm text-muted-foreground"},U_={key:0,class:"mt-1 text-sm text-muted-foreground"},Y_={class:"flex flex-wrap items-center justify-between gap-3"},G_={class:"flex items-center gap-2"},K_={class:"text-xs text-muted-foreground"},X_={name:"DCodeTimelineWithIcons"},gd=o.defineComponent({...X_,setup(t){const n=ke.useBreakpoints(ke.breakpointsTailwind).smaller("md");o.ref(!1);const a=o.computed(()=>[{type:"flight",title:"Get on the flight",meta:"Wednesday",from:"Charles de Gaulle Airport, Paris",to:"Heathrow Airport, London",time:"6:30 AM",fileName:"booking-card.pdf",fileIcon:"pdf"},{type:"interview",title:"Interview Schedule",meta:"April, 18",desc:"Lorem ipsum, dolor sit amet consectetur adipisicing elit. Possimus quos, voluptates voluptas rem veniam expedita.",personName:"Rebecca Godman",personRole:"Javascript Developer"},{type:"product",title:"Sold Puma POPX Blue Color",meta:"January, 10",desc:"PUMA presents the latest shoes from its collection. Light & comfortable made with highly durable material.",customer:"Micheal Scott",price:"$375.00",qty:"1"},{type:"design",title:"Design Review",meta:"September, 20",desc:"Weekly review of freshly prepared design for our new application.",personName:"John Doe (Client)"},{type:"server",title:"Ubuntu Server",chipText:"Inactive",ip:"192.654.8.566",cpu:"4 Cores",memory:"2 GB"},{type:"location",title:"Location",chipText:"High",desc1:"Find location for the company celebration.",desc2:"Lorem ipsum, dolor sit amet consectetur adipisicing elit.",due:"15th Jan"}]),r=i=>{switch(i){case"flight":return{Icon:ne.Plane,ring:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ne.Clock,ring:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ne.ShoppingCart,ring:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ne.Pencil,ring:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ne.Server,ring:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ne.MapPin,ring:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"}}},s=i=>i.split(" ").filter(Boolean).slice(0,2).map(l=>{var c;return(c=l[0])==null?void 0:c.toUpperCase()}).join("");return(i,l)=>(o.openBlock(),o.createBlock(o.unref($n),{class:"border-none shadow-none"},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{class:"px-0"},{default:o.withCtx(()=>[o.createVNode(o.unref(wa),{class:"text-lg font-medium"},{default:o.withCtx(()=>[...l[0]||(l[0]=[o.createTextVNode("Timeline With Icons",-1)])]),_:1})]),_:1}),o.createVNode(o.unref(Tn),{class:"px-0"},{default:o.withCtx(()=>[o.createElementVNode("div",j1,[l[7]||(l[7]=o.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),o.createElementVNode("div",W1,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.value,(c,d)=>(o.openBlock(),o.createElementBlock("div",{key:d,class:"relative pl-14"},[o.createElementVNode("div",{class:o.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",r(c.type).ring])},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r(c.type).Icon),{class:"h-4 w-4"}))],2),o.createVNode(o.unref($n),{class:"rounded-xl"},{default:o.withCtx(()=>[o.createVNode(o.unref(Tn),{class:"p-4"},{default:o.withCtx(()=>[c.type==="flight"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[o.createElementVNode("div",H1,[o.createElementVNode("p",q1,o.toDisplayString(c.title),1),o.createElementVNode("p",U1,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",Y1,[o.createElementVNode("span",G1,o.toDisplayString(c.from),1),o.createVNode(o.unref(ne.ArrowRight),{class:"mx-2 inline h-4 w-4"}),o.createElementVNode("span",K1,o.toDisplayString(c.to),1)]),o.createElementVNode("p",X1,o.toDisplayString(c.time),1),c.fileName?(o.openBlock(),o.createElementBlock("div",J1,[o.createVNode(o.unref(ne.FileText),{class:"h-4 w-4 text-muted-foreground"}),o.createElementVNode("span",null,o.toDisplayString(c.fileName),1)])):o.createCommentVNode("",!0)],64)):c.type==="interview"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[o.createElementVNode("div",Q1,[o.createElementVNode("p",Z1,o.toDisplayString(c.title),1),o.createElementVNode("p",e_,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",t_,o.toDisplayString(c.desc),1),o.createVNode(o.unref(yo),{class:"my-4"}),o.createElementVNode("div",n_,[o.createElementVNode("div",o_,[o.createVNode(o.unref(hd),{class:"h-10 w-10"},{default:o.withCtx(()=>[c.avatarUrl?(o.openBlock(),o.createBlock(o.unref(pd),{key:0,src:c.avatarUrl},null,8,["src"])):o.createCommentVNode("",!0),o.createVNode(o.unref(md),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s(c.personName)),1)]),_:2},1024)]),_:2},1024),o.createElementVNode("div",a_,[o.createElementVNode("p",r_,o.toDisplayString(c.personName),1),o.createElementVNode("p",s_,o.toDisplayString(c.personRole),1)])]),o.createElementVNode("div",i_,[o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.MessageSquare),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):c.type==="product"?(o.openBlock(),o.createElementBlock("div",l_,[o.createElementVNode("div",c_,[c.imgUrl?(o.openBlock(),o.createElementBlock("img",{key:0,src:c.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,d_)):(o.openBlock(),o.createBlock(o.unref(ne.ShoppingCart),{key:1,class:"h-5 w-5 text-muted-foreground"}))]),o.createElementVNode("div",u_,[o.createElementVNode("div",f_,[o.createElementVNode("p",h_,o.toDisplayString(c.title),1),o.createElementVNode("p",m_,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",p_,o.toDisplayString(c.desc),1),o.createElementVNode("div",{class:o.normalizeClass(["mt-4 grid gap-3",o.unref(n)?"grid-cols-1":"grid-cols-3"])},[o.createElementVNode("div",g_,[l[1]||(l[1]=o.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),o.createElementVNode("p",b_,o.toDisplayString(c.customer),1)]),o.createElementVNode("div",y_,[l[2]||(l[2]=o.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),o.createElementVNode("p",x_,o.toDisplayString(c.price),1)]),o.createElementVNode("div",k_,[l[3]||(l[3]=o.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),o.createElementVNode("p",w_,o.toDisplayString(c.qty),1)])],2)])])):c.type==="design"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createElementVNode("div",__,[o.createElementVNode("p",C_,o.toDisplayString(c.title),1),o.createElementVNode("p",B_,o.toDisplayString(c.meta),1)]),o.createElementVNode("p",S_,o.toDisplayString(c.desc),1),o.createElementVNode("div",E_,[o.createVNode(o.unref(hd),{class:"h-10 w-10"},{default:o.withCtx(()=>[c.avatarUrl?(o.openBlock(),o.createBlock(o.unref(pd),{key:0,src:c.avatarUrl},null,8,["src"])):o.createCommentVNode("",!0),o.createVNode(o.unref(md),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s(c.personName)),1)]),_:2},1024)]),_:2},1024),o.createElementVNode("p",D_,o.toDisplayString(c.personName),1)])],64)):c.type==="server"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:4},[o.createElementVNode("div",V_,[o.createElementVNode("p",M_,o.toDisplayString(c.title),1),o.createVNode(o.unref(Xt),{variant:"destructive",class:"h-6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.chipText),1)]),_:2},1024)]),o.createElementVNode("div",N_,[o.createElementVNode("div",P_,[o.createElementVNode("div",A_,[o.createVNode(o.unref(ne.Globe),{class:"h-4 w-4"}),l[4]||(l[4]=o.createElementVNode("span",null,"IP Address",-1))]),o.createElementVNode("span",$_,o.toDisplayString(c.ip),1)]),o.createElementVNode("div",T_,[o.createElementVNode("div",O_,[o.createVNode(o.unref(ne.Cpu),{class:"h-4 w-4"}),l[5]||(l[5]=o.createElementVNode("span",null,"CPU",-1))]),o.createElementVNode("span",z_,o.toDisplayString(c.cpu),1)]),o.createElementVNode("div",F_,[o.createElementVNode("div",R_,[o.createVNode(o.unref(ne.CpuIcon),{class:"h-4 w-4"}),l[6]||(l[6]=o.createElementVNode("span",null,"Memory",-1))]),o.createElementVNode("span",v_,o.toDisplayString(c.memory),1)])]),o.createVNode(o.unref(yo),{class:"my-4"}),o.createElementVNode("div",L_,[o.createElementVNode("div",I_,[o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Share2),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.RefreshCcw),{class:"h-4 w-4"})]),_:1})])])],64)):c.type==="location"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:5},[o.createElementVNode("div",j_,[o.createElementVNode("div",W_,[o.createVNode(o.unref(ne.MapPin),{class:"h-4 w-4 text-muted-foreground"}),o.createElementVNode("p",H_,o.toDisplayString(c.title),1)]),o.createVNode(o.unref(Xt),{variant:"destructive",class:"h-6"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(c.chipText),1)]),_:2},1024)]),o.createElementVNode("p",q_,o.toDisplayString(c.desc1),1),c.desc2?(o.openBlock(),o.createElementBlock("p",U_,o.toDisplayString(c.desc2),1)):o.createCommentVNode("",!0),o.createVNode(o.unref(yo),{class:"my-4"}),o.createElementVNode("div",Y_,[o.createElementVNode("div",G_,[o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Link),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.MessageSquare),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(Ce),{size:"icon",variant:"ghost"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.User),{class:"h-4 w-4"})]),_:1})]),o.createElementVNode("p",K_,"Due date: "+o.toDisplayString(c.due),1)])],64)):o.createCommentVNode("",!0)]),_:2},1024)]),_:2},1024)]))),128))])])]),_:1})]),_:1}))}}),J_={class:"dcode-upload-file"},Q_={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"},Z_={key:0,class:"text-xs text-gray-500 mt-1"},eC=["accept"],tC={key:1,class:"text-xs text-red-600 mt-1"},bd=o.defineComponent({__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,a=r=>{var i;const s=(i=r.target.files)==null?void 0:i[0];s&&n("update:modelValue",s)};return(r,s)=>(o.openBlock(),o.createElementBlock("div",J_,[t.label?(o.openBlock(),o.createBlock(es,{key:0,label:t.label},null,8,["label"])):o.createCommentVNode("",!0),o.createElementVNode("div",Q_,[o.createVNode(o.unref(ne.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=o.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[o.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),o.createTextVNode(" or drag and drop ")],-1)),t.accept?(o.openBlock(),o.createElementBlock("p",Z_,o.toDisplayString(t.accept),1)):o.createCommentVNode("",!0),o.createElementVNode("input",{type:"file",class:"hidden",onChange:a,accept:t.accept},null,40,eC)]),t.errorMessage?(o.openBlock(),o.createElementBlock("p",tC,o.toDisplayString(t.errorMessage),1)):o.createCommentVNode("",!0)]))}}),nC=["onClick"],oC={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},aC={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},rC={key:1},sC={key:0,class:"text-primary-700"},iC={key:1},lC={key:2},cC={key:1,class:"mr-2 text-sm font-bold opacity-70"},dC={class:"whitespace-normal text-sm text-center leading-tight"},uC={class:"flex flex-col flex-1 min-w-0"},fC={class:"text-sm text-muted-foreground"},hC={class:"px-1"},mC={name:"DCodeWizard"},yd=o.defineComponent({...mC,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}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:e}){const n=t,a=e,r=at(),s=r==null?void 0:r.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=o.ref(n.defaultTab),l=o.computed({get(){var k;if(typeof n.modelValue=="string"){const C=(k=n.tabs)==null?void 0:k.findIndex(x=>x.key===n.modelValue);if(C!==void 0&&C>=0)return C}return(typeof n.modelValue=="number"?n.modelValue:void 0)??i.value},set(k){var C;if(i.value=k,typeof n.modelValue=="string"){const x=(C=n.tabs)==null?void 0:C[k];x?a("update:modelValue",x.key):a("update:modelValue",k)}else a("update:modelValue",k)}}),c=o.computed(()=>{var k;return((k=n.tabs)==null?void 0:k.length)??0}),d=o.computed(()=>{var k;return(k=n.tabs)==null?void 0:k[l.value]});function u(k){return c.value<=0?0:Math.min(Math.max(k,0),c.value-1)}const f=o.reactive({});function h(k){return f[k.key]||(f[k.key]={loaded:!1,loading:!1,data:null,error:null}),f[k.key]}function m(){if(n.apiOptions)return typeof n.apiOptions=="function"?n.apiOptions():n.apiOptions}function b(k){const C=k.endpoint||{};return{apiModule:k.apiModule||C.apiModule,apiAction:k.apiAction||C.apiAction,apiUrl:C.apiUrl,apiMethod:C.apiMethod||"GET",apiParams:k.apiParams}}function p(k){if(n.isWizard||!n.allowTabClick||n.disabled)return!1;const C=n.tabs[k];return!(!C||C.disabled)}async function g(k){if(typeof k.tab.fetchData=="function"){const F=await k.tab.fetchData(),L=(F==null?void 0:F.data)??F;return(L==null?void 0:L.data)??L}const C=b(k.tab);if(!(C.apiModule&&C.apiAction||C.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const w=m();let E;if(C.apiUrl)E=await s("","",w,{_url:C.apiUrl,_method:C.apiMethod,_data:C.apiParams??void 0});else{const F={...w,...C.apiParams};E=await s(C.apiModule,C.apiAction,F)}const A=(E==null?void 0:E.data)??E;return(A==null?void 0:A.data)??A}async function y(k,{force:C=!1}={}){const x=u(k),w=n.tabs[x];if(!w)return;const E=h(w);if(!(n.cache&&E.loaded&&!C)&&!E.loading){E.loading=!0,E.error=null;try{const A=await g({tabIndex:x,tab:w});E.data=A,E.loaded=!0,a("loaded",{tabIndex:x,tab:w,data:A})}catch(A){const T=typeof(A==null?void 0:A.message)=="string"&&A.message||typeof A=="string"&&A||"Failed to load tab data.";E.error=T,a("error",{tabIndex:x,tab:w,message:T})}finally{E.loading=!1}}}function B(k){const C=u(k);p(C)&&C!==l.value&&(l.value=C)}function D(k=l.value){return y(k,{force:!0})}function M(){const k=u(l.value-1);k!==l.value&&(l.value=k)}function S(){const k=u(l.value+1);k!==l.value&&(l.value=k)}return o.watch(()=>n.tabs,k=>{for(const C of k??[])h(C)},{immediate:!0}),o.watch(()=>l.value,async k=>{var x;const C=(x=n.tabs)==null?void 0:x[k];C&&a("change",{tabIndex:k,tab:C}),await y(k)},{immediate:!0}),o.watch(()=>n.autoFetchOnMount,async k=>{k&&await y(l.value)},{immediate:!0}),(k,C)=>(o.openBlock(),o.createBlock(o.unref($n),{class:o.normalizeClass(["w-full",{"flex flex-row":t.isVertical}])},{default:o.withCtx(()=>[o.createVNode(o.unref(bo),{class:o.normalizeClass({"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical})},{default:o.withCtx(()=>[o.createElementVNode("div",{class:o.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:1},o.renderList(t.tabs,(x,w)=>(o.openBlock(),o.createElementBlock("div",{key:x.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[o.createElementVNode("div",{class:o.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-white dark:bg-zinc-800",[w<l.value?"border-primary bg-primary text-white border-primary-500":"",w===l.value?"border-primary text-primary border-primary-500 ring-2 ring-primary/20":"border-slate-300 dark:border-zinc-600 text-slate-500"]])},[t.typeWizard==="icon"&&x.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.icon),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!x.icon&&t.typeWizard!=="none"?(o.openBlock(),o.createElementBlock("span",rC,[w<l.value?(o.openBlock(),o.createElementBlock("span",sC,"✓")):(o.openBlock(),o.createElementBlock("span",iC,o.toDisplayString(w+1),1))])):(o.openBlock(),o.createElementBlock("span",lC))],2),o.createElementVNode("span",{class:o.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",w===l.value?"text-primary":"text-slate-500"])},o.toDisplayString(x.title),3)]))),128)):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(t.tabs,(x,w)=>(o.openBlock(),o.createElementBlock("div",{key:x.key,onClick:E=>B(w),style:o.normalizeStyle({zIndex:t.tabs.length-w}),class:"relative flex-1 group"},[o.createElementVNode("div",{class:o.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[w>0?"pl-8":"",w===l.value?"bg-primary text-primary-foreground":w<l.value?"bg-primary/20 text-primary hover:bg-primary/30":"bg-slate-100 dark:bg-zinc-800 text-slate-500 group-hover:bg-slate-200 dark:group-hover:bg-zinc-700"]])},[t.typeWizard==="icon"&&x.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.icon),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",oC,o.toDisplayString(w+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",aC,o.toDisplayString(x.title),1)],2),w<t.tabs.length-1?(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(["absolute top-0 -right-4 w-0 h-0 border-t-[24px] border-t-transparent border-b-[24px] border-b-transparent border-l-[16px] transition-colors",[w===l.value?"border-l-primary":w<l.value?"border-l-primary/20 group-hover:border-l-primary/30":"border-l-slate-100 dark:border-l-zinc-800 group-hover:border-l-slate-200 dark:group-hover:border-l-zinc-700"]])},null,2)):o.createCommentVNode("",!0)],12,nC))),128))],2)):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(t.tabs,(x,w)=>(o.openBlock(),o.createBlock(o.unref(Ce),{key:x.key,type:"button",variant:"ghost",disabled:!p(w),onClick:E=>B(w),class:o.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none",o.unref(de)("border-b border-r border-slate-200 dark:border-zinc-700",!t.isVertical&&w===t.tabs.length-1&&"border-r-0",w===l.value?"bg-primary-50 dark:bg-primary-900/20 text-primary-700 dark:text-primary-300 font-semibold":"bg-white dark:bg-zinc-900 text-slate-600 dark:text-zinc-400 hover:bg-slate-50 dark:hover:bg-zinc-800",!p(w)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},{default:o.withCtx(()=>[t.typeWizard==="icon"&&x.icon?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(x.icon),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(o.openBlock(),o.createElementBlock("span",cC,o.toDisplayString(w+1),1)):o.createCommentVNode("",!0),o.createElementVNode("span",dC,o.toDisplayString(x.title),1)]),_:2},1032,["disabled","onClick","class"]))),128))],2))],2)]),_:1},8,["class"]),t.isVertical?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(o.unref(yo),{key:0})),o.createElementVNode("div",uC,[o.createVNode(o.unref(Tn),{class:o.normalizeClass(["pt-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},{default:o.withCtx(()=>{var x,w,E;return[d.value?(o.openBlock(),o.createElementBlock(o.Fragment,{key:0},[(x=f[d.value.key])!=null&&x.loading?o.renderSlot(k.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[C[0]||(C[0]=o.createElementVNode("div",{class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground"},"Loading...",-1))]):o.renderSlot(k.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(w=f[d.value.key])==null?void 0:w.data,loaded:(E=f[d.value.key])==null?void 0:E.loaded,reload:D},()=>[o.createElementVNode("div",fC,[C[1]||(C[1]=o.createTextVNode(" Slot ",-1)),o.createElementVNode("code",hC,"tab-"+o.toDisplayString(d.value.key),1),C[2]||(C[2]=o.createTextVNode(" belum dibuat. ",-1))])])],64)):o.createCommentVNode("",!0)]}),_:3},8,["class"]),t.isWizard||t.showNavigation?(o.openBlock(),o.createBlock(o.unref(gk),{key:0,class:o.normalizeClass(["flex justify-between p-6 pt-0",{"pl-6":t.isVertical}])},{default:o.withCtx(()=>[o.createVNode(o.unref(Ce),{type:"button",variant:"outline",onClick:M,disabled:l.value<=0},{default:o.withCtx(()=>[...C[3]||(C[3]=[o.createTextVNode(" Sebelumnya ",-1)])]),_:1},8,["disabled"]),l.value<c.value-1?(o.openBlock(),o.createBlock(o.unref(Ce),{key:0,type:"button",onClick:S},{default:o.withCtx(()=>[...C[4]||(C[4]=[o.createTextVNode(" Selanjutnya ",-1)])]),_:1})):(o.openBlock(),o.createBlock(o.unref(Ce),{key:1,type:"submit",disabled:t.loading},{default:o.withCtx(()=>[t.loading?(o.openBlock(),o.createBlock(o.unref(ne.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):o.createCommentVNode("",!0),o.createTextVNode(" "+o.toDisplayString(t.submitText),1)]),_:1},8,["disabled"]))]),_:1},8,["class"])):o.createCommentVNode("",!0)])]),_:3},8,["class"]))}}),xo=new Map;function pC(t,e){xo.set(t,e)}function xd(t){if(xo.has(t))return xo.get(t);if(typeof window<"u"&&window.__MICRO_LOGIC_REGISTRY__){const e=window.__MICRO_LOGIC_REGISTRY__;if(e[t])return xo.set(t,e[t]),e[t]}return null}function gC(t){xo.delete(t)}function kd(t){const e=o.ref(xd(t));return{logicModule:e,onReady:r=>{var s;if((s=e.value)!=null&&s.onReady)try{e.value.onReady(r)}catch(i){console.error(`[AutoLayout] Error in onReady for "${t}":`,i)}},handleAction:(r,s)=>{var i;if((i=e.value)!=null&&i.handleAction)try{return e.value.handleAction(r,s)!==!1}catch(l){console.error(`[AutoLayout] Error in handleAction "${r}":`,l)}return!1}}}function bC(){return{setPageTitle:n=>{typeof document<"u"&&(document.title=n||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:n},bubbles:!0,composed:!0}))},setBreadcrumb:n=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:n},bubbles:!0,composed:!0}))}}}const yC={class:"w-full"},xC={class:"relative mx-auto min-h-[37.5rem]"},kC={key:"content",class:"w-full"},wC={class:"mb-6"},_C={class:"text-neutral-500 dark:text-neutral-400"},CC={key:"skeleton",class:"w-full"},BC={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},SC=Hn(o.defineComponent({__name:"AutoLayoutForm",props:{layoutCode:{}},setup(t){var C,x;const e=t,n=(x=(C=o.getCurrentInstance())==null?void 0:C.appContext)==null?void 0:x.app;n&&!n._context.provides[Symbol.for("vue-router-route-location")]&&n.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let a;try{a=zn.useRoute()}catch{a={query:{},params:{},path:""}}let r;try{r=zn.useRouter()}catch{r={back:()=>console.warn("Router back() not available in custom element"),push:()=>console.warn("Router push() not available in custom element")}}const{apiUrl:s,DCodeApi:i}=at();let l;try{l=wo.useI18n().locale}catch{l=o.ref("en")}const{setPageTitle:c}=bC(),d=o.computed(()=>a.params&&"id"in a.params?!0:a.path?/\/edit\/[^\/]+$/.test(a.path):!1),u=o.computed(()=>{if(a.params&&"id"in a.params)return a.params.id;if(!a.path)return null;const w=a.path.match(/\/edit\/([^\/]+)$/);return w?w[1]:null}),f=o.ref({}),h=o.ref(null),m=o.ref(!0),b=o.ref(!1),{onReady:p,handleAction:g}=kd(e.layoutCode),y=o.ref(e.layoutCode),B=o.computed(()=>{var A;if(!h.value)return"";const w=((A=l==null?void 0:l.value)==null?void 0:A.toLowerCase())||"en";return(w==="en"||w.startsWith("en-")?h.value.titleEN:h.value.titleID)||h.value.title||e.layoutCode});o.watch(B,w=>{w&&c(w)},{immediate:!0});const D=async()=>{var w,E,A;m.value=!0;try{let T=e.layoutCode;a&&a.query&&typeof a.query=="object"&&"code"in a.query&&(T=a.query.code||e.layoutCode);let F=await s(`/api/auto-layout/form/form-dynamic?code=${T}`,"GET");if(!F.status||!F.data||Array.isArray(F.data)&&F.data.length===0)try{const L=await s(`/api/auto-layout/datatable/form-dynamic?code=${T}`,"GET");if(L.status){const Y=Array.isArray(L.data)?L.data[0]:L.data;Y&&Y.code&&(T=Y.code,y.value=T,F=await s(`/api/auto-layout/form/form-dynamic?code=${T}`,"GET"))}}catch(L){console.warn("Failed to resolve layout code via datatable",L)}if(F.status){h.value=Array.isArray(F.data)?F.data[0]:F.data;const L={};if((w=h.value)!=null&&w.sections&&h.value.sections.forEach(Y=>{((Y.propsForm||Y.props||{}).fields||Y.fields||[]).forEach(W=>{var N;const O=W.model||((N=W.props)==null?void 0:N.model)||W.key;O&&(L[O]=null)})}),f.value=L,m.value=!1,d.value&&u.value){b.value=!0;try{if((E=h.value.endpointGlobal)!=null&&E.apiUrl){const Y=h.value.endpointGlobal.apiUrl,z=h.value.endpointGlobal.apiMethod||"GET",v={id:u.value},W=await i(Y,z,v);if(W.status){const O=Array.isArray(W.data)?W.data[0]:W.data;f.value={...f.value,...O}}}else{const Y=((A=h.value.endpoint)==null?void 0:A.detailUrl)||`/api/${y.value}/detail/${u.value}`,z=await s(Y,"GET");if(z.status){let v=Array.isArray(z.data)?z.data[0]:z.data;if(z.payload){const O={...z.payload};if(Object.keys(O).forEach(N=>{v[N]!==void 0&&v[N]!==null&&(O[N]=v[N])}),!("id"in O)&&v.id){const N=Object.keys(O).find(H=>H.startsWith("id")&&H.length>2&&!O[H]);N&&(O[N]=v.id)}v=O}const W={...v};Object.keys(f.value).forEach(O=>{if(W[O]===void 0||W[O]===null){if(O.toLowerCase().startsWith("id")&&O.length>2){const H=O.substring(2).toLowerCase(),j=Array.isArray(z.data)?z.data[0]:z.data,J=Object.keys(j).find(te=>te.toLowerCase()===H);J&&j[J]&&typeof j[J]=="object"&&"id"in j[J]&&(W[O]=j[J].id)}if(O==="idSupervisor"){const H=Array.isArray(z.data)?z.data[0]:z.data;H.supervisorId&&(W[O]=H.supervisorId)}}}),f.value={...f.value,...W}}}}catch(Y){console.error("Failed to fetch record data:",Y)}finally{b.value=!1}}}}catch(T){console.error("Failed to load form layout:",T),m.value=!1}finally{p({config:h.value,formValues:f})}},M=async w=>{var A,T,F;if(!g("submit",w))try{const L=(F=(T=(A=h.value.sections)==null?void 0:A[0])==null?void 0:T.propsForm)==null?void 0:F.endpointForm,Y=h.value.endpointGlobal||h.value.endpoint,z=(L==null?void 0:L.submitUrl)||(Y==null?void 0:Y.submitUrl)||`/api/generic/${e.layoutCode}`,v=(L==null?void 0:L.submitMethod)||(Y==null?void 0:Y.submitMethod)||(d.value?"PUT":"POST"),W={...w};d.value&&u.value&&!W.id&&(W.id=u.value),await s(z,v,W),r.back()}catch(L){console.error("Submit failed:",L)}},S=async(w,E)=>{if(w==="cancel"){k();return}const A=E.endpointPropAction||E.propsActionGlobal&&E.propsActionGlobal.endpointPropAction;if(A)try{m.value=!0;const T={...f.value};d.value&&E.model&&u.value&&(T[E.model]=u.value);const F=A.apiUrl,L=A.apiMethod||"POST";(await i(F,L,T)).status&&r.back()}catch(T){console.error("Action failed:",T)}finally{m.value=!1}},k=()=>{r.back()};return o.onMounted(()=>{D()}),o.onUnmounted(()=>{c("")}),(w,E)=>{const A=o.resolveComponent("DynamicForm"),T=o.resolveComponent("AutoLayoutSkeleton");return o.openBlock(),o.createElementBlock("div",yC,[o.createElementVNode("div",xC,[o.createVNode(o.Transition,{name:"fade",mode:"out-in"},{default:o.withCtx(()=>[!m.value&&h.value?(o.openBlock(),o.createElementBlock("div",kC,[o.createElementVNode("div",wC,[o.createElementVNode("p",_C,o.toDisplayString(h.value.description),1)]),o.createVNode(A,{schema:h.value,model:f.value,"is-edit-mode":d.value,loading:b.value,onSubmit:M,onCancel:k,onAction:S,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):m.value?(o.openBlock(),o.createElementBlock("div",CC,[o.createVNode(T)])):(o.openBlock(),o.createElementBlock("div",BC," Failed to load form configuration for "+o.toDisplayString(e.layoutCode),1))]),_:1})])])}}}),[["__scopeId","data-v-e7db8668"]]),EC=(t,e="short",n="id-ID")=>{const a=typeof t=="string"?new Date(t):t,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"}[n]||n;return e==="time"?s(a):e==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(a):e==="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)},DC=o.defineComponent({__name:"Sheet",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),VC=o.defineComponent({inheritAttrs:!1,__name:"SheetContent",props:{class:{type:[Boolean,null,String,Object,Array]},side:{},forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class","side"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),o.createVNode(o.unref(Q.DialogContent),o.mergeProps({class:o.unref(de)(o.unref(TC)({side:t.side}),n.class)},{...o.unref(s),...i.$attrs}),{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default"),o.createVNode(o.unref(Q.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-secondary"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.X),{class:"w-4 h-4"})]),_:1})]),_:3},16,["class"])]),_:3}))}}),MC=o.defineComponent({__name:"SheetDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogDescription),o.mergeProps({class:o.unref(de)("text-sm text-muted-foreground",e.class)},o.unref(n)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),NC=o.defineComponent({__name:"SheetFooter",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col-reverse sm:flex-row sm:justify-end sm:gap-x-2",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),PC=o.defineComponent({__name:"SheetHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(o.unref(de)("flex flex-col gap-y-2 text-center sm:text-left",e.class))},[o.renderSlot(n.$slots,"default")],2))}}),AC=o.defineComponent({__name:"SheetTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogTitle),o.mergeProps({class:o.unref(de)("text-lg font-medium text-foreground",e.class)},o.unref(n)),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),$C=o.defineComponent({__name:"SheetTrigger",props:{asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.DialogTrigger),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),TC=Wn("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),OC={class:"flex-1 overflow-hidden"},zC=o.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t){return(e,n)=>(o.openBlock(),o.createBlock(o.unref(DC),null,{default:o.withCtx(()=>[o.createVNode(o.unref($C),{"as-child":""},{default:o.withCtx(()=>[o.renderSlot(e.$slots,"trigger",{},()=>[o.createVNode(o.unref(Ce),{variant:"outline",class:"gap-2"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Search),{class:"w-4 h-4"}),n[0]||(n[0]=o.createElementVNode("span",null,"Pencarian",-1))]),_:1})])]),_:3}),o.createVNode(o.unref(VC),{class:"flex flex-col h-full"},{default:o.withCtx(()=>[o.createVNode(o.unref(PC),{class:"flex-shrink-0"},{default:o.withCtx(()=>[o.createVNode(o.unref(AC),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.title),1)]),_:1}),o.createVNode(o.unref(MC),null,{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(t.description),1)]),_:1})]),_:1}),o.createElementVNode("div",OC,[o.renderSlot(e.$slots,"default")]),o.createVNode(o.unref(NC),{class:"flex-shrink-0"},{default:o.withCtx(()=>[o.renderSlot(e.$slots,"footer")]),_:3})]),_:3})]),_:3}))}}),FC={key:0},RC=["value","name"],wd=o.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:e}){const{locale:n}=wo.useI18n(),a=t,r=e,s=o.ref(a.modelValue);o.watch(()=>a.modelValue,u=>{s.value=u});const i={DCodeTextField:os,DCodeAutoComplete:qa,DCodeDatePicker:Ir,DCodeDateRangePicker:Kr,DCodeTextarea:Ca,DCodeTextArea:Ca,DCodeCheckbox:mo,DCodeSwitch:ns,DCodeOtpInput:ts,DCodeImageField:Zr},l=o.computed(()=>{const u=a.field.component;return i[u]||null}),c=o.computed(()=>{const u=a.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=n.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=n.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)=>t.field.isHidden?(o.openBlock(),o.createElementBlock("div",FC,[o.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,RC)])):(o.openBlock(),o.createBlock(o.resolveDynamicComponent(l.value),o.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),vC=o.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(t,{emit:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationRoot),o.mergeProps({"data-slot":"pagination"},o.unref(s),{class:n.class}),{default:o.withCtx(c=>[o.renderSlot(i.$slots,"default",o.normalizeProps(o.guardReactiveProps(c)))]),_:3},16,["class"]))}}),LC=o.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationList),o.mergeProps({"data-slot":"pagination-content"},o.unref(n),{class:o.unref(de)("flex flex-row items-center gap-1",e.class)}),{default:o.withCtx(s=>[o.renderSlot(a.$slots,"default",o.normalizeProps(o.guardReactiveProps(s)))]),_:3},16,["class"]))}}),IC=o.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationEllipsis),o.mergeProps({"data-slot":"pagination-ellipsis"},o.unref(n),{class:o.unref(de)("flex size-9 items-center justify-center",e.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default",{},()=>[o.createVNode(o.unref(ne.MoreHorizontal),{class:"size-4"}),r[0]||(r[0]=o.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),jC=o.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationFirst),o.mergeProps({"data-slot":"pagination-first",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronLeftIcon)),s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),WC=o.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 e=t,n=ke.reactiveOmit(e,"class","size","isActive");return(a,r)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationListItem),o.mergeProps({"data-slot":"pagination-item"},o.unref(n),{class:o.unref(de)(o.unref(_t)({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":"",e.class)}),{default:o.withCtx(()=>[o.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),HC=o.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationLast),o.mergeProps({"data-slot":"pagination-last",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),o.createVNode(o.unref(ne.ChevronRightIcon))])]),_:3},16,["class"]))}}),qC=o.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationNext),o.mergeProps({"data-slot":"pagination-next",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),o.createVNode(o.unref(ne.ChevronRightIcon))])]),_:3},16,["class"]))}}),UC=o.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class","size"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.PaginationPrev),o.mergeProps({"data-slot":"pagination-previous",class:o.unref(de)(o.unref(_t)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",e.class)},o.unref(a)),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronLeftIcon)),s[0]||(s[0]=o.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),YC=o.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:e}){const n=t,a=e,r=Q.useForwardPropsEmits(n,a);return(s,i)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectRoot),o.normalizeProps(o.guardReactiveProps(o.unref(r))),{default:o.withCtx(()=>[o.renderSlot(s.$slots,"default")]),_:3},16))}}),GC=o.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:e}){const n=t,a=e,r=ke.reactiveOmit(n,"class"),s=Q.useForwardPropsEmits(r,a);return(i,l)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectPortal),null,{default:o.withCtx(()=>[o.createVNode(o.unref(Q.SelectContent),o.mergeProps({...o.unref(s),...i.$attrs},{class:o.unref(de)("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",n.class)}),{default:o.withCtx(()=>[o.createVNode(o.unref(QC)),o.createVNode(o.unref(Q.SelectViewport),{class:o.normalizeClass(o.unref(de)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:o.withCtx(()=>[o.renderSlot(i.$slots,"default")]),_:3},8,["class"]),o.createVNode(o.unref(JC))]),_:3},16,["class"])]),_:3}))}}),KC={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},XC=o.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectItem),o.mergeProps(o.unref(a),{class:o.unref(de)("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",e.class)}),{default:o.withCtx(()=>[o.createElementVNode("span",KC,[o.createVNode(o.unref(Q.SelectItemIndicator),null,{default:o.withCtx(()=>[o.createVNode(o.unref(ne.Check),{class:"h-4 w-4"})]),_:1})]),o.createVNode(o.unref(Q.SelectItemText),null,{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),JC=o.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectScrollDownButton),o.mergeProps(o.unref(a),{class:o.unref(de)("flex cursor-default items-center justify-center py-1",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronDown))])]),_:3},16,["class"]))}}),QC=o.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectScrollUpButton),o.mergeProps(o.unref(a),{class:o.unref(de)("flex cursor-default items-center justify-center py-1",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default",{},()=>[o.createVNode(o.unref(ne.ChevronUp))])]),_:3},16,["class"]))}}),ZC=o.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const e=t,n=ke.reactiveOmit(e,"class"),a=Q.useForwardProps(n);return(r,s)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectTrigger),o.mergeProps(o.unref(a),{class:o.unref(de)("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",e.class)}),{default:o.withCtx(()=>[o.renderSlot(r.$slots,"default"),o.createVNode(o.unref(Q.SelectIcon),{"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),eB=o.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const e=t;return(n,a)=>(o.openBlock(),o.createBlock(o.unref(Q.SelectValue),o.normalizeProps(o.guardReactiveProps(e)),{default:o.withCtx(()=>[o.renderSlot(n.$slots,"default")]),_:3},16))}}),tB={class:"dcode-card animate-slide-up"},nB={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"},oB={class:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4"},aB={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 max-w-2xl"},rB={class:"relative w-full sm:w-64"},sB={key:0,class:"relative"},iB={class:"flex flex-col h-full"},lB={key:0,class:"flex-1 overflow-y-auto py-4"},cB={class:"grid grid-cols-1 md:grid-cols-2 gap-4 px-1"},dB={key:0,class:"sticky bottom-0 left-0 right-0 bg-white dark:bg-zinc-900 border-t border-neutral-200 dark:border-neutral-700 p-4 flex gap-2"},uB={class:"flex justify-end gap-2 w-full"},fB={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},hB={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},mB={class:"dcode-table w-full"},pB={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},gB=["onClick"],bB={key:0,class:"flex items-center justify-center w-full"},yB={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},xB={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},kB={key:0,class:"px-3 py-0.5"},wB={key:1},_B=["colspan"],CB={class:"flex flex-col items-center gap-4"},BB={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},SB={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},EB={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},DB={key:0,class:"flex items-center justify-center"},VB={key:0,class:"px-3 py-0.5 !text-center"},MB={key:0,class:"flex items-center justify-center gap-1.5"},NB={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},PB=["colspan"],AB={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"},$B={class:"flex items-center gap-4"},TB={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},OB={class:"text-neutral-900 dark:text-neutral-100 font-medium"},zB={class:"text-neutral-900 dark:text-neutral-100 font-medium"},FB={class:"text-neutral-900 dark:text-neutral-100 font-medium"},RB={class:"flex-shrink-0"},vB={class:"space-y-4"},LB={class:"text-gray-600 dark:text-gray-400"},IB={class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-4 px-1"},jB=o.defineComponent({__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}},emits:["update:search","update:sort","update:page","create","export","action","update:selection"],setup(t,{expose:e,emit:n}){const a=t,r=n,{apiUrl:s}=at(),i=zn.useRoute(),l=zn.useRouter(),{locale:c}=wo.useI18n(),d=o.ref(""),u=o.ref(1),f=o.ref(a.perPage),h=o.ref({key:"",direction:"asc"}),m=o.ref([]),b=o.ref(!1),p=o.ref(0),g=o.ref({}),y=o.ref([]),B=o.ref(null),D=o.ref(!0),M=o.ref([]),S=o.ref([]),k=o.ref([]),C=o.ref(!1),x=o.ref(!1),w=o.ref({}),E=o.ref(null),A=o.ref(null),T=o.ref(null),F=o.ref([]),L=o.computed(()=>{if(Qe.value.length===0)return!1;const _=Qe.value.map($=>{const K=pe.value.find(I=>I.type==="CHECKBOX"),V=(K==null?void 0:K.keyCheckbox)||"id";return $[V]}).filter($=>$!=null);return _.length===0?!1:_.every($=>F.value.includes($))}),Y=o.computed(()=>{if(Qe.value.length===0)return!1;const _=pe.value.find(I=>I.type==="CHECKBOX"),$=(_==null?void 0:_.keyCheckbox)||"id",K=Qe.value.map(I=>I[$]).filter(I=>I!=null),V=K.filter(I=>F.value.includes(I)).length;return V>0&&V<K.length}),z=_=>{const $=pe.value.find(I=>I.type==="CHECKBOX"),K=($==null?void 0:$.keyCheckbox)||"id",V=_[K];return V!==void 0&&F.value.includes(V)},v=_=>{const $=pe.value.find(I=>I.type==="CHECKBOX"),K=($==null?void 0:$.keyCheckbox)||"id",V=Qe.value.map(I=>I[K]).filter(I=>I!=null);if(_){const I=new Set([...F.value,...V]);F.value=Array.from(I)}else F.value=F.value.filter(I=>!V.includes(I))},W=(_,$)=>{const K=pe.value.find(X=>X.type==="CHECKBOX"),V=(K==null?void 0:K.keyCheckbox)||"id",I=_[V];I!=null&&($?F.value.includes(I)||F.value.push(I):F.value=F.value.filter(X=>X!==I))};o.watch(F,_=>{var K;r("update:selection",_);const $=L.value||_.length>1;(K=S.value)!=null&&K.length&&S.value.forEach(V=>{var I;(I=V.fieldActionGlobal)!=null&&I.length&&V.fieldActionGlobal.forEach(X=>{var Ue,Ze;const ge=V.endpoint||((Ue=V.propsActionGlobal)==null?void 0:Ue.endpointPropAction)||V.propsActionGlobal,_e=(Ze=ge==null?void 0:ge.keyParam)==null?void 0:Ze[0];(_e&&X.model===_e||!_e&&/^(id|ids|idAuditTrail)/i.test(X.model))&&$&&X.model&&(w.value[X.model]=_)})})},{deep:!0});const O=_=>_&&typeof _=="string"&&_.trim()?_:void 0,N=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiModule)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiModule)||a.apiModule}),H=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiAction)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiAction)||a.apiAction}),j=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiMethod)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiMethod)||a.apiMethod||"POST"}),J=o.computed(()=>{var _,$,K,V;return O(($=(_=B.value)==null?void 0:_.endpoint)==null?void 0:$.apiUrl)||O((V=(K=B.value)==null?void 0:K.endpointGlobal)==null?void 0:V.apiUrl)||a.apiUrl});o.computed(()=>a.permissionBase?a.permissionBase:i.meta.permissionPath?i.meta.permissionPath:i.path);const te=o.computed(()=>!k.value||k.value.length===0?[]:[...k.value].sort((_,$)=>(_.seq||0)-($.seq||0))),ue=_=>{if(!_)return"col-span-1";const $=_.toLowerCase();return{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"}[$]||"col-span-1"},fe=()=>{let _=null;if(a.tableConfig&&(_=a.tableConfig),_){B.value=_,_.headers&&(y.value=_.headers.map(V=>{var ge,_e,Ne,Ue,Ze,Ma,$d,Td,Od,zd;if(V.key==="action"||((ge=V.custom)==null?void 0:ge.type)==="ACTION"||((_e=V.custom)==null?void 0:_e.type)==="action"){const Jt=((Ne=V.custom)==null?void 0:Ne.actionCustom)||((Ue=V.custom)==null?void 0:Ue.action);return Jt&&(M.value=Jt.map(Ot=>{const ve=Ot.propsActionCustom||Ot.props||{},Na=Ot.propCustomMessage||{};return{permission:Ot.permission,label:c.value==="id"?ve.labelID:ve.labelEN,tooltip:c.value==="id"?ve.tooltipID||ve.labelID:ve.tooltipEN||ve.labelEN,icon:ve.icon,variant:ve.variant||"ghost",bgColor:ve.bgColor,action:ve.actionType||ve.key,route:ve.route,path:ve.path,endpoint:ve.endpointPropAction,requiredCondition:Ot.requiredCondition||!1,propCustomCondition:Ot.propCustomCondition||[],openDialog:Ot.openDialog||!1,fieldActionCustom:(Ot.fieldActionCustom||[]).map(Pa=>{const ss=Pa.propsFieldCustom||Pa.propsFieldGlobal||Pa.props||{};return{...Pa,props:{...ss,endpoint:ss.endpointComponent||ss.endpoint}}}),requireConfirm:Ot.requireConfirm||ve.requireConfirm||!1,confirmTitle:c.value==="id"?Na.titleID||ve.confirmTitleID||"Konfirmasi":Na.titleEN||ve.confirmTitleEN||"Confirm",confirmMessage:c.value==="id"?Na.messageID||ve.confirmMessageID||"Apakah Anda yakin?":Na.messageEN||ve.confirmMessageEN||"Are you sure?"}})),null}let I;const X=((Ze=V.custom)==null?void 0:Ze.conditionBadge)||((Ma=V.custom)==null?void 0:Ma.condition);return((($d=V.custom)==null?void 0:$d.type)==="BADGE"||((Td=V.custom)==null?void 0:Td.type)==="badge")&&X&&(I=X.map(Jt=>({value:Jt.value,label:c.value==="id"?Jt.labelID:Jt.labelEN,color:Jt.color,variant:Jt.variant}))),{key:V.key,label:c.value==="id"?V.labelID:V.labelEN,width:V.width,align:V.align,sortable:!0,type:(Od=V.custom)==null?void 0:Od.type,condition:I,keyCheckbox:(zd=V.custom)==null?void 0:zd.keyCheckbox}}).filter(V=>V!==null));const $=_.filters||_.filter;$&&Array.isArray($)&&(k.value=$.map(V=>({...V,props:V.propsFilters||V.props||{}})),k.value.forEach(V=>{g.value[V.model]=""}));const K=_.actionGlobal||_.action;K&&Array.isArray(K)&&(S.value=K.map(V=>{const I=V.propsActionGlobal||V.props||{};return{permission:V.permission,label:c.value==="id"?I.labelID||"Action":I.labelEN||"Action",tooltip:c.value==="id"?I.tooltipID||I.labelID:I.tooltipEN||I.labelEN,icon:I.icon,variant:I.variant||"default",bgColor:I.bgColor,textColor:I.textColor,route:I.route,path:I.path,endpoint:I.endpointPropAction||V.endpoint,openDialog:V.openDialog||!1,fieldActionGlobal:(V.fieldActionGlobal||V.field||[]).map(X=>{const ge=X.propsFieldGlobal||X.props||{};return{...X,props:{...ge,endpoint:ge.endpointComponent||ge.endpoint}}})}})),_.pagination!==void 0&&(D.value=_.pagination)}};o.watch(()=>a.tableConfig,()=>{fe()},{deep:!0,immediate:!0});const pe=o.computed(()=>a.dynamicColumns||a.configKey||a.tableConfig?y.value:a.columns||[]),Le=o.computed(()=>a.hasActions||M.value.length>0),be=o.computed(()=>N.value||J.value?b.value:a.loading),U=o.computed(()=>!!N.value||!!J.value),P=o.computed(()=>[]),q=_=>P.value.some($=>$.code===_),oe=(_,$)=>{if(!_.visibilityCondition)return!0;const{field:K,operator:V,value:I}=_.visibilityCondition,X=Z($,K);switch(V){case"equals":return X===I;case"notEquals":return X!==I;case"in":return Array.isArray(I)&&I.includes(X);case"notIn":return Array.isArray(I)&&!I.includes(X);case"greaterThan":return X>I;case"lessThan":return X<I;case"contains":return String(X).includes(String(I));default:return!0}},he=o.computed(()=>S.value.length===0?S.value:S.value.filter(_=>a.ignorePermissions||!_.permission?!0:q(_.permission))),ze=o.computed(()=>M.value.length===0?M.value:M.value.filter(_=>a.ignorePermissions||!_.permission?!0:q(_.permission))),ot=_=>ze.value.filter($=>oe($,_)),At=(_,$)=>{var I,X;if(_.requiredCondition&&((I=_.propCustomCondition)==null?void 0:I.length)>0){const ge=Z($,"status"),_e=_.propCustomCondition.find(Ne=>Ne.value===ge);if(_e)return _e.bgColor||_.bgColor||"primary"}if(!_.dynamicColor||!_.colorCondition)return _.bgColor||"primary";const K=Z($,_.colorCondition.field),V=(X=_.colorCondition.conditions)==null?void 0:X.find(ge=>ge.value===K);return(V==null?void 0:V.bgColor)||_.bgColor||"primary"},$t=_=>{const $=(_||"left").toLowerCase();return $==="center"?"justify-center":$==="right"?"justify-end":"justify-start"},bn={ToggleLeft:ne.ToggleLeft,SquarePen:ne.SquarePen,Trash2:ne.Trash2,Eye:ne.Eye,CheckCircle:ne.CheckCircle,Plus:ne.Plus,Download:ne.Download,RefreshCw:ne.RefreshCw,Search:ne.Search,SlidersHorizontal:ne.SlidersHorizontal},On=_=>_?Qt[_]?Qt[_]:bn[_]||null:null,Qe=o.computed(()=>U.value?m.value.map((_,$)=>({..._,no:(u.value-1)*f.value+$+1})):Ae.value),Tt=o.computed(()=>U.value?p.value:ce.value.length),ko=o.computed(()=>Tt.value===0?0:(u.value-1)*f.value+1),R=o.computed(()=>{const _=u.value*f.value;return _>Tt.value?Tt.value:_}),Z=(_,$)=>{if(!(!_||!$))return $ in _?_[$]:$.split(".").reduce((K,V)=>K&&K[V],_)},ce=o.computed(()=>{if(U.value)return[];if(!d.value)return a.data;const _=d.value.toLowerCase();return a.data.filter($=>pe.value.some(K=>{const V=Z($,K.key);return V==null?!1:String(V).toLowerCase().includes(_)}))}),Ve=o.computed(()=>U.value?[]:h.value.key?[...ce.value].sort(($,K)=>{const V=Z($,h.value.key),I=Z(K,h.value.key);if(V===I)return 0;let X=0;return typeof V=="number"&&typeof I=="number"?X=V-I:X=String(V).localeCompare(String(I)),h.value.direction==="asc"?X:-X}):ce.value),Ae=o.computed(()=>{if(U.value)return[];const _=(u.value-1)*f.value,$=_+f.value;return Ve.value.slice(_,$).map((K,V)=>({...K,no:_+V+1}))}),G=o.computed(()=>U.value?Object.values(g.value).some(_=>!!_):!!d.value),ee=[10,25,50,100],ae=()=>{U.value&&(g.value={...g.value,keyword:d.value},u.value=1,qe())};let me;const $e=()=>{a.enableQuickSearch&&(clearTimeout(me),me=setTimeout(()=>{ae()},500))};let lt;const Bd=()=>{clearTimeout(lt),lt=setTimeout(()=>{U.value&&qe()},1e3)};o.watch(d,()=>{a.enableQuickSearch&&U.value&&$e()});const qe=async()=>{if(U.value&&!(!N.value&&!J.value))try{b.value=!0;const _={page:u.value,perPage:f.value,...g.value,...a.apiParams};d.value&&(_.keyword=d.value),Object.keys(_).forEach(K=>{(_[K]===""||_[K]===null||_[K]===void 0)&&delete _[K]});let $;N.value?$=await s(N.value,H.value,_):J.value&&($=await s(J.value,j.value,_)),Sd($)}catch(_){console.error("DataTable fetch error",_),b.value=!1}},Sd=_=>{console.log("DataTable handleResponseData:",_),_&&(a.dynamicColumns&&_.columns&&Array.isArray(_.columns)&&(y.value=_.columns.map($=>({key:$.key||$.field||$.name,label:$.label||$.header||$.name,width:$.width,align:$.align||"LEFT",sortable:$.sortable!==!1,type:$.type,condition:$.condition,format:$.format}))),_.data&&Array.isArray(_.data)?(m.value=_.data,_.totalData?p.value=_.totalData:_.maxPage?p.value=_.maxPage*f.value:p.value=_.data.length*(_.maxPage||1)):Array.isArray(_)?(m.value=_,p.value=_.length):_.users?(m.value=_.users,p.value=_.users.length):_.items&&Array.isArray(_.items)?(m.value=_.items,p.value=_.total||_.totalItems||_.items.length):_.list&&Array.isArray(_.list)?(m.value=_.list,p.value=_.total||_.list.length):_.rows&&Array.isArray(_.rows)?(m.value=_.rows,p.value=_.count||_.total||_.rows.length):_.result&&Array.isArray(_.result)?(m.value=_.result,p.value=_.total||_.count||_.result.length):(console.warn("DataTable: Unknown response format",_),m.value=[],p.value=0)),b.value=!1};o.onUnmounted(()=>{clearTimeout(me),clearTimeout(lt)});const Sa=()=>{Object.keys(g.value).forEach(_=>{g.value[_]=""}),d.value="",u.value=1,qe()},Ed=()=>{u.value=1,qe()},Ea=(_,$)=>{const K=Z(_,$.key);let V={variant:"secondary",class:"",label:K};if($.condition){const I=$.condition.find(X=>{const ge=(_e,Ne)=>typeof _e=="string"&&typeof Ne=="string"?_e.toLowerCase().trim()===Ne.toLowerCase().trim():_e==Ne;return typeof K=="object"&&K!==null?ge(X.value,K.code)||ge(X.value,K.id):ge(X.value,K)});if(I){if(I.variant&&(V.variant=I.variant),V.label=I.label||(typeof K=="object"?K.name||K.code:K),I.color){const X=I.color.toLowerCase(),ge=V.variant==="outline",_e={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"},Ne={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"},Ue={danger:"destructive",secondary:"secondary",primary:"default"};ge?Ne[X]&&(V.class=Ne[X]):Ue[X]?V.variant=Ue[X]:_e[X]&&(V.class=_e[X])}}else V.label=typeof K=="object"?(K==null?void 0:K.name)||(K==null?void 0:K.code)||"-":K}else V.label=typeof K=="object"?(K==null?void 0:K.name)||(K==null?void 0:K.code)||"-":K;return V},Dd=_=>{h.value.key===_?h.value.direction=h.value.direction==="asc"?"desc":"asc":(h.value.key=_,h.value.direction="asc"),r("update:sort",h.value)},as=_=>{_!==u.value&&(u.value=_,U.value&&qe(),r("update:page",_))},Vd=_=>{f.value=_,u.value=1,U.value&&qe()},Md=_=>{const $=Math.random()*15+75;if(_.width){const K=parseInt(String(_.width));return K<100?`${Math.floor(K*(Math.random()*.2+.7))}px`:`${$}%`}return`${$}%`},rs=()=>{d.value="",g.value={},u.value=1,qe()},Nd=_=>{var $;if(_.route){if(_.path){const K=_.route.startsWith("/")?_.route:"/"+_.route;sessionStorage.setItem(`layout_${K}`,_.path)}l.push(_.route)}else if(_.openDialog){A.value=_,T.value=null,w.value={};const K=_.fieldActionGlobal||_.field||[];K.length&&K.forEach(V=>{var ge;const I=_.endpoint||((ge=_.propsActionGlobal)==null?void 0:ge.endpointPropAction)||_.propsActionGlobal,X=I!=null&&I.keyParam&&I.keyParam.length>0?I.keyParam[0]:null;X&&V.model===X||!X&&/^(id|ids|idAuditTrail)/i.test(V.model)?w.value[V.model]=F.value:w.value[V.model]||(w.value[V.model]="")}),x.value=!0}else r("action",{action:(($=_.propsActionCustom)==null?void 0:$.key)||_.key||"create",row:null,selection:F.value})},Pd=(_,$)=>{if(_.requireConfirm){E.value={button:_,row:$},C.value=!0;return}if(_.openDialog){A.value=_,T.value=$,w.value={};const K=pe.value.find(I=>I.type==="CHECKBOX"),V=(K==null?void 0:K.keyCheckbox)||"id";_.fieldActionCustom&&_.fieldActionCustom.forEach(I=>{/^(id|ids|idAuditTrail)/i.test(I.model)?w.value[I.model]=[$[V]]:w.value[I.model]=""}),x.value=!0;return}Da(_,$)},Da=(_,$)=>{if(_.route){if(_.path){const I=_.route.startsWith("/")?_.route:"/"+_.route;sessionStorage.setItem(`layout_${I}`,_.path)}let K=_.route;K.includes(":")?K=K.replaceAll(/:([a-zA-Z0-9_]+)/g,(I,X)=>$[X]||$.id||X):$.id&&(K=`${K.replace(/\/$/,"")}/${$.id}`);const V={};_.path&&(V.code=_.path),l.push({path:K,query:V})}else if(_.endpoint&&_.endpoint.apiUrl){b.value=!0;const{apiUrl:K}=at(),V=_.endpoint.apiUrl,I=_.endpoint.apiMethod||"POST",X={};_.endpoint.keyParam&&Array.isArray(_.endpoint.keyParam)&&_.endpoint.keyParam.forEach((ge,_e)=>{const Ne=_.endpoint.model&&_e===0?_.endpoint.model:ge;$[ge]!==void 0&&(X[Ne]=$[ge])}),Object.keys(X).length===0&&$.id&&(X.id=$.id),K(V,I,X).then(()=>{qe(),r("action",{action:_.action||"success",row:$})}).catch(ge=>{console.error("Action Failed",ge)}).finally(()=>{b.value=!1})}else r("action",{action:_.action,row:$})},KB=()=>{E.value&&(Da(E.value.button,E.value.row),Ad())},XB=()=>{var _,$;if(A.value){const K=A.value,V=K.endpoint||((_=K.propsActionGlobal)==null?void 0:_.endpointPropAction)||K.propsActionGlobal;let I=(V==null?void 0:V.model)||(V!=null&&V.keyParam&&V.keyParam.length>0?V.keyParam[0]:null);if(!I){const Ne=(K.fieldActionGlobal||K.fieldActionCustom||K.field||[]).find(Ue=>/^(id|ids|idAuditTrail)/i.test(Ue.model));I=Ne?Ne.model:"ids"}let X=null,ge=!1;if(T.value){const _e=pe.value.find(Ze=>Ze.type==="CHECKBOX"),Ne=(_e==null?void 0:_e.keyCheckbox)||"id",Ue=T.value[Ne];V!=null&&V.apiUrl&&(X={...w.value},X[I]||(X[I]=[Ue]),ge=!0)}else V!=null&&V.apiUrl&&(X={...w.value},X[I]||(X[I]=F.value||[]),ge=!0);if(ge&&X&&(V!=null&&V.apiUrl)){const{apiUrl:_e}=at(),Ne=V.apiUrl,Ue=V.apiMethod||"POST";_e(Ne,Ue,X).then(()=>{x.value=!1,T.value||(F.value=[]),qe(),r("action",{action:"success",row:null})}).catch(Ze=>{console.error("Action Failed",Ze)})}else if(T.value){const _e=pe.value.find(Ma=>Ma.type==="CHECKBOX"),Ne=(_e==null?void 0:_e.keyCheckbox)||"id",Ue=T.value[Ne],Ze={...w.value};Ze[I]||(Ze[I]=[Ue]),r("action",{action:A.value.action,row:Ze}),x.value=!1}else{const _e={...w.value};_e[I]||(_e[I]=F.value);const Ne={action:(($=A.value.propsActionGlobal)==null?void 0:$.key)||A.value.key,row:_e,selection:F.value};r("action",Ne),x.value=!1}}},Ad=()=>{C.value=!1,E.value=null},JB=o.computed(()=>E.value?E.value.button.confirmTitle||"Confirm":""),QB=o.computed(()=>E.value?E.value.button.confirmMessage||"Confirm":"");e({fetchData:qe,filters:g,resetFilters:Sa,handleRefresh:rs});const Va=o.ref(""),ZB=_=>{if(!_)return"";const $=_.endpoint||_.endpointGlobal||{};return JSON.stringify({url:$.apiUrl||_.apiUrl,module:$.apiModule||_.apiModule,action:$.apiAction||_.apiAction,method:$.apiMethod||_.apiMethod,params:_.apiParams,socket:$.socket||_.socketEndpoint,socketParams:_.socketParams})};return o.watch(()=>a.tableConfig,()=>{if(a.tableConfig){fe();const _=ZB(a.tableConfig);_!==Va.value&&(!Va.value&&(U.value||isSocketMode.value)?(Va.value=_,qe()):(Va.value=_,(U.value||isSocketMode.value)&&Bd()))}},{deep:!0,immediate:!0}),o.watch(()=>a.apiModule,()=>{U.value&&qe()}),o.watch(()=>a.apiParams,()=>{U.value&&qe()},{deep:!0}),o.onMounted(()=>{fe(),U.value&&(a.tableConfig||(b.value=!0,qe()))}),(_,$)=>{var K;return o.openBlock(),o.createElementBlock("div",tB,[o.createElementVNode("div",nB,[o.createElementVNode("div",oB,[t.nested?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",aB,[o.createElementVNode("div",rB,[o.createVNode(o.unref(ne.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),o.createVNode(o.unref(pn),{modelValue:d.value,"onUpdate:modelValue":$[0]||($[0]=V=>d.value=V),placeholder:"Search...",class:"pl-9 h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:o.withKeys(ae,["enter"])},null,8,["modelValue"])]),k.value.length>0?(o.openBlock(),o.createElementBlock("div",sB,[o.createVNode(zC,null,{trigger:o.withCtx(()=>[o.createVNode(ht,{variant:"secondary",icon:o.unref(ne.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"},null,8,["icon"])]),footer:o.withCtx(()=>[o.createElementVNode("div",uB,[o.renderSlot(_.$slots,"filter-footer",{fetch:qe,reset:Sa})])]),default:o.withCtx(()=>[o.createElementVNode("div",iB,[o.renderSlot(_.$slots,"filter-form",{filters:g.value},()=>[k.value.length>0?(o.openBlock(),o.createElementBlock("div",lB,[o.createElementVNode("div",cB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(te.value,(V,I)=>(o.openBlock(),o.createElementBlock("div",{key:I,class:o.normalizeClass(ue(V.column))},[o.createVNode(wd,{field:V,modelValue:g.value[V.model],"onUpdate:modelValue":X=>g.value[V.model]=X},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):o.createCommentVNode("",!0)]),k.value.length>0?(o.openBlock(),o.createElementBlock("div",dB,[o.createVNode(o.unref(Ce),{variant:"outline",onClick:Sa,disabled:be.value,class:"flex-1 w-full"},{default:o.withCtx(()=>[...$[8]||($[8]=[o.createTextVNode(" Reset ",-1)])]),_:1},8,["disabled"]),o.createVNode(o.unref(Ce),{onClick:Ed,disabled:be.value,class:"flex-1 w-full"},{default:o.withCtx(()=>[...$[9]||($[9]=[o.createTextVNode(" Search ",-1)])]),_:1},8,["disabled"])])):o.createCommentVNode("",!0)])]),_:3})])):o.createCommentVNode("",!0)])),o.createElementVNode("div",{class:o.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(o.openBlock(),o.createElementBlock("span",fB)):o.createCommentVNode("",!0),t.nested?o.createCommentVNode("",!0):(o.openBlock(),o.createBlock(ht,{key:1,variant:"secondary",icon:o.unref(ne.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:rs,disabled:be.value},{icon:o.withCtx(()=>[o.createVNode(o.unref(ne.RefreshCw),{class:o.normalizeClass(["w-3.5 h-3.5",{"animate-spin":be.value}])},null,8,["class"])]),_:1},8,["icon","disabled"])),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(he.value,(V,I)=>(o.openBlock(),o.createBlock(ht,{key:I,icon:On(V.icon),text:V.label,tooltip:V.tooltip,variant:V.variant,"bg-color":V.bgColor,"text-color":V.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:X=>Nd(V)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),o.renderSlot(_.$slots,"header-actions")],2)])]),o.createElementVNode("div",hB,[o.createElementVNode("table",mB,[o.createElementVNode("thead",pB,[o.createElementVNode("tr",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(pe.value,V=>(o.openBlock(),o.createElementBlock("th",{key:V.key,class:o.normalizeClass([V.align?`text-${V.align.toLowerCase()}`:"",V.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:o.normalizeStyle(V.width?{width:V.width}:{}),onClick:I=>V.sortable&&Dd(V.key)},[V.type==="CHECKBOX"?(o.openBlock(),o.createElementBlock("div",bB,[o.createVNode(mo,{"model-value":L.value,indeterminate:Y.value,"onUpdate:modelValue":$[1]||($[1]=I=>v(!!I)),onClick:$[2]||($[2]=o.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-2 w-full",$t(V.align)])},[o.createElementVNode("span",null,o.toDisplayString(V.label),1)],2))],14,gB))),128)),Le.value?(o.openBlock(),o.createElementBlock("th",yB,[...$[10]||($[10]=[o.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):o.createCommentVNode("",!0)])]),o.createElementVNode("tbody",xB,[be.value?(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:0},o.renderList(f.value,V=>(o.openBlock(),o.createElementBlock("tr",{key:`skeleton-${V}`},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(pe.value,I=>{var X,ge;return o.openBlock(),o.createElementBlock("td",{key:I.key,class:o.normalizeClass([I.align?`text-${I.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[o.createElementVNode("div",{class:o.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(I.type??"")||I.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((X=I.align)==null?void 0:X.toLowerCase())==="center"?"mx-auto":"",((ge=I.align)==null?void 0:ge.toLowerCase())==="right"?"ml-auto":""]]),style:o.normalizeStyle({width:["badge","BADGE"].includes(I.type??"")||I.condition?void 0:Md(I),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(o.openBlock(),o.createElementBlock("td",kB,[...$[11]||($[11]=[o.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[o.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),o.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),o.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):o.createCommentVNode("",!0)]))),128)):Qe.value.length===0?(o.openBlock(),o.createElementBlock("tr",wB,[o.createElementVNode("td",{colspan:pe.value.length+(Le.value?1:0),class:"text-center py-16"},[o.createElementVNode("div",CB,[o.createElementVNode("div",null,[o.createElementVNode("p",BB,o.toDisplayString(G.value?"No search results":"No data"),1),o.createElementVNode("p",SB,o.toDisplayString(G.value?"Try changing keywords":"No data added"),1)])])],8,_B)])):(o.openBlock(!0),o.createElementBlock(o.Fragment,{key:2},o.renderList(Qe.value,(V,I)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:I},[o.createElementVNode("tr",EB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(pe.value,X=>(o.openBlock(),o.createElementBlock("td",{key:X.key,class:o.normalizeClass([X.align?`text-${X.align}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[o.renderSlot(_.$slots,`cell-${X.key}`,{row:V,value:Z(V,X.key)},()=>[X.type==="CHECKBOX"?(o.openBlock(),o.createElementBlock("div",DB,[o.createVNode(mo,{"model-value":z(V),"onUpdate:modelValue":ge=>W(V,!!ge),onClick:$[3]||($[3]=o.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):X.type==="badge"||X.type==="BADGE"||X.condition?(o.openBlock(),o.createElementBlock("div",{key:1,class:o.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[X.align?`justify-${X.align}`:"justify-start"]])},[o.createVNode(o.unref(Xt),{variant:Ea(V,X).variant,class:o.normalizeClass([Ea(V,X).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(Ea(V,X).label),1)]),_:2},1032,["variant","class"])],2)):X.key==="no"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:2},[o.createTextVNode(o.toDisplayString((u.value-1)*f.value+I+1),1)],64)):X.type==="date"||X.type==="DATE"?(o.openBlock(),o.createElementBlock(o.Fragment,{key:3},[o.createTextVNode(o.toDisplayString(Z(V,X.key)?o.unref(EC)(Z(V,X.key),"long"):"-"),1)],64)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:4},[o.createTextVNode(o.toDisplayString(X.format?X.format(Z(V,X.key)):Z(V,X.key)),1)],64))])],2))),128)),Le.value?(o.openBlock(),o.createElementBlock("td",VB,[o.renderSlot(_.$slots,"actions",{row:V,buttons:ot(V),getButtonColor:At,getIconComponent:On},()=>[ot(V).length>0?(o.openBlock(),o.createElementBlock("div",MB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(ot(V),(X,ge)=>(o.openBlock(),o.createElementBlock("div",{key:ge,class:"group relative"},[o.createVNode(ht,{tooltip:X.tooltip||X.label,icon:On(X.icon),size:"icon",variant:X.variant||"ghost","bg-color":At(X,V),onClick:_e=>Pd(X,V)},null,8,["tooltip","icon","variant","bg-color","onClick"])]))),128))])):o.createCommentVNode("",!0)])])):o.createCommentVNode("",!0)]),_.$slots["expanded-row"]?(o.openBlock(),o.createElementBlock("tr",NB,[o.createElementVNode("td",{colspan:pe.value.length+(Le.value?1:0),class:"px-0 py-0"},[o.renderSlot(_.$slots,"expanded-row",{row:V,index:I})],8,PB)])):o.createCommentVNode("",!0)],64))),128))])])]),!be.value&&Qe.value.length>0&&t.showPagination&&D.value?(o.openBlock(),o.createElementBlock("div",AB,[o.createElementVNode("div",$B,[o.createVNode(o.unref(YC),{"model-value":String(f.value),"onUpdate:modelValue":$[4]||($[4]=V=>Vd(Number(V)))},{default:o.withCtx(()=>[o.createVNode(o.unref(ZC),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:o.withCtx(()=>[o.createVNode(o.unref(eB),{placeholder:String(f.value)},null,8,["placeholder"])]),_:1}),o.createVNode(o.unref(GC),null,{default:o.withCtx(()=>[(o.openBlock(),o.createElementBlock(o.Fragment,null,o.renderList(ee,V=>o.createVNode(o.unref(XC),{key:V,value:String(V)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(V),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),$[16]||($[16]=o.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),o.createElementVNode("span",TB,[$[12]||($[12]=o.createTextVNode(" Showing ",-1)),o.createElementVNode("span",OB,o.toDisplayString(ko.value),1),$[13]||($[13]=o.createTextVNode(" to ",-1)),o.createElementVNode("span",zB,o.toDisplayString(R.value),1),$[14]||($[14]=o.createTextVNode(" of ",-1)),o.createElementVNode("span",FB,o.toDisplayString(Tt.value),1),$[15]||($[15]=o.createTextVNode(" items ",-1))])]),o.createElementVNode("div",RB,[o.createVNode(o.unref(vC),{total:Tt.value,"items-per-page":f.value,"sibling-count":1,"show-edges":"",page:u.value,"onUpdate:page":as,class:"scale-90 origin-right"},{default:o.withCtx(()=>[o.createVNode(o.unref(LC),{class:"flex items-center gap-1"},{default:o.withCtx(({items:V})=>[o.createVNode(o.unref(jC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(UC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(V,(I,X)=>(o.openBlock(),o.createElementBlock(o.Fragment,null,[I.type==="page"?(o.openBlock(),o.createBlock(o.unref(WC),{key:X,value:I.value,"as-child":""},{default:o.withCtx(()=>[o.createVNode(o.unref(Ce),{class:"w-8 h-8 p-0 text-sm",variant:I.value===u.value?"default":"outline",disabled:I.value===u.value,onClick:ge=>as(I.value)},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(I.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(o.openBlock(),o.createBlock(o.unref(IC),{key:I.type,index:X},null,8,["index"]))],64))),256)),o.createVNode(o.unref(qC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronRight),{class:"h-4 w-4"})]),_:1}),o.createVNode(o.unref(HC),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:o.withCtx(()=>[o.createVNode(o.unref(ne.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):o.createCommentVNode("",!0),o.createVNode(ka,{modelValue:C.value,"onUpdate:modelValue":$[5]||($[5]=V=>C.value=V),title:JB.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:o.withCtx(()=>[o.createVNode(o.unref(Ce),{variant:"outline",onClick:Ad},{default:o.withCtx(()=>[...$[17]||($[17]=[o.createTextVNode(" Cancel ",-1)])]),_:1}),o.createVNode(o.unref(Ce),{onClick:KB},{default:o.withCtx(()=>[...$[18]||($[18]=[o.createTextVNode(" Yes ",-1)])]),_:1})]),default:o.withCtx(()=>[o.createElementVNode("div",vB,[o.createElementVNode("p",LB,o.toDisplayString(QB.value),1)])]),_:1},8,["modelValue","title"]),o.createVNode(ka,{modelValue:x.value,"onUpdate:modelValue":$[7]||($[7]=V=>x.value=V),title:((K=A.value)==null?void 0:K.label)||"Action",icon:"AlertCircle","max-width":450},{actions:o.withCtx(()=>[o.createVNode(o.unref(Ce),{variant:"outline",onClick:$[6]||($[6]=V=>x.value=!1)},{default:o.withCtx(()=>[...$[19]||($[19]=[o.createTextVNode(" Cancel ",-1)])]),_:1}),o.createVNode(o.unref(Ce),{onClick:XB},{default:o.withCtx(()=>[...$[20]||($[20]=[o.createTextVNode(" Save ",-1)])]),_:1})]),default:o.withCtx(()=>{var V,I;return[o.createElementVNode("div",IB,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(((V=A.value)==null?void 0:V.fieldActionCustom)||((I=A.value)==null?void 0:I.fieldActionGlobal)||[],(X,ge)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:ge},[X.isHidden?o.createCommentVNode("",!0):(o.openBlock(),o.createElementBlock("div",{key:0,class:o.normalizeClass(ue(X.column))},[o.createVNode(wd,{field:X,modelValue:w.value[X.model],"onUpdate:modelValue":_e=>w.value[X.model]=_e},null,8,["field","modelValue","onUpdate:modelValue"])],2))],64))),128))])]}),_:1},8,["modelValue","title"])])}}}),WB={class:"h-full flex flex-col"},HB={key:1,class:"flex-1 flex items-center justify-center"},qB={key:2,class:"flex-1 flex items-center justify-center text-red-500"},UB=o.defineComponent({__name:"AutoLayoutDatatable",props:{layoutCode:{}},setup(t){const e=t,n=zn.useRoute(),{apiUrl:a}=at(),{onReady:r,handleAction:s}=kd(e.layoutCode),i=o.ref(null),l=o.ref(!0),c=o.ref(null),d=async()=>{l.value=!0;try{const f=await a(`/api/auto-layout/datatable/form-dinamic?code=${e.layoutCode}`,"GET");f.status&&(i.value=Array.isArray(f.data)?f.data[0]:f.data)}catch(f){console.error("Gagal Menampilkan Datatable:",f)}finally{l.value=!1,r({config:i.value,datatable:c})}},u=f=>{s(f.action,f.row)||console.log("Aksi tidak terdaftar:",f.action)};return o.onMounted(()=>{d()}),(f,h)=>(o.openBlock(),o.createElementBlock("div",WB,[!l.value&&i.value?(o.openBlock(),o.createBlock(jB,{key:0,ref_key:"dtRef",ref:c,"api-url":`/api/auto-layout/datatable/form-dinamic?code=${e.layoutCode}`,"api-method":"GET","table-config":i.value,"permission-base":o.unref(n).path,onAction:u},{"header-actions":o.withCtx(()=>[...h[0]||(h[0]=[])]),_:1},8,["api-url","table-config","permission-base"])):l.value?(o.openBlock(),o.createElementBlock("div",HB,[...h[1]||(h[1]=[o.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(o.openBlock(),o.createElementBlock("div",qB," Failed to load configuration for "+o.toDisplayString(e.layoutCode),1))]))}}),_d=o.defineCustomElement(SC),Cd=o.defineCustomElement(UB);customElements.define("micro-dynamic-form",_d),customElements.define("micro-dynamic-datatable",Cd);const YB=[qa,Ns,ht,Za,yc,mo,xc,Ir,Kr,ka,od,_a,rd,Xr,sd,Jr,Zr,Qr,es,id,ts,ld,cd,dd,ud,fd,ns,os,Ca,gd,bd,yd],GB={install(t,e={}){e&&Object.keys(e).length>0&&Id(e),YB.forEach(n=>{n.name&&t.component(n.name,n)})}};le.DCodeAutoComplete=qa,le.DCodeButton=ht,le.DCodeCard=Za,le.DCodeChart=yc,le.DCodeCheckbox=mo,le.DCodeCurrencyField=xc,le.DCodeDatePicker=Ir,le.DCodeDateRangePicker=Kr,le.DCodeDialog=ka,le.DCodeDialogCloseBtn=od,le.DCodeDropzone=_a,le.DCodeFileField=rd,le.DCodeFileResult=Xr,le.DCodeIconDropdown=sd,le.DCodeImageCropperDialog=Jr,le.DCodeImageField=Zr,le.DCodeImageResult=Qr,le.DCodeInfiniteAutoComplete=Ns,le.DCodeLabel=es,le.DCodeMultiSelect=id,le.DCodeOtpInput=ts,le.DCodeProgress=ld,le.DCodeProgressBar=cd,le.DCodeRadio=dd,le.DCodeRadioCustom=ud,le.DCodeSlider=fd,le.DCodeSwitch=ns,le.DCodeTextField=os,le.DCodeTextarea=Ca,le.DCodeTimelineWithIcons=gd,le.DCodeUploadFile=bd,le.DCodeWizard=yd,le.MicroDynamicDatatable=Cd,le.MicroDynamicForm=_d,le.cn=de,le.default=GB,le.getLogicModule=xd,le.registerLogic=pC,le.unregisterLogic=gC,Object.defineProperties(le,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));