@gemafajarramadhan/dynamic-ui 1.2.55 → 1.2.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dynamic-ui.css +1 -1
- package/dist/dynamic-ui.es.js +8983 -8641
- package/dist/dynamic-ui.umd.js +15 -15
- package/dist/index.d.ts +12 -0
- package/package.json +1 -1
- package/src/index.d.ts +12 -0
package/dist/dynamic-ui.umd.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(pe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(pe=typeof globalThis<"u"?globalThis:pe||self,e(pe.DynamicUI={},pe.Vue,pe.LucideIcons,pe.rekaUi,pe.core,pe.VueI18n,pe.VueDatePicker,pe.Uppy,pe.UppyDashboard,pe.UppyImageEditor,pe.VueRouter,pe.Vue3Lottie))})(this,(function(pe,e,ce,Se,lt,$t,yu,xu,mi,ku,In,wu){"use strict";var XA=Object.defineProperty;var KA=(pe,e,ce)=>e in pe?XA(pe,e,{enumerable:!0,configurable:!0,writable:!0,value:ce}):pe[e]=ce;var we=(pe,e,ce)=>KA(pe,typeof e!="symbol"?e+"":e,ce);var wa;function Cu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const Gt=Cu(ce);let Xt={};function pi(t){Xt={...Xt,...t}}function Eu(){return Xt}function Bu(){return Xt.apiBaseUrl?Xt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function _u(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(Xt.getAuthToken?n=Xt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),Xt.getHeaders){const o=Xt.getHeaders();return{...t,...o}}return t}function Su(){Xt.onUnauthorized&&Xt.onUnauthorized()}async function gi(t,n,o,r){const a=Eu();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(n||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${n}' tidak valid, fallback ke 'GET'.`);const c=Bu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{..._u(),...r||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const g=new URLSearchParams;Object.entries(o).forEach(([y,p])=>{p!=null&&g.append(y,String(p))});const k=g.toString();k&&(f=`${d}${d.includes("?")?"&":"?"}${k}`)}const h=await fetch(f,u);if(h.status===401&&Su(),!h.ok){const g=await h.text();throw new Error(`HTTP ${h.status}: ${g}`)}return(h.headers.get("content-type")||"").includes("application/json")?h.json():{status:!0,data:await h.text()}}function ft(){return{apiUrl:(o,r,a,s)=>gi(o,r,a,s),DCodeApi:(o,r,a,s)=>{let i=o,l=r,c=a;return s&&s._url?(i=s._url,l=s._method||l||"POST",s._data&&(c={...c||{},...s._data})):o&&r&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(r.toUpperCase())||(i=`${o.endsWith("/")?o.slice(0,-1):o}/${r}`,l="POST")),gi(i,l,c,s==null?void 0:s.headers)}}}const ro=Math.min,Pt=Math.max,lr=Math.round,cr=Math.floor,en=t=>({x:t,y:t}),Au={left:"right",right:"left",bottom:"top",top:"bottom"};function bi(t,n,o){return Pt(t,ro(n,o))}function Vo(t,n){return typeof t=="function"?t(n):t}function En(t){return t.split("-")[0]}function Do(t){return t.split("-")[1]}function yi(t){return t==="x"?"y":"x"}function xi(t){return t==="y"?"height":"width"}function un(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function ki(t){return yi(un(t))}function Vu(t,n,o){o===void 0&&(o=!1);const r=Do(t),a=ki(t),s=xi(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=dr(i)),[i,dr(i)]}function Du(t){const n=dr(t);return[Aa(t),n,Aa(n)]}function Aa(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const wi=["left","right"],Ci=["right","left"],Nu=["top","bottom"],Mu=["bottom","top"];function vu(t,n,o){switch(t){case"top":case"bottom":return o?n?Ci:wi:n?wi:Ci;case"left":case"right":return n?Nu:Mu;default:return[]}}function Pu(t,n,o,r){const a=Do(t);let s=vu(En(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(Aa)))),s}function dr(t){const n=En(t);return Au[n]+t.slice(n.length)}function Tu(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ou(t){return typeof t!="number"?Tu(t):{top:t,right:t,bottom:t,left:t}}function ur(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function Ei(t,n,o){let{reference:r,floating:a}=t;const s=un(n),i=ki(n),l=xi(i),c=En(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-a.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Do(n)){case"start":m[i]-=h*(o&&d?-1:1);break;case"end":m[i]+=h*(o&&d?-1:1);break}return m}async function Fu(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Vo(n,t),g=Ou(m),y=l[h?f==="floating"?"reference":"floating":f],p=ur(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(y)))==null||o?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),E=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),B=await(s.isElement==null?void 0:s.isElement(_))?await(s.getScale==null?void 0:s.getScale(_))||{x:1,y:1}:{x:1,y:1},S=ur(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:_,strategy:c}):E);return{top:(p.top-S.top+g.top)/B.y,bottom:(S.bottom-p.bottom+g.bottom)/B.y,left:(p.left-S.left+g.left)/B.x,right:(S.right-p.right+g.right)/B.x}}const zu=50,Iu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:Fu},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:f}=Ei(d,r,c),h=r,m=0;const g={};for(let k=0;k<s.length;k++){const y=s[k];if(!y)continue;const{name:p,fn:E}=y,{x:_,y:B,data:S,reset:w}=await E({x:u,y:f,initialPlacement:r,placement:h,strategy:a,middlewareData:g,rects:d,platform:l,elements:{reference:t,floating:n}});u=_??u,f=B??f,g[p]={...g[p],...S},w&&m<zu&&(m++,typeof w=="object"&&(w.placement&&(h=w.placement),w.rects&&(d=w.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):w.rects),{x:u,y:f}=Ei(d,h,c)),k=-1)}return{x:u,y:f,placement:h,strategy:a,middlewareData:g}},Ru=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:k=!0,...y}=Vo(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const p=En(a),E=un(l),_=En(l)===l,B=await(c.isRTL==null?void 0:c.isRTL(d.floating)),S=h||(_||!k?[dr(l)]:Du(l)),w=g!=="none";!h&&w&&S.push(...Pu(l,k,g,B));const x=[l,...S],b=await c.detectOverflow(n,y),A=[];let V=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&A.push(b[p]),f){const v=Vu(a,i,B);A.push(b[v[0]],b[v[1]])}if(V=[...V,{placement:a,overflows:A}],!A.every(v=>v<=0)){var D,N;const v=(((D=s.flip)==null?void 0:D.index)||0)+1,Q=x[v];if(Q&&(!(f==="alignment"?E!==un(Q):!1)||V.every(Y=>un(Y.placement)===E?Y.overflows[0]>0:!0)))return{data:{index:v,overflows:V},reset:{placement:Q}};let j=(N=V.filter(G=>G.overflows[0]<=0).sort((G,Y)=>G.overflows[1]-Y.overflows[1])[0])==null?void 0:N.placement;if(!j)switch(m){case"bestFit":{var P;const G=(P=V.filter(Y=>{if(w){const H=un(Y.placement);return H===E||H==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(H=>H>0).reduce((H,T)=>H+T,0)]).sort((Y,H)=>Y[1]-H[1])[0])==null?void 0:P[0];G&&(j=G);break}case"initialPlacement":j=l;break}if(a!==j)return{reset:{placement:j}}}return{}}}},Lu=new Set(["left","top"]);async function $u(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=En(o),l=Do(o),c=un(o)==="y",d=Lu.has(i)?-1:1,u=s&&c?-1:1,f=Vo(n,t);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*u,y:h*d}:{x:h*d,y:m*u}}const ju=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await $u(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Uu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:p=>{let{x:E,y:_}=p;return{x:E,y:_}}},...d}=Vo(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),h=un(En(a)),m=yi(h);let g=u[m],k=u[h];if(i){const p=m==="y"?"top":"left",E=m==="y"?"bottom":"right",_=g+f[p],B=g-f[E];g=bi(_,g,B)}if(l){const p=h==="y"?"top":"left",E=h==="y"?"bottom":"right",_=k+f[p],B=k-f[E];k=bi(_,k,B)}const y=c.fn({...n,[m]:g,[h]:k});return{...y,data:{x:y.x-o,y:y.y-r,enabled:{[m]:i,[h]:l}}}}}},Wu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=Vo(t,n),u=await i.detectOverflow(n,d),f=En(a),h=Do(a),m=un(a)==="y",{width:g,height:k}=s.floating;let y,p;f==="top"||f==="bottom"?(y=f,p=h===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(p=f,y=h==="end"?"top":"bottom");const E=k-u.top-u.bottom,_=g-u.left-u.right,B=ro(k-u[y],E),S=ro(g-u[p],_),w=!n.middlewareData.shift;let x=B,b=S;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=_),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(x=E),w&&!h){const V=Pt(u.left,0),D=Pt(u.right,0),N=Pt(u.top,0),P=Pt(u.bottom,0);m?b=g-2*(V!==0||D!==0?V+D:Pt(u.left,u.right)):x=k-2*(N!==0||P!==0?N+P:Pt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:x});const A=await i.getDimensions(l.floating);return g!==A.width||k!==A.height?{reset:{rects:!0}}:{}}}};function fr(){return typeof window<"u"}function Rn(t){return Va(t)?(t.nodeName||"").toLowerCase():"#document"}function Tt(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function tn(t){var n;return(n=(Va(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Va(t){return fr()?t instanceof Node||t instanceof Tt(t).Node:!1}function Kt(t){return fr()?t instanceof Element||t instanceof Tt(t).Element:!1}function fn(t){return fr()?t instanceof HTMLElement||t instanceof Tt(t).HTMLElement:!1}function Bi(t){return!fr()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Tt(t).ShadowRoot}function No(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Yt(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function Hu(t){return/^(table|td|th)$/.test(Rn(t))}function hr(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const qu=/transform|translate|scale|rotate|perspective|filter/,Gu=/paint|layout|strict|content/,Ln=t=>!!t&&t!=="none";let Da;function Na(t){const n=Kt(t)?Yt(t):t;return Ln(n.transform)||Ln(n.translate)||Ln(n.scale)||Ln(n.rotate)||Ln(n.perspective)||!Ma()&&(Ln(n.backdropFilter)||Ln(n.filter))||qu.test(n.willChange||"")||Gu.test(n.contain||"")}function Xu(t){let n=Bn(t);for(;fn(n)&&!ao(n);){if(Na(n))return n;if(hr(n))return null;n=Bn(n)}return null}function Ma(){return Da==null&&(Da=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Da}function ao(t){return/^(html|body|#document)$/.test(Rn(t))}function Yt(t){return Tt(t).getComputedStyle(t)}function mr(t){return Kt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Bn(t){if(Rn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Bi(t)&&t.host||tn(t);return Bi(n)?n.host:n}function _i(t){const n=Bn(t);return ao(n)?t.ownerDocument?t.ownerDocument.body:t.body:fn(n)&&No(n)?n:_i(n)}function Mo(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=_i(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=Tt(a);if(s){const l=va(i);return n.concat(i,i.visualViewport||[],No(a)?a:[],l&&o?Mo(l):[])}else return n.concat(a,Mo(a,[],o))}function va(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Si(t){const n=Yt(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=fn(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=lr(o)!==s||lr(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function Pa(t){return Kt(t)?t:t.contextElement}function so(t){const n=Pa(t);if(!fn(n))return en(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=Si(n);let i=(s?lr(o.width):o.width)/r,l=(s?lr(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Ku=en(0);function Ai(t){const n=Tt(t);return!Ma()||!n.visualViewport?Ku:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Yu(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==Tt(t)?!1:n}function $n(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=Pa(t);let i=en(1);n&&(r?Kt(r)&&(i=so(r)):i=so(t));const l=Yu(s,o,r)?Ai(s):en(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(s){const h=Tt(s),m=r&&Kt(r)?Tt(r):r;let g=h,k=va(g);for(;k&&r&&m!==g;){const y=so(k),p=k.getBoundingClientRect(),E=Yt(k),_=p.left+(k.clientLeft+parseFloat(E.paddingLeft))*y.x,B=p.top+(k.clientTop+parseFloat(E.paddingTop))*y.y;c*=y.x,d*=y.y,u*=y.x,f*=y.y,c+=_,d+=B,g=Tt(k),k=va(g)}}return ur({width:u,height:f,x:c,y:d})}function pr(t,n){const o=mr(t).scrollLeft;return n?n.left+o:$n(tn(t)).left+o}function Vi(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-pr(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Ju(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=tn(r),l=n?hr(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=en(1);const u=en(0),f=fn(r);if((f||!f&&!s)&&((Rn(r)!=="body"||No(i))&&(c=mr(r)),f)){const m=$n(r);d=so(r),u.x=m.x+r.clientLeft,u.y=m.y+r.clientTop}const h=i&&!f&&!s?Vi(i,c):en(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+h.x,y:o.y*d.y-c.scrollTop*d.y+u.y+h.y}}function Qu(t){return Array.from(t.getClientRects())}function Zu(t){const n=tn(t),o=mr(t),r=t.ownerDocument.body,a=Pt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=Pt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+pr(t);const l=-o.scrollTop;return Yt(r).direction==="rtl"&&(i+=Pt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const Di=25;function ef(t,n){const o=Tt(t),r=tn(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=Ma();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=pr(r);if(d<=0){const u=r.ownerDocument,f=u.body,h=getComputedStyle(f),m=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=Di&&(s-=g)}else d<=Di&&(s+=d);return{width:s,height:i,x:l,y:c}}function tf(t,n){const o=$n(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=fn(t)?so(t):en(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function Ni(t,n,o){let r;if(n==="viewport")r=ef(t,o);else if(n==="document")r=Zu(tn(t));else if(Kt(n))r=tf(n,o);else{const a=Ai(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return ur(r)}function Mi(t,n){const o=Bn(t);return o===n||!Kt(o)||ao(o)?!1:Yt(o).position==="fixed"||Mi(o,n)}function nf(t,n){const o=n.get(t);if(o)return o;let r=Mo(t,[],!1).filter(l=>Kt(l)&&Rn(l)!=="body"),a=null;const s=Yt(t).position==="fixed";let i=s?Bn(t):t;for(;Kt(i)&&!ao(i);){const l=Yt(i),c=Na(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||No(i)&&!c&&Mi(t,i))?r=r.filter(u=>u!==i):a=l,i=Bn(i)}return n.set(t,r),r}function of(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?hr(n)?[]:nf(n,this._c):[].concat(o),r],l=Ni(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let h=1;h<i.length;h++){const m=Ni(n,i[h],a);c=Pt(m.top,c),d=ro(m.right,d),u=ro(m.bottom,u),f=Pt(m.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function rf(t){const{width:n,height:o}=Si(t);return{width:n,height:o}}function af(t,n,o){const r=fn(n),a=tn(n),s=o==="fixed",i=$n(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=en(0);function d(){c.x=pr(a)}if(r||!r&&!s)if((Rn(n)!=="body"||No(a))&&(l=mr(n)),r){const m=$n(n,!0,s,n);c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?Vi(a,l):en(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 Ta(t){return Yt(t).position==="static"}function vi(t,n){if(!fn(t)||Yt(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return tn(t)===o&&(o=o.ownerDocument.body),o}function Pi(t,n){const o=Tt(t);if(hr(t))return o;if(!fn(t)){let a=Bn(t);for(;a&&!ao(a);){if(Kt(a)&&!Ta(a))return a;a=Bn(a)}return o}let r=vi(t,n);for(;r&&Hu(r)&&Ta(r);)r=vi(r,n);return r&&ao(r)&&Ta(r)&&!Na(r)?o:r||Xu(t)||o}const sf=async function(t){const n=this.getOffsetParent||Pi,o=this.getDimensions,r=await o(t.floating);return{reference:af(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function lf(t){return Yt(t).direction==="rtl"}const cf={convertOffsetParentRelativeRectToViewportRelativeRect:Ju,getDocumentElement:tn,getClippingRect:of,getOffsetParent:Pi,getElementRects:sf,getClientRects:Qu,getDimensions:rf,getScale:so,isElement:Kt,isRTL:lf};function Ti(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function df(t,n){let o=null,r;const a=tn(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:h,height:m}=d;if(l||n(),!h||!m)return;const g=cr(f),k=cr(a.clientWidth-(u+h)),y=cr(a.clientHeight-(f+m)),p=cr(u),_={rootMargin:-g+"px "+-k+"px "+-y+"px "+-p+"px",threshold:Pt(0,ro(1,c))||1};let B=!0;function S(w){const x=w[0].intersectionRatio;if(x!==c){if(!B)return i();x?i(!1,x):r=setTimeout(()=>{i(!1,1e-7)},1e3)}x===1&&!Ti(d,t.getBoundingClientRect())&&i(),B=!1}try{o=new IntersectionObserver(S,{..._,root:a.ownerDocument})}catch{o=new IntersectionObserver(S,_)}o.observe(t)}return i(!0),s}function Oa(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Pa(t),u=a||s?[...d?Mo(d):[],...n?Mo(n):[]]:[];u.forEach(p=>{a&&p.addEventListener("scroll",o,{passive:!0}),s&&p.addEventListener("resize",o)});const f=d&&l?df(d,o):null;let h=-1,m=null;i&&(m=new ResizeObserver(p=>{let[E]=p;E&&E.target===d&&m&&n&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var _;(_=m)==null||_.observe(n)})),o()}),d&&!c&&m.observe(d),n&&m.observe(n));let g,k=c?$n(t):null;c&&y();function y(){const p=$n(t);k&&!Ti(k,p)&&o(),k=p,g=requestAnimationFrame(y)}return o(),()=>{var p;u.forEach(E=>{a&&E.removeEventListener("scroll",o),s&&E.removeEventListener("resize",o)}),f==null||f(),(p=m)==null||p.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const Fa=ju,za=Uu,Ia=Ru,Ra=Wu,uf=(t,n,o)=>{const r=new Map,a={platform:cf,...o},s={...a.platform,_c:r};return Iu(t,n,{...a,platform:s})};function ff(t){return t!=null&&typeof t=="object"&&"$el"in t}function Oi(t){if(ff(t)){const n=t.$el;return Va(n)&&Rn(n)==="#comment"?null:n}return t}function vo(t){return typeof t=="function"?t():e.unref(t)}function Fi(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function zi(t,n){const o=Fi(t);return Math.round(n*o)/o}function La(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var x;return(x=vo(o.open))!=null?x:!0}),s=e.computed(()=>vo(o.middleware)),i=e.computed(()=>{var x;return(x=vo(o.placement))!=null?x:"bottom"}),l=e.computed(()=>{var x;return(x=vo(o.strategy))!=null?x:"absolute"}),c=e.computed(()=>{var x;return(x=vo(o.transform))!=null?x:!0}),d=e.computed(()=>Oi(t.value)),u=e.computed(()=>Oi(n.value)),f=e.ref(0),h=e.ref(0),m=e.ref(l.value),g=e.ref(i.value),k=e.shallowRef({}),y=e.ref(!1),p=e.computed(()=>{const x={position:m.value,left:"0",top:"0"};if(!u.value)return x;const b=zi(u.value,f.value),A=zi(u.value,h.value);return c.value?{...x,transform:"translate("+b+"px, "+A+"px)",...Fi(u.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:b+"px",top:A+"px"}});let E;function _(){if(d.value==null||u.value==null)return;const x=a.value;uf(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,h.value=b.y,m.value=b.strategy,g.value=b.placement,k.value=b.middlewareData,y.value=x!==!1})}function B(){typeof E=="function"&&(E(),E=void 0)}function S(){if(B(),r===void 0){_();return}if(d.value!=null&&u.value!=null){E=r(d.value,u.value,_);return}}function w(){a.value||(y.value=!1)}return e.watch([s,i,l,a],_,{flush:"sync"}),e.watch([d,u],S,{flush:"sync"}),e.watch(a,w,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(B),{x:e.shallowReadonly(f),y:e.shallowReadonly(h),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(g),middlewareData:e.shallowReadonly(k),isPositioned:e.shallowReadonly(y),floatingStyles:p,update:_}}const hf=["aria-busy"],mf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},pf=["for"],gf={key:0,class:"ml-1 text-destructive"},bf={class:"relative"},yf={key:0,class:"flex items-center text-gray-500 gap-2"},xf=["id","placeholder","disabled","readonly","value"],kf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},wf=["disabled"],Cf={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},Ef=["onMouseenter","onClick"],Bf={key:0},_f={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Sf={key:0},Af={key:1},Vf={key:2},Df={key:1,class:"mt-1 text-xs text-red-600"},gr=e.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=X=>{const fe=a[X];return fe===""||fe===!0||fe==="true"||fe===1||fe==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),f=e.computed(()=>i("required")),h=e.computed(()=>i("readonly")),m=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),g=e.computed(()=>f.value||i("aria-required")),k=e.computed(()=>o.error||o.errorMessage||a["error-message"]),y=e.computed(()=>a.placeholder??""),p=e.computed(()=>{const X=a.minChars??a["min-chars"];if(X==null||X==="")return 0;const fe=typeof X=="number"?X:Number.parseInt(String(X),10);return Number.isFinite(fe)&&fe>0?fe:0}),E=e.computed(()=>{const X=a.rules;return Array.isArray(X)?X:[]}),_=e.computed(()=>{const X=a.id||a.label;return X?`app-autocomplete-${X}-${Math.random().toString(36).slice(2,7)}`:void 0}),B=e.ref(o.modelValue),S=e.ref([]),w=e.ref(!1),x=e.ref(!1),b=e.computed(()=>a.items),A=e.computed(()=>{const X=v.value;return X.apiModule&&X.apiAction||X.apiUrl||o.fetchItems?S.value:b.value??[]}),V=e.computed(()=>!!a.loading),D=e.computed(()=>V.value||w.value),N=e.computed(()=>{const{label:X,items:fe,loading:_e,rules:$e,"item-title":Ae,"item-value":oe,itemTitle:de,itemValue:me,minChars:Ve,"min-chars":nt,clearable:Bt,required:So,"aria-required":Ca,disabled:Ao,readonly:no,visible:mt,"return-object":Ea,returnObject:oo,class:ir,"fetch-items":M,fetchItems:O,error:L,errorMessage:F,"error-message":q,...le}=a||{};return le}),P=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},v=e.computed(()=>{const X=o.endpoint||{};return{apiModule:o.apiModule||X.apiModule,apiAction:o.apiAction||X.apiAction,apiUrl:X.apiUrl,apiMethod:X.apiMethod||"GET"}}),Q=e.ref(null),j=e.ref(null),G=e.ref(null),{floatingStyles:Y}=La(j,G,{placement:"bottom-start",whileElementsMounted:Oa,middleware:[Fa(4),Ia(),za(),Ra({apply({rects:X,elements:fe,availableHeight:_e}){Object.assign(fe.floating.style,{width:`${X.reference.width}px`,maxHeight:`${_e}px`})}})]}),H=e.ref(!1),T=e.ref(""),U=e.ref(-1),te=e.ref(null),Z=e.computed(()=>!p.value||(T.value||"").trim().length>=p.value?"":`Ketik minimal ${p.value} karakter`),K=X=>{if(X==null)return"";if(typeof X=="string"||typeof X=="number")return String(X);const fe=c.value;return typeof fe=="function"?fe(X):(X==null?void 0:X[fe])??(X==null?void 0:X.name)??(X==null?void 0:X.nama)??(X==null?void 0:X.label)??(X==null?void 0:X.title)??"-"},ae=X=>{if(X==null)return null;if(typeof X=="string"||typeof X=="number")return X;const fe=d.value;return typeof fe=="function"?fe(X):(X==null?void 0:X[fe])??(X==null?void 0:X.id)??(X==null?void 0:X.value)??(X==null?void 0:X.code)??null},ue=e.computed(()=>{const X=B.value;if(X==null||X==="")return"";if(Array.isArray(X))return X.length?X.map($e=>{if(m.value&&typeof $e=="object"||typeof $e=="object")return K($e);const Ae=A.value.find(oe=>ae(oe)==$e);return Ae?K(Ae):String($e)}).join(", "):"";if(typeof X=="object")return K(X);const fe=A.value.find(_e=>ae(_e)==X);return fe?K(fe):String(X)}),ke=e.computed(()=>{const X=A.value||[],fe=(T.value||"").trim().toLowerCase(),_e=(ue.value||"").toLowerCase(),$e=!fe||fe===_e;let Ae=X;if($e||(Ae=X.filter(oe=>K(oe).toLowerCase().includes(fe))),Ae.length>0){const oe=de=>{const me=ae(de);return Array.isArray(B.value)?B.value.some(Ve=>Ve==me):B.value==me};Ae=[...Ae].sort((de,me)=>{const Ve=oe(de),nt=oe(me);return Ve&&!nt?-1:!Ve&&nt?1:0})}return Ae}),De=X=>Array.isArray(X)?X.length===0:X==null||X==="",Ce=X=>{if(te.value=null,f.value&&De(X)&&!E.value.length)return te.value="This field is required",!1;for(const fe of E.value){const _e=fe(X);if(_e===!1)return te.value="Invalid value",!1;if(typeof _e=="string")return te.value=_e,!1}return!0},ee=async()=>{if(u.value||h.value)return;H.value=!0,U.value=ke.value.length?0:-1,T.value=ue.value||"";const X=v.value,fe=X.apiModule&&X.apiAction||X.apiUrl||o.fetchItems;o.autoFetchOnOpen&&fe&&!x.value&&(await Xe(),U.value=ke.value.length?0:-1)},z=()=>{H.value=!1,U.value=-1,T.value=ue.value||""},J=X=>{const fe=m.value?X:ae(X);let _e=fe;Array.isArray(B.value)&&(_e=[fe]),B.value=_e,r("update:modelValue",_e),te.value=null,Ce(_e),T.value=K(X),z()},se=()=>{S.value=[],x.value=!1,B.value=Array.isArray(B.value)?[]:null,r("update:modelValue",B.value),T.value="",te.value=null},Be=()=>{l.value=!0,se(),z(),setTimeout(()=>{l.value=!1},0)},ve=X=>{if(u.value||h.value)return;const fe=X.target.value;T.value=fe,te.value&&(te.value=null),H.value||(H.value=!0),U.value=ke.value.length?0:-1;const _e=v.value.apiModule&&v.value.apiAction||v.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&_e&&!D.value&&!x.value&&Xe()},Ge=X=>{var _e;if(u.value||h.value)return;const fe={ArrowDown:()=>{if(X.preventDefault(),!H.value){ee();return}ke.value.length&&(U.value=Math.min(U.value+1,ke.value.length-1))},ArrowUp:()=>{!H.value||!ke.value.length||(X.preventDefault(),U.value=Math.max(U.value-1,0))},Enter:()=>{if(!H.value)return;X.preventDefault();const $e=ke.value[U.value];$e&&J($e)},Escape:()=>{X.preventDefault(),z()},Tab:()=>{z()}};(_e=fe[X.key])==null||_e.call(fe)},Xe=async()=>{const X=v.value;if(X.apiModule&&X.apiAction||X.apiUrl||o.fetchItems){w.value=!0;try{let _e;if(o.fetchItems){const $e=P()||{},Ae={page:1,perPage:100,search:(T.value||"").trim(),...$e,...o.apiParams},oe=await o.fetchItems(Ae),de=(oe==null?void 0:oe.data)??oe;_e=(de==null?void 0:de.data)??de}else{const Ae=ft().DCodeApi;if(typeof Ae!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const de={page:1,perPage:100,...P()||{},...o.apiParams};let me;X.apiUrl?me=await Ae("","",de,{_url:X.apiUrl,_method:X.apiMethod||"POST"}):me=await Ae(X.apiModule,X.apiAction,de);const Ve=(me==null?void 0:me.data)??me;_e=(Ve==null?void 0:Ve.data)??Ve}S.value=Array.isArray(_e)?_e:[],x.value=!0}catch(_e){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",_e),te.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(_e==null?void 0:_e.message)||(_e==null?void 0:_e.toString())||"Failed to load options"}`,S.value=[],x.value=!0}finally{w.value=!1}}},et=X=>{const fe=ae(X);return m.value?B.value?Array.isArray(B.value)?B.value.some(_e=>ae(_e)==fe):ae(B.value)==fe:!1:Array.isArray(B.value)?B.value.some(_e=>_e==fe):B.value==fe};e.watch(()=>[P(),v.value,o.apiParams],([X,fe,_e],[$e,Ae,oe])=>{const de=v.value;if(!(de.apiModule&&de.apiAction||de.apiUrl||o.fetchItems)){se();return}const Ve=JSON.stringify(X??null)===JSON.stringify($e??null),nt=JSON.stringify(_e??null)===JSON.stringify(oe??null);Ve&&nt||(se(),nt||Xe())},{deep:!0}),e.watch(()=>o.modelValue,(X,fe)=>{B.value=X,!l.value&&(X==null||X==="")&&fe!=null&&o.apiModule&&o.apiAction&&(S.value=[],x.value=!1),T.value=ue.value||""},{immediate:!0});const Fe=v.value;(Fe.apiModule&&Fe.apiAction||Fe.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!De(o.modelValue))&&Xe();const bt=X=>{const fe=Q.value,_e=G.value,$e=X.target;fe&&fe.contains($e)||_e&&_e.contains($e)||H.value&&z()},It=e.computed(()=>{const X=o.modelValue;return X==null?!1:typeof X=="string"?X.trim().length>0:Array.isArray(X)?X.length>0:typeof X=="object"?Object.keys(X).length>0:!0}),Mt=e.computed(()=>!!o.clearable&&It.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",bt)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",bt)}),(X,fe)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:Q,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",mf)):e.createCommentVNode("",!0),fe[6]||(fe[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:_.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),g.value?(e.openBlock(),e.createElementBlock("span",gf,"*")):e.createCommentVNode("",!0)],8,pf)):e.createCommentVNode("",!0),e.createElementVNode("div",bf,[e.createElementVNode("div",{ref_key:"reference",ref:j,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||h.value?"opacity-60 cursor-not-allowed":"",te.value||k.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||X.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",yf,[e.renderSlot(X.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(N.value,{id:_.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:y.value,disabled:u.value,readonly:h.value,value:H.value?T.value:ue.value||T.value,onFocus:fe[0]||(fe[0]=()=>{H.value||ee()}),onClick:fe[1]||(fe[1]=()=>{H.value||ee()}),onInput:ve,onKeydown:Ge,onBlur:fe[2]||(fe[2]=()=>Ce(B.value))}),null,16,xf),D.value?(e.openBlock(),e.createElementBlock("svg",kf,[...fe[7]||(fe[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):Mt.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:fe[3]||(fe[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(Be,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||h.value,onClick:fe[4]||(fe[4]=_e=>H.value?z():ee()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":H.value}])},null,8,["class"])],8,wf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:G,style:e.normalizeStyle(e.unref(Y)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",Cf,[ke.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ke.value,(_e,$e)=>(e.openBlock(),e.createElementBlock("button",{key:ae(_e)??$e,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",$e===U.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Ae=>U.value=$e,onMousedown:fe[5]||(fe[5]=e.withModifiers(()=>{},["prevent"])),onClick:Ae=>J(_e)},[e.createTextVNode(e.toDisplayString(K(_e))+" ",1),et(_e)?(e.openBlock(),e.createElementBlock("span",Bf," ✓ ")):e.createCommentVNode("",!0)],42,Ef))),128)):e.renderSlot(X.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",_f,[D.value?(e.openBlock(),e.createElementBlock("span",Sf,"Loading data…")):Z.value?(e.openBlock(),e.createElementBlock("span",Af,e.toDisplayString(Z.value),1)):(e.openBlock(),e.createElementBlock("span",Vf,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),te.value||k.value?(e.openBlock(),e.createElementBlock("p",Df,e.toDisplayString(te.value||k.value),1)):e.createCommentVNode("",!0)],64))],10,hf)),[[e.vShow,t.visible]])}}),Nf=["aria-busy"],Mf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},vf=["for"],Pf={key:0,class:"ml-1 text-destructive"},Tf={class:"relative"},Of={key:0,class:"flex items-center text-gray-500 gap-2"},Ff=["id","placeholder","disabled","value"],zf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},If=["disabled"],Rf={key:0,class:"p-3 space-y-2"},Lf=["onMouseenter","onClick"],$f={class:"flex items-center space-x-3"},jf={class:"flex-1"},Uf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Wf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Hf={key:0},qf={key:2,class:"p-3 text-center"},Gf={class:"inline-flex items-center space-x-2"},Xf={class:"text-sm text-gray-500"},Kf={key:3,class:"p-3 text-center"},Yf={class:"text-xs text-gray-400"},Jf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Qf={key:1,class:"mt-1 text-xs text-red-600"},Zf={key:2,class:"mt-1 text-xs text-gray-500"},Ii=e.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const U=o.label||o.placeholder;return U?`app-infinite-autocomplete-${U}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),h=e.ref([]),m=e.ref(!1),g=e.ref(!1),k=e.ref(-1),y=e.ref(1),p=e.ref(!0),E=e.ref(0),_=e.ref(),{floatingStyles:B}=La(c,d,{placement:"bottom-start",whileElementsMounted:Oa,middleware:[Fa(4),Ia(),za(),Ra({apply({rects:U,elements:te}){Object.assign(te.floating.style,{width:`${U.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const S=e.computed(()=>f.value?h.value.filter(U=>A(U).toLowerCase().includes(f.value.toLowerCase())):h.value),w=e.computed(()=>{if(g.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return A(o.modelValue);{const U=h.value.find(te=>V(te)===o.modelValue);return U?A(U):String(o.modelValue)}}return""}),x=()=>{g.value=!0},b=()=>{g.value=!1},A=U=>typeof o.itemTitle=="function"?o.itemTitle(U):U[o.itemTitle]||"",V=U=>typeof o.itemValue=="function"?o.itemValue(U):U[o.itemValue]||U,D=U=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(U):U[o.itemSubtitle]||"":"",N=U=>o.modelValue?o.returnObject?V(U)===V(o.modelValue):V(U)===o.modelValue:!1,P=U=>{var Z;const te=o.returnObject?U:V(U);r("update:modelValue",te),r("select",U),g.value=!1,f.value="",(Z=s.value)==null||Z.blur()},v=()=>{var U;r("update:modelValue",null),f.value="",(U=s.value)==null||U.focus()},Q=U=>{g.value=!0,r("focus",U),o.autoFetchOnOpen&&!m.value&&(o.refreshOnOpen||h.value.length===0)&&T(!0)},j=U=>{setTimeout(()=>{g.value=!1,r("blur",U)},200)},G=U=>{const te=U.target;f.value=te.value,_.value&&clearTimeout(_.value),_.value=setTimeout(()=>{r("search",f.value),y.value=1,p.value=!0,T(!0)},o.debounceMs)},Y=U=>{if(g.value)switch(U.key){case"ArrowDown":U.preventDefault(),k.value=Math.min(k.value+1,S.value.length-1);break;case"ArrowUp":U.preventDefault(),k.value=Math.max(k.value-1,0);break;case"Enter":U.preventDefault(),k.value>=0&&S.value[k.value]&&P(S.value[k.value]);break;case"Escape":g.value=!1;break}},H=U=>{if(!p.value||m.value)return;const te=U.target,{scrollTop:Z,scrollHeight:K,clientHeight:ae}=te;Z+ae>=K-o.threshold&&T()},T=async(U=!1)=>{var te,Z;if(!m.value){m.value=!0;try{let K=[];if(o.fetchItems)K=await o.fetchItems();else{const ae=ft(),ue=((te=o.endpoint)==null?void 0:te.apiModule)||o.apiModule,ke=((Z=o.endpoint)==null?void 0:Z.apiAction)||o.apiAction;if(!ue||!ke)throw new Error("API module and action are required");const De={page:U?1:y.value,pageSize:o.pageSize,search:f.value,...o.apiParams},Ce=await ae.apiUrl(`/${ue}/${ke}`,"GET",De);K=Ce.data||Ce.items||Ce||[],E.value=Ce.total||Ce.totalItems||K.length}U?(h.value=K,y.value=1):(h.value.push(...K),y.value++),p.value=K.length>=o.pageSize,p.value||r("end-of-results"),r("load-more",{items:K,page:y.value,hasMore:p.value,total:E.value})}catch(K){console.error("Error fetching items:",K),r("error",K)}finally{m.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&T()}),e.onUnmounted(()=>{_.value&&clearTimeout(_.value)}),e.watch(()=>o.modelValue,U=>{U||(f.value="")}),(U,te)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Mf)):e.createCommentVNode("",!0),te[3]||(te[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Pf,"*")):e.createCommentVNode("",!0)],8,vf)):e.createCommentVNode("",!0),e.createElementVNode("div",Tf,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",Of,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},U.$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:w.value,onFocus:Q,onBlur:j,onInput:G,onKeydown:Y}),null,16,Ff),m.value?(e.openBlock(),e.createElementBlock("svg",zf,[...te[4]||(te[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:te[0]||(te[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(v,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.disabled,onClick:te[1]||(te[1]=Z=>g.value?b():x()),"aria-label":"Toggle"},[e.createVNode(e.unref(ce.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":g.value}])},null,8,["class"])],8,If))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[g.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(B)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:H},[m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Rf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,Z=>e.createElementVNode("div",{key:Z,class:"flex items-center space-x-3"},[...te[5]||(te[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):S.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(S.value,(Z,K)=>(e.openBlock(),e.createElementBlock("button",{key:V(Z)??K,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",K===k.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ae=>k.value=K,onMousedown:te[2]||(te[2]=e.withModifiers(()=>{},["prevent"])),onClick:ae=>P(Z)},[e.renderSlot(U.$slots,"item",{item:Z,index:K},()=>[e.createElementVNode("div",$f,[e.createElementVNode("div",jf,[e.createElementVNode("div",Uf,e.toDisplayString(A(Z)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Wf,e.toDisplayString(D(Z)),1)):e.createCommentVNode("",!0)])])]),N(Z)?(e.openBlock(),e.createElementBlock("span",Hf," ✓ ")):e.createCommentVNode("",!0)],42,Lf))),128)):e.createCommentVNode("",!0),m.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",qf,[e.createElementVNode("div",Gf,[te[6]||(te[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Xf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!p.value&&h.value.length>0?(e.openBlock(),e.createElementBlock("div",Kf,[e.createElementVNode("div",Yf,e.toDisplayString(t.endOfResultsText),1)])):!m.value&&h.value.length===0?(e.openBlock(),e.createElementBlock("div",Jf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Qf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",Zf,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,Nf)),[[e.vShow,t.visible]])}});function Ri(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=Ri(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function Li(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=Ri(t))&&(r&&(r+=" "),r+=n);return r}const eh=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},th=(t,n)=>({classGroupId:t,validator:n}),$i=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),br="-",ji=[],nh="arbitrary..",oh=t=>{const n=ah(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return rh(i);const l=i.split(br),c=l[0]===""&&l.length>1?1:0;return Ui(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?eh(d,c):c:d||ji}return o[i]||ji}}},Ui=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=Ui(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(br):t.slice(n).join(br),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},rh=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?nh+r:void 0})(),ah=t=>{const{theme:n,classGroups:o}=t;return sh(o,n)},sh=(t,n)=>{const o=$i();for(const r in t){const a=t[r];$a(a,o,r,n)}return o},$a=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];ih(i,n,o,r)}},ih=(t,n,o,r)=>{if(typeof t=="string"){lh(t,n,o);return}if(typeof t=="function"){ch(t,n,o,r);return}dh(t,n,o,r)},lh=(t,n,o)=>{const r=t===""?n:Wi(n,t);r.classGroupId=o},ch=(t,n,o,r)=>{if(uh(t)){$a(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(th(o,t))},dh=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];$a(c,Wi(n,l),o,r)}},Wi=(t,n)=>{let o=t;const r=n.split(br),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=$i(),o.nextPart.set(i,l)),o=l}return o},uh=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,fh=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},ja="!",Hi=":",hh=[],qi=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),mh=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let k=0;k<u;k++){const y=a[k];if(i===0&&l===0){if(y===Hi){s.push(a.slice(c,k)),c=k+1;continue}if(y==="/"){d=k;continue}}y==="["?i++:y==="]"?i--:y==="("?l++:y===")"&&l--}const f=s.length===0?a:a.slice(c);let h=f,m=!1;f.endsWith(ja)?(h=f.slice(0,-1),m=!0):f.startsWith(ja)&&(h=f.slice(1),m=!0);const g=d&&d>c?d-c:void 0;return qi(s,m,h,g)};if(n){const a=n+Hi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):qi(hh,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},ph=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},gh=t=>({cache:fh(t.cacheSize),parseClassName:mh(t),sortModifiers:ph(t),...oh(t)}),bh=/\s+/,yh=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(bh);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:h,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:k}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let y=!!k,p=r(y?g.substring(0,k):g);if(!p){if(!y){c=u+(c.length>0?" "+c:c);continue}if(p=r(g),!p){c=u+(c.length>0?" "+c:c);continue}y=!1}const E=h.length===0?"":h.length===1?h[0]:s(h).join(":"),_=m?E+ja:E,B=_+p;if(i.indexOf(B)>-1)continue;i.push(B);const S=a(p,y);for(let w=0;w<S.length;++w){const x=S[w];i.push(_+x)}c=u+(c.length>0?" "+c:c)}return c},xh=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=Gi(o))&&(a&&(a+=" "),a+=r);return a},Gi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=Gi(t[r]))&&(o&&(o+=" "),o+=n);return o},kh=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=gh(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=yh(c,o);return a(c,u),u};return s=i,(...c)=>s(xh(...c))},wh=[],pt=t=>{const n=o=>o[t]||wh;return n.isThemeGetter=!0,n},Xi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ki=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Ch=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Eh=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Bh=/\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$/,_h=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Sh=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ah=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,_n=t=>Ch.test(t),ze=t=>!!t&&!Number.isNaN(Number(t)),Sn=t=>!!t&&Number.isInteger(Number(t)),Ua=t=>t.endsWith("%")&&ze(t.slice(0,-1)),hn=t=>Eh.test(t),Yi=()=>!0,Vh=t=>Bh.test(t)&&!_h.test(t),Wa=()=>!1,Dh=t=>Sh.test(t),Nh=t=>Ah.test(t),Mh=t=>!ye(t)&&!xe(t),vh=t=>An(t,nl,Wa),ye=t=>Xi.test(t),jn=t=>An(t,ol,Vh),Ji=t=>An(t,Lh,ze),Ph=t=>An(t,al,Yi),Th=t=>An(t,rl,Wa),Qi=t=>An(t,el,Wa),Oh=t=>An(t,tl,Nh),yr=t=>An(t,sl,Dh),xe=t=>Ki.test(t),Po=t=>Un(t,ol),Fh=t=>Un(t,rl),Zi=t=>Un(t,el),zh=t=>Un(t,nl),Ih=t=>Un(t,tl),xr=t=>Un(t,sl,!0),Rh=t=>Un(t,al,!0),An=(t,n,o)=>{const r=Xi.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},Un=(t,n,o=!1)=>{const r=Ki.exec(t);return r?r[1]?n(r[1]):o:!1},el=t=>t==="position"||t==="percentage",tl=t=>t==="image"||t==="url",nl=t=>t==="length"||t==="size"||t==="bg-size",ol=t=>t==="length",Lh=t=>t==="number",rl=t=>t==="family-name",al=t=>t==="number"||t==="weight",sl=t=>t==="shadow",$h=kh(()=>{const t=pt("color"),n=pt("font"),o=pt("text"),r=pt("font-weight"),a=pt("tracking"),s=pt("leading"),i=pt("breakpoint"),l=pt("container"),c=pt("spacing"),d=pt("radius"),u=pt("shadow"),f=pt("inset-shadow"),h=pt("text-shadow"),m=pt("drop-shadow"),g=pt("blur"),k=pt("perspective"),y=pt("aspect"),p=pt("ease"),E=pt("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],B=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...B(),xe,ye],w=()=>["auto","hidden","clip","visible","scroll"],x=()=>["auto","contain","none"],b=()=>[xe,ye,c],A=()=>[_n,"full","auto",...b()],V=()=>[Sn,"none","subgrid",xe,ye],D=()=>["auto",{span:["full",Sn,xe,ye]},Sn,xe,ye],N=()=>[Sn,"auto",xe,ye],P=()=>["auto","min","max","fr",xe,ye],v=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...b()],G=()=>[_n,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],Y=()=>[_n,"screen","full","dvw","lvw","svw","min","max","fit",...b()],H=()=>[_n,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],T=()=>[t,xe,ye],U=()=>[...B(),Zi,Qi,{position:[xe,ye]}],te=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",zh,vh,{size:[xe,ye]}],K=()=>[Ua,Po,jn],ae=()=>["","none","full",d,xe,ye],ue=()=>["",ze,Po,jn],ke=()=>["solid","dashed","dotted","double"],De=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ce=()=>[ze,Ua,Zi,Qi],ee=()=>["","none",g,xe,ye],z=()=>["none",ze,xe,ye],J=()=>["none",ze,xe,ye],se=()=>[ze,xe,ye],Be=()=>[_n,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[hn],breakpoint:[hn],color:[Yi],container:[hn],"drop-shadow":[hn],ease:["in","out","in-out"],font:[Mh],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[hn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[hn],shadow:[hn],spacing:["px",ze],text:[hn],"text-shadow":[hn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",_n,ye,xe,y]}],container:["container"],columns:[{columns:[ze,ye,xe,l]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"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:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:x()}],"overscroll-x":[{"overscroll-x":x()}],"overscroll-y":[{"overscroll-y":x()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Sn,"auto",xe,ye]}],basis:[{basis:[_n,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ze,_n,"auto","initial","none",ye]}],grow:[{grow:["",ze,xe,ye]}],shrink:[{shrink:["",ze,xe,ye]}],order:[{order:[Sn,"first","last","none",xe,ye]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...v(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...v()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":v()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...Y()]}],"min-inline-size":[{"min-inline":["auto",...Y()]}],"max-inline-size":[{"max-inline":["none",...Y()]}],"block-size":[{block:["auto",...H()]}],"min-block-size":[{"min-block":["auto",...H()]}],"max-block-size":[{"max-block":["none",...H()]}],w:[{w:[l,"screen",...G()]}],"min-w":[{"min-w":[l,"screen","none",...G()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",o,Po,jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Rh,Ph]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ua,ye]}],"font-family":[{font:[Fh,Th,n]}],"font-features":[{"font-features":[ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,xe,ye]}],"line-clamp":[{"line-clamp":[ze,"none",xe,Ji]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",xe,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:[ze,"from-font","auto",xe,jn]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[ze,"auto",xe,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,ye]}],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",xe,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:te()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Sn,xe,ye],radial:["",xe,ye],conic:[Sn,xe,ye]},Ih,Oh]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:K()}],"gradient-via-pos":[{via:K()}],"gradient-to-pos":[{to:K()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ke(),"hidden","none"]}],"divide-style":[{divide:[...ke(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...ke(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ze,xe,ye]}],"outline-w":[{outline:["",ze,Po,jn]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",u,xr,yr]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",f,xr,yr]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[ze,jn]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",h,xr,yr]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[ze,xe,ye]}],"mix-blend":[{"mix-blend":[...De(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":De()}],"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":[ze]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ce()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":Ce()}],"mask-image-t-to-pos":[{"mask-t-to":Ce()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":Ce()}],"mask-image-r-to-pos":[{"mask-r-to":Ce()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":Ce()}],"mask-image-b-to-pos":[{"mask-b-to":Ce()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":Ce()}],"mask-image-l-to-pos":[{"mask-l-to":Ce()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":Ce()}],"mask-image-x-to-pos":[{"mask-x-to":Ce()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":Ce()}],"mask-image-y-to-pos":[{"mask-y-to":Ce()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[xe,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ce()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"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":B()}],"mask-image-conic-pos":[{"mask-conic":[ze]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ce()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:te()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ye]}],filter:[{filter:["","none",xe,ye]}],blur:[{blur:ee()}],brightness:[{brightness:[ze,xe,ye]}],contrast:[{contrast:[ze,xe,ye]}],"drop-shadow":[{"drop-shadow":["","none",m,xr,yr]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",ze,xe,ye]}],"hue-rotate":[{"hue-rotate":[ze,xe,ye]}],invert:[{invert:["",ze,xe,ye]}],saturate:[{saturate:[ze,xe,ye]}],sepia:[{sepia:["",ze,xe,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ye]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[ze,xe,ye]}],"backdrop-contrast":[{"backdrop-contrast":[ze,xe,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ze,xe,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ze,xe,ye]}],"backdrop-invert":[{"backdrop-invert":["",ze,xe,ye]}],"backdrop-opacity":[{"backdrop-opacity":[ze,xe,ye]}],"backdrop-saturate":[{"backdrop-saturate":[ze,xe,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",ze,xe,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ze,"initial",xe,ye]}],ease:[{ease:["linear","initial",p,xe,ye]}],delay:[{delay:[ze,xe,ye]}],animate:[{animate:["none",E,xe,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,xe,ye]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:z()}],"rotate-x":[{"rotate-x":z()}],"rotate-y":[{"rotate-y":z()}],"rotate-z":[{"rotate-z":z()}],scale:[{scale:J()}],"scale-x":[{"scale-x":J()}],"scale-y":[{"scale-y":J()}],"scale-z":[{"scale-z":J()}],"scale-3d":["scale-3d"],skew:[{skew:se()}],"skew-x":[{"skew-x":se()}],"skew-y":[{"skew-y":se()}],transform:[{transform:[xe,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Be()}],"translate-x":[{"translate-x":Be()}],"translate-y":[{"translate-y":Be()}],"translate-z":[{"translate-z":Be()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",xe,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe,ye]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[ze,Po,jn,Ji]}],stroke:[{stroke:["none",...T()]}],"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 Re(...t){return $h(Li(t))}function il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ha={},qa={},kr={exports:{}},ll;function jh(){if(ll)return kr.exports;ll=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return kr.exports=n(),kr.exports.createColors=n,kr.exports}var cl;function Uh(){return cl||(cl=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a(jh());function a(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&n.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(h=>console.warn(d,"-",h)))}function l(d){return r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(qa)),qa}var dl;function Wh(){return dl||(dl=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Uh());function o(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:i,to:l}){n.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(Ha)),Ha}var Ga,ul;function Hh(){if(ul)return Ga;ul=1;let t=Wh();return Ga=(t.__esModule?t:{default:t}).default,Ga}var qh=Hh();const Gh=il(qh),fl=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,hl=Li,wr=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return hl(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const h=fl(u)||fl(f);return a[d][h]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,h]=u;return h===void 0||(d[f]=h),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:h,...m}=u;return Object.entries(m).every(g=>{let[k,y]=g;return Array.isArray(y)?y.includes({...s,...l}[k]):{...s,...l}[k]===y})?[...d,f,h]:d},[]);return hl(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},Jt=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(Re)(e.unref(io)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),io=wr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ml=e.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Se.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),pl=e.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Re)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),gl=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),bl=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Xh={class:"relative z-10"},Kh="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",Yh=e.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&Gt[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const Z=String(o.variant||"default").toLowerCase();return Z==="tonal"?"secondary":Z==="elevated"?"default":Z}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:Z,...K}=n;return K}),u=e.computed(()=>Re(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),h=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),m=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),g=e.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),k=e.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),y=e.computed(()=>Re("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",g.value,h.value,m.value,f.value)),p=e.computed(()=>{const K=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return K?K[0]:null}),E=e.computed(()=>{const K=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return K?K[0]:null}),_=e.computed(()=>!!p.value),B=e.computed(()=>/\bborder-/.test(u.value??"")),S=e.computed(()=>/\bhover:/.test(u.value??"")),w=e.computed(()=>{const Z=u.value??"";return i.value!=="outline"?Z:Z.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),x=e.ref(null),b=Z=>{const K=Z.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return K?{r:Number(K[1]),g:Number(K[2]),b:Number(K[3]),a:K[4]?Number(K[4]):1}:null},A=(Z,K)=>{const ae=b(Z);if(!ae)return Z;const ue=ke=>Math.max(0,Math.min(255,Math.round(ke)));return`rgba(${ue(ae.r*(1-K))}, ${ue(ae.g*(1-K))}, ${ue(ae.b*(1-K))}, ${ae.a})`},V=Z=>{if(globalThis.window===void 0)return null;const K=document.createElement("div");K.className=Z,K.style.position="absolute",K.style.visibility="hidden",K.style.pointerEvents="none",K.style.width="1px",K.style.height="1px",document.body.appendChild(K);const ae=globalThis.getComputedStyle(K).backgroundColor;return K.remove(),!ae||ae==="transparent"||ae==="rgba(0, 0, 0, 0)"?null:ae},D=[50,100,200,300,400,500,600,700,800,900,950],N=Z=>{const K=D.indexOf(Z);return K===-1?Z:D[Math.min(D.length-1,K+2)]},P=(Z,K)=>{const ae=Gh[Z];if(!ae)return null;if(typeof ae=="string")return ae;if(!K)return null;const ue=ae[K];return typeof ue=="string"?ue:null},v=(Z,K=!1)=>{if(!Z)return null;const ae=K?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,ue=Z.match(ae);return ue?{colorName:ue[1],shade:ue[2]?Number.parseInt(ue[2],10):null}:null},Q=()=>{const Z=p.value;if(!Z){x.value=null;return}const K=v(Z),ae=K==null?void 0:K.colorName,ue=(K==null?void 0:K.shade)??null,ke=(ae?P(ae,ue):null)??V(Z);if(!ke){x.value=null;return}let De;const Ce=v(E.value,!0),ee=Ce?P(Ce.colorName,Ce.shade??null):null;if(ee)De=ee;else if(ae&&ue){const z=N(ue);De=P(ae,z)??A(ke,.2)}else De=A(ke,.2);x.value={"--btn-color":ke,"--btn-color-hover":De}};e.onMounted(()=>{Q()}),e.watch([p,E],async()=>{await e.nextTick(),Q()});const j=e.computed(()=>{const Z=/\bdark:bg-/.test(u.value??"");return!_.value||i.value==="outline"||Z?"":x.value?"dcode-btn--fill dcode-btn--fill-hover":S.value?"":"hover:brightness-90"}),G=e.computed(()=>{if(!_.value||i.value!=="outline")return"";const Z=["dcode-btn--outline","dcode-btn--outline-hover"];return B.value||Z.push("border"),!x.value&&!S.value&&Z.push("hover:brightness-90"),Z.join(" ")}),Y=e.computed(()=>x.value??void 0),H={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},T={"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"}},U=e.computed(()=>{const Z=[],K=l.value,ae=String(o.borderColor||"").toLowerCase(),ue=K?H[K]:null,ke=K?T[K]:null,De=ae?H[ae]:null;return K&&(ue?De&&ae!==K?(Z.push(ue.bg,De.hoverBg),o.textColor||Z.push(ue.text,De.hoverText)):(Z.push(ue.bg,ue.hoverBg),o.textColor||Z.push(ue.text,ue.hoverText)):ke?(Z.push(ke.bg,ke.hover),o.textColor||Z.push(ke.text)):K==="transparent"?De?(Z.push("bg-transparent",De.hoverBg),o.textColor||Z.push("text-inherit",De.hoverText)):Z.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):Z.push(K)),ae?De?Z.push(De.border,De.hoverBorder):Z.push(ae):ue&&i.value!=="ghost"&&i.value!=="link"&&Z.push(ue.border,ue.hoverBorder),o.textColor&&Z.push(o.textColor),Z.join(" ")}),te=e.computed(()=>Re(Kh,g.value,k.value,w.value,j.value,G.value,U.value));return(Z,K)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(y.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(gl),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(ml),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(bl),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Jt),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:te.value,style:Y.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(pl),{side:"top","side-offset":8,class:"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:e.withCtx(()=>[e.createElementVNode("span",Xh,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(Jt),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:te.value,style:Y.value},d.value),{default:e.withCtx(()=>[e.renderSlot(Z.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),Ot=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Ye=Ot(Yh,[["__scopeId","data-v-fed1b675"]]),Jh={key:0,class:"flex items-center justify-between bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 px-4 py-3 backdrop-blur-sm"},Qh={class:"flex flex-col gap-1"},Zh={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},em={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},tm={key:0,class:"flex items-center gap-2"},nm={name:"DCodeCard"},yl=e.defineComponent({...nm,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-700";case 3:return"bg-neutral-100 dark:bg-neutral-600";case 1:default:return"bg-white dark:bg-neutral-800"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200/60 dark:border-neutral-700/50":t.border&&t.level===1},{"border-neutral-300/60 dark:border-neutral-600/50":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Jh,[e.createElementVNode("div",Qh,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",Zh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",em,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",tm,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200/60 dark:border-neutral-700/50",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),om={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},rm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},am={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},sm={class:"flex items-center justify-between"},im={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},lm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},cm={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},dm={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},um={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},fm={class:"flex items-center justify-between"},hm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},mm={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},pm={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Xa=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=$t.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,f=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=f,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",om,[e.createElementVNode("div",rm,[e.createElementVNode("div",am,[e.createElementVNode("div",sm,[e.createElementVNode("h3",im,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",lm,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",cm,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",dm,[e.createElementVNode("div",um,[e.createElementVNode("div",fm,[e.createElementVNode("h3",hm,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",mm,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",pm,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),gm=["aria-busy"],bm={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},ym={key:1,class:"flex justify-end"},xm=["for"],km={key:0,class:"ml-1 text-destructive"},wm={class:"relative w-full group"},Cm={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},Em={key:1},Bm=["id","value","placeholder"],_m={key:1,class:"absolute inset-y-0 right-4 flex items-center"},Sm={key:2,class:"absolute inset-y-0 right-4 flex items-center"},Am={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"},Vm={key:1,class:"text-xs text-destructive"},lo=e.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var z;return((z=l.valueType)==null?void 0:z.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=e.computed(()=>{const z=o.required,J=o["aria-required"];return z===""||z===!0||z==="true"||(J==="true"||J===!0)}),h=e.computed(()=>{const{label:z,class:J,id:se,required:Be,"aria-required":ve,...Ge}=o;return Ge}),m=e.computed(()=>{var J,se;const z={...h.value};return((J=l.valueType)==null?void 0:J.toLowerCase())==="number"&&(z.type="text",z.inputmode="numeric",z.pattern="[0-9]*"),((se=l.valueType)==null?void 0:se.toLowerCase())==="email"&&(z.type="email",z.inputmode="email"),r.value&&(z.type=a.value?"text":"password"),l.disabled&&(z.disabled=!0),l.maxLength&&(z.maxlength=l.maxLength),l.minLength&&(z.minlength=l.minLength),l.maxValue&&(z.max=l.maxValue),l.minValue&&(z.min=l.minValue),z}),g=e.computed(()=>{const z=l.modelValue;return z==null||String(z).length===0}),k=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!g.value:!0:!1),y=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),p=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,z=>{const J=String(z??"");J!==p.value&&(p.value=J)});const E=e.ref(!1),_=e.ref(!1),B=z=>z.split(/(\s+)/).map(J=>{if(J.trim()==="")return J;const se=J.toLowerCase();return se.charAt(0).toUpperCase()+se.slice(1)}).join(""),S=z=>{const J=z.toLowerCase(),se=J.search(new RegExp("\\p{L}","u"));return se<0?J:J.slice(0,se)+J.charAt(se).toUpperCase()+J.slice(se+1)},w=z=>{switch(l.textCase){case"uppercase":return z.toUpperCase();case"lowercase":return z.toLowerCase();case"titlecase":return B(z);case"sentencecase":return S(z);case"none":default:return z}},x=z=>{if(!z)return null;const J=Array.isArray(z)?z.join(""):z;return J?new Set(J):null},b=e.computed(()=>x(l.allowChars)),A=(z,J)=>(z.lastIndex=0,z.test(J)),V=z=>{var et;const J=(et=l.valueType)==null?void 0:et.toLowerCase();if(J==="free"||J==="email"||J==="password")return!0;const se=z===" ",Be=/\d/.test(z),ve=new RegExp("\\p{L}","u").test(z),Ge=new RegExp("\\p{N}","u").test(z),Xe=/[\/\-_.,]/.test(z);return J==="number"?Be:J==="letter"?ve||Xe||l.allowSpaces&&se:J==="letternumber"?ve||Ge||Xe||l.allowSpaces&&se:!0},D=z=>{let J="";for(const se of z){const Be=!!b.value&&b.value.has(se);l.pattern&&!Be&&!A(l.pattern,se)||!Be&&!V(se)||(J+=se)}return J},N=e.computed(()=>{const z=l.maxLength??o.maxlength??o.maxLength;let J=Number.NaN;return typeof z=="number"?J=z:typeof z=="string"&&(J=Number.parseInt(z,10)),Number.isFinite(J)&&J>0?J:-1}),P=e.computed(()=>p.value.length),v=e.computed(()=>l.showCharCount?N.value>0:!1),Q=z=>N.value>0?z.slice(0,N.value):z,j=z=>{const J=D(z),se=l.applyTextCaseToValue?w(J):J;return Q(se)};let G=null;const Y=z=>{var J;if(z==="")return null;if(((J=l.valueType)==null?void 0:J.toLowerCase())==="number"&&l.returnNumber){const se=Number(z);return Number.isFinite(se)?se:null}return z},H=z=>{p.value=z,i("update:modelValue",Y(z))},T=(z,J)=>{const se=Q(J);_.value=!0,z.value=se,H(se),queueMicrotask(()=>_.value=!1)},U=(z,J)=>{const se=z.selectionStart??z.value.length,Be=z.selectionEnd??z.value.length;if(N.value>0){const ve=z.value.length-(Be-se),Ge=N.value-ve;if(Ge<=0)return;J=J.slice(0,Ge)}z.setRangeText(J,se,Be,"end"),T(z,j(z.value))},te=z=>{var Be;if(!G||E.value||_.value||!((Be=z.inputType)!=null&&Be.startsWith("insert")))return;const J=z.data;if(J==null)return;const se=j(J);se!==J&&(z.preventDefault(),se.length>0&&U(G,se))},Z=z=>{var Be;if(!G||E.value||_.value)return;const J=((Be=z.clipboardData)==null?void 0:Be.getData("text"))??"",se=j(J);se!==J&&(z.preventDefault(),se.length>0&&U(G,se))},K=z=>{if(!G||E.value||_.value)return;const J=z.target,se=J.value??"",Be=j(se);Be===se?H(Be):T(J,Be)},ae=()=>E.value=!0,ue=()=>{if(E.value=!1,!G)return;const z=G.value??"",J=j(z);J===z?H(J):T(G,J)};e.onMounted(()=>{if(G=document.getElementById(u.value),!G)return;G.addEventListener("beforeinput",te),G.addEventListener("paste",Z),G.addEventListener("input",K),G.addEventListener("compositionstart",ae),G.addEventListener("compositionend",ue);const z=G.value??"",J=j(z);J===z?H(J):T(G,J)}),e.onBeforeUnmount(()=>{G&&(G.removeEventListener("beforeinput",te),G.removeEventListener("paste",Z),G.removeEventListener("input",K),G.removeEventListener("compositionstart",ae),G.removeEventListener("compositionend",ue),G=null)});const ke=()=>{p.value="",G&&(G.value=""),i("update:modelValue",null),i("clear")},De=e.computed(()=>v.value&&P.value>0),Ce=e.computed(()=>`${P.value} / ${N.value}`),ee=e.computed(()=>!!l.error);return(z,J)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",bm)):e.createCommentVNode("",!0),J[1]||(J[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),v.value?(e.openBlock(),e.createElementBlock("div",ym,[...J[0]||(J[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),f.value?(e.openBlock(),e.createElementBlock("span",km,"*")):e.createCommentVNode("",!0)],8,xm)):e.createCommentVNode("",!0),e.createElementVNode("div",wm,[l.icon||l.prependInner||z.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",Cm,[e.renderSlot(z.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",Em,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:p.value},m.value,{placeholder:l.placeholder,style:`text-transform: ${y.value}; padding-left: ${l.icon||l.prependInner||z.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${k.value||r.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600","text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",ee.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,Bm),r.value?(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(ce.Eye):e.unref(ce.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),k.value&&!r.value?(e.openBlock(),e.createElementBlock("div",Sm,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:ke}," ✕ ")])):e.createCommentVNode("",!0),De.value&&!ee.value?(e.openBlock(),e.createElementBlock("p",Am,e.toDisplayString(Ce.value),1)):e.createCommentVNode("",!0)]),ee.value?(e.openBlock(),e.createElementBlock("p",Vm,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,gm)),[[e.vShow,t.visible]])}}),Dm={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Nm={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Mm={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},vm={class:"flex items-center justify-between"},Pm={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Tm={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm"},Om={class:"p-6 flex-1"},Fm={class:"flex flex-col gap-4"},zm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Im={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Rm={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Lm={class:"flex items-center justify-between"},$m={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},jm={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/30 shadow-sm"},Um={class:"p-6 flex-1"},Wm={class:"flex flex-col gap-4"},Hm={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ka=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=$t.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",Dm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",Mm,[e.createElementVNode("div",vm,[e.createElementVNode("h3",Pm,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",Tm,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Om,[e.createElementVNode("div",Fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(lo,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",zm)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Im,[e.createElementVNode("div",Rm,[e.createElementVNode("div",Lm,[e.createElementVNode("h3",$m,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",jm,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Um,[e.createElementVNode("div",Wm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(lo,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",Hm,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
|
|
1
|
+
(function(pe,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("lucide-vue-next"),require("reka-ui"),require("@vueuse/core"),require("vue-i18n"),require("@vuepic/vue-datepicker"),require("@uppy/core"),require("@uppy/dashboard"),require("@uppy/image-editor"),require("vue-router"),require("vue3-lottie")):typeof define=="function"&&define.amd?define(["exports","vue","lucide-vue-next","reka-ui","@vueuse/core","vue-i18n","@vuepic/vue-datepicker","@uppy/core","@uppy/dashboard","@uppy/image-editor","vue-router","vue3-lottie"],e):(pe=typeof globalThis<"u"?globalThis:pe||self,e(pe.DynamicUI={},pe.Vue,pe.LucideIcons,pe.rekaUi,pe.core,pe.VueI18n,pe.VueDatePicker,pe.Uppy,pe.UppyDashboard,pe.UppyImageEditor,pe.VueRouter,pe.Vue3Lottie))})(this,(function(pe,e,le,Be,st,vt,yu,xu,hi,ku,Fn,wu){"use strict";var oA=Object.defineProperty;var rA=(pe,e,le)=>e in pe?oA(pe,e,{enumerable:!0,configurable:!0,writable:!0,value:le}):pe[e]=le;var we=(pe,e,le)=>rA(pe,typeof e!="symbol"?e+"":e,le);var wa;function Cu(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>t[o]})}}return n.default=t,Object.freeze(n)}const $t=Cu(le);let jt={};function pi(t){jt={...jt,...t}}function Eu(){return jt}function Bu(){return jt.apiBaseUrl?jt.apiBaseUrl:typeof window<"u"&&window.__MICRO_API_BASE_URL__?window.__MICRO_API_BASE_URL__:""}function _u(){const t={"Content-Type":"application/json",Accept:"application/json"};let n=null;if(jt.getAuthToken?n=jt.getAuthToken():typeof window<"u"&&window.__MICRO_AUTH_TOKEN__?n=window.__MICRO_AUTH_TOKEN__:typeof localStorage<"u"&&(n=localStorage.getItem("token")||sessionStorage.getItem("token")),n&&(t.Authorization=`Bearer ${n}`),jt.getHeaders){const o=jt.getHeaders();return{...t,...o}}return t}function Su(){jt.onUnauthorized&&jt.onUnauthorized()}async function Vu(t,n,o,r){const a=Eu();if(a.apiClient)return a.apiClient(t,n||"GET",o);if(!t||!t.trim())throw new Error("[DynamicUI][useApi] URL tidak boleh kosong. Pastikan prop `endpoint.apiUrl` sudah diisi dengan benar.");const s=["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"],i=(n||"").trim().toUpperCase(),l=s.includes(i)?i:"GET";s.includes(i)||console.warn(`[DynamicUI][useApi] HTTP method '${n}' tidak valid, fallback ke 'GET'.`);const c=Bu(),d=t.startsWith("http")?t:`${c}${t}`,u={method:l,headers:{..._u(),...r||{}}};o&&!["GET","DELETE"].includes(l)&&(o instanceof FormData?(u.body=o,u.headers&&u.headers["Content-Type"]&&delete u.headers["Content-Type"],u.headers&&u.headers["content-type"]&&delete u.headers["content-type"]):u.body=JSON.stringify(o));let f=d;if(o&&l==="GET"){const p=new URLSearchParams;Object.entries(o).forEach(([x,g])=>{g!=null&&p.append(x,String(g))});const k=p.toString();k&&(f=`${d}${d.includes("?")?"&":"?"}${k}`)}const m=await fetch(f,u);if(m.status===401&&Su(),!m.ok){const p=await m.text();throw new Error(`HTTP ${m.status}: ${p}`)}return(m.headers.get("content-type")||"").includes("application/json")?m.json():{status:!0,data:await m.text()}}function ct(){const t=(n,o,r,a)=>{let s=n,i=o,l=r,c=a;return a&&typeof a=="object"?(a._url&&(s=a._url,i=a._method||i||"POST",a._data&&(l={...l||{},...a._data})),a.headers&&(c=a.headers)):n&&o&&(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"].includes(o.toUpperCase())||(s=`${n.endsWith("/")?n.slice(0,-1):n}/${o}`,i="POST")),Vu(s,i,l,c)};return{apiUrl:t,DCodeApi:t}}const to=Math.min,Vt=Math.max,lr=Math.round,cr=Math.floor,Gt=t=>({x:t,y:t}),Au={left:"right",right:"left",bottom:"top",top:"bottom"};function gi(t,n,o){return Vt(t,to(n,o))}function Vo(t,n){return typeof t=="function"?t(n):t}function kn(t){return t.split("-")[0]}function Ao(t){return t.split("-")[1]}function bi(t){return t==="x"?"y":"x"}function yi(t){return t==="y"?"height":"width"}function rn(t){const n=t[0];return n==="t"||n==="b"?"y":"x"}function xi(t){return bi(rn(t))}function Du(t,n,o){o===void 0&&(o=!1);const r=Ao(t),a=xi(t),s=yi(a);let i=a==="x"?r===(o?"end":"start")?"right":"left":r==="start"?"bottom":"top";return n.reference[s]>n.floating[s]&&(i=dr(i)),[i,dr(i)]}function Nu(t){const n=dr(t);return[Va(t),n,Va(n)]}function Va(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const ki=["left","right"],wi=["right","left"],Mu=["top","bottom"],Tu=["bottom","top"];function Pu(t,n,o){switch(t){case"top":case"bottom":return o?n?wi:ki:n?ki:wi;case"left":case"right":return n?Mu:Tu;default:return[]}}function Ou(t,n,o,r){const a=Ao(t);let s=Pu(kn(t),o==="start",r);return a&&(s=s.map(i=>i+"-"+a),n&&(s=s.concat(s.map(Va)))),s}function dr(t){const n=kn(t);return Au[n]+t.slice(n.length)}function vu(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fu(t){return typeof t!="number"?vu(t):{top:t,right:t,bottom:t,left:t}}function ur(t){const{x:n,y:o,width:r,height:a}=t;return{width:r,height:a,top:o,left:n,right:n+r,bottom:o+a,x:n,y:o}}function Ci(t,n,o){let{reference:r,floating:a}=t;const s=rn(n),i=xi(n),l=yi(i),c=kn(n),d=s==="y",u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,m=r[l]/2-a[l]/2;let h;switch(c){case"top":h={x:u,y:r.y-a.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-a.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Ao(n)){case"start":h[i]-=m*(o&&d?-1:1);break;case"end":h[i]+=m*(o&&d?-1:1);break}return h}async function zu(t,n){var o;n===void 0&&(n={});const{x:r,y:a,platform:s,rects:i,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:m=!1,padding:h=0}=Vo(n,t),p=Fu(h),x=l[m?f==="floating"?"reference":"floating":f],g=ur(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(x)))==null||o?x:x.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),S=f==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,B=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),E=await(s.isElement==null?void 0:s.isElement(B))?await(s.getScale==null?void 0:s.getScale(B))||{x:1,y:1}:{x:1,y:1},_=ur(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:S,offsetParent:B,strategy:c}):S);return{top:(g.top-_.top+p.top)/E.y,bottom:(_.bottom-g.bottom+p.bottom)/E.y,left:(g.left-_.left+p.left)/E.x,right:(_.right-g.right+p.right)/E.x}}const Ru=50,Iu=async(t,n,o)=>{const{placement:r="bottom",strategy:a="absolute",middleware:s=[],platform:i}=o,l=i.detectOverflow?i:{...i,detectOverflow:zu},c=await(i.isRTL==null?void 0:i.isRTL(n));let d=await i.getElementRects({reference:t,floating:n,strategy:a}),{x:u,y:f}=Ci(d,r,c),m=r,h=0;const p={};for(let k=0;k<s.length;k++){const x=s[k];if(!x)continue;const{name:g,fn:S}=x,{x:B,y:E,data:_,reset:w}=await S({x:u,y:f,initialPlacement:r,placement:m,strategy:a,middlewareData:p,rects:d,platform:l,elements:{reference:t,floating:n}});u=B??u,f=E??f,p[g]={...p[g],..._},w&&h<Ru&&(h++,typeof w=="object"&&(w.placement&&(m=w.placement),w.rects&&(d=w.rects===!0?await i.getElementRects({reference:t,floating:n,strategy:a}):w.rects),{x:u,y:f}=Ci(d,m,c)),k=-1)}return{x:u,y:f,placement:m,strategy:a,middlewareData:p}},Lu=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var o,r;const{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:d}=n,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:m,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:k=!0,...x}=Vo(t,n);if((o=s.arrow)!=null&&o.alignmentOffset)return{};const g=kn(a),S=rn(l),B=kn(l)===l,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),_=m||(B||!k?[dr(l)]:Nu(l)),w=p!=="none";!m&&w&&_.push(...Ou(l,k,p,E));const y=[l,..._],b=await c.detectOverflow(n,x),C=[];let V=((r=s.flip)==null?void 0:r.overflows)||[];if(u&&C.push(b[g]),f){const M=Du(a,i,E);C.push(b[M[0]],b[M[1]])}if(V=[...V,{placement:a,overflows:C}],!C.every(M=>M<=0)){var D,N;const M=(((D=s.flip)==null?void 0:D.index)||0)+1,X=y[M];if(X&&(!(f==="alignment"?S!==rn(X):!1)||V.every(J=>rn(J.placement)===S?J.overflows[0]>0:!0)))return{data:{index:M,overflows:V},reset:{placement:X}};let $=(N=V.filter(H=>H.overflows[0]<=0).sort((H,J)=>H.overflows[1]-J.overflows[1])[0])==null?void 0:N.placement;if(!$)switch(h){case"bestFit":{var P;const H=(P=V.filter(J=>{if(w){const te=rn(J.placement);return te===S||te==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(te=>te>0).reduce((te,T)=>te+T,0)]).sort((J,te)=>J[1]-te[1])[0])==null?void 0:P[0];H&&($=H);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}},$u=new Set(["left","top"]);async function ju(t,n){const{placement:o,platform:r,elements:a}=t,s=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=kn(o),l=Ao(o),c=rn(o)==="y",d=$u.has(i)?-1:1,u=s&&c?-1:1,f=Vo(n,t);let{mainAxis:m,crossAxis:h,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(h=l==="end"?p*-1:p),c?{x:h*u,y:m*d}:{x:m*d,y:h*u}}const Uu=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var o,r;const{x:a,y:s,placement:i,middlewareData:l}=n,c=await ju(n,t);return i===((o=l.offset)==null?void 0:o.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:{...c,placement:i}}}}},Wu=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:o,y:r,placement:a,platform:s}=n,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:g=>{let{x:S,y:B}=g;return{x:S,y:B}}},...d}=Vo(t,n),u={x:o,y:r},f=await s.detectOverflow(n,d),m=rn(kn(a)),h=bi(m);let p=u[h],k=u[m];if(i){const g=h==="y"?"top":"left",S=h==="y"?"bottom":"right",B=p+f[g],E=p-f[S];p=gi(B,p,E)}if(l){const g=m==="y"?"top":"left",S=m==="y"?"bottom":"right",B=k+f[g],E=k-f[S];k=gi(B,k,E)}const x=c.fn({...n,[h]:p,[m]:k});return{...x,data:{x:x.x-o,y:x.y-r,enabled:{[h]:i,[m]:l}}}}}},Hu=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(n){var o,r;const{placement:a,rects:s,platform:i,elements:l}=n,{apply:c=()=>{},...d}=Vo(t,n),u=await i.detectOverflow(n,d),f=kn(a),m=Ao(a),h=rn(a)==="y",{width:p,height:k}=s.floating;let x,g;f==="top"||f==="bottom"?(x=f,g=m===(await(i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(g=f,x=m==="end"?"top":"bottom");const S=k-u.top-u.bottom,B=p-u.left-u.right,E=to(k-u[x],S),_=to(p-u[g],B),w=!n.middlewareData.shift;let y=E,b=_;if((o=n.middlewareData.shift)!=null&&o.enabled.x&&(b=B),(r=n.middlewareData.shift)!=null&&r.enabled.y&&(y=S),w&&!m){const V=Vt(u.left,0),D=Vt(u.right,0),N=Vt(u.top,0),P=Vt(u.bottom,0);h?b=p-2*(V!==0||D!==0?V+D:Vt(u.left,u.right)):y=k-2*(N!==0||P!==0?N+P:Vt(u.top,u.bottom))}await c({...n,availableWidth:b,availableHeight:y});const C=await i.getDimensions(l.floating);return p!==C.width||k!==C.height?{reset:{rects:!0}}:{}}}};function fr(){return typeof window<"u"}function zn(t){return Aa(t)?(t.nodeName||"").toLowerCase():"#document"}function At(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function Xt(t){var n;return(n=(Aa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function Aa(t){return fr()?t instanceof Node||t instanceof At(t).Node:!1}function Ut(t){return fr()?t instanceof Element||t instanceof At(t).Element:!1}function an(t){return fr()?t instanceof HTMLElement||t instanceof At(t).HTMLElement:!1}function Ei(t){return!fr()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof At(t).ShadowRoot}function Do(t){const{overflow:n,overflowX:o,overflowY:r,display:a}=Wt(t);return/auto|scroll|overlay|hidden|clip/.test(n+r+o)&&a!=="inline"&&a!=="contents"}function qu(t){return/^(table|td|th)$/.test(zn(t))}function mr(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Gu=/transform|translate|scale|rotate|perspective|filter/,Xu=/paint|layout|strict|content/,Rn=t=>!!t&&t!=="none";let Da;function Na(t){const n=Ut(t)?Wt(t):t;return Rn(n.transform)||Rn(n.translate)||Rn(n.scale)||Rn(n.rotate)||Rn(n.perspective)||!Ma()&&(Rn(n.backdropFilter)||Rn(n.filter))||Gu.test(n.willChange||"")||Xu.test(n.contain||"")}function Ku(t){let n=wn(t);for(;an(n)&&!no(n);){if(Na(n))return n;if(mr(n))return null;n=wn(n)}return null}function Ma(){return Da==null&&(Da=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Da}function no(t){return/^(html|body|#document)$/.test(zn(t))}function Wt(t){return At(t).getComputedStyle(t)}function hr(t){return Ut(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function wn(t){if(zn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Ei(t)&&t.host||Xt(t);return Ei(n)?n.host:n}function Bi(t){const n=wn(t);return no(n)?t.ownerDocument?t.ownerDocument.body:t.body:an(n)&&Do(n)?n:Bi(n)}function No(t,n,o){var r;n===void 0&&(n=[]),o===void 0&&(o=!0);const a=Bi(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),i=At(a);if(s){const l=Ta(i);return n.concat(i,i.visualViewport||[],Do(a)?a:[],l&&o?No(l):[])}else return n.concat(a,No(a,[],o))}function Ta(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function _i(t){const n=Wt(t);let o=parseFloat(n.width)||0,r=parseFloat(n.height)||0;const a=an(t),s=a?t.offsetWidth:o,i=a?t.offsetHeight:r,l=lr(o)!==s||lr(r)!==i;return l&&(o=s,r=i),{width:o,height:r,$:l}}function Pa(t){return Ut(t)?t:t.contextElement}function oo(t){const n=Pa(t);if(!an(n))return Gt(1);const o=n.getBoundingClientRect(),{width:r,height:a,$:s}=_i(n);let i=(s?lr(o.width):o.width)/r,l=(s?lr(o.height):o.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const Yu=Gt(0);function Si(t){const n=At(t);return!Ma()||!n.visualViewport?Yu:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function Ju(t,n,o){return n===void 0&&(n=!1),!o||n&&o!==At(t)?!1:n}function In(t,n,o,r){n===void 0&&(n=!1),o===void 0&&(o=!1);const a=t.getBoundingClientRect(),s=Pa(t);let i=Gt(1);n&&(r?Ut(r)&&(i=oo(r)):i=oo(t));const l=Ju(s,o,r)?Si(s):Gt(0);let c=(a.left+l.x)/i.x,d=(a.top+l.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(s){const m=At(s),h=r&&Ut(r)?At(r):r;let p=m,k=Ta(p);for(;k&&r&&h!==p;){const x=oo(k),g=k.getBoundingClientRect(),S=Wt(k),B=g.left+(k.clientLeft+parseFloat(S.paddingLeft))*x.x,E=g.top+(k.clientTop+parseFloat(S.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,f*=x.y,c+=B,d+=E,p=At(k),k=Ta(p)}}return ur({width:u,height:f,x:c,y:d})}function pr(t,n){const o=hr(t).scrollLeft;return n?n.left+o:In(Xt(t)).left+o}function Vi(t,n){const o=t.getBoundingClientRect(),r=o.left+n.scrollLeft-pr(t,o),a=o.top+n.scrollTop;return{x:r,y:a}}function Qu(t){let{elements:n,rect:o,offsetParent:r,strategy:a}=t;const s=a==="fixed",i=Xt(r),l=n?mr(n.floating):!1;if(r===i||l&&s)return o;let c={scrollLeft:0,scrollTop:0},d=Gt(1);const u=Gt(0),f=an(r);if((f||!f&&!s)&&((zn(r)!=="body"||Do(i))&&(c=hr(r)),f)){const h=In(r);d=oo(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const m=i&&!f&&!s?Vi(i,c):Gt(0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:o.y*d.y-c.scrollTop*d.y+u.y+m.y}}function Zu(t){return Array.from(t.getClientRects())}function ef(t){const n=Xt(t),o=hr(t),r=t.ownerDocument.body,a=Vt(n.scrollWidth,n.clientWidth,r.scrollWidth,r.clientWidth),s=Vt(n.scrollHeight,n.clientHeight,r.scrollHeight,r.clientHeight);let i=-o.scrollLeft+pr(t);const l=-o.scrollTop;return Wt(r).direction==="rtl"&&(i+=Vt(n.clientWidth,r.clientWidth)-a),{width:a,height:s,x:i,y:l}}const Ai=25;function tf(t,n){const o=At(t),r=Xt(t),a=o.visualViewport;let s=r.clientWidth,i=r.clientHeight,l=0,c=0;if(a){s=a.width,i=a.height;const u=Ma();(!u||u&&n==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=pr(r);if(d<=0){const u=r.ownerDocument,f=u.body,m=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(r.clientWidth-f.clientWidth-h);p<=Ai&&(s-=p)}else d<=Ai&&(s+=d);return{width:s,height:i,x:l,y:c}}function nf(t,n){const o=In(t,!0,n==="fixed"),r=o.top+t.clientTop,a=o.left+t.clientLeft,s=an(t)?oo(t):Gt(1),i=t.clientWidth*s.x,l=t.clientHeight*s.y,c=a*s.x,d=r*s.y;return{width:i,height:l,x:c,y:d}}function Di(t,n,o){let r;if(n==="viewport")r=tf(t,o);else if(n==="document")r=ef(Xt(t));else if(Ut(n))r=nf(n,o);else{const a=Si(t);r={x:n.x-a.x,y:n.y-a.y,width:n.width,height:n.height}}return ur(r)}function Ni(t,n){const o=wn(t);return o===n||!Ut(o)||no(o)?!1:Wt(o).position==="fixed"||Ni(o,n)}function of(t,n){const o=n.get(t);if(o)return o;let r=No(t,[],!1).filter(l=>Ut(l)&&zn(l)!=="body"),a=null;const s=Wt(t).position==="fixed";let i=s?wn(t):t;for(;Ut(i)&&!no(i);){const l=Wt(i),c=Na(i);!c&&l.position==="fixed"&&(a=null),(s?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||Do(i)&&!c&&Ni(t,i))?r=r.filter(u=>u!==i):a=l,i=wn(i)}return n.set(t,r),r}function rf(t){let{element:n,boundary:o,rootBoundary:r,strategy:a}=t;const i=[...o==="clippingAncestors"?mr(n)?[]:of(n,this._c):[].concat(o),r],l=Di(n,i[0],a);let c=l.top,d=l.right,u=l.bottom,f=l.left;for(let m=1;m<i.length;m++){const h=Di(n,i[m],a);c=Vt(h.top,c),d=to(h.right,d),u=to(h.bottom,u),f=Vt(h.left,f)}return{width:d-f,height:u-c,x:f,y:c}}function af(t){const{width:n,height:o}=_i(t);return{width:n,height:o}}function sf(t,n,o){const r=an(n),a=Xt(n),s=o==="fixed",i=In(t,!0,s,n);let l={scrollLeft:0,scrollTop:0};const c=Gt(0);function d(){c.x=pr(a)}if(r||!r&&!s)if((zn(n)!=="body"||Do(a))&&(l=hr(n)),r){const h=In(n,!0,s,n);c.x=h.x+n.clientLeft,c.y=h.y+n.clientTop}else a&&d();s&&!r&&a&&d();const u=a&&!r&&!s?Vi(a,l):Gt(0),f=i.left+l.scrollLeft-c.x-u.x,m=i.top+l.scrollTop-c.y-u.y;return{x:f,y:m,width:i.width,height:i.height}}function Oa(t){return Wt(t).position==="static"}function Mi(t,n){if(!an(t)||Wt(t).position==="fixed")return null;if(n)return n(t);let o=t.offsetParent;return Xt(t)===o&&(o=o.ownerDocument.body),o}function Ti(t,n){const o=At(t);if(mr(t))return o;if(!an(t)){let a=wn(t);for(;a&&!no(a);){if(Ut(a)&&!Oa(a))return a;a=wn(a)}return o}let r=Mi(t,n);for(;r&&qu(r)&&Oa(r);)r=Mi(r,n);return r&&no(r)&&Oa(r)&&!Na(r)?o:r||Ku(t)||o}const lf=async function(t){const n=this.getOffsetParent||Ti,o=this.getDimensions,r=await o(t.floating);return{reference:sf(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cf(t){return Wt(t).direction==="rtl"}const df={convertOffsetParentRelativeRectToViewportRelativeRect:Qu,getDocumentElement:Xt,getClippingRect:rf,getOffsetParent:Ti,getElementRects:lf,getClientRects:Zu,getDimensions:af,getScale:oo,isElement:Ut,isRTL:cf};function Pi(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function uf(t,n){let o=null,r;const a=Xt(t);function s(){var l;clearTimeout(r),(l=o)==null||l.disconnect(),o=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),s();const d=t.getBoundingClientRect(),{left:u,top:f,width:m,height:h}=d;if(l||n(),!m||!h)return;const p=cr(f),k=cr(a.clientWidth-(u+m)),x=cr(a.clientHeight-(f+h)),g=cr(u),B={rootMargin:-p+"px "+-k+"px "+-x+"px "+-g+"px",threshold:Vt(0,to(1,c))||1};let E=!0;function _(w){const y=w[0].intersectionRatio;if(y!==c){if(!E)return i();y?i(!1,y):r=setTimeout(()=>{i(!1,1e-7)},1e3)}y===1&&!Pi(d,t.getBoundingClientRect())&&i(),E=!1}try{o=new IntersectionObserver(_,{...B,root:a.ownerDocument})}catch{o=new IntersectionObserver(_,B)}o.observe(t)}return i(!0),s}function va(t,n,o,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,d=Pa(t),u=a||s?[...d?No(d):[],...n?No(n):[]]:[];u.forEach(g=>{a&&g.addEventListener("scroll",o,{passive:!0}),s&&g.addEventListener("resize",o)});const f=d&&l?uf(d,o):null;let m=-1,h=null;i&&(h=new ResizeObserver(g=>{let[S]=g;S&&S.target===d&&h&&n&&(h.unobserve(n),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var B;(B=h)==null||B.observe(n)})),o()}),d&&!c&&h.observe(d),n&&h.observe(n));let p,k=c?In(t):null;c&&x();function x(){const g=In(t);k&&!Pi(k,g)&&o(),k=g,p=requestAnimationFrame(x)}return o(),()=>{var g;u.forEach(S=>{a&&S.removeEventListener("scroll",o),s&&S.removeEventListener("resize",o)}),f==null||f(),(g=h)==null||g.disconnect(),h=null,c&&cancelAnimationFrame(p)}}const Fa=Uu,za=Wu,Ra=Lu,Ia=Hu,ff=(t,n,o)=>{const r=new Map,a={platform:df,...o},s={...a.platform,_c:r};return Iu(t,n,{...a,platform:s})};function mf(t){return t!=null&&typeof t=="object"&&"$el"in t}function Oi(t){if(mf(t)){const n=t.$el;return Aa(n)&&zn(n)==="#comment"?null:n}return t}function Mo(t){return typeof t=="function"?t():e.unref(t)}function vi(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Fi(t,n){const o=vi(t);return Math.round(n*o)/o}function La(t,n,o){o===void 0&&(o={});const r=o.whileElementsMounted,a=e.computed(()=>{var y;return(y=Mo(o.open))!=null?y:!0}),s=e.computed(()=>Mo(o.middleware)),i=e.computed(()=>{var y;return(y=Mo(o.placement))!=null?y:"bottom"}),l=e.computed(()=>{var y;return(y=Mo(o.strategy))!=null?y:"absolute"}),c=e.computed(()=>{var y;return(y=Mo(o.transform))!=null?y:!0}),d=e.computed(()=>Oi(t.value)),u=e.computed(()=>Oi(n.value)),f=e.ref(0),m=e.ref(0),h=e.ref(l.value),p=e.ref(i.value),k=e.shallowRef({}),x=e.ref(!1),g=e.computed(()=>{const y={position:h.value,left:"0",top:"0"};if(!u.value)return y;const b=Fi(u.value,f.value),C=Fi(u.value,m.value);return c.value?{...y,transform:"translate("+b+"px, "+C+"px)",...vi(u.value)>=1.5&&{willChange:"transform"}}:{position:h.value,left:b+"px",top:C+"px"}});let S;function B(){if(d.value==null||u.value==null)return;const y=a.value;ff(d.value,u.value,{middleware:s.value,placement:i.value,strategy:l.value}).then(b=>{f.value=b.x,m.value=b.y,h.value=b.strategy,p.value=b.placement,k.value=b.middlewareData,x.value=y!==!1})}function E(){typeof S=="function"&&(S(),S=void 0)}function _(){if(E(),r===void 0){B();return}if(d.value!=null&&u.value!=null){S=r(d.value,u.value,B);return}}function w(){a.value||(x.value=!1)}return e.watch([s,i,l,a],B,{flush:"sync"}),e.watch([d,u],_,{flush:"sync"}),e.watch(a,w,{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(E),{x:e.shallowReadonly(f),y:e.shallowReadonly(m),strategy:e.shallowReadonly(h),placement:e.shallowReadonly(p),middlewareData:e.shallowReadonly(k),isPositioned:e.shallowReadonly(x),floatingStyles:g,update:B}}const hf=["aria-busy"],pf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},gf=["for"],bf={key:0,class:"ml-1 text-destructive"},yf={class:"relative"},xf={key:0,class:"flex items-center text-gray-500 gap-2"},kf=["id","placeholder","disabled","readonly","value"],wf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},Cf=["disabled"],Ef={class:"overflow-y-auto overflow-x-hidden",style:{"max-height":"350px"}},Bf=["onMouseenter","onClick"],_f={key:0},Sf={class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Vf={key:0},Af={key:1},Df={key:2},Nf={key:1,class:"mt-1 text-xs text-red-600"},gr=e.defineComponent({name:"DCodeAutoComplete",inheritAttrs:!1,__name:"DCodeAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{default:()=>({})},fetchItems:{},icon:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>a.label??void 0),i=q=>{const ue=a[q];return ue===""||ue===!0||ue==="true"||ue===1||ue==="1"},l=e.ref(!1),c=e.computed(()=>o.itemTitle||a["item-title"]||a.itemTitle||"name"),d=e.computed(()=>o.itemValue||a["item-value"]||a.itemValue||"id"),u=e.computed(()=>o.disabled),f=e.computed(()=>i("required")),m=e.computed(()=>i("readonly")),h=e.computed(()=>o.returnObject||i("return-object")||i("returnObject")),p=e.computed(()=>f.value||i("aria-required")),k=e.computed(()=>o.error||o.errorMessage||a["error-message"]),x=e.computed(()=>a.placeholder??""),g=e.computed(()=>{const q=a.minChars??a["min-chars"];if(q==null||q==="")return 0;const ue=typeof q=="number"?q:Number.parseInt(String(q),10);return Number.isFinite(ue)&&ue>0?ue:0}),S=e.computed(()=>{const q=a.rules;return Array.isArray(q)?q:[]}),B=e.computed(()=>{const q=a.id||a.label;return q?`app-autocomplete-${q}-${Math.random().toString(36).slice(2,7)}`:void 0}),E=e.ref(o.modelValue),_=e.ref([]),w=e.ref(!1),y=e.ref(!1),b=e.computed(()=>a.items),C=e.computed(()=>{const q=M.value;return q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems?_.value:b.value??[]}),V=e.computed(()=>!!a.loading),D=e.computed(()=>V.value||w.value),N=e.computed(()=>{const{label:q,items:ue,loading:Ee,rules:Ue,"item-title":Me,"item-value":ne,itemTitle:ce,itemValue:he,minChars:Se,"min-chars":et,clearable:St,required:bn,"aria-required":Eo,disabled:Bo,readonly:Ca,visible:gt,"return-object":sr,returnObject:_o,class:Ea,"fetch-items":eo,fetchItems:ir,error:O,errorMessage:U,"error-message":I,...z}=a||{};return z}),P=()=>{if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions},M=e.computed(()=>{const q=o.endpoint||{};return{apiModule:o.apiModule||q.apiModule,apiAction:o.apiAction||q.apiAction,apiUrl:q.apiUrl,apiMethod:q.apiMethod||"GET"}}),X=e.ref(null),$=e.ref(null),H=e.ref(null),{floatingStyles:J}=La($,H,{placement:"bottom-start",whileElementsMounted:va,middleware:[Fa(4),Ra(),za(),Ia({apply({rects:q,elements:ue,availableHeight:Ee}){Object.assign(ue.floating.style,{width:`${q.reference.width}px`,maxHeight:`${Ee}px`})}})]}),te=e.ref(!1),T=e.ref(""),L=e.ref(-1),Z=e.ref(null),Q=e.computed(()=>!g.value||(T.value||"").trim().length>=g.value?"":`Ketik minimal ${g.value} karakter`),W=q=>{if(q==null)return"";if(typeof q=="string"||typeof q=="number")return String(q);const ue=c.value;return typeof ue=="function"?ue(q):(q==null?void 0:q[ue])??(q==null?void 0:q.name)??(q==null?void 0:q.nama)??(q==null?void 0:q.label)??(q==null?void 0:q.title)??"-"},ie=q=>{if(q==null)return null;if(typeof q=="string"||typeof q=="number")return q;const ue=d.value;return typeof ue=="function"?ue(q):(q==null?void 0:q[ue])??(q==null?void 0:q.id)??(q==null?void 0:q.value)??(q==null?void 0:q.code)??null},de=e.computed(()=>{const q=E.value;if(q==null||q==="")return"";if(Array.isArray(q))return q.length?q.map(Ue=>{if(h.value&&typeof Ue=="object"||typeof Ue=="object")return W(Ue);const Me=C.value.find(ne=>ie(ne)==Ue);return Me?W(Me):String(Ue)}).join(", "):"";if(typeof q=="object")return W(q);const ue=C.value.find(Ee=>ie(Ee)==q);return ue?W(ue):String(q)}),Ce=e.computed(()=>{const q=C.value||[],ue=(T.value||"").trim().toLowerCase(),Ee=(de.value||"").toLowerCase(),Ue=!ue||ue===Ee;let Me=q;if(Ue||(Me=q.filter(ne=>W(ne).toLowerCase().includes(ue))),Me.length>0){const ne=ce=>{const he=ie(ce);return Array.isArray(E.value)?E.value.some(Se=>Se==he):E.value==he};Me=[...Me].sort((ce,he)=>{const Se=ne(ce),et=ne(he);return Se&&!et?-1:!Se&&et?1:0})}return Me}),Ne=q=>Array.isArray(q)?q.length===0:q==null||q==="",ge=q=>{if(Z.value=null,f.value&&Ne(q)&&!S.value.length)return Z.value="This field is required",!1;for(const ue of S.value){const Ee=ue(q);if(Ee===!1)return Z.value="Invalid value",!1;if(typeof Ee=="string")return Z.value=Ee,!1}return!0},Y=async()=>{if(u.value||m.value)return;te.value=!0,L.value=Ce.value.length?0:-1,T.value=de.value||"";const q=M.value,ue=q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems;o.autoFetchOnOpen&&ue&&!y.value&&(await He(),L.value=Ce.value.length?0:-1)},v=()=>{te.value=!1,L.value=-1,T.value=de.value||""},K=q=>{const ue=h.value?q:ie(q);let Ee=ue;Array.isArray(E.value)&&(Ee=[ue]),E.value=Ee,r("update:modelValue",Ee),Z.value=null,ge(Ee),T.value=W(q),v()},re=()=>{_.value=[],y.value=!1,E.value=Array.isArray(E.value)?[]:null,r("update:modelValue",E.value),T.value="",Z.value=null},_e=()=>{l.value=!0,re(),v(),setTimeout(()=>{l.value=!1},0)},Re=q=>{if(u.value||m.value)return;const ue=q.target.value;T.value=ue,Z.value&&(Z.value=null),te.value||(te.value=!0),L.value=Ce.value.length?0:-1;const Ee=M.value.apiModule&&M.value.apiAction||M.value.apiUrl||o.fetchItems;o.autoFetchOnOpen&&Ee&&!D.value&&!y.value&&He()},ze=q=>{var Ee;if(u.value||m.value)return;const ue={ArrowDown:()=>{if(q.preventDefault(),!te.value){Y();return}Ce.value.length&&(L.value=Math.min(L.value+1,Ce.value.length-1))},ArrowUp:()=>{!te.value||!Ce.value.length||(q.preventDefault(),L.value=Math.max(L.value-1,0))},Enter:()=>{if(!te.value)return;q.preventDefault();const Ue=Ce.value[L.value];Ue&&K(Ue)},Escape:()=>{q.preventDefault(),v()},Tab:()=>{v()}};(Ee=ue[q.key])==null||Ee.call(ue)},He=async()=>{const q=M.value;if(q.apiModule&&q.apiAction||q.apiUrl||o.fetchItems){w.value=!0;try{let Ee;if(o.fetchItems){const Ue=P()||{},Me={page:1,perPage:100,search:(T.value||"").trim(),...Ue,...o.apiParams},ne=await o.fetchItems(Me),ce=(ne==null?void 0:ne.data)??ne;Ee=(ce==null?void 0:ce.data)??ce}else{const Me=ct().DCodeApi;if(typeof Me!="function"){console.error("[DCodeAutoComplete] useApi() must expose DCodeApi()");return}const ce={page:1,perPage:100,...P()||{},...o.apiParams};let he;q.apiUrl?he=await Me("","",ce,{_url:q.apiUrl,_method:q.apiMethod||"POST"}):he=await Me(q.apiModule,q.apiAction,ce);const Se=(he==null?void 0:he.data)??he;Ee=(Se==null?void 0:Se.data)??Se}_.value=Array.isArray(Ee)?Ee:[],y.value=!0}catch(Ee){console.error("[DCodeAutoComplete][fetchOptions] ERROR:",Ee),Z.value=`[DCodeAutoComplete][fetchOptions] ERROR: Error: ${(Ee==null?void 0:Ee.message)||(Ee==null?void 0:Ee.toString())||"Failed to load options"}`,_.value=[],y.value=!0}finally{w.value=!1}}},Xe=q=>{const ue=ie(q);return h.value?E.value?Array.isArray(E.value)?E.value.some(Ee=>ie(Ee)==ue):ie(E.value)==ue:!1:Array.isArray(E.value)?E.value.some(Ee=>Ee==ue):E.value==ue};e.watch(()=>[P(),M.value,o.apiParams],([q,ue,Ee],[Ue,Me,ne])=>{const ce=M.value;if(!(ce.apiModule&&ce.apiAction||ce.apiUrl||o.fetchItems)){re();return}const Se=JSON.stringify(q??null)===JSON.stringify(Ue??null),et=JSON.stringify(Ee??null)===JSON.stringify(ne??null);Se&&et||(re(),et||He())},{deep:!0}),e.watch(()=>o.modelValue,(q,ue)=>{E.value=q,!l.value&&(q==null||q==="")&&ue!=null&&o.apiModule&&o.apiAction&&(_.value=[],y.value=!1),T.value=de.value||""},{immediate:!0});const ot=M.value;(ot.apiModule&&ot.apiAction||ot.apiUrl||o.fetchItems)&&(o.autoFetchOnMount||!Ne(o.modelValue))&&He();const mt=q=>{const ue=X.value,Ee=H.value,Ue=q.target;ue&&ue.contains(Ue)||Ee&&Ee.contains(Ue)||te.value&&v()},pt=e.computed(()=>{const q=o.modelValue;return q==null?!1:typeof q=="string"?q.trim().length>0:Array.isArray(q)?q.length>0:typeof q=="object"?Object.keys(q).length>0:!0}),Tt=e.computed(()=>!!o.clearable&&pt.value&&!o.disabled);return e.onMounted(()=>{document.addEventListener("mousedown",mt)}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",mt)}),(q,ue)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:X,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",pf)):e.createCommentVNode("",!0),ue[6]||(ue[6]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:B.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),p.value?(e.openBlock(),e.createElementBlock("span",bf,"*")):e.createCommentVNode("",!0)],8,gf)):e.createCommentVNode("",!0),e.createElementVNode("div",yf,[e.createElementVNode("div",{ref_key:"reference",ref:$,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[u.value||m.value?"opacity-60 cursor-not-allowed":"",Z.value||k.value?"border-red-500 focus-within:ring-red-500":""]])},[o.icon||q.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",xf,[e.renderSlot(q.$slots,"prepend-inner",{},()=>[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps(N.value,{id:B.value,type:"text",class:["w-full bg-transparent outline-none text-sm text-gray-900 dark:text-gray-100 placeholder:text-gray-400",u.value||m.value?"cursor-not-allowed":"cursor-text"],placeholder:x.value,disabled:u.value,readonly:m.value,value:te.value?T.value:de.value||T.value,onFocus:ue[0]||(ue[0]=()=>{te.value||Y()}),onClick:ue[1]||(ue[1]=()=>{te.value||Y()}),onInput:Re,onKeydown:ze,onBlur:ue[2]||(ue[2]=()=>ge(E.value))}),null,16,kf),D.value?(e.openBlock(),e.createElementBlock("svg",wf,[...ue[7]||(ue[7]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):Tt.value?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:ue[3]||(ue[3]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(_e,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u.value||m.value,onClick:ue[4]||(ue[4]=Ee=>te.value?v():Y()),"aria-label":"Toggle"},[e.createVNode(e.unref(le.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":te.value}])},null,8,["class"])],8,Cf))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[te.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:H,style:e.normalizeStyle(e.unref(J)),class:"z-[50] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",Ef,[Ce.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ce.value,(Ee,Ue)=>(e.openBlock(),e.createElementBlock("button",{key:ie(Ee)??Ue,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",Ue===L.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:Me=>L.value=Ue,onMousedown:ue[5]||(ue[5]=e.withModifiers(()=>{},["prevent"])),onClick:Me=>K(Ee)},[e.createTextVNode(e.toDisplayString(W(Ee))+" ",1),Xe(Ee)?(e.openBlock(),e.createElementBlock("span",_f," ✓ ")):e.createCommentVNode("",!0)],42,Bf))),128)):e.renderSlot(q.$slots,"no-data",{key:1},()=>[e.createElementVNode("div",Sf,[D.value?(e.openBlock(),e.createElementBlock("span",Vf,"Loading data…")):Q.value?(e.openBlock(),e.createElementBlock("span",Af,e.toDisplayString(Q.value),1)):(e.openBlock(),e.createElementBlock("span",Df,"No data available"))])])])],4)):e.createCommentVNode("",!0)]))]),Z.value||k.value?(e.openBlock(),e.createElementBlock("p",Nf,e.toDisplayString(Z.value||k.value),1)):e.createCommentVNode("",!0)],64))],10,hf)),[[e.vShow,t.visible]])}}),Mf=["aria-busy"],Tf={key:0,class:"mb-1 h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Pf=["for"],Of={key:0,class:"ml-1 text-destructive"},vf={class:"relative"},Ff={key:0,class:"flex items-center text-gray-500 gap-2"},zf=["id","placeholder","disabled","value"],Rf={key:1,class:"h-6 w-6 animate-spin text-gray-500",viewBox:"0 0 24 24",fill:"none"},If=["disabled"],Lf={key:0,class:"p-3 space-y-2"},$f=["onMouseenter","onClick"],jf={class:"flex items-center space-x-3"},Uf={class:"flex-1"},Wf={class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Hf={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},qf={key:0},Gf={key:2,class:"p-3 text-center"},Xf={class:"inline-flex items-center space-x-2"},Kf={class:"text-sm text-gray-500"},Yf={key:3,class:"p-3 text-center"},Jf={class:"text-xs text-gray-400"},Qf={key:4,class:"px-3 py-2 text-sm text-gray-500 dark:text-gray-400"},Zf={key:1,class:"mt-1 text-xs text-red-600"},em={key:2,class:"mt-1 text-xs text-gray-500"},zi=e.defineComponent({name:"DCodeInfiniteAutoComplete",inheritAttrs:!1,__name:"DCodeInfiniteAutoComplete",props:{modelValue:{},apiModule:{},apiAction:{},apiOptions:{},autoFetchOnOpen:{type:Boolean,default:!0},refreshOnOpen:{type:Boolean,default:!1},autoFetchOnMount:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},skeleton:{type:Boolean,default:!1},error:{default:null},errorMessage:{default:null},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},itemSubtitle:{},returnObject:{type:Boolean,default:!1},endpoint:{},apiParams:{},fetchItems:{},icon:{},label:{},placeholder:{default:"Select an option"},required:{type:Boolean,default:!1},inputType:{default:"text"},helperText:{default:""},noResultsText:{default:"No results found"},loadingText:{default:"Loading more..."},endOfResultsText:{default:"End of results"},pageSize:{default:10},threshold:{default:100},debounceMs:{default:300}},emits:["update:modelValue","focus","blur","select","search","load-more","end-of-results","error"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.ref(),i=e.ref(),l=e.ref(),c=e.ref(),d=e.ref(),u=e.computed(()=>{const L=o.label||o.placeholder;return L?`app-infinite-autocomplete-${L}-${Math.random().toString(36).slice(2,7)}`:void 0}),f=e.ref(""),m=e.ref([]),h=e.ref(!1),p=e.ref(!1),k=e.ref(-1),x=e.ref(1),g=e.ref(!0),S=e.ref(0),B=e.ref(),{floatingStyles:E}=La(c,d,{placement:"bottom-start",whileElementsMounted:va,middleware:[Fa(4),Ra(),za(),Ia({apply({rects:L,elements:Z}){Object.assign(Z.floating.style,{width:`${L.reference.width}px`})}})]});e.computed(()=>({"opacity-50 pointer-events-none":o.disabled,relative:!0}));const _=e.computed(()=>f.value?m.value.filter(L=>C(L).toLowerCase().includes(f.value.toLowerCase())):m.value),w=e.computed(()=>{if(p.value&&f.value)return f.value;if(o.modelValue){if(o.returnObject)return C(o.modelValue);{const L=m.value.find(Z=>V(Z)===o.modelValue);return L?C(L):String(o.modelValue)}}return""}),y=()=>{p.value=!0},b=()=>{p.value=!1},C=L=>typeof o.itemTitle=="function"?o.itemTitle(L):L[o.itemTitle]||"",V=L=>typeof o.itemValue=="function"?o.itemValue(L):L[o.itemValue]||L,D=L=>o.itemSubtitle?typeof o.itemSubtitle=="function"?o.itemSubtitle(L):L[o.itemSubtitle]||"":"",N=L=>o.modelValue?o.returnObject?V(L)===V(o.modelValue):V(L)===o.modelValue:!1,P=L=>{var Q;const Z=o.returnObject?L:V(L);r("update:modelValue",Z),r("select",L),p.value=!1,f.value="",(Q=s.value)==null||Q.blur()},M=()=>{var L;r("update:modelValue",null),f.value="",(L=s.value)==null||L.focus()},X=L=>{p.value=!0,r("focus",L),o.autoFetchOnOpen&&!h.value&&(o.refreshOnOpen||m.value.length===0)&&T(!0)},$=L=>{setTimeout(()=>{p.value=!1,r("blur",L)},200)},H=L=>{const Z=L.target;f.value=Z.value,B.value&&clearTimeout(B.value),B.value=setTimeout(()=>{r("search",f.value),x.value=1,g.value=!0,T(!0)},o.debounceMs)},J=L=>{if(p.value)switch(L.key){case"ArrowDown":L.preventDefault(),k.value=Math.min(k.value+1,_.value.length-1);break;case"ArrowUp":L.preventDefault(),k.value=Math.max(k.value-1,0);break;case"Enter":L.preventDefault(),k.value>=0&&_.value[k.value]&&P(_.value[k.value]);break;case"Escape":p.value=!1;break}},te=L=>{if(!g.value||h.value)return;const Z=L.target,{scrollTop:Q,scrollHeight:W,clientHeight:ie}=Z;Q+ie>=W-o.threshold&&T()},T=async(L=!1)=>{var Z,Q;if(!h.value){h.value=!0;try{let W=[];if(o.fetchItems)W=await o.fetchItems();else{const ie=ct(),de=((Z=o.endpoint)==null?void 0:Z.apiModule)||o.apiModule,Ce=((Q=o.endpoint)==null?void 0:Q.apiAction)||o.apiAction;if(!de||!Ce)throw new Error("API module and action are required");const Ne={page:L?1:x.value,pageSize:o.pageSize,search:f.value,...o.apiParams},ge=await ie.apiUrl(`/${de}/${Ce}`,"GET",Ne);W=ge.data||ge.items||ge||[],S.value=ge.total||ge.totalItems||W.length}L?(m.value=W,x.value=1):(m.value.push(...W),x.value++),g.value=W.length>=o.pageSize,g.value||r("end-of-results"),r("load-more",{items:W,page:x.value,hasMore:g.value,total:S.value})}catch(W){console.error("Error fetching items:",W),r("error",W)}finally{h.value=!1}}};return e.onMounted(()=>{o.autoFetchOnMount&&T()}),e.onUnmounted(()=>{B.value&&clearTimeout(B.value)}),e.watch(()=>o.modelValue,L=>{L||(f.value="")}),(L,Z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:l,class:e.normalizeClass(["w-full",e.unref(a).class]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Tf)):e.createCommentVNode("",!0),Z[3]||(Z[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"mb-1 block text-sm font-medium text-gray-900 dark:text-gray-100"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Of,"*")):e.createCommentVNode("",!0)],8,Pf)):e.createCommentVNode("",!0),e.createElementVNode("div",vf,[e.createElementVNode("div",{ref_key:"reference",ref:c,class:e.normalizeClass(["flex items-center gap-2 rounded-lg border px-3 py-2 bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 h-10 focus-within:ring-1 focus-within:ring-gray-700 dark:focus-within:ring-gray-300",[t.disabled?"opacity-60 cursor-not-allowed":"",t.error?"border-red-500 focus-within:ring-red-500":""]])},[o.icon?(e.openBlock(),e.createElementBlock("div",Ff,[o.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.icon),{key:0,class:"h-4 w-4"})):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({ref_key:"inputRef",ref:s},L.$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:w.value,onFocus:X,onBlur:$,onInput:H,onKeydown:J}),null,16,zf),h.value?(e.openBlock(),e.createElementBlock("svg",Rf,[...Z[4]||(Z[4]=[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"},null,-1)])])):t.clearable&&t.modelValue?(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onMousedown:Z[0]||(Z[0]=e.withModifiers(()=>{},["prevent"])),onClick:e.withModifiers(M,["stop"]),"aria-label":"Clear"}," ✕ ",32)):(e.openBlock(),e.createElementBlock("button",{key:3,type:"button",class:"shrink-0 rounded-md px-1 text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 disabled:opacity-50 disabled:cursor-not-allowed",disabled:t.disabled,onClick:Z[1]||(Z[1]=Q=>p.value?b():y()),"aria-label":"Toggle"},[e.createVNode(e.unref(le.ChevronDown),{class:e.normalizeClass(["h-4 w-4 transition-transform duration-200 ease-in-out",{"rotate-180":p.value}])},null,8,["class"])],8,If))],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floating",ref:d,style:e.normalizeStyle(e.unref(E)),class:"z-[9999] overflow-hidden rounded-lg border bg-white shadow-lg border-gray-200 dark:border-neutral-700/50 dark:bg-neutral-800"},[e.createElementVNode("div",{ref_key:"scrollContainer",ref:i,class:"max-h-64 overflow-auto",onScroll:te},[h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",Lf,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,Q=>e.createElementVNode("div",{key:Q,class:"flex items-center space-x-3"},[...Z[5]||(Z[5]=[e.createElementVNode("div",{class:"skeleton h-4 w-4 bg-gray-200 rounded"},null,-1),e.createElementVNode("div",{class:"skeleton h-4 flex-1 bg-gray-200 rounded"},null,-1)])])),64))])):_.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(_.value,(Q,W)=>(e.openBlock(),e.createElementBlock("button",{key:V(Q)??W,type:"button",class:e.normalizeClass(["w-full flex justify-between text-left px-3 py-2 text-sm hover:bg-neutral-100 dark:hover:bg-neutral-800",W===k.value?"bg-neutral-100 dark:bg-neutral-800":""]),onMouseenter:ie=>k.value=W,onMousedown:Z[2]||(Z[2]=e.withModifiers(()=>{},["prevent"])),onClick:ie=>P(Q)},[e.renderSlot(L.$slots,"item",{item:Q,index:W},()=>[e.createElementVNode("div",jf,[e.createElementVNode("div",Uf,[e.createElementVNode("div",Wf,e.toDisplayString(C(Q)),1),t.itemSubtitle?(e.openBlock(),e.createElementBlock("div",Hf,e.toDisplayString(D(Q)),1)):e.createCommentVNode("",!0)])])]),N(Q)?(e.openBlock(),e.createElementBlock("span",qf," ✓ ")):e.createCommentVNode("",!0)],42,$f))),128)):e.createCommentVNode("",!0),h.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Gf,[e.createElementVNode("div",Xf,[Z[6]||(Z[6]=e.createElementVNode("div",{class:"animate-spin rounded-full h-4 w-4 border-b-2 border-blue-600"},null,-1)),e.createElementVNode("span",Kf,e.toDisplayString(t.loadingText),1)])])):e.createCommentVNode("",!0),!g.value&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",Yf,[e.createElementVNode("div",Jf,e.toDisplayString(t.endOfResultsText),1)])):!h.value&&m.value.length===0?(e.openBlock(),e.createElementBlock("div",Qf,e.toDisplayString(t.noResultsText),1)):e.createCommentVNode("",!0)],544)],4)):e.createCommentVNode("",!0)]))]),t.error?(e.openBlock(),e.createElementBlock("p",Zf,e.toDisplayString(t.errorMessage||t.error),1)):t.helperText?(e.openBlock(),e.createElementBlock("p",em,e.toDisplayString(t.helperText),1)):e.createCommentVNode("",!0)],64))],10,Mf)),[[e.vShow,t.visible]])}});function Ri(t){var n,o,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(n=0;n<a;n++)t[n]&&(o=Ri(t[n]))&&(r&&(r+=" "),r+=o)}else for(o in t)t[o]&&(r&&(r+=" "),r+=o);return r}function Ii(){for(var t,n,o=0,r="",a=arguments.length;o<a;o++)(t=arguments[o])&&(n=Ri(t))&&(r&&(r+=" "),r+=n);return r}const tm=(t,n)=>{const o=new Array(t.length+n.length);for(let r=0;r<t.length;r++)o[r]=t[r];for(let r=0;r<n.length;r++)o[t.length+r]=n[r];return o},nm=(t,n)=>({classGroupId:t,validator:n}),Li=(t=new Map,n=null,o)=>({nextPart:t,validators:n,classGroupId:o}),br="-",$i=[],om="arbitrary..",rm=t=>{const n=sm(t),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return am(i);const l=i.split(br),c=l[0]===""&&l.length>1?1:0;return ji(l,c,n)},getConflictingClassGroupIds:(i,l)=>{if(l){const c=r[i],d=o[i];return c?d?tm(d,c):c:d||$i}return o[i]||$i}}},ji=(t,n,o)=>{if(t.length-n===0)return o.classGroupId;const a=t[n],s=o.nextPart.get(a);if(s){const d=ji(t,n+1,s);if(d)return d}const i=o.validators;if(i===null)return;const l=n===0?t.join(br):t.slice(n).join(br),c=i.length;for(let d=0;d<c;d++){const u=i[d];if(u.validator(l))return u.classGroupId}},am=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const n=t.slice(1,-1),o=n.indexOf(":"),r=n.slice(0,o);return r?om+r:void 0})(),sm=t=>{const{theme:n,classGroups:o}=t;return im(o,n)},im=(t,n)=>{const o=Li();for(const r in t){const a=t[r];$a(a,o,r,n)}return o},$a=(t,n,o,r)=>{const a=t.length;for(let s=0;s<a;s++){const i=t[s];lm(i,n,o,r)}},lm=(t,n,o,r)=>{if(typeof t=="string"){cm(t,n,o);return}if(typeof t=="function"){dm(t,n,o,r);return}um(t,n,o,r)},cm=(t,n,o)=>{const r=t===""?n:Ui(n,t);r.classGroupId=o},dm=(t,n,o,r)=>{if(fm(t)){$a(t(r),n,o,r);return}n.validators===null&&(n.validators=[]),n.validators.push(nm(o,t))},um=(t,n,o,r)=>{const a=Object.entries(t),s=a.length;for(let i=0;i<s;i++){const[l,c]=a[i];$a(c,Ui(n,l),o,r)}},Ui=(t,n)=>{let o=t;const r=n.split(br),a=r.length;for(let s=0;s<a;s++){const i=r[s];let l=o.nextPart.get(i);l||(l=Li(),o.nextPart.set(i,l)),o=l}return o},fm=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,mm=t=>{if(t<1)return{get:()=>{},set:()=>{}};let n=0,o=Object.create(null),r=Object.create(null);const a=(s,i)=>{o[s]=i,n++,n>t&&(n=0,r=o,o=Object.create(null))};return{get(s){let i=o[s];if(i!==void 0)return i;if((i=r[s])!==void 0)return a(s,i),i},set(s,i){s in o?o[s]=i:a(s,i)}}},ja="!",Wi=":",hm=[],Hi=(t,n,o,r,a)=>({modifiers:t,hasImportantModifier:n,baseClassName:o,maybePostfixModifierPosition:r,isExternal:a}),pm=t=>{const{prefix:n,experimentalParseClassName:o}=t;let r=a=>{const s=[];let i=0,l=0,c=0,d;const u=a.length;for(let k=0;k<u;k++){const x=a[k];if(i===0&&l===0){if(x===Wi){s.push(a.slice(c,k)),c=k+1;continue}if(x==="/"){d=k;continue}}x==="["?i++:x==="]"?i--:x==="("?l++:x===")"&&l--}const f=s.length===0?a:a.slice(c);let m=f,h=!1;f.endsWith(ja)?(m=f.slice(0,-1),h=!0):f.startsWith(ja)&&(m=f.slice(1),h=!0);const p=d&&d>c?d-c:void 0;return Hi(s,h,m,p)};if(n){const a=n+Wi,s=r;r=i=>i.startsWith(a)?s(i.slice(a.length)):Hi(hm,!1,i,void 0,!0)}if(o){const a=r;r=s=>o({className:s,parseClassName:a})}return r},gm=t=>{const n=new Map;return t.orderSensitiveModifiers.forEach((o,r)=>{n.set(o,1e6+r)}),o=>{const r=[];let a=[];for(let s=0;s<o.length;s++){const i=o[s],l=i[0]==="[",c=n.has(i);l||c?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(i)):a.push(i)}return a.length>0&&(a.sort(),r.push(...a)),r}},bm=t=>({cache:mm(t.cacheSize),parseClassName:pm(t),sortModifiers:gm(t),...rm(t)}),ym=/\s+/,xm=(t,n)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:s}=n,i=[],l=t.trim().split(ym);let c="";for(let d=l.length-1;d>=0;d-=1){const u=l[d],{isExternal:f,modifiers:m,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:k}=o(u);if(f){c=u+(c.length>0?" "+c:c);continue}let x=!!k,g=r(x?p.substring(0,k):p);if(!g){if(!x){c=u+(c.length>0?" "+c:c);continue}if(g=r(p),!g){c=u+(c.length>0?" "+c:c);continue}x=!1}const S=m.length===0?"":m.length===1?m[0]:s(m).join(":"),B=h?S+ja:S,E=B+g;if(i.indexOf(E)>-1)continue;i.push(E);const _=a(g,x);for(let w=0;w<_.length;++w){const y=_[w];i.push(B+y)}c=u+(c.length>0?" "+c:c)}return c},km=(...t)=>{let n=0,o,r,a="";for(;n<t.length;)(o=t[n++])&&(r=qi(o))&&(a&&(a+=" "),a+=r);return a},qi=t=>{if(typeof t=="string")return t;let n,o="";for(let r=0;r<t.length;r++)t[r]&&(n=qi(t[r]))&&(o&&(o+=" "),o+=n);return o},wm=(t,...n)=>{let o,r,a,s;const i=c=>{const d=n.reduce((u,f)=>f(u),t());return o=bm(d),r=o.cache.get,a=o.cache.set,s=l,l(c)},l=c=>{const d=r(c);if(d)return d;const u=xm(c,o);return a(c,u),u};return s=i,(...c)=>s(km(...c))},Cm=[],ut=t=>{const n=o=>o[t]||Cm;return n.isThemeGetter=!0,n},Gi=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Xi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Em=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Bm=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_m=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Sm=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Vm=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Am=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Cn=t=>Em.test(t),Pe=t=>!!t&&!Number.isNaN(Number(t)),En=t=>!!t&&Number.isInteger(Number(t)),Ua=t=>t.endsWith("%")&&Pe(t.slice(0,-1)),sn=t=>Bm.test(t),Ki=()=>!0,Dm=t=>_m.test(t)&&!Sm.test(t),Wa=()=>!1,Nm=t=>Vm.test(t),Mm=t=>Am.test(t),Tm=t=>!ye(t)&&!xe(t),Pm=t=>Bn(t,tl,Wa),ye=t=>Gi.test(t),Ln=t=>Bn(t,nl,Dm),Yi=t=>Bn(t,$m,Pe),Om=t=>Bn(t,rl,Ki),vm=t=>Bn(t,ol,Wa),Ji=t=>Bn(t,Zi,Wa),Fm=t=>Bn(t,el,Mm),yr=t=>Bn(t,al,Nm),xe=t=>Xi.test(t),To=t=>$n(t,nl),zm=t=>$n(t,ol),Qi=t=>$n(t,Zi),Rm=t=>$n(t,tl),Im=t=>$n(t,el),xr=t=>$n(t,al,!0),Lm=t=>$n(t,rl,!0),Bn=(t,n,o)=>{const r=Gi.exec(t);return r?r[1]?n(r[1]):o(r[2]):!1},$n=(t,n,o=!1)=>{const r=Xi.exec(t);return r?r[1]?n(r[1]):o:!1},Zi=t=>t==="position"||t==="percentage",el=t=>t==="image"||t==="url",tl=t=>t==="length"||t==="size"||t==="bg-size",nl=t=>t==="length",$m=t=>t==="number",ol=t=>t==="family-name",rl=t=>t==="number"||t==="weight",al=t=>t==="shadow",jm=wm(()=>{const t=ut("color"),n=ut("font"),o=ut("text"),r=ut("font-weight"),a=ut("tracking"),s=ut("leading"),i=ut("breakpoint"),l=ut("container"),c=ut("spacing"),d=ut("radius"),u=ut("shadow"),f=ut("inset-shadow"),m=ut("text-shadow"),h=ut("drop-shadow"),p=ut("blur"),k=ut("perspective"),x=ut("aspect"),g=ut("ease"),S=ut("animate"),B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],_=()=>[...E(),xe,ye],w=()=>["auto","hidden","clip","visible","scroll"],y=()=>["auto","contain","none"],b=()=>[xe,ye,c],C=()=>[Cn,"full","auto",...b()],V=()=>[En,"none","subgrid",xe,ye],D=()=>["auto",{span:["full",En,xe,ye]},En,xe,ye],N=()=>[En,"auto",xe,ye],P=()=>["auto","min","max","fr",xe,ye],M=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...b()],H=()=>[Cn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...b()],J=()=>[Cn,"screen","full","dvw","lvw","svw","min","max","fit",...b()],te=()=>[Cn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...b()],T=()=>[t,xe,ye],L=()=>[...E(),Qi,Ji,{position:[xe,ye]}],Z=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",Rm,Pm,{size:[xe,ye]}],W=()=>[Ua,To,Ln],ie=()=>["","none","full",d,xe,ye],de=()=>["",Pe,To,Ln],Ce=()=>["solid","dashed","dotted","double"],Ne=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ge=()=>[Pe,Ua,Qi,Ji],Y=()=>["","none",p,xe,ye],v=()=>["none",Pe,xe,ye],K=()=>["none",Pe,xe,ye],re=()=>[Pe,xe,ye],_e=()=>[Cn,"full",...b()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[sn],breakpoint:[sn],color:[Ki],container:[sn],"drop-shadow":[sn],ease:["in","out","in-out"],font:[Tm],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[sn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[sn],shadow:[sn],spacing:["px",Pe],text:[sn],"text-shadow":[sn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Cn,ye,xe,x]}],container:["container"],columns:[{columns:[Pe,ye,xe,l]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:y()}],"overscroll-x":[{"overscroll-x":y()}],"overscroll-y":[{"overscroll-y":y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{"inset-s":C(),start:C()}],end:[{"inset-e":C(),end:C()}],"inset-bs":[{"inset-bs":C()}],"inset-be":[{"inset-be":C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[En,"auto",xe,ye]}],basis:[{basis:[Cn,"full","auto",l,...b()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,Cn,"auto","initial","none",ye]}],grow:[{grow:["",Pe,xe,ye]}],shrink:[{shrink:["",Pe,xe,ye]}],order:[{order:[En,"first","last","none",xe,ye]}],"grid-cols":[{"grid-cols":V()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":V()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:b()}],"gap-x":[{"gap-x":b()}],"gap-y":[{"gap-y":b()}],"justify-content":[{justify:[...M(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...M()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":M()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:b()}],px:[{px:b()}],py:[{py:b()}],ps:[{ps:b()}],pe:[{pe:b()}],pbs:[{pbs:b()}],pbe:[{pbe:b()}],pt:[{pt:b()}],pr:[{pr:b()}],pb:[{pb:b()}],pl:[{pl:b()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":b()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":b()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],"inline-size":[{inline:["auto",...J()]}],"min-inline-size":[{"min-inline":["auto",...J()]}],"max-inline-size":[{"max-inline":["none",...J()]}],"block-size":[{block:["auto",...te()]}],"min-block-size":[{"min-block":["auto",...te()]}],"max-block-size":[{"max-block":["none",...te()]}],w:[{w:[l,"screen",...H()]}],"min-w":[{"min-w":[l,"screen","none",...H()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[i]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",o,To,Ln]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Lm,Om]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ua,ye]}],"font-family":[{font:[zm,vm,n]}],"font-features":[{"font-features":[ye]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,xe,ye]}],"line-clamp":[{"line-clamp":[Pe,"none",xe,Yi]}],leading:[{leading:[s,...b()]}],"list-image":[{"list-image":["none",xe,ye]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,ye]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",xe,Ln]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[Pe,"auto",xe,ye]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:b()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,ye]}],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",xe,ye]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:Z()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},En,xe,ye],radial:["",xe,ye],conic:[En,xe,ye]},Im,Fm]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":de()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Ce(),"hidden","none"]}],"divide-style":[{divide:[...Ce(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-bs":[{"border-bs":T()}],"border-color-be":[{"border-be":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...Ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,xe,ye]}],"outline-w":[{outline:["",Pe,To,Ln]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",u,xr,yr]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",f,xr,yr]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[Pe,Ln]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",m,xr,yr]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[Pe,xe,ye]}],"mix-blend":[{"mix-blend":[...Ne(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ne()}],"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":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[xe,ye]}],"mask-image-radial-from-pos":[{"mask-radial-from":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:Z()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ye]}],filter:[{filter:["","none",xe,ye]}],blur:[{blur:Y()}],brightness:[{brightness:[Pe,xe,ye]}],contrast:[{contrast:[Pe,xe,ye]}],"drop-shadow":[{"drop-shadow":["","none",h,xr,yr]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",Pe,xe,ye]}],"hue-rotate":[{"hue-rotate":[Pe,xe,ye]}],invert:[{invert:["",Pe,xe,ye]}],saturate:[{saturate:[Pe,xe,ye]}],sepia:[{sepia:["",Pe,xe,ye]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ye]}],"backdrop-blur":[{"backdrop-blur":Y()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,xe,ye]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,xe,ye]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,xe,ye]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,xe,ye]}],"backdrop-invert":[{"backdrop-invert":["",Pe,xe,ye]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,xe,ye]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,xe,ye]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,xe,ye]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":b()}],"border-spacing-x":[{"border-spacing-x":b()}],"border-spacing-y":[{"border-spacing-y":b()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,ye]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",xe,ye]}],ease:[{ease:["linear","initial",g,xe,ye]}],delay:[{delay:[Pe,xe,ye]}],animate:[{animate:["none",S,xe,ye]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[k,xe,ye]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:v()}],"rotate-x":[{"rotate-x":v()}],"rotate-y":[{"rotate-y":v()}],"rotate-z":[{"rotate-z":v()}],scale:[{scale:K()}],"scale-x":[{"scale-x":K()}],"scale-y":[{"scale-y":K()}],"scale-z":[{"scale-z":K()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[xe,ye,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"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",xe,ye]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":b()}],"scroll-mx":[{"scroll-mx":b()}],"scroll-my":[{"scroll-my":b()}],"scroll-ms":[{"scroll-ms":b()}],"scroll-me":[{"scroll-me":b()}],"scroll-mbs":[{"scroll-mbs":b()}],"scroll-mbe":[{"scroll-mbe":b()}],"scroll-mt":[{"scroll-mt":b()}],"scroll-mr":[{"scroll-mr":b()}],"scroll-mb":[{"scroll-mb":b()}],"scroll-ml":[{"scroll-ml":b()}],"scroll-p":[{"scroll-p":b()}],"scroll-px":[{"scroll-px":b()}],"scroll-py":[{"scroll-py":b()}],"scroll-ps":[{"scroll-ps":b()}],"scroll-pe":[{"scroll-pe":b()}],"scroll-pbs":[{"scroll-pbs":b()}],"scroll-pbe":[{"scroll-pbe":b()}],"scroll-pt":[{"scroll-pt":b()}],"scroll-pr":[{"scroll-pr":b()}],"scroll-pb":[{"scroll-pb":b()}],"scroll-pl":[{"scroll-pl":b()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe,ye]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[Pe,To,Ln,Yi]}],stroke:[{stroke:["none",...T()]}],"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 ve(...t){return jm(Ii(t))}function sl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ha={},qa={},kr={exports:{}},il;function Um(){if(il)return kr.exports;il=1;var t=String,n=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return kr.exports=n(),kr.exports.createColors=n,kr.exports}var ll;function Wm(){return ll||(ll=1,(function(t){var n={};Object.defineProperty(t,"__esModule",{value:!0});function o(d,u){for(var f in u)Object.defineProperty(d,f,{enumerable:!0,get:u[f]})}o(t,{dim:function(){return l},default:function(){return c}});const r=a(Um());function a(d){return d&&d.__esModule?d:{default:d}}let s=new Set;function i(d,u,f){typeof process<"u"&&n.JEST_WORKER_ID||f&&s.has(f)||(f&&s.add(f),console.warn(""),u.forEach(m=>console.warn(d,"-",m)))}function l(d){return r.default.dim(d)}const c={info(d,u){i(r.default.bold(r.default.cyan("info")),...Array.isArray(d)?[d]:[u,d])},warn(d,u){i(r.default.bold(r.default.yellow("warn")),...Array.isArray(d)?[d]:[u,d])},risk(d,u){i(r.default.bold(r.default.magenta("risk")),...Array.isArray(d)?[d]:[u,d])}}})(qa)),qa}var cl;function Hm(){return cl||(cl=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});const n=o(Wm());function o(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:i,to:l}){n.default.warn(`${i}-color-renamed`,[`As of Tailwind CSS ${s}, \`${i}\` has been renamed to \`${l}\`.`,"Update your configuration file to silence this warning."])}const a={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(Ha)),Ha}var Ga,dl;function qm(){if(dl)return Ga;dl=1;let t=Hm();return Ga=(t.__esModule?t:{default:t}).default,Ga}var Gm=qm();const Xm=sl(Gm),ul=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,fl=Ii,wr=(t,n)=>o=>{var r;if((n==null?void 0:n.variants)==null)return fl(t,o==null?void 0:o.class,o==null?void 0:o.className);const{variants:a,defaultVariants:s}=n,i=Object.keys(a).map(d=>{const u=o==null?void 0:o[d],f=s==null?void 0:s[d];if(u===null)return null;const m=ul(u)||ul(f);return a[d][m]}),l=o&&Object.entries(o).reduce((d,u)=>{let[f,m]=u;return m===void 0||(d[f]=m),d},{}),c=n==null||(r=n.compoundVariants)===null||r===void 0?void 0:r.reduce((d,u)=>{let{class:f,className:m,...h}=u;return Object.entries(h).every(p=>{let[k,x]=p;return Array.isArray(x)?x.includes({...s,...l}[k]):{...s,...l}[k]===x})?[...d,f,m]:d},[]);return fl(t,i,c,o==null?void 0:o.class,o==null?void 0:o.className)},Ht=e.defineComponent({__name:"Button",props:{variant:{},size:{},class:{type:[Boolean,null,String,Object,Array]},asChild:{type:Boolean},as:{default:"button"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.Primitive),{as:t.as,"as-child":t.asChild,class:e.normalizeClass(e.unref(ve)(e.unref(ro)({variant:t.variant,size:t.size}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["as","as-child","class"]))}}),ro=wr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",xs:"h-7 rounded px-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-8 w-8","icon-sm":"size-7","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}}),ml=e.defineComponent({__name:"Tooltip",props:{defaultOpen:{type:Boolean},open:{type:Boolean},delayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Be.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Be.TooltipRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),hl=e.defineComponent({inheritAttrs:!1,__name:"TooltipContent",props:{forceMount:{type:Boolean},ariaLabel:{},asChild:{type:Boolean},as:{},side:{},sideOffset:{default:4},align:{},alignOffset:{},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.TooltipPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Be.TooltipContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(ve)("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},16,["class"])]),_:3}))}}),pl=e.defineComponent({__name:"TooltipProvider",props:{delayDuration:{},skipDelayDuration:{},disableHoverableContent:{type:Boolean},disableClosingTrigger:{type:Boolean},disabled:{type:Boolean},ignoreNonKeyboardFocus:{type:Boolean},content:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.TooltipProvider),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),gl=e.defineComponent({__name:"TooltipTrigger",props:{reference:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.TooltipTrigger),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Km={class:"relative z-10"},Ym="font-medium transition-all duration-300 ease-in-out hover:-translate-y-0.5 hover:scale-[1.02] active:translate-y-0 active:scale-[0.98] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:opacity-60 disabled:cursor-not-allowed disabled:shadow-none disabled:translate-y-0 disabled:scale-100 relative overflow-hidden before:absolute before:inset-0 before:bg-white/20 before:translate-y-full before:transition-transform before:duration-300 hover:before:translate-y-0",Jm=e.defineComponent({name:"DCodeButton",inheritAttrs:!1,__name:"DCodeButton",props:{icon:{},text:{default:""},variant:{default:"default"},size:{default:"default"},tooltip:{default:""},bgColor:{default:""},textColor:{default:""},borderColor:{default:""},rounded:{default:"lg"},borderStyle:{default:"solid"},disabled:{type:Boolean,default:!1},type:{default:"button"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&$t[o.icon]||null),a=e.computed(()=>!!o.tooltip),s=e.computed(()=>o.visible??!0),i=e.computed(()=>{const Q=String(o.variant||"default").toLowerCase();return Q==="tonal"?"secondary":Q==="elevated"?"default":Q}),l=e.computed(()=>String(o.bgColor||"").toLowerCase()),c=e.computed(()=>String(o.type||"button").toLowerCase()),d=e.computed(()=>{const{class:Q,...W}=n;return W}),u=e.computed(()=>ve(n.class)),f=e.computed(()=>((u.value??"").match(/\b(?:w|h|min-w|min-h|max-w|max-h)-[^\s]+\b/g)??[]).join(" ")),m=e.computed(()=>o.size==="sm"?"h-9":o.size==="lg"?"h-11":o.size==="icon"?"h-10 w-10":"h-10"),h=e.computed(()=>o.size==="icon"?"":!o.text&&o.icon?"w-10":"w-28"),p=e.computed(()=>o.rounded?o.rounded.startsWith("rounded")?o.rounded:{none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",xl:"rounded-xl","2xl":"rounded-2xl","3xl":"rounded-3xl",full:"rounded-full"}[o.rounded]||`rounded-${o.rounded}`:""),k=e.computed(()=>!o.borderStyle||o.borderStyle==="none"?"border-0":o.borderStyle==="solid"?"border-2":{dashed:"border-[3px] border-dashed",dotted:"border-[3px] border-dotted",double:"border-[6px] border-double"}[o.borderStyle]||"border-2"),x=e.computed(()=>ve("inline-flex items-center justify-center bg-gray-200 dark:bg-gray-700 animate-pulse",p.value,m.value,h.value,f.value)),g=e.computed(()=>{const W=(u.value??"").match(/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),S=e.computed(()=>{const W=(u.value??"").match(/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u);return W?W[0]:null}),B=e.computed(()=>!!g.value),E=e.computed(()=>/\bborder-/.test(u.value??"")),_=e.computed(()=>/\bhover:/.test(u.value??"")),w=e.computed(()=>{const Q=u.value??"";return i.value!=="outline"?Q:Q.replaceAll(/\bbg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\bhover:bg-(?!gradient)[^\s]+\b/gu,"").replaceAll(/\s+/gu," ").trim()}),y=e.ref(null),b=Q=>{const W=Q.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)/u);return W?{r:Number(W[1]),g:Number(W[2]),b:Number(W[3]),a:W[4]?Number(W[4]):1}:null},C=(Q,W)=>{const ie=b(Q);if(!ie)return Q;const de=Ce=>Math.max(0,Math.min(255,Math.round(Ce)));return`rgba(${de(ie.r*(1-W))}, ${de(ie.g*(1-W))}, ${de(ie.b*(1-W))}, ${ie.a})`},V=Q=>{if(globalThis.window===void 0)return null;const W=document.createElement("div");W.className=Q,W.style.position="absolute",W.style.visibility="hidden",W.style.pointerEvents="none",W.style.width="1px",W.style.height="1px",document.body.appendChild(W);const ie=globalThis.getComputedStyle(W).backgroundColor;return W.remove(),!ie||ie==="transparent"||ie==="rgba(0, 0, 0, 0)"?null:ie},D=[50,100,200,300,400,500,600,700,800,900,950],N=Q=>{const W=D.indexOf(Q);return W===-1?Q:D[Math.min(D.length-1,W+2)]},P=(Q,W)=>{const ie=Xm[Q];if(!ie)return null;if(typeof ie=="string")return ie;if(!W)return null;const de=ie[W];return typeof de=="string"?de:null},M=(Q,W=!1)=>{if(!Q)return null;const ie=W?/\bhover:bg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u:/\bbg-(?!gradient)([a-z-]+)(?:-(\d{2,3}))?\b/u,de=Q.match(ie);return de?{colorName:de[1],shade:de[2]?Number.parseInt(de[2],10):null}:null},X=()=>{const Q=g.value;if(!Q){y.value=null;return}const W=M(Q),ie=W==null?void 0:W.colorName,de=(W==null?void 0:W.shade)??null,Ce=(ie?P(ie,de):null)??V(Q);if(!Ce){y.value=null;return}let Ne;const ge=M(S.value,!0),Y=ge?P(ge.colorName,ge.shade??null):null;if(Y)Ne=Y;else if(ie&&de){const v=N(de);Ne=P(ie,v)??C(Ce,.2)}else Ne=C(Ce,.2);y.value={"--btn-color":Ce,"--btn-color-hover":Ne}};e.onMounted(()=>{X()}),e.watch([g,S],async()=>{await e.nextTick(),X()});const $=e.computed(()=>{const Q=/\bdark:bg-/.test(u.value??"");return!B.value||i.value==="outline"||Q?"":y.value?"dcode-btn--fill dcode-btn--fill-hover":_.value?"":"hover:brightness-90"}),H=e.computed(()=>{if(!B.value||i.value!=="outline")return"";const Q=["dcode-btn--outline","dcode-btn--outline-hover"];return E.value||Q.push("border"),!y.value&&!_.value&&Q.push("hover:brightness-90"),Q.join(" ")}),J=e.computed(()=>y.value??void 0),te={primary:{bg:"bg-blue-600 dark:bg-blue-500",border:"border-blue-700 dark:border-blue-400",text:"text-white",hoverBg:"hover:bg-blue-700 dark:hover:bg-blue-600",hoverBorder:"hover:border-blue-800 dark:hover:border-blue-500",hoverText:"hover:text-white"},success:{bg:"bg-green-600 dark:bg-green-500",border:"border-green-700 dark:border-green-400",text:"text-white",hoverBg:"hover:bg-green-700 dark:hover:bg-green-600",hoverBorder:"hover:border-green-800 dark:hover:border-green-500",hoverText:"hover:text-white"},warning:{bg:"bg-yellow-500 dark:bg-yellow-400",border:"border-yellow-600 dark:border-yellow-300",text:"text-white",hoverBg:"hover:bg-yellow-600 dark:hover:bg-yellow-500",hoverBorder:"hover:border-yellow-700 dark:hover:border-yellow-400",hoverText:"hover:text-white"},danger:{bg:"bg-red-600 dark:bg-red-500",border:"border-red-700 dark:border-red-400",text:"text-white",hoverBg:"hover:bg-red-700 dark:hover:bg-red-600",hoverBorder:"hover:border-red-800 dark:hover:border-red-500",hoverText:"hover:text-white"},info:{bg:"bg-cyan-600 dark:bg-cyan-500",border:"border-cyan-700 dark:border-cyan-400",text:"text-white",hoverBg:"hover:bg-cyan-700 dark:hover:bg-cyan-600",hoverBorder:"hover:border-cyan-800 dark:hover:border-cyan-500",hoverText:"hover:text-white"},secondary:{bg:"bg-gray-600 dark:bg-gray-500",border:"border-gray-700 dark:border-gray-400",text:"text-white",hoverBg:"hover:bg-gray-700 dark:hover:bg-gray-600",hoverBorder:"hover:border-gray-800 dark:hover:border-gray-500",hoverText:"hover:text-white"},purple:{bg:"bg-purple-600 dark:bg-purple-500",border:"border-purple-700 dark:border-purple-400",text:"text-white",hoverBg:"hover:bg-purple-700 dark:hover:bg-purple-600",hoverBorder:"hover:border-purple-800 dark:hover:border-purple-500",hoverText:"hover:text-white"},pink:{bg:"bg-pink-600 dark:bg-pink-500",border:"border-pink-700 dark:border-pink-400",text:"text-white",hoverBg:"hover:bg-pink-700 dark:hover:bg-pink-600",hoverBorder:"hover:border-pink-800 dark:hover:border-pink-500",hoverText:"hover:text-white"},dark:{bg:"bg-gray-900 dark:bg-gray-800",border:"border-black dark:border-gray-700",text:"text-white",hoverBg:"hover:bg-black dark:hover:bg-gray-950",hoverBorder:"hover:border-black dark:hover:border-gray-600",hoverText:"hover:text-white"},light:{bg:"bg-gray-100 dark:bg-gray-800",border:"border-gray-300 dark:border-gray-600",text:"text-gray-900 dark:text-gray-100",hoverBg:"hover:bg-gray-200 dark:hover:bg-gray-700",hoverBorder:"hover:border-gray-400 dark:hover:border-gray-500",hoverText:"hover:text-gray-900 dark:hover:text-gray-100"}},T={"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"}},L=e.computed(()=>{const Q=[],W=l.value,ie=String(o.borderColor||"").toLowerCase(),de=W?te[W]:null,Ce=W?T[W]:null,Ne=ie?te[ie]:null;return W&&(de?Ne&&ie!==W?(Q.push(de.bg,Ne.hoverBg),o.textColor||Q.push(de.text,Ne.hoverText)):(Q.push(de.bg,de.hoverBg),o.textColor||Q.push(de.text,de.hoverText)):Ce?(Q.push(Ce.bg,Ce.hover),o.textColor||Q.push(Ce.text)):W==="transparent"?Ne?(Q.push("bg-transparent",Ne.hoverBg),o.textColor||Q.push("text-inherit",Ne.hoverText)):Q.push("bg-transparent hover:bg-black/5 dark:hover:bg-white/5"):Q.push(W)),ie?Ne?Q.push(Ne.border,Ne.hoverBorder):Q.push(ie):de&&i.value!=="ghost"&&i.value!=="link"&&Q.push(de.border,de.hoverBorder),o.textColor&&Q.push(o.textColor),Q.join(" ")}),Z=e.computed(()=>ve(Ym,p.value,k.value,w.value,$.value,H.value,L.value));return(Q,W)=>s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(x.value),"aria-hidden":"true"},null,2)):(e.openBlock(),e.createBlock(e.unref(pl),{key:1,"delay-duration":0},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createBlock(e.unref(ml),{key:0},{default:e.withCtx(()=>[e.createVNode(e.unref(gl),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Ht),e.mergeProps({variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:Z.value,style:J.value},d.value),{default:e.withCtx(()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)]),_:1},16,["variant","size","disabled","type","class","style"])]),_:1}),e.createVNode(e.unref(hl),{side:"top","side-offset":8,class:"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0"},{default:e.withCtx(()=>[e.createElementVNode("span",Km,e.toDisplayString(o.tooltip),1)]),_:1})]),_:1})):(e.openBlock(),e.createBlock(e.unref(Ht),e.mergeProps({key:1,variant:i.value,size:o.size,disabled:o.disabled,type:c.value,class:Z.value,style:J.value},d.value),{default:e.withCtx(()=>[e.renderSlot(Q.$slots,"default",{},()=>[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:"h-[18px] w-[18px]"})):e.createCommentVNode("",!0),o.text?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(r.value?"ml-1":"")},e.toDisplayString(o.text),3)):e.createCommentVNode("",!0)],!0)]),_:3},16,["variant","size","disabled","type","class","style"]))]),_:3}))],64)):e.createCommentVNode("",!0)}}),Dt=(t,n)=>{const o=t.__vccOpts||t;for(const[r,a]of n)o[r]=a;return o},Ke=Dt(Jm,[["__scopeId","data-v-fed1b675"]]),Qm={key:0,class:"flex items-center justify-between bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 px-4 py-3 backdrop-blur-sm"},Zm={class:"flex flex-col gap-1"},eh={key:0,class:"text-sm font-semibold text-neutral-900 dark:text-neutral-100 leading-tight"},th={key:1,class:"text-xs text-neutral-500 dark:text-neutral-400"},nh={key:0,class:"flex items-center gap-2"},oh={name:"DCodeCard"},bl=e.defineComponent({...oh,props:{level:{default:1},title:{},subtitle:{},shadow:{type:Boolean,default:!1},border:{type:Boolean,default:!0},padding:{default:"p-6"}},setup(t){const n=t,o=e.computed(()=>{switch(n.level){case 2:return"bg-neutral-50 dark:bg-neutral-700";case 3:return"bg-neutral-100 dark:bg-neutral-600";case 1:default:return"bg-white dark:bg-neutral-800"}});return(r,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["transition-shadow duration-300 dcode-card",[o.value,{"shadow-md":t.shadow},{"border-transparent":!t.border},{"border-neutral-200/60 dark:border-neutral-700/50":t.border&&t.level===1},{"border-neutral-300/60 dark:border-neutral-600/50":t.border&&t.level!==1},"overflow-hidden"]])},[t.title||r.$slots.header||r.$slots.actions?(e.openBlock(),e.createElementBlock("div",Qm,[e.createElementVNode("div",Zm,[e.renderSlot(r.$slots,"header",{},()=>[t.title?(e.openBlock(),e.createElementBlock("h3",eh,e.toDisplayString(t.title),1)):e.createCommentVNode("",!0),t.subtitle?(e.openBlock(),e.createElementBlock("p",th,e.toDisplayString(t.subtitle),1)):e.createCommentVNode("",!0)])]),r.$slots.actions?(e.openBlock(),e.createElementBlock("div",nh,[e.renderSlot(r.$slots,"actions")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["relative z-10",t.padding])},[e.renderSlot(r.$slots,"default")],2),r.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["mt-6 pt-6 border-t border-neutral-200/60 dark:border-neutral-700/50",t.padding])},[e.renderSlot(r.$slots,"footer")],2)):e.createCommentVNode("",!0)],2))}}),rh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},ah={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},sh={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},ih={class:"flex items-center justify-between"},lh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},ch={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl relative group"},dh={class:"font-mono text-[11px] leading-relaxed text-blue-700 dark:text-blue-300 whitespace-pre-wrap break-all"},uh={class:"dcode-card h-full flex flex-col border border-neutral-200 dark:border-neutral-800 bg-white dark:bg-neutral-900"},fh={class:"p-4 border-b border-neutral-200 dark:border-neutral-800 bg-neutral-50 dark:bg-neutral-800/30 rounded-t-xl"},mh={class:"flex items-center justify-between"},hh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},ph={class:"p-0 flex-1 bg-white dark:bg-[#0d1117] overflow-hidden rounded-b-xl"},gh={class:"font-mono text-[11px] leading-relaxed text-emerald-700 dark:text-emerald-400 whitespace-pre-wrap break-all"},Xa=e.defineComponent({name:"DCodeBeforeAfter",__name:"DCodeBeforeAfter",props:{dataBefore:{type:[Object,Array,String,Number,Boolean,null],required:!0},dataAfter:{type:[Object,Array,String,Number,Boolean,null],required:!0}},setup(t){const{t:n}=vt.useI18n(),o=e.ref(null),r=e.ref(null);let a=!1;const s=l=>{if(a)return;a=!0;const c=l==="before"?o.value:r.value,d=l==="before"?r.value:o.value;if(c&&d){const u=c.scrollTop,f=c.scrollLeft;requestAnimationFrame(()=>{d.scrollTop=u,d.scrollLeft=f,requestAnimationFrame(()=>{a=!1})})}else a=!1},i=l=>{try{if(!l)return"";let c=l;if(typeof l=="string")try{(l.trim().startsWith("{")||l.trim().startsWith("["))&&(c=JSON.parse(l))}catch{}return JSON.stringify(c,null,2)}catch{return String(l)}};return(l,c)=>(e.openBlock(),e.createElementBlock("div",rh,[e.createElementVNode("div",ah,[e.createElementVNode("div",sh,[e.createElementVNode("div",ih,[e.createElementVNode("h3",lh,[c[2]||(c[2]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),c[3]||(c[3]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200 dark:border-neutral-700 shadow-sm"}," ORIGINAL ",-1))])]),e.createElementVNode("div",ch,[e.createElementVNode("div",{ref_key:"beforeContainer",ref:o,onScroll:c[0]||(c[0]=d=>s("before")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",dh,e.toDisplayString(i(t.dataBefore)),1)],544)])]),e.createElementVNode("div",uh,[e.createElementVNode("div",fh,[e.createElementVNode("div",mh,[e.createElementVNode("h3",hh,[c[4]||(c[4]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),c[5]||(c[5]=e.createElementVNode("span",{class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/50 shadow-sm"}," MODIFIED ",-1))])]),e.createElementVNode("div",ph,[e.createElementVNode("div",{ref_key:"afterContainer",ref:r,onScroll:c[1]||(c[1]=d=>s("after")),class:"p-4 overflow-auto max-h-[500px] custom-scrollbar"},[e.createElementVNode("pre",gh,e.toDisplayString(i(t.dataAfter)),1)],544)])])]))}}),bh=["aria-busy"],yh={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},xh={key:1,class:"flex justify-end"},kh=["for"],wh={key:0,class:"ml-1 text-destructive"},Ch={class:"relative w-full group"},Eh={key:0,class:"absolute inset-y-0 left-4 flex items-center text-muted-foreground"},Bh={key:1},_h=["id","value","placeholder"],Sh={key:1,class:"absolute inset-y-0 right-4 flex items-center"},Vh={key:2,class:"absolute inset-y-0 right-4 flex items-center"},Ah={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"},Dh={key:1,class:"text-xs text-destructive"},ao=e.defineComponent({name:"DCodeTextField",inheritAttrs:!1,__name:"DCodeTextField",props:{modelValue:{},prependInner:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null},placeholder:{default:""},icon:{},disabled:{type:Boolean,default:!1},maxLength:{},minLength:{},maxValue:{},minValue:{}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=e.computed(()=>{var v;return((v=l.valueType)==null?void 0:v.toLowerCase())==="password"||o.type==="password"}),a=e.ref(!1),s=()=>{a.value=!a.value},i=n,l=t,c=e.computed(()=>o.label);e.computed(()=>l.visible??!0);const d=Math.random().toString(36).slice(2,7),u=e.computed(()=>`app-text-field-${o.id||c.value||"field"}-${d}`),f=e.computed(()=>{const v=o.required,K=o["aria-required"];return v===""||v===!0||v==="true"||(K==="true"||K===!0)}),m=e.computed(()=>{const{label:v,class:K,id:re,required:_e,"aria-required":Re,...ze}=o;return ze}),h=e.computed(()=>{var K,re;const v={...m.value};return((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&(v.type="text",v.inputmode="numeric",v.pattern="[0-9]*"),((re=l.valueType)==null?void 0:re.toLowerCase())==="email"&&(v.type="email",v.inputmode="email"),r.value&&(v.type=a.value?"text":"password"),l.disabled&&(v.disabled=!0),l.maxLength&&(v.maxlength=l.maxLength),l.minLength&&(v.minlength=l.minLength),l.maxValue&&(v.max=l.maxValue),l.minValue&&(v.min=l.minValue),v}),p=e.computed(()=>{const v=l.modelValue;return v==null||String(v).length===0}),k=e.computed(()=>l.clearable?l.hideClearWhenEmpty?!p.value:!0:!1),x=e.computed(()=>{switch(l.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),g=e.ref(String(l.modelValue??""));e.watch(()=>l.modelValue,v=>{const K=String(v??"");K!==g.value&&(g.value=K)});const S=e.ref(!1),B=e.ref(!1),E=v=>v.split(/(\s+)/).map(K=>{if(K.trim()==="")return K;const re=K.toLowerCase();return re.charAt(0).toUpperCase()+re.slice(1)}).join(""),_=v=>{const K=v.toLowerCase(),re=K.search(new RegExp("\\p{L}","u"));return re<0?K:K.slice(0,re)+K.charAt(re).toUpperCase()+K.slice(re+1)},w=v=>{switch(l.textCase){case"uppercase":return v.toUpperCase();case"lowercase":return v.toLowerCase();case"titlecase":return E(v);case"sentencecase":return _(v);case"none":default:return v}},y=v=>{if(!v)return null;const K=Array.isArray(v)?v.join(""):v;return K?new Set(K):null},b=e.computed(()=>y(l.allowChars)),C=(v,K)=>(v.lastIndex=0,v.test(K)),V=v=>{var Xe;const K=(Xe=l.valueType)==null?void 0:Xe.toLowerCase();if(K==="free"||K==="email"||K==="password")return!0;const re=v===" ",_e=/\d/.test(v),Re=new RegExp("\\p{L}","u").test(v),ze=new RegExp("\\p{N}","u").test(v),He=/[\/\-_.,]/.test(v);return K==="number"?_e:K==="letter"?Re||He||l.allowSpaces&&re:K==="letternumber"?Re||ze||He||l.allowSpaces&&re:!0},D=v=>{let K="";for(const re of v){const _e=!!b.value&&b.value.has(re);l.pattern&&!_e&&!C(l.pattern,re)||!_e&&!V(re)||(K+=re)}return K},N=e.computed(()=>{const v=l.maxLength??o.maxlength??o.maxLength;let K=Number.NaN;return typeof v=="number"?K=v:typeof v=="string"&&(K=Number.parseInt(v,10)),Number.isFinite(K)&&K>0?K:-1}),P=e.computed(()=>g.value.length),M=e.computed(()=>l.showCharCount?N.value>0:!1),X=v=>N.value>0?v.slice(0,N.value):v,$=v=>{const K=D(v),re=l.applyTextCaseToValue?w(K):K;return X(re)};let H=null;const J=v=>{var K;if(v==="")return null;if(((K=l.valueType)==null?void 0:K.toLowerCase())==="number"&&l.returnNumber){const re=Number(v);return Number.isFinite(re)?re:null}return v},te=v=>{g.value=v,i("update:modelValue",J(v))},T=(v,K)=>{const re=X(K);B.value=!0,v.value=re,te(re),queueMicrotask(()=>B.value=!1)},L=(v,K)=>{const re=v.selectionStart??v.value.length,_e=v.selectionEnd??v.value.length;if(N.value>0){const Re=v.value.length-(_e-re),ze=N.value-Re;if(ze<=0)return;K=K.slice(0,ze)}v.setRangeText(K,re,_e,"end"),T(v,$(v.value))},Z=v=>{var _e;if(!H||S.value||B.value||!((_e=v.inputType)!=null&&_e.startsWith("insert")))return;const K=v.data;if(K==null)return;const re=$(K);re!==K&&(v.preventDefault(),re.length>0&&L(H,re))},Q=v=>{var _e;if(!H||S.value||B.value)return;const K=((_e=v.clipboardData)==null?void 0:_e.getData("text"))??"",re=$(K);re!==K&&(v.preventDefault(),re.length>0&&L(H,re))},W=v=>{if(!H||S.value||B.value)return;const K=v.target,re=K.value??"",_e=$(re);_e===re?te(_e):T(K,_e)},ie=()=>S.value=!0,de=()=>{if(S.value=!1,!H)return;const v=H.value??"",K=$(v);K===v?te(K):T(H,K)};e.onMounted(()=>{if(H=document.getElementById(u.value),!H)return;H.addEventListener("beforeinput",Z),H.addEventListener("paste",Q),H.addEventListener("input",W),H.addEventListener("compositionstart",ie),H.addEventListener("compositionend",de);const v=H.value??"",K=$(v);K===v?te(K):T(H,K)}),e.onBeforeUnmount(()=>{H&&(H.removeEventListener("beforeinput",Z),H.removeEventListener("paste",Q),H.removeEventListener("input",W),H.removeEventListener("compositionstart",ie),H.removeEventListener("compositionend",de),H=null)});const Ce=()=>{g.value="",H&&(H.value=""),i("update:modelValue",null),i("clear")},Ne=e.computed(()=>M.value&&P.value>0),ge=e.computed(()=>`${P.value} / ${N.value}`),Y=e.computed(()=>!!l.error);return(v,K)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":l.skeleton},[l.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[c.value?(e.openBlock(),e.createElementBlock("div",yh)):e.createCommentVNode("",!0),K[1]||(K[1]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),M.value?(e.openBlock(),e.createElementBlock("div",xh,[...K[0]||(K[0]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[c.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:u.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(c.value)+" ",1),f.value?(e.openBlock(),e.createElementBlock("span",wh,"*")):e.createCommentVNode("",!0)],8,kh)):e.createCommentVNode("",!0),e.createElementVNode("div",Ch,[l.icon||l.prependInner||v.$slots["prepend-inner"]?(e.openBlock(),e.createElementBlock("div",Eh,[e.renderSlot(v.$slots,"prepend-inner",{},()=>[l.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.icon),{key:0,class:"h-4 w-4"})):l.prependInner?(e.openBlock(),e.createElementBlock("span",Bh,e.toDisplayString(l.prependInner),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("input",e.mergeProps({id:u.value,value:g.value},h.value,{placeholder:l.placeholder,style:`text-transform: ${x.value}; padding-left: ${l.icon||l.prependInner||v.$slots["prepend-inner"]?"2.5rem":"0.75rem"} !important; padding-right: ${k.value||r.value?"2.5rem":"0.75rem"} !important;`,class:["w-full h-10 flex items-center gap-2 rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600","text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",Y.value?"border-destructive focus:ring-destructive focus-visible:ring-destructive focus-visible:ring-[0.5px]":""]}),null,16,_h),r.value?(e.openBlock(),e.createElementBlock("div",Sh,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground",tabindex:"-1",onClick:s},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.value?e.unref(le.Eye):e.unref(le.EyeOff)),{class:"w-4 h-4"}))])])):e.createCommentVNode("",!0),k.value&&!r.value?(e.openBlock(),e.createElementBlock("div",Vh,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-lg leading-none","aria-label":"Clear input",onClick:Ce}," ✕ ")])):e.createCommentVNode("",!0),Ne.value&&!Y.value?(e.openBlock(),e.createElementBlock("p",Ah,e.toDisplayString(ge.value),1)):e.createCommentVNode("",!0)]),Y.value?(e.openBlock(),e.createElementBlock("p",Dh,e.toDisplayString(l.error),1)):e.createCommentVNode("",!0)],64))],10,bh)),[[e.vShow,t.visible]])}}),Nh={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},Mh={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Th={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},Ph={class:"flex items-center justify-between"},Oh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},vh={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-neutral-600 dark:text-neutral-400 border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm"},Fh={class:"p-6 flex-1"},zh={class:"flex flex-col gap-4"},Rh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ih={class:"dcode-card h-full flex flex-col border border-neutral-200/60 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 rounded-xl overflow-hidden"},Lh={class:"p-4 border-b border-neutral-200/60 dark:border-neutral-700/30 bg-neutral-50 dark:bg-neutral-900/10"},$h={class:"flex items-center justify-between"},jh={class:"font-display font-semibold text-neutral-900 dark:text-neutral-100 flex items-center gap-2"},Uh={class:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-white dark:bg-neutral-800 text-primary-600 dark:text-primary-400 border border-primary-100 dark:border-primary-900/30 shadow-sm"},Wh={class:"p-6 flex-1"},Hh={class:"flex flex-col gap-4"},qh={key:0,class:"text-center py-8 text-neutral-400 dark:text-neutral-500 italic text-sm"},Ka=e.defineComponent({name:"DCodeListLabels",__name:"DCodeListLabels",props:{dataBefore:{},dataAfter:{}},setup(t){const{t:n}=vt.useI18n(),o=t,r=c=>{if(!c)return{};if(typeof c=="string")try{if(c.trim().startsWith("{")||c.trim().startsWith("["))return JSON.parse(c)}catch(d){return console.error("Failed to parse data string:",d),{raw:c}}return typeof c=="object"&&c!==null?c:{value:c}},a=e.computed(()=>r(o.dataBefore)),s=e.computed(()=>r(o.dataAfter)),i=c=>c.replaceAll(/([A-Z])/g," $1").replace(/^./,d=>d.toUpperCase()).trim(),l=c=>c==null?"-":typeof c=="boolean"?n(c?"common.yes":"common.no"):typeof c=="object"?JSON.stringify(c):String(c);return(c,d)=>(e.openBlock(),e.createElementBlock("div",Nh,[e.createElementVNode("div",Mh,[e.createElementVNode("div",Th,[e.createElementVNode("div",Ph,[e.createElementVNode("h3",Oh,[d[0]||(d[0]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-danger-500 shadow-[0_0_8px_rgba(239,68,68,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataBefore")),1)]),e.createElementVNode("span",vh,e.toDisplayString(e.unref(n)("beforeAfter.original")),1)])]),e.createElementVNode("div",Fh,[e.createElementVNode("div",zh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(u,f)=>(e.openBlock(),e.createBlock(ao,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(a.value).length===0?(e.openBlock(),e.createElementBlock("div",Rh)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",Ih,[e.createElementVNode("div",Lh,[e.createElementVNode("div",$h,[e.createElementVNode("h3",jh,[d[1]||(d[1]=e.createElementVNode("span",{class:"w-2 h-2 rounded-full bg-success-500 shadow-[0_0_8px_rgba(34,197,94,0.5)]"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(n)("beforeAfter.dataAfter")),1)]),e.createElementVNode("span",Uh,e.toDisplayString(e.unref(n)("beforeAfter.modified")),1)])]),e.createElementVNode("div",Wh,[e.createElementVNode("div",Hh,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,(u,f)=>(e.openBlock(),e.createBlock(ao,{key:f,"model-value":l(u),label:i(String(f)),disabled:"",variant:"underlined",class:"w-full"},null,8,["model-value","label"]))),128)),Object.keys(s.value).length===0?(e.openBlock(),e.createElementBlock("div",qh,e.toDisplayString(e.unref(n)("beforeAfter.noModifiedData")),1)):e.createCommentVNode("",!0)])])])]))}});/*!
|
|
2
2
|
* @kurkle/color v0.3.4
|
|
3
3
|
* https://github.com/kurkle/color#readme
|
|
4
4
|
* (c) 2024 Jukka Kurkela
|
|
5
5
|
* Released under the MIT License
|
|
6
|
-
*/function
|
|
6
|
+
*/function Po(t){return t+.5|0}const _n=(t,n,o)=>Math.max(Math.min(t,o),n);function Oo(t){return _n(Po(t*2.55),0,255)}function Sn(t){return _n(Po(t*255),0,255)}function ln(t){return _n(Po(t/2.55)/100,0,1)}function yl(t){return _n(Po(t*100),0,100)}const Ft={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},Ya=[..."0123456789ABCDEF"],Gh=t=>Ya[t&15],Xh=t=>Ya[(t&240)>>4]+Ya[t&15],Cr=t=>(t&240)>>4===(t&15),Kh=t=>Cr(t.r)&&Cr(t.g)&&Cr(t.b)&&Cr(t.a);function Yh(t){var n=t.length,o;return t[0]==="#"&&(n===4||n===5?o={r:255&Ft[t[1]]*17,g:255&Ft[t[2]]*17,b:255&Ft[t[3]]*17,a:n===5?Ft[t[4]]*17:255}:(n===7||n===9)&&(o={r:Ft[t[1]]<<4|Ft[t[2]],g:Ft[t[3]]<<4|Ft[t[4]],b:Ft[t[5]]<<4|Ft[t[6]],a:n===9?Ft[t[7]]<<4|Ft[t[8]]:255})),o}const Jh=(t,n)=>t<255?n(t):"";function Qh(t){var n=Kh(t)?Gh:Xh;return t?"#"+n(t.r)+n(t.g)+n(t.b)+Jh(t.a,n):void 0}const Zh=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function xl(t,n,o){const r=n*Math.min(o,1-o),a=(s,i=(s+t/30)%12)=>o-r*Math.max(Math.min(i-3,9-i,1),-1);return[a(0),a(8),a(4)]}function ep(t,n,o){const r=(a,s=(a+t/60)%6)=>o-o*n*Math.max(Math.min(s,4-s,1),0);return[r(5),r(3),r(1)]}function tp(t,n,o){const r=xl(t,1,.5);let a;for(n+o>1&&(a=1/(n+o),n*=a,o*=a),a=0;a<3;a++)r[a]*=1-n-o,r[a]+=n;return r}function np(t,n,o,r,a){return t===a?(n-o)/r+(n<o?6:0):n===a?(o-t)/r+2:(t-n)/r+4}function Ja(t){const o=t.r/255,r=t.g/255,a=t.b/255,s=Math.max(o,r,a),i=Math.min(o,r,a),l=(s+i)/2;let c,d,u;return s!==i&&(u=s-i,d=l>.5?u/(2-s-i):u/(s+i),c=np(o,r,a,u,s),c=c*60+.5),[c|0,d||0,l]}function Qa(t,n,o,r){return(Array.isArray(n)?t(n[0],n[1],n[2]):t(n,o,r)).map(Sn)}function Za(t,n,o){return Qa(xl,t,n,o)}function op(t,n,o){return Qa(tp,t,n,o)}function rp(t,n,o){return Qa(ep,t,n,o)}function kl(t){return(t%360+360)%360}function ap(t){const n=Zh.exec(t);let o=255,r;if(!n)return;n[5]!==r&&(o=n[6]?Oo(+n[5]):Sn(+n[5]));const a=kl(+n[2]),s=+n[3]/100,i=+n[4]/100;return n[1]==="hwb"?r=op(a,s,i):n[1]==="hsv"?r=rp(a,s,i):r=Za(a,s,i),{r:r[0],g:r[1],b:r[2],a:o}}function sp(t,n){var o=Ja(t);o[0]=kl(o[0]+n),o=Za(o),t.r=o[0],t.g=o[1],t.b=o[2]}function ip(t){if(!t)return;const n=Ja(t),o=n[0],r=yl(n[1]),a=yl(n[2]);return t.a<255?`hsla(${o}, ${r}%, ${a}%, ${ln(t.a)})`:`hsl(${o}, ${r}%, ${a}%)`}const wl={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"},Cl={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 lp(){const t={},n=Object.keys(Cl),o=Object.keys(wl);let r,a,s,i,l;for(r=0;r<n.length;r++){for(i=l=n[r],a=0;a<o.length;a++)s=o[a],l=l.replace(s,wl[s]);s=parseInt(Cl[i],16),t[l]=[s>>16&255,s>>8&255,s&255]}return t}let Er;function cp(t){Er||(Er=lp(),Er.transparent=[0,0,0,0]);const n=Er[t.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}const dp=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function up(t){const n=dp.exec(t);let o=255,r,a,s;if(n){if(n[7]!==r){const i=+n[7];o=n[8]?Oo(i):_n(i*255,0,255)}return r=+n[1],a=+n[3],s=+n[5],r=255&(n[2]?Oo(r):_n(r,0,255)),a=255&(n[4]?Oo(a):_n(a,0,255)),s=255&(n[6]?Oo(s):_n(s,0,255)),{r,g:a,b:s,a:o}}}function fp(t){return t&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${ln(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`)}const es=t=>t<=.0031308?t*12.92:Math.pow(t,1/2.4)*1.055-.055,so=t=>t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4);function mp(t,n,o){const r=so(ln(t.r)),a=so(ln(t.g)),s=so(ln(t.b));return{r:Sn(es(r+o*(so(ln(n.r))-r))),g:Sn(es(a+o*(so(ln(n.g))-a))),b:Sn(es(s+o*(so(ln(n.b))-s))),a:t.a+o*(n.a-t.a)}}function Br(t,n,o){if(t){let r=Ja(t);r[n]=Math.max(0,Math.min(r[n]+r[n]*o,n===0?360:1)),r=Za(r),t.r=r[0],t.g=r[1],t.b=r[2]}}function El(t,n){return t&&Object.assign(n||{},t)}function Bl(t){var n={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(n={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(n.a=Sn(t[3]))):(n=El(t,{r:0,g:0,b:0,a:1}),n.a=Sn(n.a)),n}function hp(t){return t.charAt(0)==="r"?up(t):ap(t)}class vo{constructor(n){if(n instanceof vo)return n;const o=typeof n;let r;o==="object"?r=Bl(n):o==="string"&&(r=Yh(n)||cp(n)||hp(n)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var n=El(this._rgb);return n&&(n.a=ln(n.a)),n}set rgb(n){this._rgb=Bl(n)}rgbString(){return this._valid?fp(this._rgb):void 0}hexString(){return this._valid?Qh(this._rgb):void 0}hslString(){return this._valid?ip(this._rgb):void 0}mix(n,o){if(n){const r=this.rgb,a=n.rgb;let s;const i=o===s?.5:o,l=2*i-1,c=r.a-a.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;s=1-d,r.r=255&d*r.r+s*a.r+.5,r.g=255&d*r.g+s*a.g+.5,r.b=255&d*r.b+s*a.b+.5,r.a=i*r.a+(1-i)*a.a,this.rgb=r}return this}interpolate(n,o){return n&&(this._rgb=mp(this._rgb,n._rgb,o)),this}clone(){return new vo(this.rgb)}alpha(n){return this._rgb.a=Sn(n),this}clearer(n){const o=this._rgb;return o.a*=1-n,this}greyscale(){const n=this._rgb,o=Po(n.r*.3+n.g*.59+n.b*.11);return n.r=n.g=n.b=o,this}opaquer(n){const o=this._rgb;return o.a*=1+n,this}negate(){const n=this._rgb;return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,this}lighten(n){return Br(this._rgb,2,n),this}darken(n){return Br(this._rgb,2,-n),this}saturate(n){return Br(this._rgb,1,n),this}desaturate(n){return Br(this._rgb,1,-n),this}rotate(n){return sp(this._rgb,n),this}}/*!
|
|
7
7
|
* Chart.js v4.5.1
|
|
8
8
|
* https://www.chartjs.org
|
|
9
9
|
* (c) 2025 Chart.js Contributors
|
|
10
10
|
* Released under the MIT License
|
|
11
|
-
*/function pn(){}const mp=(()=>{let t=0;return()=>t++})();function qe(t){return t==null}function ht(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Le(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function kt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function nn(t,n){return kt(t)?t:n}function Oe(t,n){return typeof t>"u"?n:t}const pp=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,Sl=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function at(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Je(t,n,o,r){let a,s,i;if(ht(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Le(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function _r(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function Sr(t){if(ht(t))return t.map(Sr);if(Le(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Sr(t[o[a]]);return n}return t}function Al(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function gp(t,n,o,r){if(!Al(t))return;const a=n[t],s=o[t];Le(a)&&Le(s)?zo(a,s,r):n[t]=Sr(s)}function zo(t,n,o){const r=ht(n)?n:[n],a=r.length;if(!Le(t))return t;o=o||{};const s=o.merger||gp;let i;for(let l=0;l<a;++l){if(i=r[l],!Le(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function Io(t,n){return zo(t,n,{merger:bp})}function bp(t,n,o){if(!Al(t))return;const r=n[t],a=o[t];Le(r)&&Le(a)?Io(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Sr(a))}const Vl={"":t=>t,x:t=>t.x,y:t=>t.y};function yp(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function xp(t){const n=yp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function Wn(t,n){return(Vl[n]||(Vl[n]=xp(n)))(t)}function ts(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ro=t=>typeof t<"u",Nn=t=>typeof t=="function",Dl=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function kp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Qe=Math.PI,it=2*Qe,wp=it+Qe,Ar=Number.POSITIVE_INFINITY,Cp=Qe/180,gt=Qe/2,Hn=Qe/4,Nl=Qe*2/3,Ml=Math.log10,on=Math.sign;function Lo(t,n,o){return Math.abs(t-n)<o}function vl(t){const n=Math.round(t);t=Lo(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(Ml(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function Ep(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function Bp(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function $o(t){return!Bp(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function _p(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function Sp(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function gn(t){return t*(Qe/180)}function Ap(t){return t*(180/Qe)}function Pl(t){if(!kt(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function Tl(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*Qe&&(s+=it),{angle:s,distance:a}}function ns(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function Vp(t,n){return(t-n+wp)%it-Qe}function Ft(t){return(t%it+it)%it}function jo(t,n,o,r){const a=Ft(t),s=Ft(n),i=Ft(o),l=Ft(s-a),c=Ft(i-a),d=Ft(a-s),u=Ft(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function wt(t,n,o){return Math.max(n,Math.min(o,t))}function Dp(t){return wt(t,-32768,32767)}function bn(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function os(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const qn=(t,n,o,r)=>os(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),Np=(t,n,o)=>os(t,o,r=>t[r][n]>=o);function Mp(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const Ol=["push","pop","shift","splice","unshift"];function vp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),Ol.forEach(o=>{const r="_onData"+ts(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function Fl(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(Ol.forEach(s=>{delete t[s]}),delete t._chartjs)}function zl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const Il=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Rl(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,Il.call(window,()=>{r=!1,t.apply(n,o)}))}}function Pp(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const rs=t=>t==="start"?"left":t==="end"?"right":"center",Ct=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,Tp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Op(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:f,max:h,minDefined:m,maxDefined:g}=i.getUserBounds();if(m){if(a=Math.min(qn(c,u,f).lo,o?r:qn(n,u,i.getPixelForValue(f)).lo),d){const k=c.slice(0,a+1).reverse().findIndex(y=>!qe(y[l.axis]));a-=Math.max(0,k)}a=wt(a,0,r-1)}if(g){let k=Math.max(qn(c,i.axis,h,!0).hi+1,o?0:qn(n,u,i.getPixelForValue(h),!0).hi+1);if(d){const y=c.slice(k-1).findIndex(p=>!qe(p[l.axis]));k+=Math.max(0,y)}s=wt(k,a,r)-a}else s=r-a}return{start:a,count:s}}function Fp(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const Vr=t=>t===0||t===1,Ll=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*it/o)),$l=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*it/o)+1,Uo={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*gt)+1,easeOutSine:t=>Math.sin(t*gt),easeInOutSine:t=>-.5*(Math.cos(Qe*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=>Vr(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=>Vr(t)?t:Ll(t,.075,.3),easeOutElastic:t=>Vr(t)?t:$l(t,.075,.3),easeInOutElastic(t){return Vr(t)?t:t<.5?.5*Ll(t*2,.1125,.45):.5+.5*$l(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-Uo.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?Uo.easeInBounce(t*2)*.5:Uo.easeOutBounce(t*2-1)*.5+.5};function as(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function jl(t){return as(t)?t:new Fo(t)}function ss(t){return as(t)?t:new Fo(t).saturate(.5).darken(.1).hexString()}const zp=["x","y","borderWidth","radius","tension"],Ip=["color","borderColor","backgroundColor"];function Rp(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:Ip},numbers:{type:"number",properties:zp}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function Lp(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ul=new Map;function $p(t,n){n=n||{};const o=t+JSON.stringify(n);let r=Ul.get(o);return r||(r=new Intl.NumberFormat(t,n),Ul.set(o,r)),r}function is(t,n,o){return $p(n,o).format(t)}const jp={values(t){return ht(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(a="scientific"),s=Up(t,o)}const i=Ml(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),is(t,r,c)}};function Up(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var Wl={formatters:jp};function Wp(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,o)=>o.lineWidth,tickColor:(n,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Wl.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const Gn=Object.create(null),ls=Object.create(null);function Wo(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function cs(t,n,o){return typeof n=="string"?zo(Wo(t,n),o):zo(Wo(t,""),n)}class Hp{constructor(n,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,a)=>ss(a.backgroundColor),this.hoverBorderColor=(r,a)=>ss(a.borderColor),this.hoverColor=(r,a)=>ss(a.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(o)}set(n,o){return cs(this,n,o)}get(n){return Wo(this,n)}describe(n,o){return cs(ls,n,o)}override(n,o){return cs(Gn,n,o)}route(n,o,r,a){const s=Wo(this,n),i=Wo(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return Le(c)?Object.assign({},d,c):Oe(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var dt=new Hp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Rp,Lp,Wp]);function qp(t){return!t||qe(t.size)||qe(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Hl(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function Xn(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function ql(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function ds(t,n,o,r){Gl(t,n,o,r,null)}function Gl(t,n,o,r,a){let s,i,l,c,d,u,f,h;const m=n.pointStyle,g=n.rotation,k=n.radius;let y=(g||0)*Cp;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(y),t.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),t.restore();return}if(!(isNaN(k)||k<=0)){switch(t.beginPath(),m){default:a?t.ellipse(o,r,a/2,k,0,0,it):t.arc(o,r,k,0,it),t.closePath();break;case"triangle":u=a?a/2:k,t.moveTo(o+Math.sin(y)*u,r-Math.cos(y)*k),y+=Nl,t.lineTo(o+Math.sin(y)*u,r-Math.cos(y)*k),y+=Nl,t.lineTo(o+Math.sin(y)*u,r-Math.cos(y)*k),t.closePath();break;case"rectRounded":d=k*.516,c=k-d,i=Math.cos(y+Hn)*c,f=Math.cos(y+Hn)*(a?a/2-d:c),l=Math.sin(y+Hn)*c,h=Math.sin(y+Hn)*(a?a/2-d:c),t.arc(o-f,r-l,d,y-Qe,y-gt),t.arc(o+h,r-i,d,y-gt,y),t.arc(o+f,r+l,d,y,y+gt),t.arc(o-h,r+i,d,y+gt,y+Qe),t.closePath();break;case"rect":if(!g){c=Math.SQRT1_2*k,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}y+=Hn;case"rectRot":f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+h,r-i),t.lineTo(o+f,r+l),t.lineTo(o-h,r+i),t.closePath();break;case"crossRot":y+=Hn;case"cross":f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"star":f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i),y+=Hn,f=Math.cos(y)*(a?a/2:k),i=Math.cos(y)*k,l=Math.sin(y)*k,h=Math.sin(y)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+h,r-i),t.lineTo(o-h,r+i);break;case"line":i=a?a/2:Math.cos(y)*k,l=Math.sin(y)*k,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(y)*(a?a/2:k),r+Math.sin(y)*k);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function Ho(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function Dr(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function Nr(t){t.restore()}function Gp(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function Xp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Kp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),qe(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function Yp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Jp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function qo(t,n,o,r,a,s={}){const i=ht(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Kp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Jp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),qe(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Yp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function Mr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*Qe,Qe,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Qe,gt,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,gt,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-gt,!0),t.lineTo(o+i.topLeft,r)}const Qp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Zp=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function eg(t,n){const o=(""+t).match(Qp);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const tg=t=>+t||0;function us(t,n){const o={},r=Le(n),a=r?Object.keys(n):n,s=Le(t)?r?i=>Oe(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=tg(s(i));return o}function Xl(t){return us(t,{top:"y",right:"x",bottom:"y",left:"x"})}function uo(t){return us(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ut(t){const n=Xl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Et(t,n){t=t||{},n=n||dt.font;let o=Oe(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=Oe(t.style,n.style);r&&!(""+r).match(Zp)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:Oe(t.family,n.family),lineHeight:eg(Oe(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:Oe(t.weight,n.weight),string:""};return a.string=qp(a),a}function vr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function ng(t,n,o){const{min:r,max:a}=t,s=Sl(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Kn(t,n){return Object.assign(Object.create(t),n)}function fs(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Zl("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>fs([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return Yl(l,c,()=>dg(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return ec(l).includes(c)},ownKeys(l){return ec(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function fo(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Kl(t,r),setContext:s=>fo(t,s,o,r),override:s=>fo(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return Yl(s,i,()=>rg(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 Kl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:Nn(o)?o:()=>o,isIndexable:Nn(r)?r:()=>r}}const og=(t,n)=>t?t+ts(n):n,hs=(t,n)=>Le(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function Yl(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function rg(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return Nn(l)&&i.isScriptable(n)&&(l=ag(n,l,t,o)),ht(l)&&l.length&&(l=sg(n,l,t,i.isIndexable)),hs(n,l)&&(l=fo(l,a,s&&s[n],i)),l}function ag(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),hs(t,c)&&(c=ms(a._scopes,a,t,c)),c}function sg(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(Le(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=ms(d,a,t,u);n.push(fo(f,s,i&&i[t],l))}}return n}function Jl(t,n,o){return Nn(t)?t(n,o):t}const ig=(t,n)=>t===!0?n:typeof t=="string"?Wn(n,t):void 0;function lg(t,n,o,r,a){for(const s of n){const i=ig(o,s);if(i){t.add(i);const l=Jl(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function ms(t,n,o,r){const a=n._rootScopes,s=Jl(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Ql(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Ql(l,i,s,c,r),c===null)?!1:fs(Array.from(l),[""],a,s,()=>cg(n,o,r))}function Ql(t,n,o,r,a){for(;o;)o=lg(t,n,o,r,a);return o}function cg(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return ht(a)&&Le(o)?o:a||{}}function dg(t,n,o,r){let a;for(const s of n)if(a=Zl(og(s,t),o),typeof a<"u")return hs(t,a)?ms(o,r,t,a):a}function Zl(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function ec(t){let n=t._keys;return n||(n=t._keys=ug(t._scopes)),n}function ug(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const fg=Number.EPSILON||1e-14,ho=(t,n)=>n<t.length&&!t[n].skip&&t[n],tc=t=>t==="x"?"y":"x";function hg(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=ns(s,a),c=ns(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=r*d,h=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+h*(i.x-a.x),y:s.y+h*(i.y-a.y)}}}function mg(t,n,o){const r=t.length;let a,s,i,l,c,d=ho(t,0);for(let u=0;u<r-1;++u)if(c=d,d=ho(t,u+1),!(!c||!d)){if(Lo(n[u],0,fg)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function pg(t,n,o="x"){const r=tc(o),a=t.length;let s,i,l,c=ho(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=ho(t,d+1),!l)continue;const u=l[o],f=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=f+s*n[d])}}function gg(t,n="x"){const o=tc(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=ho(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=ho(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?on(a[i-1])!==on(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}mg(t,a,s),pg(t,s,n)}function Pr(t,n,o){return Math.max(Math.min(t,o),n)}function bg(t,n){let o,r,a,s,i,l=Ho(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&Ho(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=Pr(a.cp1x,n.left,n.right),a.cp1y=Pr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=Pr(a.cp2x,n.left,n.right),a.cp2y=Pr(a.cp2y,n.top,n.bottom)))}function yg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")gg(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=hg(d,l,t[Math.min(s+1,i-(r?0:1))%i],n.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}n.capBezierPoints&&bg(t,o)}function ps(){return typeof window<"u"&&typeof document<"u"}function gs(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function Tr(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const Or=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function xg(t,n){return Or(t).getPropertyValue(n)}const kg=["top","right","bottom","left"];function Yn(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=kg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const wg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function Cg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(wg(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function Jn(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=Or(o),s=a.boxSizing==="border-box",i=Yn(a,"padding"),l=Yn(a,"border","width"),{x:c,y:d,box:u}=Cg(t,o),f=i.left+(u&&l.left),h=i.top+(u&&l.top);let{width:m,height:g}=n;return s&&(m-=i.width+l.width,g-=i.height+l.height),{x:Math.round((c-f)/m*o.width/r),y:Math.round((d-h)/g*o.height/r)}}function Eg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&gs(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=Or(s),c=Yn(l,"border","width"),d=Yn(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=Tr(l.maxWidth,s,"clientWidth"),a=Tr(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||Ar,maxHeight:a||Ar}}const Mn=t=>Math.round(t*10)/10;function Bg(t,n,o,r){const a=Or(t),s=Yn(a,"margin"),i=Tr(a.maxWidth,t,"clientWidth")||Ar,l=Tr(a.maxHeight,t,"clientHeight")||Ar,c=Eg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const h=Yn(a,"border","width"),m=Yn(a,"padding");d-=m.width+h.width,u-=m.height+h.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=Mn(Math.min(d,i,c.maxWidth)),u=Mn(Math.min(u,l,c.maxHeight)),d&&!u&&(u=Mn(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=Mn(Math.floor(u*r))),{width:d,height:u}}function nc(t,n,o){const r=n||1,a=Mn(t.height*r),s=Mn(t.width*r);t.height=Mn(t.height),t.width=Mn(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const _g=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};ps()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function oc(t,n){const o=xg(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Qn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function Sg(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function Ag(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Qn(t,a,o),l=Qn(a,s,o),c=Qn(s,n,o),d=Qn(i,l,o),u=Qn(l,c,o);return Qn(d,u,o)}const Vg=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},Dg=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function mo(t,n,o){return t?Vg(n,o):Dg()}function rc(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function ac(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function sc(t){return t==="angle"?{between:jo,compare:Vp,normalize:Ft}:{between:bn,compare:(n,o)=>n-o,normalize:n=>n}}function ic({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function Ng(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=sc(r),c=n.length;let{start:d,end:u,loop:f}=t,h,m;if(f){for(d+=c,u+=c,h=0,m=c;h<m&&i(l(n[d%c][r]),a,s);++h)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function lc(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=sc(r),{start:u,end:f,loop:h,style:m}=Ng(t,n,o),g=[];let k=!1,y=null,p,E,_;const B=()=>c(a,_,p)&&l(a,_)!==0,S=()=>l(s,p)===0||c(s,_,p),w=()=>k||B(),x=()=>!k||S();for(let b=u,A=u;b<=f;++b)E=n[b%i],!E.skip&&(p=d(E[r]),p!==_&&(k=c(p,a,s),y===null&&w()&&(y=l(p,a)===0?b:A),y!==null&&x()&&(g.push(ic({start:y,end:b,loop:h,count:i,style:m})),y=null),A=b,_=p));return y!==null&&g.push(ic({start:y,end:f,loop:h,count:i,style:m})),g}function cc(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=lc(r[a],t.points,n);s.length&&o.push(...s)}return o}function Mg(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function vg(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function Pg(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=Mg(o,a,s,r);if(r===!0)return dc(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return dc(t,vg(o,i,c,d),o,n)}function dc(t,n,o,r){return!r||!r.setContext||!o?n:Tg(t,n,o,r)}function Tg(t,n,o,r){const a=t._chart.getContext(),s=uc(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,h=f;function m(g,k,y,p){const E=l?-1:1;if(g!==k){for(g+=c;o[g%c].skip;)g-=E;for(;o[k%c].skip;)k+=E;g%c!==k%c&&(d.push({start:g%c,end:k%c,loop:y,style:p}),u=p,f=k%c)}}for(const g of n){f=l?f:g.start;let k=o[f%c],y;for(h=f+1;h<=g.end;h++){const p=o[h%c];y=uc(r.setContext(Kn(a,{type:"segment",p0:k,p1:p,p0DataIndex:(h-1)%c,p1DataIndex:h%c,datasetIndex:i}))),Og(y,u)&&m(f,h-1,g.loop,u),k=p,u=y}f<h-1&&m(f,h-1,g.loop,u)}return d}function uc(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Og(t,n){if(!n)return!1;const o=[],r=function(a,s){return as(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function Fr(t,n,o){return t.options.clip?t[o]:n[o]}function Fg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:Fr(o,n,"left"),right:Fr(o,n,"right"),top:Fr(r,n,"top"),bottom:Fr(r,n,"bottom")}:n}function fc(t,n){const o=n._clip;if(o.disabled)return!1;const r=Fg(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.bottom+(o.bottom===!0?0:o.bottom)}}/*!
|
|
11
|
+
*/function cn(){}const pp=(()=>{let t=0;return()=>t++})();function Ge(t){return t==null}function dt(t){if(Array.isArray&&Array.isArray(t))return!0;const n=Object.prototype.toString.call(t);return n.slice(0,7)==="[object"&&n.slice(-6)==="Array]"}function Fe(t){return t!==null&&Object.prototype.toString.call(t)==="[object Object]"}function bt(t){return(typeof t=="number"||t instanceof Number)&&isFinite(+t)}function Kt(t,n){return bt(t)?t:n}function Te(t,n){return typeof t>"u"?n:t}const gp=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100:+t/n,_l=(t,n)=>typeof t=="string"&&t.endsWith("%")?parseFloat(t)/100*n:+t;function nt(t,n,o){if(t&&typeof t.call=="function")return t.apply(o,n)}function Ye(t,n,o,r){let a,s,i;if(dt(t))for(s=t.length,a=0;a<s;a++)n.call(o,t[a],a);else if(Fe(t))for(i=Object.keys(t),s=i.length,a=0;a<s;a++)n.call(o,t[i[a]],i[a])}function _r(t,n){let o,r,a,s;if(!t||!n||t.length!==n.length)return!1;for(o=0,r=t.length;o<r;++o)if(a=t[o],s=n[o],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function Sr(t){if(dt(t))return t.map(Sr);if(Fe(t)){const n=Object.create(null),o=Object.keys(t),r=o.length;let a=0;for(;a<r;++a)n[o[a]]=Sr(t[o[a]]);return n}return t}function Sl(t){return["__proto__","prototype","constructor"].indexOf(t)===-1}function bp(t,n,o,r){if(!Sl(t))return;const a=n[t],s=o[t];Fe(a)&&Fe(s)?Fo(a,s,r):n[t]=Sr(s)}function Fo(t,n,o){const r=dt(n)?n:[n],a=r.length;if(!Fe(t))return t;o=o||{};const s=o.merger||bp;let i;for(let l=0;l<a;++l){if(i=r[l],!Fe(i))continue;const c=Object.keys(i);for(let d=0,u=c.length;d<u;++d)s(c[d],t,i,o)}return t}function zo(t,n){return Fo(t,n,{merger:yp})}function yp(t,n,o){if(!Sl(t))return;const r=n[t],a=o[t];Fe(r)&&Fe(a)?zo(r,a):Object.prototype.hasOwnProperty.call(n,t)||(n[t]=Sr(a))}const Vl={"":t=>t,x:t=>t.x,y:t=>t.y};function xp(t){const n=t.split("."),o=[];let r="";for(const a of n)r+=a,r.endsWith("\\")?r=r.slice(0,-1)+".":(o.push(r),r="");return o}function kp(t){const n=xp(t);return o=>{for(const r of n){if(r==="")break;o=o&&o[r]}return o}}function jn(t,n){return(Vl[n]||(Vl[n]=kp(n)))(t)}function ts(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Ro=t=>typeof t<"u",Vn=t=>typeof t=="function",Al=(t,n)=>{if(t.size!==n.size)return!1;for(const o of t)if(!n.has(o))return!1;return!0};function wp(t){return t.type==="mouseup"||t.type==="click"||t.type==="contextmenu"}const Je=Math.PI,rt=2*Je,Cp=rt+Je,Vr=Number.POSITIVE_INFINITY,Ep=Je/180,ft=Je/2,Un=Je/4,Dl=Je*2/3,Nl=Math.log10,Yt=Math.sign;function Io(t,n,o){return Math.abs(t-n)<o}function Ml(t){const n=Math.round(t);t=Io(t,n,t/1e3)?n:t;const o=Math.pow(10,Math.floor(Nl(t))),r=t/o;return(r<=1?1:r<=2?2:r<=5?5:10)*o}function Bp(t){const n=[],o=Math.sqrt(t);let r;for(r=1;r<o;r++)t%r===0&&(n.push(r),n.push(t/r));return o===(o|0)&&n.push(o),n.sort((a,s)=>a-s).pop(),n}function _p(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}function Lo(t){return!_p(t)&&!isNaN(parseFloat(t))&&isFinite(t)}function Sp(t,n){const o=Math.round(t);return o-n<=t&&o+n>=t}function Vp(t,n,o){let r,a,s;for(r=0,a=t.length;r<a;r++)s=t[r][o],isNaN(s)||(n.min=Math.min(n.min,s),n.max=Math.max(n.max,s))}function dn(t){return t*(Je/180)}function Ap(t){return t*(180/Je)}function Tl(t){if(!bt(t))return;let n=1,o=0;for(;Math.round(t*n)/n!==t;)n*=10,o++;return o}function Pl(t,n){const o=n.x-t.x,r=n.y-t.y,a=Math.sqrt(o*o+r*r);let s=Math.atan2(r,o);return s<-.5*Je&&(s+=rt),{angle:s,distance:a}}function ns(t,n){return Math.sqrt(Math.pow(n.x-t.x,2)+Math.pow(n.y-t.y,2))}function Dp(t,n){return(t-n+Cp)%rt-Je}function Nt(t){return(t%rt+rt)%rt}function $o(t,n,o,r){const a=Nt(t),s=Nt(n),i=Nt(o),l=Nt(s-a),c=Nt(i-a),d=Nt(a-s),u=Nt(a-i);return a===s||a===i||r&&s===i||l>c&&d<u}function yt(t,n,o){return Math.max(n,Math.min(o,t))}function Np(t){return yt(t,-32768,32767)}function un(t,n,o,r=1e-6){return t>=Math.min(n,o)-r&&t<=Math.max(n,o)+r}function os(t,n,o){o=o||(i=>t[i]<n);let r=t.length-1,a=0,s;for(;r-a>1;)s=a+r>>1,o(s)?a=s:r=s;return{lo:a,hi:r}}const Wn=(t,n,o,r)=>os(t,o,r?a=>{const s=t[a][n];return s<o||s===o&&t[a+1][n]===o}:a=>t[a][n]<o),Mp=(t,n,o)=>os(t,o,r=>t[r][n]>=o);function Tp(t,n,o){let r=0,a=t.length;for(;r<a&&t[r]<n;)r++;for(;a>r&&t[a-1]>o;)a--;return r>0||a<t.length?t.slice(r,a):t}const Ol=["push","pop","shift","splice","unshift"];function Pp(t,n){if(t._chartjs){t._chartjs.listeners.push(n);return}Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),Ol.forEach(o=>{const r="_onData"+ts(o),a=t[o];Object.defineProperty(t,o,{configurable:!0,enumerable:!1,value(...s){const i=a.apply(this,s);return t._chartjs.listeners.forEach(l=>{typeof l[r]=="function"&&l[r](...s)}),i}})})}function vl(t,n){const o=t._chartjs;if(!o)return;const r=o.listeners,a=r.indexOf(n);a!==-1&&r.splice(a,1),!(r.length>0)&&(Ol.forEach(s=>{delete t[s]}),delete t._chartjs)}function Fl(t){const n=new Set(t);return n.size===t.length?t:Array.from(n)}const zl=(function(){return typeof window>"u"?function(t){return t()}:window.requestAnimationFrame})();function Rl(t,n){let o=[],r=!1;return function(...a){o=a,r||(r=!0,zl.call(window,()=>{r=!1,t.apply(n,o)}))}}function Op(t,n){let o;return function(...r){return n?(clearTimeout(o),o=setTimeout(t,n,r)):t.apply(this,r),n}}const rs=t=>t==="start"?"left":t==="end"?"right":"center",xt=(t,n,o)=>t==="start"?n:t==="end"?o:(n+o)/2,vp=(t,n,o,r)=>t===(r?"left":"right")?o:t==="center"?(n+o)/2:n;function Fp(t,n,o){const r=n.length;let a=0,s=r;if(t._sorted){const{iScale:i,vScale:l,_parsed:c}=t,d=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null,u=i.axis,{min:f,max:m,minDefined:h,maxDefined:p}=i.getUserBounds();if(h){if(a=Math.min(Wn(c,u,f).lo,o?r:Wn(n,u,i.getPixelForValue(f)).lo),d){const k=c.slice(0,a+1).reverse().findIndex(x=>!Ge(x[l.axis]));a-=Math.max(0,k)}a=yt(a,0,r-1)}if(p){let k=Math.max(Wn(c,i.axis,m,!0).hi+1,o?0:Wn(n,u,i.getPixelForValue(m),!0).hi+1);if(d){const x=c.slice(k-1).findIndex(g=>!Ge(g[l.axis]));k+=Math.max(0,x)}s=yt(k,a,r)-a}else s=r-a}return{start:a,count:s}}function zp(t){const{xScale:n,yScale:o,_scaleRanges:r}=t,a={xmin:n.min,xmax:n.max,ymin:o.min,ymax:o.max};if(!r)return t._scaleRanges=a,!0;const s=r.xmin!==n.min||r.xmax!==n.max||r.ymin!==o.min||r.ymax!==o.max;return Object.assign(r,a),s}const Ar=t=>t===0||t===1,Il=(t,n,o)=>-(Math.pow(2,10*(t-=1))*Math.sin((t-n)*rt/o)),Ll=(t,n,o)=>Math.pow(2,-10*t)*Math.sin((t-n)*rt/o)+1,jo={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*ft)+1,easeOutSine:t=>Math.sin(t*ft),easeInOutSine:t=>-.5*(Math.cos(Je*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=>Ar(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=>Ar(t)?t:Il(t,.075,.3),easeOutElastic:t=>Ar(t)?t:Ll(t,.075,.3),easeInOutElastic(t){return Ar(t)?t:t<.5?.5*Il(t*2,.1125,.45):.5+.5*Ll(t*2-1,.1125,.45)},easeInBack(t){return t*t*((1.70158+1)*t-1.70158)},easeOutBack(t){return(t-=1)*t*((1.70158+1)*t+1.70158)+1},easeInOutBack(t){let n=1.70158;return(t/=.5)<1?.5*(t*t*(((n*=1.525)+1)*t-n)):.5*((t-=2)*t*(((n*=1.525)+1)*t+n)+2)},easeInBounce:t=>1-jo.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?jo.easeInBounce(t*2)*.5:jo.easeOutBounce(t*2-1)*.5+.5};function as(t){if(t&&typeof t=="object"){const n=t.toString();return n==="[object CanvasPattern]"||n==="[object CanvasGradient]"}return!1}function $l(t){return as(t)?t:new vo(t)}function ss(t){return as(t)?t:new vo(t).saturate(.5).darken(.1).hexString()}const Rp=["x","y","borderWidth","radius","tension"],Ip=["color","borderColor","backgroundColor"];function Lp(t){t.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"}),t.set("animations",{colors:{type:"color",properties:Ip},numbers:{type:"number",properties:Rp}}),t.describe("animations",{_fallback:"animation"}),t.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}})}function $p(t){t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const jl=new Map;function jp(t,n){n=n||{};const o=t+JSON.stringify(n);let r=jl.get(o);return r||(r=new Intl.NumberFormat(t,n),jl.set(o,r)),r}function is(t,n,o){return jp(n,o).format(t)}const Up={values(t){return dt(t)?t:""+t},numeric(t,n,o){if(t===0)return"0";const r=this.chart.options.locale;let a,s=t;if(o.length>1){const d=Math.max(Math.abs(o[0].value),Math.abs(o[o.length-1].value));(d<1e-4||d>1e15)&&(a="scientific"),s=Wp(t,o)}const i=Nl(Math.abs(s)),l=isNaN(i)?1:Math.max(Math.min(-1*Math.floor(i),20),0),c={notation:a,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),is(t,r,c)}};function Wp(t,n){let o=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(o)>=1&&t!==Math.floor(t)&&(o=t-Math.floor(t)),o}var Ul={formatters:Up};function Hp(t){t.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,o)=>o.lineWidth,tickColor:(n,o)=>o.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ul.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),t.route("scale.ticks","color","","color"),t.route("scale.grid","color","","borderColor"),t.route("scale.border","color","","borderColor"),t.route("scale.title","color","","color"),t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"&&n!=="dash"}),t.describe("scales",{_fallback:"scale"}),t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"})}const Hn=Object.create(null),ls=Object.create(null);function Uo(t,n){if(!n)return t;const o=n.split(".");for(let r=0,a=o.length;r<a;++r){const s=o[r];t=t[s]||(t[s]=Object.create(null))}return t}function cs(t,n,o){return typeof n=="string"?Fo(Uo(t,n),o):Fo(Uo(t,""),n)}class qp{constructor(n,o){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,a)=>ss(a.backgroundColor),this.hoverBorderColor=(r,a)=>ss(a.borderColor),this.hoverColor=(r,a)=>ss(a.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(o)}set(n,o){return cs(this,n,o)}get(n){return Uo(this,n)}describe(n,o){return cs(ls,n,o)}override(n,o){return cs(Hn,n,o)}route(n,o,r,a){const s=Uo(this,n),i=Uo(this,r),l="_"+o;Object.defineProperties(s,{[l]:{value:s[o],writable:!0},[o]:{enumerable:!0,get(){const c=this[l],d=i[a];return Fe(c)?Object.assign({},d,c):Te(c,d)},set(c){this[l]=c}}})}apply(n){n.forEach(o=>o(this))}}var lt=new qp({_scriptable:t=>!t.startsWith("on"),_indexable:t=>t!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Lp,$p,Hp]);function Gp(t){return!t||Ge(t.size)||Ge(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Wl(t,n,o,r,a){let s=n[a];return s||(s=n[a]=t.measureText(a).width,o.push(a)),s>r&&(r=s),r}function qn(t,n,o){const r=t.currentDevicePixelRatio,a=o!==0?Math.max(o/2,.5):0;return Math.round((n-a)*r)/r+a}function Hl(t,n){!n&&!t||(n=n||t.getContext("2d"),n.save(),n.resetTransform(),n.clearRect(0,0,t.width,t.height),n.restore())}function ds(t,n,o,r){ql(t,n,o,r,null)}function ql(t,n,o,r,a){let s,i,l,c,d,u,f,m;const h=n.pointStyle,p=n.rotation,k=n.radius;let x=(p||0)*Ep;if(h&&typeof h=="object"&&(s=h.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){t.save(),t.translate(o,r),t.rotate(x),t.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),t.restore();return}if(!(isNaN(k)||k<=0)){switch(t.beginPath(),h){default:a?t.ellipse(o,r,a/2,k,0,0,rt):t.arc(o,r,k,0,rt),t.closePath();break;case"triangle":u=a?a/2:k,t.moveTo(o+Math.sin(x)*u,r-Math.cos(x)*k),x+=Dl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*k),x+=Dl,t.lineTo(o+Math.sin(x)*u,r-Math.cos(x)*k),t.closePath();break;case"rectRounded":d=k*.516,c=k-d,i=Math.cos(x+Un)*c,f=Math.cos(x+Un)*(a?a/2-d:c),l=Math.sin(x+Un)*c,m=Math.sin(x+Un)*(a?a/2-d:c),t.arc(o-f,r-l,d,x-Je,x-ft),t.arc(o+m,r-i,d,x-ft,x),t.arc(o+f,r+l,d,x,x+ft),t.arc(o-m,r+i,d,x+ft,x+Je),t.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*k,u=a?a/2:c,t.rect(o-u,r-c,2*u,2*c);break}x+=Un;case"rectRot":f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+m,r-i),t.lineTo(o+f,r+l),t.lineTo(o-m,r+i),t.closePath();break;case"crossRot":x+=Un;case"cross":f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"star":f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i),x+=Un,f=Math.cos(x)*(a?a/2:k),i=Math.cos(x)*k,l=Math.sin(x)*k,m=Math.sin(x)*(a?a/2:k),t.moveTo(o-f,r-l),t.lineTo(o+f,r+l),t.moveTo(o+m,r-i),t.lineTo(o-m,r+i);break;case"line":i=a?a/2:Math.cos(x)*k,l=Math.sin(x)*k,t.moveTo(o-i,r-l),t.lineTo(o+i,r+l);break;case"dash":t.moveTo(o,r),t.lineTo(o+Math.cos(x)*(a?a/2:k),r+Math.sin(x)*k);break;case!1:t.closePath();break}t.fill(),n.borderWidth>0&&t.stroke()}}function Wo(t,n,o){return o=o||.5,!n||t&&t.x>n.left-o&&t.x<n.right+o&&t.y>n.top-o&&t.y<n.bottom+o}function Dr(t,n){t.save(),t.beginPath(),t.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),t.clip()}function Nr(t){t.restore()}function Xp(t,n,o,r,a){if(!n)return t.lineTo(o.x,o.y);if(a==="middle"){const s=(n.x+o.x)/2;t.lineTo(s,n.y),t.lineTo(s,o.y)}else a==="after"!=!!r?t.lineTo(n.x,o.y):t.lineTo(o.x,n.y);t.lineTo(o.x,o.y)}function Kp(t,n,o,r){if(!n)return t.lineTo(o.x,o.y);t.bezierCurveTo(r?n.cp1x:n.cp2x,r?n.cp1y:n.cp2y,r?o.cp2x:o.cp1x,r?o.cp2y:o.cp1y,o.x,o.y)}function Yp(t,n){n.translation&&t.translate(n.translation[0],n.translation[1]),Ge(n.rotation)||t.rotate(n.rotation),n.color&&(t.fillStyle=n.color),n.textAlign&&(t.textAlign=n.textAlign),n.textBaseline&&(t.textBaseline=n.textBaseline)}function Jp(t,n,o,r,a){if(a.strikethrough||a.underline){const s=t.measureText(r),i=n-s.actualBoundingBoxLeft,l=n+s.actualBoundingBoxRight,c=o-s.actualBoundingBoxAscent,d=o+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;t.strokeStyle=t.fillStyle,t.beginPath(),t.lineWidth=a.decorationWidth||2,t.moveTo(i,u),t.lineTo(l,u),t.stroke()}}function Qp(t,n){const o=t.fillStyle;t.fillStyle=n.color,t.fillRect(n.left,n.top,n.width,n.height),t.fillStyle=o}function Ho(t,n,o,r,a,s={}){const i=dt(n)?n:[n],l=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(t.save(),t.font=a.string,Yp(t,s),c=0;c<i.length;++c)d=i[c],s.backdrop&&Qp(t,s.backdrop),l&&(s.strokeColor&&(t.strokeStyle=s.strokeColor),Ge(s.strokeWidth)||(t.lineWidth=s.strokeWidth),t.strokeText(d,o,r,s.maxWidth)),t.fillText(d,o,r,s.maxWidth),Jp(t,o,r,d,s),r+=Number(a.lineHeight);t.restore()}function Mr(t,n){const{x:o,y:r,w:a,h:s,radius:i}=n;t.arc(o+i.topLeft,r+i.topLeft,i.topLeft,1.5*Je,Je,!0),t.lineTo(o,r+s-i.bottomLeft),t.arc(o+i.bottomLeft,r+s-i.bottomLeft,i.bottomLeft,Je,ft,!0),t.lineTo(o+a-i.bottomRight,r+s),t.arc(o+a-i.bottomRight,r+s-i.bottomRight,i.bottomRight,ft,0,!0),t.lineTo(o+a,r+i.topRight),t.arc(o+a-i.topRight,r+i.topRight,i.topRight,0,-ft,!0),t.lineTo(o+i.topLeft,r)}const Zp=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,eg=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function tg(t,n){const o=(""+t).match(Zp);if(!o||o[1]==="normal")return n*1.2;switch(t=+o[2],o[3]){case"px":return t;case"%":t/=100;break}return n*t}const ng=t=>+t||0;function us(t,n){const o={},r=Fe(n),a=r?Object.keys(n):n,s=Fe(t)?r?i=>Te(t[i],t[n[i]]):i=>t[i]:()=>t;for(const i of a)o[i]=ng(s(i));return o}function Gl(t){return us(t,{top:"y",right:"x",bottom:"y",left:"x"})}function io(t){return us(t,["topLeft","topRight","bottomLeft","bottomRight"])}function zt(t){const n=Gl(t);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function kt(t,n){t=t||{},n=n||lt.font;let o=Te(t.size,n.size);typeof o=="string"&&(o=parseInt(o,10));let r=Te(t.style,n.style);r&&!(""+r).match(eg)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const a={family:Te(t.family,n.family),lineHeight:tg(Te(t.lineHeight,n.lineHeight),o),size:o,style:r,weight:Te(t.weight,n.weight),string:""};return a.string=Gp(a),a}function Tr(t,n,o,r){let a,s,i;for(a=0,s=t.length;a<s;++a)if(i=t[a],i!==void 0&&i!==void 0)return i}function og(t,n,o){const{min:r,max:a}=t,s=_l(n,(a-r)/2),i=(l,c)=>o&&l===0?0:l+c;return{min:i(r,-Math.abs(s)),max:i(a,s)}}function Gn(t,n){return Object.assign(Object.create(t),n)}function fs(t,n=[""],o,r,a=()=>t[0]){const s=o||t;typeof r>"u"&&(r=Ql("_fallback",t));const i={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:s,_fallback:r,_getTarget:a,override:l=>fs([l,...t],n,s,r)};return new Proxy(i,{deleteProperty(l,c){return delete l[c],delete l._keys,delete t[0][c],!0},get(l,c){return Kl(l,c,()=>ug(c,n,t,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(t[0])},has(l,c){return Zl(l).includes(c)},ownKeys(l){return Zl(l)},set(l,c,d){const u=l._storage||(l._storage=a());return l[c]=u[c]=d,delete l._keys,!0}})}function lo(t,n,o,r){const a={_cacheable:!1,_proxy:t,_context:n,_subProxy:o,_stack:new Set,_descriptors:Xl(t,r),setContext:s=>lo(t,s,o,r),override:s=>lo(t.override(s),n,o,r)};return new Proxy(a,{deleteProperty(s,i){return delete s[i],delete t[i],!0},get(s,i,l){return Kl(s,i,()=>ag(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 Xl(t,n={scriptable:!0,indexable:!0}){const{_scriptable:o=n.scriptable,_indexable:r=n.indexable,_allKeys:a=n.allKeys}=t;return{allKeys:a,scriptable:o,indexable:r,isScriptable:Vn(o)?o:()=>o,isIndexable:Vn(r)?r:()=>r}}const rg=(t,n)=>t?t+ts(n):n,ms=(t,n)=>Fe(n)&&t!=="adapters"&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function Kl(t,n,o){if(Object.prototype.hasOwnProperty.call(t,n)||n==="constructor")return t[n];const r=o();return t[n]=r,r}function ag(t,n,o){const{_proxy:r,_context:a,_subProxy:s,_descriptors:i}=t;let l=r[n];return Vn(l)&&i.isScriptable(n)&&(l=sg(n,l,t,o)),dt(l)&&l.length&&(l=ig(n,l,t,i.isIndexable)),ms(n,l)&&(l=lo(l,a,s&&s[n],i)),l}function sg(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_stack:l}=o;if(l.has(t))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+t);l.add(t);let c=n(s,i||r);return l.delete(t),ms(t,c)&&(c=hs(a._scopes,a,t,c)),c}function ig(t,n,o,r){const{_proxy:a,_context:s,_subProxy:i,_descriptors:l}=o;if(typeof s.index<"u"&&r(t))return n[s.index%n.length];if(Fe(n[0])){const c=n,d=a._scopes.filter(u=>u!==c);n=[];for(const u of c){const f=hs(d,a,t,u);n.push(lo(f,s,i&&i[t],l))}}return n}function Yl(t,n,o){return Vn(t)?t(n,o):t}const lg=(t,n)=>t===!0?n:typeof t=="string"?jn(n,t):void 0;function cg(t,n,o,r,a){for(const s of n){const i=lg(o,s);if(i){t.add(i);const l=Yl(i._fallback,o,a);if(typeof l<"u"&&l!==o&&l!==r)return l}else if(i===!1&&typeof r<"u"&&o!==r)return null}return!1}function hs(t,n,o,r){const a=n._rootScopes,s=Yl(n._fallback,o,r),i=[...t,...a],l=new Set;l.add(r);let c=Jl(l,i,o,s||o,r);return c===null||typeof s<"u"&&s!==o&&(c=Jl(l,i,s,c,r),c===null)?!1:fs(Array.from(l),[""],a,s,()=>dg(n,o,r))}function Jl(t,n,o,r,a){for(;o;)o=cg(t,n,o,r,a);return o}function dg(t,n,o){const r=t._getTarget();n in r||(r[n]={});const a=r[n];return dt(a)&&Fe(o)?o:a||{}}function ug(t,n,o,r){let a;for(const s of n)if(a=Ql(rg(s,t),o),typeof a<"u")return ms(t,a)?hs(o,r,t,a):a}function Ql(t,n){for(const o of n){if(!o)continue;const r=o[t];if(typeof r<"u")return r}}function Zl(t){let n=t._keys;return n||(n=t._keys=fg(t._scopes)),n}function fg(t){const n=new Set;for(const o of t)for(const r of Object.keys(o).filter(a=>!a.startsWith("_")))n.add(r);return Array.from(n)}const mg=Number.EPSILON||1e-14,co=(t,n)=>n<t.length&&!t[n].skip&&t[n],ec=t=>t==="x"?"y":"x";function hg(t,n,o,r){const a=t.skip?n:t,s=n,i=o.skip?n:o,l=ns(s,a),c=ns(i,s);let d=l/(l+c),u=c/(l+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const f=r*d,m=r*u;return{previous:{x:s.x-f*(i.x-a.x),y:s.y-f*(i.y-a.y)},next:{x:s.x+m*(i.x-a.x),y:s.y+m*(i.y-a.y)}}}function pg(t,n,o){const r=t.length;let a,s,i,l,c,d=co(t,0);for(let u=0;u<r-1;++u)if(c=d,d=co(t,u+1),!(!c||!d)){if(Io(n[u],0,mg)){o[u]=o[u+1]=0;continue}a=o[u]/n[u],s=o[u+1]/n[u],l=Math.pow(a,2)+Math.pow(s,2),!(l<=9)&&(i=3/Math.sqrt(l),o[u]=a*i*n[u],o[u+1]=s*i*n[u])}}function gg(t,n,o="x"){const r=ec(o),a=t.length;let s,i,l,c=co(t,0);for(let d=0;d<a;++d){if(i=l,l=c,c=co(t,d+1),!l)continue;const u=l[o],f=l[r];i&&(s=(u-i[o])/3,l[`cp1${o}`]=u-s,l[`cp1${r}`]=f-s*n[d]),c&&(s=(c[o]-u)/3,l[`cp2${o}`]=u+s,l[`cp2${r}`]=f+s*n[d])}}function bg(t,n="x"){const o=ec(n),r=t.length,a=Array(r).fill(0),s=Array(r);let i,l,c,d=co(t,0);for(i=0;i<r;++i)if(l=c,c=d,d=co(t,i+1),!!c){if(d){const u=d[n]-c[n];a[i]=u!==0?(d[o]-c[o])/u:0}s[i]=l?d?Yt(a[i-1])!==Yt(a[i])?0:(a[i-1]+a[i])/2:a[i-1]:a[i]}pg(t,a,s),gg(t,s,n)}function Pr(t,n,o){return Math.max(Math.min(t,o),n)}function yg(t,n){let o,r,a,s,i,l=Wo(t[0],n);for(o=0,r=t.length;o<r;++o)i=s,s=l,l=o<r-1&&Wo(t[o+1],n),s&&(a=t[o],i&&(a.cp1x=Pr(a.cp1x,n.left,n.right),a.cp1y=Pr(a.cp1y,n.top,n.bottom)),l&&(a.cp2x=Pr(a.cp2x,n.left,n.right),a.cp2y=Pr(a.cp2y,n.top,n.bottom)))}function xg(t,n,o,r,a){let s,i,l,c;if(n.spanGaps&&(t=t.filter(d=>!d.skip)),n.cubicInterpolationMode==="monotone")bg(t,a);else{let d=r?t[t.length-1]:t[0];for(s=0,i=t.length;s<i;++s)l=t[s],c=hg(d,l,t[Math.min(s+1,i-(r?0:1))%i],n.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}n.capBezierPoints&&yg(t,o)}function ps(){return typeof window<"u"&&typeof document<"u"}function gs(t){let n=t.parentNode;return n&&n.toString()==="[object ShadowRoot]"&&(n=n.host),n}function Or(t,n,o){let r;return typeof t=="string"?(r=parseInt(t,10),t.indexOf("%")!==-1&&(r=r/100*n.parentNode[o])):r=t,r}const vr=t=>t.ownerDocument.defaultView.getComputedStyle(t,null);function kg(t,n){return vr(t).getPropertyValue(n)}const wg=["top","right","bottom","left"];function Xn(t,n,o){const r={};o=o?"-"+o:"";for(let a=0;a<4;a++){const s=wg[a];r[s]=parseFloat(t[n+"-"+s+o])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const Cg=(t,n,o)=>(t>0||n>0)&&(!o||!o.shadowRoot);function Eg(t,n){const o=t.touches,r=o&&o.length?o[0]:t,{offsetX:a,offsetY:s}=r;let i=!1,l,c;if(Cg(a,s,t.target))l=a,c=s;else{const d=n.getBoundingClientRect();l=r.clientX-d.left,c=r.clientY-d.top,i=!0}return{x:l,y:c,box:i}}function Kn(t,n){if("native"in t)return t;const{canvas:o,currentDevicePixelRatio:r}=n,a=vr(o),s=a.boxSizing==="border-box",i=Xn(a,"padding"),l=Xn(a,"border","width"),{x:c,y:d,box:u}=Eg(t,o),f=i.left+(u&&l.left),m=i.top+(u&&l.top);let{width:h,height:p}=n;return s&&(h-=i.width+l.width,p-=i.height+l.height),{x:Math.round((c-f)/h*o.width/r),y:Math.round((d-m)/p*o.height/r)}}function Bg(t,n,o){let r,a;if(n===void 0||o===void 0){const s=t&&gs(t);if(!s)n=t.clientWidth,o=t.clientHeight;else{const i=s.getBoundingClientRect(),l=vr(s),c=Xn(l,"border","width"),d=Xn(l,"padding");n=i.width-d.width-c.width,o=i.height-d.height-c.height,r=Or(l.maxWidth,s,"clientWidth"),a=Or(l.maxHeight,s,"clientHeight")}}return{width:n,height:o,maxWidth:r||Vr,maxHeight:a||Vr}}const An=t=>Math.round(t*10)/10;function _g(t,n,o,r){const a=vr(t),s=Xn(a,"margin"),i=Or(a.maxWidth,t,"clientWidth")||Vr,l=Or(a.maxHeight,t,"clientHeight")||Vr,c=Bg(t,n,o);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const m=Xn(a,"border","width"),h=Xn(a,"padding");d-=h.width+m.width,u-=h.height+m.height}return d=Math.max(0,d-s.width),u=Math.max(0,r?d/r:u-s.height),d=An(Math.min(d,i,c.maxWidth)),u=An(Math.min(u,l,c.maxHeight)),d&&!u&&(u=An(d/2)),(n!==void 0||o!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,d=An(Math.floor(u*r))),{width:d,height:u}}function tc(t,n,o){const r=n||1,a=An(t.height*r),s=An(t.width*r);t.height=An(t.height),t.width=An(t.width);const i=t.canvas;return i.style&&(o||!i.style.height&&!i.style.width)&&(i.style.height=`${t.height}px`,i.style.width=`${t.width}px`),t.currentDevicePixelRatio!==r||i.height!==a||i.width!==s?(t.currentDevicePixelRatio=r,i.height=a,i.width=s,t.ctx.setTransform(r,0,0,r,0,0),!0):!1}const Sg=(function(){let t=!1;try{const n={get passive(){return t=!0,!1}};ps()&&(window.addEventListener("test",null,n),window.removeEventListener("test",null,n))}catch{}return t})();function nc(t,n){const o=kg(t,n),r=o&&o.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Yn(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:t.y+o*(n.y-t.y)}}function Vg(t,n,o,r){return{x:t.x+o*(n.x-t.x),y:r==="middle"?o<.5?t.y:n.y:r==="after"?o<1?t.y:n.y:o>0?n.y:t.y}}function Ag(t,n,o,r){const a={x:t.cp2x,y:t.cp2y},s={x:n.cp1x,y:n.cp1y},i=Yn(t,a,o),l=Yn(a,s,o),c=Yn(s,n,o),d=Yn(i,l,o),u=Yn(l,c,o);return Yn(d,u,o)}const Dg=function(t,n){return{x(o){return t+t+n-o},setWidth(o){n=o},textAlign(o){return o==="center"?o:o==="right"?"left":"right"},xPlus(o,r){return o-r},leftForLtr(o,r){return o-r}}},Ng=function(){return{x(t){return t},setWidth(t){},textAlign(t){return t},xPlus(t,n){return t+n},leftForLtr(t,n){return t}}};function uo(t,n,o){return t?Dg(n,o):Ng()}function oc(t,n){let o,r;(n==="ltr"||n==="rtl")&&(o=t.canvas.style,r=[o.getPropertyValue("direction"),o.getPropertyPriority("direction")],o.setProperty("direction",n,"important"),t.prevTextDirection=r)}function rc(t,n){n!==void 0&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",n[0],n[1]))}function ac(t){return t==="angle"?{between:$o,compare:Dp,normalize:Nt}:{between:un,compare:(n,o)=>n-o,normalize:n=>n}}function sc({start:t,end:n,count:o,loop:r,style:a}){return{start:t%o,end:n%o,loop:r&&(n-t+1)%o===0,style:a}}function Mg(t,n,o){const{property:r,start:a,end:s}=o,{between:i,normalize:l}=ac(r),c=n.length;let{start:d,end:u,loop:f}=t,m,h;if(f){for(d+=c,u+=c,m=0,h=c;m<h&&i(l(n[d%c][r]),a,s);++m)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:f,style:t.style}}function ic(t,n,o){if(!o)return[t];const{property:r,start:a,end:s}=o,i=n.length,{compare:l,between:c,normalize:d}=ac(r),{start:u,end:f,loop:m,style:h}=Mg(t,n,o),p=[];let k=!1,x=null,g,S,B;const E=()=>c(a,B,g)&&l(a,B)!==0,_=()=>l(s,g)===0||c(s,B,g),w=()=>k||E(),y=()=>!k||_();for(let b=u,C=u;b<=f;++b)S=n[b%i],!S.skip&&(g=d(S[r]),g!==B&&(k=c(g,a,s),x===null&&w()&&(x=l(g,a)===0?b:C),x!==null&&y()&&(p.push(sc({start:x,end:b,loop:m,count:i,style:h})),x=null),C=b,B=g));return x!==null&&p.push(sc({start:x,end:f,loop:m,count:i,style:h})),p}function lc(t,n){const o=[],r=t.segments;for(let a=0;a<r.length;a++){const s=ic(r[a],t.points,n);s.length&&o.push(...s)}return o}function Tg(t,n,o,r){let a=0,s=n-1;if(o&&!r)for(;a<n&&!t[a].skip;)a++;for(;a<n&&t[a].skip;)a++;for(a%=n,o&&(s+=a);s>a&&t[s%n].skip;)s--;return s%=n,{start:a,end:s}}function Pg(t,n,o,r){const a=t.length,s=[];let i=n,l=t[n],c;for(c=n+1;c<=o;++c){const d=t[c%a];d.skip||d.stop?l.skip||(r=!1,s.push({start:n%a,end:(c-1)%a,loop:r}),n=i=d.stop?c:null):(i=c,l.skip&&(n=c)),l=d}return i!==null&&s.push({start:n%a,end:i%a,loop:r}),s}function Og(t,n){const o=t.points,r=t.options.spanGaps,a=o.length;if(!a)return[];const s=!!t._loop,{start:i,end:l}=Tg(o,a,s,r);if(r===!0)return cc(t,[{start:i,end:l,loop:s}],o,n);const c=l<i?l+a:l,d=!!t._fullLoop&&i===0&&l===a-1;return cc(t,Pg(o,i,c,d),o,n)}function cc(t,n,o,r){return!r||!r.setContext||!o?n:vg(t,n,o,r)}function vg(t,n,o,r){const a=t._chart.getContext(),s=dc(t.options),{_datasetIndex:i,options:{spanGaps:l}}=t,c=o.length,d=[];let u=s,f=n[0].start,m=f;function h(p,k,x,g){const S=l?-1:1;if(p!==k){for(p+=c;o[p%c].skip;)p-=S;for(;o[k%c].skip;)k+=S;p%c!==k%c&&(d.push({start:p%c,end:k%c,loop:x,style:g}),u=g,f=k%c)}}for(const p of n){f=l?f:p.start;let k=o[f%c],x;for(m=f+1;m<=p.end;m++){const g=o[m%c];x=dc(r.setContext(Gn(a,{type:"segment",p0:k,p1:g,p0DataIndex:(m-1)%c,p1DataIndex:m%c,datasetIndex:i}))),Fg(x,u)&&h(f,m-1,p.loop,u),k=g,u=x}f<m-1&&h(f,m-1,p.loop,u)}return d}function dc(t){return{backgroundColor:t.backgroundColor,borderCapStyle:t.borderCapStyle,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderJoinStyle:t.borderJoinStyle,borderWidth:t.borderWidth,borderColor:t.borderColor}}function Fg(t,n){if(!n)return!1;const o=[],r=function(a,s){return as(s)?(o.includes(s)||o.push(s),o.indexOf(s)):s};return JSON.stringify(t,r)!==JSON.stringify(n,r)}function Fr(t,n,o){return t.options.clip?t[o]:n[o]}function zg(t,n){const{xScale:o,yScale:r}=t;return o&&r?{left:Fr(o,n,"left"),right:Fr(o,n,"right"),top:Fr(r,n,"top"),bottom:Fr(r,n,"bottom")}:n}function uc(t,n){const o=n._clip;if(o.disabled)return!1;const r=zg(n,t.chartArea);return{left:o.left===!1?0:r.left-(o.left===!0?0:o.left),right:o.right===!1?t.width:r.right+(o.right===!0?0:o.right),top:o.top===!1?0:r.top-(o.top===!0?0:o.top),bottom:o.bottom===!1?t.height:r.bottom+(o.bottom===!0?0:o.bottom)}}/*!
|
|
12
12
|
* Chart.js v4.5.1
|
|
13
13
|
* https://www.chartjs.org
|
|
14
14
|
* (c) 2025 Chart.js Contributors
|
|
15
15
|
* Released under the MIT License
|
|
16
|
-
*/class zg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=Il.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}add(n,o){!o||!o.length||this._getAnims(n).items.push(...o)}has(n){return this._getAnims(n).items.length>0}start(n){const o=this._charts.get(n);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(n){if(!this._running)return!1;const o=this._charts.get(n);return!(!o||!o.running||!o.items.length)}stop(n){const o=this._charts.get(n);if(!o||!o.items.length)return;const r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var yn=new zg;const hc="transparent",Ig={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=jl(t||hc),a=r.valid&&jl(n||hc);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Rg{constructor(n,o,r,a){const s=o[r];a=vr([n.to,a,s,n.from]);const i=vr([n.from,s,a]);this._active=!0,this._fn=n.fn||Ig[n.type||typeof i],this._easing=Uo[n.easing]||Uo.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=o,this._prop=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=vr([n.to,o,a,n.from]),this._from=vr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class mc{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Le(n))return;const o=Object.keys(dt.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Le(s))return;const i={};for(const l of o)i[l]=s[l];(ht(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=$g(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&Lg(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],s=n.$animations||(n.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const h=r.get(d);if(f)if(h&&f.active()){f.update(h,u,l);continue}else f.cancel();if(!h||!h.duration){n[d]=u;continue}s[d]=f=new Rg(h,n,d,u),a.push(f)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return yn.add(this._chart,r),!0}}function Lg(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function $g(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function pc(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function jg(t,n,o){if(o===!1)return!1;const r=pc(t,o),a=pc(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Ug(t){let n,o,r,a;return Le(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function gc(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function bc(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],kt(d)&&(s||n===0||on(n)===on(d))&&(n+=d)}return!u&&!r.all?0:n}function Wg(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function bs(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function Hg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function qg(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function Gg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function yc(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function xc(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=Hg(s,i,r),f=n.length;let h;for(let m=0;m<f;++m){const g=n[m],{[c]:k,[d]:y}=g,p=g._stacks||(g._stacks={});h=p[d]=Gg(a,u,k),h[l]=y,h._top=yc(h,i,!0,r.type),h._bottom=yc(h,i,!1,r.type);const E=h._visualValues||(h._visualValues={});E[l]=y}}function ys(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Xg(t,n){return Kn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Kg(t,n,o){return Kn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function Go(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const xs=t=>t==="reset"||t==="none",kc=(t,n)=>n?t:Object.assign({},t),Yg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:gc(o,!0),values:null};class Zn{constructor(n,o){this.chart=n,this._ctx=n.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=bs(n.vScale,n),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(n){this.index!==n&&Go(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,h,m,g)=>f==="x"?h:f==="r"?g:m,s=o.xAxisID=Oe(r.xAxisID,ys(n,"x")),i=o.yAxisID=Oe(r.yAxisID,ys(n,"y")),l=o.rAxisID=Oe(r.rAxisID,ys(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const o=this._cachedMeta;return n===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&Fl(this._data,this),n._stacked&&Go(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Le(o)){const a=this._cachedMeta;this._data=Wg(o,a)}else if(r!==o){if(r){Fl(r,this);const a=this._cachedMeta;Go(a),a._parsed=[]}o&&Object.isExtensible(o)&&vp(o,this),this._syncList=[],this._data=o}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const o=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=bs(o.vScale,o),o.stack!==r.stack&&(a=!0,Go(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(xc(this,o._parsed),o._stacked=bs(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,f,h;if(this._parsing===!1)r._parsed=a,r._sorted=!0,h=a;else{ht(a[n])?h=this.parseArrayData(r,a,n,o):Le(a[n])?h=this.parseObjectData(r,a,n,o):h=this.parsePrimitiveData(r,a,n,o);const m=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=h[u],c&&(m()&&(c=!1),d=f);r._sorted=c}i&&xc(this,h)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let h,m,g;for(h=0,m=a;h<m;++h)g=h+r,f[h]={[l]:u||s.parse(d[g],g),[c]:i.parse(o[g],g)};return f}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,h,m;for(u=0,f=a;u<f;++u)h=u+r,m=o[h],d[u]={x:s.parse(Wn(m,l),h),y:i.parse(Wn(m,c),h)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:gc(a,!0),values:o._stacks[n.axis]._visualValues};return bc(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=bc(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=Yg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=qg(l);let h,m;function g(){m=a[h];const k=m[l.axis];return!kt(m[n.axis])||u>k||f<k}for(h=0;h<i&&!(!g()&&(this.updateRangeFromParsed(d,n,m,c),s));++h);if(s){for(h=i-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(d,n,m,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],kt(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=Ug(Oe(this.options.clip,jg(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=a[u];f.hidden||(f.active&&d?i.push(f):f.draw(n,s))}for(u=0;u<i.length;++u)i[u].draw(n,s)}getStyle(n,o){const r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Kg(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Xg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,s}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,o){return this._resolveElementOptions(this.dataElementType.id,o,n)}_resolveElementOptions(n,o="default",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&Ro(r);if(l)return kc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],h=d.getOptionScopes(this.getDataset(),u),m=Object.keys(dt.elements[n]),g=()=>this.getContext(r,a,o),k=d.resolveNamedOptions(h,m,g,f);return k.$shared&&(k.$shared=c,s[i]=Object.freeze(kc(k,c))),k}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),h=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(h,this.getContext(n,r,o))}const d=new mc(a,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,o){return!o||xs(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){xs(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!xs(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const o=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.data,i=n+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=n;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&Go(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,o){o&&this._sync(["_removeElements",n,o]);const r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}we(Zn,"defaults",{}),we(Zn,"datasetElementType",null),we(Zn,"dataElementType",null);function Jg(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=zl(r.sort((a,s)=>a-s))}return t._cache.$bar}function Qg(t){const n=t.iScale,o=Jg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Ro(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function Zg(t,n,o,r){const a=o.barThickness;let s,i;return qe(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function e0(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?n.end-n.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/r,ratio:o.barPercentage,start:d}}function t0(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),n[o.axis]=d,n._custom={barStart:c,barEnd:d,start:a,end:s,min:i,max:l}}function wc(t,n,o,r){return ht(t)?t0(t,n,o,r):n[o.axis]=o.parse(t,r),n}function Cc(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,h;for(d=o,u=o+r;d<u;++d)h=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(wc(h,f,s,d));return c}function ks(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function n0(t,n,o){return t!==0?on(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function o0(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function r0(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=o0(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[Ec(u,i,l,c)]=!0,a=d)),s[Ec(a,i,l,c)]=!0,t.borderSkipped=s}function Ec(t,n,o,r){return r?(t=a0(t,n,o),t=Bc(t,o,n)):t=Bc(t,n,o),t}function a0(t,n,o){return t===n?o:t===o?n:t}function Bc(t,n,o){return t==="start"?n:t==="end"?o:t}function s0(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class zr extends Zn{parsePrimitiveData(n,o,r,a){return Cc(n,o,r,a)}parseArrayData(n,o,r,a){return Cc(n,o,r,a)}parseObjectData(n,o,r,a){const{iScale:s,vScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let h,m,g,k;for(h=r,m=r+a;h<m;++h)k=o[h],g={},g[s.axis]=s.parse(Wn(k,d),h),f.push(wc(Wn(k,u),g,i,h));return f}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._custom;s&&o===this._cachedMeta.vScale&&(n.min=Math.min(n.min,s.min),n.max=Math.max(n.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const o=this._cachedMeta,{iScale:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=ks(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,n)}updateElements(n,o,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(o,a);for(let m=o;m<o+r;m++){const g=this.getParsed(m),k=s||qe(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),y=this._calculateBarIndexPixels(m,u),p=(g._stacks||{})[l.axis],E={horizontal:d,base:k.base,enableBorderRadius:!p||ks(g._custom)||i===p._top||i===p._bottom,x:d?k.head:y.center,y:d?y.center:k.head,height:d?y.size:Math.abs(k.size),width:d?Math.abs(k.size):y.size};h&&(E.options=f||this.resolveDataElementOptions(m,n[m].active?"active":a));const _=E.options||n[m].options;r0(E,_,p,i),s0(E,_,u.ratio),this.updateElement(n[m],m,E,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(m=>m[r.axis]===c),h=f&&f[u.vScale.axis];if(qe(h)||isNaN(h))return!0};for(const u of a)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===n))break;return i.length||i.push(void 0),i}_getStackCount(n){return this._getStacks(void 0,n).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const n=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(n).filter(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[Oe(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||Qg(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=ks(d);let f=c[o.axis],h=0,m=r?this.applyStack(o,c,r):f,g,k;m!==f&&(h=m-f,m=f),u&&(f=d.barStart,m=d.barEnd-d.barStart,f!==0&&on(f)!==on(d.barEnd)&&(h=0),h+=f);const y=!qe(s)&&!u?s:h;let p=o.getPixelForValue(y);if(this.chart.getDataVisibility(n)?g=o.getPixelForValue(h+m):g=p,k=g-p,Math.abs(k)<i){k=n0(k,o,l)*i,f===l&&(p-=k/2);const E=o.getPixelForDecimal(0),_=o.getPixelForDecimal(1),B=Math.min(E,_),S=Math.max(E,_);p=Math.max(Math.min(p,S),B),g=p+k,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(g)-o.getValueForPixel(p))}if(p===o.getPixelForValue(l)){const E=on(k)*o.getLineWidthForValue(l)/2;p+=E,k-=E}return{size:k,base:p,head:g,center:g+k/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=Oe(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=a.barThickness==="flex"?e0(n,o,a,u*d):Zg(n,o,a,u*d),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(Oe(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+m;l=f.start+f.chunk*g+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.axis],n),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const n=this._cachedMeta,o=n.vScale,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}we(zr,"id","bar"),we(zr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),we(zr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function i0(t,n,o){let r=1,a=1,s=0,i=0;if(n<it){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),h=Math.sin(c),m=(_,B,S)=>jo(_,l,c,!0)?1:Math.max(B,B*o,S,S*o),g=(_,B,S)=>jo(_,l,c,!0)?-1:Math.min(B,B*o,S,S*o),k=m(0,d,f),y=m(gt,u,h),p=g(Qe,d,f),E=g(Qe+gt,u,h);r=(k-p)/2,a=(y-E)/2,s=-(k+p)/2,i=-(y+E)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class po extends Zn{constructor(n,o){super(n,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,o){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Le(r[n])){const{key:c="value"}=this._parsing;s=d=>+Wn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return gn(this.options.rotation-90)}_getCircumference(){return gn(this.options.circumference)}_getRotationExtents(){let n=it,o=-it;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._getCircumference();n=Math.min(n,s),o=Math.max(o,s+i)}return{rotation:n,circumference:o-n}}update(n){const o=this.chart,{chartArea:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(pp(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:m,offsetX:g,offsetY:k}=i0(f,u,c),y=(r.width-i)/h,p=(r.height-i)/m,E=Math.max(Math.min(y,p)/2,0),_=Sl(this.options.radius,E),B=Math.max(_*c,0),S=(_-B)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=k*_,a.total=this.calculateTotal(),this.outerRadius=_-S*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-S*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/it)}updateElements(n,o,r,a){const s=a==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,h=s&&d.animateScale,m=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:k,includeOptions:y}=this._getSharedOptions(o,a);let p=this._getRotation(),E;for(E=0;E<o;++E)p+=this._circumference(E,s);for(E=o;E<o+r;++E){const _=this._circumference(E,s),B=n[E],S={x:u+this.offsetX,y:f+this.offsetY,startAngle:p,endAngle:p+_,circumference:_,outerRadius:g,innerRadius:m};y&&(S.options=k||this.resolveDataElementOptions(E,B.active?"active":a)),p+=_,this.updateElement(B,E,S,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?it*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=is(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(Oe(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}we(po,"id","doughnut"),we(po,"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"}),we(po,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),we(po,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=n.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=n.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!n.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class Ir extends Zn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Op(o,a,i);this._drawStart=l,this._drawCount=c,Fp(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,a),h=i.axis,m=l.axis,{spanGaps:g,segment:k}=this.options,y=$o(g)?g:Number.POSITIVE_INFINITY,p=this.chart._animationsDisabled||s||a==="none",E=o+r,_=n.length;let B=o>0&&this.getParsed(o-1);for(let S=0;S<_;++S){const w=n[S],x=p?w:{};if(S<o||S>=E){x.skip=!0;continue}const b=this.getParsed(S),A=qe(b[m]),V=x[h]=i.getPixelForValue(b[h],S),D=x[m]=s||A?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[m],S);x.skip=isNaN(V)||isNaN(D)||A,x.stop=S>0&&Math.abs(b[h]-B[h])>y,k&&(x.parsed=b,x.raw=d.data[S]),f&&(x.options=u||this.resolveDataElementOptions(S,w.active?"active":a)),p||this.updateElement(w,S,x,a),B=b}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}we(Ir,"id","line"),we(Ir,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),we(Ir,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ws extends po{}we(ws,"id","pie"),we(ws,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function eo(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Cs{constructor(n){we(this,"options");this.options=n||{}}static override(n){Object.assign(Cs.prototype,n)}init(){}formats(){return eo()}parse(){return eo()}format(){return eo()}add(){return eo()}diff(){return eo()}startOf(){return eo()}endOf(){return eo()}}var l0={_date:Cs};function c0(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?Np:qn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const h=d(s,n,o-f),m=d(s,n,o+f);return{lo:h.lo,hi:m.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:h}=t,m=h.slice(0,u.lo+1).reverse().findIndex(k=>!qe(k[f.axis]));u.lo-=Math.max(0,m);const g=h.slice(u.hi).findIndex(k=>!qe(k[f.axis]));u.hi+=Math.max(0,g)}return u}}return{lo:0,hi:s.length-1}}function Rr(t,n,o,r,a){const s=t.getSortedVisibleDatasetMetas(),i=o[n];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:h}=c0(s[l],n,i,a);for(let m=f;m<=h;++m){const g=u[m];g.skip||r(g,d,m)}}}function d0(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Es(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||Rr(t,o,n,function(l,c,d){!a&&!Ho(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function u0(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=Tl(i,{x:n.x,y:n.y});jo(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return Rr(t,o,n,s),a}function f0(t,n,o,r,a,s){let i=[];const l=d0(o);let c=Number.POSITIVE_INFINITY;function d(u,f,h){const m=u.inRange(n.x,n.y,a);if(r&&!m)return;const g=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(g))&&!m)return;const y=l(n,g);y<c?(i=[{element:u,datasetIndex:f,index:h}],c=y):y===c&&i.push({element:u,datasetIndex:f,index:h})}return Rr(t,o,n,d),i}function Bs(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?u0(t,n,o,a):f0(t,n,o,r,a,s)}function _c(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return Rr(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var h0={modes:{index(t,n,o,r){const a=Jn(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Es(t,a,s,r,i):Bs(t,a,s,!1,r,i),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,n,o,r){const a=Jn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Es(t,a,s,r,i):Bs(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=Jn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Es(t,a,s,r,i)},nearest(t,n,o,r){const a=Jn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Bs(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=Jn(n,t);return _c(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=Jn(n,t);return _c(t,a,"y",o.intersect,r)}}};const Sc=["left","top","right","bottom"];function Xo(t,n){return t.filter(o=>o.pos===n)}function Ac(t,n){return t.filter(o=>Sc.indexOf(o.pos)===-1&&o.box.axis===n)}function Ko(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function m0(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function p0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!Sc.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function g0(t,n){const o=p0(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function b0(t){const n=m0(t),o=Ko(n.filter(d=>d.box.fullSize),!0),r=Ko(Xo(n,"left"),!0),a=Ko(Xo(n,"right")),s=Ko(Xo(n,"top"),!0),i=Ko(Xo(n,"bottom")),l=Ac(n,"x"),c=Ac(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:Xo(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function Vc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function Dc(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function y0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Le(a)){o.size&&(t[a]-=o.size);const f=r[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,t[a]+=o.size}s.getPadding&&Dc(i,s.getPadding());const l=Math.max(0,n.outerWidth-Vc(i,t,"left","right")),c=Math.max(0,n.outerHeight-Vc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function x0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function k0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function Yo(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,k0(l.horizontal,n));const{same:f,other:h}=y0(n,o,l,r);d|=f&&a.length,u=u||h,c.fullSize||a.push(l)}return d&&Yo(a,n,o,r)||u}function Lr(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function Nc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=n.w*u,h=d.size||c.height;Ro(d.start)&&(i=d.start),c.fullSize?Lr(c,a.left,i,o.outerWidth-a.right-a.left,h):Lr(c,n.left+d.placed,i,f,h),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,h=d.size||c.width;Ro(d.start)&&(s=d.start),c.fullSize?Lr(c,s,a.top,h,o.outerHeight-a.bottom-a.top):Lr(c,s,n.top+d.placed,h,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var Wt={addBox(t,n){t.boxes||(t.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(o){n.draw(o)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=Ut(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=b0(t.boxes),c=l.vertical,d=l.horizontal;Je(t.boxes,k=>{typeof k.beforeLayout=="function"&&k.beforeLayout()});const u=c.reduce((k,y)=>y.box.options&&y.box.options.display===!1?k:k+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),h=Object.assign({},a);Dc(h,Ut(r));const m=Object.assign({maxPadding:h,w:s,h:i,x:a.left,y:a.top},a),g=g0(c.concat(d),f);Yo(l.fullSize,m,f,g),Yo(c,m,f,g),Yo(d,m,f,g)&&Yo(c,m,f,g),x0(m),Nc(l.leftAndTop,m,f,g),m.x+=m.w,m.y+=m.h,Nc(l.rightAndBottom,m,f,g),t.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},Je(l.chartArea,k=>{const y=k.box;Object.assign(y,t.chartArea),y.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Mc{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class w0 extends Mc{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const $r="$chartjs",C0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vc=t=>t===null||t==="";function E0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[$r]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",vc(a)){const s=oc(t,"width");s!==void 0&&(t.width=s)}if(vc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=oc(t,"height");s!==void 0&&(t.height=s)}return t}const Pc=_g?{passive:!0}:!1;function B0(t,n,o){t&&t.addEventListener(n,o,Pc)}function _0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,Pc)}function S0(t,n){const o=C0[t.type]||t.type,{x:r,y:a}=Jn(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function jr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function A0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.addedNodes,r),i=i&&!jr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function V0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.removedNodes,r),i=i&&!jr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Jo=new Map;let Tc=0;function Oc(){const t=window.devicePixelRatio;t!==Tc&&(Tc=t,Jo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function D0(t,n){Jo.size||window.addEventListener("resize",Oc),Jo.set(t,n)}function N0(t){Jo.delete(t),Jo.size||window.removeEventListener("resize",Oc)}function M0(t,n,o){const r=t.canvas,a=r&&gs(r);if(!a)return;const s=Rl((l,c)=>{const d=a.clientWidth;o(l,c),d<a.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(a),D0(t,s),i}function _s(t,n,o){o&&o.disconnect(),n==="resize"&&N0(t)}function v0(t,n,o){const r=t.canvas,a=Rl(s=>{t.ctx!==null&&o(S0(s,t))},t);return B0(r,n,a),a}class P0 extends Mc{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(E0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[$r])return!1;const r=o[$r].initial;["height","width"].forEach(s=>{const i=r[s];qe(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[$r],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:A0,detach:V0,resize:M0}[o]||v0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:_s,detach:_s,resize:_s}[o]||_0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return Bg(n,o,r,a)}isAttached(n){const o=n&&gs(n);return!!(o&&o.isConnected)}}function T0(t){return!ps()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?w0:P0}let xn=(wa=class{constructor(){we(this,"x");we(this,"y");we(this,"active",!1);we(this,"options");we(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return $o(this.x)&&$o(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},we(wa,"defaults",{}),we(wa,"defaultRoutes"),wa);function O0(t,n){const o=t.options.ticks,r=F0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?I0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return R0(n,d,s,i/a),d;const u=z0(s,n,a);if(i>0){let f,h;const m=i>1?Math.round((c-l)/(i-1)):null;for(Ur(n,d,u,qe(m)?0:l-m,l),f=0,h=i-1;f<h;f++)Ur(n,d,u,s[f],s[f+1]);return Ur(n,d,u,c,qe(m)?n.length:c+m),d}return Ur(n,d,u),d}function F0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function z0(t,n,o){const r=L0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=Ep(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function I0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function R0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function Ur(t,n,o,r,a){const s=Oe(r,0),i=Math.min(Oe(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(n.push(t[d]),l++,u=Math.round(s+l*o))}function L0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const $0=t=>t==="left"?"right":t==="right"?"left":t,Fc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,zc=(t,n)=>Math.min(n||t,t);function Ic(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function j0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function U0(t,n){Je(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Qo(t){return t.drawTicks?t.tickLength:0}function Rc(t,n){if(!t.display)return 0;const o=Et(t.font,n),r=Ut(t.padding);return(ht(t.text)?t.text.length:1)*o.lineHeight+r.height}function W0(t,n){return Kn(t,{scale:n,type:"scale"})}function H0(t,n,o){return Kn(t,{tick:o,index:n,type:"tick"})}function q0(t,n,o){let r=rs(t);return(o&&n!=="right"||!o&&n==="right")&&(r=$0(r)),r}function G0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,h,m,g;const k=i-a,y=l-s;if(t.isHorizontal()){if(m=Ct(r,s,l),Le(o)){const p=Object.keys(o)[0],E=o[p];g=u[p].getPixelForValue(E)+k-n}else o==="center"?g=(d.bottom+d.top)/2+k-n:g=Fc(t,o,n);h=l-s}else{if(Le(o)){const p=Object.keys(o)[0],E=o[p];m=u[p].getPixelForValue(E)-y+n}else o==="center"?m=(d.left+d.right)/2-y+n:m=Fc(t,o,n);g=Ct(r,i,a),f=o==="left"?-gt:gt}return{titleX:m,titleY:g,maxWidth:h,rotation:f}}class go extends xn{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,o){return n}getUserBounds(){let{_userMin:n,_userMax:o,_suggestedMin:r,_suggestedMax:a}=this;return n=nn(n,Number.POSITIVE_INFINITY),o=nn(o,Number.NEGATIVE_INFINITY),r=nn(r,Number.POSITIVE_INFINITY),a=nn(a,Number.NEGATIVE_INFINITY),{min:nn(n,r),max:nn(o,a),minDefined:kt(n),maxDefined:kt(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:nn(o,nn(r,o)),max:nn(r,nn(o,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){at(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ng(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Ic(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=O0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,o,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){at(this.options.afterUpdate,[this])}beforeSetDimensions(){at(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(){at(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),at(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){at(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=at(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){at(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){at(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=zc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,h=u.highest.height,m=wt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:m/(r-1),f+6>l&&(l=m/(r-(n.offset?.5:1)),c=this.maxHeight-Qo(n.grid)-o.padding-Rc(n.title,this.chart.options.font),d=Math.sqrt(f*f+h*h),i=Ap(Math.min(Math.asin(wt((u.highest.height+6)/l,-1,1)),Math.asin(wt(c/d,-1,1))-Math.asin(wt(h/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){at(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){at(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=Rc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Qo(s)+c):(n.height=this.maxHeight,n.width=Qo(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:h}=this._getLabelSizes(),m=r.padding*2,g=gn(this.labelRotation),k=Math.cos(g),y=Math.sin(g);if(l){const p=r.mirror?0:y*f.width+k*h.height;n.height=Math.min(this.maxHeight,n.height+p+m)}else{const p=r.mirror?0:k*f.width+y*h.height;n.width=Math.min(this.maxWidth,n.width+p+m)}this._calculatePadding(d,u,y,k)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,o,r,a){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,m=0;c?d?(h=a*n.width,m=r*o.height):(h=r*n.height,m=a*o.width):s==="start"?m=o.width:s==="end"?h=n.width:s!=="inner"&&(h=n.width/2,m=o.width/2),this.paddingLeft=Math.max((h-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=n.height/2;s==="start"?(u=0,f=n.height):s==="end"&&(u=o.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){at(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:o}=this.options;return o==="top"||o==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let o,r;for(o=0,r=n.length;o<r;o++)qe(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=Ic(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/zc(o,r));let d=0,u=0,f,h,m,g,k,y,p,E,_,B,S;for(f=0;f<o;f+=c){if(g=n[f].label,k=this._resolveTickFontOptions(f),a.font=y=k.string,p=s[y]=s[y]||{data:{},gc:[]},E=k.lineHeight,_=B=0,!qe(g)&&!ht(g))_=Hl(a,p.data,p.gc,_,g),B=E;else if(ht(g))for(h=0,m=g.length;h<m;++h)S=g[h],!qe(S)&&!ht(S)&&(_=Hl(a,p.data,p.gc,_,S),B+=E);i.push(_),l.push(B),d=Math.max(_,d),u=Math.max(B,u)}U0(s,o);const w=i.indexOf(d),x=l.indexOf(u),b=A=>({width:i[A]||0,height:l[A]||0});return{first:b(0),last:b(o-1),widest:b(w),highest:b(x),widths:i,heights:l}}getLabelForValue(n){return n}getPixelForValue(n,o){return NaN}getValueForPixel(n){}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const o=this._startPixel+n*this._length;return Dp(this._alignToPixels?Xn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const r=o[n];return r.$context||(r.$context=H0(this.getContext(),n,r))}return this.$context||(this.$context=W0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=gn(this.labelRotation),r=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=n.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),h=Qo(s),m=[],g=l.setContext(this.getContext()),k=g.display?g.width:0,y=k/2,p=function(j){return Xn(r,j,k)};let E,_,B,S,w,x,b,A,V,D,N,P;if(i==="top")E=p(this.bottom),x=this.bottom-h,A=E-y,D=p(n.top)+y,P=n.bottom;else if(i==="bottom")E=p(this.top),D=n.top,P=p(n.bottom)-y,x=E+y,A=this.top+h;else if(i==="left")E=p(this.right),w=this.right-h,b=E-y,V=p(n.left)+y,N=n.right;else if(i==="right")E=p(this.left),V=n.left,N=p(n.right)-y,w=E+y,b=this.left+h;else if(o==="x"){if(i==="center")E=p((n.top+n.bottom)/2+.5);else if(Le(i)){const j=Object.keys(i)[0],G=i[j];E=p(this.chart.scales[j].getPixelForValue(G))}D=n.top,P=n.bottom,x=E+y,A=x+h}else if(o==="y"){if(i==="center")E=p((n.left+n.right)/2);else if(Le(i)){const j=Object.keys(i)[0],G=i[j];E=p(this.chart.scales[j].getPixelForValue(G))}w=E-y,b=w-h,V=n.left,N=n.right}const v=Oe(a.ticks.maxTicksLimit,f),Q=Math.max(1,Math.ceil(f/v));for(_=0;_<f;_+=Q){const j=this.getContext(_),G=s.setContext(j),Y=l.setContext(j),H=G.lineWidth,T=G.color,U=Y.dash||[],te=Y.dashOffset,Z=G.tickWidth,K=G.tickColor,ae=G.tickBorderDash||[],ue=G.tickBorderDashOffset;B=j0(this,_,c),B!==void 0&&(S=Xn(r,B,H),d?w=b=V=N=S:x=A=D=P=S,m.push({tx1:w,ty1:x,tx2:b,ty2:A,x1:V,y1:D,x2:N,y2:P,width:H,color:T,borderDash:U,borderDashOffset:te,tickWidth:Z,tickColor:K,tickBorderDash:ae,tickBorderDashOffset:ue}))}return this._ticksLength=f,this._borderValue=E,m}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,h=Qo(r.grid),m=h+u,g=f?-u:m,k=-gn(this.labelRotation),y=[];let p,E,_,B,S,w,x,b,A,V,D,N,P="middle";if(a==="top")w=this.bottom-g,x=this._getXAxisLabelAlignment();else if(a==="bottom")w=this.top+g,x=this._getXAxisLabelAlignment();else if(a==="left"){const Q=this._getYAxisLabelAlignment(h);x=Q.textAlign,S=Q.x}else if(a==="right"){const Q=this._getYAxisLabelAlignment(h);x=Q.textAlign,S=Q.x}else if(o==="x"){if(a==="center")w=(n.top+n.bottom)/2+m;else if(Le(a)){const Q=Object.keys(a)[0],j=a[Q];w=this.chart.scales[Q].getPixelForValue(j)+m}x=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")S=(n.left+n.right)/2-m;else if(Le(a)){const Q=Object.keys(a)[0],j=a[Q];S=this.chart.scales[Q].getPixelForValue(j)}x=this._getYAxisLabelAlignment(h).textAlign}o==="y"&&(c==="start"?P="top":c==="end"&&(P="bottom"));const v=this._getLabelSizes();for(p=0,E=l.length;p<E;++p){_=l[p],B=_.label;const Q=s.setContext(this.getContext(p));b=this.getPixelForTick(p)+s.labelOffset,A=this._resolveTickFontOptions(p),V=A.lineHeight,D=ht(B)?B.length:1;const j=D/2,G=Q.color,Y=Q.textStrokeColor,H=Q.textStrokeWidth;let T=x;i?(S=b,x==="inner"&&(p===E-1?T=this.options.reverse?"left":"right":p===0?T=this.options.reverse?"right":"left":T="center"),a==="top"?d==="near"||k!==0?N=-D*V+V/2:d==="center"?N=-v.highest.height/2-j*V+V:N=-v.highest.height+V/2:d==="near"||k!==0?N=V/2:d==="center"?N=v.highest.height/2-j*V:N=v.highest.height-D*V,f&&(N*=-1),k!==0&&!Q.showLabelBackdrop&&(S+=V/2*Math.sin(k))):(w=b,N=(1-D)*V/2);let U;if(Q.showLabelBackdrop){const te=Ut(Q.backdropPadding),Z=v.heights[p],K=v.widths[p];let ae=N-te.top,ue=0-te.left;switch(P){case"middle":ae-=Z/2;break;case"bottom":ae-=Z;break}switch(x){case"center":ue-=K/2;break;case"right":ue-=K;break;case"inner":p===E-1?ue-=K:p>0&&(ue-=K/2);break}U={left:ue,top:ae,width:K+te.width,height:Z+te.height,color:Q.backdropColor}}y.push({label:B,font:A,textOffset:N,options:{rotation:k,color:G,strokeColor:Y,strokeWidth:H,textAlign:T,textBaseline:P,translation:[S,w],backdrop:U}})}return y}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-gn(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:o},left:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:o,options:{border:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,h;this.isHorizontal()?(d=Xn(n,this.left,i)-i/2,u=Xn(n,this.right,l)+l/2,f=h=c):(f=Xn(n,this.top,i)-i/2,h=Xn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,h),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Dr(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;qo(r,d,0,u,c,l)}a&&Nr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=Et(r.font),i=Ut(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Le(o)?(c+=i.bottom,ht(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:h}=G0(this,c,o,l);qo(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:h,textAlign:q0(l,o,a),textBaseline:"middle",translation:[d,u]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,o=n.ticks&&n.ticks.z||0,r=Oe(n.grid&&n.grid.z,-1),a=Oe(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==go.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return Et(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class Wr{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const o=Object.getPrototypeOf(n);let r;Y0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,X0(n,i,r),this.override&&dt.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in dt[a]&&(delete dt[a][r],this.override&&delete Gn[r])}}function X0(t,n,o){const r=zo(Object.create(null),[o?dt.get(o):{},dt.get(n),t.defaults]);dt.set(n,r),t.defaultRoutes&&K0(n,t.defaultRoutes),t.descriptors&&dt.describe(n,t.descriptors)}function K0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");dt.route(s,a,c,l)})}function Y0(t){return"id"in t&&"defaults"in t}class J0{constructor(){this.controllers=new Wr(Zn,"datasets",!0),this.elements=new Wr(xn,"elements"),this.plugins=new Wr(Object,"plugins"),this.scales=new Wr(go,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,o,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):Je(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=ts(n);at(r["before"+a],[],r),o[n](r),at(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var rn=new J0;class Q0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if(at(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){qe(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),o}_createDescriptors(n,o){const r=n&&n.config,a=Oe(r.options&&r.options.plugins,{}),s=Z0(r);return a===!1&&!o?[]:tb(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function Z0(t){const n={},o=[],r=Object.keys(rn.plugins.items);for(let s=0;s<r.length;s++)o.push(rn.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function eb(t,n){return!n&&t===!1?null:t===!0?{}:t}function tb(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=eb(r[c],a);d!==null&&s.push({plugin:l,options:nb(t.config,{plugin:l,local:o[c]},d,i)})}return s}function nb(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ss(t,n){const o=dt.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function ob(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function rb(t,n){return t===n?"_index_":"_value_"}function Lc(t){if(t==="x"||t==="y"||t==="r")return t}function ab(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function As(t,...n){if(Lc(t))return t;for(const o of n){const r=o.axis||ab(o.position)||t.length>1&&Lc(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function $c(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function sb(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return $c(t,"x",o[0])||$c(t,"y",o[0])}return{}}function ib(t,n){const o=Gn[t.type]||{scales:{}},r=n.scales||{},a=Ss(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Le(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=As(i,l,sb(i,t),dt.scales[l.type]),d=rb(c,a),u=o.scales||{};s[i]=Io(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Ss(l,n),u=(Gn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const h=ob(f,c),m=i[h+"AxisID"]||h;s[m]=s[m]||Object.create(null),Io(s[m],[{axis:h},r[m],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];Io(l,[dt.scales[l.type],dt.scale])}),s}function jc(t){const n=t.options||(t.options={});n.plugins=Oe(n.plugins,{}),n.scales=ib(t,n)}function Uc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function lb(t){return t=t||{},t.data=Uc(t.data),jc(t),t}const Wc=new Map,Hc=new Set;function Hr(t,n){let o=Wc.get(t);return o||(o=n(),Wc.set(t,o),Hc.add(o)),o}const Zo=(t,n,o)=>{const r=Wn(n,o);r!==void 0&&t.add(r)};class cb{constructor(n){this._config=lb(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=Uc(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),jc(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return Hr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Hr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Hr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Hr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>Zo(c,n,f))),u.forEach(f=>Zo(c,a,f)),u.forEach(f=>Zo(c,Gn[s]||{},f)),u.forEach(f=>Zo(c,dt,f)),u.forEach(f=>Zo(c,ls,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Hc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,Gn[o]||{},dt.datasets[o]||{},{type:o},dt,ls]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=qc(this._resolverCache,n,a);let c=i;if(ub(i,o)){s.$shared=!1,r=Nn(r)?r():r;const d=this.createResolver(n,r,l);c=fo(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=qc(this._resolverCache,n,r);return Le(o)?fo(s,o,void 0,a):s}}function qc(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:fs(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const db=t=>Le(t)&&Object.getOwnPropertyNames(t).some(n=>Nn(t[n]));function ub(t,n){const{isScriptable:o,isIndexable:r}=Kl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(Nn(l)||db(l))||i&&ht(l))return!0}return!1}var fb="4.5.1";const hb=["top","bottom","left","right","chartArea"];function Gc(t,n){return t==="top"||t==="bottom"||hb.indexOf(t)===-1&&n==="x"}function Xc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Kc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),at(o&&o.onComplete,[t],n)}function mb(t){const n=t.chart,o=n.options.animation;at(o&&o.onProgress,[t],n)}function Yc(t){return ps()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const qr={},Jc=t=>{const n=Yc(t);return Object.values(qr).filter(o=>o.canvas===n).pop()};function pb(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function gb(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class kn{static register(...n){rn.add(...n),Qc()}static unregister(...n){rn.remove(...n),Qc()}constructor(n,o){const r=this.config=new cb(o),a=Yc(n),s=Jc(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||T0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=mp(),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 Q0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Pp(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],qr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}yn.listen(this,"complete",Kc),yn.listen(this,"progress",mb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return qe(n)?o&&s?s:a?r/a:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}get registry(){return rn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():nc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ql(this.canvas,this.ctx),this}stop(){return yn.stop(this),this}resize(n,o){yn.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,nc(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),at(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Je(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=As(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Je(s,i=>{const l=i.options,c=l.id,d=As(c,l),u=Oe(l.type,i.dtype);(l.position===void 0||Gc(l.position,d)!==Gc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const h=rn.getScale(u);f=new h({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Je(a,(i,l)=>{i||delete r[l]}),Je(r,i=>{Wt.configure(this,i,i.options),Wt.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Xc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||Ss(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=rn.getController(l),{datasetElementType:d,dataElementType:u}=dt.datasets[l];Object.assign(c,{dataElementType:rn.getElement(u),datasetElementType:d&&rn.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Je(this.data.datasets,(n,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const o=this.config;o.update();const r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),h=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(h),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Je(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Xc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Je(this.scales,n=>{Wt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!Dl(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;pb(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!Dl(a,r(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Wt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Je(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,Nn(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(yn.has(this)?this.attached&&!yn.running(this)&&yn.start(this):(this.draw(),Kc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(n=0;n<o.length&&o[n].z<=0;++n)o[n].draw(this.chartArea);for(this._drawDatasets();n<o.length;++n)o[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const o=this._sortedMetasets,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o)this._drawDataset(n[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const o=this.ctx,r={meta:n,index:n.index,cancelable:!0},a=fc(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Dr(o,a),n.controller.draw(),a&&Nr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return Ho(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=h0.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:n,_dataset:o,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=Kn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);Ro(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a:void 0))}hide(n,o){this._updateVisibility(n,o,!1)}show(n,o){this._updateVisibility(n,o,!0)}_destroyDatasetMeta(n){const o=this._metasets[n];o&&o.controller&&o.controller._destroy(),delete this._metasets[n]}_stop(){let n,o;for(this.stop(),yn.remove(this),n=0,o=this.data.datasets.length;n<o;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:o}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),ql(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete qr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,o=this.platform,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Je(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(c,d)=>{n[c]&&(o.removeEventListener(this,c,d),delete n[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Je(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Je(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=n.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!_r(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,n),l=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=kp(n),d=gb(n,this._lastEvent,r,c);r&&(this._lastEvent=null,at(s.onHover,[n,l,this],this),c&&at(s.onClick,[n,l,this],this));const u=!_r(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}we(kn,"defaults",dt),we(kn,"instances",qr),we(kn,"overrides",Gn),we(kn,"registry",rn),we(kn,"version",fb),we(kn,"getChart",Jc);function Qc(){return Je(kn.instances,t=>t._plugins.invalidate())}function bb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Ft(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const h=Math.min(d/l,Ft(r-o));t.arc(a,s,l+d/2,o-h/2,r+h/2,!0)}else{const h=Math.min(d/2,i*Ft(r-o));if(u==="round")t.arc(a,s,h,o-Qe/2,r+Qe/2,!0);else if(u==="bevel"){const m=2*h*h,g=-m*Math.cos(o+Qe/2)+a,k=-m*Math.sin(o+Qe/2)+s,y=m*Math.cos(r+Qe/2)+a,p=m*Math.sin(r+Qe/2)+s;t.lineTo(g,k),t.lineTo(y,p)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function yb(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+gt,r-gt),t.closePath(),t.clip()}function xb(t){return us(t,["outerStart","outerEnd","innerStart","innerEnd"])}function kb(t,n,o,r){const a=xb(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return wt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:wt(a.innerStart,0,i),innerEnd:wt(a.innerEnd,0,i)}}function bo(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function Gr(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+r+o-d,0),h=u>0?u+r+o+d:0;let m=0;const g=a-c;if(r){const Q=u>0?u-r:0,j=f>0?f-r:0,G=(Q+j)/2,Y=G!==0?g*G/(G+r):g;m=(g-Y)/2}const k=Math.max(.001,g*f-o/Qe)/f,y=(g-k)/2,p=c+y+m,E=a-y-m,{outerStart:_,outerEnd:B,innerStart:S,innerEnd:w}=kb(n,h,f,E-p),x=f-_,b=f-B,A=p+_/x,V=E-B/b,D=h+S,N=h+w,P=p+S/D,v=E-w/N;if(t.beginPath(),s){const Q=(A+V)/2;if(t.arc(i,l,f,A,Q),t.arc(i,l,f,Q,V),B>0){const H=bo(b,V,i,l);t.arc(H.x,H.y,B,V,E+gt)}const j=bo(N,E,i,l);if(t.lineTo(j.x,j.y),w>0){const H=bo(N,v,i,l);t.arc(H.x,H.y,w,E+gt,v+Math.PI)}const G=(E-w/h+(p+S/h))/2;if(t.arc(i,l,h,E-w/h,G,!0),t.arc(i,l,h,G,p+S/h,!0),S>0){const H=bo(D,P,i,l);t.arc(H.x,H.y,S,P+Math.PI,p-gt)}const Y=bo(x,p,i,l);if(t.lineTo(Y.x,Y.y),_>0){const H=bo(x,A,i,l);t.arc(H.x,H.y,_,p-gt,A)}}else{t.moveTo(i,l);const Q=Math.cos(A)*f+i,j=Math.sin(A)*f+l;t.lineTo(Q,j);const G=Math.cos(V)*f+i,Y=Math.sin(V)*f+l;t.lineTo(G,Y)}t.closePath()}function wb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){Gr(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%it||it))}return Gr(t,n,o,r,c,a),t.fill(),c}function Cb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:h,borderRadius:m}=c,g=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=h,g?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let k=n.endAngle;if(s){Gr(t,n,o,r,k,a);for(let y=0;y<s;++y)t.stroke();isNaN(l)||(k=i+(l%it||it))}g&&yb(t,n,k),c.selfJoin&&k-i>=Qe&&m===0&&u!=="miter"&&bb(t,n,k),s||(Gr(t,n,o,r,k,a),t.stroke())}class er extends xn{constructor(o){super();we(this,"circumference");we(this,"endAngle");we(this,"fullCircles");we(this,"innerRadius");we(this,"outerRadius");we(this,"pixelMargin");we(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=Tl(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,g=Oe(h,d-c),k=jo(i,c,d)&&c!==d,y=g>=it||k,p=bn(l,u+m,f+m);return y&&p}getCenterPoint(o){const{x:r,y:a,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,f=(s+i)/2,h=(l+c+u+d)/2;return{x:r+Math.cos(f)*h,y:a+Math.sin(f)*h}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>it?Math.floor(a/it):0,a===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(Qe,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,wb(o,this,u,i,l),Cb(o,this,u,i,l),o.restore()}}we(er,"id","arc"),we(er,"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}),we(er,"defaultRoutes",{backgroundColor:"backgroundColor"}),we(er,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Zc(t,n,o=n){t.lineCap=Oe(o.borderCapStyle,n.borderCapStyle),t.setLineDash(Oe(o.borderDash,n.borderDash)),t.lineDashOffset=Oe(o.borderDashOffset,n.borderDashOffset),t.lineJoin=Oe(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=Oe(o.borderWidth,n.borderWidth),t.strokeStyle=Oe(o.borderColor,n.borderColor)}function Eb(t,n,o){t.lineTo(o.x,o.y)}function Bb(t){return t.stepped?Gp:t.tension||t.cubicInterpolationMode==="monotone"?Xp:Eb}function ed(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function _b(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=ed(a,o,r),u=Bb(s);let{move:f=!0,reverse:h}=r||{},m,g,k;for(m=0;m<=d;++m)g=a[(l+(h?d-m:m))%i],!g.skip&&(f?(t.moveTo(g.x,g.y),f=!1):u(t,k,g,h,s.stepped),k=g);return c&&(g=a[(l+(h?d:0))%i],u(t,k,g,h,s.stepped)),!!c}function Sb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=ed(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,h,m,g,k,y,p;const E=B=>(i+(d?l-B:B))%s,_=()=>{k!==y&&(t.lineTo(u,y),t.lineTo(u,k),t.lineTo(u,p))};for(c&&(m=a[E(0)],t.moveTo(m.x,m.y)),h=0;h<=l;++h){if(m=a[E(h)],m.skip)continue;const B=m.x,S=m.y,w=B|0;w===g?(S<k?k=S:S>y&&(y=S),u=(f*u+B)/++f):(_(),t.lineTo(B,S),g=w,f=0,k=y=S),p=S}_()}function Vs(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?Sb:_b}function Ab(t){return t.stepped?Sg:t.tension||t.cubicInterpolationMode==="monotone"?Ag:Qn}function Vb(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Zc(t,n.options),t.stroke(a)}function Db(t,n,o,r){const{segments:a,options:s}=n,i=Vs(n);for(const l of a)Zc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const Nb=typeof Path2D=="function";function Mb(t,n,o,r){Nb&&!n.options.segment?Vb(t,n,o,r):Db(t,n,o,r)}class vn extends xn{constructor(n){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,n&&Object.assign(this,n)}updateControlPoints(n,o){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;yg(this._points,r,n,a,o),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Pg(this,this.options.segment))}first(){const n=this.segments,o=this.points;return n.length&&o[n[0].start]}last(){const n=this.segments,o=this.points,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=cc(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=Ab(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:h}=i[d],m=s[f],g=s[h];if(m===g){l.push(m);continue}const k=Math.abs((a-m[o])/(g[o]-m[o])),y=c(m,g,k,r.stepped);y[o]=n[o],l.push(y)}return l.length===1?l[0]:l}pathSegment(n,o,r){return Vs(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=Vs(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),Mb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}we(vn,"id","line"),we(vn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),we(vn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),we(vn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function td(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class Xr extends xn{constructor(o){super();we(this,"parsed");we(this,"skip");we(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return td(this,o,"x",r)}inYRange(o,r){return td(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!Ho(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,ds(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}we(Xr,"id","point"),we(Xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),we(Xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function nd(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-f,u=r+f):(f=s/2,l=o-f,c=o+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function Pn(t,n,o,r){return t?0:wt(n,o,r)}function vb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Xl(r);return{t:Pn(a.top,s.top,0,o),r:Pn(a.right,s.right,0,n),b:Pn(a.bottom,s.bottom,0,o),l:Pn(a.left,s.left,0,n)}}function Pb(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=uo(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Le(a);return{topLeft:Pn(!c||l.top||l.left,s.topLeft,0,i),topRight:Pn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Pn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Pn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function Tb(t){const n=nd(t),o=n.right-n.left,r=n.bottom-n.top,a=vb(t,o/2,r/2),s=Pb(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function Ds(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&nd(t,r);return l&&(a||bn(n,l.left,l.right))&&(s||bn(o,l.top,l.bottom))}function Ob(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function Fb(t,n){t.rect(n.x,n.y,n.w,n.h)}function Ns(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class Kr extends xn{constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){const{inflateAmount:o,options:{borderColor:r,backgroundColor:a}}=this,{inner:s,outer:i}=Tb(this),l=Ob(i.radius)?Mr:Fb;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,Ns(i,o,s)),n.clip(),l(n,Ns(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,Ns(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return Ds(this,n,o,r)}inXRange(n,o){return Ds(this,n,null,o)}inYRange(n,o){return Ds(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}we(Kr,"id","bar"),we(Kr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),we(Kr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function zb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=Yr(c,d,a);const u=Ms(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=cc(n,u);for(const h of f){const m=Ms(o,s[h.start],s[h.end],h.loop),g=lc(l,a,m);for(const k of g)i.push({source:k,target:h,start:{[o]:od(u,m,"start",Math.max)},end:{[o]:od(u,m,"end",Math.min)}})}}return i}function Ms(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Ft(a),s=Ft(s)),{property:t,start:a,end:s}}function Ib(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Yr(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function Yr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function od(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function rd(t,n){let o=[],r=!1;return ht(t)?(r=!0,o=t):o=Ib(t,n),o.length?new vn({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function ad(t){return t&&t.fill!==!1}function Rb(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!kt(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function Lb(t,n,o){const r=Wb(t);if(Le(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return kt(a)&&Math.floor(a)===a?$b(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function $b(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function jb(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Le(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Ub(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Le(t)?r=t.value:r=n.getBaseValue(),r}function Wb(t){const n=t.options,o=n.fill;let r=Oe(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function Hb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=qb(n,o);l.push(rd({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Gb(a,i[u],l)}return new vn({points:a,options:{}})}function qb(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function Gb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Xb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Xb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],h=i[u.end][o];if(bn(a,f,h)){l=a===f,c=a===h;break}}return{first:l,last:c,point:r}}class sd{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:it},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Kb(t){const{chart:n,fill:o,line:r}=t;if(kt(o))return Yb(n,o);if(o==="stack")return Hb(t);if(o==="shape")return!0;const a=Jb(t);return a instanceof sd?a:rd(a,r)}function Yb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Jb(t){return(t.scale||{}).getPointPositionForValue?Zb(t):Qb(t)}function Qb(t){const{scale:n={},fill:o}=t,r=jb(o,n);if(kt(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function Zb(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Ub(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new sd({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function vs(t,n,o){const r=Kb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:h=f,below:m=f}=u||{},g=a.getDatasetMeta(s),k=fc(a,g);r&&i.points.length&&(Dr(t,o),ey(t,{line:i,target:r,above:h,below:m,area:o,scale:l,axis:c,clip:k}),Nr(t))}function ey(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(id(t,r,i.top),Ps(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),id(t,r,i.bottom)):d==="y"&&(ld(t,r,i.left),Ps(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),ld(t,r,i.right),u=a)),Ps(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function id(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Yr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function ld(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Yr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,f.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function Ps(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=zb(o,r,a);for(const{source:d,target:u,start:f,end:h}of c){const{style:{backgroundColor:m=s}={}}=d,g=r!==!0;t.save(),t.fillStyle=m,ty(t,i,l,g&&Ms(a,f,h)),t.beginPath();const k=!!o.pathSegment(t,d);let y;if(g){k?t.closePath():cd(t,r,h,a);const p=!!r.pathSegment(t,u,{move:k,reverse:!0});y=k&&p,y||cd(t,r,f,a)}t.closePath(),t.fill(y?"evenodd":"nonzero"),t.restore()}}function ty(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),f=Math.min(f,o.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function cd(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var ny={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof vn&&(c={visible:t.isDatasetVisible(i),index:i,fill:Lb(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Rb(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&vs(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;ad(s)&&vs(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!ad(r)||o.drawTime!=="beforeDatasetDraw"||vs(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const dd=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},oy=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class ud extends xn{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const n=this.options.labels||{};let o=at(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:n,ctx:o}=this;if(!n.display){this.width=this.height=0;return}const r=n.labels,a=Et(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=dd(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=n;s.textAlign="left",s.textBaseline="middle";let h=-1,m=-u;return this.legendItems.forEach((g,k)=>{const y=r+o/2+s.measureText(g.text).width;(k===0||d[d.length-1]+y+2*l>i)&&(f+=u,d[d.length-(k>0?0:1)]=0,m+=u,h++),c[k]={left:0,top:m,row:h,width:y,height:a},d[d.length-1]+=y+l}),f}_fitCols(n,o,r,a){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-n;let f=l,h=0,m=0,g=0,k=0;return this.legendItems.forEach((y,p)=>{const{itemWidth:E,itemHeight:_}=ry(r,o,s,y,a);p>0&&m+_+2*l>u&&(f+=h+l,d.push({width:h,height:m}),g+=h+l,k++,h=m=0),c[p]={left:g,top:m,col:k,width:E,height:_},h=Math.max(h,E),m+=_+l}),f+=h,d.push({width:h,height:m}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=mo(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=Ct(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=Ct(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=Ct(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=Ct(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;Dr(n,this),this._draw(),Nr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=dt.color,c=mo(n.rtl,this.left,this.width),d=Et(i.font),{padding:u}=i,f=d.size,h=f/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:g,boxHeight:k,itemHeight:y}=dd(i,f),p=function(w,x,b){if(isNaN(g)||g<=0||isNaN(k)||k<0)return;a.save();const A=Oe(b.lineWidth,1);if(a.fillStyle=Oe(b.fillStyle,l),a.lineCap=Oe(b.lineCap,"butt"),a.lineDashOffset=Oe(b.lineDashOffset,0),a.lineJoin=Oe(b.lineJoin,"miter"),a.lineWidth=A,a.strokeStyle=Oe(b.strokeStyle,l),a.setLineDash(Oe(b.lineDash,[])),i.usePointStyle){const V={radius:k*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:A},D=c.xPlus(w,g/2),N=x+h;Gl(a,V,D,N,i.pointStyleWidth&&g)}else{const V=x+Math.max((f-k)/2,0),D=c.leftForLtr(w,g),N=uo(b.borderRadius);a.beginPath(),Object.values(N).some(P=>P!==0)?Mr(a,{x:D,y:V,w:g,h:k,radius:N}):a.rect(D,V,g,k),a.fill(),A!==0&&a.stroke()}a.restore()},E=function(w,x,b){qo(a,b.text,w,x+y/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},_=this.isHorizontal(),B=this._computeTitleHeight();_?m={x:Ct(s,this.left+u,this.right-r[0]),y:this.top+u+B,line:0}:m={x:this.left+u,y:Ct(s,this.top+B+u,this.bottom-o[0].height),line:0},rc(this.ctx,n.textDirection);const S=y+u;this.legendItems.forEach((w,x)=>{a.strokeStyle=w.fontColor,a.fillStyle=w.fontColor;const b=a.measureText(w.text).width,A=c.textAlign(w.textAlign||(w.textAlign=i.textAlign)),V=g+h+b;let D=m.x,N=m.y;c.setWidth(this.width),_?x>0&&D+V+u>this.right&&(N=m.y+=S,m.line++,D=m.x=Ct(s,this.left+u,this.right-r[m.line])):x>0&&N+S>this.bottom&&(D=m.x=D+o[m.line].width+u,m.line++,N=m.y=Ct(s,this.top+B+u,this.bottom-o[m.line].height));const P=c.x(D);if(p(P,N,w),D=Tp(A,D+g+h,_?D+V:this.right,n.rtl),E(c.x(D),N,w),_)m.x+=V+u;else if(typeof w.text!="string"){const v=d.lineHeight;m.y+=fd(w,v)+u}else m.y+=S}),ac(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=Et(o.font),a=Ut(o.padding);if(!o.display)return;const s=mo(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),u=this.top+d,f=Ct(n.align,f,this.right-h);else{const g=this.columnSizes.reduce((k,y)=>Math.max(k,y.height),0);u=d+Ct(n.align,this.top,this.bottom-g-n.labels.padding-this._computeTitleHeight())}const m=Ct(l,f,f+h);i.textAlign=s.textAlign(rs(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,qo(i,o.text,m,u,r)}_computeTitleHeight(){const n=this.options.title,o=Et(n.font),r=Ut(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(bn(n,this.left,this.right)&&bn(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],bn(n,a.left,a.left+a.width)&&bn(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!iy(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=oy(a,r);a&&!s&&at(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&at(o.onHover,[n,r,this],this)}else r&&at(o.onClick,[n,r,this],this)}}function ry(t,n,o,r,a){const s=ay(r,t,n,o),i=sy(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function ay(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function sy(t,n,o){let r=t;return typeof n.text!="string"&&(r=fd(n,o)),r}function fd(t,n){const o=t.text?t.text.length:0;return n*o}function iy(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var ly={id:"legend",_element:ud,start(t,n,o){const r=t.legend=new ud({ctx:t.ctx,options:o,chart:t});Wt.configure(t,r,o),Wt.addBox(t,r)},stop(t){Wt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;Wt.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=Ut(d.borderWidth);return{text:n[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class hd extends xn{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=ht(r.text)?r.text.length:1;this._padding=Ut(r.padding);const s=a*Et(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){const{top:o,left:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=Ct(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=Ct(l,a,o),c=Qe*-.5):(u=s-n,f=Ct(l,o,a),c=Qe*.5),d=a-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=Et(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);qo(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:rs(o.align),textBaseline:"middle",translation:[i,l]})}}function cy(t,n){const o=new hd({ctx:t.ctx,options:n,chart:t});Wt.configure(t,o,n),Wt.addBox(t,o),t.titleBlock=o}var dy={id:"title",_element:hd,start(t,n,o){cy(t,o)},stop(t){const n=t.titleBlock;Wt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;Wt.configure(t,r,o),r.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const tr={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=ns(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function an(t,n){return n&&(ht(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function wn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
16
|
+
*/class Rg{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(n,o,r,a){const s=o.listeners[a],i=o.duration;s.forEach(l=>l({chart:n,initial:o.initial,numSteps:i,currentStep:Math.min(r-o.start,i)}))}_refresh(){this._request||(this._running=!0,this._request=zl.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(n=Date.now()){let o=0;this._charts.forEach((r,a)=>{if(!r.running||!r.items.length)return;const s=r.items;let i=s.length-1,l=!1,c;for(;i>=0;--i)c=s[i],c._active?(c._total>r.duration&&(r.duration=c._total),c.tick(n),l=!0):(s[i]=s[s.length-1],s.pop());l&&(a.draw(),this._notify(a,r,n,"progress")),s.length||(r.running=!1,this._notify(a,r,n,"complete"),r.initial=!1),o+=s.length}),this._lastDate=n,o===0&&(this._running=!1)}_getAnims(n){const o=this._charts;let r=o.get(n);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},o.set(n,r)),r}listen(n,o,r){this._getAnims(n).listeners[o].push(r)}add(n,o){!o||!o.length||this._getAnims(n).items.push(...o)}has(n){return this._getAnims(n).items.length>0}start(n){const o=this._charts.get(n);o&&(o.running=!0,o.start=Date.now(),o.duration=o.items.reduce((r,a)=>Math.max(r,a._duration),0),this._refresh())}running(n){if(!this._running)return!1;const o=this._charts.get(n);return!(!o||!o.running||!o.items.length)}stop(n){const o=this._charts.get(n);if(!o||!o.items.length)return;const r=o.items;let a=r.length-1;for(;a>=0;--a)r[a].cancel();o.items=[],this._notify(n,o,Date.now(),"complete")}remove(n){return this._charts.delete(n)}}var fn=new Rg;const fc="transparent",Ig={boolean(t,n,o){return o>.5?n:t},color(t,n,o){const r=$l(t||fc),a=r.valid&&$l(n||fc);return a&&a.valid?a.mix(r,o).hexString():n},number(t,n,o){return t+(n-t)*o}};class Lg{constructor(n,o,r,a){const s=o[r];a=Tr([n.to,a,s,n.from]);const i=Tr([n.from,s,a]);this._active=!0,this._fn=n.fn||Ig[n.type||typeof i],this._easing=jo[n.easing]||jo.linear,this._start=Math.floor(Date.now()+(n.delay||0)),this._duration=this._total=Math.floor(n.duration),this._loop=!!n.loop,this._target=o,this._prop=r,this._from=i,this._to=a,this._promises=void 0}active(){return this._active}update(n,o,r){if(this._active){this._notify(!1);const a=this._target[this._prop],s=r-this._start,i=this._duration-s;this._start=r,this._duration=Math.floor(Math.max(i,n.duration)),this._total+=s,this._loop=!!n.loop,this._to=Tr([n.to,o,a,n.from]),this._from=Tr([n.from,a,o])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(n){const o=n-this._start,r=this._duration,a=this._prop,s=this._from,i=this._loop,l=this._to;let c;if(this._active=s!==l&&(i||o<r),!this._active){this._target[a]=l,this._notify(!0);return}if(o<0){this._target[a]=s;return}c=o/r%2,c=i&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,l,c)}wait(){const n=this._promises||(this._promises=[]);return new Promise((o,r)=>{n.push({res:o,rej:r})})}_notify(n){const o=n?"res":"rej",r=this._promises||[];for(let a=0;a<r.length;a++)r[a][o]()}}class mc{constructor(n,o){this._chart=n,this._properties=new Map,this.configure(o)}configure(n){if(!Fe(n))return;const o=Object.keys(lt.animation),r=this._properties;Object.getOwnPropertyNames(n).forEach(a=>{const s=n[a];if(!Fe(s))return;const i={};for(const l of o)i[l]=s[l];(dt(s.properties)&&s.properties||[a]).forEach(l=>{(l===a||!r.has(l))&&r.set(l,i)})})}_animateOptions(n,o){const r=o.options,a=jg(n,r);if(!a)return[];const s=this._createAnimations(a,r);return r.$shared&&$g(n.options.$animations,r).then(()=>{n.options=r},()=>{}),s}_createAnimations(n,o){const r=this._properties,a=[],s=n.$animations||(n.$animations={}),i=Object.keys(o),l=Date.now();let c;for(c=i.length-1;c>=0;--c){const d=i[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(n,o));continue}const u=o[d];let f=s[d];const m=r.get(d);if(f)if(m&&f.active()){f.update(m,u,l);continue}else f.cancel();if(!m||!m.duration){n[d]=u;continue}s[d]=f=new Lg(m,n,d,u),a.push(f)}return a}update(n,o){if(this._properties.size===0){Object.assign(n,o);return}const r=this._createAnimations(n,o);if(r.length)return fn.add(this._chart,r),!0}}function $g(t,n){const o=[],r=Object.keys(n);for(let a=0;a<r.length;a++){const s=t[r[a]];s&&s.active()&&o.push(s.wait())}return Promise.all(o)}function jg(t,n){if(!n)return;let o=t.options;if(!o){t.options=n;return}return o.$shared&&(t.options=o=Object.assign({},o,{$shared:!1,$animations:{}})),o}function hc(t,n){const o=t&&t.options||{},r=o.reverse,a=o.min===void 0?n:0,s=o.max===void 0?n:0;return{start:r?s:a,end:r?a:s}}function Ug(t,n,o){if(o===!1)return!1;const r=hc(t,o),a=hc(n,o);return{top:a.end,right:r.end,bottom:a.start,left:r.start}}function Wg(t){let n,o,r,a;return Fe(t)?(n=t.top,o=t.right,r=t.bottom,a=t.left):n=o=r=a=t,{top:n,right:o,bottom:r,left:a,disabled:t===!1}}function pc(t,n){const o=[],r=t._getSortedDatasetMetas(n);let a,s;for(a=0,s=r.length;a<s;++a)o.push(r[a].index);return o}function gc(t,n,o,r={}){const a=t.keys,s=r.mode==="single";let i,l,c,d;if(n===null)return;let u=!1;for(i=0,l=a.length;i<l;++i){if(c=+a[i],c===o){if(u=!0,r.all)continue;break}d=t.values[c],bt(d)&&(s||n===0||Yt(n)===Yt(d))&&(n+=d)}return!u&&!r.all?0:n}function Hg(t,n){const{iScale:o,vScale:r}=n,a=o.axis==="x"?"x":"y",s=r.axis==="x"?"x":"y",i=Object.keys(t),l=new Array(i.length);let c,d,u;for(c=0,d=i.length;c<d;++c)u=i[c],l[c]={[a]:u,[s]:t[u]};return l}function bs(t,n){const o=t&&t.options.stacked;return o||o===void 0&&n.stack!==void 0}function qg(t,n,o){return`${t.id}.${n.id}.${o.stack||o.type}`}function Gg(t){const{min:n,max:o,minDefined:r,maxDefined:a}=t.getUserBounds();return{min:r?n:Number.NEGATIVE_INFINITY,max:a?o:Number.POSITIVE_INFINITY}}function Xg(t,n,o){const r=t[n]||(t[n]={});return r[o]||(r[o]={})}function bc(t,n,o,r){for(const a of n.getMatchingVisibleMetas(r).reverse()){const s=t[a.index];if(o&&s>0||!o&&s<0)return a.index}return null}function yc(t,n){const{chart:o,_cachedMeta:r}=t,a=o._stacks||(o._stacks={}),{iScale:s,vScale:i,index:l}=r,c=s.axis,d=i.axis,u=qg(s,i,r),f=n.length;let m;for(let h=0;h<f;++h){const p=n[h],{[c]:k,[d]:x}=p,g=p._stacks||(p._stacks={});m=g[d]=Xg(a,u,k),m[l]=x,m._top=bc(m,i,!0,r.type),m._bottom=bc(m,i,!1,r.type);const S=m._visualValues||(m._visualValues={});S[l]=x}}function ys(t,n){const o=t.scales;return Object.keys(o).filter(r=>o[r].axis===n).shift()}function Kg(t,n){return Gn(t,{active:!1,dataset:void 0,datasetIndex:n,index:n,mode:"default",type:"dataset"})}function Yg(t,n,o){return Gn(t,{active:!1,dataIndex:n,parsed:void 0,raw:void 0,element:o,index:n,mode:"default",type:"data"})}function qo(t,n){const o=t.controller.index,r=t.vScale&&t.vScale.axis;if(r){n=n||t._parsed;for(const a of n){const s=a._stacks;if(!s||s[r]===void 0||s[r][o]===void 0)return;delete s[r][o],s[r]._visualValues!==void 0&&s[r]._visualValues[o]!==void 0&&delete s[r]._visualValues[o]}}}const xs=t=>t==="reset"||t==="none",xc=(t,n)=>n?t:Object.assign({},t),Jg=(t,n,o)=>t&&!n.hidden&&n._stacked&&{keys:pc(o,!0),values:null};class Jn{constructor(n,o){this.chart=n,this._ctx=n.ctx,this.index=o,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const n=this._cachedMeta;this.configure(),this.linkScales(),n._stacked=bs(n.vScale,n),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(n){this.index!==n&&qo(this._cachedMeta),this.index=n}linkScales(){const n=this.chart,o=this._cachedMeta,r=this.getDataset(),a=(f,m,h,p)=>f==="x"?m:f==="r"?p:h,s=o.xAxisID=Te(r.xAxisID,ys(n,"x")),i=o.yAxisID=Te(r.yAxisID,ys(n,"y")),l=o.rAxisID=Te(r.rAxisID,ys(n,"r")),c=o.indexAxis,d=o.iAxisID=a(c,s,i,l),u=o.vAxisID=a(c,i,s,l);o.xScale=this.getScaleForId(s),o.yScale=this.getScaleForId(i),o.rScale=this.getScaleForId(l),o.iScale=this.getScaleForId(d),o.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(n){return this.chart.scales[n]}_getOtherScale(n){const o=this._cachedMeta;return n===o.iScale?o.vScale:o.iScale}reset(){this._update("reset")}_destroy(){const n=this._cachedMeta;this._data&&vl(this._data,this),n._stacked&&qo(n)}_dataCheck(){const n=this.getDataset(),o=n.data||(n.data=[]),r=this._data;if(Fe(o)){const a=this._cachedMeta;this._data=Hg(o,a)}else if(r!==o){if(r){vl(r,this);const a=this._cachedMeta;qo(a),a._parsed=[]}o&&Object.isExtensible(o)&&Pp(o,this),this._syncList=[],this._data=o}}addElements(){const n=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(n.dataset=new this.datasetElementType)}buildOrUpdateElements(n){const o=this._cachedMeta,r=this.getDataset();let a=!1;this._dataCheck();const s=o._stacked;o._stacked=bs(o.vScale,o),o.stack!==r.stack&&(a=!0,qo(o),o.stack=r.stack),this._resyncElements(n),(a||s!==o._stacked)&&(yc(this,o._parsed),o._stacked=bs(o.vScale,o))}configure(){const n=this.chart.config,o=n.datasetScopeKeys(this._type),r=n.getOptionScopes(this.getDataset(),o,!0);this.options=n.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(n,o){const{_cachedMeta:r,_data:a}=this,{iScale:s,_stacked:i}=r,l=s.axis;let c=n===0&&o===a.length?!0:r._sorted,d=n>0&&r._parsed[n-1],u,f,m;if(this._parsing===!1)r._parsed=a,r._sorted=!0,m=a;else{dt(a[n])?m=this.parseArrayData(r,a,n,o):Fe(a[n])?m=this.parseObjectData(r,a,n,o):m=this.parsePrimitiveData(r,a,n,o);const h=()=>f[l]===null||d&&f[l]<d[l];for(u=0;u<o;++u)r._parsed[u+n]=f=m[u],c&&(h()&&(c=!1),d=f);r._sorted=c}i&&yc(this,m)}parsePrimitiveData(n,o,r,a){const{iScale:s,vScale:i}=n,l=s.axis,c=i.axis,d=s.getLabels(),u=s===i,f=new Array(a);let m,h,p;for(m=0,h=a;m<h;++m)p=m+r,f[m]={[l]:u||s.parse(d[p],p),[c]:i.parse(o[p],p)};return f}parseArrayData(n,o,r,a){const{xScale:s,yScale:i}=n,l=new Array(a);let c,d,u,f;for(c=0,d=a;c<d;++c)u=c+r,f=o[u],l[c]={x:s.parse(f[0],u),y:i.parse(f[1],u)};return l}parseObjectData(n,o,r,a){const{xScale:s,yScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,f,m,h;for(u=0,f=a;u<f;++u)m=u+r,h=o[m],d[u]={x:s.parse(jn(h,l),m),y:i.parse(jn(h,c),m)};return d}getParsed(n){return this._cachedMeta._parsed[n]}getDataElement(n){return this._cachedMeta.data[n]}applyStack(n,o,r){const a=this.chart,s=this._cachedMeta,i=o[n.axis],l={keys:pc(a,!0),values:o._stacks[n.axis]._visualValues};return gc(l,i,s.index,{mode:r})}updateRangeFromParsed(n,o,r,a){const s=r[o.axis];let i=s===null?NaN:s;const l=a&&r._stacks[o.axis];a&&l&&(a.values=l,i=gc(a,s,this._cachedMeta.index)),n.min=Math.min(n.min,i),n.max=Math.max(n.max,i)}getMinMax(n,o){const r=this._cachedMeta,a=r._parsed,s=r._sorted&&n===r.iScale,i=a.length,l=this._getOtherScale(n),c=Jg(o,r,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:f}=Gg(l);let m,h;function p(){h=a[m];const k=h[l.axis];return!bt(h[n.axis])||u>k||f<k}for(m=0;m<i&&!(!p()&&(this.updateRangeFromParsed(d,n,h,c),s));++m);if(s){for(m=i-1;m>=0;--m)if(!p()){this.updateRangeFromParsed(d,n,h,c);break}}return d}getAllParsedValues(n){const o=this._cachedMeta._parsed,r=[];let a,s,i;for(a=0,s=o.length;a<s;++a)i=o[a][n.axis],bt(i)&&r.push(i);return r}getMaxOverflow(){return!1}getLabelAndValue(n){const o=this._cachedMeta,r=o.iScale,a=o.vScale,s=this.getParsed(n);return{label:r?""+r.getLabelForValue(s[r.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(n){const o=this._cachedMeta;this.update(n||"default"),o._clip=Wg(Te(this.options.clip,Ug(o.xScale,o.yScale,this.getMaxOverflow())))}update(n){}draw(){const n=this._ctx,o=this.chart,r=this._cachedMeta,a=r.data||[],s=o.chartArea,i=[],l=this._drawStart||0,c=this._drawCount||a.length-l,d=this.options.drawActiveElementsOnTop;let u;for(r.dataset&&r.dataset.draw(n,s,l,c),u=l;u<l+c;++u){const f=a[u];f.hidden||(f.active&&d?i.push(f):f.draw(n,s))}for(u=0;u<i.length;++u)i[u].draw(n,s)}getStyle(n,o){const r=o?"active":"default";return n===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(n||0,r)}getContext(n,o,r){const a=this.getDataset();let s;if(n>=0&&n<this._cachedMeta.data.length){const i=this._cachedMeta.data[n];s=i.$context||(i.$context=Yg(this.getContext(),n,i)),s.parsed=this.getParsed(n),s.raw=a.data[n],s.index=s.dataIndex=n}else s=this.$context||(this.$context=Kg(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!o,s.mode=r,s}resolveDatasetElementOptions(n){return this._resolveElementOptions(this.datasetElementType.id,n)}resolveDataElementOptions(n,o){return this._resolveElementOptions(this.dataElementType.id,o,n)}_resolveElementOptions(n,o="default",r){const a=o==="active",s=this._cachedDataOpts,i=n+"-"+o,l=s[i],c=this.enableOptionSharing&&Ro(r);if(l)return xc(l,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,n),f=a?[`${n}Hover`,"hover",n,""]:[n,""],m=d.getOptionScopes(this.getDataset(),u),h=Object.keys(lt.elements[n]),p=()=>this.getContext(r,a,o),k=d.resolveNamedOptions(m,h,p,f);return k.$shared&&(k.$shared=c,s[i]=Object.freeze(xc(k,c))),k}_resolveAnimations(n,o,r){const a=this.chart,s=this._cachedDataOpts,i=`animation-${o}`,l=s[i];if(l)return l;let c;if(a.options.animation!==!1){const u=this.chart.config,f=u.datasetAnimationScopeKeys(this._type,o),m=u.getOptionScopes(this.getDataset(),f);c=u.createResolver(m,this.getContext(n,r,o))}const d=new mc(a,c&&c.animations);return c&&c._cacheable&&(s[i]=Object.freeze(d)),d}getSharedOptions(n){if(n.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},n))}includeOptions(n,o){return!o||xs(n)||this.chart._animationsDisabled}_getSharedOptions(n,o){const r=this.resolveDataElementOptions(n,o),a=this._sharedOptions,s=this.getSharedOptions(r),i=this.includeOptions(o,s)||s!==a;return this.updateSharedOptions(s,o,r),{sharedOptions:s,includeOptions:i}}updateElement(n,o,r,a){xs(a)?Object.assign(n,r):this._resolveAnimations(o,a).update(n,r)}updateSharedOptions(n,o,r){n&&!xs(o)&&this._resolveAnimations(void 0,o).update(n,r)}_setStyle(n,o,r,a){n.active=a;const s=this.getStyle(o,a);this._resolveAnimations(o,r,a).update(n,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(n,o,r){this._setStyle(n,r,"active",!1)}setHoverStyle(n,o,r){this._setStyle(n,r,"active",!0)}_removeDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!1)}_setDatasetHoverStyle(){const n=this._cachedMeta.dataset;n&&this._setStyle(n,void 0,"active",!0)}_resyncElements(n){const o=this._data,r=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const a=r.length,s=o.length,i=Math.min(s,a);i&&this.parse(0,i),s>a?this._insertElements(a,s-a,n):s<a&&this._removeElements(s,a-s)}_insertElements(n,o,r=!0){const a=this._cachedMeta,s=a.data,i=n+o;let l;const c=d=>{for(d.length+=o,l=d.length-1;l>=i;l--)d[l]=d[l-o]};for(c(s),l=n;l<i;++l)s[l]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(n,o),r&&this.updateElements(s,n,o,"reset")}updateElements(n,o,r,a){}_removeElements(n,o){const r=this._cachedMeta;if(this._parsing){const a=r._parsed.splice(n,o);r._stacked&&qo(r,a)}r.data.splice(n,o)}_sync(n){if(this._parsing)this._syncList.push(n);else{const[o,r,a]=n;this[o](r,a)}this.chart._dataChanges.push([this.index,...n])}_onDataPush(){const n=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-n,n])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(n,o){o&&this._sync(["_removeElements",n,o]);const r=arguments.length-2;r&&this._sync(["_insertElements",n,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}we(Jn,"defaults",{}),we(Jn,"datasetElementType",null),we(Jn,"dataElementType",null);function Qg(t,n){if(!t._cache.$bar){const o=t.getMatchingVisibleMetas(n);let r=[];for(let a=0,s=o.length;a<s;a++)r=r.concat(o[a].controller.getAllParsedValues(t));t._cache.$bar=Fl(r.sort((a,s)=>a-s))}return t._cache.$bar}function Zg(t){const n=t.iScale,o=Qg(n,t.type);let r=n._length,a,s,i,l;const c=()=>{i===32767||i===-32768||(Ro(l)&&(r=Math.min(r,Math.abs(i-l)||r)),l=i)};for(a=0,s=o.length;a<s;++a)i=n.getPixelForValue(o[a]),c();for(l=void 0,a=0,s=n.ticks.length;a<s;++a)i=n.getPixelForTick(a),c();return r}function e0(t,n,o,r){const a=o.barThickness;let s,i;return Ge(a)?(s=n.min*o.categoryPercentage,i=o.barPercentage):(s=a*r,i=1),{chunk:s/r,ratio:i,start:n.pixels[t]-s/2}}function t0(t,n,o,r){const a=n.pixels,s=a[t];let i=t>0?a[t-1]:null,l=t<a.length-1?a[t+1]:null;const c=o.categoryPercentage;i===null&&(i=s-(l===null?n.end-n.start:l-s)),l===null&&(l=s+s-i);const d=s-(s-Math.min(i,l))/2*c;return{chunk:Math.abs(l-i)/2*c/r,ratio:o.barPercentage,start:d}}function n0(t,n,o,r){const a=o.parse(t[0],r),s=o.parse(t[1],r),i=Math.min(a,s),l=Math.max(a,s);let c=i,d=l;Math.abs(i)>Math.abs(l)&&(c=l,d=i),n[o.axis]=d,n._custom={barStart:c,barEnd:d,start:a,end:s,min:i,max:l}}function kc(t,n,o,r){return dt(t)?n0(t,n,o,r):n[o.axis]=o.parse(t,r),n}function wc(t,n,o,r){const a=t.iScale,s=t.vScale,i=a.getLabels(),l=a===s,c=[];let d,u,f,m;for(d=o,u=o+r;d<u;++d)m=n[d],f={},f[a.axis]=l||a.parse(i[d],d),c.push(kc(m,f,s,d));return c}function ks(t){return t&&t.barStart!==void 0&&t.barEnd!==void 0}function o0(t,n,o){return t!==0?Yt(t):(n.isHorizontal()?1:-1)*(n.min>=o?1:-1)}function r0(t){let n,o,r,a,s;return t.horizontal?(n=t.base>t.x,o="left",r="right"):(n=t.base<t.y,o="bottom",r="top"),n?(a="end",s="start"):(a="start",s="end"),{start:o,end:r,reverse:n,top:a,bottom:s}}function a0(t,n,o,r){let a=n.borderSkipped;const s={};if(!a){t.borderSkipped=s;return}if(a===!0){t.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:i,end:l,reverse:c,top:d,bottom:u}=r0(t);a==="middle"&&o&&(t.enableBorderRadius=!0,(o._top||0)===r?a=d:(o._bottom||0)===r?a=u:(s[Cc(u,i,l,c)]=!0,a=d)),s[Cc(a,i,l,c)]=!0,t.borderSkipped=s}function Cc(t,n,o,r){return r?(t=s0(t,n,o),t=Ec(t,o,n)):t=Ec(t,n,o),t}function s0(t,n,o){return t===n?o:t===o?n:t}function Ec(t,n,o){return t==="start"?n:t==="end"?o:t}function i0(t,{inflateAmount:n},o){t.inflateAmount=n==="auto"?o===1?.33:0:n}class zr extends Jn{parsePrimitiveData(n,o,r,a){return wc(n,o,r,a)}parseArrayData(n,o,r,a){return wc(n,o,r,a)}parseObjectData(n,o,r,a){const{iScale:s,vScale:i}=n,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?l:c,u=i.axis==="x"?l:c,f=[];let m,h,p,k;for(m=r,h=r+a;m<h;++m)k=o[m],p={},p[s.axis]=s.parse(jn(k,d),m),f.push(kc(jn(k,u),p,i,m));return f}updateRangeFromParsed(n,o,r,a){super.updateRangeFromParsed(n,o,r,a);const s=r._custom;s&&o===this._cachedMeta.vScale&&(n.min=Math.min(n.min,s.min),n.max=Math.max(n.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(n){const o=this._cachedMeta,{iScale:r,vScale:a}=o,s=this.getParsed(n),i=s._custom,l=ks(i)?"["+i.start+", "+i.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+r.getLabelForValue(s[r.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const n=this._cachedMeta;n.stack=this.getDataset().stack}update(n){const o=this._cachedMeta;this.updateElements(o.data,0,o.data.length,n)}updateElements(n,o,r,a){const s=a==="reset",{index:i,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),u=this._getRuler(),{sharedOptions:f,includeOptions:m}=this._getSharedOptions(o,a);for(let h=o;h<o+r;h++){const p=this.getParsed(h),k=s||Ge(p[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(h),x=this._calculateBarIndexPixels(h,u),g=(p._stacks||{})[l.axis],S={horizontal:d,base:k.base,enableBorderRadius:!g||ks(p._custom)||i===g._top||i===g._bottom,x:d?k.head:x.center,y:d?x.center:k.head,height:d?x.size:Math.abs(k.size),width:d?Math.abs(k.size):x.size};m&&(S.options=f||this.resolveDataElementOptions(h,n[h].active?"active":a));const B=S.options||n[h].options;a0(S,B,g,i),i0(S,B,u.ratio),this.updateElement(n[h],h,S,a)}}_getStacks(n,o){const{iScale:r}=this._cachedMeta,a=r.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=r.options.stacked,i=[],l=this._cachedMeta.controller.getParsed(o),c=l&&l[r.axis],d=u=>{const f=u._parsed.find(h=>h[r.axis]===c),m=f&&f[u.vScale.axis];if(Ge(m)||isNaN(m))return!0};for(const u of a)if(!(o!==void 0&&d(u))&&((s===!1||i.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&i.push(u.stack),u.index===n))break;return i.length||i.push(void 0),i}_getStackCount(n){return this._getStacks(void 0,n).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const n=this.chart.scales,o=this.chart.options.indexAxis;return Object.keys(n).filter(r=>n[r].axis===o).shift()}_getAxis(){const n={},o=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)n[Te(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,o)]=!0;return Object.keys(n)}_getStackIndex(n,o,r){const a=this._getStacks(n,r),s=o!==void 0?a.indexOf(o):-1;return s===-1?a.length-1:s}_getRuler(){const n=this.options,o=this._cachedMeta,r=o.iScale,a=[];let s,i;for(s=0,i=o.data.length;s<i;++s)a.push(r.getPixelForValue(this.getParsed(s)[r.axis],s));const l=n.barThickness;return{min:l||Zg(o),pixels:a,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:n.grouped,ratio:l?1:n.categoryPercentage*n.barPercentage}}_calculateBarValuePixels(n){const{_cachedMeta:{vScale:o,_stacked:r,index:a},options:{base:s,minBarLength:i}}=this,l=s||0,c=this.getParsed(n),d=c._custom,u=ks(d);let f=c[o.axis],m=0,h=r?this.applyStack(o,c,r):f,p,k;h!==f&&(m=h-f,h=f),u&&(f=d.barStart,h=d.barEnd-d.barStart,f!==0&&Yt(f)!==Yt(d.barEnd)&&(m=0),m+=f);const x=!Ge(s)&&!u?s:m;let g=o.getPixelForValue(x);if(this.chart.getDataVisibility(n)?p=o.getPixelForValue(m+h):p=g,k=p-g,Math.abs(k)<i){k=o0(k,o,l)*i,f===l&&(g-=k/2);const S=o.getPixelForDecimal(0),B=o.getPixelForDecimal(1),E=Math.min(S,B),_=Math.max(S,B);g=Math.max(Math.min(g,_),E),p=g+k,r&&!u&&(c._stacks[o.axis]._visualValues[a]=o.getValueForPixel(p)-o.getValueForPixel(g))}if(g===o.getPixelForValue(l)){const S=Yt(k)*o.getLineWidthForValue(l)/2;g+=S,k-=S}return{size:k,base:g,head:p,center:p+k/2}}_calculateBarIndexPixels(n,o){const r=o.scale,a=this.options,s=a.skipNull,i=Te(a.maxBarThickness,1/0);let l,c;const d=this._getAxisCount();if(o.grouped){const u=s?this._getStackCount(n):o.stackCount,f=a.barThickness==="flex"?t0(n,o,a,u*d):e0(n,o,a,u*d),m=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(Te(m,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?n:void 0)+h;l=f.start+f.chunk*p+f.chunk/2,c=Math.min(i,f.chunk*f.ratio)}else l=r.getPixelForValue(this.getParsed(n)[r.axis],n),c=Math.min(i,o.min*o.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const n=this._cachedMeta,o=n.vScale,r=n.data,a=r.length;let s=0;for(;s<a;++s)this.getParsed(s)[o.axis]!==null&&!r[s].hidden&&r[s].draw(this._ctx)}}we(zr,"id","bar"),we(zr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),we(zr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function l0(t,n,o){let r=1,a=1,s=0,i=0;if(n<rt){const l=t,c=l+n,d=Math.cos(l),u=Math.sin(l),f=Math.cos(c),m=Math.sin(c),h=(B,E,_)=>$o(B,l,c,!0)?1:Math.max(E,E*o,_,_*o),p=(B,E,_)=>$o(B,l,c,!0)?-1:Math.min(E,E*o,_,_*o),k=h(0,d,f),x=h(ft,u,m),g=p(Je,d,f),S=p(Je+ft,u,m);r=(k-g)/2,a=(x-S)/2,s=-(k+g)/2,i=-(x+S)/2}return{ratioX:r,ratioY:a,offsetX:s,offsetY:i}}class fo extends Jn{constructor(n,o){super(n,o),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(n,o){const r=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=r;else{let s=c=>+r[c];if(Fe(r[n])){const{key:c="value"}=this._parsing;s=d=>+jn(r[d],c)}let i,l;for(i=n,l=n+o;i<l;++i)a._parsed[i]=s(i)}}_getRotation(){return dn(this.options.rotation-90)}_getCircumference(){return dn(this.options.circumference)}_getRotationExtents(){let n=rt,o=-rt;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const a=this.chart.getDatasetMeta(r).controller,s=a._getRotation(),i=a._getCircumference();n=Math.min(n,s),o=Math.max(o,s+i)}return{rotation:n,circumference:o-n}}update(n){const o=this.chart,{chartArea:r}=o,a=this._cachedMeta,s=a.data,i=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,l=Math.max((Math.min(r.width,r.height)-i)/2,0),c=Math.min(gp(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:u,rotation:f}=this._getRotationExtents(),{ratioX:m,ratioY:h,offsetX:p,offsetY:k}=l0(f,u,c),x=(r.width-i)/m,g=(r.height-i)/h,S=Math.max(Math.min(x,g)/2,0),B=_l(this.options.radius,S),E=Math.max(B*c,0),_=(B-E)/this._getVisibleDatasetWeightTotal();this.offsetX=p*B,this.offsetY=k*B,a.total=this.calculateTotal(),this.outerRadius=B-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,0),this.updateElements(s,0,s.length,n)}_circumference(n,o){const r=this.options,a=this._cachedMeta,s=this._getCircumference();return o&&r.animation.animateRotate||!this.chart.getDataVisibility(n)||a._parsed[n]===null||a.data[n].hidden?0:this.calculateCircumference(a._parsed[n]*s/rt)}updateElements(n,o,r,a){const s=a==="reset",i=this.chart,l=i.chartArea,d=i.options.animation,u=(l.left+l.right)/2,f=(l.top+l.bottom)/2,m=s&&d.animateScale,h=m?0:this.innerRadius,p=m?0:this.outerRadius,{sharedOptions:k,includeOptions:x}=this._getSharedOptions(o,a);let g=this._getRotation(),S;for(S=0;S<o;++S)g+=this._circumference(S,s);for(S=o;S<o+r;++S){const B=this._circumference(S,s),E=n[S],_={x:u+this.offsetX,y:f+this.offsetY,startAngle:g,endAngle:g+B,circumference:B,outerRadius:p,innerRadius:h};x&&(_.options=k||this.resolveDataElementOptions(S,E.active?"active":a)),g+=B,this.updateElement(E,S,_,a)}}calculateTotal(){const n=this._cachedMeta,o=n.data;let r=0,a;for(a=0;a<o.length;a++){const s=n._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!o[a].hidden&&(r+=Math.abs(s))}return r}calculateCircumference(n){const o=this._cachedMeta.total;return o>0&&!isNaN(n)?rt*(Math.abs(n)/o):0}getLabelAndValue(n){const o=this._cachedMeta,r=this.chart,a=r.data.labels||[],s=is(o._parsed[n],r.options.locale);return{label:a[n]||"",value:s}}getMaxBorderWidth(n){let o=0;const r=this.chart;let a,s,i,l,c;if(!n){for(a=0,s=r.data.datasets.length;a<s;++a)if(r.isDatasetVisible(a)){i=r.getDatasetMeta(a),n=i.data,l=i.controller;break}}if(!n)return 0;for(a=0,s=n.length;a<s;++a)c=l.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(o=Math.max(o,c.borderWidth||0,c.hoverBorderWidth||0));return o}getMaxOffset(n){let o=0;for(let r=0,a=n.length;r<a;++r){const s=this.resolveDataElementOptions(r);o=Math.max(o,s.offset||0,s.hoverOffset||0)}return o}_getRingWeightOffset(n){let o=0;for(let r=0;r<n;++r)this.chart.isDatasetVisible(r)&&(o+=this._getRingWeight(r));return o}_getRingWeight(n){return Math.max(Te(this.chart.data.datasets[n].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}we(fo,"id","doughnut"),we(fo,"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"}),we(fo,"descriptors",{_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"&&!n.startsWith("borderDash")&&!n.startsWith("hoverBorderDash")}),we(fo,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const o=n.data,{labels:{pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=n.legend.options;return o.labels.length&&o.datasets.length?o.labels.map((c,d)=>{const f=n.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:f.backgroundColor,fontColor:s,hidden:!n.getDataVisibility(d),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:a,pointStyle:r,borderRadius:i&&(l||f.borderRadius),index:d}}):[]}},onClick(n,o,r){r.chart.toggleDataVisibility(o.index),r.chart.update()}}}});class Rr extends Jn{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(n){const o=this._cachedMeta,{dataset:r,data:a=[],_dataset:s}=o,i=this.chart._animationsDisabled;let{start:l,count:c}=Fp(o,a,i);this._drawStart=l,this._drawCount=c,zp(o)&&(l=0,c=a.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!s._decimated,r.points=a;const d=this.resolveDatasetElementOptions(n);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!i,options:d},n),this.updateElements(a,l,c,n)}updateElements(n,o,r,a){const s=a==="reset",{iScale:i,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:f}=this._getSharedOptions(o,a),m=i.axis,h=l.axis,{spanGaps:p,segment:k}=this.options,x=Lo(p)?p:Number.POSITIVE_INFINITY,g=this.chart._animationsDisabled||s||a==="none",S=o+r,B=n.length;let E=o>0&&this.getParsed(o-1);for(let _=0;_<B;++_){const w=n[_],y=g?w:{};if(_<o||_>=S){y.skip=!0;continue}const b=this.getParsed(_),C=Ge(b[h]),V=y[m]=i.getPixelForValue(b[m],_),D=y[h]=s||C?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,b,c):b[h],_);y.skip=isNaN(V)||isNaN(D)||C,y.stop=_>0&&Math.abs(b[m]-E[m])>x,k&&(y.parsed=b,y.raw=d.data[_]),f&&(y.options=u||this.resolveDataElementOptions(_,w.active?"active":a)),g||this.updateElement(w,_,y,a),E=b}}getMaxOverflow(){const n=this._cachedMeta,o=n.dataset,r=o.options&&o.options.borderWidth||0,a=n.data||[];if(!a.length)return r;const s=a[0].size(this.resolveDataElementOptions(0)),i=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(r,s,i)/2}draw(){const n=this._cachedMeta;n.dataset.updateControlPoints(this.chart.chartArea,n.iScale.axis),super.draw()}}we(Rr,"id","line"),we(Rr,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),we(Rr,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ws extends fo{}we(ws,"id","pie"),we(ws,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});function Qn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Cs{constructor(n){we(this,"options");this.options=n||{}}static override(n){Object.assign(Cs.prototype,n)}init(){}formats(){return Qn()}parse(){return Qn()}format(){return Qn()}add(){return Qn()}diff(){return Qn()}startOf(){return Qn()}endOf(){return Qn()}}var c0={_date:Cs};function d0(t,n,o,r){const{controller:a,data:s,_sorted:i}=t,l=a._cachedMeta.iScale,c=t.dataset&&t.dataset.options?t.dataset.options.spanGaps:null;if(l&&n===l.axis&&n!=="r"&&i&&s.length){const d=l._reversePixels?Mp:Wn;if(r){if(a._sharedOptions){const u=s[0],f=typeof u.getRange=="function"&&u.getRange(n);if(f){const m=d(s,n,o-f),h=d(s,n,o+f);return{lo:m.lo,hi:h.hi}}}}else{const u=d(s,n,o);if(c){const{vScale:f}=a._cachedMeta,{_parsed:m}=t,h=m.slice(0,u.lo+1).reverse().findIndex(k=>!Ge(k[f.axis]));u.lo-=Math.max(0,h);const p=m.slice(u.hi).findIndex(k=>!Ge(k[f.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function Ir(t,n,o,r,a){const s=t.getSortedVisibleDatasetMetas(),i=o[n];for(let l=0,c=s.length;l<c;++l){const{index:d,data:u}=s[l],{lo:f,hi:m}=d0(s[l],n,i,a);for(let h=f;h<=m;++h){const p=u[h];p.skip||r(p,d,h)}}}function u0(t){const n=t.indexOf("x")!==-1,o=t.indexOf("y")!==-1;return function(r,a){const s=n?Math.abs(r.x-a.x):0,i=o?Math.abs(r.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(i,2))}}function Es(t,n,o,r,a){const s=[];return!a&&!t.isPointInArea(n)||Ir(t,o,n,function(l,c,d){!a&&!Wo(l,t.chartArea,0)||l.inRange(n.x,n.y,r)&&s.push({element:l,datasetIndex:c,index:d})},!0),s}function f0(t,n,o,r){let a=[];function s(i,l,c){const{startAngle:d,endAngle:u}=i.getProps(["startAngle","endAngle"],r),{angle:f}=Pl(i,{x:n.x,y:n.y});$o(f,d,u)&&a.push({element:i,datasetIndex:l,index:c})}return Ir(t,o,n,s),a}function m0(t,n,o,r,a,s){let i=[];const l=u0(o);let c=Number.POSITIVE_INFINITY;function d(u,f,m){const h=u.inRange(n.x,n.y,a);if(r&&!h)return;const p=u.getCenterPoint(a);if(!(!!s||t.isPointInArea(p))&&!h)return;const x=l(n,p);x<c?(i=[{element:u,datasetIndex:f,index:m}],c=x):x===c&&i.push({element:u,datasetIndex:f,index:m})}return Ir(t,o,n,d),i}function Bs(t,n,o,r,a,s){return!s&&!t.isPointInArea(n)?[]:o==="r"&&!r?f0(t,n,o,a):m0(t,n,o,r,a,s)}function Bc(t,n,o,r,a){const s=[],i=o==="x"?"inXRange":"inYRange";let l=!1;return Ir(t,o,n,(c,d,u)=>{c[i]&&c[i](n[o],a)&&(s.push({element:c,datasetIndex:d,index:u}),l=l||c.inRange(n.x,n.y,a))}),r&&!l?[]:s}var h0={modes:{index(t,n,o,r){const a=Kn(n,t),s=o.axis||"x",i=o.includeInvisible||!1,l=o.intersect?Es(t,a,s,r,i):Bs(t,a,s,!1,r,i),c=[];return l.length?(t.getSortedVisibleDatasetMetas().forEach(d=>{const u=l[0].index,f=d.data[u];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:u})}),c):[]},dataset(t,n,o,r){const a=Kn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;let l=o.intersect?Es(t,a,s,r,i):Bs(t,a,s,!1,r,i);if(l.length>0){const c=l[0].datasetIndex,d=t.getDatasetMeta(c).data;l=[];for(let u=0;u<d.length;++u)l.push({element:d[u],datasetIndex:c,index:u})}return l},point(t,n,o,r){const a=Kn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Es(t,a,s,r,i)},nearest(t,n,o,r){const a=Kn(n,t),s=o.axis||"xy",i=o.includeInvisible||!1;return Bs(t,a,s,o.intersect,r,i)},x(t,n,o,r){const a=Kn(n,t);return Bc(t,a,"x",o.intersect,r)},y(t,n,o,r){const a=Kn(n,t);return Bc(t,a,"y",o.intersect,r)}}};const _c=["left","top","right","bottom"];function Go(t,n){return t.filter(o=>o.pos===n)}function Sc(t,n){return t.filter(o=>_c.indexOf(o.pos)===-1&&o.box.axis===n)}function Xo(t,n){return t.sort((o,r)=>{const a=n?r:o,s=n?o:r;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function p0(t){const n=[];let o,r,a,s,i,l;for(o=0,r=(t||[]).length;o<r;++o)a=t[o],{position:s,options:{stack:i,stackWeight:l=1}}=a,n.push({index:o,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:i&&s+i,stackWeight:l});return n}function g0(t){const n={};for(const o of t){const{stack:r,pos:a,stackWeight:s}=o;if(!r||!_c.includes(a))continue;const i=n[r]||(n[r]={count:0,placed:0,weight:0,size:0});i.count++,i.weight+=s}return n}function b0(t,n){const o=g0(t),{vBoxMaxWidth:r,hBoxMaxHeight:a}=n;let s,i,l;for(s=0,i=t.length;s<i;++s){l=t[s];const{fullSize:c}=l.box,d=o[l.stack],u=d&&l.stackWeight/d.weight;l.horizontal?(l.width=u?u*r:c&&n.availableWidth,l.height=a):(l.width=r,l.height=u?u*a:c&&n.availableHeight)}return o}function y0(t){const n=p0(t),o=Xo(n.filter(d=>d.box.fullSize),!0),r=Xo(Go(n,"left"),!0),a=Xo(Go(n,"right")),s=Xo(Go(n,"top"),!0),i=Xo(Go(n,"bottom")),l=Sc(n,"x"),c=Sc(n,"y");return{fullSize:o,leftAndTop:r.concat(s),rightAndBottom:a.concat(c).concat(i).concat(l),chartArea:Go(n,"chartArea"),vertical:r.concat(a).concat(c),horizontal:s.concat(i).concat(l)}}function Vc(t,n,o,r){return Math.max(t[o],n[o])+Math.max(t[r],n[r])}function Ac(t,n){t.top=Math.max(t.top,n.top),t.left=Math.max(t.left,n.left),t.bottom=Math.max(t.bottom,n.bottom),t.right=Math.max(t.right,n.right)}function x0(t,n,o,r){const{pos:a,box:s}=o,i=t.maxPadding;if(!Fe(a)){o.size&&(t[a]-=o.size);const f=r[o.stack]||{size:0,count:1};f.size=Math.max(f.size,o.horizontal?s.height:s.width),o.size=f.size/f.count,t[a]+=o.size}s.getPadding&&Ac(i,s.getPadding());const l=Math.max(0,n.outerWidth-Vc(i,t,"left","right")),c=Math.max(0,n.outerHeight-Vc(i,t,"top","bottom")),d=l!==t.w,u=c!==t.h;return t.w=l,t.h=c,o.horizontal?{same:d,other:u}:{same:u,other:d}}function k0(t){const n=t.maxPadding;function o(r){const a=Math.max(n[r]-t[r],0);return t[r]+=a,a}t.y+=o("top"),t.x+=o("left"),o("right"),o("bottom")}function w0(t,n){const o=n.maxPadding;function r(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(i=>{s[i]=Math.max(n[i],o[i])}),s}return r(t?["left","right"]:["top","bottom"])}function Ko(t,n,o,r){const a=[];let s,i,l,c,d,u;for(s=0,i=t.length,d=0;s<i;++s){l=t[s],c=l.box,c.update(l.width||n.w,l.height||n.h,w0(l.horizontal,n));const{same:f,other:m}=x0(n,o,l,r);d|=f&&a.length,u=u||m,c.fullSize||a.push(l)}return d&&Ko(a,n,o,r)||u}function Lr(t,n,o,r,a){t.top=o,t.left=n,t.right=n+r,t.bottom=o+a,t.width=r,t.height=a}function Dc(t,n,o,r){const a=o.padding;let{x:s,y:i}=n;for(const l of t){const c=l.box,d=r[l.stack]||{placed:0,weight:1},u=l.stackWeight/d.weight||1;if(l.horizontal){const f=n.w*u,m=d.size||c.height;Ro(d.start)&&(i=d.start),c.fullSize?Lr(c,a.left,i,o.outerWidth-a.right-a.left,m):Lr(c,n.left+d.placed,i,f,m),d.start=i,d.placed+=f,i=c.bottom}else{const f=n.h*u,m=d.size||c.width;Ro(d.start)&&(s=d.start),c.fullSize?Lr(c,s,a.top,m,o.outerHeight-a.bottom-a.top):Lr(c,s,n.top+d.placed,m,f),d.start=s,d.placed+=f,s=c.right}}n.x=s,n.y=i}var Rt={addBox(t,n){t.boxes||(t.boxes=[]),n.fullSize=n.fullSize||!1,n.position=n.position||"top",n.weight=n.weight||0,n._layers=n._layers||function(){return[{z:0,draw(o){n.draw(o)}}]},t.boxes.push(n)},removeBox(t,n){const o=t.boxes?t.boxes.indexOf(n):-1;o!==-1&&t.boxes.splice(o,1)},configure(t,n,o){n.fullSize=o.fullSize,n.position=o.position,n.weight=o.weight},update(t,n,o,r){if(!t)return;const a=zt(t.options.layout.padding),s=Math.max(n-a.width,0),i=Math.max(o-a.height,0),l=y0(t.boxes),c=l.vertical,d=l.horizontal;Ye(t.boxes,k=>{typeof k.beforeLayout=="function"&&k.beforeLayout()});const u=c.reduce((k,x)=>x.box.options&&x.box.options.display===!1?k:k+1,0)||1,f=Object.freeze({outerWidth:n,outerHeight:o,padding:a,availableWidth:s,availableHeight:i,vBoxMaxWidth:s/2/u,hBoxMaxHeight:i/2}),m=Object.assign({},a);Ac(m,zt(r));const h=Object.assign({maxPadding:m,w:s,h:i,x:a.left,y:a.top},a),p=b0(c.concat(d),f);Ko(l.fullSize,h,f,p),Ko(c,h,f,p),Ko(d,h,f,p)&&Ko(c,h,f,p),k0(h),Dc(l.leftAndTop,h,f,p),h.x+=h.w,h.y+=h.h,Dc(l.rightAndBottom,h,f,p),t.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Ye(l.chartArea,k=>{const x=k.box;Object.assign(x,t.chartArea),x.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class Nc{acquireContext(n,o){}releaseContext(n){return!1}addEventListener(n,o,r){}removeEventListener(n,o,r){}getDevicePixelRatio(){return 1}getMaximumSize(n,o,r,a){return o=Math.max(0,o||n.width),r=r||n.height,{width:o,height:Math.max(0,a?Math.floor(o/a):r)}}isAttached(n){return!0}updateConfig(n){}}class C0 extends Nc{acquireContext(n){return n&&n.getContext&&n.getContext("2d")||null}updateConfig(n){n.options.animation=!1}}const $r="$chartjs",E0={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mc=t=>t===null||t==="";function B0(t,n){const o=t.style,r=t.getAttribute("height"),a=t.getAttribute("width");if(t[$r]={initial:{height:r,width:a,style:{display:o.display,height:o.height,width:o.width}}},o.display=o.display||"block",o.boxSizing=o.boxSizing||"border-box",Mc(a)){const s=nc(t,"width");s!==void 0&&(t.width=s)}if(Mc(r))if(t.style.height==="")t.height=t.width/(n||2);else{const s=nc(t,"height");s!==void 0&&(t.height=s)}return t}const Tc=Sg?{passive:!0}:!1;function _0(t,n,o){t&&t.addEventListener(n,o,Tc)}function S0(t,n,o){t&&t.canvas&&t.canvas.removeEventListener(n,o,Tc)}function V0(t,n){const o=E0[t.type]||t.type,{x:r,y:a}=Kn(t,n);return{type:o,chart:n,native:t,x:r!==void 0?r:null,y:a!==void 0?a:null}}function jr(t,n){for(const o of t)if(o===n||o.contains(n))return!0}function A0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.addedNodes,r),i=i&&!jr(l.removedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}function D0(t,n,o){const r=t.canvas,a=new MutationObserver(s=>{let i=!1;for(const l of s)i=i||jr(l.removedNodes,r),i=i&&!jr(l.addedNodes,r);i&&o()});return a.observe(document,{childList:!0,subtree:!0}),a}const Yo=new Map;let Pc=0;function Oc(){const t=window.devicePixelRatio;t!==Pc&&(Pc=t,Yo.forEach((n,o)=>{o.currentDevicePixelRatio!==t&&n()}))}function N0(t,n){Yo.size||window.addEventListener("resize",Oc),Yo.set(t,n)}function M0(t){Yo.delete(t),Yo.size||window.removeEventListener("resize",Oc)}function T0(t,n,o){const r=t.canvas,a=r&&gs(r);if(!a)return;const s=Rl((l,c)=>{const d=a.clientWidth;o(l,c),d<a.clientWidth&&o()},window),i=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return i.observe(a),N0(t,s),i}function _s(t,n,o){o&&o.disconnect(),n==="resize"&&M0(t)}function P0(t,n,o){const r=t.canvas,a=Rl(s=>{t.ctx!==null&&o(V0(s,t))},t);return _0(r,n,a),a}class O0 extends Nc{acquireContext(n,o){const r=n&&n.getContext&&n.getContext("2d");return r&&r.canvas===n?(B0(n,o),r):null}releaseContext(n){const o=n.canvas;if(!o[$r])return!1;const r=o[$r].initial;["height","width"].forEach(s=>{const i=r[s];Ge(i)?o.removeAttribute(s):o.setAttribute(s,i)});const a=r.style||{};return Object.keys(a).forEach(s=>{o.style[s]=a[s]}),o.width=o.width,delete o[$r],!0}addEventListener(n,o,r){this.removeEventListener(n,o);const a=n.$proxies||(n.$proxies={}),i={attach:A0,detach:D0,resize:T0}[o]||P0;a[o]=i(n,o,r)}removeEventListener(n,o){const r=n.$proxies||(n.$proxies={}),a=r[o];if(!a)return;({attach:_s,detach:_s,resize:_s}[o]||S0)(n,o,a),r[o]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(n,o,r,a){return _g(n,o,r,a)}isAttached(n){const o=n&&gs(n);return!!(o&&o.isConnected)}}function v0(t){return!ps()||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas?C0:O0}let mn=(wa=class{constructor(){we(this,"x");we(this,"y");we(this,"active",!1);we(this,"options");we(this,"$animations")}tooltipPosition(n){const{x:o,y:r}=this.getProps(["x","y"],n);return{x:o,y:r}}hasValue(){return Lo(this.x)&&Lo(this.y)}getProps(n,o){const r=this.$animations;if(!o||!r)return this;const a={};return n.forEach(s=>{a[s]=r[s]&&r[s].active()?r[s]._to:this[s]}),a}},we(wa,"defaults",{}),we(wa,"defaultRoutes"),wa);function F0(t,n){const o=t.options.ticks,r=z0(t),a=Math.min(o.maxTicksLimit||r,r),s=o.major.enabled?I0(n):[],i=s.length,l=s[0],c=s[i-1],d=[];if(i>a)return L0(n,d,s,i/a),d;const u=R0(s,n,a);if(i>0){let f,m;const h=i>1?Math.round((c-l)/(i-1)):null;for(Ur(n,d,u,Ge(h)?0:l-h,l),f=0,m=i-1;f<m;f++)Ur(n,d,u,s[f],s[f+1]);return Ur(n,d,u,c,Ge(h)?n.length:c+h),d}return Ur(n,d,u),d}function z0(t){const n=t.options.offset,o=t._tickSize(),r=t._length/o+(n?0:1),a=t._maxLength/o;return Math.floor(Math.min(r,a))}function R0(t,n,o){const r=$0(t),a=n.length/o;if(!r)return Math.max(a,1);const s=Bp(r);for(let i=0,l=s.length-1;i<l;i++){const c=s[i];if(c>a)return c}return Math.max(a,1)}function I0(t){const n=[];let o,r;for(o=0,r=t.length;o<r;o++)t[o].major&&n.push(o);return n}function L0(t,n,o,r){let a=0,s=o[0],i;for(r=Math.ceil(r),i=0;i<t.length;i++)i===s&&(n.push(t[i]),a++,s=o[a*r])}function Ur(t,n,o,r,a){const s=Te(r,0),i=Math.min(Te(a,t.length),t.length);let l=0,c,d,u;for(o=Math.ceil(o),a&&(c=a-r,o=c/Math.floor(c/o)),u=s;u<0;)l++,u=Math.round(s+l*o);for(d=Math.max(s,0);d<i;d++)d===u&&(n.push(t[d]),l++,u=Math.round(s+l*o))}function $0(t){const n=t.length;let o,r;if(n<2)return!1;for(r=t[0],o=1;o<n;++o)if(t[o]-t[o-1]!==r)return!1;return r}const j0=t=>t==="left"?"right":t==="right"?"left":t,vc=(t,n,o)=>n==="top"||n==="left"?t[n]+o:t[n]-o,Fc=(t,n)=>Math.min(n||t,t);function zc(t,n){const o=[],r=t.length/n,a=t.length;let s=0;for(;s<a;s+=r)o.push(t[Math.floor(s)]);return o}function U0(t,n,o){const r=t.ticks.length,a=Math.min(n,r-1),s=t._startPixel,i=t._endPixel,l=1e-6;let c=t.getPixelForTick(a),d;if(!(o&&(r===1?d=Math.max(c-s,i-c):n===0?d=(t.getPixelForTick(1)-c)/2:d=(c-t.getPixelForTick(a-1))/2,c+=a<n?d:-d,c<s-l||c>i+l)))return c}function W0(t,n){Ye(t,o=>{const r=o.gc,a=r.length/2;let s;if(a>n){for(s=0;s<a;++s)delete o.data[r[s]];r.splice(0,a)}})}function Jo(t){return t.drawTicks?t.tickLength:0}function Rc(t,n){if(!t.display)return 0;const o=kt(t.font,n),r=zt(t.padding);return(dt(t.text)?t.text.length:1)*o.lineHeight+r.height}function H0(t,n){return Gn(t,{scale:n,type:"scale"})}function q0(t,n,o){return Gn(t,{tick:o,index:n,type:"tick"})}function G0(t,n,o){let r=rs(t);return(o&&n!=="right"||!o&&n==="right")&&(r=j0(r)),r}function X0(t,n,o,r){const{top:a,left:s,bottom:i,right:l,chart:c}=t,{chartArea:d,scales:u}=c;let f=0,m,h,p;const k=i-a,x=l-s;if(t.isHorizontal()){if(h=xt(r,s,l),Fe(o)){const g=Object.keys(o)[0],S=o[g];p=u[g].getPixelForValue(S)+k-n}else o==="center"?p=(d.bottom+d.top)/2+k-n:p=vc(t,o,n);m=l-s}else{if(Fe(o)){const g=Object.keys(o)[0],S=o[g];h=u[g].getPixelForValue(S)-x+n}else o==="center"?h=(d.left+d.right)/2-x+n:h=vc(t,o,n);p=xt(r,i,a),f=o==="left"?-ft:ft}return{titleX:h,titleY:p,maxWidth:m,rotation:f}}class mo extends mn{constructor(n){super(),this.id=n.id,this.type=n.type,this.options=void 0,this.ctx=n.ctx,this.chart=n.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(n){this.options=n.setContext(this.getContext()),this.axis=n.axis,this._userMin=this.parse(n.min),this._userMax=this.parse(n.max),this._suggestedMin=this.parse(n.suggestedMin),this._suggestedMax=this.parse(n.suggestedMax)}parse(n,o){return n}getUserBounds(){let{_userMin:n,_userMax:o,_suggestedMin:r,_suggestedMax:a}=this;return n=Kt(n,Number.POSITIVE_INFINITY),o=Kt(o,Number.NEGATIVE_INFINITY),r=Kt(r,Number.POSITIVE_INFINITY),a=Kt(a,Number.NEGATIVE_INFINITY),{min:Kt(n,r),max:Kt(o,a),minDefined:bt(n),maxDefined:bt(o)}}getMinMax(n){let{min:o,max:r,minDefined:a,maxDefined:s}=this.getUserBounds(),i;if(a&&s)return{min:o,max:r};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)i=l[c].controller.getMinMax(this,n),a||(o=Math.min(o,i.min)),s||(r=Math.max(r,i.max));return o=s&&o>r?r:o,r=a&&o>r?o:r,{min:Kt(o,Kt(r,o)),max:Kt(r,Kt(o,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const n=this.chart.data;return this.options.labels||(this.isHorizontal()?n.xLabels:n.yLabels)||n.labels||[]}getLabelItems(n=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(n))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){nt(this.options.beforeUpdate,[this])}update(n,o,r){const{beginAtZero:a,grace:s,ticks:i}=this.options,l=i.sampleSize;this.beforeUpdate(),this.maxWidth=n,this.maxHeight=o,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=og(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?zc(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),i.display&&(i.autoSkip||i.source==="auto")&&(this.ticks=F0(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let n=this.options.reverse,o,r;this.isHorizontal()?(o=this.left,r=this.right):(o=this.top,r=this.bottom,n=!n),this._startPixel=o,this._endPixel=r,this._reversePixels=n,this._length=r-o,this._alignToPixels=this.options.alignToPixels}afterUpdate(){nt(this.options.afterUpdate,[this])}beforeSetDimensions(){nt(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(){nt(this.options.afterSetDimensions,[this])}_callHooks(n){this.chart.notifyPlugins(n,this.getContext()),nt(this.options[n],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){nt(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(n){const o=this.options.ticks;let r,a,s;for(r=0,a=n.length;r<a;r++)s=n[r],s.label=nt(o.callback,[s.value,r,n],this)}afterTickToLabelConversion(){nt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){nt(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const n=this.options,o=n.ticks,r=Fc(this.ticks.length,n.ticks.maxTicksLimit),a=o.minRotation||0,s=o.maxRotation;let i=a,l,c,d;if(!this._isVisible()||!o.display||a>=s||r<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),f=u.widest.width,m=u.highest.height,h=yt(this.chart.width-f,0,this.maxWidth);l=n.offset?this.maxWidth/r:h/(r-1),f+6>l&&(l=h/(r-(n.offset?.5:1)),c=this.maxHeight-Jo(n.grid)-o.padding-Rc(n.title,this.chart.options.font),d=Math.sqrt(f*f+m*m),i=Ap(Math.min(Math.asin(yt((u.highest.height+6)/l,-1,1)),Math.asin(yt(c/d,-1,1))-Math.asin(yt(m/d,-1,1)))),i=Math.max(a,Math.min(s,i))),this.labelRotation=i}afterCalculateLabelRotation(){nt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){nt(this.options.beforeFit,[this])}fit(){const n={width:0,height:0},{chart:o,options:{ticks:r,title:a,grid:s}}=this,i=this._isVisible(),l=this.isHorizontal();if(i){const c=Rc(a,o.options.font);if(l?(n.width=this.maxWidth,n.height=Jo(s)+c):(n.height=this.maxHeight,n.width=Jo(s)+c),r.display&&this.ticks.length){const{first:d,last:u,widest:f,highest:m}=this._getLabelSizes(),h=r.padding*2,p=dn(this.labelRotation),k=Math.cos(p),x=Math.sin(p);if(l){const g=r.mirror?0:x*f.width+k*m.height;n.height=Math.min(this.maxHeight,n.height+g+h)}else{const g=r.mirror?0:k*f.width+x*m.height;n.width=Math.min(this.maxWidth,n.width+g+h)}this._calculatePadding(d,u,x,k)}}this._handleMargins(),l?(this.width=this._length=o.width-this._margins.left-this._margins.right,this.height=n.height):(this.width=n.width,this.height=this._length=o.height-this._margins.top-this._margins.bottom)}_calculatePadding(n,o,r,a){const{ticks:{align:s,padding:i},position:l}=this.options,c=this.labelRotation!==0,d=l!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let m=0,h=0;c?d?(m=a*n.width,h=r*o.height):(m=r*n.height,h=a*o.width):s==="start"?h=o.width:s==="end"?m=n.width:s!=="inner"&&(m=n.width/2,h=o.width/2),this.paddingLeft=Math.max((m-u+i)*this.width/(this.width-u),0),this.paddingRight=Math.max((h-f+i)*this.width/(this.width-f),0)}else{let u=o.height/2,f=n.height/2;s==="start"?(u=0,f=n.height):s==="end"&&(u=o.height,f=0),this.paddingTop=u+i,this.paddingBottom=f+i}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){nt(this.options.afterFit,[this])}isHorizontal(){const{axis:n,position:o}=this.options;return o==="top"||o==="bottom"||n==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(n){this.beforeTickToLabelConversion(),this.generateTickLabels(n);let o,r;for(o=0,r=n.length;o<r;o++)Ge(n[o].label)&&(n.splice(o,1),r--,o--);this.afterTickToLabelConversion()}_getLabelSizes(){let n=this._labelSizes;if(!n){const o=this.options.ticks.sampleSize;let r=this.ticks;o<r.length&&(r=zc(r,o)),this._labelSizes=n=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return n}_computeLabelSizes(n,o,r){const{ctx:a,_longestTextCache:s}=this,i=[],l=[],c=Math.floor(o/Fc(o,r));let d=0,u=0,f,m,h,p,k,x,g,S,B,E,_;for(f=0;f<o;f+=c){if(p=n[f].label,k=this._resolveTickFontOptions(f),a.font=x=k.string,g=s[x]=s[x]||{data:{},gc:[]},S=k.lineHeight,B=E=0,!Ge(p)&&!dt(p))B=Wl(a,g.data,g.gc,B,p),E=S;else if(dt(p))for(m=0,h=p.length;m<h;++m)_=p[m],!Ge(_)&&!dt(_)&&(B=Wl(a,g.data,g.gc,B,_),E+=S);i.push(B),l.push(E),d=Math.max(B,d),u=Math.max(E,u)}W0(s,o);const w=i.indexOf(d),y=l.indexOf(u),b=C=>({width:i[C]||0,height:l[C]||0});return{first:b(0),last:b(o-1),widest:b(w),highest:b(y),widths:i,heights:l}}getLabelForValue(n){return n}getPixelForValue(n,o){return NaN}getValueForPixel(n){}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getPixelForDecimal(n){this._reversePixels&&(n=1-n);const o=this._startPixel+n*this._length;return Np(this._alignToPixels?qn(this.chart,o,0):o)}getDecimalForPixel(n){const o=(n-this._startPixel)/this._length;return this._reversePixels?1-o:o}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:n,max:o}=this;return n<0&&o<0?o:n>0&&o>0?n:0}getContext(n){const o=this.ticks||[];if(n>=0&&n<o.length){const r=o[n];return r.$context||(r.$context=q0(this.getContext(),n,r))}return this.$context||(this.$context=H0(this.chart.getContext(),this))}_tickSize(){const n=this.options.ticks,o=dn(this.labelRotation),r=Math.abs(Math.cos(o)),a=Math.abs(Math.sin(o)),s=this._getLabelSizes(),i=n.autoSkipPadding||0,l=s?s.widest.width+i:0,c=s?s.highest.height+i:0;return this.isHorizontal()?c*r>l*a?l/r:c/a:c*a<l*r?c/r:l/a}_isVisible(){const n=this.options.display;return n!=="auto"?!!n:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(n){const o=this.axis,r=this.chart,a=this.options,{grid:s,position:i,border:l}=a,c=s.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),m=Jo(s),h=[],p=l.setContext(this.getContext()),k=p.display?p.width:0,x=k/2,g=function($){return qn(r,$,k)};let S,B,E,_,w,y,b,C,V,D,N,P;if(i==="top")S=g(this.bottom),y=this.bottom-m,C=S-x,D=g(n.top)+x,P=n.bottom;else if(i==="bottom")S=g(this.top),D=n.top,P=g(n.bottom)-x,y=S+x,C=this.top+m;else if(i==="left")S=g(this.right),w=this.right-m,b=S-x,V=g(n.left)+x,N=n.right;else if(i==="right")S=g(this.left),V=n.left,N=g(n.right)-x,w=S+x,b=this.left+m;else if(o==="x"){if(i==="center")S=g((n.top+n.bottom)/2+.5);else if(Fe(i)){const $=Object.keys(i)[0],H=i[$];S=g(this.chart.scales[$].getPixelForValue(H))}D=n.top,P=n.bottom,y=S+x,C=y+m}else if(o==="y"){if(i==="center")S=g((n.left+n.right)/2);else if(Fe(i)){const $=Object.keys(i)[0],H=i[$];S=g(this.chart.scales[$].getPixelForValue(H))}w=S-x,b=w-m,V=n.left,N=n.right}const M=Te(a.ticks.maxTicksLimit,f),X=Math.max(1,Math.ceil(f/M));for(B=0;B<f;B+=X){const $=this.getContext(B),H=s.setContext($),J=l.setContext($),te=H.lineWidth,T=H.color,L=J.dash||[],Z=J.dashOffset,Q=H.tickWidth,W=H.tickColor,ie=H.tickBorderDash||[],de=H.tickBorderDashOffset;E=U0(this,B,c),E!==void 0&&(_=qn(r,E,te),d?w=b=V=N=_:y=C=D=P=_,h.push({tx1:w,ty1:y,tx2:b,ty2:C,x1:V,y1:D,x2:N,y2:P,width:te,color:T,borderDash:L,borderDashOffset:Z,tickWidth:Q,tickColor:W,tickBorderDash:ie,tickBorderDashOffset:de}))}return this._ticksLength=f,this._borderValue=S,h}_computeLabelItems(n){const o=this.axis,r=this.options,{position:a,ticks:s}=r,i=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:u,mirror:f}=s,m=Jo(r.grid),h=m+u,p=f?-u:h,k=-dn(this.labelRotation),x=[];let g,S,B,E,_,w,y,b,C,V,D,N,P="middle";if(a==="top")w=this.bottom-p,y=this._getXAxisLabelAlignment();else if(a==="bottom")w=this.top+p,y=this._getXAxisLabelAlignment();else if(a==="left"){const X=this._getYAxisLabelAlignment(m);y=X.textAlign,_=X.x}else if(a==="right"){const X=this._getYAxisLabelAlignment(m);y=X.textAlign,_=X.x}else if(o==="x"){if(a==="center")w=(n.top+n.bottom)/2+h;else if(Fe(a)){const X=Object.keys(a)[0],$=a[X];w=this.chart.scales[X].getPixelForValue($)+h}y=this._getXAxisLabelAlignment()}else if(o==="y"){if(a==="center")_=(n.left+n.right)/2-h;else if(Fe(a)){const X=Object.keys(a)[0],$=a[X];_=this.chart.scales[X].getPixelForValue($)}y=this._getYAxisLabelAlignment(m).textAlign}o==="y"&&(c==="start"?P="top":c==="end"&&(P="bottom"));const M=this._getLabelSizes();for(g=0,S=l.length;g<S;++g){B=l[g],E=B.label;const X=s.setContext(this.getContext(g));b=this.getPixelForTick(g)+s.labelOffset,C=this._resolveTickFontOptions(g),V=C.lineHeight,D=dt(E)?E.length:1;const $=D/2,H=X.color,J=X.textStrokeColor,te=X.textStrokeWidth;let T=y;i?(_=b,y==="inner"&&(g===S-1?T=this.options.reverse?"left":"right":g===0?T=this.options.reverse?"right":"left":T="center"),a==="top"?d==="near"||k!==0?N=-D*V+V/2:d==="center"?N=-M.highest.height/2-$*V+V:N=-M.highest.height+V/2:d==="near"||k!==0?N=V/2:d==="center"?N=M.highest.height/2-$*V:N=M.highest.height-D*V,f&&(N*=-1),k!==0&&!X.showLabelBackdrop&&(_+=V/2*Math.sin(k))):(w=b,N=(1-D)*V/2);let L;if(X.showLabelBackdrop){const Z=zt(X.backdropPadding),Q=M.heights[g],W=M.widths[g];let ie=N-Z.top,de=0-Z.left;switch(P){case"middle":ie-=Q/2;break;case"bottom":ie-=Q;break}switch(y){case"center":de-=W/2;break;case"right":de-=W;break;case"inner":g===S-1?de-=W:g>0&&(de-=W/2);break}L={left:de,top:ie,width:W+Z.width,height:Q+Z.height,color:X.backdropColor}}x.push({label:E,font:C,textOffset:N,options:{rotation:k,color:H,strokeColor:J,strokeWidth:te,textAlign:T,textBaseline:P,translation:[_,w],backdrop:L}})}return x}_getXAxisLabelAlignment(){const{position:n,ticks:o}=this.options;if(-dn(this.labelRotation))return n==="top"?"left":"right";let a="center";return o.align==="start"?a="left":o.align==="end"?a="right":o.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(n){const{position:o,ticks:{crossAlign:r,mirror:a,padding:s}}=this.options,i=this._getLabelSizes(),l=n+s,c=i.widest.width;let d,u;return o==="left"?a?(u=this.right+s,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-l,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u=this.left)):o==="right"?a?(u=this.left+s,r==="near"?d="right":r==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+l,r==="near"?d="left":r==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const n=this.chart,o=this.options.position;if(o==="left"||o==="right")return{top:0,left:this.left,bottom:n.height,right:this.right};if(o==="top"||o==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:n.width}}drawBackground(){const{ctx:n,options:{backgroundColor:o},left:r,top:a,width:s,height:i}=this;o&&(n.save(),n.fillStyle=o,n.fillRect(r,a,s,i),n.restore())}getLineWidthForValue(n){const o=this.options.grid;if(!this._isVisible()||!o.display)return 0;const a=this.ticks.findIndex(s=>s.value===n);return a>=0?o.setContext(this.getContext(a)).lineWidth:0}drawGrid(n){const o=this.options.grid,r=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(n));let s,i;const l=(c,d,u)=>{!u.width||!u.color||(r.save(),r.lineWidth=u.width,r.strokeStyle=u.color,r.setLineDash(u.borderDash||[]),r.lineDashOffset=u.borderDashOffset,r.beginPath(),r.moveTo(c.x,c.y),r.lineTo(d.x,d.y),r.stroke(),r.restore())};if(o.display)for(s=0,i=a.length;s<i;++s){const c=a[s];o.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),o.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:n,ctx:o,options:{border:r,grid:a}}=this,s=r.setContext(this.getContext()),i=r.display?s.width:0;if(!i)return;const l=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,f,m;this.isHorizontal()?(d=qn(n,this.left,i)-i/2,u=qn(n,this.right,l)+l/2,f=m=c):(f=qn(n,this.top,i)-i/2,m=qn(n,this.bottom,l)+l/2,d=u=c),o.save(),o.lineWidth=s.width,o.strokeStyle=s.color,o.beginPath(),o.moveTo(d,f),o.lineTo(u,m),o.stroke(),o.restore()}drawLabels(n){if(!this.options.ticks.display)return;const r=this.ctx,a=this._computeLabelArea();a&&Dr(r,a);const s=this.getLabelItems(n);for(const i of s){const l=i.options,c=i.font,d=i.label,u=i.textOffset;Ho(r,d,0,u,c,l)}a&&Nr(r)}drawTitle(){const{ctx:n,options:{position:o,title:r,reverse:a}}=this;if(!r.display)return;const s=kt(r.font),i=zt(r.padding),l=r.align;let c=s.lineHeight/2;o==="bottom"||o==="center"||Fe(o)?(c+=i.bottom,dt(r.text)&&(c+=s.lineHeight*(r.text.length-1))):c+=i.top;const{titleX:d,titleY:u,maxWidth:f,rotation:m}=X0(this,c,o,l);Ho(n,r.text,0,0,s,{color:r.color,maxWidth:f,rotation:m,textAlign:G0(l,o,a),textBaseline:"middle",translation:[d,u]})}draw(n){this._isVisible()&&(this.drawBackground(),this.drawGrid(n),this.drawBorder(),this.drawTitle(),this.drawLabels(n))}_layers(){const n=this.options,o=n.ticks&&n.ticks.z||0,r=Te(n.grid&&n.grid.z,-1),a=Te(n.border&&n.border.z,0);return!this._isVisible()||this.draw!==mo.prototype.draw?[{z:o,draw:s=>{this.draw(s)}}]:[{z:r,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:o,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(n){const o=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",a=[];let s,i;for(s=0,i=o.length;s<i;++s){const l=o[s];l[r]===this.id&&(!n||l.type===n)&&a.push(l)}return a}_resolveTickFontOptions(n){const o=this.options.ticks.setContext(this.getContext(n));return kt(o.font)}_maxDigits(){const n=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/n}}class Wr{constructor(n,o,r){this.type=n,this.scope=o,this.override=r,this.items=Object.create(null)}isForType(n){return Object.prototype.isPrototypeOf.call(this.type.prototype,n.prototype)}register(n){const o=Object.getPrototypeOf(n);let r;J0(o)&&(r=this.register(o));const a=this.items,s=n.id,i=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+n);return s in a||(a[s]=n,K0(n,i,r),this.override&<.override(n.id,n.overrides)),i}get(n){return this.items[n]}unregister(n){const o=this.items,r=n.id,a=this.scope;r in o&&delete o[r],a&&r in lt[a]&&(delete lt[a][r],this.override&&delete Hn[r])}}function K0(t,n,o){const r=Fo(Object.create(null),[o?lt.get(o):{},lt.get(n),t.defaults]);lt.set(n,r),t.defaultRoutes&&Y0(n,t.defaultRoutes),t.descriptors&<.describe(n,t.descriptors)}function Y0(t,n){Object.keys(n).forEach(o=>{const r=o.split("."),a=r.pop(),s=[t].concat(r).join("."),i=n[o].split("."),l=i.pop(),c=i.join(".");lt.route(s,a,c,l)})}function J0(t){return"id"in t&&"defaults"in t}class Q0{constructor(){this.controllers=new Wr(Jn,"datasets",!0),this.elements=new Wr(mn,"elements"),this.plugins=new Wr(Object,"plugins"),this.scales=new Wr(mo,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...n){this._each("register",n)}remove(...n){this._each("unregister",n)}addControllers(...n){this._each("register",n,this.controllers)}addElements(...n){this._each("register",n,this.elements)}addPlugins(...n){this._each("register",n,this.plugins)}addScales(...n){this._each("register",n,this.scales)}getController(n){return this._get(n,this.controllers,"controller")}getElement(n){return this._get(n,this.elements,"element")}getPlugin(n){return this._get(n,this.plugins,"plugin")}getScale(n){return this._get(n,this.scales,"scale")}removeControllers(...n){this._each("unregister",n,this.controllers)}removeElements(...n){this._each("unregister",n,this.elements)}removePlugins(...n){this._each("unregister",n,this.plugins)}removeScales(...n){this._each("unregister",n,this.scales)}_each(n,o,r){[...o].forEach(a=>{const s=r||this._getRegistryForType(a);r||s.isForType(a)||s===this.plugins&&a.id?this._exec(n,s,a):Ye(a,i=>{const l=r||this._getRegistryForType(i);this._exec(n,l,i)})})}_exec(n,o,r){const a=ts(n);nt(r["before"+a],[],r),o[n](r),nt(r["after"+a],[],r)}_getRegistryForType(n){for(let o=0;o<this._typedRegistries.length;o++){const r=this._typedRegistries[o];if(r.isForType(n))return r}return this.plugins}_get(n,o,r){const a=o.get(n);if(a===void 0)throw new Error('"'+n+'" is not a registered '+r+".");return a}}var Jt=new Q0;class Z0{constructor(){this._init=void 0}notify(n,o,r,a){if(o==="beforeInit"&&(this._init=this._createDescriptors(n,!0),this._notify(this._init,n,"install")),this._init===void 0)return;const s=a?this._descriptors(n).filter(a):this._descriptors(n),i=this._notify(s,n,o,r);return o==="afterDestroy"&&(this._notify(s,n,"stop"),this._notify(this._init,n,"uninstall"),this._init=void 0),i}_notify(n,o,r,a){a=a||{};for(const s of n){const i=s.plugin,l=i[r],c=[o,a,s.options];if(nt(l,c,i)===!1&&a.cancelable)return!1}return!0}invalidate(){Ge(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(n){if(this._cache)return this._cache;const o=this._cache=this._createDescriptors(n);return this._notifyStateChanges(n),o}_createDescriptors(n,o){const r=n&&n.config,a=Te(r.options&&r.options.plugins,{}),s=eb(r);return a===!1&&!o?[]:nb(n,s,a,o)}_notifyStateChanges(n){const o=this._oldCache||[],r=this._cache,a=(s,i)=>s.filter(l=>!i.some(c=>l.plugin.id===c.plugin.id));this._notify(a(o,r),n,"stop"),this._notify(a(r,o),n,"start")}}function eb(t){const n={},o=[],r=Object.keys(Jt.plugins.items);for(let s=0;s<r.length;s++)o.push(Jt.getPlugin(r[s]));const a=t.plugins||[];for(let s=0;s<a.length;s++){const i=a[s];o.indexOf(i)===-1&&(o.push(i),n[i.id]=!0)}return{plugins:o,localIds:n}}function tb(t,n){return!n&&t===!1?null:t===!0?{}:t}function nb(t,{plugins:n,localIds:o},r,a){const s=[],i=t.getContext();for(const l of n){const c=l.id,d=tb(r[c],a);d!==null&&s.push({plugin:l,options:ob(t.config,{plugin:l,local:o[c]},d,i)})}return s}function ob(t,{plugin:n,local:o},r,a){const s=t.pluginScopeKeys(n),i=t.getOptionScopes(r,s);return o&&n.defaults&&i.push(n.defaults),t.createResolver(i,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ss(t,n){const o=lt.datasets[t]||{};return((n.datasets||{})[t]||{}).indexAxis||n.indexAxis||o.indexAxis||"x"}function rb(t,n){let o=t;return t==="_index_"?o=n:t==="_value_"&&(o=n==="x"?"y":"x"),o}function ab(t,n){return t===n?"_index_":"_value_"}function Ic(t){if(t==="x"||t==="y"||t==="r")return t}function sb(t){if(t==="top"||t==="bottom")return"x";if(t==="left"||t==="right")return"y"}function Vs(t,...n){if(Ic(t))return t;for(const o of n){const r=o.axis||sb(o.position)||t.length>1&&Ic(t[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${t}' axis. Please provide 'axis' or 'position' option.`)}function Lc(t,n,o){if(o[n+"AxisID"]===t)return{axis:n}}function ib(t,n){if(n.data&&n.data.datasets){const o=n.data.datasets.filter(r=>r.xAxisID===t||r.yAxisID===t);if(o.length)return Lc(t,"x",o[0])||Lc(t,"y",o[0])}return{}}function lb(t,n){const o=Hn[t.type]||{scales:{}},r=n.scales||{},a=Ss(t.type,n),s=Object.create(null);return Object.keys(r).forEach(i=>{const l=r[i];if(!Fe(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=Vs(i,l,ib(i,t),lt.scales[l.type]),d=ab(c,a),u=o.scales||{};s[i]=zo(Object.create(null),[{axis:c},l,u[c],u[d]])}),t.data.datasets.forEach(i=>{const l=i.type||t.type,c=i.indexAxis||Ss(l,n),u=(Hn[l]||{}).scales||{};Object.keys(u).forEach(f=>{const m=rb(f,c),h=i[m+"AxisID"]||m;s[h]=s[h]||Object.create(null),zo(s[h],[{axis:m},r[h],u[f]])})}),Object.keys(s).forEach(i=>{const l=s[i];zo(l,[lt.scales[l.type],lt.scale])}),s}function $c(t){const n=t.options||(t.options={});n.plugins=Te(n.plugins,{}),n.scales=lb(t,n)}function jc(t){return t=t||{},t.datasets=t.datasets||[],t.labels=t.labels||[],t}function cb(t){return t=t||{},t.data=jc(t.data),$c(t),t}const Uc=new Map,Wc=new Set;function Hr(t,n){let o=Uc.get(t);return o||(o=n(),Uc.set(t,o),Wc.add(o)),o}const Qo=(t,n,o)=>{const r=jn(n,o);r!==void 0&&t.add(r)};class db{constructor(n){this._config=cb(n),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(n){this._config.type=n}get data(){return this._config.data}set data(n){this._config.data=jc(n)}get options(){return this._config.options}set options(n){this._config.options=n}get plugins(){return this._config.plugins}update(){const n=this._config;this.clearCache(),$c(n)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(n){return Hr(n,()=>[[`datasets.${n}`,""]])}datasetAnimationScopeKeys(n,o){return Hr(`${n}.transition.${o}`,()=>[[`datasets.${n}.transitions.${o}`,`transitions.${o}`],[`datasets.${n}`,""]])}datasetElementScopeKeys(n,o){return Hr(`${n}-${o}`,()=>[[`datasets.${n}.elements.${o}`,`datasets.${n}`,`elements.${o}`,""]])}pluginScopeKeys(n){const o=n.id,r=this.type;return Hr(`${r}-plugin-${o}`,()=>[[`plugins.${o}`,...n.additionalOptionScopes||[]]])}_cachedScopes(n,o){const r=this._scopeCache;let a=r.get(n);return(!a||o)&&(a=new Map,r.set(n,a)),a}getOptionScopes(n,o,r){const{options:a,type:s}=this,i=this._cachedScopes(n,r),l=i.get(o);if(l)return l;const c=new Set;o.forEach(u=>{n&&(c.add(n),u.forEach(f=>Qo(c,n,f))),u.forEach(f=>Qo(c,a,f)),u.forEach(f=>Qo(c,Hn[s]||{},f)),u.forEach(f=>Qo(c,lt,f)),u.forEach(f=>Qo(c,ls,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Wc.has(o)&&i.set(o,d),d}chartOptionScopes(){const{options:n,type:o}=this;return[n,Hn[o]||{},lt.datasets[o]||{},{type:o},lt,ls]}resolveNamedOptions(n,o,r,a=[""]){const s={$shared:!0},{resolver:i,subPrefixes:l}=Hc(this._resolverCache,n,a);let c=i;if(fb(i,o)){s.$shared=!1,r=Vn(r)?r():r;const d=this.createResolver(n,r,l);c=lo(i,r,d)}for(const d of o)s[d]=c[d];return s}createResolver(n,o,r=[""],a){const{resolver:s}=Hc(this._resolverCache,n,r);return Fe(o)?lo(s,o,void 0,a):s}}function Hc(t,n,o){let r=t.get(n);r||(r=new Map,t.set(n,r));const a=o.join();let s=r.get(a);return s||(s={resolver:fs(n,o),subPrefixes:o.filter(l=>!l.toLowerCase().includes("hover"))},r.set(a,s)),s}const ub=t=>Fe(t)&&Object.getOwnPropertyNames(t).some(n=>Vn(t[n]));function fb(t,n){const{isScriptable:o,isIndexable:r}=Xl(t);for(const a of n){const s=o(a),i=r(a),l=(i||s)&&t[a];if(s&&(Vn(l)||ub(l))||i&&dt(l))return!0}return!1}var mb="4.5.1";const hb=["top","bottom","left","right","chartArea"];function qc(t,n){return t==="top"||t==="bottom"||hb.indexOf(t)===-1&&n==="x"}function Gc(t,n){return function(o,r){return o[t]===r[t]?o[n]-r[n]:o[t]-r[t]}}function Xc(t){const n=t.chart,o=n.options.animation;n.notifyPlugins("afterRender"),nt(o&&o.onComplete,[t],n)}function pb(t){const n=t.chart,o=n.options.animation;nt(o&&o.onProgress,[t],n)}function Kc(t){return ps()&&typeof t=="string"?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const qr={},Yc=t=>{const n=Kc(t);return Object.values(qr).filter(o=>o.canvas===n).pop()};function gb(t,n,o){const r=Object.keys(t);for(const a of r){const s=+a;if(s>=n){const i=t[a];delete t[a],(o>0||s>n)&&(t[s+o]=i)}}}function bb(t,n,o,r){return!o||t.type==="mouseout"?null:r?n:t}class hn{static register(...n){Jt.add(...n),Jc()}static unregister(...n){Jt.remove(...n),Jc()}constructor(n,o){const r=this.config=new db(o),a=Kc(n),s=Yc(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const i=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||v0(a)),this.platform.updateConfig(r);const l=this.platform.acquireContext(a,i.aspectRatio),c=l&&l.canvas,d=c&&c.height,u=c&&c.width;if(this.id=pp(),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 Z0,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Op(f=>this.update(f),i.resizeDelay||0),this._dataChanges=[],qr[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}fn.listen(this,"complete",Xc),fn.listen(this,"progress",pb),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:n,maintainAspectRatio:o},width:r,height:a,_aspectRatio:s}=this;return Ge(n)?o&&s?s:a?r/a:null:n}get data(){return this.config.data}set data(n){this.config.data=n}get options(){return this._options}set options(n){this.config.options=n}get registry(){return Jt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():tc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hl(this.canvas,this.ctx),this}stop(){return fn.stop(this),this}resize(n,o){fn.running(this)?this._resizeBeforeDraw={width:n,height:o}:this._resize(n,o)}_resize(n,o){const r=this.options,a=this.canvas,s=r.maintainAspectRatio&&this.aspectRatio,i=this.platform.getMaximumSize(a,n,o,s),l=r.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=i.width,this.height=i.height,this._aspectRatio=this.aspectRatio,tc(this,l,!0)&&(this.notifyPlugins("resize",{size:i}),nt(r.onResize,[this,i],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const o=this.options.scales||{};Ye(o,(r,a)=>{r.id=a})}buildOrUpdateScales(){const n=this.options,o=n.scales,r=this.scales,a=Object.keys(r).reduce((i,l)=>(i[l]=!1,i),{});let s=[];o&&(s=s.concat(Object.keys(o).map(i=>{const l=o[i],c=Vs(i,l),d=c==="r",u=c==="x";return{options:l,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),Ye(s,i=>{const l=i.options,c=l.id,d=Vs(c,l),u=Te(l.type,i.dtype);(l.position===void 0||qc(l.position,d)!==qc(i.dposition))&&(l.position=i.dposition),a[c]=!0;let f=null;if(c in r&&r[c].type===u)f=r[c];else{const m=Jt.getScale(u);f=new m({id:c,type:u,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(l,n)}),Ye(a,(i,l)=>{i||delete r[l]}),Ye(r,i=>{Rt.configure(this,i,i.options),Rt.addBox(this,i)})}_updateMetasets(){const n=this._metasets,o=this.data.datasets.length,r=n.length;if(n.sort((a,s)=>a.index-s.index),r>o){for(let a=o;a<r;++a)this._destroyDatasetMeta(a);n.splice(o,r-o)}this._sortedMetasets=n.slice(0).sort(Gc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:n,data:{datasets:o}}=this;n.length>o.length&&delete this._stacks,n.forEach((r,a)=>{o.filter(s=>s===r._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const n=[],o=this.data.datasets;let r,a;for(this._removeUnreferencedMetasets(),r=0,a=o.length;r<a;r++){const s=o[r];let i=this.getDatasetMeta(r);const l=s.type||this.config.type;if(i.type&&i.type!==l&&(this._destroyDatasetMeta(r),i=this.getDatasetMeta(r)),i.type=l,i.indexAxis=s.indexAxis||Ss(l,this.options),i.order=s.order||0,i.index=r,i.label=""+s.label,i.visible=this.isDatasetVisible(r),i.controller)i.controller.updateIndex(r),i.controller.linkScales();else{const c=Jt.getController(l),{datasetElementType:d,dataElementType:u}=lt.datasets[l];Object.assign(c,{dataElementType:Jt.getElement(u),datasetElementType:d&&Jt.getElement(d)}),i.controller=new c(this,r),n.push(i.controller)}}return this._updateMetasets(),n}_resetElements(){Ye(this.data.datasets,(n,o)=>{this.getDatasetMeta(o).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(n){const o=this.config;o.update();const r=this._options=o.createResolver(o.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:n,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let i=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:f}=this.getDatasetMeta(d),m=!a&&s.indexOf(f)===-1;f.buildOrUpdateElements(m),i=Math.max(+f.getMaxOverflow(),i)}i=this._minPadding=r.layout.autoPadding?i:0,this._updateLayout(i),a||Ye(s,d=>{d.reset()}),this._updateDatasets(n),this.notifyPlugins("afterUpdate",{mode:n}),this._layers.sort(Gc("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Ye(this.scales,n=>{Rt.removeBox(this,n)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const n=this.options,o=new Set(Object.keys(this._listeners)),r=new Set(n.events);(!Al(o,r)||!!this._responsiveListeners!==n.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:n}=this,o=this._getUniformDataChanges()||[];for(const{method:r,start:a,count:s}of o){const i=r==="_removeElements"?-s:s;gb(n,a,i)}}_getUniformDataChanges(){const n=this._dataChanges;if(!n||!n.length)return;this._dataChanges=[];const o=this.data.datasets.length,r=s=>new Set(n.filter(i=>i[0]===s).map((i,l)=>l+","+i.splice(1).join(","))),a=r(0);for(let s=1;s<o;s++)if(!Al(a,r(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(n){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Rt.update(this,this.width,this.height,n);const o=this.chartArea,r=o.width<=0||o.height<=0;this._layers=[],Ye(this.boxes,a=>{r&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(n){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:n,cancelable:!0})!==!1){for(let o=0,r=this.data.datasets.length;o<r;++o)this.getDatasetMeta(o).controller.configure();for(let o=0,r=this.data.datasets.length;o<r;++o)this._updateDataset(o,Vn(n)?n({datasetIndex:o}):n);this.notifyPlugins("afterDatasetsUpdate",{mode:n})}}_updateDataset(n,o){const r=this.getDatasetMeta(n),a={meta:r,index:n,mode:o,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(r.controller._update(o),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(fn.has(this)?this.attached&&!fn.running(this)&&fn.start(this):(this.draw(),Xc({chart:this})))}draw(){let n;if(this._resizeBeforeDraw){const{width:r,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const o=this._layers;for(n=0;n<o.length&&o[n].z<=0;++n)o[n].draw(this.chartArea);for(this._drawDatasets();n<o.length;++n)o[n].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(n){const o=this._sortedMetasets,r=[];let a,s;for(a=0,s=o.length;a<s;++a){const i=o[a];(!n||i.visible)&&r.push(i)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const n=this.getSortedVisibleDatasetMetas();for(let o=n.length-1;o>=0;--o)this._drawDataset(n[o]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(n){const o=this.ctx,r={meta:n,index:n.index,cancelable:!0},a=uc(this,n);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(a&&Dr(o,a),n.controller.draw(),a&&Nr(o),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(n){return Wo(n,this.chartArea,this._minPadding)}getElementsAtEventForMode(n,o,r,a){const s=h0.modes[o];return typeof s=="function"?s(this,n,r,a):[]}getDatasetMeta(n){const o=this.data.datasets[n],r=this._metasets;let a=r.filter(s=>s&&s._dataset===o).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:o&&o.order||0,index:n,_dataset:o,_parsed:[],_sorted:!1},r.push(a)),a}getContext(){return this.$context||(this.$context=Gn(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(n){const o=this.data.datasets[n];if(!o)return!1;const r=this.getDatasetMeta(n);return typeof r.hidden=="boolean"?!r.hidden:!o.hidden}setDatasetVisibility(n,o){const r=this.getDatasetMeta(n);r.hidden=!o}toggleDataVisibility(n){this._hiddenIndices[n]=!this._hiddenIndices[n]}getDataVisibility(n){return!this._hiddenIndices[n]}_updateVisibility(n,o,r){const a=r?"show":"hide",s=this.getDatasetMeta(n),i=s.controller._resolveAnimations(void 0,a);Ro(o)?(s.data[o].hidden=!r,this.update()):(this.setDatasetVisibility(n,r),i.update(s,{visible:r}),this.update(l=>l.datasetIndex===n?a:void 0))}hide(n,o){this._updateVisibility(n,o,!1)}show(n,o){this._updateVisibility(n,o,!0)}_destroyDatasetMeta(n){const o=this._metasets[n];o&&o.controller&&o.controller._destroy(),delete this._metasets[n]}_stop(){let n,o;for(this.stop(),fn.remove(this),n=0,o=this.data.datasets.length;n<o;++n)this._destroyDatasetMeta(n)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:n,ctx:o}=this;this._stop(),this.config.clearCache(),n&&(this.unbindEvents(),Hl(n,o),this.platform.releaseContext(o),this.canvas=null,this.ctx=null),delete qr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...n){return this.canvas.toDataURL(...n)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const n=this._listeners,o=this.platform,r=(s,i)=>{o.addEventListener(this,s,i),n[s]=i},a=(s,i,l)=>{s.offsetX=i,s.offsetY=l,this._eventHandler(s)};Ye(this.options.events,s=>r(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const n=this._responsiveListeners,o=this.platform,r=(c,d)=>{o.addEventListener(this,c,d),n[c]=d},a=(c,d)=>{n[c]&&(o.removeEventListener(this,c,d),delete n[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let i;const l=()=>{a("attach",l),this.attached=!0,this.resize(),r("resize",s),r("detach",i)};i=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),r("attach",l)},o.isAttached(this.canvas)?l():i()}unbindEvents(){Ye(this._listeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._listeners={},Ye(this._responsiveListeners,(n,o)=>{this.platform.removeEventListener(this,o,n)}),this._responsiveListeners=void 0}updateHoverStyle(n,o,r){const a=r?"set":"remove";let s,i,l,c;for(o==="dataset"&&(s=this.getDatasetMeta(n[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),l=0,c=n.length;l<c;++l){i=n[l];const d=i&&this.getDatasetMeta(i.datasetIndex).controller;d&&d[a+"HoverStyle"](i.element,i.datasetIndex,i.index)}}getActiveElements(){return this._active||[]}setActiveElements(n){const o=this._active||[],r=n.map(({datasetIndex:s,index:i})=>{const l=this.getDatasetMeta(s);if(!l)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:l.data[i],index:i}});!_r(r,o)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,o))}notifyPlugins(n,o,r){return this._plugins.notify(this,n,o,r)}isPluginEnabled(n){return this._plugins._cache.filter(o=>o.plugin.id===n).length===1}_updateHoverStyles(n,o,r){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(f=>u.datasetIndex===f.datasetIndex&&u.index===f.index)),i=s(o,n),l=r?n:s(n,o);i.length&&this.updateHoverStyle(i,a.mode,!1),l.length&&a.mode&&this.updateHoverStyle(l,a.mode,!0)}_eventHandler(n,o){const r={event:n,replay:o,cancelable:!0,inChartArea:this.isPointInArea(n)},a=i=>(i.options.events||this.options.events).includes(n.native.type);if(this.notifyPlugins("beforeEvent",r,a)===!1)return;const s=this._handleEvent(n,o,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,a),(s||r.changed)&&this.render(),this}_handleEvent(n,o,r){const{_active:a=[],options:s}=this,i=o,l=this._getActiveElements(n,a,r,i),c=wp(n),d=bb(n,this._lastEvent,r,c);r&&(this._lastEvent=null,nt(s.onHover,[n,l,this],this),c&&nt(s.onClick,[n,l,this],this));const u=!_r(l,a);return(u||o)&&(this._active=l,this._updateHoverStyles(l,a,o)),this._lastEvent=d,u}_getActiveElements(n,o,r,a){if(n.type==="mouseout")return[];if(!r)return o;const s=this.options.hover;return this.getElementsAtEventForMode(n,s.mode,s,a)}}we(hn,"defaults",lt),we(hn,"instances",qr),we(hn,"overrides",Hn),we(hn,"registry",Jt),we(hn,"version",mb),we(hn,"getChart",Yc);function Jc(){return Ye(hn.instances,t=>t._plugins.invalidate())}function yb(t,n,o){const{startAngle:r,x:a,y:s,outerRadius:i,innerRadius:l,options:c}=n,{borderWidth:d,borderJoinStyle:u}=c,f=Math.min(d/i,Nt(r-o));if(t.beginPath(),t.arc(a,s,i-d/2,r+f/2,o-f/2),l>0){const m=Math.min(d/l,Nt(r-o));t.arc(a,s,l+d/2,o-m/2,r+m/2,!0)}else{const m=Math.min(d/2,i*Nt(r-o));if(u==="round")t.arc(a,s,m,o-Je/2,r+Je/2,!0);else if(u==="bevel"){const h=2*m*m,p=-h*Math.cos(o+Je/2)+a,k=-h*Math.sin(o+Je/2)+s,x=h*Math.cos(r+Je/2)+a,g=h*Math.sin(r+Je/2)+s;t.lineTo(p,k),t.lineTo(x,g)}}t.closePath(),t.moveTo(0,0),t.rect(0,0,t.canvas.width,t.canvas.height),t.clip("evenodd")}function xb(t,n,o){const{startAngle:r,pixelMargin:a,x:s,y:i,outerRadius:l,innerRadius:c}=n;let d=a/l;t.beginPath(),t.arc(s,i,l,r-d,o+d),c>a?(d=a/c,t.arc(s,i,c,o+d,r-d,!0)):t.arc(s,i,a,o+ft,r-ft),t.closePath(),t.clip()}function kb(t){return us(t,["outerStart","outerEnd","innerStart","innerEnd"])}function wb(t,n,o,r){const a=kb(t.options.borderRadius),s=(o-n)/2,i=Math.min(s,r*n/2),l=c=>{const d=(o-Math.min(s,c))*r/2;return yt(c,0,Math.min(s,d))};return{outerStart:l(a.outerStart),outerEnd:l(a.outerEnd),innerStart:yt(a.innerStart,0,i),innerEnd:yt(a.innerEnd,0,i)}}function ho(t,n,o,r){return{x:o+t*Math.cos(n),y:r+t*Math.sin(n)}}function Gr(t,n,o,r,a,s){const{x:i,y:l,startAngle:c,pixelMargin:d,innerRadius:u}=n,f=Math.max(n.outerRadius+r+o-d,0),m=u>0?u+r+o+d:0;let h=0;const p=a-c;if(r){const X=u>0?u-r:0,$=f>0?f-r:0,H=(X+$)/2,J=H!==0?p*H/(H+r):p;h=(p-J)/2}const k=Math.max(.001,p*f-o/Je)/f,x=(p-k)/2,g=c+x+h,S=a-x-h,{outerStart:B,outerEnd:E,innerStart:_,innerEnd:w}=wb(n,m,f,S-g),y=f-B,b=f-E,C=g+B/y,V=S-E/b,D=m+_,N=m+w,P=g+_/D,M=S-w/N;if(t.beginPath(),s){const X=(C+V)/2;if(t.arc(i,l,f,C,X),t.arc(i,l,f,X,V),E>0){const te=ho(b,V,i,l);t.arc(te.x,te.y,E,V,S+ft)}const $=ho(N,S,i,l);if(t.lineTo($.x,$.y),w>0){const te=ho(N,M,i,l);t.arc(te.x,te.y,w,S+ft,M+Math.PI)}const H=(S-w/m+(g+_/m))/2;if(t.arc(i,l,m,S-w/m,H,!0),t.arc(i,l,m,H,g+_/m,!0),_>0){const te=ho(D,P,i,l);t.arc(te.x,te.y,_,P+Math.PI,g-ft)}const J=ho(y,g,i,l);if(t.lineTo(J.x,J.y),B>0){const te=ho(y,C,i,l);t.arc(te.x,te.y,B,g-ft,C)}}else{t.moveTo(i,l);const X=Math.cos(C)*f+i,$=Math.sin(C)*f+l;t.lineTo(X,$);const H=Math.cos(V)*f+i,J=Math.sin(V)*f+l;t.lineTo(H,J)}t.closePath()}function Cb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l}=n;let c=n.endAngle;if(s){Gr(t,n,o,r,c,a);for(let d=0;d<s;++d)t.fill();isNaN(l)||(c=i+(l%rt||rt))}return Gr(t,n,o,r,c,a),t.fill(),c}function Eb(t,n,o,r,a){const{fullCircles:s,startAngle:i,circumference:l,options:c}=n,{borderWidth:d,borderJoinStyle:u,borderDash:f,borderDashOffset:m,borderRadius:h}=c,p=c.borderAlign==="inner";if(!d)return;t.setLineDash(f||[]),t.lineDashOffset=m,p?(t.lineWidth=d*2,t.lineJoin=u||"round"):(t.lineWidth=d,t.lineJoin=u||"bevel");let k=n.endAngle;if(s){Gr(t,n,o,r,k,a);for(let x=0;x<s;++x)t.stroke();isNaN(l)||(k=i+(l%rt||rt))}p&&xb(t,n,k),c.selfJoin&&k-i>=Je&&h===0&&u!=="miter"&&yb(t,n,k),s||(Gr(t,n,o,r,k,a),t.stroke())}class Zo extends mn{constructor(o){super();we(this,"circumference");we(this,"endAngle");we(this,"fullCircles");we(this,"innerRadius");we(this,"outerRadius");we(this,"pixelMargin");we(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.getProps(["x","y"],a),{angle:i,distance:l}=Pl(s,{x:o,y:r}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:f,circumference:m}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),h=(this.options.spacing+this.options.borderWidth)/2,p=Te(m,d-c),k=$o(i,c,d)&&c!==d,x=p>=rt||k,g=un(l,u+h,f+h);return x&&g}getCenterPoint(o){const{x:r,y:a,startAngle:s,endAngle:i,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],o),{offset:d,spacing:u}=this.options,f=(s+i)/2,m=(l+c+u+d)/2;return{x:r+Math.cos(f)*m,y:a+Math.sin(f)*m}}tooltipPosition(o){return this.getCenterPoint(o)}draw(o){const{options:r,circumference:a}=this,s=(r.offset||0)/4,i=(r.spacing||0)/2,l=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=a>rt?Math.floor(a/rt):0,a===0||this.innerRadius<0||this.outerRadius<0)return;o.save();const c=(this.startAngle+this.endAngle)/2;o.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(Je,a||0)),u=s*d;o.fillStyle=r.backgroundColor,o.strokeStyle=r.borderColor,Cb(o,this,u,i,l),Eb(o,this,u,i,l),o.restore()}}we(Zo,"id","arc"),we(Zo,"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}),we(Zo,"defaultRoutes",{backgroundColor:"backgroundColor"}),we(Zo,"descriptors",{_scriptable:!0,_indexable:o=>o!=="borderDash"});function Qc(t,n,o=n){t.lineCap=Te(o.borderCapStyle,n.borderCapStyle),t.setLineDash(Te(o.borderDash,n.borderDash)),t.lineDashOffset=Te(o.borderDashOffset,n.borderDashOffset),t.lineJoin=Te(o.borderJoinStyle,n.borderJoinStyle),t.lineWidth=Te(o.borderWidth,n.borderWidth),t.strokeStyle=Te(o.borderColor,n.borderColor)}function Bb(t,n,o){t.lineTo(o.x,o.y)}function _b(t){return t.stepped?Xp:t.tension||t.cubicInterpolationMode==="monotone"?Kp:Bb}function Zc(t,n,o={}){const r=t.length,{start:a=0,end:s=r-1}=o,{start:i,end:l}=n,c=Math.max(a,i),d=Math.min(s,l),u=a<i&&s<i||a>l&&s>l;return{count:r,start:c,loop:n.loop,ilen:d<c&&!u?r+d-c:d-c}}function Sb(t,n,o,r){const{points:a,options:s}=n,{count:i,start:l,loop:c,ilen:d}=Zc(a,o,r),u=_b(s);let{move:f=!0,reverse:m}=r||{},h,p,k;for(h=0;h<=d;++h)p=a[(l+(m?d-h:h))%i],!p.skip&&(f?(t.moveTo(p.x,p.y),f=!1):u(t,k,p,m,s.stepped),k=p);return c&&(p=a[(l+(m?d:0))%i],u(t,k,p,m,s.stepped)),!!c}function Vb(t,n,o,r){const a=n.points,{count:s,start:i,ilen:l}=Zc(a,o,r),{move:c=!0,reverse:d}=r||{};let u=0,f=0,m,h,p,k,x,g;const S=E=>(i+(d?l-E:E))%s,B=()=>{k!==x&&(t.lineTo(u,x),t.lineTo(u,k),t.lineTo(u,g))};for(c&&(h=a[S(0)],t.moveTo(h.x,h.y)),m=0;m<=l;++m){if(h=a[S(m)],h.skip)continue;const E=h.x,_=h.y,w=E|0;w===p?(_<k?k=_:_>x&&(x=_),u=(f*u+E)/++f):(B(),t.lineTo(E,_),p=w,f=0,k=x=_),g=_}B()}function As(t){const n=t.options,o=n.borderDash&&n.borderDash.length;return!t._decimated&&!t._loop&&!n.tension&&n.cubicInterpolationMode!=="monotone"&&!n.stepped&&!o?Vb:Sb}function Ab(t){return t.stepped?Vg:t.tension||t.cubicInterpolationMode==="monotone"?Ag:Yn}function Db(t,n,o,r){let a=n._path;a||(a=n._path=new Path2D,n.path(a,o,r)&&a.closePath()),Qc(t,n.options),t.stroke(a)}function Nb(t,n,o,r){const{segments:a,options:s}=n,i=As(n);for(const l of a)Qc(t,s,l.style),t.beginPath(),i(t,n,l,{start:o,end:o+r-1})&&t.closePath(),t.stroke()}const Mb=typeof Path2D=="function";function Tb(t,n,o,r){Mb&&!n.options.segment?Db(t,n,o,r):Nb(t,n,o,r)}class Dn extends mn{constructor(n){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,n&&Object.assign(this,n)}updateControlPoints(n,o){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const a=r.spanGaps?this._loop:this._fullLoop;xg(this._points,r,n,a,o),this._pointsUpdated=!0}}set points(n){this._points=n,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Og(this,this.options.segment))}first(){const n=this.segments,o=this.points;return n.length&&o[n[0].start]}last(){const n=this.segments,o=this.points,r=n.length;return r&&o[n[r-1].end]}interpolate(n,o){const r=this.options,a=n[o],s=this.points,i=lc(this,{property:o,start:a,end:a});if(!i.length)return;const l=[],c=Ab(r);let d,u;for(d=0,u=i.length;d<u;++d){const{start:f,end:m}=i[d],h=s[f],p=s[m];if(h===p){l.push(h);continue}const k=Math.abs((a-h[o])/(p[o]-h[o])),x=c(h,p,k,r.stepped);x[o]=n[o],l.push(x)}return l.length===1?l[0]:l}pathSegment(n,o,r){return As(this)(n,this,o,r)}path(n,o,r){const a=this.segments,s=As(this);let i=this._loop;o=o||0,r=r||this.points.length-o;for(const l of a)i&=s(n,this,l,{start:o,end:o+r-1});return!!i}draw(n,o,r,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(n.save(),Tb(n,this,r,a),n.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}we(Dn,"id","line"),we(Dn,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),we(Dn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),we(Dn,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"});function ed(t,n,o,r){const a=t.options,{[o]:s}=t.getProps([o],r);return Math.abs(n-s)<a.radius+a.hitRadius}class Xr extends mn{constructor(o){super();we(this,"parsed");we(this,"skip");we(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,o&&Object.assign(this,o)}inRange(o,r,a){const s=this.options,{x:i,y:l}=this.getProps(["x","y"],a);return Math.pow(o-i,2)+Math.pow(r-l,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(o,r){return ed(this,o,"x",r)}inYRange(o,r){return ed(this,o,"y",r)}getCenterPoint(o){const{x:r,y:a}=this.getProps(["x","y"],o);return{x:r,y:a}}size(o){o=o||this.options||{};let r=o.radius||0;r=Math.max(r,r&&o.hoverRadius||0);const a=r&&o.borderWidth||0;return(r+a)*2}draw(o,r){const a=this.options;this.skip||a.radius<.1||!Wo(this,r,this.size(a)/2)||(o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.fillStyle=a.backgroundColor,ds(o,a,this.x,this.y))}getRange(){const o=this.options||{};return o.radius+o.hitRadius}}we(Xr,"id","point"),we(Xr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),we(Xr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function td(t,n){const{x:o,y:r,base:a,width:s,height:i}=t.getProps(["x","y","base","width","height"],n);let l,c,d,u,f;return t.horizontal?(f=i/2,l=Math.min(o,a),c=Math.max(o,a),d=r-f,u=r+f):(f=s/2,l=o-f,c=o+f,d=Math.min(r,a),u=Math.max(r,a)),{left:l,top:d,right:c,bottom:u}}function Nn(t,n,o,r){return t?0:yt(n,o,r)}function Pb(t,n,o){const r=t.options.borderWidth,a=t.borderSkipped,s=Gl(r);return{t:Nn(a.top,s.top,0,o),r:Nn(a.right,s.right,0,n),b:Nn(a.bottom,s.bottom,0,o),l:Nn(a.left,s.left,0,n)}}function Ob(t,n,o){const{enableBorderRadius:r}=t.getProps(["enableBorderRadius"]),a=t.options.borderRadius,s=io(a),i=Math.min(n,o),l=t.borderSkipped,c=r||Fe(a);return{topLeft:Nn(!c||l.top||l.left,s.topLeft,0,i),topRight:Nn(!c||l.top||l.right,s.topRight,0,i),bottomLeft:Nn(!c||l.bottom||l.left,s.bottomLeft,0,i),bottomRight:Nn(!c||l.bottom||l.right,s.bottomRight,0,i)}}function vb(t){const n=td(t),o=n.right-n.left,r=n.bottom-n.top,a=Pb(t,o/2,r/2),s=Ob(t,o/2,r/2);return{outer:{x:n.left,y:n.top,w:o,h:r,radius:s},inner:{x:n.left+a.l,y:n.top+a.t,w:o-a.l-a.r,h:r-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function Ds(t,n,o,r){const a=n===null,s=o===null,l=t&&!(a&&s)&&td(t,r);return l&&(a||un(n,l.left,l.right))&&(s||un(o,l.top,l.bottom))}function Fb(t){return t.topLeft||t.topRight||t.bottomLeft||t.bottomRight}function zb(t,n){t.rect(n.x,n.y,n.w,n.h)}function Ns(t,n,o={}){const r=t.x!==o.x?-n:0,a=t.y!==o.y?-n:0,s=(t.x+t.w!==o.x+o.w?n:0)-r,i=(t.y+t.h!==o.y+o.h?n:0)-a;return{x:t.x+r,y:t.y+a,w:t.w+s,h:t.h+i,radius:t.radius}}class Kr extends mn{constructor(n){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,n&&Object.assign(this,n)}draw(n){const{inflateAmount:o,options:{borderColor:r,backgroundColor:a}}=this,{inner:s,outer:i}=vb(this),l=Fb(i.radius)?Mr:zb;n.save(),(i.w!==s.w||i.h!==s.h)&&(n.beginPath(),l(n,Ns(i,o,s)),n.clip(),l(n,Ns(s,-o,i)),n.fillStyle=r,n.fill("evenodd")),n.beginPath(),l(n,Ns(s,o)),n.fillStyle=a,n.fill(),n.restore()}inRange(n,o,r){return Ds(this,n,o,r)}inXRange(n,o){return Ds(this,n,null,o)}inYRange(n,o){return Ds(this,null,n,o)}getCenterPoint(n){const{x:o,y:r,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],n);return{x:s?(o+a)/2:o,y:s?r:(r+a)/2}}getRange(n){return n==="x"?this.width/2:this.height/2}}we(Kr,"id","bar"),we(Kr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),we(Kr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Rb(t,n,o){const r=t.segments,a=t.points,s=n.points,i=[];for(const l of r){let{start:c,end:d}=l;d=Yr(c,d,a);const u=Ms(o,a[c],a[d],l.loop);if(!n.segments){i.push({source:l,target:u,start:a[c],end:a[d]});continue}const f=lc(n,u);for(const m of f){const h=Ms(o,s[m.start],s[m.end],m.loop),p=ic(l,a,h);for(const k of p)i.push({source:k,target:m,start:{[o]:nd(u,h,"start",Math.max)},end:{[o]:nd(u,h,"end",Math.min)}})}}return i}function Ms(t,n,o,r){if(r)return;let a=n[t],s=o[t];return t==="angle"&&(a=Nt(a),s=Nt(s)),{property:t,start:a,end:s}}function Ib(t,n){const{x:o=null,y:r=null}=t||{},a=n.points,s=[];return n.segments.forEach(({start:i,end:l})=>{l=Yr(i,l,a);const c=a[i],d=a[l];r!==null?(s.push({x:c.x,y:r}),s.push({x:d.x,y:r})):o!==null&&(s.push({x:o,y:c.y}),s.push({x:o,y:d.y}))}),s}function Yr(t,n,o){for(;n>t;n--){const r=o[n];if(!isNaN(r.x)&&!isNaN(r.y))break}return n}function nd(t,n,o,r){return t&&n?r(t[o],n[o]):t?t[o]:n?n[o]:0}function od(t,n){let o=[],r=!1;return dt(t)?(r=!0,o=t):o=Ib(t,n),o.length?new Dn({points:o,options:{tension:0},_loop:r,_fullLoop:r}):null}function rd(t){return t&&t.fill!==!1}function Lb(t,n,o){let a=t[n].fill;const s=[n];let i;if(!o)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!bt(a))return a;if(i=t[a],!i)return!1;if(i.visible)return a;s.push(a),a=i.fill}return!1}function $b(t,n,o){const r=Hb(t);if(Fe(r))return isNaN(r.value)?!1:r;let a=parseFloat(r);return bt(a)&&Math.floor(a)===a?jb(r[0],n,a,o):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function jb(t,n,o,r){return(t==="-"||t==="+")&&(o=n+o),o===n||o<0||o>=r?!1:o}function Ub(t,n){let o=null;return t==="start"?o=n.bottom:t==="end"?o=n.top:Fe(t)?o=n.getPixelForValue(t.value):n.getBasePixel&&(o=n.getBasePixel()),o}function Wb(t,n,o){let r;return t==="start"?r=o:t==="end"?r=n.options.reverse?n.min:n.max:Fe(t)?r=t.value:r=n.getBaseValue(),r}function Hb(t){const n=t.options,o=n.fill;let r=Te(o&&o.target,o);return r===void 0&&(r=!!n.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function qb(t){const{scale:n,index:o,line:r}=t,a=[],s=r.segments,i=r.points,l=Gb(n,o);l.push(od({x:null,y:n.bottom},r));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Xb(a,i[u],l)}return new Dn({points:a,options:{}})}function Gb(t,n){const o=[],r=t.getMatchingVisibleMetas("line");for(let a=0;a<r.length;a++){const s=r[a];if(s.index===n)break;s.hidden||o.unshift(s.dataset)}return o}function Xb(t,n,o){const r=[];for(let a=0;a<o.length;a++){const s=o[a],{first:i,last:l,point:c}=Kb(s,n,"x");if(!(!c||i&&l)){if(i)r.unshift(c);else if(t.push(c),!l)break}}t.push(...r)}function Kb(t,n,o){const r=t.interpolate(n,o);if(!r)return{};const a=r[o],s=t.segments,i=t.points;let l=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],f=i[u.start][o],m=i[u.end][o];if(un(a,f,m)){l=a===f,c=a===m;break}}return{first:l,last:c,point:r}}class ad{constructor(n){this.x=n.x,this.y=n.y,this.radius=n.radius}pathSegment(n,o,r){const{x:a,y:s,radius:i}=this;return o=o||{start:0,end:rt},n.arc(a,s,i,o.end,o.start,!0),!r.bounds}interpolate(n){const{x:o,y:r,radius:a}=this,s=n.angle;return{x:o+Math.cos(s)*a,y:r+Math.sin(s)*a,angle:s}}}function Yb(t){const{chart:n,fill:o,line:r}=t;if(bt(o))return Jb(n,o);if(o==="stack")return qb(t);if(o==="shape")return!0;const a=Qb(t);return a instanceof ad?a:od(a,r)}function Jb(t,n){const o=t.getDatasetMeta(n);return o&&t.isDatasetVisible(n)?o.dataset:null}function Qb(t){return(t.scale||{}).getPointPositionForValue?ey(t):Zb(t)}function Zb(t){const{scale:n={},fill:o}=t,r=Ub(o,n);if(bt(r)){const a=n.isHorizontal();return{x:a?r:null,y:a?null:r}}return null}function ey(t){const{scale:n,fill:o}=t,r=n.options,a=n.getLabels().length,s=r.reverse?n.max:n.min,i=Wb(o,n,s),l=[];if(r.grid.circular){const c=n.getPointPositionForValue(0,s);return new ad({x:c.x,y:c.y,radius:n.getDistanceFromCenterForValue(i)})}for(let c=0;c<a;++c)l.push(n.getPointPositionForValue(c,i));return l}function Ts(t,n,o){const r=Yb(n),{chart:a,index:s,line:i,scale:l,axis:c}=n,d=i.options,u=d.fill,f=d.backgroundColor,{above:m=f,below:h=f}=u||{},p=a.getDatasetMeta(s),k=uc(a,p);r&&i.points.length&&(Dr(t,o),ty(t,{line:i,target:r,above:m,below:h,area:o,scale:l,axis:c,clip:k}),Nr(t))}function ty(t,n){const{line:o,target:r,above:a,below:s,area:i,scale:l,clip:c}=n,d=o._loop?"angle":n.axis;t.save();let u=s;s!==a&&(d==="x"?(sd(t,r,i.top),Ps(t,{line:o,target:r,color:a,scale:l,property:d,clip:c}),t.restore(),t.save(),sd(t,r,i.bottom)):d==="y"&&(id(t,r,i.left),Ps(t,{line:o,target:r,color:s,scale:l,property:d,clip:c}),t.restore(),t.save(),id(t,r,i.right),u=a)),Ps(t,{line:o,target:r,color:u,scale:l,property:d,clip:c}),t.restore()}function sd(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Yr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(u.x,o),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(f.x,o)}t.lineTo(n.first().x,o),t.closePath(),t.clip()}function id(t,n,o){const{segments:r,points:a}=n;let s=!0,i=!1;t.beginPath();for(const l of r){const{start:c,end:d}=l,u=a[c],f=a[Yr(c,d,a)];s?(t.moveTo(u.x,u.y),s=!1):(t.lineTo(o,u.y),t.lineTo(u.x,u.y)),i=!!n.pathSegment(t,l,{move:i}),i?t.closePath():t.lineTo(o,f.y)}t.lineTo(o,n.first().y),t.closePath(),t.clip()}function Ps(t,n){const{line:o,target:r,property:a,color:s,scale:i,clip:l}=n,c=Rb(o,r,a);for(const{source:d,target:u,start:f,end:m}of c){const{style:{backgroundColor:h=s}={}}=d,p=r!==!0;t.save(),t.fillStyle=h,ny(t,i,l,p&&Ms(a,f,m)),t.beginPath();const k=!!o.pathSegment(t,d);let x;if(p){k?t.closePath():ld(t,r,m,a);const g=!!r.pathSegment(t,u,{move:k,reverse:!0});x=k&&g,x||ld(t,r,f,a)}t.closePath(),t.fill(x?"evenodd":"nonzero"),t.restore()}}function ny(t,n,o,r){const a=n.chart.chartArea,{property:s,start:i,end:l}=r||{};if(s==="x"||s==="y"){let c,d,u,f;s==="x"?(c=i,d=a.top,u=l,f=a.bottom):(c=a.left,d=i,u=a.right,f=l),t.beginPath(),o&&(c=Math.max(c,o.left),u=Math.min(u,o.right),d=Math.max(d,o.top),f=Math.min(f,o.bottom)),t.rect(c,d,u-c,f-d),t.clip()}}function ld(t,n,o,r){const a=n.interpolate(o,r);a&&t.lineTo(a.x,a.y)}var oy={id:"filler",afterDatasetsUpdate(t,n,o){const r=(t.data.datasets||[]).length,a=[];let s,i,l,c;for(i=0;i<r;++i)s=t.getDatasetMeta(i),l=s.dataset,c=null,l&&l.options&&l instanceof Dn&&(c={visible:t.isDatasetVisible(i),index:i,fill:$b(l,i,r),chart:t,axis:s.controller.options.indexAxis,scale:s.vScale,line:l}),s.$filler=c,a.push(c);for(i=0;i<r;++i)c=a[i],!(!c||c.fill===!1)&&(c.fill=Lb(a,i,o.propagate))},beforeDraw(t,n,o){const r=o.drawTime==="beforeDraw",a=t.getSortedVisibleDatasetMetas(),s=t.chartArea;for(let i=a.length-1;i>=0;--i){const l=a[i].$filler;l&&(l.line.updateControlPoints(s,l.axis),r&&l.fill&&Ts(t.ctx,l,s))}},beforeDatasetsDraw(t,n,o){if(o.drawTime!=="beforeDatasetsDraw")return;const r=t.getSortedVisibleDatasetMetas();for(let a=r.length-1;a>=0;--a){const s=r[a].$filler;rd(s)&&Ts(t.ctx,s,t.chartArea)}},beforeDatasetDraw(t,n,o){const r=n.meta.$filler;!rd(r)||o.drawTime!=="beforeDatasetDraw"||Ts(t.ctx,r,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const cd=(t,n)=>{let{boxHeight:o=n,boxWidth:r=n}=t;return t.usePointStyle&&(o=Math.min(o,n),r=t.pointStyleWidth||Math.min(r,n)),{boxWidth:r,boxHeight:o,itemHeight:Math.max(n,o)}},ry=(t,n)=>t!==null&&n!==null&&t.datasetIndex===n.datasetIndex&&t.index===n.index;class dd extends mn{constructor(n){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o,r){this.maxWidth=n,this.maxHeight=o,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const n=this.options.labels||{};let o=nt(n.generateLabels,[this.chart],this)||[];n.filter&&(o=o.filter(r=>n.filter(r,this.chart.data))),n.sort&&(o=o.sort((r,a)=>n.sort(r,a,this.chart.data))),this.options.reverse&&o.reverse(),this.legendItems=o}fit(){const{options:n,ctx:o}=this;if(!n.display){this.width=this.height=0;return}const r=n.labels,a=kt(r.font),s=a.size,i=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=cd(r,s);let d,u;o.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(i,s,l,c)+10):(u=this.maxHeight,d=this._fitCols(i,a,l,c)+10),this.width=Math.min(d,n.maxWidth||this.maxWidth),this.height=Math.min(u,n.maxHeight||this.maxHeight)}_fitRows(n,o,r,a){const{ctx:s,maxWidth:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+l;let f=n;s.textAlign="left",s.textBaseline="middle";let m=-1,h=-u;return this.legendItems.forEach((p,k)=>{const x=r+o/2+s.measureText(p.text).width;(k===0||d[d.length-1]+x+2*l>i)&&(f+=u,d[d.length-(k>0?0:1)]=0,h+=u,m++),c[k]={left:0,top:h,row:m,width:x,height:a},d[d.length-1]+=x+l}),f}_fitCols(n,o,r,a){const{ctx:s,maxHeight:i,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=i-n;let f=l,m=0,h=0,p=0,k=0;return this.legendItems.forEach((x,g)=>{const{itemWidth:S,itemHeight:B}=ay(r,o,s,x,a);g>0&&h+B+2*l>u&&(f+=m+l,d.push({width:m,height:h}),p+=m+l,k++,m=h=0),c[g]={left:p,top:h,col:k,width:S,height:B},m=Math.max(m,S),h+=B+l}),f+=m,d.push({width:m,height:h}),f}adjustHitBoxes(){if(!this.options.display)return;const n=this._computeTitleHeight(),{legendHitBoxes:o,options:{align:r,labels:{padding:a},rtl:s}}=this,i=uo(s,this.left,this.width);if(this.isHorizontal()){let l=0,c=xt(r,this.left+a,this.right-this.lineWidths[l]);for(const d of o)l!==d.row&&(l=d.row,c=xt(r,this.left+a,this.right-this.lineWidths[l])),d.top+=this.top+n+a,d.left=i.leftForLtr(i.x(c),d.width),c+=d.width+a}else{let l=0,c=xt(r,this.top+n+a,this.bottom-this.columnSizes[l].height);for(const d of o)d.col!==l&&(l=d.col,c=xt(r,this.top+n+a,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+a,d.left=i.leftForLtr(i.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const n=this.ctx;Dr(n,this),this._draw(),Nr(n)}}_draw(){const{options:n,columnSizes:o,lineWidths:r,ctx:a}=this,{align:s,labels:i}=n,l=lt.color,c=uo(n.rtl,this.left,this.width),d=kt(i.font),{padding:u}=i,f=d.size,m=f/2;let h;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:p,boxHeight:k,itemHeight:x}=cd(i,f),g=function(w,y,b){if(isNaN(p)||p<=0||isNaN(k)||k<0)return;a.save();const C=Te(b.lineWidth,1);if(a.fillStyle=Te(b.fillStyle,l),a.lineCap=Te(b.lineCap,"butt"),a.lineDashOffset=Te(b.lineDashOffset,0),a.lineJoin=Te(b.lineJoin,"miter"),a.lineWidth=C,a.strokeStyle=Te(b.strokeStyle,l),a.setLineDash(Te(b.lineDash,[])),i.usePointStyle){const V={radius:k*Math.SQRT2/2,pointStyle:b.pointStyle,rotation:b.rotation,borderWidth:C},D=c.xPlus(w,p/2),N=y+m;ql(a,V,D,N,i.pointStyleWidth&&p)}else{const V=y+Math.max((f-k)/2,0),D=c.leftForLtr(w,p),N=io(b.borderRadius);a.beginPath(),Object.values(N).some(P=>P!==0)?Mr(a,{x:D,y:V,w:p,h:k,radius:N}):a.rect(D,V,p,k),a.fill(),C!==0&&a.stroke()}a.restore()},S=function(w,y,b){Ho(a,b.text,w,y+x/2,d,{strikethrough:b.hidden,textAlign:c.textAlign(b.textAlign)})},B=this.isHorizontal(),E=this._computeTitleHeight();B?h={x:xt(s,this.left+u,this.right-r[0]),y:this.top+u+E,line:0}:h={x:this.left+u,y:xt(s,this.top+E+u,this.bottom-o[0].height),line:0},oc(this.ctx,n.textDirection);const _=x+u;this.legendItems.forEach((w,y)=>{a.strokeStyle=w.fontColor,a.fillStyle=w.fontColor;const b=a.measureText(w.text).width,C=c.textAlign(w.textAlign||(w.textAlign=i.textAlign)),V=p+m+b;let D=h.x,N=h.y;c.setWidth(this.width),B?y>0&&D+V+u>this.right&&(N=h.y+=_,h.line++,D=h.x=xt(s,this.left+u,this.right-r[h.line])):y>0&&N+_>this.bottom&&(D=h.x=D+o[h.line].width+u,h.line++,N=h.y=xt(s,this.top+E+u,this.bottom-o[h.line].height));const P=c.x(D);if(g(P,N,w),D=vp(C,D+p+m,B?D+V:this.right,n.rtl),S(c.x(D),N,w),B)h.x+=V+u;else if(typeof w.text!="string"){const M=d.lineHeight;h.y+=ud(w,M)+u}else h.y+=_}),rc(this.ctx,n.textDirection)}drawTitle(){const n=this.options,o=n.title,r=kt(o.font),a=zt(o.padding);if(!o.display)return;const s=uo(n.rtl,this.left,this.width),i=this.ctx,l=o.position,c=r.size/2,d=a.top+c;let u,f=this.left,m=this.width;if(this.isHorizontal())m=Math.max(...this.lineWidths),u=this.top+d,f=xt(n.align,f,this.right-m);else{const p=this.columnSizes.reduce((k,x)=>Math.max(k,x.height),0);u=d+xt(n.align,this.top,this.bottom-p-n.labels.padding-this._computeTitleHeight())}const h=xt(l,f,f+m);i.textAlign=s.textAlign(rs(l)),i.textBaseline="middle",i.strokeStyle=o.color,i.fillStyle=o.color,i.font=r.string,Ho(i,o.text,h,u,r)}_computeTitleHeight(){const n=this.options.title,o=kt(n.font),r=zt(n.padding);return n.display?o.lineHeight+r.height:0}_getLegendItemAt(n,o){let r,a,s;if(un(n,this.left,this.right)&&un(o,this.top,this.bottom)){for(s=this.legendHitBoxes,r=0;r<s.length;++r)if(a=s[r],un(n,a.left,a.left+a.width)&&un(o,a.top,a.top+a.height))return this.legendItems[r]}return null}handleEvent(n){const o=this.options;if(!ly(n.type,o))return;const r=this._getLegendItemAt(n.x,n.y);if(n.type==="mousemove"||n.type==="mouseout"){const a=this._hoveredItem,s=ry(a,r);a&&!s&&nt(o.onLeave,[n,a,this],this),this._hoveredItem=r,r&&!s&&nt(o.onHover,[n,r,this],this)}else r&&nt(o.onClick,[n,r,this],this)}}function ay(t,n,o,r,a){const s=sy(r,t,n,o),i=iy(a,r,n.lineHeight);return{itemWidth:s,itemHeight:i}}function sy(t,n,o,r){let a=t.text;return a&&typeof a!="string"&&(a=a.reduce((s,i)=>s.length>i.length?s:i)),n+o.size/2+r.measureText(a).width}function iy(t,n,o){let r=t;return typeof n.text!="string"&&(r=ud(n,o)),r}function ud(t,n){const o=t.text?t.text.length:0;return n*o}function ly(t,n){return!!((t==="mousemove"||t==="mouseout")&&(n.onHover||n.onLeave)||n.onClick&&(t==="click"||t==="mouseup"))}var cy={id:"legend",_element:dd,start(t,n,o){const r=t.legend=new dd({ctx:t.ctx,options:o,chart:t});Rt.configure(t,r,o),Rt.addBox(t,r)},stop(t){Rt.removeBox(t,t.legend),delete t.legend},beforeUpdate(t,n,o){const r=t.legend;Rt.configure(t,r,o),r.options=o},afterUpdate(t){const n=t.legend;n.buildLabels(),n.adjustHitBoxes()},afterEvent(t,n){n.replay||t.legend.handleEvent(n.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(t,n,o){const r=n.datasetIndex,a=o.chart;a.isDatasetVisible(r)?(a.hide(r),n.hidden=!0):(a.show(r),n.hidden=!1)},onHover:null,onLeave:null,labels:{color:t=>t.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const n=t.data.datasets,{labels:{usePointStyle:o,pointStyle:r,textAlign:a,color:s,useBorderRadius:i,borderRadius:l}}=t.legend.options;return t._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(o?0:void 0),u=zt(d.borderWidth);return{text:n[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:r||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:i&&(l||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class fd extends mn{constructor(n){super(),this.chart=n.chart,this.options=n.options,this.ctx=n.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(n,o){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=n,this.height=this.bottom=o;const a=dt(r.text)?r.text.length:1;this._padding=zt(r.padding);const s=a*kt(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const n=this.options.position;return n==="top"||n==="bottom"}_drawArgs(n){const{top:o,left:r,bottom:a,right:s,options:i}=this,l=i.align;let c=0,d,u,f;return this.isHorizontal()?(u=xt(l,r,s),f=o+n,d=s-r):(i.position==="left"?(u=r+n,f=xt(l,a,o),c=Je*-.5):(u=s-n,f=xt(l,o,a),c=Je*.5),d=a-o),{titleX:u,titleY:f,maxWidth:d,rotation:c}}draw(){const n=this.ctx,o=this.options;if(!o.display)return;const r=kt(o.font),s=r.lineHeight/2+this._padding.top,{titleX:i,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(s);Ho(n,o.text,0,0,r,{color:o.color,maxWidth:c,rotation:d,textAlign:rs(o.align),textBaseline:"middle",translation:[i,l]})}}function dy(t,n){const o=new fd({ctx:t.ctx,options:n,chart:t});Rt.configure(t,o,n),Rt.addBox(t,o),t.titleBlock=o}var uy={id:"title",_element:fd,start(t,n,o){dy(t,o)},stop(t){const n=t.titleBlock;Rt.removeBox(t,n),delete t.titleBlock},beforeUpdate(t,n,o){const r=t.titleBlock;Rt.configure(t,r,o),r.options=o},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const er={average(t){if(!t.length)return!1;let n,o,r=new Set,a=0,s=0;for(n=0,o=t.length;n<o;++n){const l=t[n].element;if(l&&l.hasValue()){const c=l.tooltipPosition();r.add(c.x),a+=c.y,++s}}return s===0||r.size===0?!1:{x:[...r].reduce((l,c)=>l+c)/r.size,y:a/s}},nearest(t,n){if(!t.length)return!1;let o=n.x,r=n.y,a=Number.POSITIVE_INFINITY,s,i,l;for(s=0,i=t.length;s<i;++s){const c=t[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=ns(n,d);u<a&&(a=u,l=c)}}if(l){const c=l.tooltipPosition();o=c.x,r=c.y}return{x:o,y:r}}};function Qt(t,n){return n&&(dt(n)?Array.prototype.push.apply(t,n):t.push(n)),t}function pn(t){return(typeof t=="string"||t instanceof String)&&t.indexOf(`
|
|
17
17
|
`)>-1?t.split(`
|
|
18
|
-
`):t}function uy(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function md(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=Et(n.bodyFont),d=Et(n.titleFont),u=Et(n.footerFont),f=s.length,h=a.length,m=r.length,g=Ut(n.padding);let k=g.height,y=0,p=r.reduce((B,S)=>B+S.before.length+S.lines.length+S.after.length,0);if(p+=t.beforeBody.length+t.afterBody.length,f&&(k+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),p){const B=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;k+=m*B+(p-m)*c.lineHeight+(p-1)*n.bodySpacing}h&&(k+=n.footerMarginTop+h*u.lineHeight+(h-1)*n.footerSpacing);let E=0;const _=function(B){y=Math.max(y,o.measureText(B).width+E)};return o.save(),o.font=d.string,Je(t.title,_),o.font=c.string,Je(t.beforeBody.concat(t.afterBody),_),E=n.displayColors?i+2+n.boxPadding:0,Je(r,B=>{Je(B.before,_),Je(B.lines,_),Je(B.after,_)}),E=0,o.font=u.string,Je(t.footer,_),o.restore(),y+=g.width,{width:y,height:k}}function fy(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function hy(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function my(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),hy(d,t,n,o)&&(d="center"),d}function pd(t,n,o){const r=o.yAlign||n.yAlign||fy(t,o);return{xAlign:o.xAlign||n.xAlign||my(t,n,o,r),yAlign:r}}function py(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function gy(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function gd(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:f,bottomLeft:h,bottomRight:m}=uo(i);let g=py(n,l);const k=gy(n,c,d);return c==="center"?l==="left"?g+=d:l==="right"&&(g-=d):l==="left"?g-=Math.max(u,h)+a:l==="right"&&(g+=Math.max(f,m)+a),{x:wt(g,0,r.width-n.width),y:wt(k,0,r.height-n.height)}}function Jr(t,n,o){const r=Ut(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function bd(t){return an([],wn(t))}function by(t,n,o){return Kn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function yd(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const xd={beforeTitle:pn,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:pn,beforeBody:pn,beforeLabel:pn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return qe(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:pn,afterBody:pn,beforeFooter:pn,footer:pn,afterFooter:pn};function Dt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?xd[n].call(o,r):a}class Ts extends xn{constructor(n){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=n.chart,this.options=n.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const o=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new mc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=by(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=Dt(r,"beforeTitle",this,n),s=Dt(r,"title",this,n),i=Dt(r,"afterTitle",this,n);let l=[];return l=an(l,wn(a)),l=an(l,wn(s)),l=an(l,wn(i)),l}getBeforeBody(n,o){return bd(Dt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Je(n,s=>{const i={before:[],lines:[],after:[]},l=yd(r,s);an(i.before,wn(Dt(l,"beforeLabel",this,s))),an(i.lines,Dt(l,"label",this,s)),an(i.after,wn(Dt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return bd(Dt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=Dt(r,"beforeFooter",this,n),s=Dt(r,"footer",this,n),i=Dt(r,"afterFooter",this,n);let l=[];return l=an(l,wn(a)),l=an(l,wn(s)),l=an(l,wn(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(uy(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,h)=>n.filter(u,f,h,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Je(l,u=>{const f=yd(n.callbacks,u);a.push(Dt(f,"labelColor",this,u)),s.push(Dt(f,"labelPointStyle",this,u)),i.push(Dt(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=tr[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=md(this,r),d=Object.assign({},l,c),u=pd(this.chart,r,d),f=gd(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=uo(l),{x:h,y:m}=n,{width:g,height:k}=o;let y,p,E,_,B,S;return s==="center"?(B=m+k/2,a==="left"?(y=h,p=y-i,_=B+i,S=B-i):(y=h+g,p=y+i,_=B-i,S=B+i),E=y):(a==="left"?p=h+Math.max(c,u)+i:a==="right"?p=h+g-Math.max(d,f)-i:p=this.caretX,s==="top"?(_=m,B=_-i,y=p-i,E=p+i):(_=m+k,B=_+i,y=p+i,E=p-i),S=_),{x1:y,x2:p,x3:E,y1:_,y2:B,y3:S}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=mo(r.rtl,this.x,this.width);for(n.x=Jr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=Et(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=Et(s.bodyFont),f=Jr(this,"left",s),h=a.x(f),m=c<u.lineHeight?(u.lineHeight-c)/2:0,g=o.y+m;if(s.usePointStyle){const k={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},y=a.leftForLtr(h,d)+d/2,p=g+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,ds(n,k,y,p),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,ds(n,k,y,p)}else{n.lineWidth=Le(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const k=a.leftForLtr(h,d),y=a.leftForLtr(a.xPlus(h,1),d-2),p=uo(i.borderRadius);Object.values(p).some(E=>E!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,Mr(n,{x:k,y:g,w:d,h:c,radius:p}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),Mr(n,{x:y,y:g+1,w:d-2,h:c-2,radius:p}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(k,g,d,c),n.strokeRect(k,g,d,c),n.fillStyle=i.backgroundColor,n.fillRect(y,g+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=Et(r.bodyFont);let h=f.lineHeight,m=0;const g=mo(r.rtl,this.x,this.width),k=function(b){o.fillText(b,g.x(n.x+m),n.y+h/2),n.y+=h+s},y=g.textAlign(i);let p,E,_,B,S,w,x;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Jr(this,y,r),o.fillStyle=r.bodyColor,Je(this.beforeBody,k),m=l&&y!=="right"?i==="center"?d/2+u:d+2+u:0,B=0,w=a.length;B<w;++B){for(p=a[B],E=this.labelTextColors[B],o.fillStyle=E,Je(p.before,k),_=p.lines,l&&_.length&&(this._drawColorBox(o,n,B,g,r),h=Math.max(f.lineHeight,c)),S=0,x=_.length;S<x;++S)k(_[S]),h=f.lineHeight;Je(p.after,k)}m=0,h=f.lineHeight,Je(this.afterBody,k),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=mo(r.rtl,this.x,this.width);for(n.x=Jr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=Et(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:f,topRight:h,bottomLeft:m,bottomRight:g}=uo(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-h,c),o.quadraticCurveTo(l+d,c,l+d,c+h),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-g),o.quadraticCurveTo(l+d,c+u,l+d-g,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+m,c+u),o.quadraticCurveTo(l,c+u,l,c+u-m),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=tr[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=md(this,n),c=Object.assign({},i,this._size),d=pd(o,n,c),u=gd(n,c,d,o);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(n){const o=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=Ut(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(n.save(),n.globalAlpha=r,this.drawBackground(s,n,a,o),rc(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),ac(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=n.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!_r(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!_r(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(n,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=tr[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}we(Ts,"positioners",tr);var yy={id:"tooltip",_element:Ts,positioners:tr,afterInit(t,n,o){o&&(t.tooltip=new Ts({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.tooltip.handleEvent(n.event,o,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,n)=>n.bodyFont.size,boxWidth:(t,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:xd},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 xy=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function ky(t,n,o,r){const a=t.indexOf(n);if(a===-1)return xy(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const wy=(t,n)=>t===null?null:wt(Math.round(t),0,n);function kd(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class Os extends go{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(qe(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:ky(r,n,Oe(o,n),this._addedLabels),wy(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return kd.call(this,n)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}we(Os,"id","category"),we(Os,"defaults",{ticks:{callback:kd}});function Cy(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:h}=t,m=s||1,g=u-1,{min:k,max:y}=n,p=!qe(i),E=!qe(l),_=!qe(d),B=(y-k)/(f+1);let S=vl((y-k)/g/m)*m,w,x,b,A;if(S<1e-14&&!p&&!E)return[{value:k},{value:y}];A=Math.ceil(y/S)-Math.floor(k/S),A>g&&(S=vl(A*S/g/m)*m),qe(c)||(w=Math.pow(10,c),S=Math.ceil(S*w)/w),a==="ticks"?(x=Math.floor(k/S)*S,b=Math.ceil(y/S)*S):(x=k,b=y),p&&E&&s&&_p((l-i)/s,S/1e3)?(A=Math.round(Math.min((l-i)/S,u)),S=(l-i)/A,x=i,b=l):_?(x=p?i:x,b=E?l:b,A=d-1,S=(b-x)/A):(A=(b-x)/S,Lo(A,Math.round(A),S/1e3)?A=Math.round(A):A=Math.ceil(A));const V=Math.max(Pl(S),Pl(x));w=Math.pow(10,qe(c)?V:c),x=Math.round(x*w)/w,b=Math.round(b*w)/w;let D=0;for(p&&(h&&x!==i?(o.push({value:i}),x<i&&D++,Lo(Math.round((x+D*S)*w)/w,i,wd(i,B,t))&&D++):x<i&&D++);D<A;++D){const N=Math.round((x+D*S)*w)/w;if(E&&N>l)break;o.push({value:N})}return E&&h&&b!==l?o.length&&Lo(o[o.length-1].value,l,wd(l,B,t))?o[o.length-1].value=l:o.push({value:l}):(!E||b===l)&&o.push({value:b}),o}function wd(t,n,{horizontal:o,minRotation:r}){const a=gn(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class Ey extends go{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,o){return qe(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=on(a),d=on(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:n.bounds,min:n.min,max:n.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=Cy(a,s);return n.bounds==="ticks"&&Sp(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const n=this.ticks;let o=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return is(n,this.chart.options.locale,this.options.ticks.format)}}class Fs extends Ey{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=kt(n)?n:0,this.max=kt(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=gn(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}we(Fs,"id","linear"),we(Fs,"defaults",{ticks:{callback:Wl.formatters.numeric}});const Qr={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}},Nt=Object.keys(Qr);function Cd(t,n){return t-n}function Ed(t,n){if(qe(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),kt(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&($o(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function Bd(t,n,o,r){const a=Nt.length;for(let s=Nt.indexOf(t);s<a-1;++s){const i=Qr[Nt[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return Nt[s]}return Nt[a-1]}function By(t,n,o,r,a){for(let s=Nt.length-1;s>=Nt.indexOf(o);s--){const i=Nt[s];if(Qr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return Nt[o?Nt.indexOf(o):0]}function _y(t){for(let n=Nt.indexOf(t)+1,o=Nt.length;n<o;++n)if(Qr[Nt[n]].common)return Nt[n]}function _d(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=os(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function Sy(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function Sd(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:Sy(t,r,a,o)}class Zr extends go{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,o={}){const r=n.time||(n.time={}),a=this._adapter=new l0._date(n.adapters.date);a.init(o),Io(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:Ed(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=kt(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=kt(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=Mp(a,s,i);return this._unit=o.unit||(r.autoSkip?Bd(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):By(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:_y(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),Sd(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=wt(o,0,i),r=wt(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||Bd(s.minUnit,o,r,this._getLabelCapacity(o)),l=Oe(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=$o(c)||c===!0,u={};let f=o,h,m;if(d&&(f=+n.startOf(f,"isoWeek",c)),f=+n.startOf(f,d?"day":i),n.diff(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const g=a.ticks.source==="data"&&this.getDataTimestamps();for(h=f,m=0;h<r;h=+n.add(h,l,i),m++)_d(u,h,g);return(h===r||a.bounds==="ticks"||m===1)&&_d(u,h,g),Object.keys(u).sort(Cd).map(k=>+k)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return at(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],h=r[o],m=d&&f&&h&&h.major;return this._adapter.format(n,a||(m?f:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=gn(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,Sd(this,[n],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let n=this._cache.data||[],o,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(Ed(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return zl(n.sort(Cd))}}we(Zr,"id","time"),we(Zr,"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 ea(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=qn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=qn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class Ad extends Zr{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=ea(o,this.min),this._tableRange=ea(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const n=this.min,o=this.max;let r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(ea(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return ea(this._table,r*this._tableRange+this._minPos,!0)}}we(Ad,"id","timeseries"),we(Ad,"defaults",Zr.defaults);const Ay={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Vy={key:0,class:"text-red-500 ml-1"},Dy={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},Ny={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},My={class:"text-red-600 text-sm"},vy={key:1,class:"mt-2 text-xs text-gray-500"},Py={key:0},Vd=Ot(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:n,emit:o}){kn.register(Os,Fs,Xr,vn,Kr,er,dy,yy,ly,ny,Ir,zr,ws,po);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const h=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:m=>{let g=0;return m.type==="data"&&m.mode==="default"&&(g=m.dataIndex*100+m.datasetIndex*50),g},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:h?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:h?"#1F2937":"#FFFFFF",titleColor:h?"#F3F4F6":"#111827",bodyColor:h?"#D1D5DB":"#4B5563",borderColor:h?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}},y:{grid:{color:h?"#374151":"#E5E7EB"},ticks:{color:h?"#D1D5DB":"#6B7280"}}}:void 0}},u=h=>!h||!h.datasets?h:{...h,datasets:h.datasets.map((m,g)=>{const k=g%r.colors.length,y=r.colors[k];let p=m.backgroundColor,E=m.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!p||p.length===0)?m.data&&(p=m.data.map((_,B)=>r.colors[B%r.colors.length]+"80"),E=m.data.map((_,B)=>r.colors[B%r.colors.length])):(p=p||y+"40",E=E||y),{...m,borderColor:E,backgroundColor:p,pointBackgroundColor:m.pointBackgroundColor||y,pointBorderColor:m.pointBorderColor||y,hoverBackgroundColor:m.hoverBackgroundColor||y+"60",hoverBorderColor:m.hoverBorderColor||y}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const h=r.data||r.modelValue;let m=h;if(Array.isArray(h))if(h.length>0&&typeof h[0]=="object"&&h[0]!==null){const k=Object.keys(h[0]),y=k.find(E=>["label","name","x","category","title"].includes(E.toLowerCase()))||k[0],p=k.find(E=>E!==y&&["value","y","count","amount","total","data"].includes(E.toLowerCase()))||k.find(E=>E!==y&&typeof h[0][E]=="number")||(k.length>1?k.find(E=>E!==y):k[0]);m={labels:h.map(E=>E[y||""]),datasets:[{label:r.label||"Data",data:h.map(E=>E[p||""])}]}}else h.length>0?m={labels:h.map((k,y)=>`Data ${y+1}`),datasets:[{label:r.label||"Data",data:h}]}:m={labels:[],datasets:[]};if(l.value=u(m),!l.value)return;const g={...d(),...r.options,onClick:(k,y)=>{a("click",k,y),r.onClick&&r.onClick(k,y)},onHover:(k,y)=>{a("hover",k,y),r.onHover&&r.onHover(k,y)}};i.value=new kn(s.value,{type:r.type,data:l.value,options:g}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(h,m)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",Ay,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Vy,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",Dy,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",Ny,[e.createElementVNode("div",My,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",vy,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",Py,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),nr=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.Label),e.mergeProps(e.unref(o),{class:e.unref(Re)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),Ty={class:"grid gap-1.5"},Oy={key:0,class:"ml-1 text-destructive"},Fy=["aria-busy"],zy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Iy={key:1,class:"flex items-center"},Ry=["id","checked","indeterminate","disabled","required"],Cn=Ot(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,h=>{d.value=!!h},{immediate:!0});const u=()=>{if(a.disabled)return;const h=!d.value;d.value=h,r("update:modelValue",h)},f=h=>{(h.key===" "||h.key==="Enter")&&(h.preventDefault(),u())};return(h,m)=>(e.openBlock(),e.createElementBlock("div",Ty,[t.label?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Oy,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",zy)):e.createCommentVNode("",!0),m[0]||(m[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",Iy,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Ry),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(ce.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,Fy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),Ly={class:"w-full"},$y={key:0,class:"mb-4"},jy={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Uy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Wy={key:0,class:"ml-1 text-destructive"},Hy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},qy={key:1,class:"flex flex-wrap gap-4"},Gy={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Xy={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Ky={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},zs=Ot(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ft(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,S=>{if(!S){s.value=new Set;return}const w=S.map(x=>typeof x=="object"&&x!==null?x.id!==void 0?x.id:x.value:x);s.value=new Set(w)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var w,x;const S=((w=a.endpoint)==null?void 0:w.apiUrl)||a.apiUrl;if(!(!S&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const A=((x=a.endpoint)==null?void 0:x.apiMethod)||a.apiMethod||"GET",V={page:1,perPage:100,...a.apiParams};if(S)b=await o(S,A,V);else if(a.apiModule&&a.apiAction){const{DCodeApi:N}=ft();b=await N(a.apiModule,a.apiAction,V)}let D=b;a.dataPath?D=a.dataPath.split(".").reduce((P,v)=>P&&P[v]!==void 0?P[v]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(D=b.data),Array.isArray(D)?i.value=D:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(b){console.error("DCodeCardCheckboxList fetch error:",b),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var S;((S=a.endpoint)!=null&&S.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),g=S=>{if(typeof S!="object"||S===null)return S;const w=a.itemValue||a.model||"id";return S[w]},k=S=>{if(typeof S!="object"||S===null)return String(S);const w=a.itemTitle||"name";return S[w]},y=S=>s.value.has(S),p=(S,w)=>{if(a.disabled)return;const x=new Set(s.value);w?x.add(S):x.delete(S),s.value=x;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},E=e.computed(()=>a.skeleton||l.value),_=e.computed(()=>!!a.error||!!c.value),B=e.computed(()=>a.error||c.value);return(S,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",Ly,[t.label||E.value?(e.openBlock(),e.createElementBlock("div",$y,[E.value?(e.openBlock(),e.createElementBlock("div",jy)):(e.openBlock(),e.createElementBlock("h3",Uy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Wy,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",Hy,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createElementBlock("div",qy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,x=>e.createElementVNode("div",{key:`skeleton-${x}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...w[1]||(w[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[m.value.length===0?(e.openBlock(),e.createElementBlock("div",Gy," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",Xy,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(x,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(Cn,{"model-value":y(g(x)),title:k(x),disabled:t.disabled,"onUpdate:modelValue":A=>p(g(x),A)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),_.value&&B.value?(e.openBlock(),e.createElementBlock("div",Ky,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(B.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Yy=["aria-busy"],Jy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Qy={key:1,class:"flex justify-end"},Zy=["for"],ex={key:0,class:"ml-1 text-destructive"},tx={class:"relative w-full group"},nx={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},ox={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},rx=["id","disabled","readonly","placeholder","maxlength"],ax={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},sx={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Is=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const D=o.required,N=o["aria-required"];return D===""||D===!0||D==="true"||(N==="true"||N===!0)}),c=e.computed(()=>{const D=o.maxlength??o.maxLength;let N=Number.NaN;return typeof D=="number"?N=D:typeof D=="string"&&(N=Number.parseInt(D,10)),Number.isFinite(N)&&N>0?N:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),h=D=>{const N=D.replaceAll(/\D/g,"");return N?Number(N):null},m=D=>f.value.format(D),g=e.ref(""),k=e.ref(null);e.watch(()=>a.modelValue,D=>{D==null?g.value="":h(g.value)!==D&&(g.value=m(D))},{immediate:!0});const y=(D,N)=>{let P=0;for(let v=0;v<N;v++)/\d/.test(D[v])&&P++;return P},p=(D,N)=>{let P=0;for(let v=0;v<D.length;v++)if(/\d/.test(D[v])&&(P++,P===N))return v+1;return D.length},E=D=>{const N=D.target,P=N.value,v=N.selectionStart??P.length,Q=h(P);if(Q===null){g.value="",r("update:modelValue",null);return}const j=m(Q);if(P!==j){const G=y(P,v);g.value=j,e.nextTick(()=>{if(k.value){const Y=p(j,G);k.value.setSelectionRange(Y,Y)}})}r("update:modelValue",Q)},_=()=>{g.value="",r("update:modelValue",null),r("clear")},B=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?g.value.length>0:!0),S=e.computed(()=>!!a.error),w=e.computed(()=>{const{class:D,maxlength:N,maxLength:P,...v}=o;return v}),x=e.computed(()=>g.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),A=e.computed(()=>b.value&&x.value>0),V=e.computed(()=>`${x.value} / ${c.value}`);return(D,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Jy)):e.createCommentVNode("",!0),N[2]||(N[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(e.openBlock(),e.createElementBlock("div",Qy,[...N[1]||(N[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",ex,"*")):e.createCommentVNode("",!0)],8,Zy)):e.createCommentVNode("",!0),e.createElementVNode("div",tx,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",S.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[e.createElementVNode("div",nx,[e.createElementVNode("span",ox,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:k,"onUpdate:modelValue":N[0]||(N[0]=P=>g.value=P),onInput:E,type:"text",inputmode:"numeric"},w.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",B.value?"pr-8":""]}),null,16,rx),[[e.vModelText,g.value]]),B.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:_},[e.createVNode(e.unref(ce.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),A.value&&!S.value?(e.openBlock(),e.createElementBlock("p",ax,e.toDisplayString(V.value),1)):e.createCommentVNode("",!0)]),S.value?(e.openBlock(),e.createElementBlock("p",sx,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Yy))}}),Dd=6048e5,ix=864e5,Nd=Symbol.for("constructDateFrom");function Tn(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Nd in t?t[Nd](n):t instanceof Date?new t.constructor(n):new Date(n)}function Qt(t,n){return Tn(n||t,t)}let lx={};function ta(){return lx}function or(t,n){var l,c,d,u;const o=ta(),r=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=Qt(t,n==null?void 0:n.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function na(t,n){return or(t,{...n,weekStartsOn:1})}function Md(t,n){const o=Qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Tn(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=na(a),i=Tn(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=na(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function vd(t){const n=Qt(t),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+t-+o}function cx(t,...n){const o=Tn.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function Pd(t,n){const o=Qt(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function dx(t,n,o){const[r,a]=cx(o==null?void 0:o.in,t,n),s=Pd(r),i=Pd(a),l=+s-vd(s),c=+i-vd(i);return Math.round((l-c)/ix)}function ux(t,n){const o=Md(t,n),r=Tn(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),na(r)}function fx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function hx(t){return!(!fx(t)&&typeof t!="number"||isNaN(+Qt(t)))}function mx(t,n){const o=Qt(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const px={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"}},gx=(t,n,o)=>{let r;const a=px[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function yo(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const bx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},yx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},xx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kx={date:yo({formats:bx,defaultWidth:"full"}),time:yo({formats:yx,defaultWidth:"full"}),dateTime:yo({formats:xx,defaultWidth:"full"})},wx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Cx=(t,n,o,r)=>wx[t];function sn(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const Ex={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Bx={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},_x={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"]},Sx={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"]},Ax={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"}},Vx={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"}},Dx={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:sn({values:Ex,defaultWidth:"wide"}),quarter:sn({values:Bx,defaultWidth:"wide",argumentCallback:t=>t-1}),month:sn({values:_x,defaultWidth:"wide"}),day:sn({values:Sx,defaultWidth:"wide"}),dayPeriod:sn({values:Ax,defaultWidth:"wide",formattingValues:Vx,defaultFormattingWidth:"wide"})};function ln(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Mx(l,f=>f.test(i)):Nx(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function Nx(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function Mx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function Td(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const vx=/^(\d+)(th|st|nd|rd)?/i,Px=/\d+/i,Tx={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},Ox={any:[/^b/i,/^(a|c)/i]},Fx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},zx={any:[/1/i,/2/i,/3/i,/4/i]},Ix={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},Rx={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]},Lx={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},$x={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]},jx={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},Ux={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}},Wx={ordinalNumber:Td({matchPattern:vx,parsePattern:Px,valueCallback:t=>parseInt(t,10)}),era:ln({matchPatterns:Tx,defaultMatchWidth:"wide",parsePatterns:Ox,defaultParseWidth:"any"}),quarter:ln({matchPatterns:Fx,defaultMatchWidth:"wide",parsePatterns:zx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ln({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any"}),day:ln({matchPatterns:Lx,defaultMatchWidth:"wide",parsePatterns:$x,defaultParseWidth:"any"}),dayPeriod:ln({matchPatterns:jx,defaultMatchWidth:"any",parsePatterns:Ux,defaultParseWidth:"any"})},Od={code:"en-US",formatDistance:gx,formatLong:kx,formatRelative:Cx,localize:Dx,match:Wx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Hx(t,n){const o=Qt(t,n==null?void 0:n.in);return dx(o,mx(o))+1}function qx(t,n){const o=Qt(t,n==null?void 0:n.in),r=+na(o)-+ux(o);return Math.round(r/Dd)+1}function Fd(t,n){var u,f,h,m;const o=Qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=ta(),s=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,i=Tn((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=or(i,n),c=Tn((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=or(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function Gx(t,n){var l,c,d,u;const o=ta(),r=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=Fd(t,n),s=Tn((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),or(s,n)}function Xx(t,n){const o=Qt(t,n==null?void 0:n.in),r=+or(o,n)-+Gx(o,n);return Math.round(r/Dd)+1}function Ze(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const On={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return Ze(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):Ze(o+1,2)},d(t,n){return Ze(t.getDate(),n.length)},a(t,n){const o=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,n){return Ze(t.getHours()%12||12,n.length)},H(t,n){return Ze(t.getHours(),n.length)},m(t,n){return Ze(t.getMinutes(),n.length)},s(t,n){return Ze(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return Ze(a,n.length)}},xo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},zd={G:function(t,n,o){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})}},y:function(t,n,o){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return o.ordinalNumber(a,{unit:"year"})}return On.y(t,n)},Y:function(t,n,o,r){const a=Fd(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return Ze(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):Ze(s,n.length)},R:function(t,n){const o=Md(t);return Ze(o,n.length)},u:function(t,n){const o=t.getFullYear();return Ze(o,n.length)},Q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return Ze(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return Ze(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,o){const r=t.getMonth();switch(n){case"M":case"MM":return On.M(t,n);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,o){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return Ze(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,o,r){const a=Xx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):Ze(a,n.length)},I:function(t,n,o){const r=qx(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):Ze(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):On.d(t,n)},D:function(t,n,o){const r=Hx(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):Ze(r,n.length)},E:function(t,n,o){const r=t.getDay();switch(n){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});case"EEEE":default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Ze(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(a,{width:"short",context:"formatting"});case"eeee":default:return o.day(a,{width:"wide",context:"formatting"})}},c:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Ze(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(a,{width:"narrow",context:"standalone"});case"cccccc":return o.day(a,{width:"short",context:"standalone"});case"cccc":default:return o.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,o){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return Ze(a,n.length);case"io":return o.ordinalNumber(a,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});case"iiii":default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,o){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,o){const r=t.getHours();let a;switch(r===12?a=xo.noon:r===0?a=xo.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,o){const r=t.getHours();let a;switch(r>=17?a=xo.evening:r>=12?a=xo.afternoon:r>=4?a=xo.morning:a=xo.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,o){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return On.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):On.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):Ze(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):Ze(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):On.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):On.s(t,n)},S:function(t,n){return On.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return Rd(r);case"XXXX":case"XX":return to(r);case"XXXXX":case"XXX":default:return to(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return Rd(r);case"xxxx":case"xx":return to(r);case"xxxxx":case"xxx":default:return to(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+Id(r,":");case"OOOO":default:return"GMT"+to(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+Id(r,":");case"zzzz":default:return"GMT"+to(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return Ze(r,n.length)},T:function(t,n,o){return Ze(+t,n.length)}};function Id(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?o+String(a):o+String(a)+n+Ze(s,2)}function Rd(t,n){return t%60===0?(t>0?"-":"+")+Ze(Math.abs(t)/60,2):to(t,n)}function to(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Ze(Math.trunc(r/60),2),s=Ze(r%60,2);return o+a+n+s}const Ld=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},$d=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Kx={p:$d,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return Ld(t,n);let s;switch(r){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Ld(r,n)).replace("{{time}}",$d(a,n))}},Yx=/^D+$/,Jx=/^Y+$/,Qx=["D","DD","YY","YYYY"];function Zx(t){return Yx.test(t)}function ek(t){return Jx.test(t)}function tk(t,n,o){const r=nk(t,n,o);if(console.warn(r),Qx.includes(t))throw new RangeError(r)}function nk(t,n,o){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const ok=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rk=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ak=/^'([^]*?)'?$/,sk=/''/g,ik=/[a-zA-Z]/;function jd(t,n,o){var u,f,h,m;const r=ta(),a=r.locale??Od,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,l=Qt(t,o==null?void 0:o.in);if(!hx(l))throw new RangeError("Invalid time value");let c=n.match(rk).map(g=>{const k=g[0];if(k==="p"||k==="P"){const y=Kx[k];return y(g,a.formatLong)}return g}).join("").match(ok).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const k=g[0];if(k==="'")return{isToken:!1,value:lk(g)};if(zd[k])return{isToken:!0,value:g};if(k.match(ik))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const k=g.value;(ek(k)||Zx(k))&&tk(k,n,String(t));const y=zd[k[0]];return y(l,k,a.localize,d)}).join("")}function lk(t){const n=t.match(ak);return n?n[1].replace(sk,"'"):t}const ck={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"}},dk=(t,n,o)=>{let r;const a=ck[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},uk={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},fk={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},hk={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},mk={date:yo({formats:uk,defaultWidth:"full"}),time:yo({formats:fk,defaultWidth:"full"}),dateTime:yo({formats:hk,defaultWidth:"full"})},pk={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},gk=(t,n,o,r)=>pk[t],bk={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},yk={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},xk={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"]},kk={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"]},wk={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"}},Ck={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"}},Ek={ordinalNumber:(t,n)=>"ke-"+Number(t),era:sn({values:bk,defaultWidth:"wide"}),quarter:sn({values:yk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:sn({values:xk,defaultWidth:"wide"}),day:sn({values:kk,defaultWidth:"wide"}),dayPeriod:sn({values:wk,defaultWidth:"wide",formattingValues:Ck,defaultFormattingWidth:"wide"})},Bk=/^ke-(\d+)?/i,_k=/\d+/i,Sk={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},Ak={any:[/^s/i,/^(m|e)/i]},Vk={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},Dk={any:[/1/i,/2/i,/3/i,/4/i]},Nk={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},Mk={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]},vk={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},Pk={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]},Tk={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},Ok={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}},Fk={ordinalNumber:Td({matchPattern:Bk,parsePattern:_k,valueCallback:t=>parseInt(t,10)}),era:ln({matchPatterns:Sk,defaultMatchWidth:"wide",parsePatterns:Ak,defaultParseWidth:"any"}),quarter:ln({matchPatterns:Vk,defaultMatchWidth:"wide",parsePatterns:Dk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ln({matchPatterns:Nk,defaultMatchWidth:"wide",parsePatterns:Mk,defaultParseWidth:"any"}),day:ln({matchPatterns:vk,defaultMatchWidth:"wide",parsePatterns:Pk,defaultParseWidth:"any"}),dayPeriod:ln({matchPatterns:Tk,defaultMatchWidth:"any",parsePatterns:Ok,defaultParseWidth:"any"})},zk={code:"id",formatDistance:dk,formatLong:mk,formatRelative:gk,localize:Ek,match:Fk,options:{weekStartsOn:1,firstWeekContainsDate:1}},Ud={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)"}}},Wd="dcode-dp-theme-forced";function Ik(t,n=Wd){const o=Ud[t]??Ud.primary,r=`
|
|
18
|
+
`):t}function fy(t,n){const{element:o,datasetIndex:r,index:a}=n,s=t.getDatasetMeta(r).controller,{label:i,value:l}=s.getLabelAndValue(a);return{chart:t,label:i,parsed:s.getParsed(a),raw:t.data.datasets[r].data[a],formattedValue:l,dataset:s.getDataset(),dataIndex:a,datasetIndex:r,element:o}}function md(t,n){const o=t.chart.ctx,{body:r,footer:a,title:s}=t,{boxWidth:i,boxHeight:l}=n,c=kt(n.bodyFont),d=kt(n.titleFont),u=kt(n.footerFont),f=s.length,m=a.length,h=r.length,p=zt(n.padding);let k=p.height,x=0,g=r.reduce((E,_)=>E+_.before.length+_.lines.length+_.after.length,0);if(g+=t.beforeBody.length+t.afterBody.length,f&&(k+=f*d.lineHeight+(f-1)*n.titleSpacing+n.titleMarginBottom),g){const E=n.displayColors?Math.max(l,c.lineHeight):c.lineHeight;k+=h*E+(g-h)*c.lineHeight+(g-1)*n.bodySpacing}m&&(k+=n.footerMarginTop+m*u.lineHeight+(m-1)*n.footerSpacing);let S=0;const B=function(E){x=Math.max(x,o.measureText(E).width+S)};return o.save(),o.font=d.string,Ye(t.title,B),o.font=c.string,Ye(t.beforeBody.concat(t.afterBody),B),S=n.displayColors?i+2+n.boxPadding:0,Ye(r,E=>{Ye(E.before,B),Ye(E.lines,B),Ye(E.after,B)}),S=0,o.font=u.string,Ye(t.footer,B),o.restore(),x+=p.width,{width:x,height:k}}function my(t,n){const{y:o,height:r}=n;return o<r/2?"top":o>t.height-r/2?"bottom":"center"}function hy(t,n,o,r){const{x:a,width:s}=r,i=o.caretSize+o.caretPadding;if(t==="left"&&a+s+i>n.width||t==="right"&&a-s-i<0)return!0}function py(t,n,o,r){const{x:a,width:s}=o,{width:i,chartArea:{left:l,right:c}}=t;let d="center";return r==="center"?d=a<=(l+c)/2?"left":"right":a<=s/2?d="left":a>=i-s/2&&(d="right"),hy(d,t,n,o)&&(d="center"),d}function hd(t,n,o){const r=o.yAlign||n.yAlign||my(t,o);return{xAlign:o.xAlign||n.xAlign||py(t,n,o,r),yAlign:r}}function gy(t,n){let{x:o,width:r}=t;return n==="right"?o-=r:n==="center"&&(o-=r/2),o}function by(t,n,o){let{y:r,height:a}=t;return n==="top"?r+=o:n==="bottom"?r-=a+o:r-=a/2,r}function pd(t,n,o,r){const{caretSize:a,caretPadding:s,cornerRadius:i}=t,{xAlign:l,yAlign:c}=o,d=a+s,{topLeft:u,topRight:f,bottomLeft:m,bottomRight:h}=io(i);let p=gy(n,l);const k=by(n,c,d);return c==="center"?l==="left"?p+=d:l==="right"&&(p-=d):l==="left"?p-=Math.max(u,m)+a:l==="right"&&(p+=Math.max(f,h)+a),{x:yt(p,0,r.width-n.width),y:yt(k,0,r.height-n.height)}}function Jr(t,n,o){const r=zt(o.padding);return n==="center"?t.x+t.width/2:n==="right"?t.x+t.width-r.right:t.x+r.left}function gd(t){return Qt([],pn(t))}function yy(t,n,o){return Gn(t,{tooltip:n,tooltipItems:o,type:"tooltip"})}function bd(t,n){const o=n&&n.dataset&&n.dataset.tooltip&&n.dataset.tooltip.callbacks;return o?t.override(o):t}const yd={beforeTitle:cn,title(t){if(t.length>0){const n=t[0],o=n.chart.data.labels,r=o?o.length:0;if(this&&this.options&&this.options.mode==="dataset")return n.dataset.label||"";if(n.label)return n.label;if(r>0&&n.dataIndex<r)return o[n.dataIndex]}return""},afterTitle:cn,beforeBody:cn,beforeLabel:cn,label(t){if(this&&this.options&&this.options.mode==="dataset")return t.label+": "+t.formattedValue||t.formattedValue;let n=t.dataset.label||"";n&&(n+=": ");const o=t.formattedValue;return Ge(o)||(n+=o),n},labelColor(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{borderColor:o.borderColor,backgroundColor:o.backgroundColor,borderWidth:o.borderWidth,borderDash:o.borderDash,borderDashOffset:o.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(t){const o=t.chart.getDatasetMeta(t.datasetIndex).controller.getStyle(t.dataIndex);return{pointStyle:o.pointStyle,rotation:o.rotation}},afterLabel:cn,afterBody:cn,beforeFooter:cn,footer:cn,afterFooter:cn};function Bt(t,n,o,r){const a=t[n].call(o,r);return typeof a>"u"?yd[n].call(o,r):a}class Os extends mn{constructor(n){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=n.chart,this.options=n.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(n){this.options=n,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const n=this._cachedAnimations;if(n)return n;const o=this.chart,r=this.options.setContext(this.getContext()),a=r.enabled&&o.options.animation&&r.animations,s=new mc(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=yy(this.chart.getContext(),this,this._tooltipItems))}getTitle(n,o){const{callbacks:r}=o,a=Bt(r,"beforeTitle",this,n),s=Bt(r,"title",this,n),i=Bt(r,"afterTitle",this,n);let l=[];return l=Qt(l,pn(a)),l=Qt(l,pn(s)),l=Qt(l,pn(i)),l}getBeforeBody(n,o){return gd(Bt(o.callbacks,"beforeBody",this,n))}getBody(n,o){const{callbacks:r}=o,a=[];return Ye(n,s=>{const i={before:[],lines:[],after:[]},l=bd(r,s);Qt(i.before,pn(Bt(l,"beforeLabel",this,s))),Qt(i.lines,Bt(l,"label",this,s)),Qt(i.after,pn(Bt(l,"afterLabel",this,s))),a.push(i)}),a}getAfterBody(n,o){return gd(Bt(o.callbacks,"afterBody",this,n))}getFooter(n,o){const{callbacks:r}=o,a=Bt(r,"beforeFooter",this,n),s=Bt(r,"footer",this,n),i=Bt(r,"afterFooter",this,n);let l=[];return l=Qt(l,pn(a)),l=Qt(l,pn(s)),l=Qt(l,pn(i)),l}_createItems(n){const o=this._active,r=this.chart.data,a=[],s=[],i=[];let l=[],c,d;for(c=0,d=o.length;c<d;++c)l.push(fy(this.chart,o[c]));return n.filter&&(l=l.filter((u,f,m)=>n.filter(u,f,m,r))),n.itemSort&&(l=l.sort((u,f)=>n.itemSort(u,f,r))),Ye(l,u=>{const f=bd(n.callbacks,u);a.push(Bt(f,"labelColor",this,u)),s.push(Bt(f,"labelPointStyle",this,u)),i.push(Bt(f,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=i,this.dataPoints=l,l}update(n,o){const r=this.options.setContext(this.getContext()),a=this._active;let s,i=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const l=er[r.position].call(this,a,this._eventPosition);i=this._createItems(r),this.title=this.getTitle(i,r),this.beforeBody=this.getBeforeBody(i,r),this.body=this.getBody(i,r),this.afterBody=this.getAfterBody(i,r),this.footer=this.getFooter(i,r);const c=this._size=md(this,r),d=Object.assign({},l,c),u=hd(this.chart,r,d),f=pd(r,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=i,this.$context=void 0,s&&this._resolveAnimations().update(this,s),n&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:o})}drawCaret(n,o,r,a){const s=this.getCaretPosition(n,r,a);o.lineTo(s.x1,s.y1),o.lineTo(s.x2,s.y2),o.lineTo(s.x3,s.y3)}getCaretPosition(n,o,r){const{xAlign:a,yAlign:s}=this,{caretSize:i,cornerRadius:l}=r,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=io(l),{x:m,y:h}=n,{width:p,height:k}=o;let x,g,S,B,E,_;return s==="center"?(E=h+k/2,a==="left"?(x=m,g=x-i,B=E+i,_=E-i):(x=m+p,g=x+i,B=E-i,_=E+i),S=x):(a==="left"?g=m+Math.max(c,u)+i:a==="right"?g=m+p-Math.max(d,f)-i:g=this.caretX,s==="top"?(B=h,E=B-i,x=g-i,S=g+i):(B=h+k,E=B+i,x=g+i,S=g-i),_=B),{x1:x,x2:g,x3:S,y1:B,y2:E,y3:_}}drawTitle(n,o,r){const a=this.title,s=a.length;let i,l,c;if(s){const d=uo(r.rtl,this.x,this.width);for(n.x=Jr(this,r.titleAlign,r),o.textAlign=d.textAlign(r.titleAlign),o.textBaseline="middle",i=kt(r.titleFont),l=r.titleSpacing,o.fillStyle=r.titleColor,o.font=i.string,c=0;c<s;++c)o.fillText(a[c],d.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+l,c+1===s&&(n.y+=r.titleMarginBottom-l)}}_drawColorBox(n,o,r,a,s){const i=this.labelColors[r],l=this.labelPointStyles[r],{boxHeight:c,boxWidth:d}=s,u=kt(s.bodyFont),f=Jr(this,"left",s),m=a.x(f),h=c<u.lineHeight?(u.lineHeight-c)/2:0,p=o.y+h;if(s.usePointStyle){const k={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},x=a.leftForLtr(m,d)+d/2,g=p+c/2;n.strokeStyle=s.multiKeyBackground,n.fillStyle=s.multiKeyBackground,ds(n,k,x,g),n.strokeStyle=i.borderColor,n.fillStyle=i.backgroundColor,ds(n,k,x,g)}else{n.lineWidth=Fe(i.borderWidth)?Math.max(...Object.values(i.borderWidth)):i.borderWidth||1,n.strokeStyle=i.borderColor,n.setLineDash(i.borderDash||[]),n.lineDashOffset=i.borderDashOffset||0;const k=a.leftForLtr(m,d),x=a.leftForLtr(a.xPlus(m,1),d-2),g=io(i.borderRadius);Object.values(g).some(S=>S!==0)?(n.beginPath(),n.fillStyle=s.multiKeyBackground,Mr(n,{x:k,y:p,w:d,h:c,radius:g}),n.fill(),n.stroke(),n.fillStyle=i.backgroundColor,n.beginPath(),Mr(n,{x,y:p+1,w:d-2,h:c-2,radius:g}),n.fill()):(n.fillStyle=s.multiKeyBackground,n.fillRect(k,p,d,c),n.strokeRect(k,p,d,c),n.fillStyle=i.backgroundColor,n.fillRect(x,p+1,d-2,c-2))}n.fillStyle=this.labelTextColors[r]}drawBody(n,o,r){const{body:a}=this,{bodySpacing:s,bodyAlign:i,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:u}=r,f=kt(r.bodyFont);let m=f.lineHeight,h=0;const p=uo(r.rtl,this.x,this.width),k=function(b){o.fillText(b,p.x(n.x+h),n.y+m/2),n.y+=m+s},x=p.textAlign(i);let g,S,B,E,_,w,y;for(o.textAlign=i,o.textBaseline="middle",o.font=f.string,n.x=Jr(this,x,r),o.fillStyle=r.bodyColor,Ye(this.beforeBody,k),h=l&&x!=="right"?i==="center"?d/2+u:d+2+u:0,E=0,w=a.length;E<w;++E){for(g=a[E],S=this.labelTextColors[E],o.fillStyle=S,Ye(g.before,k),B=g.lines,l&&B.length&&(this._drawColorBox(o,n,E,p,r),m=Math.max(f.lineHeight,c)),_=0,y=B.length;_<y;++_)k(B[_]),m=f.lineHeight;Ye(g.after,k)}h=0,m=f.lineHeight,Ye(this.afterBody,k),n.y-=s}drawFooter(n,o,r){const a=this.footer,s=a.length;let i,l;if(s){const c=uo(r.rtl,this.x,this.width);for(n.x=Jr(this,r.footerAlign,r),n.y+=r.footerMarginTop,o.textAlign=c.textAlign(r.footerAlign),o.textBaseline="middle",i=kt(r.footerFont),o.fillStyle=r.footerColor,o.font=i.string,l=0;l<s;++l)o.fillText(a[l],c.x(n.x),n.y+i.lineHeight/2),n.y+=i.lineHeight+r.footerSpacing}}drawBackground(n,o,r,a){const{xAlign:s,yAlign:i}=this,{x:l,y:c}=n,{width:d,height:u}=r,{topLeft:f,topRight:m,bottomLeft:h,bottomRight:p}=io(a.cornerRadius);o.fillStyle=a.backgroundColor,o.strokeStyle=a.borderColor,o.lineWidth=a.borderWidth,o.beginPath(),o.moveTo(l+f,c),i==="top"&&this.drawCaret(n,o,r,a),o.lineTo(l+d-m,c),o.quadraticCurveTo(l+d,c,l+d,c+m),i==="center"&&s==="right"&&this.drawCaret(n,o,r,a),o.lineTo(l+d,c+u-p),o.quadraticCurveTo(l+d,c+u,l+d-p,c+u),i==="bottom"&&this.drawCaret(n,o,r,a),o.lineTo(l+h,c+u),o.quadraticCurveTo(l,c+u,l,c+u-h),i==="center"&&s==="left"&&this.drawCaret(n,o,r,a),o.lineTo(l,c+f),o.quadraticCurveTo(l,c,l+f,c),o.closePath(),o.fill(),a.borderWidth>0&&o.stroke()}_updateAnimationTarget(n){const o=this.chart,r=this.$animations,a=r&&r.x,s=r&&r.y;if(a||s){const i=er[n.position].call(this,this._active,this._eventPosition);if(!i)return;const l=this._size=md(this,n),c=Object.assign({},i,this._size),d=hd(o,n,c),u=pd(n,c,d,o);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(n){const o=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(o);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const i=zt(o.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;o.enabled&&l&&(n.save(),n.globalAlpha=r,this.drawBackground(s,n,a,o),oc(n,o.textDirection),s.y+=i.top,this.drawTitle(s,n,o),this.drawBody(s,n,o),this.drawFooter(s,n,o),rc(n,o.textDirection),n.restore())}getActiveElements(){return this._active||[]}setActiveElements(n,o){const r=this._active,a=n.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),s=!_r(r,a),i=this._positionChanged(a,o);(s||i)&&(this._active=a,this._eventPosition=o,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(n,o,r=!0){if(o&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],i=this._getActiveElements(n,s,o,r),l=this._positionChanged(i,n),c=o||!_r(i,s)||l;return c&&(this._active=i,(a.enabled||a.external)&&(this._eventPosition={x:n.x,y:n.y},this.update(!0,o))),c}_getActiveElements(n,o,r,a){const s=this.options;if(n.type==="mouseout")return[];if(!a)return o.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);const i=this.chart.getElementsAtEventForMode(n,s.mode,s,r);return s.reverse&&i.reverse(),i}_positionChanged(n,o){const{caretX:r,caretY:a,options:s}=this,i=er[s.position].call(this,n,o);return i!==!1&&(r!==i.x||a!==i.y)}}we(Os,"positioners",er);var xy={id:"tooltip",_element:Os,positioners:er,afterInit(t,n,o){o&&(t.tooltip=new Os({chart:t,options:o}))},beforeUpdate(t,n,o){t.tooltip&&t.tooltip.initialize(o)},reset(t,n,o){t.tooltip&&t.tooltip.initialize(o)},afterDraw(t){const n=t.tooltip;if(n&&n._willRender()){const o={tooltip:n};if(t.notifyPlugins("beforeTooltipDraw",{...o,cancelable:!0})===!1)return;n.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",o)}},afterEvent(t,n){if(t.tooltip){const o=n.replay;t.tooltip.handleEvent(n.event,o,n.inChartArea)&&(n.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,n)=>n.bodyFont.size,boxWidth:(t,n)=>n.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:yd},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 ky=(t,n,o,r)=>(typeof n=="string"?(o=t.push(n)-1,r.unshift({index:o,label:n})):isNaN(n)&&(o=null),o);function wy(t,n,o,r){const a=t.indexOf(n);if(a===-1)return ky(t,n,o,r);const s=t.lastIndexOf(n);return a!==s?o:a}const Cy=(t,n)=>t===null?null:yt(Math.round(t),0,n);function xd(t){const n=this.getLabels();return t>=0&&t<n.length?n[t]:t}class vs extends mo{constructor(n){super(n),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(n){const o=this._addedLabels;if(o.length){const r=this.getLabels();for(const{index:a,label:s}of o)r[a]===s&&r.splice(a,1);this._addedLabels=[]}super.init(n)}parse(n,o){if(Ge(n))return null;const r=this.getLabels();return o=isFinite(o)&&r[o]===n?o:wy(r,n,Te(o,n),this._addedLabels),Cy(o,r.length-1)}determineDataLimits(){const{minDefined:n,maxDefined:o}=this.getUserBounds();let{min:r,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(n||(r=0),o||(a=this.getLabels().length-1)),this.min=r,this.max=a}buildTicks(){const n=this.min,o=this.max,r=this.options.offset,a=[];let s=this.getLabels();s=n===0&&o===s.length-1?s:s.slice(n,o+1),this._valueRange=Math.max(s.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let i=n;i<=o;i++)a.push({value:i});return a}getLabelForValue(n){return xd.call(this,n)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(n){return typeof n!="number"&&(n=this.parse(n)),n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getPixelForTick(n){const o=this.ticks;return n<0||n>o.length-1?null:this.getPixelForValue(o[n].value)}getValueForPixel(n){return Math.round(this._startValue+this.getDecimalForPixel(n)*this._valueRange)}getBasePixel(){return this.bottom}}we(vs,"id","category"),we(vs,"defaults",{ticks:{callback:xd}});function Ey(t,n){const o=[],{bounds:a,step:s,min:i,max:l,precision:c,count:d,maxTicks:u,maxDigits:f,includeBounds:m}=t,h=s||1,p=u-1,{min:k,max:x}=n,g=!Ge(i),S=!Ge(l),B=!Ge(d),E=(x-k)/(f+1);let _=Ml((x-k)/p/h)*h,w,y,b,C;if(_<1e-14&&!g&&!S)return[{value:k},{value:x}];C=Math.ceil(x/_)-Math.floor(k/_),C>p&&(_=Ml(C*_/p/h)*h),Ge(c)||(w=Math.pow(10,c),_=Math.ceil(_*w)/w),a==="ticks"?(y=Math.floor(k/_)*_,b=Math.ceil(x/_)*_):(y=k,b=x),g&&S&&s&&Sp((l-i)/s,_/1e3)?(C=Math.round(Math.min((l-i)/_,u)),_=(l-i)/C,y=i,b=l):B?(y=g?i:y,b=S?l:b,C=d-1,_=(b-y)/C):(C=(b-y)/_,Io(C,Math.round(C),_/1e3)?C=Math.round(C):C=Math.ceil(C));const V=Math.max(Tl(_),Tl(y));w=Math.pow(10,Ge(c)?V:c),y=Math.round(y*w)/w,b=Math.round(b*w)/w;let D=0;for(g&&(m&&y!==i?(o.push({value:i}),y<i&&D++,Io(Math.round((y+D*_)*w)/w,i,kd(i,E,t))&&D++):y<i&&D++);D<C;++D){const N=Math.round((y+D*_)*w)/w;if(S&&N>l)break;o.push({value:N})}return S&&m&&b!==l?o.length&&Io(o[o.length-1].value,l,kd(l,E,t))?o[o.length-1].value=l:o.push({value:l}):(!S||b===l)&&o.push({value:b}),o}function kd(t,n,{horizontal:o,minRotation:r}){const a=dn(r),s=(o?Math.sin(a):Math.cos(a))||.001,i=.75*n*(""+t).length;return Math.min(n/s,i)}class By extends mo{constructor(n){super(n),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(n,o){return Ge(n)||(typeof n=="number"||n instanceof Number)&&!isFinite(+n)?null:+n}handleTickRangeOptions(){const{beginAtZero:n}=this.options,{minDefined:o,maxDefined:r}=this.getUserBounds();let{min:a,max:s}=this;const i=c=>a=o?a:c,l=c=>s=r?s:c;if(n){const c=Yt(a),d=Yt(s);c<0&&d<0?l(0):c>0&&d>0&&i(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);l(s+c),n||i(a-c)}this.min=a,this.max=s}getTickLimit(){const n=this.options.ticks;let{maxTicksLimit:o,stepSize:r}=n,a;return r?(a=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),o=o||11),o&&(a=Math.min(o,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const n=this.options,o=n.ticks;let r=this.getTickLimit();r=Math.max(2,r);const a={maxTicks:r,bounds:n.bounds,min:n.min,max:n.max,precision:o.precision,step:o.stepSize,count:o.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:o.minRotation||0,includeBounds:o.includeBounds!==!1},s=this._range||this,i=Ey(a,s);return n.bounds==="ticks"&&Vp(i,this,"value"),n.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}configure(){const n=this.ticks;let o=this.min,r=this.max;if(super.configure(),this.options.offset&&n.length){const a=(r-o)/Math.max(n.length-1,1)/2;o-=a,r+=a}this._startValue=o,this._endValue=r,this._valueRange=r-o}getLabelForValue(n){return is(n,this.chart.options.locale,this.options.ticks.format)}}class Fs extends By{determineDataLimits(){const{min:n,max:o}=this.getMinMax(!0);this.min=bt(n)?n:0,this.max=bt(o)?o:1,this.handleTickRangeOptions()}computeTickLimit(){const n=this.isHorizontal(),o=n?this.width:this.height,r=dn(this.options.ticks.minRotation),a=(n?Math.sin(r):Math.cos(r))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(o/Math.min(40,s.lineHeight/a))}getPixelForValue(n){return n===null?NaN:this.getPixelForDecimal((n-this._startValue)/this._valueRange)}getValueForPixel(n){return this._startValue+this.getDecimalForPixel(n)*this._valueRange}}we(Fs,"id","linear"),we(Fs,"defaults",{ticks:{callback:Ul.formatters.numeric}});const Qr={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}},_t=Object.keys(Qr);function wd(t,n){return t-n}function Cd(t,n){if(Ge(n))return null;const o=t._adapter,{parser:r,round:a,isoWeekday:s}=t._parseOpts;let i=n;return typeof r=="function"&&(i=r(i)),bt(i)||(i=typeof r=="string"?o.parse(i,r):o.parse(i)),i===null?null:(a&&(i=a==="week"&&(Lo(s)||s===!0)?o.startOf(i,"isoWeek",s):o.startOf(i,a)),+i)}function Ed(t,n,o,r){const a=_t.length;for(let s=_t.indexOf(t);s<a-1;++s){const i=Qr[_t[s]],l=i.steps?i.steps:Number.MAX_SAFE_INTEGER;if(i.common&&Math.ceil((o-n)/(l*i.size))<=r)return _t[s]}return _t[a-1]}function _y(t,n,o,r,a){for(let s=_t.length-1;s>=_t.indexOf(o);s--){const i=_t[s];if(Qr[i].common&&t._adapter.diff(a,r,i)>=n-1)return i}return _t[o?_t.indexOf(o):0]}function Sy(t){for(let n=_t.indexOf(t)+1,o=_t.length;n<o;++n)if(Qr[_t[n]].common)return _t[n]}function Bd(t,n,o){if(!o)t[n]=!0;else if(o.length){const{lo:r,hi:a}=os(o,n),s=o[r]>=n?o[r]:o[a];t[s]=!0}}function Vy(t,n,o,r){const a=t._adapter,s=+a.startOf(n[0].value,r),i=n[n.length-1].value;let l,c;for(l=s;l<=i;l=+a.add(l,1,r))c=o[l],c>=0&&(n[c].major=!0);return n}function _d(t,n,o){const r=[],a={},s=n.length;let i,l;for(i=0;i<s;++i)l=n[i],a[l]=i,r.push({value:l,major:!1});return s===0||!o?r:Vy(t,r,a,o)}class Zr extends mo{constructor(n){super(n),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(n,o={}){const r=n.time||(n.time={}),a=this._adapter=new c0._date(n.adapters.date);a.init(o),zo(r.displayFormats,a.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(n),this._normalized=o.normalized}parse(n,o){return n===void 0?null:Cd(this,n)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const n=this.options,o=this._adapter,r=n.time.unit||"day";let{min:a,max:s,minDefined:i,maxDefined:l}=this.getUserBounds();function c(d){!i&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!l&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!i||!l)&&(c(this._getLabelBounds()),(n.bounds!=="ticks"||n.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=bt(a)&&!isNaN(a)?a:+o.startOf(Date.now(),r),s=bt(s)&&!isNaN(s)?s:+o.endOf(Date.now(),r)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const n=this.getLabelTimestamps();let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return n.length&&(o=n[0],r=n[n.length-1]),{min:o,max:r}}buildTicks(){const n=this.options,o=n.time,r=n.ticks,a=r.source==="labels"?this.getLabelTimestamps():this._generate();n.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,i=this.max,l=Tp(a,s,i);return this._unit=o.unit||(r.autoSkip?Ed(o.minUnit,this.min,this.max,this._getLabelCapacity(s)):_y(this,l.length,o.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:Sy(this._unit),this.initOffsets(a),n.reverse&&l.reverse(),_d(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(n=>+n.value))}initOffsets(n=[]){let o=0,r=0,a,s;this.options.offset&&n.length&&(a=this.getDecimalForValue(n[0]),n.length===1?o=1-a:o=(this.getDecimalForValue(n[1])-a)/2,s=this.getDecimalForValue(n[n.length-1]),n.length===1?r=s:r=(s-this.getDecimalForValue(n[n.length-2]))/2);const i=n.length<3?.5:.25;o=yt(o,0,i),r=yt(r,0,i),this._offsets={start:o,end:r,factor:1/(o+1+r)}}_generate(){const n=this._adapter,o=this.min,r=this.max,a=this.options,s=a.time,i=s.unit||Ed(s.minUnit,o,r,this._getLabelCapacity(o)),l=Te(a.ticks.stepSize,1),c=i==="week"?s.isoWeekday:!1,d=Lo(c)||c===!0,u={};let f=o,m,h;if(d&&(f=+n.startOf(f,"isoWeek",c)),f=+n.startOf(f,d?"day":i),n.diff(r,o,i)>1e5*l)throw new Error(o+" and "+r+" are too far apart with stepSize of "+l+" "+i);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(m=f,h=0;m<r;m=+n.add(m,l,i),h++)Bd(u,m,p);return(m===r||a.bounds==="ticks"||h===1)&&Bd(u,m,p),Object.keys(u).sort(wd).map(k=>+k)}getLabelForValue(n){const o=this._adapter,r=this.options.time;return r.tooltipFormat?o.format(n,r.tooltipFormat):o.format(n,r.displayFormats.datetime)}format(n,o){const a=this.options.time.displayFormats,s=this._unit,i=o||a[s];return this._adapter.format(n,i)}_tickFormatFunction(n,o,r,a){const s=this.options,i=s.ticks.callback;if(i)return nt(i,[n,o,r],this);const l=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&l[c],f=d&&l[d],m=r[o],h=d&&f&&m&&m.major;return this._adapter.format(n,a||(h?f:u))}generateTickLabels(n){let o,r,a;for(o=0,r=n.length;o<r;++o)a=n[o],a.label=this._tickFormatFunction(a.value,o,n)}getDecimalForValue(n){return n===null?NaN:(n-this.min)/(this.max-this.min)}getPixelForValue(n){const o=this._offsets,r=this.getDecimalForValue(n);return this.getPixelForDecimal((o.start+r)*o.factor)}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return this.min+r*(this.max-this.min)}_getLabelSize(n){const o=this.options.ticks,r=this.ctx.measureText(n).width,a=dn(this.isHorizontal()?o.maxRotation:o.minRotation),s=Math.cos(a),i=Math.sin(a),l=this._resolveTickFontOptions(0).size;return{w:r*s+l*i,h:r*i+l*s}}_getLabelCapacity(n){const o=this.options.time,r=o.displayFormats,a=r[o.unit]||r.millisecond,s=this._tickFormatFunction(n,0,_d(this,[n],this._majorUnit),a),i=this._getLabelSize(s),l=Math.floor(this.isHorizontal()?this.width/i.w:this.height/i.h)-1;return l>0?l:1}getDataTimestamps(){let n=this._cache.data||[],o,r;if(n.length)return n;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(o=0,r=a.length;o<r;++o)n=n.concat(a[o].controller.getAllParsedValues(this));return this._cache.data=this.normalize(n)}getLabelTimestamps(){const n=this._cache.labels||[];let o,r;if(n.length)return n;const a=this.getLabels();for(o=0,r=a.length;o<r;++o)n.push(Cd(this,a[o]));return this._cache.labels=this._normalized?n:this.normalize(n)}normalize(n){return Fl(n.sort(wd))}}we(Zr,"id","time"),we(Zr,"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 ea(t,n,o){let r=0,a=t.length-1,s,i,l,c;o?(n>=t[r].pos&&n<=t[a].pos&&({lo:r,hi:a}=Wn(t,"pos",n)),{pos:s,time:l}=t[r],{pos:i,time:c}=t[a]):(n>=t[r].time&&n<=t[a].time&&({lo:r,hi:a}=Wn(t,"time",n)),{time:s,pos:l}=t[r],{time:i,pos:c}=t[a]);const d=i-s;return d?l+(c-l)*(n-s)/d:l}class Sd extends Zr{constructor(n){super(n),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const n=this._getTimestampsForTable(),o=this._table=this.buildLookupTable(n);this._minPos=ea(o,this.min),this._tableRange=ea(o,this.max)-this._minPos,super.initOffsets(n)}buildLookupTable(n){const{min:o,max:r}=this,a=[],s=[];let i,l,c,d,u;for(i=0,l=n.length;i<l;++i)d=n[i],d>=o&&d<=r&&a.push(d);if(a.length<2)return[{time:o,pos:0},{time:r,pos:1}];for(i=0,l=a.length;i<l;++i)u=a[i+1],c=a[i-1],d=a[i],Math.round((u+c)/2)!==d&&s.push({time:d,pos:i/(l-1)});return s}_generate(){const n=this.min,o=this.max;let r=super.getDataTimestamps();return(!r.includes(n)||!r.length)&&r.splice(0,0,n),(!r.includes(o)||r.length===1)&&r.push(o),r.sort((a,s)=>a-s)}_getTimestampsForTable(){let n=this._cache.all||[];if(n.length)return n;const o=this.getDataTimestamps(),r=this.getLabelTimestamps();return o.length&&r.length?n=this.normalize(o.concat(r)):n=o.length?o:r,n=this._cache.all=n,n}getDecimalForValue(n){return(ea(this._table,n)-this._minPos)/this._tableRange}getValueForPixel(n){const o=this._offsets,r=this.getDecimalForPixel(n)/o.factor-o.end;return ea(this._table,r*this._tableRange+this._minPos,!0)}}we(Sd,"id","timeseries"),we(Sd,"defaults",Zr.defaults);const Ay={key:0,class:"mb-2 text-sm font-medium text-gray-700"},Dy={key:0,class:"text-red-500 ml-1"},Ny={key:0,class:"absolute inset-0 flex items-center justify-center bg-white"},My={key:1,class:"absolute inset-0 flex items-center justify-center bg-red-50 border border-red-200 rounded"},Ty={class:"text-red-600 text-sm"},Py={key:1,class:"mt-2 text-xs text-gray-500"},Oy={key:0},Vd=Dt(e.defineComponent({name:"DCodeChart",__name:"DCodeChart",props:{type:{default:"line"},width:{default:400},height:{default:300},required:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},error:{default:null},showInfo:{type:Boolean,default:!1},responsive:{type:Boolean,default:!0},maintainAspectRatio:{type:Boolean,default:!1},theme:{default:"light"},colors:{default:()=>["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#6366F1","#84CC16"]},data:{},modelValue:{},options:{},onClick:{},onHover:{},label:{}},emits:["update:modelValue","click","hover","ready"],setup(t,{expose:n,emit:o}){hn.register(vs,Fs,Xr,Dn,Kr,Zo,uy,xy,cy,oy,Rr,zr,ws,fo);const r=t,a=o,s=e.ref(null),i=e.shallowRef(null),l=e.ref(null),c=e.computed(()=>({"opacity-50 pointer-events-none":r.loading||r.error})),d=()=>{const m=r.theme==="dark";return{responsive:r.responsive,maintainAspectRatio:r.maintainAspectRatio,animation:{duration:1e3,easing:"easeInOutQuart",delay:h=>{let p=0;return h.type==="data"&&h.mode==="default"&&(p=h.dataIndex*100+h.datasetIndex*50),p},onComplete:()=>{}},plugins:{legend:{position:"top",labels:{color:m?"#E5E7EB":"#374151",font:{size:12}}},tooltip:{backgroundColor:m?"#1F2937":"#FFFFFF",titleColor:m?"#F3F4F6":"#111827",bodyColor:m?"#D1D5DB":"#4B5563",borderColor:m?"#374151":"#E5E7EB",borderWidth:1,animation:{duration:200,easing:"easeInOutQuad"}}},scales:r.type!=="pie"&&r.type!=="doughnut"&&r.type!=="polarArea"?{x:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}},y:{grid:{color:m?"#374151":"#E5E7EB"},ticks:{color:m?"#D1D5DB":"#6B7280"}}}:void 0}},u=m=>!m||!m.datasets?m:{...m,datasets:m.datasets.map((h,p)=>{const k=p%r.colors.length,x=r.colors[k];let g=h.backgroundColor,S=h.borderColor;return["pie","doughnut","polarArea"].includes(r.type)&&(!g||g.length===0)?h.data&&(g=h.data.map((B,E)=>r.colors[E%r.colors.length]+"80"),S=h.data.map((B,E)=>r.colors[E%r.colors.length])):(g=g||x+"40",S=S||x),{...h,borderColor:S,backgroundColor:g,pointBackgroundColor:h.pointBackgroundColor||x,pointBorderColor:h.pointBorderColor||x,hoverBackgroundColor:h.hoverBackgroundColor||x+"60",hoverBorderColor:h.hoverBorderColor||x}})},f=async()=>{if(!s.value)return;await e.nextTick(),i.value&&i.value.destroy();const m=r.data||r.modelValue;let h=m;if(Array.isArray(m))if(m.length>0&&typeof m[0]=="object"&&m[0]!==null){const k=Object.keys(m[0]),x=k.find(S=>["label","name","x","category","title"].includes(S.toLowerCase()))||k[0],g=k.find(S=>S!==x&&["value","y","count","amount","total","data"].includes(S.toLowerCase()))||k.find(S=>S!==x&&typeof m[0][S]=="number")||(k.length>1?k.find(S=>S!==x):k[0]);h={labels:m.map(S=>S[x||""]),datasets:[{label:r.label||"Data",data:m.map(S=>S[g||""])}]}}else m.length>0?h={labels:m.map((k,x)=>`Data ${x+1}`),datasets:[{label:r.label||"Data",data:m}]}:h={labels:[],datasets:[]};if(l.value=u(h),!l.value)return;const p={...d(),...r.options,onClick:(k,x)=>{a("click",k,x),r.onClick&&r.onClick(k,x)},onHover:(k,x)=>{a("hover",k,x),r.onHover&&r.onHover(k,x)}};i.value=new hn(s.value,{type:r.type,data:l.value,options:p}),a("ready",i.value)};return e.watch(()=>[r.data,r.modelValue,r.type,r.options,r.theme],()=>{f()},{deep:!0}),e.watch(()=>[r.width,r.height],()=>{i.value&&i.value.resize()}),e.onMounted(()=>{f()}),e.onUnmounted(()=>{i.value&&i.value.destroy()}),n({chart:i,updateChart:f}),(m,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["d-code-chart",c.value])},[t.label?(e.openBlock(),e.createElementBlock("div",Ay,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Dy,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"relative",style:e.normalizeStyle({height:t.height+"px"})},[e.createElementVNode("canvas",{ref_key:"chartCanvas",ref:s},null,512),t.loading?(e.openBlock(),e.createElementBlock("div",Ny,[...h[0]||(h[0]=[e.createElementVNode("div",{class:"animate-pulse-slow rounded-full h-8 w-8 border-b-2 border-blue-600"},null,-1)])])):e.createCommentVNode("",!0),t.error?(e.openBlock(),e.createElementBlock("div",My,[e.createElementVNode("div",Ty,e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0)],4),t.showInfo&&l.value?(e.openBlock(),e.createElementBlock("div",Py,[l.value.datasets?(e.openBlock(),e.createElementBlock("div",Oy,e.toDisplayString(l.value.datasets.length)+" dataset(s) • "+e.toDisplayString(l.value.labels?l.value.labels.length:0)+" data points ",1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1c7c58f"]]),tr=e.defineComponent({__name:"Label",props:{for:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.Label),e.mergeProps(e.unref(o),{class:e.unref(ve)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),vy={class:"grid gap-1.5"},Fy={key:0,class:"ml-1 text-destructive"},zy=["aria-busy"],Ry={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-2"},Iy={key:1,class:"flex items-center"},Ly=["id","checked","indeterminate","disabled","required"],gn=Dt(e.defineComponent({name:"DCodeCheckbox",inheritAttrs:!1,__name:"DCodeCheckbox",props:{id:{default:""},label:{default:""},title:{default:""},required:{type:Boolean,default:!1},modelValue:{type:[Boolean,null]},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>a.visible??!0),i=e.computed(()=>a.required),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-checkbox-${a.id||a.label||"checkbox"}-${l}`),d=e.ref(!!a.modelValue);e.watch(()=>a.modelValue,m=>{d.value=!!m},{immediate:!0});const u=()=>{if(a.disabled)return;const m=!d.value;d.value=m,r("update:modelValue",m)},f=m=>{(m.key===" "||m.key==="Enter")&&(m.preventDefault(),u())};return(m,h)=>(e.openBlock(),e.createElementBlock("div",vy,[t.label?(e.openBlock(),e.createBlock(tr,{key:0,class:"text-sm font-medium mb-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Fy,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass([e.unref(o).class,{"opacity-60 cursor-not-allowed":t.disabled}]),"aria-busy":t.skeleton},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Ry)):e.createCommentVNode("",!0),h[0]||(h[0]=e.createElementVNode("div",{class:"flex items-center gap-2.5"},[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1))],64)):(e.openBlock(),e.createElementBlock("div",Iy,[e.createElementVNode("label",{class:e.normalizeClass(["flex items-center gap-2.5 group relative",{"cursor-pointer":!t.disabled,"opacity-50 cursor-not-allowed":t.disabled}])},[e.createElementVNode("input",{type:"checkbox",id:c.value,class:"sr-only peer",checked:d.value,indeterminate:t.indeterminate,disabled:t.disabled,required:i.value,onChange:u,onKeydown:f},null,40,Ly),e.createElementVNode("div",{class:e.normalizeClass(["h-4 w-4 shrink-0 rounded-sm border shadow-sm transition-all focus:outline-none peer-focus-visible:ring-2 peer-focus-visible:ring-neutral-400 dark:peer-focus-visible:ring-neutral-600 peer-focus-visible:ring-offset-2 flex items-center justify-center",[d.value||t.indeterminate?"bg-primary border-primary text-primary-foreground":"border-neutral-300 dark:border-neutral-600 bg-white dark:bg-neutral-800",t.disabled?"cursor-not-allowed":"cursor-pointer"]]),"aria-hidden":"true"},[d.value&&!t.indeterminate?(e.openBlock(),e.createBlock(e.unref(le.Check),{key:0,class:"h-3 w-3 text-white","stroke-width":"3"})):t.indeterminate?(e.openBlock(),e.createBlock(e.unref(le.Minus),{key:1,class:"h-3 w-3 text-white","stroke-width":"3"})):e.createCommentVNode("",!0)],2),t.title?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["text-sm leading-relaxed select-none transition-colors",[t.disabled?"text-gray-400 dark:text-gray-500":"text-gray-700 dark:text-gray-300 group-hover:text-gray-900 dark:group-hover:text-gray-100"]])},e.toDisplayString(t.title),3)):e.createCommentVNode("",!0)],2)]))],10,zy),[[e.vShow,s.value]])]))}}),[["__scopeId","data-v-c233d0a6"]]),$y={class:"w-full"},jy={key:0,class:"mb-4"},Uy={key:0,class:"h-6 w-48 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Wy={key:1,class:"text-sm font-medium text-gray-900 dark:text-gray-100"},Hy={key:0,class:"ml-1 text-destructive"},qy={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-4"},Gy={key:1,class:"flex flex-wrap gap-4"},Xy={key:0,class:"text-center py-8 text-gray-500 dark:text-gray-400"},Ky={key:1,class:"flex flex-wrap gap-x-6 gap-y-4"},Yy={key:3,class:"flex items-center gap-1 text-sm text-red-500 mt-4"},zs=Dt(e.defineComponent({name:"DCodeCardCheckboxList",inheritAttrs:!1,__name:"DCodeCardCheckboxList",props:{modelValue:{default:()=>[]},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},items:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},apiModule:{},apiAction:{},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""},columns:{default:2},apiParams:{default:()=>({})},returnArray:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ct(),r=n,a=t,s=e.ref(new Set);e.watch(()=>a.modelValue,_=>{if(!_){s.value=new Set;return}const w=_.map(y=>typeof y=="object"&&y!==null?y.id!==void 0?y.id:y.value:y);s.value=new Set(w)},{immediate:!0,deep:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var w,y;const _=((w=a.endpoint)==null?void 0:w.apiUrl)||a.apiUrl;if(!(!_&&!a.apiModule&&!a.apiAction)){l.value=!0,c.value=null;try{let b;const C=((y=a.endpoint)==null?void 0:y.apiMethod)||a.apiMethod||"GET",V={page:1,perPage:100,...a.apiParams};if(_)b=await o(_,C,V);else if(a.apiModule&&a.apiAction){const{DCodeApi:N}=ct();b=await N(a.apiModule,a.apiAction,V)}let D=b;a.dataPath?D=a.dataPath.split(".").reduce((P,M)=>P&&P[M]!==void 0?P[M]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(D=b.data),Array.isArray(D)?i.value=D:(console.warn("DCodeCardCheckboxList: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(b){console.error("DCodeCardCheckboxList fetch error:",b),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const m=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl||a.apiModule&&a.apiAction)&&d(),m(),typeof document<"u"&&(f=new MutationObserver(m),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const h=e.computed(()=>a.options&&a.options.length>0?a.options:a.items&&a.items.length>0?a.items:i.value),p=_=>{if(typeof _!="object"||_===null)return _;const w=a.itemValue||a.model||"id";return _[w]},k=_=>{if(typeof _!="object"||_===null)return String(_);const w=a.itemTitle||"name";return _[w]},x=_=>s.value.has(_),g=(_,w)=>{if(a.disabled)return;const y=new Set(s.value);w?y.add(_):y.delete(_),s.value=y;const b=Array.from(s.value);r("update:modelValue",b),r("change",b)},S=e.computed(()=>a.skeleton||l.value),B=e.computed(()=>!!a.error||!!c.value),E=e.computed(()=>a.error||c.value);return(_,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",$y,[t.label||S.value?(e.openBlock(),e.createElementBlock("div",jy,[S.value?(e.openBlock(),e.createElementBlock("div",Uy)):(e.openBlock(),e.createElementBlock("h3",Wy,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",Hy,"*")):e.createCommentVNode("",!0)]))])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[l.value?(e.openBlock(),e.createElementBlock("div",qy,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),w[0]||(w[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("div",Gy,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,y=>e.createElementVNode("div",{key:`skeleton-${y}`,class:"flex items-center gap-2.5 min-w-[120px]"},[...w[1]||(w[1]=[e.createElementVNode("div",{class:"h-4 w-4 rounded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"},null,-1),e.createElementVNode("div",{class:"h-4 w-24 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])),64))])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[h.value.length===0?(e.openBlock(),e.createElementBlock("div",Xy," Tidak ada data ")):(e.openBlock(),e.createElementBlock("div",Ky,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(y,b)=>(e.openBlock(),e.createElementBlock("div",{key:b,class:"flex items-start"},[e.createVNode(gn,{"model-value":x(p(y)),title:k(y),disabled:t.disabled,"onUpdate:modelValue":C=>g(p(y),C)},null,8,["model-value","title","disabled","onUpdate:modelValue"])]))),128))]))],64)),B.value&&E.value?(e.openBlock(),e.createElementBlock("div",Yy,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(E.value),1)])):e.createCommentVNode("",!0)])],512)),[[e.vShow,t.visible]])}}),[["__scopeId","data-v-8f934d59"]]),Jy=["aria-busy"],Qy={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},Zy={key:1,class:"flex justify-end"},ex=["for"],tx={key:0,class:"ml-1 text-destructive"},nx={class:"relative w-full group"},ox={class:"flex items-center self-stretch px-3 bg-gray-50 dark:bg-neutral-800 border-r border-gray-300 dark:border-gray-700"},rx={class:"text-sm font-semibold text-gray-500 dark:text-gray-400 whitespace-nowrap select-none"},ax=["id","disabled","readonly","placeholder","maxlength"],sx={key:0,class:"absolute top-full right-0 z-10 text-[11px] text-gray-400 dark:text-gray-500 opacity-0 transition-opacity pointer-events-none group-focus-within:opacity-100 mt-0.5"},ix={key:1,class:"flex items-center gap-1 text-xs text-destructive"},Rs=e.defineComponent({name:"DCodeCurrencyField",inheritAttrs:!1,__name:"DCodeCurrencyField",props:{modelValue:{},currency:{default:"IDR"},locale:{},label:{},placeholder:{},error:{},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},prependInner:{},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`app-currency-field-${o.id||a.label||"currency-field"}-${s}`),l=e.computed(()=>{const D=o.required,N=o["aria-required"];return D===""||D===!0||D==="true"||(N==="true"||N===!0)}),c=e.computed(()=>{const D=o.maxlength??o.maxLength;let N=Number.NaN;return typeof D=="number"?N=D:typeof D=="string"&&(N=Number.parseInt(D,10)),Number.isFinite(N)&&N>0?N:void 0}),d=e.computed(()=>a.locale?a.locale:"en-US"),u=e.computed(()=>a.prependInner?a.prependInner:a.currency==="USD"?"$":a.currency==="IDR"?"Rp":a.currency),f=e.computed(()=>new Intl.NumberFormat(d.value,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:0})),m=D=>{const N=D.replaceAll(/\D/g,"");return N?Number(N):null},h=D=>f.value.format(D),p=e.ref(""),k=e.ref(null);e.watch(()=>a.modelValue,D=>{D==null?p.value="":m(p.value)!==D&&(p.value=h(D))},{immediate:!0});const x=(D,N)=>{let P=0;for(let M=0;M<N;M++)/\d/.test(D[M])&&P++;return P},g=(D,N)=>{let P=0;for(let M=0;M<D.length;M++)if(/\d/.test(D[M])&&(P++,P===N))return M+1;return D.length},S=D=>{const N=D.target,P=N.value,M=N.selectionStart??P.length,X=m(P);if(X===null){p.value="",r("update:modelValue",null);return}const $=h(X);if(P!==$){const H=x(P,M);p.value=$,e.nextTick(()=>{if(k.value){const J=g($,H);k.value.setSelectionRange(J,J)}})}r("update:modelValue",X)},B=()=>{p.value="",r("update:modelValue",null),r("clear")},E=e.computed(()=>!a.clearable||a.disabled||a.readonly?!1:a.hideClearWhenEmpty?p.value.length>0:!0),_=e.computed(()=>!!a.error),w=e.computed(()=>{const{class:D,maxlength:N,maxLength:P,...M}=o;return M}),y=e.computed(()=>p.value.length),b=e.computed(()=>a.showCharCount?(c.value??0)>0:!1),C=e.computed(()=>b.value&&y.value>0),V=e.computed(()=>`${y.value} / ${c.value}`);return(D,N)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1.5 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Qy)):e.createCommentVNode("",!0),N[2]||(N[2]=e.createElementVNode("div",{class:"relative w-full"},[e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"})],-1)),b.value?(e.openBlock(),e.createElementBlock("div",Zy,[...N[1]||(N[1]=[e.createElementVNode("div",{class:"h-3 w-14 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1)])])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium text-gray-700 dark:text-gray-300"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",tx,"*")):e.createCommentVNode("",!0)],8,ex)):e.createCommentVNode("",!0),e.createElementVNode("div",nx,[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full rounded-lg border overflow-hidden transition-all duration-200","bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50",_.value?"border-destructive ring-1 ring-destructive":"border-gray-300 dark:border-gray-700 focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 dark:focus-within:border-blue-400",a.disabled?"opacity-50 cursor-not-allowed bg-gray-50 dark:bg-neutral-800":""])},[e.createElementVNode("div",ox,[e.createElementVNode("span",rx,e.toDisplayString(u.value),1)]),e.withDirectives(e.createElementVNode("input",e.mergeProps({id:i.value,ref_key:"inputRef",ref:k,"onUpdate:modelValue":N[0]||(N[0]=P=>p.value=P),onInput:S,type:"text",inputmode:"numeric"},w.value,{disabled:a.disabled,readonly:a.readonly,placeholder:a.placeholder,maxlength:c.value,class:["flex-1 h-10 px-3 py-2 text-sm bg-transparent text-foreground dark:text-gray-300 outline-none placeholder:text-gray-400",E.value?"pr-8":""]}),null,16,ax),[[e.vModelText,p.value]]),E.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center w-8 h-10 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 transition-colors flex-shrink-0","aria-label":"Clear input",onClick:B},[e.createVNode(e.unref(le.X),{class:"w-3.5 h-3.5"})])):e.createCommentVNode("",!0)],2),C.value&&!_.value?(e.openBlock(),e.createElementBlock("p",sx,e.toDisplayString(V.value),1)):e.createCommentVNode("",!0)]),_.value?(e.openBlock(),e.createElementBlock("p",ix,[e.createVNode(e.unref(le.AlertCircle),{class:"w-3.5 h-3.5 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(a.error),1)])):e.createCommentVNode("",!0)],64))],10,Jy))}}),Ad=6048e5,lx=864e5,Dd=Symbol.for("constructDateFrom");function Mn(t,n){return typeof t=="function"?t(n):t&&typeof t=="object"&&Dd in t?t[Dd](n):t instanceof Date?new t.constructor(n):new Date(n)}function qt(t,n){return Mn(n||t,t)}let cx={};function ta(){return cx}function nr(t,n){var l,c,d,u;const o=ta(),r=(n==null?void 0:n.weekStartsOn)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??o.weekStartsOn??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=qt(t,n==null?void 0:n.in),s=a.getDay(),i=(s<r?7:0)+s-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function na(t,n){return nr(t,{...n,weekStartsOn:1})}function Nd(t,n){const o=qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=Mn(o,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const s=na(a),i=Mn(o,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const l=na(i);return o.getTime()>=s.getTime()?r+1:o.getTime()>=l.getTime()?r:r-1}function Md(t){const n=qt(t),o=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return o.setUTCFullYear(n.getFullYear()),+t-+o}function dx(t,...n){const o=Mn.bind(null,n.find(r=>typeof r=="object"));return n.map(o)}function Td(t,n){const o=qt(t,n==null?void 0:n.in);return o.setHours(0,0,0,0),o}function ux(t,n,o){const[r,a]=dx(o==null?void 0:o.in,t,n),s=Td(r),i=Td(a),l=+s-Md(s),c=+i-Md(i);return Math.round((l-c)/lx)}function fx(t,n){const o=Nd(t,n),r=Mn(t,0);return r.setFullYear(o,0,4),r.setHours(0,0,0,0),na(r)}function mx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function hx(t){return!(!mx(t)&&typeof t!="number"||isNaN(+qt(t)))}function px(t,n){const o=qt(t,n==null?void 0:n.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}const gx={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"}},bx=(t,n,o)=>{let r;const a=gx[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r};function po(t){return(n={})=>{const o=n.width?String(n.width):t.defaultWidth;return t.formats[o]||t.formats[t.defaultWidth]}}const yx={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xx={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kx={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},wx={date:po({formats:yx,defaultWidth:"full"}),time:po({formats:xx,defaultWidth:"full"}),dateTime:po({formats:kx,defaultWidth:"full"})},Cx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Ex=(t,n,o,r)=>Cx[t];function Zt(t){return(n,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let a;if(r==="formatting"&&t.formattingValues){const i=t.defaultFormattingWidth||t.defaultWidth,l=o!=null&&o.width?String(o.width):i;a=t.formattingValues[l]||t.formattingValues[i]}else{const i=t.defaultWidth,l=o!=null&&o.width?String(o.width):t.defaultWidth;a=t.values[l]||t.values[i]}const s=t.argumentCallback?t.argumentCallback(n):n;return a[s]}}const Bx={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},_x={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sx={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"]},Vx={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"]},Ax={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"}},Dx={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"}},Nx={ordinalNumber:(t,n)=>{const o=Number(t),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},era:Zt({values:Bx,defaultWidth:"wide"}),quarter:Zt({values:_x,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Zt({values:Sx,defaultWidth:"wide"}),day:Zt({values:Vx,defaultWidth:"wide"}),dayPeriod:Zt({values:Ax,defaultWidth:"wide",formattingValues:Dx,defaultFormattingWidth:"wide"})};function en(t){return(n,o={})=>{const r=o.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=n.match(a);if(!s)return null;const i=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Tx(l,f=>f.test(i)):Mx(l,f=>f.test(i));let d;d=t.valueCallback?t.valueCallback(c):c,d=o.valueCallback?o.valueCallback(d):d;const u=n.slice(i.length);return{value:d,rest:u}}}function Mx(t,n){for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&n(t[o]))return o}function Tx(t,n){for(let o=0;o<t.length;o++)if(n(t[o]))return o}function Pd(t){return(n,o={})=>{const r=n.match(t.matchPattern);if(!r)return null;const a=r[0],s=n.match(t.parsePattern);if(!s)return null;let i=t.valueCallback?t.valueCallback(s[0]):s[0];i=o.valueCallback?o.valueCallback(i):i;const l=n.slice(a.length);return{value:i,rest:l}}}const Px=/^(\d+)(th|st|nd|rd)?/i,Ox=/\d+/i,vx={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},Fx={any:[/^b/i,/^(a|c)/i]},zx={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Rx={any:[/1/i,/2/i,/3/i,/4/i]},Ix={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},Lx={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]},$x={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},jx={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]},Ux={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},Wx={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}},Hx={ordinalNumber:Pd({matchPattern:Px,parsePattern:Ox,valueCallback:t=>parseInt(t,10)}),era:en({matchPatterns:vx,defaultMatchWidth:"wide",parsePatterns:Fx,defaultParseWidth:"any"}),quarter:en({matchPatterns:zx,defaultMatchWidth:"wide",parsePatterns:Rx,defaultParseWidth:"any",valueCallback:t=>t+1}),month:en({matchPatterns:Ix,defaultMatchWidth:"wide",parsePatterns:Lx,defaultParseWidth:"any"}),day:en({matchPatterns:$x,defaultMatchWidth:"wide",parsePatterns:jx,defaultParseWidth:"any"}),dayPeriod:en({matchPatterns:Ux,defaultMatchWidth:"any",parsePatterns:Wx,defaultParseWidth:"any"})},Od={code:"en-US",formatDistance:bx,formatLong:wx,formatRelative:Ex,localize:Nx,match:Hx,options:{weekStartsOn:0,firstWeekContainsDate:1}};function qx(t,n){const o=qt(t,n==null?void 0:n.in);return ux(o,px(o))+1}function Gx(t,n){const o=qt(t,n==null?void 0:n.in),r=+na(o)-+fx(o);return Math.round(r/Ad)+1}function vd(t,n){var u,f,m,h;const o=qt(t,n==null?void 0:n.in),r=o.getFullYear(),a=ta(),s=(n==null?void 0:n.firstWeekContainsDate)??((f=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((h=(m=a.locale)==null?void 0:m.options)==null?void 0:h.firstWeekContainsDate)??1,i=Mn((n==null?void 0:n.in)||t,0);i.setFullYear(r+1,0,s),i.setHours(0,0,0,0);const l=nr(i,n),c=Mn((n==null?void 0:n.in)||t,0);c.setFullYear(r,0,s),c.setHours(0,0,0,0);const d=nr(c,n);return+o>=+l?r+1:+o>=+d?r:r-1}function Xx(t,n){var l,c,d,u;const o=ta(),r=(n==null?void 0:n.firstWeekContainsDate)??((c=(l=n==null?void 0:n.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=vd(t,n),s=Mn((n==null?void 0:n.in)||t,0);return s.setFullYear(a,0,r),s.setHours(0,0,0,0),nr(s,n)}function Kx(t,n){const o=qt(t,n==null?void 0:n.in),r=+nr(o,n)-+Xx(o,n);return Math.round(r/Ad)+1}function Qe(t,n){const o=t<0?"-":"",r=Math.abs(t).toString().padStart(n,"0");return o+r}const Tn={y(t,n){const o=t.getFullYear(),r=o>0?o:1-o;return Qe(n==="yy"?r%100:r,n.length)},M(t,n){const o=t.getMonth();return n==="M"?String(o+1):Qe(o+1,2)},d(t,n){return Qe(t.getDate(),n.length)},a(t,n){const o=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,n){return Qe(t.getHours()%12||12,n.length)},H(t,n){return Qe(t.getHours(),n.length)},m(t,n){return Qe(t.getMinutes(),n.length)},s(t,n){return Qe(t.getSeconds(),n.length)},S(t,n){const o=n.length,r=t.getMilliseconds(),a=Math.trunc(r*Math.pow(10,o-3));return Qe(a,n.length)}},go={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Fd={G:function(t,n,o){const r=t.getFullYear()>0?1:0;switch(n){case"G":case"GG":case"GGG":return o.era(r,{width:"abbreviated"});case"GGGGG":return o.era(r,{width:"narrow"});case"GGGG":default:return o.era(r,{width:"wide"})}},y:function(t,n,o){if(n==="yo"){const r=t.getFullYear(),a=r>0?r:1-r;return o.ordinalNumber(a,{unit:"year"})}return Tn.y(t,n)},Y:function(t,n,o,r){const a=vd(t,r),s=a>0?a:1-a;if(n==="YY"){const i=s%100;return Qe(i,2)}return n==="Yo"?o.ordinalNumber(s,{unit:"year"}):Qe(s,n.length)},R:function(t,n){const o=Nd(t);return Qe(o,n.length)},u:function(t,n){const o=t.getFullYear();return Qe(o,n.length)},Q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"Q":return String(r);case"QQ":return Qe(r,2);case"Qo":return o.ordinalNumber(r,{unit:"quarter"});case"QQQ":return o.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,n,o){const r=Math.ceil((t.getMonth()+1)/3);switch(n){case"q":return String(r);case"qq":return Qe(r,2);case"qo":return o.ordinalNumber(r,{unit:"quarter"});case"qqq":return o.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,n,o){const r=t.getMonth();switch(n){case"M":case"MM":return Tn.M(t,n);case"Mo":return o.ordinalNumber(r+1,{unit:"month"});case"MMM":return o.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(r,{width:"wide",context:"formatting"})}},L:function(t,n,o){const r=t.getMonth();switch(n){case"L":return String(r+1);case"LL":return Qe(r+1,2);case"Lo":return o.ordinalNumber(r+1,{unit:"month"});case"LLL":return o.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(r,{width:"wide",context:"standalone"})}},w:function(t,n,o,r){const a=Kx(t,r);return n==="wo"?o.ordinalNumber(a,{unit:"week"}):Qe(a,n.length)},I:function(t,n,o){const r=Gx(t);return n==="Io"?o.ordinalNumber(r,{unit:"week"}):Qe(r,n.length)},d:function(t,n,o){return n==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):Tn.d(t,n)},D:function(t,n,o){const r=qx(t);return n==="Do"?o.ordinalNumber(r,{unit:"dayOfYear"}):Qe(r,n.length)},E:function(t,n,o){const r=t.getDay();switch(n){case"E":case"EE":case"EEE":return o.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(r,{width:"short",context:"formatting"});case"EEEE":default:return o.day(r,{width:"wide",context:"formatting"})}},e:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"e":return String(s);case"ee":return Qe(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(a,{width:"short",context:"formatting"});case"eeee":default:return o.day(a,{width:"wide",context:"formatting"})}},c:function(t,n,o,r){const a=t.getDay(),s=(a-r.weekStartsOn+8)%7||7;switch(n){case"c":return String(s);case"cc":return Qe(s,n.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(a,{width:"narrow",context:"standalone"});case"cccccc":return o.day(a,{width:"short",context:"standalone"});case"cccc":default:return o.day(a,{width:"wide",context:"standalone"})}},i:function(t,n,o){const r=t.getDay(),a=r===0?7:r;switch(n){case"i":return String(a);case"ii":return Qe(a,n.length);case"io":return o.ordinalNumber(a,{unit:"day"});case"iii":return o.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(r,{width:"short",context:"formatting"});case"iiii":default:return o.day(r,{width:"wide",context:"formatting"})}},a:function(t,n,o){const a=t.getHours()/12>=1?"pm":"am";switch(n){case"a":case"aa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,n,o){const r=t.getHours();let a;switch(r===12?a=go.noon:r===0?a=go.midnight:a=r/12>=1?"pm":"am",n){case"b":case"bb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,n,o){const r=t.getHours();let a;switch(r>=17?a=go.evening:r>=12?a=go.afternoon:r>=4?a=go.morning:a=go.night,n){case"B":case"BB":case"BBB":return o.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,n,o){if(n==="ho"){let r=t.getHours()%12;return r===0&&(r=12),o.ordinalNumber(r,{unit:"hour"})}return Tn.h(t,n)},H:function(t,n,o){return n==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):Tn.H(t,n)},K:function(t,n,o){const r=t.getHours()%12;return n==="Ko"?o.ordinalNumber(r,{unit:"hour"}):Qe(r,n.length)},k:function(t,n,o){let r=t.getHours();return r===0&&(r=24),n==="ko"?o.ordinalNumber(r,{unit:"hour"}):Qe(r,n.length)},m:function(t,n,o){return n==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):Tn.m(t,n)},s:function(t,n,o){return n==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):Tn.s(t,n)},S:function(t,n){return Tn.S(t,n)},X:function(t,n,o){const r=t.getTimezoneOffset();if(r===0)return"Z";switch(n){case"X":return Rd(r);case"XXXX":case"XX":return Zn(r);case"XXXXX":case"XXX":default:return Zn(r,":")}},x:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"x":return Rd(r);case"xxxx":case"xx":return Zn(r);case"xxxxx":case"xxx":default:return Zn(r,":")}},O:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"O":case"OO":case"OOO":return"GMT"+zd(r,":");case"OOOO":default:return"GMT"+Zn(r,":")}},z:function(t,n,o){const r=t.getTimezoneOffset();switch(n){case"z":case"zz":case"zzz":return"GMT"+zd(r,":");case"zzzz":default:return"GMT"+Zn(r,":")}},t:function(t,n,o){const r=Math.trunc(+t/1e3);return Qe(r,n.length)},T:function(t,n,o){return Qe(+t,n.length)}};function zd(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),s=r%60;return s===0?o+String(a):o+String(a)+n+Qe(s,2)}function Rd(t,n){return t%60===0?(t>0?"-":"+")+Qe(Math.abs(t)/60,2):Zn(t,n)}function Zn(t,n=""){const o=t>0?"-":"+",r=Math.abs(t),a=Qe(Math.trunc(r/60),2),s=Qe(r%60,2);return o+a+n+s}const Id=(t,n)=>{switch(t){case"P":return n.date({width:"short"});case"PP":return n.date({width:"medium"});case"PPP":return n.date({width:"long"});case"PPPP":default:return n.date({width:"full"})}},Ld=(t,n)=>{switch(t){case"p":return n.time({width:"short"});case"pp":return n.time({width:"medium"});case"ppp":return n.time({width:"long"});case"pppp":default:return n.time({width:"full"})}},Yx={p:Ld,P:(t,n)=>{const o=t.match(/(P+)(p+)?/)||[],r=o[1],a=o[2];if(!a)return Id(t,n);let s;switch(r){case"P":s=n.dateTime({width:"short"});break;case"PP":s=n.dateTime({width:"medium"});break;case"PPP":s=n.dateTime({width:"long"});break;case"PPPP":default:s=n.dateTime({width:"full"});break}return s.replace("{{date}}",Id(r,n)).replace("{{time}}",Ld(a,n))}},Jx=/^D+$/,Qx=/^Y+$/,Zx=["D","DD","YY","YYYY"];function ek(t){return Jx.test(t)}function tk(t){return Qx.test(t)}function nk(t,n,o){const r=ok(t,n,o);if(console.warn(r),Zx.includes(t))throw new RangeError(r)}function ok(t,n,o){const r=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${n}\`) for formatting ${r} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const rk=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ak=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sk=/^'([^]*?)'?$/,ik=/''/g,lk=/[a-zA-Z]/;function $d(t,n,o){var u,f,m,h;const r=ta(),a=r.locale??Od,s=r.firstWeekContainsDate??((f=(u=r.locale)==null?void 0:u.options)==null?void 0:f.firstWeekContainsDate)??1,i=r.weekStartsOn??((h=(m=r.locale)==null?void 0:m.options)==null?void 0:h.weekStartsOn)??0,l=qt(t,o==null?void 0:o.in);if(!hx(l))throw new RangeError("Invalid time value");let c=n.match(ak).map(p=>{const k=p[0];if(k==="p"||k==="P"){const x=Yx[k];return x(p,a.formatLong)}return p}).join("").match(rk).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const k=p[0];if(k==="'")return{isToken:!1,value:ck(p)};if(Fd[k])return{isToken:!0,value:p};if(k.match(lk))throw new RangeError("Format string contains an unescaped latin alphabet character `"+k+"`");return{isToken:!1,value:p}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:s,weekStartsOn:i,locale:a};return c.map(p=>{if(!p.isToken)return p.value;const k=p.value;(tk(k)||ek(k))&&nk(k,n,String(t));const x=Fd[k[0]];return x(l,k,a.localize,d)}).join("")}function ck(t){const n=t.match(sk);return n?n[1].replace(ik,"'"):t}const dk={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"}},uk=(t,n,o)=>{let r;const a=dk[t];return typeof a=="string"?r=a:n===1?r=a.one:r=a.other.replace("{{count}}",n.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"dalam waktu "+r:r+" yang lalu":r},fk={full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},mk={full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},hk={full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pk={date:po({formats:fk,defaultWidth:"full"}),time:po({formats:mk,defaultWidth:"full"}),dateTime:po({formats:hk,defaultWidth:"full"})},gk={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},bk=(t,n,o,r)=>gk[t],yk={narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},xk={narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},kk={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"]},wk={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"]},Ck={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"}},Ek={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"}},Bk={ordinalNumber:(t,n)=>"ke-"+Number(t),era:Zt({values:yk,defaultWidth:"wide"}),quarter:Zt({values:xk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Zt({values:kk,defaultWidth:"wide"}),day:Zt({values:wk,defaultWidth:"wide"}),dayPeriod:Zt({values:Ck,defaultWidth:"wide",formattingValues:Ek,defaultFormattingWidth:"wide"})},_k=/^ke-(\d+)?/i,Sk=/\d+/i,Vk={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},Ak={any:[/^s/i,/^(m|e)/i]},Dk={narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},Nk={any:[/1/i,/2/i,/3/i,/4/i]},Mk={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},Tk={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]},Pk={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},Ok={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]},vk={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},Fk={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}},zk={ordinalNumber:Pd({matchPattern:_k,parsePattern:Sk,valueCallback:t=>parseInt(t,10)}),era:en({matchPatterns:Vk,defaultMatchWidth:"wide",parsePatterns:Ak,defaultParseWidth:"any"}),quarter:en({matchPatterns:Dk,defaultMatchWidth:"wide",parsePatterns:Nk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:en({matchPatterns:Mk,defaultMatchWidth:"wide",parsePatterns:Tk,defaultParseWidth:"any"}),day:en({matchPatterns:Pk,defaultMatchWidth:"wide",parsePatterns:Ok,defaultParseWidth:"any"}),dayPeriod:en({matchPatterns:vk,defaultMatchWidth:"any",parsePatterns:Fk,defaultParseWidth:"any"})},Rk={code:"id",formatDistance:uk,formatLong:pk,formatRelative:bk,localize:Bk,match:zk,options:{weekStartsOn:1,firstWeekContainsDate:1}},jd={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)"}}},Ud="dcode-dp-theme-forced";function Ik(t,n=Ud){const o=jd[t]??jd.primary,r=`
|
|
19
19
|
.dp__theme_light {
|
|
20
20
|
--dp-primary-color: ${o.light.primary} !important;
|
|
21
21
|
--dp-primary-text-color: ${o.light.text} !important;
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
.dcode-datepicker-menu .dp__menu_inner {
|
|
64
64
|
padding: 0 !important;
|
|
65
65
|
}
|
|
66
|
-
`.trim();let a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Rk(t,n=Wd){e.watch(t,o=>Ik(o,n),{immediate:!0})}const Lk={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},$k=["for"],jk={key:0,class:"ml-1 text-destructive"},Uk=["disabled","onClick"],Wk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},Hk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],qk={class:"h-full p-2 flex flex-col gap-3 w-32"},Gk=["onClick"],Xk={class:"flex items-center justify-end gap-2 w-full p-2"},Kk=["disabled","onClick"],Yk={key:1,class:"text-xs text-destructive"},oa=e.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const P=o.required,v=o["aria-required"];return P===""||P===!0||P==="true"||v==="true"||v===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:P=>{a("update:modelValue",P),a("change",P)}}),u=e.computed(()=>r.locale==="en"?Od:zk),f=e.computed(()=>r.range?2:!1),h=e.computed(()=>{if(!r.range)return!1;const P={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(P.maxRange=r.autoRangeDays,P.autoRange=r.autoRangeDays),P}),m=P=>{const v=new Date(P);return v.setHours(0,0,0,0),v},g=P=>{const v=new Date(P);return v.setHours(23,59,59,999),v},k=(P,v)=>{const Q=new Date(P);return Q.setDate(Q.getDate()+v),Q},y=e.computed(()=>{if(r.disablePast)return m(new Date)}),p=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return g(k(new Date,r.maxDaysAhead))}),E=e.ref(null),_=e.ref(null),B=P=>{_.value={month:P.month,year:P.year}},S=e.ref(!1);let w=null;e.onMounted(()=>{const P=document.documentElement,v=()=>S.value=P.classList.contains("dark");v(),w=new MutationObserver(v),w.observe(P,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{w==null||w.disconnect(),w=null}),Rk(e.toRef(r,"tone"));const x=P=>{const v=new Date(P),Q=v.getDay(),j=v.getDate()-Q+(Q===0?-6:1);return v.setDate(j),m(v)},b=P=>{const v=x(P);return v.setDate(v.getDate()+6),g(v)},A=P=>{const v=new Date(P);return v.setDate(1),m(v)},V=P=>{const v=new Date(P);return v.setMonth(v.getMonth()+1),v.setDate(0),g(v)},D=e.computed(()=>{if(!r.range)return[];const P=new Date,v=m(P),Q=x(P),j=b(P),G=A(P),Y=V(P),H=(T,U)=>{let te=T;r.disablePast&&te<v&&(te=v);let Z=U;if(r.autoRangeDays&&r.autoRangeDays>0){const K=g(k(te,r.autoRangeDays-1));Z>K&&(Z=K)}return Z<te&&(Z=g(new Date(te))),[te,Z]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:H(Q,j)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:H(G,Y)}]}),N=async P=>{var U,te;const v=r.modelType||"yyyy-MM-dd";if(P.length===0){d.value=null;return}if(P.length<2)return;const Q=jd(P[0],v),j=jd(P[1],v);d.value=[Q,j],await e.nextTick();const G=P[0],Y=G.getMonth(),H=G.getFullYear();_.value&&_.value.month===Y&&_.value.year===H||(U=E.value)==null||U.setMonthYear({month:Y,year:H}),(te=E.value)==null||te.openMenu()};return(P,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",Lk)):e.createCommentVNode("",!0),v[2]||(v[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",jk,"*")):e.createCommentVNode("",!0)],8,$k)):e.createCommentVNode("",!0),e.createVNode(e.unref(yu.VueDatePicker),{ref_key:"dpRef",ref:E,modelValue:d.value,"onUpdate:modelValue":v[1]||(v[1]=Q=>d.value=Q),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":y.value,"max-date":p.value,"preset-ranges":D.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:B},e.createSlots({"dp-input":e.withCtx(({value:Q,onInput:j,onEnter:G,onTab:Y,onBlur:H,onFocus:T,onKeypress:U,onPaste:te,toggleMenu:Z})=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",t.disabled?"opacity-50 cursor-not-allowed":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.disabled,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none",onClick:K=>Z()},[e.createVNode(e.unref(ce.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Uk),v[4]||(v[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Wk,e.toDisplayString(t.prependInner),1),v[3]||(v[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:Q,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",t.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:K=>Z(),onFocus:K=>T(),onBlur:K=>H(),onInput:K=>j(K),onKeydown:[e.withKeys(K=>G(K),["enter"]),e.withKeys(K=>Y(K),["tab"])],onKeypress:K=>U(K),onPaste:K=>te()},null,42,Hk)],2)]),"action-buttons":e.withCtx(({selectDate:Q,selectionDisabled:j})=>[e.createElementVNode("div",Xk,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:v[0]||(v[0]=G=>{var Y;return(Y=E.value)==null?void 0:Y.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:j,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:G=>Q()},e.toDisplayString(t.selectLabel),9,Kk)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",qk,[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(D.value,Q=>(e.openBlock(),e.createElementBlock("button",{key:Q.label,type:"button",class:"w-full inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:j=>N(Q.range)},e.toDisplayString(Q.label),9,Gk))),128)):e.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",Yk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),Jk=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Se.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Qk=e.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.createVNode(e.unref(Se.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Re)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(Se.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),Zk=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(Re)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),ew=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(Re)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),tw={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},nw={class:"flex items-center gap-3"},ow={class:"flex flex-col"},rw={key:0,class:"flex items-center gap-2"},aw={key:1,class:"px-6 py-4 border-t border-neutral-200/60 dark:border-neutral-700/50 bg-neutral-50/50 dark:bg-neutral-900/30 sticky bottom-0 z-20"},sw={class:"flex justify-end gap-3 flex-wrap"},Fn=Ot(e.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?Gt[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(Jk),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(Qk),e.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",tw,[e.createElementVNode("div",nw,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",ow,[e.createVNode(e.unref(ew),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(Zk),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",rw,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",aw,[e.createElementVNode("div",sw,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),ko=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&Gt[o.icon]||null),a=e.computed(()=>o.textSize?`text-${o.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},i=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),iw={class:"flex flex-col gap-3 w-full"},lw={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-dashed border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70 pointer-events-none animate-pulse"},cw={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-neutral-700/50 bg-slate-50 dark:bg-neutral-900/30 text-slate-400"},dw={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},uw={class:"text-sm font-medium text-slate-500"},fw={class:"flex items-center justify-between gap-2"},hw=["onClick"],mw={key:0,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},pw={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},gw=["onClick"],bw=["for","onDrop"],yw={class:"text-xs text-slate-500 dark:text-slate-400"},xw={key:2,class:"text-xs text-slate-400"},kw=["id","disabled","accept","onChange"],ww={class:"flex flex-col items-center justify-center min-h-[300px]"},Cw=["src","alt"],Ew=["src"],Bw={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},_w={class:"text-sm font-medium"},Sw=["href"],Rs=e.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0}},emits:["update:modelValue","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=$t.useI18n(),i=e.computed(()=>{const w=o.endpoint;if(!(w!=null&&w.apiUrl))return null;let x=w.apiUrl;if(!x.startsWith("http")&&o.baseUrl){const b=o.baseUrl.replace(/\/$/,""),A=x.startsWith("/")?x:`/${x}`;x=`${b}${A}`}return x}),l=e.computed(()=>{const w=c.value.length;return w<=1?"grid-cols-1":w===2?"grid-cols-1 md:grid-cols-2":w===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":w===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),f=e.ref(!0),h=e.ref(!1),m=e.ref(""),g=e.ref(""),k=e.ref(""),y=async()=>{var w;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((w=o.endpointReference)!=null&&w.apiUrl)){f.value=!1;return}try{const{apiUrl:x}=ft(),b=await x(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let A=(b==null?void 0:b.data)||b;Array.isArray(A)||(A=[A]),c.value=A}catch(x){console.error("Failed to fetch dynamic document list",x)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),y()}),e.onBeforeUnmount(()=>{d.value.forEach(w=>{w._localPreviewUrl&&URL.revokeObjectURL(w._localPreviewUrl)})}),e.watch(()=>o.modelValue,w=>{if(Array.isArray(w)&&JSON.stringify(w)!==JSON.stringify(d.value)){const x=JSON.parse(JSON.stringify(w));x.forEach(b=>{const A=d.value.find(V=>V.typeDocument===b.typeDocument||V.idDocumentType===b.idDocumentType);A!=null&&A._localPreviewUrl&&(b._localPreviewUrl=A._localPreviewUrl)}),d.value=x}},{deep:!0}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiUrl},(w,x)=>{w!==x&&y()}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiMethod},(w,x)=>{w!==x&&y()}),e.watch(()=>o.items,w=>{c.value=w??[],f.value=!1},{deep:!0,immediate:!0});const p=w=>{const x=w[o.itemValue]||w.id||w.typeDocument;return d.value.find(b=>b.typeDocument===x||b.idDocumentType===x||b[o.itemValue]===x)||null},E=async(w,x,b)=>{var P,v,Q,j;const A=b.target,V=(P=A.files)==null?void 0:P[0];if(!V)return;const D=w[o.itemValue]||w.id||w.typeDocument,N=URL.createObjectURL(V);if(!i.value){const G=[...d.value],Y=G.findIndex(T=>T.typeDocument===D||T.idDocumentType===D);(v=G[Y])!=null&&v._localPreviewUrl&&URL.revokeObjectURL(G[Y]._localPreviewUrl);const H={id:null,idDocument:null,idDocumentType:D,filename:V.name,document:D,documentUrl:V.name,typeDocument:D,_localPreviewUrl:N,_fileType:V.type};Y>-1?G[Y]={...G[Y],...H}:G.push(H),d.value=G,r("update:modelValue",G);return}u.value.add(x);try{const{apiUrl:G}=ft(),Y=new FormData;Y.append("doc",V),Y.append("typeDocument",String(D));const H=await G(i.value,((Q=o.endpoint)==null?void 0:Q.apiMethod)||"POST",Y),T=Array.isArray(H==null?void 0:H.data)?H.data[0]:(H==null?void 0:H.data)||H,U=(T==null?void 0:T.url)||(T==null?void 0:T.document)||V.name,te=(T==null?void 0:T.id)||null,Z=(T==null?void 0:T.filename)||(T==null?void 0:T.name)||V.name,K=[...d.value],ae=K.findIndex(ke=>ke.typeDocument===D||ke.idDocumentType===D);(j=K[ae])!=null&&j._localPreviewUrl&&URL.revokeObjectURL(K[ae]._localPreviewUrl);const ue={...T,id:te||(T==null?void 0:T.idDocument)||(T==null?void 0:T.id_document)||null,idDocument:(T==null?void 0:T.idDocument)||te||(T==null?void 0:T.id_document)||null,idDocumentType:D,filename:Z,document:D,documentUrl:U,typeDocument:D,_localPreviewUrl:N,_fileType:V.type};ae>-1?K[ae]={...K[ae],...ue}:K.push(ue),d.value=K,r("update:modelValue",K),r("uploaded",T),r("success",T)}catch(G){console.error("Upload failed",G)}finally{u.value.delete(x),A.value=""}},_=w=>{const x=w[o.itemValue]||w.id||w.typeDocument,b=d.value.find(V=>V.typeDocument===x||V.idDocumentType===x);b!=null&&b._localPreviewUrl&&URL.revokeObjectURL(b._localPreviewUrl);const A=d.value.filter(V=>V.typeDocument!==x&&V.idDocumentType!==x);d.value=A,r("update:modelValue",A)},B=w=>{const x=p(w);if(!x)return;let b=x._localPreviewUrl;if(!b)if(x.server&&x.url){const D=x.server.replace(/\/+$/,""),N=x.url.replace(/^\/+/,"");b=`${D}/${N}`}else b=x.document||x.url;if(!b)return;const A=x.mime||x._fileType||"",V=A==="application/pdf"||b.toLowerCase().endsWith(".pdf");V&&!b.includes("#")&&(b+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),m.value=b,g.value=w[o.itemTitle]||w.name||x.filename||"Preview Document",k.value=A||(V?"application/pdf":"image/jpeg"),h.value=!0},S=(w,x,b)=>{var D,N;b.preventDefault();const A=(N=(D=b.dataTransfer)==null?void 0:D.files)==null?void 0:N[0];if(!A)return;E(w,x,{target:{files:[A],value:""}})};return(w,x)=>(e.openBlock(),e.createElementBlock("div",iw,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(ko,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(e.openBlock(),e.createElementBlock("div",lw,[e.createVNode(ko,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",cw,[e.createVNode(e.unref(ce.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",dw,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",uw,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,A)=>{var V;return e.openBlock(),e.createElementBlock("div",{key:A,class:"flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg shadow-sm"},[e.createElementVNode("div",fw,[e.createVNode(ko,{text:b[t.itemTitle]||b.name||b.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),p(b)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"p-1 hover:bg-slate-100 dark:hover:bg-zinc-700 rounded transition-colors text-slate-400 hover:text-primary-500",onClick:D=>B(b)},[e.createVNode(e.unref(ce.Eye),{class:"w-4 h-4"})],8,hw)):e.createCommentVNode("",!0)]),p(b)?(e.openBlock(),e.createElementBlock("div",mw,[e.createVNode(e.unref(ce.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",pw,e.toDisplayString(((V=p(b))==null?void 0:V.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:D=>_(b)},[e.createVNode(e.unref(ce.X),{class:"w-4 h-4"})],8,gw))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${A}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",u.value.has(A)?"pointer-events-none opacity-70":""]]),onDragover:x[0]||(x[0]=e.withModifiers(()=>{},["prevent"])),onDrop:D=>!t.disabled&&!u.value.has(A)&&S(b,A,D)},[u.value.has(A)?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(ce.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",yw,e.toDisplayString(u.value.has(A)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",xw,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${A}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(A),accept:t.typeFile,onChange:D=>E(b,A,D)},null,40,kw)],42,bw))])}),128))],2),e.createVNode(Fn,{modelValue:h.value,"onUpdate:modelValue":x[2]||(x[2]=b=>h.value=b),title:g.value,"max-width":k.value==="application/pdf"?"720":"500",class:e.normalizeClass(k.value==="application/pdf"?"max-w-[40vw]":""),"content-class":k.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:x[1]||(x[1]=b=>h.value=!1)},e.toDisplayString(e.unref(a)("common.close")||"Close"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",ww,[k.value.startsWith("image/")?(e.openBlock(),e.createElementBlock("img",{key:0,src:m.value,alt:g.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,Cw)):k.value==="application/pdf"?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${m.value}${m.value.includes("#")?"":"#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"}`,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,Ew)):(e.openBlock(),e.createElementBlock("div",Bw,[e.createVNode(e.unref(ce.FileText),{class:"w-16 h-16 stroke-1"}),e.createElementVNode("span",_w,e.toDisplayString(e.unref(a)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),e.createElementVNode("a",{href:m.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},e.toDisplayString(e.unref(a)("dynamicUploadList.viewOriginal")||"View Original"),9,Sw)]))])]),_:1},8,["modelValue","title","max-width","class","content-class"])]))}}),Hd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>Gt[n.icon]??Gt.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Jt),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),Aw=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Re)(e.unref(Dw)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Vw=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Re)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Dw=wr("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ls=e.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Re)(e.unref(Nw)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Nw=wr("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),$s=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Re)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),js=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Re)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Us=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(Re)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ws=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(Re)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Mw={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},vw={class:"flex flex-wrap items-center justify-center gap-2"},Pw=["accept","multiple"],ra=Ot(e.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null}},emits:["picked","picked:multiple","error"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var x;o.disabled||(x=a.value)==null||x.click()}function f(x){const b=x/1024,A=b/1024;return A>=1?`${A.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${x} B`}function h(x){var A;if(!x)return"File tidak valid";if((A=o.accept)!=null&&A.includes("image/")&&!x.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return x.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function m(x){l.value=x.name,c.value=x.size}function g(x){if(i.value=null,!x.length)return;if(o.mode==="single"){const A=x[0],V=h(A);if(V){i.value=V,r("error",V);return}o.showSelected&&m(A),r("picked",A);return}const b=[];for(const A of x){const V=h(A);if(V){i.value=V,r("error",V);return}b.push(A)}b.length&&(o.showSelected&&m(b[0]),r("picked:multiple",b))}function k(x){const b=x.target,A=Array.from(b.files??[]);g(A),b.value=""}function y(){o.disabled||(s.value=!0)}function p(){o.disabled||(s.value=!0)}function E(){s.value=!1}function _(x){var V,D;if(o.disabled)return;s.value=!1;const b=Array.from(((V=x.dataTransfer)==null?void 0:V.files)??[]),A=(D=o.accept)!=null&&D.includes("image/")?b.filter(N=>N.type.startsWith("image/")):b;g(A)}const B=e.computed(()=>(o.accept||"file/*").split(",").map(x=>x.trim()).filter(Boolean).map(x=>x==="image/*"?"IMAGE":x.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const S=e.ref(!1),w=e.computed(()=>{if(o.disabled||!S.value)return{};const x=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:x?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:x?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(x,b)=>(e.openBlock(),e.createBlock(e.unref($s),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(Us),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ws),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(js),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},w.value]),onClick:u,onDragenter:e.withModifiers(y,["prevent"]),onDragover:e.withModifiers(p,["prevent"]),onDragleave:e.withModifiers(E,["prevent"]),onDrop:e.withModifiers(_,["prevent"]),onMouseenter:b[0]||(b[0]=A=>S.value=!0),onMouseleave:b[1]||(b[1]=A=>S.value=!1)},[e.createElementVNode("div",Mw,[b[2]||(b[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",vw,[e.createVNode(e.unref(Ls),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(B.value),1)]),_:1}),e.createVNode(e.unref(Ls),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(e.unref(Ls),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?f(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:k},null,40,Pw)],38),d.value?(e.openBlock(),e.createBlock(e.unref(Aw),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Vw),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-d8943808"]]),Tw={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Ow=["src"],Fw={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground dark:text-neutral-400 gap-2 p-4 text-center"},zw={class:"space-y-0.5"},Iw={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Rw={class:"text-xs opacity-70"},Lw=["disabled"],$w={key:1},jw=["disabled"],Uw={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Ww={class:"flex gap-2"},Hw={class:"font-medium truncate"},qw={class:"flex gap-2"},Gw={class:"font-medium"},Xw={class:"flex gap-2"},Kw={class:"font-medium truncate"},Hs=Ot(e.defineComponent({name:"DCodeFileResult",__name:"DCodeFileResult",props:{file:{},title:{default:"File Terpilih"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(m){const g=m/1024,k=g/1024;return k>=1?`${k.toFixed(2)} MB`:g>=1?`${g.toFixed(1)} KB`:`${m} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{f(),typeof document<"u"&&(u=new MutationObserver(f),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const h=e.computed(()=>o.disabled||!c.value?{}:{borderColor:d.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:d.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,g)=>t.file?(e.openBlock(),e.createBlock($s,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Us,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ws,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",Tw,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(js,{class:"pt-2"},{default:e.withCtx(()=>{var k,y,p,E,_;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},h.value]),onMouseenter:g[2]||(g[2]=B=>c.value=!0),onMouseleave:g[3]||(g[3]=B=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Ow)):(e.openBlock(),e.createElementBlock("div",Fw,[e.createVNode(e.unref(ce.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",zw,[e.createElementVNode("p",Iw,e.toDisplayString((k=l.value)==null?void 0:k.name),1),e.createElementVNode("p",Rw,e.toDisplayString((y=l.value)==null?void 0:y.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[0]||(g[0]=B=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,Lw)):(e.openBlock(),e.createElementBlock("div",$w)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:g[1]||(g[1]=B=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,jw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:c.value?1:0,transform:c.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:d.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:d.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",Uw,[e.createElementVNode("div",Ww,[g[4]||(g[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",Hw,e.toDisplayString((p=l.value)==null?void 0:p.name),1)]),e.createElementVNode("div",qw,[g[5]||(g[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Gw,e.toDisplayString((E=l.value)==null?void 0:E.size),1)]),e.createElementVNode("div",Xw,[g[6]||(g[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Kw,e.toDisplayString((_=l.value)==null?void 0:_.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function qs(){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 Yw={class:"space-y-3"},Jw={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},qd=e.defineComponent({name:"DCodeFileField",inheritAttrs:!1,__name:"DCodeFileField",props:{modelValue:{default:null},label:{default:"Upload File"},hint:{},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:void 0},allowedTypes:{default:null},accept:{default:"*/*"},minSizeMb:{default:null},maxSizeMb:{default:1},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:w=>r("update:modelValue",w)}),s=e.ref(null),i=e.ref(null);function l(w){i.value=w,r("error",w)}function c(){i.value=null}const d=e.computed(()=>{const w=(o.allowedTypes??"").trim();return w?w.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(w){const x=w.lastIndexOf(".");return x>=0?w.slice(x).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const w=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...w].join(",")}return o.accept}),h=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function m(w){if(d.value.length){const x=(w.type||"").toLowerCase(),b=u(w.name);return d.value.some(A=>A.includes("/")?x===A:A.startsWith(".")?b===A:b===`.${A}`)}if(o.accept){if(o.accept==="*/*")return!0;const x=o.accept.split(",").map(V=>V.trim().toLowerCase()),b=(w.type||"").toLowerCase(),A=u(w.name);return x.some(V=>{if(V.endsWith("/*")){const D=V.slice(0,-2);return b.startsWith(D)}return V.startsWith(".")?A===V:b===V})}return!0}function g(w){return w*1024*1024}async function k(w){return w?m(w)?o.minSizeMb!=null&&w.size<g(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&w.size>g(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${h.value}`:"File tidak valid"}const{DCodeApi:y}=ft(),p=qs(),E=e.ref(!1);async function _(w){var x;if(o.uploadFn){try{E.value=!0;const b=await o.uploadFn(w);a.value=w,r("uploaded",b)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{E.value=!1}return}if(!((x=o.endpoint)!=null&&x.apiUrl)){a.value=w;return}if(typeof y!="function"){l("useApi() must expose DCodeApi()");return}try{E.value=!0;const b=new FormData;b.append("doc",w);const A=(o.endpoint.apiMethod||"POST").toUpperCase(),V=o.endpoint.apiUrl,D=await y("","",b,{_url:V,_method:A,withCredentials:!0,transformRequest:[(P,v)=>(v&&(delete v["Content-Type"],delete v["content-type"]),P)]}),N=(D==null?void 0:D.data)??D;a.value=w,r("uploaded",N)}catch(b){console.error("Upload Error",b),p.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{E.value=!1}}async function B(w){var b;if(o.disabled)return;c();const x=await k(w);if(x){l(x);return}s.value=w,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await _(w):a.value=w}function S(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,w=>{w&&!s.value&&(s.value=w),w||(s.value=null)},{immediate:!0}),(w,x)=>(e.openBlock(),e.createElementBlock("div",Yw,[a.value?E.value?(e.openBlock(),e.createElementBlock("div",Jw,[...x[1]||(x[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(Hs,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:S},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||E.value,onPicked:B,error:i.value,onError:x[0]||(x[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Qw=["for"],Zw={key:0,class:"!ml-1 !text-destructive"},e1={class:"relative w-full block box-border"},t1={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},n1=["id","readonly","disabled","placeholder"],o1={class:"absolute inset-y-0 right-4 flex items-center z-10"},r1={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-800 border-neutral-200/60 dark:border-neutral-700/50 shadow-lg box-border"},a1={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},s1={key:1,class:"text-sm text-muted-foreground text-center"},i1=["onClick","title"],l1={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},c1={class:"flex items-center justify-center flex-1"},d1={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},u1={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},Gd=e.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=t,r=n,a=Gt,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),f=e.ref(""),h=e.ref(!1),m=e.ref(!1),g=e.ref(!1),k=e.shallowRef([]),y=e.ref(o.pageSize),p=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),E=async()=>{if(m.value||g.value)return;g.value=!0,await new Promise(U=>setTimeout(U,0));const T=Object.keys(a).filter(U=>!p.has(U)).filter(U=>/^[A-Z]/.test(U)).filter(U=>typeof a[U]=="function"||typeof a[U]=="object"&&a[U]).sort((U,te)=>U.localeCompare(te));k.value=T,m.value=!0,g.value=!1},_=e.computed(()=>!m.value||!u.value||!k.value.includes(u.value)?null:a[u.value]),B=e.ref(u.value),S=e.computed(()=>!!u.value&&!d.value),w=e.computed(()=>{if(!m.value)return[];const T=(f.value??"").trim().toLowerCase();return T?k.value.filter(U=>U.toLowerCase().includes(T)):k.value}),x=e.computed(()=>w.value.slice(0,y.value)),b=e.computed(()=>{const T=o.columns;return T<=2?"grid-cols-2":T===3?"grid-cols-3":T===4?"grid-cols-4":T===5?"grid-cols-5":T>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>_.value&&!d.value?"!pl-12":"!pl-3");const A=async()=>{var T;await e.nextTick(),(T=i.value)==null||T.focus()},V=async T=>{if(o.disabled)return;const U=T!==!1;if(h.value){h.value=!1;return}d.value=!0,await E(),U&&(f.value="",B.value=""),y.value=o.pageSize,await A()},D=()=>{d.value=!1,f.value="",B.value=u.value,y.value=o.pageSize},N=async()=>{o.disabled||(d.value?D():await V())};let P=null;const v=async T=>{if(o.disabled)return;r("update:modelValue",null),d.value||await V(!1),P&&clearTimeout(P);const U=B.value;P=setTimeout(()=>{f.value=U},300)},Q=T=>{o.disabled||(r("update:modelValue",T),D(),queueMicrotask(()=>{var U;return(U=i.value)==null?void 0:U.blur()}))},j=()=>{o.disabled||(r("update:modelValue",null),r("clear"),h.value=!0,D(),queueMicrotask(()=>{var T;return(T=i.value)==null?void 0:T.focus()}))},G=T=>{if(T.key==="Escape"){T.preventDefault(),D();return}if(T.key==="Enter"&&d.value){const U=w.value[0];U&&(T.preventDefault(),Q(U))}},Y=T=>{if(!d.value)return;const U=T.target;s.value&&!s.value.contains(U)&&D()},H=T=>{const U=T.target;U.scrollTop+U.clientHeight>=U.scrollHeight-24&&y.value<w.value.length&&(y.value=Math.min(y.value+o.pageSize,w.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",Y),queueMicrotask(()=>{var T;i.value=((T=s.value)==null?void 0:T.querySelector("input"))??null}),u.value&&E()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",Y),P&&clearTimeout(P)}),e.watch(u,T=>{d.value||(B.value=T)}),e.watch(()=>f.value,()=>{y.value=o.pageSize}),(T,U)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",Zw,"*")):e.createCommentVNode("",!0)],8,Qw)):e.createCommentVNode("",!0),e.createElementVNode("div",e1,[_.value&&!d.value?(e.openBlock(),e.createElementBlock("div",t1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":U[0]||(U[0]=te=>B.value=te),readonly:S.value,disabled:o.disabled,placeholder:o.placeholder,class:e.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 pr-10 outline-none box-border truncate",[_.value&&!d.value?"pl-10":"pl-4",S.value?"cursor-pointer select-none":""]]),onClick:V,onFocus:V,onInput:v,onKeydown:G},null,42,n1),[[e.vModelText,B.value]]),e.createElementVNode("div",o1,[o.clearable&&u.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:U[1]||(U[1]=e.withModifiers(()=>{},["prevent"])),onClick:j,title:"Clear"},[e.createVNode(e.unref(ce.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:U[2]||(U[2]=e.withModifiers(()=>{},["prevent"])),onClick:N,title:"Open"},[e.createVNode(e.unref(ce.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",r1,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:H},[g.value?(e.openBlock(),e.createElementBlock("div",a1,[e.createVNode(e.unref(ce.Loader2),{class:"h-4 w-4 animate-spin"}),U[3]||(U[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):m.value&&w.value.length===0?(e.openBlock(),e.createElementBlock("div",s1," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",b.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,te=>(e.openBlock(),e.createElementBlock("button",{key:te,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===te?"ring-1 ring-primary":""]),onClick:Z=>Q(te),title:te},[e.createElementVNode("div",l1,[e.createElementVNode("div",c1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[te]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",d1,e.toDisplayString(te),1)])],10,i1))),128))],2)),m.value&&w.value.length>0?(e.openBlock(),e.createElementBlock("div",u1," Showing "+e.toDisplayString(x.value.length)+" / "+e.toDisplayString(w.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),f1={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},h1={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},m1={class:"relative overflow-auto p-0"},Gs=e.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:_=>r("update:modelValue",_)}),s=e.ref(null),i=e.ref(null);let l=null,c=!1,d=0,u=null;function f(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function h(_,B,S,w,x){const b=await new Promise((D,N)=>{const P=URL.createObjectURL(_),v=new Image;v.onload=()=>{URL.revokeObjectURL(P),D(v)},v.onerror=Q=>{URL.revokeObjectURL(P),N(Q)},v.src=P}),A=document.createElement("canvas");A.width=B,A.height=S;const V=A.getContext("2d");return V?(V.drawImage(b,0,0,B,S),await new Promise(D=>{A.toBlob(N=>D(N||_),w,x)})):_}function m(){if(!l||!i.value)return;const _=l.getPlugin("Dashboard"),B=l.getFile(i.value);!_||!B||requestAnimationFrame(()=>{try{_.openFileEditor(B)}catch{try{_.openFileEditor(i.value)}catch{}}})}async function g(_){if(l){l.cancelAll(),i.value=null;try{const B=l.addFile({name:_.name,type:_.type,data:_,source:"Local",isRemote:!1});i.value=String(B)}catch{}}}function k(){if(!s.value)return;l&&f(),l=new xu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const _=document.documentElement.classList.contains("dark");l.use(mi,{target:s.value,inline:!0,height:480,theme:_?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const B=document.documentElement.classList.contains("dark"),S=l.getPlugin("Dashboard");S&&S.setOptions({theme:B?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(ku,{target:mi,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.value=!1}),l.on("file-added",B=>{i.value=(B==null?void 0:B.id)??null,o.autoOpenEditor&&setTimeout(()=>m(),80)}),l.on("file-editor:complete",async B=>{const S=++d;try{const w=B.data,x=w.type||B.type||"image/jpeg";let b=w;if(o.outputWidth&&o.outputHeight&&(b=await h(w,o.outputWidth,o.outputHeight,x,o.quality)),c||S!==d)return;const A=B.name||"edited-image.jpg",V=new File([b],A,{type:x});await y(V,"UPPY_EDITOR_COMPLETE"),r("done",V),a.value=!1}catch{}})}async function y(_,B="CROP_RESULT"){const S=URL.createObjectURL(_);try{const w=await new Promise((x,b)=>{const A=new Image;A.onload=()=>x(A),A.onerror=b,A.src=S});console.group(B),console.log("file:",_),console.table({name:_.name,type:_.type,sizeBytes:_.size,sizeMB:+(_.size/1024/1024).toFixed(3),width:w.naturalWidth,height:w.naturalHeight,ratio:+(w.naturalWidth/w.naturalHeight).toFixed(4)}),console.log("previewUrl:",S),console.groupEnd()}finally{URL.revokeObjectURL(S)}}e.watch(a,async _=>{c=!_,d++,_?(await e.nextTick(),k(),o.file&&await g(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async _=>{a.value&&_&&(await e.nextTick(),await g(_))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const p=_=>{_.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,_=>{_?globalThis.addEventListener("keydown",p):globalThis.removeEventListener("keydown",p)},{immediate:!0});const E=e.ref(!1);return(_,B)=>a.value?(e.openBlock(),e.createElementBlock("div",f1,[e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:B[0]||(B[0]=S=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-700/50 bg-background dark:bg-neutral-800 shadow-2xl transition-all",onClick:B[4]||(B[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",h1,[B[6]||(B[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:e.normalizeStyle({opacity:E.value?1:.7}),onClick:B[1]||(B[1]=S=>a.value=!1),onMouseenter:B[2]||(B[2]=S=>E.value=!0),onMouseleave:B[3]||(B[3]=S=>E.value=!1)},[e.createVNode(e.unref(ce.X),{class:"h-4 w-4"}),B[5]||(B[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",m1,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),p1={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},g1=["src"],b1=["disabled"],y1=["disabled"],x1={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},k1={class:"flex gap-2"},w1={class:"font-medium truncate"},C1={class:"flex gap-2"},E1={class:"font-medium"},B1={class:"flex gap-2"},_1={class:"font-medium truncate"},Xs=Ot(e.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(h){const m=h/1024,g=m/1024;return g>=1?`${g.toFixed(2)} MB`:m>=1?`${m.toFixed(1)} KB`:`${h} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=e.computed(()=>o.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(h,m)=>t.file?(e.openBlock(),e.createBlock($s,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Us,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ws,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",p1,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(js,{class:"pt-2"},{default:e.withCtx(()=>{var g,k,y;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:m[2]||(m[2]=p=>l.value=!0),onMouseleave:m[3]||(m[3]=p=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,g1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[0]||(m[0]=p=>r("edit"))},[e.createVNode(e.unref(ce.Pencil),{style:{width:"16px",height:"16px"}})],12,b1)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:m[1]||(m[1]=p=>r("remove"))},[e.createVNode(e.unref(ce.Trash2),{style:{width:"16px",height:"16px"}})],12,y1)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",x1,[e.createElementVNode("div",k1,[m[4]||(m[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",w1,e.toDisplayString((g=i.value)==null?void 0:g.name),1)]),e.createElementVNode("div",C1,[m[5]||(m[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",E1,e.toDisplayString((k=i.value)==null?void 0:k.size),1)]),e.createElementVNode("div",B1,[m[6]||(m[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",_1,e.toDisplayString((y=i.value)==null?void 0:y.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),S1={class:"space-y-3"},aa=e.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:j=>r("update:modelValue",j)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d(j){c.value=j,r("error",j)}function u(){c.value=null}const f=e.computed(()=>{const j=(o.allowedTypes??"").trim();return j?j.split(/[,\s;]+/g).map(Y=>Y.trim().toLowerCase()).filter(Boolean).map(Y=>Y.includes("/")||Y.startsWith(".")?Y:`.${Y}`):[]});function h(j){const G=j.lastIndexOf(".");return G>=0?j.slice(G).toLowerCase():""}const m=e.computed(()=>{if(f.value.length){const j=f.value.filter(Y=>Y.startsWith("."));return[...f.value.filter(Y=>Y.includes("/")),...j].join(",")}return o.accept||"image/*"}),g=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function k(j){if(f.value.length){const Y=(j.type||"").toLowerCase(),H=h(j.name);return f.value.some(T=>T.includes("/")?Y===T:T.startsWith(".")?H===T:H===`.${T}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?(j.type||"").toLowerCase().startsWith("image/"):!0}function y(j){return j*1024*1024}async function p(j){var G;return(G=j.type)!=null&&G.startsWith("image/")?await new Promise(Y=>{const H=URL.createObjectURL(j),T=new Image;T.onload=()=>{URL.revokeObjectURL(H),Y({w:T.naturalWidth,h:T.naturalHeight})},T.onerror=()=>{URL.revokeObjectURL(H),Y(null)},T.src=H}):null}async function E(j){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const Y=await p(j);return Y?o.minWidth!=null&&Y.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&Y.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&Y.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&Y.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function _(j){return j?k(j)?o.minSizeMb!=null&&j.size<y(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&j.size>y(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await E(j):`only Allowed: ${g.value}`:"File tidak valid"}function B(j){o.disabled||(i.value=j,s.value=!0)}async function S(j){if(o.disabled)return;u();const G=await _(j);if(G){d(G);return}l.value=j,B(j)}const{DCodeApi:w}=ft(),x=qs(),b=e.ref(!1);e.ref(null);function A(j,G){return!j||!G?null:j.replace(/\/+$/,"")+"/"+G.replace(/^\/+/,"")}function V(j){var T;const G=(j==null?void 0:j.data)??j,Y=(T=G==null?void 0:G.data)==null?void 0:T[0];if(!Y)return null;const H=A(Y.server,Y.url);return{...Y,fullUrl:H?encodeURI(H):null}}async function D(j){var G;if(o.uploadFn){try{b.value=!0;const Y=await o.uploadFn(j);a.value=j,r("uploaded",Y)}catch(Y){console.error("Upload Error",Y),x.error("Upload Failed",(Y==null?void 0:Y.message)||"Unknown error"),d((Y==null?void 0:Y.message)||"Upload Failed")}finally{b.value=!1}return}if(!((G=o.endpoint)!=null&&G.apiUrl)){a.value=j;return}if(typeof w!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const Y=new FormData;Y.append("doc",j);const H=(o.endpoint.apiMethod||"POST").toUpperCase(),T=o.endpoint.apiUrl,U=await w("","",Y,{_url:T,_method:H,withCredentials:!0,transformRequest:[(Z,K)=>(K&&(delete K["Content-Type"],delete K["content-type"]),Z)]}),te=(U==null?void 0:U.data)??U;V(te),a.value=j,r("uploaded",te)}catch(Y){console.error("Upload Error",Y),x.error("Upload Failed",(Y==null?void 0:Y.message)||"Unknown error"),d((Y==null?void 0:Y.message)||"Upload Failed")}finally{b.value=!1}}async function N(j){var G;u(),o.uploadFn||(G=o.endpoint)!=null&&G.apiUrl?await D(j):a.value=j,s.value=!1,i.value=null}function P(){s.value=!1,i.value=null}async function v(){if(!a.value)return;u();const j=o.editUseOriginal?l.value??a.value:a.value,G=await _(j);if(G){d(G);return}B(j)}function Q(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,j=>{j&&!l.value&&(l.value=j),j||(l.value=null)},{immediate:!0}),(j,G)=>(e.openBlock(),e.createElementBlock("div",S1,[a.value?(e.openBlock(),e.createBlock(Xs,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:v,onRemove:Q,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:m.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:S,error:c.value,onError:G[0]||(G[0]=Y=>d(Y))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Gs,{modelValue:s.value,"onUpdate:modelValue":G[1]||(G[1]=Y=>s.value=Y),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:N,onCancel:P},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),A1=["aria-busy"],V1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},D1=["for"],N1={key:0,class:"ml-1 text-destructive"},M1=["id","disabled"],v1={class:"min-w-0 flex-1 text-left"},P1={key:0,class:"flex flex-wrap gap-1.5"},T1={class:"max-w-[220px] truncate"},O1=["onClick"],F1={key:0,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent"},z1={key:1,class:"text-muted-foreground truncate"},I1={class:"flex items-center gap-2 shrink-0"},R1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},L1=["placeholder","onKeydown"],$1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},j1=["disabled","onClick"],U1={class:"truncate"},W1={key:0,class:"text-primary-600 dark:text-primary-400"},H1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},q1={key:0},G1={key:1},X1={key:1,class:"text-xs text-destructive"},Ks=e.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},maxChips:{default:5},maxSelected:{default:5},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},virtual:{type:Boolean,default:!0},itemHeight:{default:40},maxRows:{default:5},overscan:{default:6},error:{default:null},required:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const oe=o.required,de=o["aria-required"];return oe===""||oe===!0||oe==="true"||(de==="true"||de===!0)}),u=e.computed(()=>!!a.error);function f(oe){return oe?typeof a.itemTitle=="function"?a.itemTitle(oe)??"":String((oe==null?void 0:oe[a.itemTitle])??""):""}function h(oe){return oe?typeof a.itemValue=="function"?a.itemValue(oe):oe==null?void 0:oe[a.itemValue]:null}function m(oe,de){return h(oe)??de}const g=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),k=e.computed(()=>{var oe;return!!((oe=a.endpoint)!=null&&oe.apiUrl)||!!a.fetchItems}),y=e.ref([]),p=e.ref(!1),E=e.ref(!1),_=e.computed(()=>{var de;const oe=(de=a.endpoint)==null?void 0:de.apiOptions;if(oe)return typeof oe=="function"?oe():oe}),B=e.computed(()=>{var Ve,nt;const oe=((Ve=a.endpoint)==null?void 0:Ve.apiUrl)??"",de=(((nt=a.endpoint)==null?void 0:nt.apiMethod)??"GET").toUpperCase(),me=JSON.stringify(_.value??null);return`${de} ${oe} :: ${me}`}),S=e.computed(()=>k.value?y.value:a.items||[]);async function w(){var oe;if(k.value&&!(!((oe=a.endpoint)!=null&&oe.apiUrl)&&!a.fetchItems)&&!p.value){p.value=!0;try{let de;if(a.fetchItems){const me=await a.fetchItems(),Ve=(me==null?void 0:me.data)??me;de=(Ve==null?void 0:Ve.data)??Ve}else{const{DCodeApi:me}=ft();if(typeof me!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const Ve={page:1,perPage:100,..._.value||{}},nt=await me("","",Ve,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),Bt=(nt==null?void 0:nt.data)??nt;de=(Bt==null?void 0:Bt.data)??Bt}y.value=Array.isArray(de)?de:[],E.value=!0}catch(de){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",de),y.value=[]}finally{p.value=!1}}}e.watch(()=>B.value,()=>{y.value=[],E.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&k.value&&w()});const x=e.computed(()=>{const oe=g.value;if(a.returnObject)return oe;const de=new Map;for(const me of S.value)de.set(h(me),me);return oe.map(me=>de.get(me)??{[a.itemValue]:me,[a.itemTitle]:String(me)})}),b=e.computed(()=>a.maxChips===null?x.value:x.value.slice(0,a.maxChips));function A(oe){const de=g.value;if(a.returnObject){const me=h(oe);return de.some(Ve=>h(Ve)===me)}return de.includes(h(oe))}const V=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const oe=Number(a.maxSelected);return Number.isFinite(oe)&&oe>0?oe:null}),D=e.computed(()=>{const oe=V.value;return oe===null?!1:g.value.length>=oe});function N(oe){return!A(oe)&&D.value}const P=e.computed(()=>{const oe=g.value,de=new Set;if(a.returnObject)for(const me of oe)de.add(h(me));else for(const me of oe)de.add(me);return de}),v=e.computed(()=>{const oe=P.value;return(S.value||[]).filter(de=>!oe.has(h(de)))}),Q=e.computed(()=>S.value.length===0?!1:v.value.length===0),j=e.ref(null),G=e.ref(null),Y=e.ref(null),H=e.ref(!1),T=e.ref(""),U=e.ref(0),te=e.ref(0),{floatingStyles:Z}=La(j,G,{whileElementsMounted:Oa,placement:"bottom-start",middleware:[Fa(8),Ia(),za({padding:8}),Ra({apply({rects:oe,elements:de}){Object.assign(de.floating.style,{width:`${oe.reference.width}px`,"--floating-width":`${oe.reference.width}px`})}})]}),K=e.computed(()=>Z.value),ae=e.computed(()=>{const oe=Number(a.maxRows);return Number.isFinite(oe)&&oe>0?oe:5});async function ue(){a.disabled||(H.value=!0,te.value=0,requestAnimationFrame(()=>{Y.value&&(Y.value.scrollTop=0),U.value=0}),k.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!E.value)&&!p.value&&await w())}function ke(){H.value=!1}function De(){H.value?ke():ue()}function Ce(oe){var me,Ve;if(!H.value)return;const de=oe.target;(me=j.value)!=null&&me.contains(de)||(Ve=G.value)!=null&&Ve.contains(de)||ke()}e.onMounted(()=>document.addEventListener("mousedown",Ce)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",Ce));function ee(oe){if(a.disabled)return;if(N(oe)){r("max");return}const de=[...g.value];if(a.returnObject){const me=h(oe);if(de.some(nt=>h(nt)===me))return;r("update:modelValue",[...de,oe])}else{const me=h(oe);if(de.includes(me))return;r("update:modelValue",[...de,me])}T.value="",te.value=0,requestAnimationFrame(()=>{Y.value&&(Y.value.scrollTop=0),U.value=0})}function z(oe){if(a.disabled)return;const de=[...g.value];if(a.returnObject){const me=h(oe);r("update:modelValue",de.filter(Ve=>h(Ve)!==me))}else{const me=h(oe);r("update:modelValue",de.filter(Ve=>Ve!==me))}}function J(){a.disabled||(r("update:modelValue",[]),r("clear"),ke())}const se=e.computed(()=>{const oe=T.value.trim().toLowerCase(),de=v.value;return oe?de.filter(me=>f(me).toLowerCase().includes(oe)):de}),Be=e.computed(()=>se.value.length);e.watch(H,oe=>{oe||(T.value="")});const ve=e.computed(()=>{if(Q.value)return a.itemHeight;const oe=Be.value;return(oe<=0?1:Math.min(oe,ae.value))*a.itemHeight}),Ge=e.computed(()=>a.virtual?Be.value*a.itemHeight:0),Xe=e.computed(()=>a.virtual?Math.ceil(ve.value/a.itemHeight)+a.overscan:Be.value),et=e.computed(()=>{if(!a.virtual)return 0;const oe=Math.floor(U.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,oe)}),Fe=e.computed(()=>a.virtual?Math.min(Be.value,et.value+Xe.value):Be.value),ut=e.computed(()=>a.virtual?et.value*a.itemHeight:0),bt=e.computed(()=>{const oe=se.value;return a.virtual?oe.slice(et.value,Fe.value):oe});function It(oe){const de=oe.target;U.value=de.scrollTop}function Mt(oe){return oe===te.value}function X(oe){const de=Y.value;if(!de||!a.virtual)return;const me=oe*a.itemHeight,Ve=me+a.itemHeight,nt=de.scrollTop,Bt=de.scrollTop+de.clientHeight;me<nt?de.scrollTop=me:Ve>Bt&&(de.scrollTop=Ve-de.clientHeight)}function fe(oe){const de=Math.max(0,Be.value-1);te.value=Math.min(de,Math.max(0,te.value+oe)),X(te.value)}function _e(){const oe=se.value[te.value];oe&&ee(oe)}const $e=e.computed(()=>a.clearable&&!a.disabled&&x.value.length>0),Ae=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":H.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(oe,de)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0),de[3]||(de[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",N1,"*")):e.createCommentVNode("",!0)],8,D1)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:j,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border rounded-lg flex items-center",["bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 text-foreground dark:text-gray-300",Ae.value]]),disabled:a.disabled,onClick:De},[e.createElementVNode("div",v1,[x.value.length?(e.openBlock(),e.createElementBlock("div",P1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(me,Ve)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${m(me,Ve)}`,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent gap-1"},[e.createElementVNode("span",T1,e.toDisplayString(f(me)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(nt=>z(me),["stop"]),"aria-label":"Remove"}," ✕ ",8,O1))]))),128)),a.maxChips!==null&&x.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",F1," +"+e.toDisplayString(x.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",z1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",I1,[$e.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(J,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(ce.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,M1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:G,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-800 border-gray-200 dark:border-neutral-700/50",style:e.normalizeStyle(K.value)},[a.searchable&&!Q.value?(e.openBlock(),e.createElementBlock("div",R1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":de[0]||(de[0]=me=>T.value=me),placeholder:a.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[de[1]||(de[1]=e.withKeys(e.withModifiers(me=>fe(1),["prevent"]),["down"])),de[2]||(de[2]=e.withKeys(e.withModifiers(me=>fe(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(_e,["prevent"]),["enter"]),e.withKeys(e.withModifiers(ke,["prevent"]),["esc"])]},null,40,L1),[[e.vModelText,T.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:Y,class:"relative overflow-auto",style:e.normalizeStyle({height:ve.value+"px"}),onScroll:It},[Q.value?(e.openBlock(),e.createElementBlock("div",$1," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:Ge.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${ut.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,(me,Ve)=>(e.openBlock(),e.createElementBlock("button",{key:String(m(me,et.value+Ve)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[N(me)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",Mt(et.value+Ve)?"bg-neutral-50 dark:bg-neutral-800/60":"",A(me)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||N(me),onClick:nt=>ee(me)},[e.createElementVNode("span",U1,e.toDisplayString(f(me)),1),A(me)?(e.openBlock(),e.createElementBlock("span",W1,"✓")):e.createCommentVNode("",!0)],14,j1))),128))],6),Be.value===0?(e.openBlock(),e.createElementBlock("div",H1,[p.value?(e.openBlock(),e.createElementBlock("span",q1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",G1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",X1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,A1)),[[e.vShow,i.value]])}}),K1={class:"space-y-4"},Y1={key:0,class:"flex flex-col gap-0.5"},J1=["for"],Q1=["for"],Z1={class:"text-[11px] text-gray-500 dark:text-gray-400"},eC={class:"flex items-center gap-2 flex-nowrap"},tC=["id","value","disabled","onKeydown","onInput","onPaste"],sa=e.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=ft(),f=qs(),h=e.computed(()=>{const w=Number(s.totalInput);return w&&w>0?w:6}),m=()=>{c.value=Array.from({length:h.value},(w,x)=>{var b;return((b=s.default)==null?void 0:b[x])??""}),i("updateOtp",c.value.join(""))};m(),e.watch(()=>[s.totalInput,s.default],()=>m());const g=w=>{w<0||w>=h.value||e.nextTick(()=>{var x;return(x=l.value[w])==null?void 0:x.focus()})},k=w=>w.match(/[a-zA-Z0-9]/)?w.match(/[a-zA-Z0-9]/)[0]:"";async function y(w){var x;if(i("complete",w),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(w);i("success",b)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((x=s.endpoint)!=null&&x.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const b=(s.endpoint.apiMethod||"POST").toUpperCase(),A=s.endpoint.apiUrl,V=await u("","",{otp:w},{_url:A,_method:b,withCredentials:!0}),D=(V==null?void 0:V.data)??V;i("success",D)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const p=(w,x)=>{c.value[w]=k(x);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===h.value&&y(b)},E=(w,x)=>{const b=w.key,A=/^\d$/.test(b),V=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(w.preventDefault(),c.value[x]){p(x,"");return}x>0&&(p(x-1,""),g(x-1));return}if(b==="ArrowLeft"){w.preventDefault(),g(x-1);return}if(b==="ArrowRight"){w.preventDefault(),g(x+1);return}if(A||V){w.preventDefault(),p(x,b),x<h.value-1&&g(x+1);return}b.length===1&&w.preventDefault()},_=(w,x)=>{const b=w.target,A=b.value??"",V=k(A);b.value=V,p(x,V),V&&x<h.value-1&&g(x+1)},B=(w,x)=>{var N;w.preventDefault();const A=(((N=w.clipboardData)==null?void 0:N.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!A)return;let V=x;for(const P of A){if(V>=h.value)break;c.value[V]=P,V++}const D=c.value.join("");i("updateOtp",D),i("update:modelValue",D),D.length===h.value&&y(D),g(Math.min(V,h.value-1))},S=w=>x=>{l.value[w]=(x==null?void 0:x.$el)??x};return(w,x)=>(e.openBlock(),e.createElementBlock("div",K1,[s.label||h.value?(e.openBlock(),e.createElementBlock("div",Y1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,J1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,Q1)),e.createElementVNode("p",Z1," Ketik "+e.toDisplayString(h.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",eC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:S(b-1),value:c.value[b-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:e.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",c.value[b-1]?"border-blue-500 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300":"border-gray-300 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:A=>E(A,b-1),onInput:A=>_(A,b-1),onPaste:A=>B(A,b-1)},null,42,tC))),128))])]))}}),nC={class:"w-full"},oC={key:0,class:"flex items-center justify-between mb-2"},rC={key:0,class:"text-sm font-medium text-gray-700"},aC={key:1,class:"text-sm text-gray-600"},sC={name:"DCodeProgress"},Xd=e.defineComponent({...sC,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",nC,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",oC,[t.label?(e.openBlock(),e.createElementBlock("span",rC,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",aC,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),iC={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},Kd=Ot(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",iC,[e.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),lC={class:"grid gap-3"},cC={key:0,class:"ml-1 text-destructive"},dC={class:"flex flex-col"},uC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},fC={class:"relative flex-shrink-0 mt-0.5"},hC=["id","name","value","checked","disabled","required","onChange"],mC=["onClick"],pC=["for"],gC={key:0,class:"ml-1 text-red-500"},bC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Ys=e.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ft(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var B,S;const _=((B=a.endpoint)==null?void 0:B.apiUrl)||a.apiUrl;if(_){i.value=!0,l.value=null;try{const w={page:1,perPage:100},x=((S=a.endpoint)==null?void 0:S.apiMethod)||a.apiMethod,b=await o(_,x,w);let A=b;a.dataPath?A=a.dataPath.split(".").reduce((D,N)=>D&&D[N]!=="undefined"?D[N]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(A=b.data),Array.isArray(A)?s.value=A:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(w){console.error("DCodeRadio fetch error:",w),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var _;((_=a.endpoint)!=null&&_.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const _=a.itemValue||a.model||"id",B=a.itemTitle||(a.label===""?"name":a.label);return B&&a.label!==""?[{[_]:_,[B]:B}]:[]}),u=_=>{if(typeof _!="object")return _;const B=a.itemValue||a.model||"id";return _[B]},f=_=>{if(typeof _!="object")return String(_);const B=a.itemTitle||"name";return _[B]},h=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),m=e.computed(()=>!!a.error||!!l.value),g=e.computed(()=>a.error||l.value),k=_=>_==null?a.modelValue===_:String(a.modelValue)===String(_),y=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),p=(_,B)=>{B.target.checked&&(r("update:modelValue",_),r("change",_))},E=_=>{!a.disabled&&!k(_)&&(r("update:modelValue",_),r("change",_))};return(_,B)=>(e.openBlock(),e.createElementBlock("div",lC,[t.label?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",cC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",dC,[i.value?(e.openBlock(),e.createElementBlock("div",uC,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),B[0]||(B[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(S,w)=>(e.openBlock(),e.createElementBlock("div",{key:w,class:e.normalizeClass(["flex items-start",y.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",fC,[e.createElementVNode("input",{id:t.id?`${t.id}-${w}`:`${h.value}-${w}`,name:h.value,type:"radio",value:u(S),checked:k(u(S)),disabled:t.disabled,required:t.required&&w===0,onChange:x=>p(u(S),x),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,hC)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:x=>E(u(S))},[e.createElementVNode("label",{for:t.id?`${t.id}-${w}`:`${h.value}-${w}`,class:e.normalizeClass([y.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled?"cursor-not-allowed opacity-50":""])},[e.createTextVNode(e.toDisplayString(f(S))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",gC,"*")):e.createCommentVNode("",!0)],10,pC)],8,mC)],2))),128))],2),m.value&&g.value?(e.openBlock(),e.createElementBlock("div",bC,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(g.value),1)])):e.createCommentVNode("",!0)])]))}}),yC={class:"grid gap-3"},xC={key:0,class:"ml-1 text-destructive"},kC={class:"flex flex-col"},wC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},CC=["onClick"],EC=["id","name","value","checked","disabled","required","onChange"],BC={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},_C=["for"],SC={key:0,class:"ml-1 text-red-500"},AC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Js=e.defineComponent({name:"DCodeRadioCustom",inheritAttrs:!1,__name:"DCodeRadioCustom",props:{modelValue:{default:void 0},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ft(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,A=>{s.value=A},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var V,D;const A=((V=a.endpoint)==null?void 0:V.apiUrl)||a.apiUrl;if(A){l.value=!0,c.value=null;try{const N={page:1,perPage:100},P=((D=a.endpoint)==null?void 0:D.apiMethod)||a.apiMethod,v=await o(A,P,N);let Q=v;a.dataPath?Q=a.dataPath.split(".").reduce((G,Y)=>G&&G[Y]!=="undefined"?G[Y]:void 0,v):typeof v=="object"&&!Array.isArray(v)&&v.data&&(Q=v.data),Array.isArray(Q)?i.value=Q:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(N){console.error("DCodeRadioCustom fetch error:",N),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const h=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var A;((A=a.endpoint)!=null&&A.apiUrl||a.apiUrl)&&d(),h(),typeof document<"u"&&(f=new MutationObserver(h),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const m=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const A=a.itemValue||a.model||"id",V=a.itemTitle||(a.label===""?"name":a.label);return V&&a.label!==""?[{[A]:A,[V]:V}]:[]}),g=A=>{if(typeof A!="object")return A;const V=a.itemValue||a.model||"id";return A[V]},k=A=>{if(typeof A!="object")return String(A);const V=a.itemTitle||"name";return A[V]},y=Math.random().toString(36).slice(2,7),p=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${y}`),E=e.computed(()=>!!a.error||!!c.value),_=e.computed(()=>a.error||c.value),B=A=>{const V=s.value;return A==null?V===A:String(V)===String(A)},S=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),w=e.computed(()=>a.icon&&Gt[a.icon]||null),x=(A,V)=>{V.target.checked&&(s.value=A,r("update:modelValue",A),r("change",A))},b=A=>{a.disabled||B(A)||(s.value=A,r("update:modelValue",A),r("change",A))};return(A,V)=>(e.openBlock(),e.createElementBlock("div",yC,[t.label?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",xC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",kC,[l.value?(e.openBlock(),e.createElementBlock("div",wC,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),V[0]||(V[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,(D,N)=>(e.openBlock(),e.createElementBlock("div",{key:N,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",B(g(D))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:P=>!t.disabled&&b(g(D))},[e.createElementVNode("input",{id:t.id?`${t.id}-${N}`:`${p.value}-${N}`,name:p.value,type:"radio",value:g(D),checked:B(g(D)),disabled:t.disabled,required:t.required&&N===0,onChange:P=>x(g(D),P),class:"sr-only",tabindex:"-1"},null,40,EC),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",B(g(D))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[w.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",BC,[...V[1]||(V[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${N}`:`${p.value}-${N}`,class:e.normalizeClass([S.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",B(g(D))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(k(D))+" ",1),t.required&&m.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",SC,"*")):e.createCommentVNode("",!0)],10,_C)],10,CC))),128))],2),E.value&&_.value?(e.openBlock(),e.createElementBlock("div",AC,[e.createVNode(e.unref(ce.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(_.value),1)])):e.createCommentVNode("",!0)])]))}}),VC={key:0,class:"ml-1 text-destructive"},DC={class:"relative w-full"},NC={key:0,class:"mb-2 flex items-center justify-between"},MC={class:"text-sm text-muted-foreground"},vC={class:"text-sm font-medium text-foreground"},PC={class:"text-sm text-muted-foreground"},TC={class:"relative"},OC=["id","value","min","max","step","disabled","placeholder"],FC={key:1,class:"relative mt-2"},zC={class:"text-xs text-muted-foreground mt-1"},IC={key:1,class:"flex items-center gap-1 text-sm text-destructive"},RC={name:"DCodeSlider"},ia=e.defineComponent({...RC,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),f=e.computed(()=>{const S={sm:"h-2",md:"h-2.5",lg:"h-3"},w={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",S[a.size],w[a.color]||w.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),h=e.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),m=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),g=e.computed(()=>{const S=a.max-a.min;return(a.modelValue-a.min)/S*100}),k=S=>{const w=S.target,x=parseFloat(w.value);r("update:modelValue",x),r("input",x)},y=S=>{const w=S.target,x=parseFloat(w.value);r("change",x)},p=()=>{i.value=!0},E=()=>{i.value=!1},_=S=>{const w=a.max-a.min;return(S-a.min)/w*100},B=e.computed(()=>{const S={sm:16,md:20,lg:24};return`
|
|
66
|
+
`.trim();let a=document.getElementById(n);a||(a=document.createElement("style"),a.id=n,document.head.appendChild(a)),a.textContent=r}function Lk(t,n=Ud){e.watch(t,o=>Ik(o,n),{immediate:!0})}const $k={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},jk=["for"],Uk={key:0,class:"ml-1 text-destructive"},Wk=["disabled","onClick"],Hk={class:"flex-shrink-0 px-2 text-sm text-muted-foreground select-none whitespace-nowrap"},qk=["id","value","placeholder","disabled","onClick","onFocus","onBlur","onInput","onKeydown","onKeypress","onPaste"],Gk={class:"h-full p-2 flex flex-col gap-3 w-32"},Xk=["onClick"],Kk={class:"flex items-center justify-end gap-2 w-full p-2"},Yk=["disabled","onClick"],Jk={key:1,class:"text-xs text-destructive"},oa=e.defineComponent({name:"DCodeDatePicker",inheritAttrs:!1,__name:"DCodeDatePicker",props:{modelValue:{},range:{type:Boolean,default:!1},autoRangeDays:{default:null},disablePast:{type:Boolean,default:!1},maxDaysAhead:{default:null},placeholder:{default:"Pilih tanggal"},label:{},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},displayFormat:{default:"dd/MM/yyyy"},modelType:{default:"yyyy-MM-dd"},locale:{default:"en"},placement:{default:"bottom-start"},prependInner:{default:void 0},error:{default:null},selectLabel:{default:"Select"},cancelLabel:{default:"Cancel"},tone:{default:"primary"},skeleton:{type:Boolean,default:!1}},emits:["update:modelValue","change","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=t,a=n,s=Math.random().toString(36).slice(2,7),i=e.computed(()=>`dcode-datepicker-${o.id||r.label||"date-picker"}-${s}`),l=e.computed(()=>{const P=o.required,M=o["aria-required"];return P===""||P===!0||P==="true"||M==="true"||M===!0}),c=e.computed(()=>!!r.error),d=e.computed({get:()=>r.modelValue,set:P=>{a("update:modelValue",P),a("change",P)}}),u=e.computed(()=>r.locale==="en"?Od:Rk),f=e.computed(()=>r.range?2:!1),m=e.computed(()=>{if(!r.range)return!1;const P={partialRange:!1};return r.autoRangeDays&&r.autoRangeDays>0&&(P.maxRange=r.autoRangeDays,P.autoRange=r.autoRangeDays),P}),h=P=>{const M=new Date(P);return M.setHours(0,0,0,0),M},p=P=>{const M=new Date(P);return M.setHours(23,59,59,999),M},k=(P,M)=>{const X=new Date(P);return X.setDate(X.getDate()+M),X},x=e.computed(()=>{if(r.disablePast)return h(new Date)}),g=e.computed(()=>{if(r.maxDaysAhead&&r.maxDaysAhead>0)return p(k(new Date,r.maxDaysAhead))}),S=e.ref(null),B=e.ref(null),E=P=>{B.value={month:P.month,year:P.year}},_=e.ref(!1);let w=null;e.onMounted(()=>{const P=document.documentElement,M=()=>_.value=P.classList.contains("dark");M(),w=new MutationObserver(M),w.observe(P,{attributes:!0,attributeFilter:["class"]})}),e.onBeforeUnmount(()=>{w==null||w.disconnect(),w=null}),Lk(e.toRef(r,"tone"));const y=P=>{const M=new Date(P),X=M.getDay(),$=M.getDate()-X+(X===0?-6:1);return M.setDate($),h(M)},b=P=>{const M=y(P);return M.setDate(M.getDate()+6),p(M)},C=P=>{const M=new Date(P);return M.setDate(1),h(M)},V=P=>{const M=new Date(P);return M.setMonth(M.getMonth()+1),M.setDate(0),p(M)},D=e.computed(()=>{if(!r.range)return[];const P=new Date,M=h(P),X=y(P),$=b(P),H=C(P),J=V(P),te=(T,L)=>{let Z=T;r.disablePast&&Z<M&&(Z=M);let Q=L;if(r.autoRangeDays&&r.autoRangeDays>0){const W=p(k(Z,r.autoRangeDays-1));Q>W&&(Q=W)}return Q<Z&&(Q=p(new Date(Z))),[Z,Q]};return[{label:r.locale==="id"?"Minggu Ini":"This Week",range:te(X,$)},{label:r.locale==="id"?"Bulan Ini":"This Month",range:te(H,J)}]}),N=async P=>{var L,Z;const M=r.modelType||"yyyy-MM-dd";if(P.length===0){d.value=null;return}if(P.length<2)return;const X=$d(P[0],M),$=$d(P[1],M);d.value=[X,$],await e.nextTick();const H=P[0],J=H.getMonth(),te=H.getFullYear();B.value&&B.value.month===J&&B.value.year===te||(L=S.value)==null||L.setMonthYear({month:J,year:te}),(Z=S.value)==null||Z.openMenu()};return(P,M)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class])},[t.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[t.label?(e.openBlock(),e.createElementBlock("div",$k)):e.createCommentVNode("",!0),M[2]||(M[2]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[t.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:i.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(t.label)+" ",1),l.value?(e.openBlock(),e.createElementBlock("span",Uk,"*")):e.createCommentVNode("",!0)],8,jk)):e.createCommentVNode("",!0),e.createVNode(e.unref(yu.VueDatePicker),{ref_key:"dpRef",ref:S,modelValue:d.value,"onUpdate:modelValue":M[1]||(M[1]=X=>d.value=X),dark:_.value,range:m.value,"multi-calendars":f.value,disabled:t.disabled,clearable:!1,"text-input":"","enable-time-picker":!1,"time-config":{enableTimePicker:!1},"auto-apply":!1,"action-row":{showPreview:!0,showNow:!1},locale:u.value,"model-type":t.modelType,formats:{input:t.displayFormat},"min-date":x.value,"max-date":g.value,"preset-ranges":D.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:E},e.createSlots({"dp-input":e.withCtx(({value:X,onInput:$,onEnter:H,onTab:J,onBlur:te,onFocus:T,onKeypress:L,onPaste:Z,toggleMenu:Q})=>[e.createElementVNode("div",{class:e.normalizeClass(["flex items-center w-full h-10 rounded-lg border bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 overflow-hidden shadow-none transition-all duration-200 focus-within:ring-1 focus-within:ring-neutral-400 dark:focus-within:ring-neutral-600 focus-within:border-neutral-400 dark:focus-within:border-neutral-600",[c.value?"border-destructive":"",t.disabled?"opacity-50 cursor-not-allowed":""]])},[e.createElementVNode("button",{type:"button",tabindex:"-1",disabled:t.disabled,class:"flex-shrink-0 flex items-center justify-center w-10 h-full text-muted-foreground hover:text-foreground transition-colors focus:outline-none",onClick:W=>Q()},[e.createVNode(e.unref(le.Calendar),{class:"w-4 h-4 pointer-events-none"})],8,Wk),M[4]||(M[4]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1)),t.prependInner?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("span",Hk,e.toDisplayString(t.prependInner),1),M[3]||(M[3]=e.createElementVNode("span",{class:"w-px h-5 bg-gray-200 dark:bg-gray-700 flex-shrink-0"},null,-1))],64)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:i.value,value:X,placeholder:t.placeholder,disabled:t.disabled,autocomplete:"off",readonly:"",class:e.normalizeClass(["flex-1 min-w-0 px-3 h-full bg-transparent text-sm text-foreground dark:text-gray-300 placeholder:text-muted-foreground outline-none",t.disabled?"cursor-not-allowed":"cursor-pointer"]),onClick:W=>Q(),onFocus:W=>T(),onBlur:W=>te(),onInput:W=>$(W),onKeydown:[e.withKeys(W=>H(W),["enter"]),e.withKeys(W=>J(W),["tab"])],onKeypress:W=>L(W),onPaste:W=>Z()},null,42,qk)],2)]),"action-buttons":e.withCtx(({selectDate:X,selectionDisabled:$})=>[e.createElementVNode("div",Kk,[e.createElementVNode("button",{type:"button",class:"inline-flex items-center justify-center rounded-md text-sm font-medium border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:M[0]||(M[0]=H=>{var J;return(J=S.value)==null?void 0:J.closeMenu()})},e.toDisplayString(t.cancelLabel),1),e.createElementVNode("button",{type:"button",disabled:$,class:"inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400 disabled:pointer-events-none disabled:opacity-50",onClick:H=>X()},e.toDisplayString(t.selectLabel),9,Yk)])]),_:2},[t.range?{name:"left-sidebar",fn:e.withCtx(()=>[e.createElementVNode("div",Gk,[D.value.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(D.value,X=>(e.openBlock(),e.createElementBlock("button",{key:X.label,type:"button",class:"w-full inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-9 px-4 py-2 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-neutral-400",onClick:$=>N(X.range)},e.toDisplayString(X.label),9,Xk))),128)):e.createCommentVNode("",!0)])]),key:"0"}:void 0]),1032,["modelValue","dark","range","multi-calendars","disabled","locale","model-type","formats","min-date","max-date","preset-ranges","floating"]),c.value?(e.openBlock(),e.createElementBlock("p",Jk,e.toDisplayString(r.error),1)):e.createCommentVNode("",!0)],64))],2))}}),Qk=e.defineComponent({__name:"Dialog",props:{open:{type:Boolean},defaultOpen:{type:Boolean},modal:{type:Boolean}},emits:["update:open"],setup(t,{emit:n}){const o=t,r=n,a=Be.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),Zk=e.defineComponent({inheritAttrs:!1,__name:"DialogContent",props:{forceMount:{type:Boolean},disableOutsidePointerEvents:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(t,{emit:n}){const o=t,r=n,a=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Be.DialogOverlay),{class:"fixed inset-0 z-50 bg-black/40 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0"}),e.createVNode(e.unref(Be.DialogContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(ve)("fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",o.class)}),{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default"),e.createVNode(e.unref(Be.DialogClose),{class:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.X),{class:"w-4 h-4"}),l[0]||(l[0]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))]),_:1})]),_:3},16,["class"])]),_:3}))}}),ew=e.defineComponent({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogDescription),e.mergeProps(e.unref(r),{class:e.unref(ve)("text-sm text-muted-foreground",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),tw=e.defineComponent({__name:"DialogTitle",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.DialogTitle),e.mergeProps(e.unref(r),{class:e.unref(ve)("text-lg font-medium leading-none tracking-tight",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16,["class"]))}}),nw={key:0,class:"px-6 py-4 flex items-center justify-between border-b border-neutral-200/60 dark:border-neutral-700/50 bg-white/80 dark:bg-neutral-900/30 backdrop-blur-md sticky top-0 z-20"},ow={class:"flex items-center gap-3"},rw={class:"flex flex-col"},aw={key:0,class:"flex items-center gap-2"},sw={key:1,class:"px-6 py-4 border-t border-neutral-200/60 dark:border-neutral-700/50 bg-neutral-50/50 dark:bg-neutral-900/30 sticky bottom-0 z-20"},iw={class:"flex justify-end gap-3 flex-wrap"},Pn=Dt(e.defineComponent({name:"DCodeDialog",inheritAttrs:!1,__name:"DCodeDialog",props:{modelValue:{type:Boolean,default:!1},title:{default:""},icon:{default:""},maxWidth:{default:500},persistent:{type:Boolean,default:!0},contentClass:{default:"p-5"},contentStyle:{default:()=>({})},iconClass:{default:""}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=e.useAttrs(),s=e.computed(()=>{const{style:d,...u}=a;return u}),i=e.computed(()=>({maxWidth:typeof o.maxWidth=="number"?`${o.maxWidth}px`:o.maxWidth,width:"100%"})),l=e.computed(()=>o.icon?$t[o.icon]??null:null),c=d=>{r("update:modelValue",d)};return(d,u)=>(e.openBlock(),e.createBlock(e.unref(Qk),{open:t.modelValue,"onUpdate:open":c},{default:e.withCtx(()=>[e.createVNode(e.unref(Zk),e.mergeProps(s.value,{style:i.value,class:"p-0 overflow-hidden rounded-xl flex flex-col max-h-[90vh] bg-white dark:bg-neutral-800 border-0",onInteractOutside:u[0]||(u[0]=f=>t.persistent?f.preventDefault():null),onEscapeKeyDown:u[1]||(u[1]=f=>t.persistent?f.preventDefault():null)}),{default:e.withCtx(()=>[t.title||d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",nw,[e.createElementVNode("div",ow,[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["p-2 rounded-lg",t.iconClass||"bg-primary/10 text-primary"])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),{class:"h-5 w-5"}))],2)):e.createCommentVNode("",!0),e.createElementVNode("div",rw,[e.createVNode(e.unref(tw),{class:"text-lg font-bold text-neutral-900 dark:text-neutral-50 leading-tight"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),e.createVNode(e.unref(ew),{class:"hidden"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title||"Dialog Content"),1)]),_:1})])]),d.$slots["header-append"]?(e.openBlock(),e.createElementBlock("div",aw,[e.renderSlot(d.$slots,"header-append",{},void 0,!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex-1 overflow-y-auto custom-scrollbar",t.contentClass]),style:e.normalizeStyle(t.contentStyle)},[e.renderSlot(d.$slots,"default",{},void 0,!0)],6),d.$slots.actions?(e.openBlock(),e.createElementBlock("div",sw,[e.createElementVNode("div",iw,[e.renderSlot(d.$slots,"actions",{},void 0,!0)])])):e.createCommentVNode("",!0)]),_:3},16,["style"])]),_:3},8,["open"]))}}),[["__scopeId","data-v-52781e0f"]]),bo=e.defineComponent({name:"DCodeLabel",inheritAttrs:!1,__name:"DCodeLabel",props:{label:{},text:{},textSize:{},textType:{},icon:{},iconClass:{}},setup(t){const n=e.useAttrs(),o=t,r=e.computed(()=>o.icon&&$t[o.icon]||null),a=e.computed(()=>o.textSize?`text-${o.textSize}`:"text-xs"),s={xs:"w-3 h-3",sm:"w-3.5 h-3.5",base:"w-4 h-4",lg:"w-5 h-5",xl:"w-5 h-5","2xl":"w-6 h-6","3xl":"w-7 h-7","4xl":"w-8 h-8","5xl":"w-10 h-10","6xl":"w-12 h-12"},i=e.computed(()=>s[o.textSize??"xs"]??"w-3 h-3"),l=e.computed(()=>o.textType==="BOLD"?"font-bold":o.textType==="ITALIC"?"italic font-normal":"font-normal"),c=e.computed(()=>{const u=`${a.value} ${l.value} text-slate-600 ml-1 inline-flex items-center gap-1`,f=n.class??"";return[u,f].filter(Boolean).join(" ")}),d=e.computed(()=>{const{class:u,...f}=n;return f});return(u,f)=>(e.openBlock(),e.createElementBlock("span",e.mergeProps({class:c.value},d.value),[r.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(r.value),{key:0,class:e.normalizeClass(["shrink-0",i.value,t.iconClass])},null,8,["class"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label||t.text),1)],16))}}),lw={class:"flex flex-col gap-3 w-full"},cw={key:0,class:"col-span-full flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-dashed border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70 pointer-events-none animate-pulse"},dw={class:"flex flex-col items-center justify-center gap-2 py-6 rounded-lg border border-dashed border-slate-300 dark:border-neutral-700/50 bg-slate-50 dark:bg-neutral-900/30 text-slate-400"},uw={key:1,class:"col-span-full flex flex-col items-center justify-center text-center gap-2 px-3 py-8 bg-slate-50 dark:bg-neutral-900/10 border border-slate-200 dark:border-neutral-700/50 rounded-lg opacity-70"},fw={class:"text-sm font-medium text-slate-500"},mw={class:"flex items-center justify-between gap-2"},hw=["onClick"],pw={key:0,class:"flex items-center gap-3 px-3 py-2 bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-800 rounded-md"},gw={class:"text-xs text-green-700 dark:text-green-400 flex-1 truncate"},bw=["onClick"],yw=["for","onDrop"],xw={class:"text-xs text-slate-500 dark:text-slate-400"},kw={key:2,class:"text-xs text-slate-400"},ww=["id","disabled","accept","onChange"],Cw={class:"flex flex-col items-center justify-center min-h-[300px]"},Ew=["src","alt"],Bw=["src"],_w={key:2,class:"flex flex-col items-center gap-4 py-12 text-slate-400"},Sw={class:"text-sm font-medium"},Vw=["href"],Is=e.defineComponent({__name:"DCodeDynamicUploadList",props:{modelValue:{type:Array,default:()=>[]},label:{type:String,default:""},labelID:{type:String,default:"Documents"},labelEN:{type:String,default:"Documents"},endpoint:{type:Object,default:()=>null},endpointReference:{type:Object,default:()=>null},itemTitle:{type:String,default:"name"},itemValue:{type:String,default:"id"},disabled:Boolean,required:Boolean,typeFile:{type:String,default:void 0},sizeFile:{type:Number,default:void 0},items:{type:Array,default:void 0},baseUrl:{type:String,default:void 0}},emits:["update:modelValue","uploaded","success"],setup(t,{emit:n}){const o=t,r=n,{t:a,locale:s}=vt.useI18n(),i=e.computed(()=>{const w=o.endpoint;if(!(w!=null&&w.apiUrl))return null;let y=w.apiUrl;if(!y.startsWith("http")&&o.baseUrl){const b=o.baseUrl.replace(/\/$/,""),C=y.startsWith("/")?y:`/${y}`;y=`${b}${C}`}return y}),l=e.computed(()=>{const w=c.value.length;return w<=1?"grid-cols-1":w===2?"grid-cols-1 md:grid-cols-2":w===3?"grid-cols-1 md:grid-cols-3 xl:grid-cols-4":w===4?"grid-cols-1 md:grid-cols-2 lg:grid-cols-3":"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"}),c=e.ref([]),d=e.ref([]),u=e.ref(new Set),f=e.ref(!0),m=e.ref(!1),h=e.ref(""),p=e.ref(""),k=e.ref(""),x=async()=>{var w;if(f.value=!0,o.items!==void 0){c.value=o.items,f.value=!1;return}if(!((w=o.endpointReference)!=null&&w.apiUrl)){f.value=!1;return}try{const{apiUrl:y}=ct(),b=await y(o.endpointReference.apiUrl,o.endpointReference.apiMethod||"GET",{page:1,perPage:100});if(o.items!==void 0){f.value=!1;return}let C=(b==null?void 0:b.data)||b;Array.isArray(C)||(C=[C]),c.value=C}catch(y){console.error("Failed to fetch dynamic document list",y)}finally{f.value=!1}};e.onMounted(()=>{Array.isArray(o.modelValue)&&o.modelValue.length>0&&(d.value=JSON.parse(JSON.stringify(o.modelValue))),x()}),e.onBeforeUnmount(()=>{d.value.forEach(w=>{w._localPreviewUrl&&URL.revokeObjectURL(w._localPreviewUrl)})}),e.watch(()=>o.modelValue,w=>{if(Array.isArray(w)&&JSON.stringify(w)!==JSON.stringify(d.value)){const y=JSON.parse(JSON.stringify(w));y.forEach(b=>{const C=d.value.find(V=>V.typeDocument===b.typeDocument||V.idDocumentType===b.idDocumentType);C!=null&&C._localPreviewUrl&&(b._localPreviewUrl=C._localPreviewUrl)}),d.value=y}},{deep:!0}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiUrl},(w,y)=>{w!==y&&x()}),e.watch(()=>{var w;return(w=o.endpointReference)==null?void 0:w.apiMethod},(w,y)=>{w!==y&&x()}),e.watch(()=>o.items,w=>{c.value=w??[],f.value=!1},{deep:!0,immediate:!0});const g=w=>{const y=w[o.itemValue]||w.id||w.typeDocument;return d.value.find(b=>b.typeDocument===y||b.idDocumentType===y||b[o.itemValue]===y)||null},S=async(w,y,b)=>{var P,M,X,$;const C=b.target,V=(P=C.files)==null?void 0:P[0];if(!V)return;const D=w[o.itemValue]||w.id||w.typeDocument,N=URL.createObjectURL(V);if(!i.value){const H=[...d.value],J=H.findIndex(T=>T.typeDocument===D||T.idDocumentType===D);(M=H[J])!=null&&M._localPreviewUrl&&URL.revokeObjectURL(H[J]._localPreviewUrl);const te={id:null,idDocument:null,idDocumentType:D,filename:V.name,document:D,documentUrl:V.name,typeDocument:D,_localPreviewUrl:N,_fileType:V.type};J>-1?H[J]={...H[J],...te}:H.push(te),d.value=H,r("update:modelValue",H);return}u.value.add(y);try{const{apiUrl:H}=ct(),J=new FormData;J.append("doc",V),J.append("typeDocument",String(D));const te=await H(i.value,((X=o.endpoint)==null?void 0:X.apiMethod)||"POST",J),T=Array.isArray(te==null?void 0:te.data)?te.data[0]:(te==null?void 0:te.data)||te,L=(T==null?void 0:T.url)||(T==null?void 0:T.document)||V.name,Z=(T==null?void 0:T.id)||null,Q=(T==null?void 0:T.filename)||(T==null?void 0:T.name)||V.name,W=[...d.value],ie=W.findIndex(Ce=>Ce.typeDocument===D||Ce.idDocumentType===D);($=W[ie])!=null&&$._localPreviewUrl&&URL.revokeObjectURL(W[ie]._localPreviewUrl);const de={...T,id:Z||(T==null?void 0:T.idDocument)||(T==null?void 0:T.id_document)||null,idDocument:(T==null?void 0:T.idDocument)||Z||(T==null?void 0:T.id_document)||null,idDocumentType:D,filename:Q,document:D,documentUrl:L,typeDocument:D,_localPreviewUrl:N,_fileType:V.type};ie>-1?W[ie]={...W[ie],...de}:W.push(de),d.value=W,r("update:modelValue",W),r("uploaded",T),r("success",T)}catch(H){console.error("Upload failed",H)}finally{u.value.delete(y),C.value=""}},B=w=>{const y=w[o.itemValue]||w.id||w.typeDocument,b=d.value.find(V=>V.typeDocument===y||V.idDocumentType===y);b!=null&&b._localPreviewUrl&&URL.revokeObjectURL(b._localPreviewUrl);const C=d.value.filter(V=>V.typeDocument!==y&&V.idDocumentType!==y);d.value=C,r("update:modelValue",C)},E=w=>{const y=g(w);if(!y)return;let b=y._localPreviewUrl;if(!b)if(y.server&&y.url){const D=y.server.replace(/\/+$/,""),N=y.url.replace(/^\/+/,"");b=`${D}/${N}`}else b=y.document||y.url;if(!b)return;const C=y.mime||y._fileType||"",V=C==="application/pdf"||b.toLowerCase().endsWith(".pdf");V&&!b.includes("#")&&(b+="#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"),h.value=b,p.value=w[o.itemTitle]||w.name||y.filename||"Preview Document",k.value=C||(V?"application/pdf":"image/jpeg"),m.value=!0},_=(w,y,b)=>{var D,N;b.preventDefault();const C=(N=(D=b.dataTransfer)==null?void 0:D.files)==null?void 0:N[0];if(!C)return;S(w,y,{target:{files:[C],value:""}})};return(w,y)=>(e.openBlock(),e.createElementBlock("div",lw,[t.label||t.labelID||t.labelEN?(e.openBlock(),e.createBlock(bo,{key:0,text:t.label||(e.unref(s).toLowerCase().startsWith("en")?t.labelEN:t.labelID),class:"font-semibold text-sm text-slate-700 dark:text-slate-300",required:t.required},null,8,["text","required"])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["w-full grid gap-4",l.value])},[c.value.length===0&&f.value?(e.openBlock(),e.createElementBlock("div",cw,[e.createVNode(bo,{text:e.unref(a)("dynamicUploadList.loadingDocs"),class:"font-semibold text-sm text-slate-700 dark:text-neutral-300"},null,8,["text"]),e.createElementVNode("div",dw,[e.createVNode(e.unref(le.Loader2),{class:"w-6 h-6 animate-spin"})])])):c.value.length===0&&!f.value?(e.openBlock(),e.createElementBlock("div",uw,[e.createVNode(e.unref(le.CheckCircle2),{class:"w-6 h-6 text-slate-400"}),e.createElementVNode("span",fw,e.toDisplayString(e.unref(a)("dynamicUploadList.noDocsRequired")),1)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(b,C)=>{var V;return e.openBlock(),e.createElementBlock("div",{key:C,class:"flex flex-col gap-2 p-3 bg-white dark:bg-neutral-800 border border-slate-200 dark:border-neutral-700/50 rounded-lg shadow-sm"},[e.createElementVNode("div",mw,[e.createVNode(bo,{text:b[t.itemTitle]||b.name||b.filename||"Upload Document",class:"font-semibold text-sm text-slate-700 dark:text-neutral-300 truncate flex-1"},null,8,["text"]),g(b)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"p-1 hover:bg-slate-100 dark:hover:bg-zinc-700 rounded transition-colors text-slate-400 hover:text-primary-500",onClick:D=>E(b)},[e.createVNode(e.unref(le.Eye),{class:"w-4 h-4"})],8,hw)):e.createCommentVNode("",!0)]),g(b)?(e.openBlock(),e.createElementBlock("div",pw,[e.createVNode(e.unref(le.CheckCircle2),{class:"w-4 h-4 text-green-600 shrink-0"}),e.createElementVNode("span",gw,e.toDisplayString(((V=g(b))==null?void 0:V.filename)||e.unref(a)("dynamicUploadList.fileUploaded")),1),t.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"text-red-400 hover:text-red-600 transition-colors",onClick:D=>B(b)},[e.createVNode(e.unref(le.X),{class:"w-4 h-4"})],8,bw))])):(e.openBlock(),e.createElementBlock("label",{key:1,for:`dyn-upload-input-${C}`,class:e.normalizeClass(["flex flex-col items-center justify-center gap-2 py-8 rounded-lg border-2 border-dashed transition-colors cursor-pointer",[t.disabled?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-60":"border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800 hover:border-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/10",u.value.has(C)?"pointer-events-none opacity-70":""]]),onDragover:y[0]||(y[0]=e.withModifiers(()=>{},["prevent"])),onDrop:D=>!t.disabled&&!u.value.has(C)&&_(b,C,D)},[u.value.has(C)?(e.openBlock(),e.createBlock(e.unref(le.Loader2),{key:0,class:"w-6 h-6 animate-spin text-primary-500"})):(e.openBlock(),e.createBlock(e.unref(le.Upload),{key:1,class:"w-6 h-6 text-slate-400"})),e.createElementVNode("span",xw,e.toDisplayString(u.value.has(C)?e.unref(a)("dynamicUploadList.uploading"):e.unref(a)("dynamicUploadList.clickOrDrag")),1),t.typeFile?(e.openBlock(),e.createElementBlock("span",kw,e.toDisplayString(t.typeFile),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:`dyn-upload-input-${C}`,type:"file",class:"sr-only",disabled:t.disabled||u.value.has(C),accept:t.typeFile,onChange:D=>S(b,C,D)},null,40,ww)],42,yw))])}),128))],2),e.createVNode(Pn,{modelValue:m.value,"onUpdate:modelValue":y[2]||(y[2]=b=>m.value=b),title:p.value,"max-width":k.value==="application/pdf"?"720":"500",class:e.normalizeClass(k.value==="application/pdf"?"max-w-[40vw]":""),"content-class":k.value==="application/pdf"?"p-0 overflow-hidden":"px-6 py-1 overflow-y-auto"},{actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"px-4 py-2 border border-slate-200 dark:border-zinc-700 rounded-md text-sm font-medium hover:bg-slate-50 dark:hover:bg-zinc-800 transition-colors",onClick:y[1]||(y[1]=b=>m.value=!1)},e.toDisplayString(e.unref(a)("common.close")||"Close"),1)]),default:e.withCtx(()=>[e.createElementVNode("div",Cw,[k.value.startsWith("image/")?(e.openBlock(),e.createElementBlock("img",{key:0,src:h.value,alt:p.value,class:"w-full h-auto max-h-[72vh] object-contain rounded-lg shadow-md"},null,8,Ew)):k.value==="application/pdf"?(e.openBlock(),e.createElementBlock("iframe",{key:1,src:`${h.value}${h.value.includes("#")?"":"#toolbar=0&navpanes=0&scrollbar=0&view=FitH&pagemode=none"}`,class:"w-full h-[70vh] rounded-lg border border-slate-200",title:"Document Preview"},null,8,Bw)):(e.openBlock(),e.createElementBlock("div",_w,[e.createVNode(e.unref(le.FileText),{class:"w-16 h-16 stroke-1"}),e.createElementVNode("span",Sw,e.toDisplayString(e.unref(a)("dynamicUploadList.noSupportPreview")||"Preview not supported for this file type"),1),e.createElementVNode("a",{href:h.value,target:"_blank",class:"px-4 py-2 bg-primary-500 text-white rounded-md text-sm font-semibold hover:bg-primary-600 transition-colors"},e.toDisplayString(e.unref(a)("dynamicUploadList.viewOriginal")||"View Original"),9,Vw)]))])]),_:1},8,["modelValue","title","max-width","class","content-class"])]))}}),Wd=e.defineComponent({name:"DCodeDialogCloseBtn",__name:"DCodeDialogCloseBtn",props:{icon:{default:"X"},iconSize:{default:22}},setup(t){const n=t,o=e.computed(()=>$t[n.icon]??$t.X);return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Ht),{type:"button",variant:"secondary",size:"icon",class:"rounded-full shadow-sm"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{size:Number(t.iconSize)},null,8,["size"]))]),_:1}))}}),Aw=e.defineComponent({__name:"Alert",props:{class:{type:[Boolean,null,String,Object,Array]},variant:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)(e.unref(Nw)({variant:t.variant}),n.class)),role:"alert"},[e.renderSlot(o.$slots,"default")],2))}}),Dw=e.defineComponent({__name:"AlertDescription",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("text-sm [&_p]:leading-relaxed",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Nw=wr("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Ls=e.defineComponent({__name:"Badge",props:{variant:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)(e.unref(Mw)({variant:t.variant}),n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Mw=wr("inline-flex gap-1 items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}}),$s=e.defineComponent({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("rounded-xl border bg-card text-card-foreground shadow",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),js=e.defineComponent({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("p-6 pt-0",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Us=e.defineComponent({__name:"CardHeader",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(ve)("flex flex-col gap-y-1.5 p-6",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Ws=e.defineComponent({__name:"CardTitle",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createElementBlock("h3",{class:e.normalizeClass(e.unref(ve)("font-medium leading-none tracking-tight",n.class))},[e.renderSlot(o.$slots,"default")],2))}}),Tw={class:"h-full w-full p-6 flex flex-col items-center justify-center text-center gap-2"},Pw={class:"flex flex-wrap items-center justify-center gap-2"},Ow=["accept","multiple"],ra=Dt(e.defineComponent({name:"DCodeDropzone",__name:"DCodeDropzone",props:{label:{default:"Upload File"},hint:{default:"Drag & drop file di sini atau klik area ini"},accept:{default:"*/*"},maxSizeMb:{default:2},mode:{default:"single"},disabled:{type:Boolean,default:!1},showSelected:{type:Boolean,default:!0},error:{default:null}},emits:["picked","picked:multiple","error"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);e.computed(()=>o.accept||"file/*");const d=e.computed(()=>o.error??i.value);function u(){var y;o.disabled||(y=a.value)==null||y.click()}function f(y){const b=y/1024,C=b/1024;return C>=1?`${C.toFixed(2)} MB`:b>=1?`${b.toFixed(1)} KB`:`${y} B`}function m(y){var C;if(!y)return"File tidak valid";if((C=o.accept)!=null&&C.includes("image/")&&!y.type.startsWith("image/"))return"Hanya file gambar yang diizinkan";const b=(o.maxSizeMb??2)*1024*1024;return y.size>b?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null}function h(y){l.value=y.name,c.value=y.size}function p(y){if(i.value=null,!y.length)return;if(o.mode==="single"){const C=y[0],V=m(C);if(V){i.value=V,r("error",V);return}o.showSelected&&h(C),r("picked",C);return}const b=[];for(const C of y){const V=m(C);if(V){i.value=V,r("error",V);return}b.push(C)}b.length&&(o.showSelected&&h(b[0]),r("picked:multiple",b))}function k(y){const b=y.target,C=Array.from(b.files??[]);p(C),b.value=""}function x(){o.disabled||(s.value=!0)}function g(){o.disabled||(s.value=!0)}function S(){s.value=!1}function B(y){var V,D;if(o.disabled)return;s.value=!1;const b=Array.from(((V=y.dataTransfer)==null?void 0:V.files)??[]),C=(D=o.accept)!=null&&D.includes("image/")?b.filter(N=>N.type.startsWith("image/")):b;p(C)}const E=e.computed(()=>(o.accept||"file/*").split(",").map(y=>y.trim()).filter(Boolean).map(y=>y==="image/*"?"IMAGE":y.replace(/^image\//,"").replace(/^\./,"")).join(", "));e.computed(()=>`${o.maxSizeMb??0}MB`);const _=e.ref(!1),w=e.computed(()=>{if(o.disabled||!_.value)return{};const y=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark");return{borderColor:y?"hsl(var(--primary) / 0.5)":"hsl(var(--primary) / 0.6)",backgroundColor:y?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"}});return(y,b)=>(e.openBlock(),e.createBlock(e.unref($s),{class:e.normalizeClass([t.disabled?"opacity-60":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(e.unref(Us),{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(Ws),{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1})]),_:1}),e.createVNode(e.unref(js),{class:"pt-2"},{default:e.withCtx(()=>[e.createElementVNode("div",{class:e.normalizeClass(["d-dropzone-area flex justify-center items-center rounded-xl border-2 border-dashed transition cursor-pointer select-none",[s.value?"is-dragging border-primary bg-primary/10 dark:bg-primary/20 -translate-y-[1px]":"border-border dark:border-neutral-700 bg-muted/30 dark:bg-neutral-800/50",t.disabled?"is-disabled":""]]),style:e.normalizeStyle([{minHeight:"190px"},w.value]),onClick:u,onDragenter:e.withModifiers(x,["prevent"]),onDragover:e.withModifiers(g,["prevent"]),onDragleave:e.withModifiers(S,["prevent"]),onDrop:e.withModifiers(B,["prevent"]),onMouseenter:b[0]||(b[0]=C=>_.value=!0),onMouseleave:b[1]||(b[1]=C=>_.value=!1)},[e.createElementVNode("div",Tw,[b[2]||(b[2]=e.createElementVNode("div",{class:"text-sm font-medium dark:text-neutral-200"},"Drag & drop file di sini",-1)),b[3]||(b[3]=e.createElementVNode("div",{class:"text-xs text-muted-foreground dark:text-neutral-400"},"atau klik area ini untuk memilih file",-1)),e.createElementVNode("div",Pw,[e.createVNode(e.unref(Ls),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Allowed: "+e.toDisplayString(E.value),1)]),_:1}),e.createVNode(e.unref(Ls),{variant:"secondary",class:"text-[11px] dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(" Max: "+e.toDisplayString(o.maxSizeMb)+"MB ",1)]),_:1})]),t.showSelected&&l.value?(e.openBlock(),e.createBlock(e.unref(Ls),{key:0,variant:"secondary",class:"mt-2 dark:bg-neutral-800 dark:text-neutral-300"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value)+" • "+e.toDisplayString(c.value?f(c.value):""),1)]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("input",{ref_key:"fileInputEl",ref:a,type:"file",class:"hidden",accept:t.accept,multiple:t.mode==="multiple",onChange:k},null,40,Ow)],38),d.value?(e.openBlock(),e.createBlock(e.unref(Aw),{key:0,variant:"destructive",class:"mt-3"},{default:e.withCtx(()=>[e.createVNode(e.unref(Dw),{class:"text-sm"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value),1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["class"]))}}),[["__scopeId","data-v-d8943808"]]),vw={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},Fw=["src"],zw={key:1,class:"h-full w-full flex flex-col items-center justify-center text-muted-foreground dark:text-neutral-400 gap-2 p-4 text-center"},Rw={class:"space-y-0.5"},Iw={class:"text-sm font-medium truncate max-w-[180px] dark:text-neutral-200"},Lw={class:"text-xs opacity-70"},$w=["disabled"],jw={key:1},Uw=["disabled"],Ww={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},Hw={class:"flex gap-2"},qw={class:"font-medium truncate"},Gw={class:"flex gap-2"},Xw={class:"font-medium"},Kw={class:"flex gap-2"},Yw={class:"font-medium truncate"},Hs=Dt(e.defineComponent({name:"DCodeFileResult",__name:"DCodeFileResult",props:{file:{},title:{default:"File Terpilih"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0},forceFileIcon:{type:Boolean,default:!1}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null),s=e.computed(()=>o.forceFileIcon||!o.file?!1:(o.file.type||"").startsWith("image/"));e.watch(()=>o.file,h=>{a.value&&URL.revokeObjectURL(a.value),a.value=h?URL.createObjectURL(h):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),u&&u.disconnect()});function i(h){const p=h/1024,k=p/1024;return k>=1?`${k.toFixed(2)} MB`:p>=1?`${p.toFixed(1)} KB`:`${h} B`}const l=e.computed(()=>o.file?{name:o.file.name,size:i(o.file.size),type:o.file.type||"unknown"}:null),c=e.ref(!1),d=e.ref(!1);let u=null;const f=()=>{typeof document<"u"&&(d.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{f(),typeof document<"u"&&(u=new MutationObserver(f),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),u.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const m=e.computed(()=>o.disabled||!c.value?{}:{borderColor:d.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:d.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(h,p)=>t.file?(e.openBlock(),e.createBlock($s,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Us,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ws,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",vw,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(js,{class:"pt-2"},{default:e.withCtx(()=>{var k,x,g,S,B;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},m.value]),onMouseenter:p[2]||(p[2]=E=>c.value=!0),onMouseleave:p[3]||(p[3]=E=>c.value=!1)},[s.value&&a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,Fw)):(e.openBlock(),e.createElementBlock("div",zw,[e.createVNode(e.unref(le.FileText),{class:"w-10 h-10"}),e.createElementVNode("div",Rw,[e.createElementVNode("p",Iw,e.toDisplayString((k=l.value)==null?void 0:k.name),1),e.createElementVNode("p",Lw,e.toDisplayString((x=l.value)==null?void 0:x.size),1)])])),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:c.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:c.value?"auto":"none"})},[t.showEdit&&s.value?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[0]||(p[0]=E=>r("edit"))},[e.createVNode(e.unref(le.Pencil),{style:{width:"16px",height:"16px"}})],12,$w)):(e.openBlock(),e.createElementBlock("div",jw)),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:2,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s"}),onClick:p[1]||(p[1]=E=>r("remove"))},[e.createVNode(e.unref(le.Trash2),{style:{width:"16px",height:"16px"}})],12,Uw)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:c.value?1:0,transform:c.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:d.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:d.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",Ww,[e.createElementVNode("div",Hw,[p[4]||(p[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",qw,e.toDisplayString((g=l.value)==null?void 0:g.name),1)]),e.createElementVNode("div",Gw,[p[5]||(p[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",Xw,e.toDisplayString((S=l.value)==null?void 0:S.size),1)]),e.createElementVNode("div",Kw,[p[6]||(p[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",Yw,e.toDisplayString((B=l.value)==null?void 0:B.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-bb5c9599"]]);function qs(){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 Jw={class:"space-y-3"},Qw={key:1,class:"flex items-center justify-center p-6 border rounded-lg bg-muted/30 dark:bg-neutral-800/20 dark:border-neutral-800"},Hd=e.defineComponent({name:"DCodeFileField",inheritAttrs:!1,__name:"DCodeFileField",props:{modelValue:{default:null},label:{default:"Upload File"},hint:{},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:void 0},allowedTypes:{default:null},accept:{default:"*/*"},minSizeMb:{default:null},maxSizeMb:{default:1},endpoint:{},uploadFn:{}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:w=>r("update:modelValue",w)}),s=e.ref(null),i=e.ref(null);function l(w){i.value=w,r("error",w)}function c(){i.value=null}const d=e.computed(()=>{const w=(o.allowedTypes??"").trim();return w?w.split(/[,\s;]+/g).map(b=>b.trim().toLowerCase()).filter(Boolean).map(b=>b.includes("/")||b.startsWith(".")?b:`.${b}`):[]});function u(w){const y=w.lastIndexOf(".");return y>=0?w.slice(y).toLowerCase():""}const f=e.computed(()=>{if(d.value.length){const w=d.value.filter(b=>b.startsWith("."));return[...d.value.filter(b=>b.includes("/")),...w].join(",")}return o.accept}),m=e.computed(()=>d.value.length?d.value.join(", "):o.accept||"Semua File");function h(w){if(d.value.length){const y=(w.type||"").toLowerCase(),b=u(w.name);return d.value.some(C=>C.includes("/")?y===C:C.startsWith(".")?b===C:b===`.${C}`)}if(o.accept){if(o.accept==="*/*")return!0;const y=o.accept.split(",").map(V=>V.trim().toLowerCase()),b=(w.type||"").toLowerCase(),C=u(w.name);return y.some(V=>{if(V.endsWith("/*")){const D=V.slice(0,-2);return b.startsWith(D)}return V.startsWith(".")?C===V:b===V})}return!0}function p(w){return w*1024*1024}async function k(w){return w?h(w)?o.minSizeMb!=null&&w.size<p(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&w.size>p(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:null:`File Type not allowed. Allowed: ${m.value}`:"File tidak valid"}const{DCodeApi:x}=ct(),g=qs(),S=e.ref(!1);async function B(w){var y;if(o.uploadFn){try{S.value=!0;const b=await o.uploadFn(w);a.value=w,r("uploaded",b)}catch(b){console.error("Upload Error",b),g.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{S.value=!1}return}if(!((y=o.endpoint)!=null&&y.apiUrl)){a.value=w;return}if(typeof x!="function"){l("useApi() must expose DCodeApi()");return}try{S.value=!0;const b=new FormData;b.append("doc",w);const C=(o.endpoint.apiMethod||"POST").toUpperCase(),V=o.endpoint.apiUrl,D=await x("","",b,{_url:V,_method:C,withCredentials:!0,transformRequest:[(P,M)=>(M&&(delete M["Content-Type"],delete M["content-type"]),P)]}),N=(D==null?void 0:D.data)??D;a.value=w,r("uploaded",N)}catch(b){console.error("Upload Error",b),g.error("Upload Failed",(b==null?void 0:b.message)||"Unknown error"),l((b==null?void 0:b.message)||"Upload Failed")}finally{S.value=!1}}async function E(w){var b;if(o.disabled)return;c();const y=await k(w);if(y){l(y);return}s.value=w,o.uploadFn||(b=o.endpoint)!=null&&b.apiUrl?await B(w):a.value=w}function _(){c(),a.value=null,s.value=null}return e.watch(()=>o.modelValue,w=>{w&&!s.value&&(s.value=w),w||(s.value=null)},{immediate:!0}),(w,y)=>(e.openBlock(),e.createElementBlock("div",Jw,[a.value?S.value?(e.openBlock(),e.createElementBlock("div",Qw,[...y[1]||(y[1]=[e.createElementVNode("span",{class:"text-sm text-muted-foreground dark:text-neutral-400 animate-pulse"},"Uploading...",-1)])])):(e.openBlock(),e.createBlock(Hs,{key:2,file:a.value,title:t.label,description:t.hint,disabled:t.disabled,"show-edit":!1,"show-replace":!1,"show-remove":!0,"force-file-icon":!0,"preview-height":t.previewHeight,"preview-width":t.previewWidth,onRemove:_},null,8,["file","title","description","disabled","preview-height","preview-width"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:f.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled||S.value,onPicked:E,error:i.value,onError:y[0]||(y[0]=b=>l(b))},null,8,["label","hint","accept","maxSizeMb","disabled","error"]))]))}}),Zw=["for"],e1={key:0,class:"!ml-1 !text-destructive"},t1={class:"relative w-full block box-border"},n1={key:0,class:"absolute inset-y-0 left-3 flex items-center text-muted-foreground pointer-events-none z-10"},o1=["id","readonly","disabled","placeholder"],r1={class:"absolute inset-y-0 right-4 flex items-center z-10"},a1={key:1,class:"absolute z-50 mt-1 w-full rounded-xl border bg-white dark:bg-neutral-800 border-neutral-200/60 dark:border-neutral-700/50 shadow-lg box-border"},s1={key:0,class:"flex items-center justify-center py-10 text-muted-foreground gap-2"},i1={key:1,class:"text-sm text-muted-foreground text-center"},l1=["onClick","title"],c1={class:"flex flex-col items-center justify-between gap-2 py-1 min-h-[72px]"},d1={class:"flex items-center justify-center flex-1"},u1={class:"text-[10px] leading-tight text-muted-foreground truncate w-full text-center block flex-shrink-0"},f1={key:3,class:"pt-2 text-[11px] text-muted-foreground text-center"},qd=e.defineComponent({name:"DCodeIconDropdown",__name:"DCodeIconDropdown",props:{modelValue:{},label:{},placeholder:{default:"Pilih icon…"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},columns:{default:4},maxHeight:{default:"335px"},iconSize:{default:20},pageSize:{default:120}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=t,r=n,a=$t,s=e.ref(null),i=e.ref(null),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`dcode-icon-dropdown-${o.label||"icon-dropdown"}-${l}`),d=e.ref(!1),u=e.computed(()=>(o.modelValue??"").trim()||""),f=e.ref(""),m=e.ref(!1),h=e.ref(!1),p=e.ref(!1),k=e.shallowRef([]),x=e.ref(o.pageSize),g=new Set(["default","createLucideIcon","LucideIcon","Icon","icons","toKebabCase","camelCase","children","IconNode"]),S=async()=>{if(h.value||p.value)return;p.value=!0,await new Promise(L=>setTimeout(L,0));const T=Object.keys(a).filter(L=>!g.has(L)).filter(L=>/^[A-Z]/.test(L)).filter(L=>typeof a[L]=="function"||typeof a[L]=="object"&&a[L]).sort((L,Z)=>L.localeCompare(Z));k.value=T,h.value=!0,p.value=!1},B=e.computed(()=>!h.value||!u.value||!k.value.includes(u.value)?null:a[u.value]),E=e.ref(u.value),_=e.computed(()=>!!u.value&&!d.value),w=e.computed(()=>{if(!h.value)return[];const T=(f.value??"").trim().toLowerCase();return T?k.value.filter(L=>L.toLowerCase().includes(T)):k.value}),y=e.computed(()=>w.value.slice(0,x.value)),b=e.computed(()=>{const T=o.columns;return T<=2?"grid-cols-2":T===3?"grid-cols-3":T===4?"grid-cols-4":T===5?"grid-cols-5":T>=8?"grid-cols-8":"grid-cols-6"});e.computed(()=>o.clearable?"!pr-10":"!pr-3"),e.computed(()=>B.value&&!d.value?"!pl-12":"!pl-3");const C=async()=>{var T;await e.nextTick(),(T=i.value)==null||T.focus()},V=async T=>{if(o.disabled)return;const L=T!==!1;if(m.value){m.value=!1;return}d.value=!0,await S(),L&&(f.value="",E.value=""),x.value=o.pageSize,await C()},D=()=>{d.value=!1,f.value="",E.value=u.value,x.value=o.pageSize},N=async()=>{o.disabled||(d.value?D():await V())};let P=null;const M=async T=>{if(o.disabled)return;r("update:modelValue",null),d.value||await V(!1),P&&clearTimeout(P);const L=E.value;P=setTimeout(()=>{f.value=L},300)},X=T=>{o.disabled||(r("update:modelValue",T),D(),queueMicrotask(()=>{var L;return(L=i.value)==null?void 0:L.blur()}))},$=()=>{o.disabled||(r("update:modelValue",null),r("clear"),m.value=!0,D(),queueMicrotask(()=>{var T;return(T=i.value)==null?void 0:T.focus()}))},H=T=>{if(T.key==="Escape"){T.preventDefault(),D();return}if(T.key==="Enter"&&d.value){const L=w.value[0];L&&(T.preventDefault(),X(L))}},J=T=>{if(!d.value)return;const L=T.target;s.value&&!s.value.contains(L)&&D()},te=T=>{const L=T.target;L.scrollTop+L.clientHeight>=L.scrollHeight-24&&x.value<w.value.length&&(x.value=Math.min(x.value+o.pageSize,w.value.length))};return e.onMounted(()=>{document.addEventListener("mousedown",J),queueMicrotask(()=>{var T;i.value=((T=s.value)==null?void 0:T.querySelector("input"))??null}),u.value&&S()}),e.onBeforeUnmount(()=>{document.removeEventListener("mousedown",J),P&&clearTimeout(P)}),e.watch(u,T=>{d.value||(E.value=T)}),e.watch(()=>f.value,()=>{x.value=o.pageSize}),(T,L)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"rootEl",ref:s,class:"!w-full !block !box-border"},[o.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"!text-sm !font-medium !mb-1 !block"},[e.createTextVNode(e.toDisplayString(o.label)+" ",1),o.required?(e.openBlock(),e.createElementBlock("span",e1,"*")):e.createCommentVNode("",!0)],8,Zw)):e.createCommentVNode("",!0),e.createElementVNode("div",t1,[B.value&&!d.value?(e.openBlock(),e.createElementBlock("div",n1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(B.value),{size:18}))])):e.createCommentVNode("",!0),e.withDirectives(e.createElementVNode("input",{id:c.value,"onUpdate:modelValue":L[0]||(L[0]=Z=>E.value=Z),readonly:_.value,disabled:o.disabled,placeholder:o.placeholder,class:e.normalizeClass(["w-full h-10 m-0 py-0 rounded-lg border bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 pr-10 outline-none box-border truncate",[B.value&&!d.value?"pl-10":"pl-4",_.value?"cursor-pointer select-none":""]]),onClick:V,onFocus:V,onInput:M,onKeydown:H},null,42,o1),[[e.vModelText,E.value]]),e.createElementVNode("div",r1,[o.clearable&&u.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition cursor-pointer outline-none",onMousedown:L[1]||(L[1]=e.withModifiers(()=>{},["prevent"])),onClick:$,title:"Clear"},[e.createVNode(e.unref(le.X),{class:"h-4 w-4"})],32)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"flex items-center justify-center p-1 m-0 bg-transparent border-0 text-muted-foreground hover:text-foreground transition-transform cursor-pointer outline-none",onMousedown:L[2]||(L[2]=e.withModifiers(()=>{},["prevent"])),onClick:N,title:"Open"},[e.createVNode(e.unref(le.ChevronDown),{class:"h-4 w-4"})],32))]),d.value?(e.openBlock(),e.createElementBlock("div",a1,[e.createElementVNode("div",{class:"p-2 overflow-auto",style:e.normalizeStyle({maxHeight:o.maxHeight}),onScroll:te},[p.value?(e.openBlock(),e.createElementBlock("div",s1,[e.createVNode(e.unref(le.Loader2),{class:"h-4 w-4 animate-spin"}),L[3]||(L[3]=e.createElementVNode("span",{class:"text-sm"},"Loading icons…",-1))])):h.value&&w.value.length===0?(e.openBlock(),e.createElementBlock("div",i1," Icon tidak ditemukan ")):(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["grid gap-2",b.value])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,Z=>(e.openBlock(),e.createElementBlock("button",{key:Z,type:"button",class:e.normalizeClass(["group rounded-lg border p-2 hover:bg-muted/40 transition",u.value===Z?"ring-1 ring-primary":""]),onClick:Q=>X(Z),title:Z},[e.createElementVNode("div",c1,[e.createElementVNode("div",d1,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(a)[Z]),{size:o.iconSize,class:"shrink-0"},null,8,["size"]))]),e.createElementVNode("span",u1,e.toDisplayString(Z),1)])],10,l1))),128))],2)),h.value&&w.value.length>0?(e.openBlock(),e.createElementBlock("div",f1," Showing "+e.toDisplayString(y.value.length)+" / "+e.toDisplayString(w.value.length),1)):e.createCommentVNode("",!0)],36)])):e.createCommentVNode("",!0)])],512))}}),m1={key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6"},h1={class:"flex items-center justify-between border-b dark:border-neutral-700/50 px-6 py-4"},p1={class:"relative overflow-auto p-0"},Gs=e.defineComponent({name:"DCodeImageCropperDialog",inheritAttrs:!1,__name:"DCodeImageCropperDialog",props:{modelValue:{type:Boolean},file:{},title:{default:"Resize & Crop Gambar"},description:{default:""},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!1}},emits:["update:modelValue","done","cancel"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:B=>r("update:modelValue",B)}),s=e.ref(null),i=e.ref(null);let l=null,c=!1,d=0,u=null;function f(){if(l){try{l.close()}catch{}l=null,u&&(u.disconnect(),u=null),s.value&&(s.value.innerHTML=""),i.value=null}}async function m(B,E,_,w,y){const b=await new Promise((D,N)=>{const P=URL.createObjectURL(B),M=new Image;M.onload=()=>{URL.revokeObjectURL(P),D(M)},M.onerror=X=>{URL.revokeObjectURL(P),N(X)},M.src=P}),C=document.createElement("canvas");C.width=E,C.height=_;const V=C.getContext("2d");return V?(V.drawImage(b,0,0,E,_),await new Promise(D=>{C.toBlob(N=>D(N||B),w,y)})):B}function h(){if(!l||!i.value)return;const B=l.getPlugin("Dashboard"),E=l.getFile(i.value);!B||!E||requestAnimationFrame(()=>{try{B.openFileEditor(E)}catch{try{B.openFileEditor(i.value)}catch{}}})}async function p(B){if(l){l.cancelAll(),i.value=null;try{const E=l.addFile({name:B.name,type:B.type,data:B,source:"Local",isRemote:!1});i.value=String(E)}catch{}}}function k(){if(!s.value)return;l&&f(),l=new xu({autoProceed:!1,restrictions:{maxNumberOfFiles:1,allowedFileTypes:["image/*"]}});const B=document.documentElement.classList.contains("dark");l.use(hi,{target:s.value,inline:!0,height:480,theme:B?"dark":"light",proudlyDisplayPoweredByUppy:!1,hideUploadButton:!0,hideRetryButton:!0,hidePauseResumeButton:!0,hideCancelButton:!0,showProgressDetails:!1}),u=new MutationObserver(()=>{if(!l)return;const E=document.documentElement.classList.contains("dark"),_=l.getPlugin("Dashboard");_&&_.setOptions({theme:E?"dark":"light"})}),u.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),l.use(ku,{target:hi,quality:o.quality,cropperOptions:{viewMode:1,dragMode:"move",autoCropArea:1,aspectRatio:o.aspectRatio==null?Number.NaN:o.aspectRatio}}),l.on("file-editor:cancel",()=>{a.value=!1}),l.on("file-added",E=>{i.value=(E==null?void 0:E.id)??null,o.autoOpenEditor&&setTimeout(()=>h(),80)}),l.on("file-editor:complete",async E=>{const _=++d;try{const w=E.data,y=w.type||E.type||"image/jpeg";let b=w;if(o.outputWidth&&o.outputHeight&&(b=await m(w,o.outputWidth,o.outputHeight,y,o.quality)),c||_!==d)return;const C=E.name||"edited-image.jpg",V=new File([b],C,{type:y});await x(V,"UPPY_EDITOR_COMPLETE"),r("done",V),a.value=!1}catch{}})}async function x(B,E="CROP_RESULT"){const _=URL.createObjectURL(B);try{const w=await new Promise((y,b)=>{const C=new Image;C.onload=()=>y(C),C.onerror=b,C.src=_});console.group(E),console.log("file:",B),console.table({name:B.name,type:B.type,sizeBytes:B.size,sizeMB:+(B.size/1024/1024).toFixed(3),width:w.naturalWidth,height:w.naturalHeight,ratio:+(w.naturalWidth/w.naturalHeight).toFixed(4)}),console.log("previewUrl:",_),console.groupEnd()}finally{URL.revokeObjectURL(_)}}e.watch(a,async B=>{c=!B,d++,B?(await e.nextTick(),k(),o.file&&await p(o.file)):f()},{flush:"post"}),e.watch(()=>o.file,async B=>{a.value&&B&&(await e.nextTick(),await p(B))}),e.onBeforeUnmount(()=>{c=!0,d++,f()});const g=B=>{B.key==="Escape"&&a.value&&(a.value=!1)};e.watch(a,B=>{B?globalThis.addEventListener("keydown",g):globalThis.removeEventListener("keydown",g)},{immediate:!0});const S=e.ref(!1);return(B,E)=>a.value?(e.openBlock(),e.createElementBlock("div",m1,[e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm transition-opacity",onClick:E[0]||(E[0]=_=>a.value=!1)})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"duration-300 ease-out","enter-from-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-active-class":"duration-200 ease-in","leave-from-class":"opacity-100 scale-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 scale-95 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"relative flex w-fit max-w-4xl flex-col overflow-hidden rounded-xl border border-border dark:border-neutral-700/50 bg-background dark:bg-neutral-800 shadow-2xl transition-all",onClick:E[4]||(E[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",h1,[E[6]||(E[6]=e.createElementVNode("h3",{class:"text-lg font-semibold leading-none tracking-tight dark:text-neutral-100"}," Crop & Resize ",-1)),e.createElementVNode("button",{class:"d-close-btn rounded-sm dark:text-neutral-400 ring-offset-background transition-opacity focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",style:e.normalizeStyle({opacity:S.value?1:.7}),onClick:E[1]||(E[1]=_=>a.value=!1),onMouseenter:E[2]||(E[2]=_=>S.value=!0),onMouseleave:E[3]||(E[3]=_=>S.value=!1)},[e.createVNode(e.unref(le.X),{class:"h-4 w-4"}),E[5]||(E[5]=e.createElementVNode("span",{class:"sr-only"},"Close",-1))],36)]),e.createElementVNode("div",p1,[e.createElementVNode("div",{ref_key:"dashboardEl",ref:s,class:"uppy-wrap"},null,512)])])):e.createCommentVNode("",!0)]),_:1})])):e.createCommentVNode("",!0)}}),g1={key:0,class:"text-xs text-muted-foreground dark:text-neutral-400"},b1=["src"],y1=["disabled"],x1=["disabled"],k1={class:"text-[11px] text-foreground/90 dark:text-neutral-200 space-y-1 whitespace-nowrap"},w1={class:"flex gap-2"},C1={class:"font-medium truncate"},E1={class:"flex gap-2"},B1={class:"font-medium"},_1={class:"flex gap-2"},S1={class:"font-medium truncate"},Xs=Dt(e.defineComponent({name:"DCodeImageResult",__name:"DCodeImageResult",props:{file:{},title:{default:"Hasil Gambar"},description:{default:""},disabled:{type:Boolean,default:!1},previewHeight:{default:190},previewWidth:{default:220},showEdit:{type:Boolean,default:!0},showReplace:{type:Boolean,default:!0},showRemove:{type:Boolean,default:!0}},emits:["edit","replace","remove"],setup(t,{emit:n}){const o=t,r=n,a=e.ref(null);e.watch(()=>o.file,m=>{a.value&&URL.revokeObjectURL(a.value),a.value=m?URL.createObjectURL(m):null},{immediate:!0}),e.onBeforeUnmount(()=>{a.value&&URL.revokeObjectURL(a.value),d&&d.disconnect()});function s(m){const h=m/1024,p=h/1024;return p>=1?`${p.toFixed(2)} MB`:h>=1?`${h.toFixed(1)} KB`:`${m} B`}const i=e.computed(()=>o.file?{name:o.file.name,size:s(o.file.size),type:o.file.type||"unknown"}:null),l=e.ref(!1),c=e.ref(!1);let d=null;const u=()=>{typeof document<"u"&&(c.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{u(),typeof document<"u"&&(d=new MutationObserver(u),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),d.observe(document.body,{attributes:!0,attributeFilter:["class"]}))});const f=e.computed(()=>o.disabled||!l.value?{}:{borderColor:c.value?"hsl(var(--primary) / 0.4)":"hsl(var(--primary) / 0.5)",backgroundColor:c.value?"hsl(var(--primary) / 0.1)":"hsl(var(--primary) / 0.05)"});return(m,h)=>t.file?(e.openBlock(),e.createBlock($s,{key:0,class:e.normalizeClass([t.disabled?"opacity-60 pointer-events-none":"","dark:bg-neutral-800 dark:border-neutral-700/50"])},{default:e.withCtx(()=>[e.createVNode(Us,{class:"pb-2"},{default:e.withCtx(()=>[e.createVNode(Ws,{class:"text-sm font-semibold dark:text-neutral-100"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.title),1)]),_:1}),t.description?(e.openBlock(),e.createElementBlock("div",g1,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(js,{class:"pt-2"},{default:e.withCtx(()=>{var p,k,x;return[e.createElementVNode("div",{class:"d-result-preview-wrap relative rounded-xl overflow-hidden border-2 border-dashed transition-colors duration-200 bg-muted dark:bg-neutral-900/30 border-border dark:border-neutral-700/50 w-full",style:e.normalizeStyle([{height:`${t.previewHeight}px`},f.value]),onMouseenter:h[2]||(h[2]=g=>l.value=!0),onMouseleave:h[3]||(h[3]=g=>l.value=!1)},[a.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.value,alt:"Preview",class:"h-full w-full object-contain"},null,8,b1)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"d-action-buttons",style:e.normalizeStyle({position:"absolute",top:"8px",left:"8px",right:"8px",display:"flex",alignItems:"center",justifyContent:"space-between",zIndex:50,opacity:l.value?1:0,transition:"opacity 0.2s ease-in-out",pointerEvents:l.value?"auto":"none"})},[t.showEdit?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#eab308",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:h[0]||(h[0]=g=>r("edit"))},[e.createVNode(e.unref(le.Pencil),{style:{width:"16px",height:"16px"}})],12,y1)):e.createCommentVNode("",!0),t.showRemove?(e.openBlock(),e.createElementBlock("button",{key:1,disabled:t.disabled,class:"d-action-btn shadow-md",style:e.normalizeStyle({height:"32px",width:"32px",display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"#ef4444",color:"white",borderRadius:"8px",border:"1px solid rgba(255,255,255,0.4)",cursor:t.disabled?"not-allowed":"pointer",transition:"all 0.2s",boxShadow:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"}),onClick:h[1]||(h[1]=g=>r("remove"))},[e.createVNode(e.unref(le.Trash2),{style:{width:"16px",height:"16px"}})],12,x1)):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"d-metadata-overlay",style:e.normalizeStyle({position:"absolute",left:"8px",bottom:"8px",zIndex:10,display:"inline-block",maxWidth:"calc(100% - 16px)",borderRadius:"12px",border:"1px solid rgba(0,0,0,0.1)",padding:"8px 12px",boxShadow:"0 10px 15px -3px rgba(0,0,0,0.1)",backdropFilter:"blur(8px)",transition:"all 0.2s ease-in-out",opacity:l.value?1:0,transform:l.value?"translateY(0) scale(1)":"translateY(4px) scale(0.99)",backgroundColor:c.value?"rgba(38, 38, 38, 0.8)":"rgba(255, 255, 255, 0.8)",color:c.value?"#e5e5e5":"#171717"})},[e.createElementVNode("div",k1,[e.createElementVNode("div",w1,[h[4]||(h[4]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Nama",-1)),e.createElementVNode("span",C1,e.toDisplayString((p=i.value)==null?void 0:p.name),1)]),e.createElementVNode("div",E1,[h[5]||(h[5]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Ukuran",-1)),e.createElementVNode("span",B1,e.toDisplayString((k=i.value)==null?void 0:k.size),1)]),e.createElementVNode("div",_1,[h[6]||(h[6]=e.createElementVNode("span",{class:"w-14 shrink-0 text-muted-foreground dark:text-neutral-400"},"Tipe",-1)),e.createElementVNode("span",S1,e.toDisplayString((x=i.value)==null?void 0:x.type),1)])])],4)],36)]}),_:1})]),_:1},8,["class"])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-e1d893ab"]]),V1={class:"space-y-3"},aa=e.defineComponent({name:"DCodeImageField",inheritAttrs:!1,__name:"DCodeImageField",props:{modelValue:{default:null},label:{default:"Upload Gambar"},hint:{default:"Drag & drop atau klik area ini"},disabled:{type:Boolean,default:!1},allowedTypes:{default:null},accept:{default:"image/*"},minSizeMb:{default:null},maxSizeMb:{default:1},title:{default:"Hasil Gambar"},description:{default:""},previewWidth:{default:360},previewHeight:{default:220},aspectRatio:{default:null},outputWidth:{default:null},outputHeight:{default:null},quality:{default:.92},autoOpenEditor:{type:Boolean,default:!0},minWidth:{default:null},minHeight:{default:null},maxWidth:{default:null},maxHeight:{default:null},endpoint:{},uploadFn:{},editUseOriginal:{type:Boolean,default:!1}},emits:["update:modelValue","error","uploaded"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:$=>r("update:modelValue",$)}),s=e.ref(!1),i=e.ref(null),l=e.ref(null),c=e.ref(null);function d($){c.value=$,r("error",$)}function u(){c.value=null}const f=e.computed(()=>{const $=(o.allowedTypes??"").trim();return $?$.split(/[,\s;]+/g).map(J=>J.trim().toLowerCase()).filter(Boolean).map(J=>J.includes("/")||J.startsWith(".")?J:`.${J}`):[]});function m($){const H=$.lastIndexOf(".");return H>=0?$.slice(H).toLowerCase():""}const h=e.computed(()=>{if(f.value.length){const $=f.value.filter(J=>J.startsWith("."));return[...f.value.filter(J=>J.includes("/")),...$].join(",")}return o.accept||"image/*"}),p=e.computed(()=>f.value.length?f.value.join(", "):o.accept||"image/*");function k($){if(f.value.length){const J=($.type||"").toLowerCase(),te=m($.name);return f.value.some(T=>T.includes("/")?J===T:T.startsWith(".")?te===T:te===`.${T}`)}return(o.accept||"image/*").toLowerCase().includes("image/")?($.type||"").toLowerCase().startsWith("image/"):!0}function x($){return $*1024*1024}async function g($){var H;return(H=$.type)!=null&&H.startsWith("image/")?await new Promise(J=>{const te=URL.createObjectURL($),T=new Image;T.onload=()=>{URL.revokeObjectURL(te),J({w:T.naturalWidth,h:T.naturalHeight})},T.onerror=()=>{URL.revokeObjectURL(te),J(null)},T.src=te}):null}async function S($){if(!(o.minWidth!=null||o.minHeight!=null||o.maxWidth!=null||o.maxHeight!=null))return null;const J=await g($);return J?o.minWidth!=null&&J.w<o.minWidth?`Lebar gambar minimal ${o.minWidth}px`:o.minHeight!=null&&J.h<o.minHeight?`Tinggi gambar minimal ${o.minHeight}px`:o.maxWidth!=null&&J.w>o.maxWidth?`Lebar gambar maksimal ${o.maxWidth}px`:o.maxHeight!=null&&J.h>o.maxHeight?`Tinggi gambar maksimal ${o.maxHeight}px`:null:"Gagal membaca dimensi gambar"}async function B($){return $?k($)?o.minSizeMb!=null&&$.size<x(o.minSizeMb)?`Ukuran file terlalu kecil. Minimal ${o.minSizeMb}MB`:o.maxSizeMb!=null&&$.size>x(o.maxSizeMb)?`Ukuran file terlalu besar. Maks ${o.maxSizeMb}MB`:await S($):`only Allowed: ${p.value}`:"File tidak valid"}function E($){o.disabled||(i.value=$,s.value=!0)}async function _($){if(o.disabled)return;u();const H=await B($);if(H){d(H);return}l.value=$,E($)}const{DCodeApi:w}=ct(),y=qs(),b=e.ref(!1);e.ref(null);function C($,H){return!$||!H?null:$.replace(/\/+$/,"")+"/"+H.replace(/^\/+/,"")}function V($){var T;const H=($==null?void 0:$.data)??$,J=(T=H==null?void 0:H.data)==null?void 0:T[0];if(!J)return null;const te=C(J.server,J.url);return{...J,fullUrl:te?encodeURI(te):null}}async function D($){var H;if(o.uploadFn){try{b.value=!0;const J=await o.uploadFn($);a.value=$,r("uploaded",J)}catch(J){console.error("Upload Error",J),y.error("Upload Failed",(J==null?void 0:J.message)||"Unknown error"),d((J==null?void 0:J.message)||"Upload Failed")}finally{b.value=!1}return}if(!((H=o.endpoint)!=null&&H.apiUrl)){a.value=$;return}if(typeof w!="function"){d("useApi() must expose DCodeApi()");return}try{b.value=!0;const J=new FormData;J.append("doc",$);const te=(o.endpoint.apiMethod||"POST").toUpperCase(),T=o.endpoint.apiUrl,L=await w("","",J,{_url:T,_method:te,withCredentials:!0,transformRequest:[(Q,W)=>(W&&(delete W["Content-Type"],delete W["content-type"]),Q)]}),Z=(L==null?void 0:L.data)??L;V(Z),a.value=$,r("uploaded",Z)}catch(J){console.error("Upload Error",J),y.error("Upload Failed",(J==null?void 0:J.message)||"Unknown error"),d((J==null?void 0:J.message)||"Upload Failed")}finally{b.value=!1}}async function N($){var H;u(),o.uploadFn||(H=o.endpoint)!=null&&H.apiUrl?await D($):a.value=$,s.value=!1,i.value=null}function P(){s.value=!1,i.value=null}async function M(){if(!a.value)return;u();const $=o.editUseOriginal?l.value??a.value:a.value,H=await B($);if(H){d(H);return}E($)}function X(){u(),a.value=null,i.value=null,s.value=!1,l.value=null}return e.watch(()=>o.modelValue,$=>{$&&!l.value&&(l.value=$),$||(l.value=null)},{immediate:!0}),($,H)=>(e.openBlock(),e.createElementBlock("div",V1,[a.value?(e.openBlock(),e.createBlock(Xs,{key:1,file:a.value,title:t.label,description:t.description,"preview-width":t.previewWidth,disabled:t.disabled,"show-edit":!0,"show-remove":!0,"show-replace":!1,onEdit:M,onRemove:X,"aspect-ratio":16/9},null,8,["file","title","description","preview-width","disabled"])):(e.openBlock(),e.createBlock(ra,{key:0,label:t.label,hint:t.hint,accept:h.value,maxSizeMb:t.maxSizeMb,disabled:t.disabled,onPicked:_,error:c.value,onError:H[0]||(H[0]=J=>d(J))},null,8,["label","hint","accept","maxSizeMb","disabled","error"])),e.createVNode(Gs,{modelValue:s.value,"onUpdate:modelValue":H[1]||(H[1]=J=>s.value=J),file:i.value,title:t.title,description:t.description,"auto-open-editor":t.autoOpenEditor,"aspect-ratio":t.aspectRatio,"output-width":t.outputWidth,"output-height":t.outputHeight,quality:t.quality,onDone:N,onCancel:P},null,8,["modelValue","file","title","description","auto-open-editor","aspect-ratio","output-width","output-height","quality"])]))}}),A1=["aria-busy"],D1={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},N1=["for"],M1={key:0,class:"ml-1 text-destructive"},T1=["id","disabled"],P1={class:"min-w-0 flex-1 text-left"},O1={key:0,class:"flex flex-wrap gap-1.5"},v1={class:"max-w-[220px] truncate"},F1=["onClick"],z1={key:0,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent"},R1={key:1,class:"text-muted-foreground truncate"},I1={class:"flex items-center gap-2 shrink-0"},L1={key:0,class:"p-2 border-b border-gray-200 dark:border-gray-800"},$1=["placeholder","onKeydown"],j1={key:0,class:"h-full flex items-center justify-center px-3 text-sm text-muted-foreground"},U1=["disabled","onClick"],W1={class:"truncate"},H1={key:0,class:"text-primary-600 dark:text-primary-400"},q1={key:1,class:"h-full flex items-center justify-center text-sm text-muted-foreground"},G1={key:0},X1={key:1},K1={key:1,class:"text-xs text-destructive"},Ks=e.defineComponent({name:"DCodeMultiSelect",inheritAttrs:!1,__name:"DCodeMultiSelect",props:{modelValue:{},items:{default:()=>[]},endpoint:{default:void 0},fetchItems:{},autoFetchOnOpen:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!1},refreshOnOpen:{type:Boolean,default:!1},label:{default:""},placeholder:{default:"Pilih data…"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},searchPlaceholder:{default:"Cari…"},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},maxChips:{default:5},maxSelected:{default:5},itemTitle:{type:[String,Function],default:"name"},itemValue:{type:[String,Function],default:"id"},returnObject:{type:Boolean,default:!1},virtual:{type:Boolean,default:!0},itemHeight:{default:40},maxRows:{default:5},overscan:{default:6},error:{default:null},required:{type:Boolean,default:!1}},emits:["update:modelValue","clear","max"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>(a.label||o.label)??void 0),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-multiselect-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{if(a.required)return!0;const ne=o.required,ce=o["aria-required"];return ne===""||ne===!0||ne==="true"||(ce==="true"||ce===!0)}),u=e.computed(()=>!!a.error);function f(ne){return ne?typeof a.itemTitle=="function"?a.itemTitle(ne)??"":String((ne==null?void 0:ne[a.itemTitle])??""):""}function m(ne){return ne?typeof a.itemValue=="function"?a.itemValue(ne):ne==null?void 0:ne[a.itemValue]:null}function h(ne,ce){return m(ne)??ce}const p=e.computed(()=>Array.isArray(a.modelValue)?a.modelValue:[]),k=e.computed(()=>{var ne;return!!((ne=a.endpoint)!=null&&ne.apiUrl)||!!a.fetchItems}),x=e.ref([]),g=e.ref(!1),S=e.ref(!1),B=e.computed(()=>{var ce;const ne=(ce=a.endpoint)==null?void 0:ce.apiOptions;if(ne)return typeof ne=="function"?ne():ne}),E=e.computed(()=>{var Se,et;const ne=((Se=a.endpoint)==null?void 0:Se.apiUrl)??"",ce=(((et=a.endpoint)==null?void 0:et.apiMethod)??"GET").toUpperCase(),he=JSON.stringify(B.value??null);return`${ce} ${ne} :: ${he}`}),_=e.computed(()=>k.value?x.value:a.items||[]);async function w(){var ne;if(k.value&&!(!((ne=a.endpoint)!=null&&ne.apiUrl)&&!a.fetchItems)&&!g.value){g.value=!0;try{let ce;if(a.fetchItems){const he=await a.fetchItems(),Se=(he==null?void 0:he.data)??he;ce=(Se==null?void 0:Se.data)??Se}else{const{DCodeApi:he}=ct();if(typeof he!="function"){console.error("[DCodeMultiSelectChips] useApi() must expose DCodeApi()");return}const Se={page:1,perPage:100,...B.value||{}},et=await he("","",Se,{_url:a.endpoint.apiUrl,_method:(a.endpoint.apiMethod||"GET").toUpperCase()}),St=(et==null?void 0:et.data)??et;ce=(St==null?void 0:St.data)??St}x.value=Array.isArray(ce)?ce:[],S.value=!0}catch(ce){console.error("[DCodeMultiSelectChips][fetchOptions] ERROR:",ce),x.value=[]}finally{g.value=!1}}}e.watch(()=>E.value,()=>{x.value=[],S.value=!1}),e.onMounted(()=>{a.autoFetchOnMount&&k.value&&w()});const y=e.computed(()=>{const ne=p.value;if(a.returnObject)return ne;const ce=new Map;for(const he of _.value)ce.set(m(he),he);return ne.map(he=>ce.get(he)??{[a.itemValue]:he,[a.itemTitle]:String(he)})}),b=e.computed(()=>a.maxChips===null?y.value:y.value.slice(0,a.maxChips));function C(ne){const ce=p.value;if(a.returnObject){const he=m(ne);return ce.some(Se=>m(Se)===he)}return ce.includes(m(ne))}const V=e.computed(()=>{if(a.maxSelected===null||a.maxSelected===void 0)return null;const ne=Number(a.maxSelected);return Number.isFinite(ne)&&ne>0?ne:null}),D=e.computed(()=>{const ne=V.value;return ne===null?!1:p.value.length>=ne});function N(ne){return!C(ne)&&D.value}const P=e.computed(()=>{const ne=p.value,ce=new Set;if(a.returnObject)for(const he of ne)ce.add(m(he));else for(const he of ne)ce.add(he);return ce}),M=e.computed(()=>{const ne=P.value;return(_.value||[]).filter(ce=>!ne.has(m(ce)))}),X=e.computed(()=>_.value.length===0?!1:M.value.length===0),$=e.ref(null),H=e.ref(null),J=e.ref(null),te=e.ref(!1),T=e.ref(""),L=e.ref(0),Z=e.ref(0),{floatingStyles:Q}=La($,H,{whileElementsMounted:va,placement:"bottom-start",middleware:[Fa(8),Ra(),za({padding:8}),Ia({apply({rects:ne,elements:ce}){Object.assign(ce.floating.style,{width:`${ne.reference.width}px`,"--floating-width":`${ne.reference.width}px`})}})]}),W=e.computed(()=>Q.value),ie=e.computed(()=>{const ne=Number(a.maxRows);return Number.isFinite(ne)&&ne>0?ne:5});async function de(){a.disabled||(te.value=!0,Z.value=0,requestAnimationFrame(()=>{J.value&&(J.value.scrollTop=0),L.value=0}),k.value&&a.autoFetchOnOpen&&(a.refreshOnOpen||!S.value)&&!g.value&&await w())}function Ce(){te.value=!1}function Ne(){te.value?Ce():de()}function ge(ne){var he,Se;if(!te.value)return;const ce=ne.target;(he=$.value)!=null&&he.contains(ce)||(Se=H.value)!=null&&Se.contains(ce)||Ce()}e.onMounted(()=>document.addEventListener("mousedown",ge)),e.onBeforeUnmount(()=>document.removeEventListener("mousedown",ge));function Y(ne){if(a.disabled)return;if(N(ne)){r("max");return}const ce=[...p.value];if(a.returnObject){const he=m(ne);if(ce.some(et=>m(et)===he))return;r("update:modelValue",[...ce,ne])}else{const he=m(ne);if(ce.includes(he))return;r("update:modelValue",[...ce,he])}T.value="",Z.value=0,requestAnimationFrame(()=>{J.value&&(J.value.scrollTop=0),L.value=0})}function v(ne){if(a.disabled)return;const ce=[...p.value];if(a.returnObject){const he=m(ne);r("update:modelValue",ce.filter(Se=>m(Se)!==he))}else{const he=m(ne);r("update:modelValue",ce.filter(Se=>Se!==he))}}function K(){a.disabled||(r("update:modelValue",[]),r("clear"),Ce())}const re=e.computed(()=>{const ne=T.value.trim().toLowerCase(),ce=M.value;return ne?ce.filter(he=>f(he).toLowerCase().includes(ne)):ce}),_e=e.computed(()=>re.value.length);e.watch(te,ne=>{ne||(T.value="")});const Re=e.computed(()=>{if(X.value)return a.itemHeight;const ne=_e.value;return(ne<=0?1:Math.min(ne,ie.value))*a.itemHeight}),ze=e.computed(()=>a.virtual?_e.value*a.itemHeight:0),He=e.computed(()=>a.virtual?Math.ceil(Re.value/a.itemHeight)+a.overscan:_e.value),Xe=e.computed(()=>{if(!a.virtual)return 0;const ne=Math.floor(L.value/a.itemHeight)-Math.floor(a.overscan/2);return Math.max(0,ne)}),ot=e.computed(()=>a.virtual?Math.min(_e.value,Xe.value+He.value):_e.value),Ie=e.computed(()=>a.virtual?Xe.value*a.itemHeight:0),mt=e.computed(()=>{const ne=re.value;return a.virtual?ne.slice(Xe.value,ot.value):ne});function pt(ne){const ce=ne.target;L.value=ce.scrollTop}function Tt(ne){return ne===Z.value}function q(ne){const ce=J.value;if(!ce||!a.virtual)return;const he=ne*a.itemHeight,Se=he+a.itemHeight,et=ce.scrollTop,St=ce.scrollTop+ce.clientHeight;he<et?ce.scrollTop=he:Se>St&&(ce.scrollTop=Se-ce.clientHeight)}function ue(ne){const ce=Math.max(0,_e.value-1);Z.value=Math.min(ce,Math.max(0,Z.value+ne)),q(Z.value)}function Ee(){const ne=re.value[Z.value];ne&&Y(ne)}const Ue=e.computed(()=>a.clearable&&!a.disabled&&y.value.length>0),Me=e.computed(()=>u.value?"border-destructive ring-1 ring-destructive":te.value?"border-neutral-400 ring-1 ring-neutral-400 dark:border-neutral-600 dark:ring-neutral-600":"");return(ne,ce)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",D1)):e.createCommentVNode("",!0),ce[3]||(ce[3]=e.createElementVNode("div",{class:"h-10 w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse"},null,-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",M1,"*")):e.createCommentVNode("",!0)],8,N1)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"referenceEl",ref:$,class:"relative"},[e.createElementVNode("button",{id:c.value,type:"button",class:e.normalizeClass(["w-full justify-between h-auto min-h-10 px-3 py-2 transition border rounded-lg flex items-center",["bg-white dark:bg-neutral-800 border-gray-300 dark:border-neutral-700/50 text-foreground dark:text-gray-300",Me.value]]),disabled:a.disabled,onClick:Ne},[e.createElementVNode("div",P1,[y.value.length?(e.openBlock(),e.createElementBlock("div",O1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value,(he,Se)=>(e.openBlock(),e.createElementBlock("div",{key:`chip-${h(he,Se)}`,class:"inline-flex items-center rounded-md border px-1.5 py-0.5 text-xs font-medium bg-neutral-100 dark:bg-neutral-800 text-neutral-900 dark:text-neutral-100 border-transparent gap-1"},[e.createElementVNode("span",v1,e.toDisplayString(f(he)),1),a.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"ml-1 opacity-70 hover:opacity-100",onClick:e.withModifiers(et=>v(he),["stop"]),"aria-label":"Remove"}," ✕ ",8,F1))]))),128)),a.maxChips!==null&&y.value.length>a.maxChips?(e.openBlock(),e.createElementBlock("div",z1," +"+e.toDisplayString(y.value.length-(a.maxChips??0)),1)):e.createCommentVNode("",!0)])):(e.openBlock(),e.createElementBlock("div",R1,e.toDisplayString(a.placeholder),1))]),e.createElementVNode("div",I1,[Ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"text-muted-foreground hover:text-foreground",onClick:e.withModifiers(K,["stop"]),"aria-label":"Clear"}," ✕ ")):e.createCommentVNode("",!0),e.createVNode(e.unref(le.ChevronDown),{class:"h-4 w-4 text-muted-foreground"})])],10,T1),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[te.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingEl",ref:H,class:"-mt-1 z-[9999] w-[var(--floating-width)] rounded-lg border shadow-lg overflow-hidden bg-white dark:bg-neutral-800 border-gray-200 dark:border-neutral-700/50",style:e.normalizeStyle(W.value)},[a.searchable&&!X.value?(e.openBlock(),e.createElementBlock("div",L1,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":ce[0]||(ce[0]=he=>T.value=he),placeholder:a.searchPlaceholder,class:"w-full h-10 px-3 py-2 text-sm bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-md focus:outline-none focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600",onKeydown:[ce[1]||(ce[1]=e.withKeys(e.withModifiers(he=>ue(1),["prevent"]),["down"])),ce[2]||(ce[2]=e.withKeys(e.withModifiers(he=>ue(-1),["prevent"]),["up"])),e.withKeys(e.withModifiers(Ee,["prevent"]),["enter"]),e.withKeys(e.withModifiers(Ce,["prevent"]),["esc"])]},null,40,$1),[[e.vModelText,T.value]])])):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"listEl",ref:J,class:"relative overflow-auto",style:e.normalizeStyle({height:Re.value+"px"}),onScroll:pt},[X.value?(e.openBlock(),e.createElementBlock("div",j1," All items have been selected ")):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[a.virtual?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle({height:ze.value+"px"})},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.virtual?"absolute left-0 top-0 w-full":""),style:e.normalizeStyle(a.virtual?{transform:`translateY(${Ie.value}px)`}:void 0)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,(he,Se)=>(e.openBlock(),e.createElementBlock("button",{key:String(h(he,Xe.value+Se)),type:"button",class:e.normalizeClass(["w-full px-3 text-left text-sm flex items-center justify-between gap-3",[N(he)?"cursor-not-allowed opacity-50":"hover:bg-neutral-50 dark:hover:bg-neutral-800/60",Tt(Xe.value+Se)?"bg-neutral-50 dark:bg-neutral-800/60":"",C(he)?"font-semibold":"font-normal"]]),style:e.normalizeStyle({height:a.itemHeight+"px"}),disabled:a.disabled||N(he),onClick:et=>Y(he)},[e.createElementVNode("span",W1,e.toDisplayString(f(he)),1),C(he)?(e.openBlock(),e.createElementBlock("span",H1,"✓")):e.createCommentVNode("",!0)],14,U1))),128))],6),_e.value===0?(e.openBlock(),e.createElementBlock("div",q1,[g.value?(e.openBlock(),e.createElementBlock("span",G1,"Loading data…")):(e.openBlock(),e.createElementBlock("span",X1,"Tidak ada data"))])):e.createCommentVNode("",!0)],64))],36)],4)):e.createCommentVNode("",!0)]))],512),u.value?(e.openBlock(),e.createElementBlock("p",K1,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,A1)),[[e.vShow,i.value]])}}),Y1={class:"space-y-4"},J1={key:0,class:"flex flex-col gap-0.5"},Q1=["for"],Z1=["for"],eC={class:"text-[11px] text-gray-500 dark:text-gray-400"},tC={class:"flex items-center gap-2 flex-nowrap"},nC=["id","value","disabled","onKeydown","onInput","onPaste"],sa=e.defineComponent({name:"DCodeOtpInput",inheritAttrs:!1,__name:"DCodeOtpInput",props:{modelValue:{default:""},totalInput:{default:6},default:{default:""},label:{default:""},endpoint:{},submitFn:{}},emits:["updateOtp","update:modelValue","complete","loading","success","error"],setup(t,{emit:n}){const o=e.useAttrs(),r=Math.random().toString(36).slice(2,7),a=e.computed(()=>`app-otp-${(o.id||s.label||"otp-field").replaceAll(/\s+/g,"-").toLowerCase()}-${r}`),s=t,i=n,l=e.ref([]),c=e.ref([]),d=e.ref(!1),{DCodeApi:u}=ct(),f=qs(),m=e.computed(()=>{const w=Number(s.totalInput);return w&&w>0?w:6}),h=()=>{c.value=Array.from({length:m.value},(w,y)=>{var b;return((b=s.default)==null?void 0:b[y])??""}),i("updateOtp",c.value.join(""))};h(),e.watch(()=>[s.totalInput,s.default],()=>h());const p=w=>{w<0||w>=m.value||e.nextTick(()=>{var y;return(y=l.value[w])==null?void 0:y.focus()})},k=w=>w.match(/[a-zA-Z0-9]/)?w.match(/[a-zA-Z0-9]/)[0]:"";async function x(w){var y;if(i("complete",w),s.submitFn){try{d.value=!0,i("loading",!0);const b=await s.submitFn(w);i("success",b)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}return}if((y=s.endpoint)!=null&&y.apiUrl){if(typeof u!="function"){i("error","useApi() must expose DCodeApi()");return}try{d.value=!0,i("loading",!0);const b=(s.endpoint.apiMethod||"POST").toUpperCase(),C=s.endpoint.apiUrl,V=await u("","",{otp:w},{_url:C,_method:b,withCredentials:!0}),D=(V==null?void 0:V.data)??V;i("success",D)}catch(b){console.error("OTP Submit Error",b),f.error("Submit Failed",(b==null?void 0:b.message)||"Unknown error"),i("error",(b==null?void 0:b.message)||"Submit Failed")}finally{d.value=!1,i("loading",!1)}}}const g=(w,y)=>{c.value[w]=k(y);const b=c.value.join("");i("updateOtp",b),i("update:modelValue",b),b.length===m.value&&x(b)},S=(w,y)=>{const b=w.key,C=/^\d$/.test(b),V=/^[a-zA-Z]$/.test(b);if(b==="Backspace"){if(w.preventDefault(),c.value[y]){g(y,"");return}y>0&&(g(y-1,""),p(y-1));return}if(b==="ArrowLeft"){w.preventDefault(),p(y-1);return}if(b==="ArrowRight"){w.preventDefault(),p(y+1);return}if(C||V){w.preventDefault(),g(y,b),y<m.value-1&&p(y+1);return}b.length===1&&w.preventDefault()},B=(w,y)=>{const b=w.target,C=b.value??"",V=k(C);b.value=V,g(y,V),V&&y<m.value-1&&p(y+1)},E=(w,y)=>{var N;w.preventDefault();const C=(((N=w.clipboardData)==null?void 0:N.getData("text"))??"").replaceAll(/[^a-zA-Z0-9]/g,"");if(!C)return;let V=y;for(const P of C){if(V>=m.value)break;c.value[V]=P,V++}const D=c.value.join("");i("updateOtp",D),i("update:modelValue",D),D.length===m.value&&x(D),p(Math.min(V,m.value-1))},_=w=>y=>{l.value[w]=(y==null?void 0:y.$el)??y};return(w,y)=>(e.openBlock(),e.createElementBlock("div",Y1,[s.label||m.value?(e.openBlock(),e.createElementBlock("div",J1,[s.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:a.value,class:"text-sm font-medium text-foreground"},e.toDisplayString(s.label),9,Q1)):(e.openBlock(),e.createElementBlock("label",{key:1,for:a.value,class:"text-sm font-medium text-foreground"}," Masukkan kode keamanan ",8,Z1)),e.createElementVNode("p",eC," Ketik "+e.toDisplayString(m.value)+" digit kode verifikasi Anda ",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",tC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,b=>(e.openBlock(),e.createElementBlock("input",{key:b,id:b===1?a.value:void 0,ref_for:!0,ref:_(b-1),value:c.value[b-1]||"",type:"text",inputmode:"text",maxlength:"1",autocomplete:"one-time-code","aria-label":"`OTP digit ${i}`",placeholder:"*",disabled:d.value,class:e.normalizeClass(["w-12 h-12 flex-none text-center text-xl font-bold rounded-xl border transition-all duration-200 box-border p-0","focus:outline-none focus:scale-105 disabled:opacity-50 disabled:cursor-not-allowed",c.value[b-1]?"border-blue-500 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300":"border-gray-300 dark:border-neutral-700/50 bg-white dark:bg-neutral-800 text-gray-400 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600"]),onKeydown:C=>S(C,b-1),onInput:C=>B(C,b-1),onPaste:C=>E(C,b-1)},null,42,nC))),128))])]))}}),oC={class:"w-full"},rC={key:0,class:"flex items-center justify-between mb-2"},aC={key:0,class:"text-sm font-medium text-gray-700"},sC={key:1,class:"text-sm text-gray-600"},iC={name:"DCodeProgress"},Gd=e.defineComponent({...iC,name:"DCodeProgress",inheritAttrs:!1,props:{modelValue:{default:0},max:{default:100},label:{default:""},showValue:{type:Boolean,default:!1},color:{default:"blue"},size:{default:"md"},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=e.computed(()=>Math.min(o.modelValue/o.max*100,100)),a=e.computed(()=>["w-full rounded-full overflow-hidden",{sm:"h-1",md:"h-2",lg:"h-3"}[o.size],"bg-gray-200"].join(" ")),s=e.computed(()=>{const l={blue:"bg-blue-500",green:"bg-green-500",red:"bg-red-500",yellow:"bg-yellow-500",purple:"bg-purple-500",gray:"bg-gray-500"},c=["h-full transition-all duration-300 ease-out",l[o.color]||l.blue];return o.striped&&c.push("bg-gradient-to-r from-transparent via-white/20 to-transparent"),o.animated&&c.push("animate-pulse"),c.join(" ")}),i=e.computed(()=>`${Math.round(r.value)}%`);return(l,c)=>(e.openBlock(),e.createElementBlock("div",oC,[t.label||t.showValue?(e.openBlock(),e.createElementBlock("div",rC,[t.label?(e.openBlock(),e.createElementBlock("span",aC,e.toDisplayString(t.label),1)):e.createCommentVNode("",!0),t.showValue?(e.openBlock(),e.createElementBlock("span",sC,e.toDisplayString(i.value),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(a.value)},[e.createElementVNode("div",{class:e.normalizeClass(s.value),style:e.normalizeStyle({width:`${r.value}%`})},null,6)],2)]))}}),lC={key:0,class:"fixed top-0 left-0 right-0 z-[10000] h-[3px]"},Xd=Dt(e.defineComponent({name:"DCodeProgressBar",__name:"DCodeProgressBar",props:{isApiLoading:{type:Boolean,default:!1},apiProgress:{default:0}},setup(t){return(n,o)=>(e.openBlock(),e.createBlock(e.Transition,{name:"fade"},{default:e.withCtx(()=>[t.isApiLoading?(e.openBlock(),e.createElementBlock("div",lC,[e.createElementVNode("div",{class:"h-full bg-primary-600 shadow-[0_0_15px_rgba(37,99,235,0.8)] transition-all duration-300 ease-out",style:e.normalizeStyle({width:`${t.apiProgress}%`})},null,4)])):e.createCommentVNode("",!0)]),_:1}))}}),[["__scopeId","data-v-85c68054"]]),cC={class:"grid gap-3"},dC={key:0,class:"ml-1 text-destructive"},uC={class:"flex flex-col"},fC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 mb-2"},mC={class:"relative flex-shrink-0 mt-0.5"},hC=["id","name","value","checked","disabled","required","onChange"],pC=["onClick"],gC=["for"],bC={key:0,class:"ml-1 text-red-500"},yC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-1"},Ys=e.defineComponent({name:"DCodeRadio",inheritAttrs:!1,__name:"DCodeRadio",props:{modelValue:{default:void 0},label:{default:""},itemTitle:{default:"name"},itemValue:{default:"id"},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ct(),r=n,a=t,s=e.ref([]),i=e.ref(!1),l=e.ref(null),c=async()=>{var E,_;const B=((E=a.endpoint)==null?void 0:E.apiUrl)||a.apiUrl;if(B){i.value=!0,l.value=null;try{const w={page:1,perPage:100},y=((_=a.endpoint)==null?void 0:_.apiMethod)||a.apiMethod,b=await o(B,y,w);let C=b;a.dataPath?C=a.dataPath.split(".").reduce((D,N)=>D&&D[N]!=="undefined"?D[N]:void 0,b):typeof b=="object"&&!Array.isArray(b)&&b.data&&(C=b.data),Array.isArray(C)?s.value=C:(console.warn("DCodeRadio: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),l.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(w){console.error("DCodeRadio fetch error:",w),l.value="Gagal memuat data dari endpoint."}finally{i.value=!1}}};e.onMounted(()=>{var B;((B=a.endpoint)!=null&&B.apiUrl||a.apiUrl)&&c()});const d=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(s.value.length>0)return s.value;const B=a.itemValue||a.model||"id",E=a.itemTitle||(a.label===""?"name":a.label);return E&&a.label!==""?[{[B]:B,[E]:E}]:[]}),u=B=>{if(typeof B!="object")return B;const E=a.itemValue||a.model||"id";return B[E]},f=B=>{if(typeof B!="object")return String(B);const E=a.itemTitle||"name";return B[E]},m=e.computed(()=>a.model||`radio-group-${Math.random().toString(36).substr(2,9)}`),h=e.computed(()=>!!a.error||!!l.value),p=e.computed(()=>a.error||l.value),k=B=>B==null?a.modelValue===B:String(a.modelValue)===String(B),x=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),g=(B,E)=>{E.target.checked&&(r("update:modelValue",B),r("change",B))},S=B=>{!a.disabled&&!k(B)&&(r("update:modelValue",B),r("change",B))};return(B,E)=>(e.openBlock(),e.createElementBlock("div",cC,[t.label?(e.openBlock(),e.createBlock(tr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",dC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",uC,[i.value?(e.openBlock(),e.createElementBlock("div",fC,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),E[0]||(E[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["flex",t.layout?"flex-row flex-wrap gap-4":"flex-col gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(_,w)=>(e.openBlock(),e.createElementBlock("div",{key:w,class:e.normalizeClass(["flex items-start",x.value.container,t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e.createElementVNode("div",mC,[e.createElementVNode("input",{id:t.id?`${t.id}-${w}`:`${m.value}-${w}`,name:m.value,type:"radio",value:u(_),checked:k(u(_)),disabled:t.disabled,required:t.required&&w===0,onChange:y=>g(u(_),y),class:"w-5 h-5 text-blue-600 focus:ring-blue-500 border-gray-300"},null,40,hC)]),e.createElementVNode("div",{class:"flex-1 min-w-0",onClick:y=>S(u(_))},[e.createElementVNode("label",{for:t.id?`${t.id}-${w}`:`${m.value}-${w}`,class:e.normalizeClass([x.value.label,"font-medium cursor-pointer select-none text-foreground dark:text-gray-300",t.disabled?"cursor-not-allowed opacity-50":""])},[e.createTextVNode(e.toDisplayString(f(_))+" ",1),t.required&&d.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",bC,"*")):e.createCommentVNode("",!0)],10,gC)],8,pC)],2))),128))],2),h.value&&p.value?(e.openBlock(),e.createElementBlock("div",yC,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(p.value),1)])):e.createCommentVNode("",!0)])]))}}),xC={class:"grid gap-3"},kC={key:0,class:"ml-1 text-destructive"},wC={class:"flex flex-col"},CC={key:0,class:"flex items-center gap-2 text-sm text-gray-500 dark:text-neutral-400 mb-2"},EC=["onClick"],BC=["id","name","value","checked","disabled","required","onChange"],_C={key:1,class:"w-6 h-6",fill:"currentColor",viewBox:"0 0 20 20"},SC=["for"],VC={key:0,class:"ml-1 text-red-500"},AC={key:1,class:"flex items-center gap-1 text-sm text-red-500 mt-2"},Js=e.defineComponent({name:"DCodeRadioCustom",inheritAttrs:!1,__name:"DCodeRadioCustom",props:{modelValue:{default:void 0},icon:{},itemTitle:{default:"name"},itemValue:{default:"id"},label:{default:""},options:{default:()=>[]},apiUrl:{default:""},apiMethod:{default:"GET"},endpoint:{},dataPath:{default:""},layout:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{default:null},size:{default:"md"},color:{default:"blue"},model:{default:"id"},id:{default:""}},emits:["update:modelValue","change"],setup(t,{emit:n}){e.useAttrs();const{apiUrl:o}=ct(),r=n,a=t,s=e.ref(a.modelValue??void 0);e.watch(()=>a.modelValue,C=>{s.value=C},{immediate:!0});const i=e.ref([]),l=e.ref(!1),c=e.ref(null),d=async()=>{var V,D;const C=((V=a.endpoint)==null?void 0:V.apiUrl)||a.apiUrl;if(C){l.value=!0,c.value=null;try{const N={page:1,perPage:100},P=((D=a.endpoint)==null?void 0:D.apiMethod)||a.apiMethod,M=await o(C,P,N);let X=M;a.dataPath?X=a.dataPath.split(".").reduce((H,J)=>H&&H[J]!=="undefined"?H[J]:void 0,M):typeof M=="object"&&!Array.isArray(M)&&M.data&&(X=M.data),Array.isArray(X)?i.value=X:(console.warn("DCodeRadioCustom: Format response tidak terdeteksi sebagai Array. Gunakan prop 'dataPath'."),c.value="Format respons data tidak valid. Array tidak ditemukan.")}catch(N){console.error("DCodeRadioCustom fetch error:",N),c.value="Gagal memuat data dari endpoint."}finally{l.value=!1}}},u=e.ref(!1);let f=null;const m=()=>{typeof document<"u"&&(u.value=document.documentElement.classList.contains("dark")||document.body.classList.contains("dark"))};e.onMounted(()=>{var C;((C=a.endpoint)!=null&&C.apiUrl||a.apiUrl)&&d(),m(),typeof document<"u"&&(f=new MutationObserver(m),f.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),f.observe(document.body,{attributes:!0,attributeFilter:["class"]}))}),e.onBeforeUnmount(()=>{f&&f.disconnect()});const h=e.computed(()=>{if(a.options&&a.options.length>0)return a.options;if(i.value.length>0)return i.value;const C=a.itemValue||a.model||"id",V=a.itemTitle||(a.label===""?"name":a.label);return V&&a.label!==""?[{[C]:C,[V]:V}]:[]}),p=C=>{if(typeof C!="object")return C;const V=a.itemValue||a.model||"id";return C[V]},k=C=>{if(typeof C!="object")return String(C);const V=a.itemTitle||"name";return C[V]},x=Math.random().toString(36).slice(2,7),g=e.computed(()=>a.id?`radio-custom-${a.id}`:`radio-custom-${a.model}-${x}`),S=e.computed(()=>!!a.error||!!c.value),B=e.computed(()=>a.error||c.value),E=C=>{const V=s.value;return C==null?V===C:String(V)===String(C)},_=e.computed(()=>({sm:{radio:"w-3 h-3",label:"text-sm",container:"gap-2"},md:{radio:"w-4 h-4",label:"text-base",container:"gap-2"},lg:{radio:"w-5 h-5",label:"text-lg",container:"gap-3"}})[a.size]),w=e.computed(()=>a.icon&&$t[a.icon]||null),y=(C,V)=>{V.target.checked&&(s.value=C,r("update:modelValue",C),r("change",C))},b=C=>{a.disabled||E(C)||(s.value=C,r("update:modelValue",C),r("change",C))};return(C,V)=>(e.openBlock(),e.createElementBlock("div",xC,[t.label?(e.openBlock(),e.createBlock(tr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",kC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",wC,[l.value?(e.openBlock(),e.createElementBlock("div",CC,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),V[0]||(V[0]=e.createTextVNode(" Sedang memuat opsi... ",-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["grid",t.layout?"grid-cols-2 sm:grid-cols-3":"grid-cols-1","gap-3"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(D,N)=>(e.openBlock(),e.createElementBlock("div",{key:N,class:e.normalizeClass(["relative flex flex-col items-center justify-center gap-2 p-4 rounded-xl border-2 transition-all duration-200",E(p(D))?u.value?"border-primary-500 bg-primary-500/10 shadow-none":"border-primary-500 bg-primary-50 shadow-md shadow-primary-100":u.value?"border-neutral-700 bg-neutral-800 hover:border-neutral-600":"border-gray-200 bg-white hover:border-gray-300 hover:shadow-sm",t.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"]),onClick:P=>!t.disabled&&b(p(D))},[e.createElementVNode("input",{id:t.id?`${t.id}-${N}`:`${g.value}-${N}`,name:g.value,type:"radio",value:p(D),checked:E(p(D)),disabled:t.disabled,required:t.required&&N===0,onChange:P=>y(p(D),P),class:"sr-only",tabindex:"-1"},null,40,BC),e.createElementVNode("div",{class:e.normalizeClass(["w-10 h-10 rounded-full flex items-center justify-center transition-all duration-200",E(p(D))?u.value?"bg-primary-500/25 text-primary-400":"bg-primary-100 text-primary-600":u.value?"bg-neutral-700 text-neutral-500":"bg-gray-100 text-gray-400"])},[w.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w.value),{key:0,class:"w-6 h-6"})):(e.openBlock(),e.createElementBlock("svg",_C,[...V[1]||(V[1]=[e.createElementVNode("circle",{cx:"10",cy:"10",r:"6"},null,-1)])]))],2),e.createElementVNode("label",{for:t.id?`${t.id}-${N}`:`${g.value}-${N}`,class:e.normalizeClass([_.value.label,"font-medium text-center leading-tight select-none transition-colors duration-200",E(p(D))?u.value?"text-primary-400":"text-primary-700":u.value?"text-neutral-300":"text-gray-700",t.disabled?"cursor-not-allowed":"cursor-pointer"])},[e.createTextVNode(e.toDisplayString(k(D))+" ",1),t.required&&h.value.length===1&&t.label?(e.openBlock(),e.createElementBlock("span",VC,"*")):e.createCommentVNode("",!0)],10,SC)],10,EC))),128))],2),S.value&&B.value?(e.openBlock(),e.createElementBlock("div",AC,[e.createVNode(e.unref(le.AlertCircle),{class:"w-4 h-4 flex-shrink-0"}),e.createTextVNode(" "+e.toDisplayString(B.value),1)])):e.createCommentVNode("",!0)])]))}}),DC={key:0,class:"ml-1 text-destructive"},NC={class:"relative w-full"},MC={key:0,class:"mb-2 flex items-center justify-between"},TC={class:"text-sm text-muted-foreground"},PC={class:"text-sm font-medium text-foreground"},OC={class:"text-sm text-muted-foreground"},vC={class:"relative"},FC=["id","value","min","max","step","disabled","placeholder"],zC={key:1,class:"relative mt-2"},RC={class:"text-xs text-muted-foreground mt-1"},IC={key:1,class:"flex items-center gap-1 text-sm text-destructive"},LC={name:"DCodeSlider"},ia=e.defineComponent({...LC,name:"DCodeSlider",inheritAttrs:!1,props:{modelValue:{default:0},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},label:{default:""},placeholder:{default:""},required:{type:Boolean,default:!1},error:{default:null},showValue:{type:Boolean,default:!0},valuePrefix:{default:""},valueSuffix:{default:""},marks:{default:()=>[]},color:{default:"blue"},size:{default:"md"}},emits:["update:modelValue","change","input"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.ref(),i=e.ref(!1),l=e.computed(()=>!!a.error),c=e.computed(()=>`slider-${Math.random().toString(36).substr(2,9)}`),d=e.computed(()=>(a.label||o.label)??void 0),u=e.computed(()=>!0),f=e.computed(()=>{const _={sm:"h-2",md:"h-2.5",lg:"h-3"},w={blue:"accent-blue-500",green:"accent-green-500",red:"accent-red-500",yellow:"accent-yellow-500",purple:"accent-purple-500",gray:"accent-gray-500"};return["w-full appearance-none bg-transparent rounded-lg outline-none transition-all cursor-pointer relative z-10","disabled:opacity-50 disabled:cursor-not-allowed",_[a.size],w[a.color]||w.blue,l.value?"accent-red-500":"",o.class].filter(Boolean).join(" ")}),m=e.computed(()=>["appearance-none bg-white border-2 border-current rounded-full cursor-pointer transition-all","hover:scale-110 focus:scale-110","shadow-md hover:shadow-lg focus:shadow-lg","focus:outline-none focus:ring-2 focus:ring-offset-2",{sm:"w-4 h-4",md:"w-5 h-5",lg:"w-6 h-6"}[a.size],a.color==="blue"?"focus:ring-blue-500":a.color==="green"?"focus:ring-green-500":a.color==="red"?"focus:ring-red-500":a.color==="yellow"?"focus:ring-yellow-500":a.color==="purple"?"focus:ring-purple-500":"focus:ring-gray-500"].join(" ")),h=e.computed(()=>`${a.valuePrefix}${a.modelValue}${a.valueSuffix}`),p=e.computed(()=>{const _=a.max-a.min;return(a.modelValue-a.min)/_*100}),k=_=>{const w=_.target,y=parseFloat(w.value);r("update:modelValue",y),r("input",y)},x=_=>{const w=_.target,y=parseFloat(w.value);r("change",y)},g=()=>{i.value=!0},S=()=>{i.value=!1},B=_=>{const w=a.max-a.min;return(_-a.min)/w*100},E=e.computed(()=>{const _={sm:16,md:20,lg:24};return`
|
|
67
67
|
input[type="range"]::-webkit-slider-thumb {
|
|
68
|
-
${
|
|
69
|
-
width: ${
|
|
70
|
-
height: ${
|
|
68
|
+
${m.value}
|
|
69
|
+
width: ${_[a.size]}px;
|
|
70
|
+
height: ${_[a.size]}px;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
input[type="range"]::-moz-range-thumb {
|
|
74
|
-
${
|
|
75
|
-
width: ${
|
|
76
|
-
height: ${
|
|
74
|
+
${m.value}
|
|
75
|
+
width: ${_[a.size]}px;
|
|
76
|
+
height: ${_[a.size]}px;
|
|
77
77
|
border-width: 2px;
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -92,6 +92,6 @@
|
|
|
92
92
|
input[type="range"]:focus::-moz-range-thumb {
|
|
93
93
|
transform: scale(1.1);
|
|
94
94
|
}
|
|
95
|
-
`});return(S,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(nr),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",VC,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",DC,[t.showValue?(e.openBlock(),e.createElementBlock("div",NC,[e.createElementVNode("span",MC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",vC,e.toDisplayString(m.value),1),e.createElementVNode("span",PC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",TC,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${g.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(f.value),onInput:k,onChange:y,onMousedown:p,onMouseup:E,onTouchstart:p,onTouchend:E},null,42,OC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",FC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,x=>(e.openBlock(),e.createElementBlock("div",{key:x.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${_(x.value)}%`,transform:"translateX(-50%)"})},[w[0]||(w[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",zC,e.toDisplayString(x.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",IC,[w[1]||(w[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),B.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(B.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),LC={class:"grid gap-3"},$C={key:0,class:"ml-1 text-destructive"},jC={class:"inline-flex items-center gap-3"},UC=["id","name","aria-checked","aria-label","disabled"],WC={key:0,class:"absolute inset-0 flex items-center justify-center"},HC={class:"relative z-10 flex items-center gap-2"},qC=["id","name","aria-checked","aria-label","disabled"],GC={key:0,class:"absolute inset-0 flex items-center justify-center"},XC={name:"DCodeSwitch"},la=e.defineComponent({...XC,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(r("update:modelValue",f),r("change",f))}}),s=e.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=e.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(!a.value)return"bg-gray-200";switch(o.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{a.value=!a.value},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,h)=>(e.openBlock(),e.createElementBlock("div",LC,[t.title?(e.openBlock(),e.createBlock(nr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",$C,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",jC,[e.createVNode(e.unref(gl),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(ml),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(bl),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",WC,[...h[0]||(h[0]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,UC)]),_:1}),e.createVNode(e.unref(pl),{side:"top","side-offset":8,class:e.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",HC,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",GC,[...h[1]||(h[1]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(ce.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,qC))]),_:1})])]))}}),KC=["aria-busy"],YC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},JC=["for"],QC={key:0,class:"ml-1 text-destructive"},ZC={class:"relative w-full group"},eE=["id","value"],tE={key:0,class:"absolute top-1 right-2"},nE={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"},oE={key:1,class:"text-xs text-destructive"},wo=e.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const ee=o.required,z=o["aria-required"];return ee===""||ee===!0||ee==="true"||(z==="true"||z===!0)}),u=e.computed(()=>{const{label:ee,class:z,id:J,required:se,"aria-required":Be,...ve}=o;return ve}),f=e.computed(()=>{const ee=o.maxlength;let z=Number.NaN;return typeof ee=="number"?z=ee:typeof ee=="string"&&(z=Number.parseInt(ee,10)),Number.isFinite(z)&&z>0?z:-1}),h=ee=>f.value>0?ee.slice(0,f.value):ee,m=e.computed(()=>{const ee=a.modelValue;return ee==null||String(ee).length===0}),g=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!m.value:!0:!1),k=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,ee=>{const z=String(ee??"");z!==k.value&&(k.value=z)});const y=e.ref(!1),p=e.ref(!1),E=ee=>ee.split(/(\s+)/).map(z=>{if(z.trim()==="")return z;const J=z.toLowerCase();return J.charAt(0).toUpperCase()+J.slice(1)}).join(""),_=ee=>{const z=ee.toLowerCase(),J=z.search(new RegExp("\\p{L}","u"));return J<0?z:z.slice(0,J)+z.charAt(J).toUpperCase()+z.slice(J+1)},B=ee=>{switch(a.textCase){case"uppercase":return ee.toUpperCase();case"lowercase":return ee.toLowerCase();case"titlecase":return E(ee);case"sentencecase":return _(ee);case"none":default:return ee}},S=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),w=ee=>{if(!ee)return null;const z=Array.isArray(ee)?ee.join(""):ee;return z?new Set(z):null},x=e.computed(()=>w(a.allowChars)),b=(ee,z)=>(ee.lastIndex=0,ee.test(z)),A=ee=>{if(ee===`
|
|
96
|
-
`)return a.valueType!=="number";if(a.valueType==="free")return!0;const
|
|
97
|
-
`,""),J=Number(z);return Number.isFinite(J)?J:null}return ee},v=ee=>{k.value=ee,r("update:modelValue",P(ee))},Q=(ee,z)=>{const J=h(z);p.value=!0,ee.value=J,v(J),queueMicrotask(()=>p.value=!1)},j=(ee,z)=>{const J=ee.selectionStart??ee.value.length,se=ee.selectionEnd??ee.value.length;if(f.value>0){const Be=ee.value.length-(se-J),ve=f.value-Be;if(ve<=0)return;z=z.slice(0,ve)}ee.setRangeText(z,J,se,"end"),Q(ee,D(ee.value))},G=ee=>{var se;if(!N||y.value||p.value||!((se=ee.inputType)!=null&&se.startsWith("insert")))return;const z=ee.data;if(z==null)return;const J=D(z);J!==z&&(ee.preventDefault(),J.length>0&&j(N,J))},Y=ee=>{var se;if(!N||y.value||p.value)return;const z=((se=ee.clipboardData)==null?void 0:se.getData("text"))??"",J=D(z);J!==z&&(ee.preventDefault(),J.length>0&&j(N,J))},H=async ee=>{if(!N||y.value||p.value)return;const z=ee.target,J=z.value??"",se=D(J);if(se===J){const Be=z.selectionStart??se.length,ve=z.selectionEnd??se.length;Q(z,se),await e.nextTick();try{z.setSelectionRange(Be,ve)}catch{}v(se)}else{const Be=z.selectionStart??se.length,ve=z.selectionEnd??se.length;Q(z,se),await e.nextTick();try{z.setSelectionRange(Be,ve)}catch{}}},T=()=>y.value=!0,U=()=>{if(y.value=!1,!N)return;const ee=N.value??"",z=D(ee);z===ee?v(z):Q(N,z)};e.onMounted(()=>{if(N=document.getElementById(c.value),!N)return;N.addEventListener("beforeinput",G),N.addEventListener("paste",Y),N.addEventListener("input",H),N.addEventListener("compositionstart",T),N.addEventListener("compositionend",U);const ee=N.value??"",z=D(ee);z===ee?v(z):Q(N,z)}),e.onBeforeUnmount(()=>{N&&(N.removeEventListener("beforeinput",G),N.removeEventListener("paste",Y),N.removeEventListener("input",H),N.removeEventListener("compositionstart",T),N.removeEventListener("compositionend",U),N=null)});const te=()=>{k.value="",N&&(N.value=""),r("update:modelValue",null),r("clear")},Z=e.computed(()=>k.value.length),K=e.computed(()=>a.showCharCount?f.value>0:!1),ae=e.computed(()=>K.value&&Z.value>0),ue=e.computed(()=>`${Z.value} / ${f.value}`),ke=e.computed(()=>!!a.error),De=e.computed(()=>{const ee=o.rows,z=typeof ee=="number"?ee:Number.parseInt(String(ee??""),10);return Number.isFinite(z)&&z>0?z:3}),Ce=e.computed(()=>({height:`${De.value*24+16}px`}));return(ee,z)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",YC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(Ce.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",QC,"*")):e.createCommentVNode("",!0)],8,JC)):e.createCommentVNode("",!0),e.createElementVNode("div",ZC,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:k.value},u.value,{style:`text-transform: ${S.value}; padding-right: ${g.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",ke.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,eE),g.value?(e.openBlock(),e.createElementBlock("div",tE,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:te}," ✕ ")])):e.createCommentVNode("",!0),ae.value&&!ke.value?(e.openBlock(),e.createElementBlock("p",nE,e.toDisplayString(ue.value),1)):e.createCommentVNode("",!0)]),ke.value?(e.openBlock(),e.createElementBlock("p",oE,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,KC)),[[e.vShow,i.value]])}}),Yd=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.AvatarRoot),{class:e.normalizeClass(e.unref(Re)(e.unref(rE)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),Jd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Qd=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),rE=wr("inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden",{variants:{size:{sm:"h-10 w-10 text-xs",base:"h-16 w-16 text-2xl",lg:"h-32 w-32 text-5xl"},shape:{circle:"rounded-full",square:"rounded-md"}}}),ca=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.Separator),e.mergeProps(e.unref(o),{class:e.unref(Re)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),aE={class:"bg-card text-card-foreground"},sE={class:"pb-6 px-3"},iE={key:0,class:"flex justify-center p-8"},lE={key:1,class:"p-8 text-center text-red-500"},cE={key:2,class:"relative"},dE={class:"space-y-6"},uE={class:"rounded-xl border bg-card text-card-foreground shadow"},fE={class:"p-4"},hE={class:"flex items-center justify-between gap-3"},mE={class:"font-medium"},pE={class:"text-xs text-muted-foreground"},gE={class:"mt-1 text-sm text-muted-foreground"},bE={class:"text-foreground"},yE={class:"text-foreground"},xE={class:"mt-1 text-xs text-muted-foreground"},kE={key:0,class:"mt-3 flex items-center gap-2 text-sm"},wE={class:"flex items-center justify-between gap-3"},CE={class:"font-medium"},EE={class:"text-xs text-muted-foreground"},BE={class:"mt-2 text-sm text-muted-foreground"},_E={class:"flex flex-wrap items-center justify-between gap-3"},SE={class:"flex items-center gap-3"},AE={class:"leading-tight"},VE={class:"text-sm font-medium"},DE={class:"text-xs text-muted-foreground"},NE={class:"flex items-center gap-2"},ME={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},vE={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},PE=["src"],TE={class:"flex-1"},OE={class:"flex items-center justify-between gap-3"},FE={class:"font-medium"},zE={class:"text-xs text-muted-foreground"},IE={class:"mt-1 text-sm text-muted-foreground"},RE={class:"text-left sm:text-center"},LE={class:"text-xs text-muted-foreground"},$E={class:"text-left sm:text-center"},jE={class:"text-xs text-muted-foreground"},UE={class:"text-left sm:text-center"},WE={class:"text-xs text-muted-foreground"},HE={class:"flex items-center justify-between gap-3"},qE={class:"font-medium"},GE={class:"text-xs text-muted-foreground"},XE={class:"mt-2 text-sm text-muted-foreground"},KE={class:"mt-3 flex items-center gap-3"},YE={class:"text-sm font-medium"},JE={class:"flex items-start justify-between gap-3"},QE={class:"font-medium"},ZE={class:"mt-3 grid gap-2 text-sm"},eB={class:"flex items-center justify-between gap-3"},tB={class:"flex items-center gap-2 text-muted-foreground"},nB={class:"font-medium"},oB={class:"flex items-center justify-between gap-3"},rB={class:"flex items-center gap-2 text-muted-foreground"},aB={class:"font-medium"},sB={class:"flex items-center justify-between gap-3"},iB={class:"flex items-center gap-2 text-muted-foreground"},lB={class:"font-medium"},cB={class:"flex items-center justify-between"},dB={class:"flex items-center gap-2"},uB={class:"flex items-start justify-between gap-3"},fB={class:"flex items-center gap-2"},hB={class:"font-medium"},mB={class:"mt-2 text-sm text-muted-foreground"},pB={key:0,class:"mt-1 text-sm text-muted-foreground"},gB={class:"flex flex-wrap items-center justify-between gap-3"},bB={class:"flex items-center gap-2"},yB={class:"text-xs text-muted-foreground"},Zd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=lt.useBreakpoints(lt.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const f=await fetch(r.apiUrl,{method:r.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const h=await f.json();Array.isArray(h)?i.value=h:h.data&&Array.isArray(h.data)?i.value=h.data:h.items&&Array.isArray(h.items)?i.value=h.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:ce.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:ce.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:ce.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:ce.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:ce.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:ce.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:ce.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(h=>{var m;return(m=h[0])==null?void 0:m.toUpperCase()}).join("");return(f,h)=>{const m=e.resolveComponent("ShoppingCart"),g=e.resolveComponent("DCodeBadge"),k=e.resolveComponent("RefreshCcw"),y=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",aE,[h[8]||(h[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",sE,[a.value?(e.openBlock(),e.createElementBlock("div",iE,[...h[0]||(h[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",lE,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",cE,[h[7]||(h[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",dE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(p,E)=>(e.openBlock(),e.createElementBlock("div",{key:E,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(p.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(p.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",uE,[e.createElementVNode("div",fE,[p.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",hE,[e.createElementVNode("p",mE,e.toDisplayString(p.title),1),e.createElementVNode("p",pE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",gE,[e.createElementVNode("span",bE,e.toDisplayString(p.from),1),e.createVNode(e.unref(ce.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",yE,e.toDisplayString(p.to),1)]),e.createElementVNode("p",xE,e.toDisplayString(p.time),1),p.fileName?(e.openBlock(),e.createElementBlock("div",kE,[e.createVNode(e.unref(ce.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(p.fileName),1)])):e.createCommentVNode("",!0)],64)):p.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",wE,[e.createElementVNode("p",CE,e.toDisplayString(p.title),1),e.createElementVNode("p",EE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",BE,e.toDisplayString(p.desc),1),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",_E,[e.createElementVNode("div",SE,[e.createVNode(e.unref(Yd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Qd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Jd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",AE,[e.createElementVNode("p",VE,e.toDisplayString(p.personName),1),e.createElementVNode("p",DE,e.toDisplayString(p.personRole),1)])]),e.createElementVNode("div",NE,[e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="product"?(e.openBlock(),e.createElementBlock("div",ME,[e.createElementVNode("div",vE,[p.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:p.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,PE)):(e.openBlock(),e.createBlock(m,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",TE,[e.createElementVNode("div",OE,[e.createElementVNode("p",FE,e.toDisplayString(p.title),1),e.createElementVNode("p",zE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",IE,e.toDisplayString(p.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",RE,[h[1]||(h[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",LE,e.toDisplayString(p.customer),1)]),e.createElementVNode("div",$E,[h[2]||(h[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",jE,e.toDisplayString(p.price),1)]),e.createElementVNode("div",UE,[h[3]||(h[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",WE,e.toDisplayString(p.qty),1)])],2)])])):p.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",HE,[e.createElementVNode("p",qE,e.toDisplayString(p.title),1),e.createElementVNode("p",GE,e.toDisplayString(p.meta),1)]),e.createElementVNode("p",XE,e.toDisplayString(p.desc),1),e.createElementVNode("div",KE,[e.createVNode(e.unref(Yd),{class:"h-10 w-10"},{default:e.withCtx(()=>[p.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Qd),{key:0,src:p.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Jd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(p.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",YE,e.toDisplayString(p.personName),1)])],64)):p.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",JE,[e.createElementVNode("p",QE,e.toDisplayString(p.title),1),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",ZE,[e.createElementVNode("div",eB,[e.createElementVNode("div",tB,[e.createVNode(e.unref(ce.Globe),{class:"h-4 w-4"}),h[4]||(h[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",nB,e.toDisplayString(p.ip),1)]),e.createElementVNode("div",oB,[e.createElementVNode("div",rB,[e.createVNode(e.unref(ce.Cpu),{class:"h-4 w-4"}),h[5]||(h[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",aB,e.toDisplayString(p.cpu),1)]),e.createElementVNode("div",sB,[e.createElementVNode("div",iB,[e.createVNode(e.unref(ce.CpuIcon),{class:"h-4 w-4"}),h[6]||(h[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",lB,e.toDisplayString(p.memory),1)])]),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",cB,[e.createElementVNode("div",dB,[e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(k,{class:"h-4 w-4"})]),_:1})])])],64)):p.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",uB,[e.createElementVNode("div",fB,[e.createVNode(y,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",hB,e.toDisplayString(p.title),1)]),e.createVNode(g,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.chipText),1)]),_:2},1024)]),e.createElementVNode("p",mB,e.toDisplayString(p.desc1),1),p.desc2?(e.openBlock(),e.createElementBlock("p",pB,e.toDisplayString(p.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",gB,[e.createElementVNode("div",bB,[e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Jt),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",yB,"Due date: "+e.toDisplayString(p.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),xB={class:"dcode-upload-file"},kB={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"},wB={key:0,class:"text-xs text-gray-500 mt-1"},CB=["accept"],EB={key:1,class:"text-xs text-red-600 mt-1"},eu=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",xB,[t.label?(e.openBlock(),e.createBlock(ko,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",kB,[e.createVNode(e.unref(ce.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",wB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,CB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",EB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),BB=["onClick"],_B={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},SB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},AB={key:1},VB={key:0,class:"text-white"},DB={key:1},NB={key:2},MB=["disabled","onClick"],vB={key:1,class:"mr-2 text-sm font-bold opacity-70"},PB={class:"whitespace-normal text-sm text-center leading-tight"},TB={class:"flex flex-col flex-1 min-w-0"},OB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},FB={class:"text-sm text-muted-foreground"},zB={class:"px-1"},IB=["disabled"],RB=["type"],LB=["disabled"],Qs=Ot(e.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:n}){const o=t,r=n,a=ft(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var x;if(typeof o.modelValue=="string"){const b=(x=o.tabs)==null?void 0:x.findIndex(A=>A.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(x){var b;if(i.value=x,typeof o.modelValue=="string"){const A=(b=o.tabs)==null?void 0:b[x];A?r("update:modelValue",A.key):r("update:modelValue",x)}else r("update:modelValue",x)}}),c=e.computed(()=>{var x;return((x=o.tabs)==null?void 0:x.length)??0}),d=e.computed(()=>{var x;return(x=o.tabs)==null?void 0:x[l.value]});function u(x){return c.value<=0?0:Math.min(Math.max(x,0),c.value-1)}function f(x){return x?typeof x=="string"?Gt[x]||null:x:null}const h=e.reactive({});function m(x){return h[x.key]||(h[x.key]={loaded:!1,loading:!1,data:null,error:null}),h[x.key]}function g(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function k(x){const b=x.endpoint||{};return{apiModule:x.apiModule||b.apiModule,apiAction:x.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:x.apiParams}}function y(x){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[x];return!(!b||b.disabled)}async function p(x){if(typeof x.tab.fetchData=="function"){const v=await x.tab.fetchData(),Q=(v==null?void 0:v.data)??v;return(Q==null?void 0:Q.data)??Q}const b=k(x.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const V=g();let D;if(b.apiUrl)D=await s("","",V,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const v={...V,...b.apiParams};D=await s(b.apiModule,b.apiAction,v)}const N=(D==null?void 0:D.data)??D;return(N==null?void 0:N.data)??N}async function E(x,{force:b=!1}={}){const A=u(x),V=o.tabs[A];if(!V)return;const D=m(V);if(!(o.cache&&D.loaded&&!b)&&!D.loading){D.loading=!0,D.error=null;try{const N=await p({tabIndex:A,tab:V});D.data=N,D.loaded=!0,r("loaded",{tabIndex:A,tab:V,data:N})}catch(N){const P=typeof(N==null?void 0:N.message)=="string"&&N.message||typeof N=="string"&&N||"Failed to load tab data.";D.error=P,r("error",{tabIndex:A,tab:V,message:P})}finally{D.loading=!1}}}function _(x){const b=u(x);y(b)&&b!==l.value&&(l.value=b)}function B(x=l.value){return E(x,{force:!0})}function S(){const x=u(l.value-1);x!==l.value&&(l.value=x)}function w(){const x=u(l.value+1);x!==l.value&&(l.value=x)}return e.watch(()=>o.tabs,x=>{for(const b of x??[])m(b)},{immediate:!0}),e.watch(()=>l.value,async x=>{var A;const b=(A=o.tabs)==null?void 0:A[x];b&&r("change",{tabIndex:x,tab:b}),await E(x)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async x=>{x&&await E(l.value)},{immediate:!0}),(x,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(A,V)=>(e.openBlock(),e.createElementBlock("div",{key:A.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[V<l.value?"wizard-num-done":"",V===l.value?"wizard-num-active":V>l.value?"wizard-num-pending":""]])},[t.typeWizard==="icon"&&A.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(A.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!A.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",AB,[V<l.value?(e.openBlock(),e.createElementBlock("span",VB,"✓")):(e.openBlock(),e.createElementBlock("span",DB,e.toDisplayString(V+1),1))])):(e.openBlock(),e.createElementBlock("span",NB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",V===l.value?"wizard-text-active":"wizard-text-pending"])},e.toDisplayString(A.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(A,V)=>(e.openBlock(),e.createElementBlock("div",{key:A.key,onClick:D=>_(V),style:e.normalizeStyle({zIndex:t.tabs.length-V}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[V>0?"pl-8":"",V===l.value?"wizard-step-active":V<l.value?"wizard-step-done":"wizard-step-pending"]])},[t.typeWizard==="icon"&&A.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(A.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",_B,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",SB,e.toDisplayString(A.title),1)],2),V<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[V===l.value?"wizard-svg-active":V<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,BB))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(A,V)=>(e.openBlock(),e.createElementBlock("button",{key:A.key,type:"button",disabled:!y(V),onClick:D=>_(V),class:e.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 wizard-btn-common",e.unref(Re)("border-b border-r",!t.isVertical&&V===t.tabs.length-1&&"border-r-0",V===l.value?"wizard-btn-active":"wizard-btn-pending",!y(V)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&A.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(A.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",vB,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",PB,e.toDisplayString(A.title),1)],10,MB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ca),{key:0})),e.createElementVNode("div",TB,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var A,V,D,N;return[(e.openBlock(),e.createElementBlock("div",{key:((A=d.value)==null?void 0:A.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(V=h[d.value.key])!=null&&V.loading?e.renderSlot(x.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",OB,[e.createVNode(e.unref(ce.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(x.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(D=h[d.value.key])==null?void 0:D.data,loaded:(N=h[d.value.key])==null?void 0:N.loaded,reload:B},()=>[e.createElementVNode("div",FB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",zB,"tab-"+e.toDisplayString(d.value.key),1),b[3]||(b[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:S,disabled:l.value<=0,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,IB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:w,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,RB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(ce.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,LB))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),$B={class:"permission-menu w-full space-y-4"},jB={class:"bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-4"},UB={class:"flex items-center justify-between"},WB={class:"flex items-center gap-3 flex-1"},HB=["onClick"],qB={key:1,class:"w-7"},GB={key:2,class:"flex-shrink-0"},XB={class:"text-lg font-semibold flex-1"},KB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},YB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},JB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},QB=["checked","disabled","onChange"],ZB={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},e_={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},t_={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},n_={class:"bg-neutral-50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-3"},o_={class:"flex items-center justify-between"},r_={class:"flex items-center gap-3 flex-1"},a_={key:0,class:"flex-shrink-0"},s_={class:"text-base font-semibold flex-1"},i_={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},l_={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},c_=["checked","onChange"],d_={class:"text-xs font-medium"},u_={key:0,class:"p-3"},f_={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},h_=["checked","disabled","onChange"],m_={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},Zs=Ot(e.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(t,{expose:n,emit:o}){const{t:r}=$t.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(V=!0)=>{(N=>{N.forEach(P=>{P.permission.forEach(v=>{const Q=`${P.id}-${v.id}-parent`,j=v.code==="VIEW"||v.name.toUpperCase()==="VIEW";l.value.has(Q)||l.value.set(Q,j||(V?P.checked??!1:!1))}),P.detail&&P.detail.length>0&&P.detail.forEach(v=>{v.permission.forEach(Q=>{const j=`${v.id}-${Q.id}-child`,G=Q.code==="VIEW"||Q.name.toUpperCase()==="VIEW";l.value.has(j)||l.value.set(j,G||(V?v.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(V=>{const D=V.menuId,N=V.actionsIds;i.value.forEach(P=>{P.id===D&&N.forEach(v=>{const Q=`${D}-${v}-parent`;l.value.set(Q,!0)}),P.detail&&P.detail.length>0&&P.detail.forEach(v=>{v.id===D&&N.forEach(Q=>{const j=`${D}-${Q}-child`;l.value.set(j,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(V,D)=>{D===0&&V>0&&u()});const f=V=>V.detail&&V.detail.length>0,h=V=>{c.value.has(V)?c.value.delete(V):c.value.add(V)},m=V=>c.value.has(V),g=(V,D,N=!1)=>{const P=`${V}-${D}-${N?"child":"parent"}`;return l.value.get(P)??!1},k=()=>{const V=w();s("update:modelValue",V.permissions)},y=(V,D,N,P=!1)=>{const v=N.target.checked,Q=`${V}-${D}-${P?"child":"parent"}`;l.value.set(Q,v),s("permission-change",V,D,v,!P),k()},p=V=>V.permission.filter(E),E=V=>V.code==="VIEW"||V.name.toUpperCase()==="VIEW",_=(V,D,N)=>{const P=N.target.checked;D.permission.forEach(v=>{if(E(v)){const j=`${D.id}-${v.id}-child`;l.value.set(j,!0);return}const Q=`${D.id}-${v.id}-child`;l.value.set(Q,P)}),l.value=new Map(l.value),s("menu-check",D.id,P),k()},B=(V,D=!1)=>{const N=D?V.permission:p(V);return!N||N.length===0?!1:N.every(P=>{const v=`${V.id}-${P.id}-${D?"child":"parent"}`;return l.value.get(v)??!1})},S=()=>{const V={};return i.value.forEach(D=>{var N;V[D.id]={name:D.name,parentPermissions:D.permission.map(P=>({id:P.id,name:P.name,checked:g(D.id,P.id,!1)})),children:((N=D.detail)==null?void 0:N.map(P=>({id:P.id,name:P.name,permissions:P.permission.map(v=>({id:v.id,name:v.name,checked:g(P.id,v.id,!0)}))})))||[]}}),V},w=()=>{const V=[],D=(N,P=!1)=>{const v=[];N.permission.forEach(Q=>{const j=`${N.id}-${Q.id}-${P?"child":"parent"}`;(l.value.get(j)??!1)&&v.push(Q.id)}),v.length>0&&V.push({menuId:N.id,actionsIds:v})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{D(P,!0)})}),{permissions:V}};return n({getCurrentStates:S,getPermissionsForDatabase:w,getAllPermissionsWithStatus:()=>{const V=[],D=(N,P=!1)=>{const v=N.permission.map(j=>{const G=`${N.id}-${j.id}-${P?"child":"parent"}`,Y=l.value.get(G)??!1;return{id:j.id,name:j.name,checked:Y}}),Q=v.filter(j=>j.checked).map(j=>j.id);V.push({menuId:N.id,menuName:N.name,actionsIds:Q,actions:v})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{D(P,!0)})}),{permissions:V}},permissionStates:l,expandAll:()=>{i.value.forEach(V=>{f(V)&&c.value.add(V.id)})},collapseAll:()=>{c.value.clear()}}),(V,D)=>(e.openBlock(),e.createElementBlock("div",$B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,N=>(e.openBlock(),e.createElementBlock("div",{key:N.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(N)}])},[e.createElementVNode("div",jB,[e.createElementVNode("div",UB,[e.createElementVNode("div",WB,[f(N)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:P=>h(N.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[m(N.id)?(e.openBlock(),e.createBlock(e.unref(ce.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(ce.ChevronRight),{key:1,class:"w-5 h-5"}))],8,HB)):(e.openBlock(),e.createElementBlock("div",qB)),t.showIcons&&N.icon?(e.openBlock(),e.createElementBlock("span",GB,[e.createElementVNode("i",{class:e.normalizeClass([N.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",XB,e.toDisplayString(N.name),1)])])]),N.permission&&N.permission.length>0&&!f(N)?(e.openBlock(),e.createElementBlock("div",KB,[e.createElementVNode("h4",YB,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",JB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p(N),P=>(e.openBlock(),e.createElementBlock("label",{key:P.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-neutral-900/50 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:E(P)||g(N.id,P.id,!1),disabled:E(P),onChange:v=>y(N.id,P.id,v,!1),class:e.normalizeClass(["w-4 h-4 text-blue-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-blue-500 dark:focus:ring-blue-600",E(P)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,QB),e.createElementVNode("span",ZB,e.toDisplayString(P.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[5000px]","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-[5000px]","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[f(N)&&m(N.id)?(e.openBlock(),e.createElementBlock("div",e_,[e.createElementVNode("h4",t_,[D[0]||(D[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.detail,P=>(e.openBlock(),e.createElementBlock("div",{key:P.id,class:"bg-white dark:bg-neutral-800 rounded-lg border border-gray-200 dark:border-neutral-700/50 overflow-hidden shadow-sm hover:shadow transition-shadow"},[e.createElementVNode("div",n_,[e.createElementVNode("div",o_,[e.createElementVNode("div",r_,[t.showIcons&&P.icon?(e.openBlock(),e.createElementBlock("span",a_,[e.createElementVNode("i",{class:e.normalizeClass([P.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",s_,e.toDisplayString(P.name),1),P.path?(e.openBlock(),e.createElementBlock("span",i_,e.toDisplayString(P.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",l_,[e.createElementVNode("input",{type:"checkbox",checked:B(P,!0),onChange:v=>_(N,P,v),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,c_),e.createElementVNode("span",d_,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),P.permission&&P.permission.length>0?(e.openBlock(),e.createElementBlock("div",u_,[e.createElementVNode("div",f_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.permission,v=>(e.openBlock(),e.createElementBlock("label",{key:v.id,class:"flex items-center gap-2 px-2.5 py-1.5 bg-gray-50 dark:bg-zinc-900/50 border border-gray-200 dark:border-neutral-700 rounded-md cursor-pointer hover:border-pink-400 dark:hover:border-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:E(v)||g(P.id,v.id,!0),disabled:E(v),onChange:Q=>y(P.id,v.id,Q,!0),class:e.normalizeClass(["w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600",E(v)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,h_),e.createElementVNode("span",m_,e.toDisplayString(v.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),p_={class:"space-y-4"},g_={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},b_={key:0,class:"text-danger-500"},y_={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},x_={class:"text-neutral-600 dark:text-neutral-400"},k_={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},w_={class:"text-neutral-500 dark:text-neutral-400"},C_={key:3,class:"space-y-3"},E_={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},B_={class:"flex items-center gap-3"},__={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},S_={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},A_={class:"flex items-center gap-2 text-sm font-medium"},V_={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},D_={class:"p-4"},N_={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},M_={class:"ml-2 flex-1 min-w-0"},v_=["for"],P_={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},T_={key:4,class:"mt-1 text-xs text-danger-600"},ei=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=$t.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=p=>{if(console.log(p),!p)return[];if(Array.isArray(p)&&p.length>0&&p[0].module&&Array.isArray(p[0].permissions))return p.map(E=>({menuId:E.menuId,module:E.module,label:E.label||E.module,permissions:E.permissions}));if(Array.isArray(p)&&p.length>0&&p[0].key){const E={};return p.forEach(_=>{const B=_.key,S=B&&B.includes(".")?B.split(".")[0]:"other";E[S]||(E[S]={menuId:0,module:S,label:S,permissions:[]}),E[S].permissions.push({id:_.id,key:_.key,label:_.label,description:_.description})}),Object.values(E)}if(Array.isArray(p)&&p.length>0&&p[0].id&&p[0].name&&Array.isArray(p[0].permission)){const E=[],_=(B,S="")=>{const w=S?`${S}.${B.name}`:B.name,x=w.toLowerCase().replace(/\s+/g,"_"),b=[];if(B.detail&&Array.isArray(B.detail)&&B.detail.forEach(A=>{b.push(A.id)}),B.permission&&B.permission.length>0){const A=B.permission.map(V=>({id:V.id,key:`${x}.${V.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${V.name} ${B.name}`,description:`Permission to ${V.name.toLowerCase()} ${B.name.toLowerCase()}`}));E.push({menuId:B.id,module:x,label:B.name,permissions:A,subMenuIds:b.length>0?b:void 0})}B.detail&&Array.isArray(B.detail)&&B.detail.forEach(A=>{_(A,w)})};return p.forEach(B=>_(B)),E}return p.data?u(p.data):[]},f=async()=>{s.value=!0;try{let p;o.treeData&&o.treeData.length>0?p=o.treeData:p=[];const E=u(p);i.value=E;const _={},B=[],S={};E.forEach(x=>{x.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;S[A]=x.menuId})});const w=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(x=>{B.push(x.menuId),x.actionsIds&&Array.isArray(x.actionsIds)&&x.actionsIds.forEach(b=>w.add(b))}),E.forEach(x=>x.permissions.forEach(b=>{const A=typeof b.id=="string"?parseInt(b.id):b.id;_[A]=w.has(A)})),l.value=_,c.value=B,d.value=S}catch{i.value=[]}finally{s.value=!1}},h=p=>p.permissions.filter(E=>{const _=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[_]}).length,m=p=>p.permissions.every(E=>{const _=typeof E.id=="string"?parseInt(E.id):E.id;return l.value[_]}),g=p=>{const E=h(p);return E>0&&E<p.permissions.length},k=e.ref(!1),y=(p,E)=>{k.value=!0,p.permissions.map(S=>typeof S.id=="string"?parseInt(S.id):S.id),p.permissions.forEach(S=>{const w=typeof S.id=="string"?parseInt(S.id):S.id;l.value[w]=E});let _=o.modelValue?[...o.modelValue]:[],B=[p.menuId];p.subMenuIds&&p.subMenuIds.length>0&&(B=[...B,...p.subMenuIds],p.subMenuIds.forEach(S=>{const w=i.value.find(x=>x.menuId===S);w&&w.permissions.forEach(x=>{const b=typeof x.id=="string"?parseInt(x.id):x.id;l.value[b]=E})})),E?B.forEach(S=>{const w=i.value.find(x=>x.menuId===S);if(w){const x=w.permissions.map(A=>typeof A.id=="string"?parseInt(A.id):A.id),b=_.findIndex(A=>A.menuId===S);b!==-1?_[b]={menuId:S,actionsIds:x}:_.push({menuId:S,actionsIds:x})}}):_=_.filter(S=>!B.includes(S.menuId)),c.value=_.map(S=>S.menuId),console.log("Full Result:",JSON.stringify(_,null,2)),r("update:modelValue",_),setTimeout(()=>{k.value=!1},100)};return e.watch(()=>o.modelValue,p=>{if(!p)return;const E=new Set,_=[];p.forEach(B=>{_.push(B.menuId),B.actionsIds&&Array.isArray(B.actionsIds)&&B.actionsIds.forEach(S=>E.add(S))}),Object.keys(l.value).forEach(B=>{const S=parseInt(B);l.value[S]=E.has(S)}),c.value=_}),e.watch(()=>o.treeData,p=>{p&&p.length>0&&f()},{deep:!0}),e.watch(l,(p,E)=>{if(k.value)return;if(Object.keys(p).map(B=>parseInt(B)).filter(B=>p[B]!==(E==null?void 0:E[B])).length>0){let B=o.modelValue?[...o.modelValue]:[];const S={};Object.keys(p).forEach(w=>{const x=parseInt(w);if(p[x]){const b=d.value[x];console.log(`Permission ${x} belongs to Menu ${b}`),b!==void 0&&(S[b]||(S[b]=[]),S[b].push(x))}}),Object.keys(S).forEach(w=>{const x=parseInt(w),b=S[x],A=B.findIndex(V=>V.menuId===x);A!==-1?B[A]={menuId:x,actionsIds:b}:B.push({menuId:x,actionsIds:b})}),B=B.filter(w=>S[w.menuId]&&S[w.menuId].length>0),c.value=B.map(w=>w.menuId),console.log("Result:",JSON.stringify(B,null,2)),r("update:modelValue",B)}},{deep:!0}),e.onMounted(f),(p,E)=>(e.openBlock(),e.createElementBlock("div",p_,[t.label?(e.openBlock(),e.createElementBlock("label",g_,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",b_,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",y_,[e.createVNode(e.unref(ce.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",x_,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",k_,[e.createElementVNode("p",w_,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",C_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,_=>(e.openBlock(),e.createElementBlock("div",{key:_.module,class:"bg-white dark:bg-neutral-800 rounded-lg border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm hover:shadow-md transition-shadow"},[e.createElementVNode("div",E_,[e.createElementVNode("div",B_,[e.createVNode(Cn,{modelValue:m(_),indeterminate:g(_),"onUpdate:modelValue":B=>y(_,!!B),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",__,e.toDisplayString(_.label||_.module),1),e.createElementVNode("div",S_,e.toDisplayString(h(_))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(_.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",A_,[e.createElementVNode("div",V_,e.toDisplayString(h(_))+"/"+e.toDisplayString(_.permissions.length),1)])]),e.createElementVNode("div",D_,[e.createElementVNode("div",N_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.permissions,B=>(e.openBlock(),e.createElementBlock("div",{key:B.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(Cn,{modelValue:l.value[typeof B.id=="string"?parseInt(B.id):B.id],"onUpdate:modelValue":S=>l.value[typeof B.id=="string"?parseInt(B.id):B.id]=S,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",M_,[e.createElementVNode("label",{for:`perm-${B.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(B.label||B.key),9,v_),B.description?(e.openBlock(),e.createElementBlock("p",P_,e.toDisplayString(B.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",T_,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),O_=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},F_=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),z_=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):F_(t),I_={key:0,class:"fixed inset-0 z-[100] flex justify-end"},R_={key:0,class:"relative w-full max-w-sm h-full bg-white dark:bg-slate-900 shadow-2xl flex flex-col border-l border-gray-200 dark:border-gray-800"},L_={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},$_={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},j_={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},U_={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},W_={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},H_=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(Ye,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",I_,[e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",R_,[e.createElementVNode("div",L_,[e.createElementVNode("div",null,[e.createElementVNode("h3",$_,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",j_,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Ye,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",U_,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",W_,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),q_={key:0},G_=["value","name"],tu=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=$t.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:lo,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:wo,DCodeTextArea:wo,DCodeCheckbox:Cn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(f.required=u.required),u.disabled!==void 0&&(f.disabled=u.disabled),u.readonly!==void 0&&(f.readonly=u.readonly),u.valueType&&(f.type=u.valueType),u.minLength!==void 0&&(f.minlength=u.minLength),u.maxLength!==void 0&&(f.maxlength=u.maxLength),u.min!==void 0&&(f.min=u.min),u.max!==void 0&&(f.max=u.max),u.options&&(f.options=u.options),u.endpoint&&(f.endpoint=u.endpoint),u.itemTitle&&(f.itemTitle=u.itemTitle),u.itemValue&&(f.itemValue=u.itemValue),u.returnObject!==void 0&&(f.returnObject=u.returnObject),u.clearable!==void 0&&(f.clearable=u.clearable),Object.keys(u).forEach(h=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(h)&&!f.hasOwnProperty(h)&&(f[h]=u[h])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",q_,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,G_)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=h=>s.value=h),d]}),null,16,["modelValue"]))}}),X_=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=lt.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(Re)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[e.vModelText,e.unref(a)]])}}),K_=e.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),Y_=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(Re)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),J_=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(Re)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(ce.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),Q_=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(Re)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),Z_=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(Re)(e.unref(io)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),e2=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(Re)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),t2=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(Re)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(ce.ChevronRightIcon))])]),_:3},16,["class"]))}}),n2=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class","size"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(Re)(e.unref(io)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),o2=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const o=t,r=n,a=Se.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),r2=e.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=lt.reactiveOmit(o,"class"),s=Se.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Se.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(Re)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(l2)),e.createVNode(e.unref(Se.SelectViewport),{class:e.normalizeClass(e.unref(Re)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(i2))]),_:3},16,["class"])]),_:3}))}}),a2={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},s2=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(Re)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",a2,[e.createVNode(e.unref(Se.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(ce.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(Se.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),i2=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(Re)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronDown))])]),_:3},16,["class"]))}}),l2=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(Re)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(ce.ChevronUp))])]),_:3},16,["class"]))}}),c2=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=lt.reactiveOmit(n,"class"),r=Se.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(Re)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(Se.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),d2=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Se.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),rr={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},Co={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},St={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},u2={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},f2={dangerouslyHTMLString:!1,multiple:!0,position:rr.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},h2={rtl:!1,newestOnTop:!1,toastClassName:""},nu={...f2,...h2};St.DEFAULT;var Ue=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))(Ue||{}),ti=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(ti||{});const m2={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},p2={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},g2={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},b2={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},ou="Toastify--animate Toastify__none-enter";function ru(t,n=!1){var o;let r=m2;if(!t||typeof t=="string")switch(t){case"flip":r=b2;break;case"zoom":r=g2;break;case"slide":r=p2;break}else r=t;if(n)r.enter=ou;else if(r.enter===ou){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function y2(t){return t.containerId||String(t.position)}const da="will-unmount";function x2(t=rr.TOP_RIGHT){return!!document.querySelector(`.${Ue.CSS_NAMESPACE}__toast-container--${t}`)}function k2(t=rr.TOP_RIGHT){return`${Ue.CSS_NAMESPACE}__toast-container--${t}`}function w2(t,n,o=!1){const r=[`${Ue.CSS_NAMESPACE}__toast-container`,`${Ue.CSS_NAMESPACE}__toast-container--${t}`,o?`${Ue.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return Bo(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function C2(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=Ue.CSS_NAMESPACE,l=k2(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(da)),f=c||document.createElement("div"),h=document.createElement("div");h.className=w2(o,r,a),h.dataset.testid=`${Ue.CSS_NAMESPACE}__toast-container--${o}`,h.id=y2(t);for(const m in s)if(Object.prototype.hasOwnProperty.call(s,m)){const g=s[m];h.style[m]=g}return c||(f.className=Ue.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(h),h}function ni(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",ni,!1);try{ar[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete ar[a],delete yt[a]}catch{}}const ar=e.reactive({});function E2(t,n){const o=document.getElementById(String(n));o&&(ar[o.id]=t)}function oi(t,n=!0){const o=String(t);if(!ar[o])return;const r=document.getElementById(o);r&&r.classList.add(da),n?(_2(t),r&&r.addEventListener("animationend",ni,!1)):ni(o),Ht.items=Ht.items.filter(a=>a.containerId!==t)}function B2(t){for(const n in ar)oi(n,t);Ht.items=[]}function au(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...ru(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function _2(t){for(const n in yt)if(n===t)for(const o of yt[n]||[])au(o)}function S2(t){const n=Eo().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function ri(t){return document.getElementById(t)}function A2(t){const n=ri(t.containerId);return n&&n.classList.contains(da)}function su(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function V2(t){return t?Ht.items.filter(n=>n.containerId===t).length>0:Ht.items.length>0}function D2(){if(Ht.items.length>0){const t=Ht.items.shift();ua(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const yt=e.reactive({}),Ht=e.reactive({items:[]});function Eo(){const t=e.toRaw(yt);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function N2(t){return Eo().find(n=>n.toastId===t)}function ua(t,n={}){if(A2(n)){const o=ri(n.containerId);o&&o.addEventListener("animationend",ai.bind(null,t,n),!1)}else ai(t,n)}function ai(t,n={}){const o=ri(n.containerId);o&&o.removeEventListener("animationend",ai.bind(null,t,n),!1);const r=yt[n.containerId]||[],a=r.length>0;if(!a&&!x2(n.position)){const s=C2(n),i=e.createApp(eS,n);n.useHandler&&n.useHandler(i),i.mount(s),E2(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?zt.update(n):zt.add(t,n)})}const zt={add(t,n){const{containerId:o=""}=n;o&&(yt[o]=yt[o]||[],yt[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=yt[o])==null||r.unshift(n):(a=yt[o])==null||a.push(n),n.onOpen&&n.onOpen(su(n))},n.delay||0))},remove(t){if(t){const n=S2(t);if(n){const o=yt[n];let r=o.find(a=>a.toastId===t);yt[n]=o.filter(a=>a.toastId!==t),!yt[n].length&&!V2(n)&&oi(n,!1),D2(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(su(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){yt[n]=yt[n]||[];const o=yt[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};zt.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{He(a.content,a)},t.delay||0)}},clear(t,n=!0){t?oi(t,n):B2(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",zt.dismissCallback,!1),setTimeout(()=>{zt.remove(o)}))},dismiss(t){if(t){const n=Eo();for(const o of n)if(o.toastId===t){au(o,r=>{r.addEventListener("animationend",zt.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=Eo();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",zt.dismissCallback,!1),zt.remove(t));break}}}},M2=e.reactive({useHandler:void 0}),iu=e.reactive({}),fa=e.reactive({});function lu(){return Math.random().toString(36).substring(2,9)}function v2(t){return typeof t=="number"&&!isNaN(t)}function si(t){return typeof t=="string"}function Bo(t){return typeof t=="function"}function ha(...t){return e.mergeProps(...t)}function ma(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function P2(t={}){iu[`${Ue.CSS_NAMESPACE}-default-options`]=t}function cu(){return iu[`${Ue.CSS_NAMESPACE}-default-options`]||nu}function T2(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var pa=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(pa||{});const du={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:rr.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:Co.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:St.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},O2={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:St.DEFAULT},theme:{type:String,required:!1,default:Co.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},F2=e.defineComponent({name:"ProgressBar",props:O2,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${Ue.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${Ue.CSS_NAMESPACE}__progress-bar--controlled`:`${Ue.CSS_NAMESPACE}__progress-bar--animated`,`${Ue.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${Ue.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${Ue.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),z2=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:Co.AUTO},type:{type:String,required:!1,default:Co.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${Ue.CSS_NAMESPACE}__close-button ${Ue.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),ga=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function I2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function R2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function L2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function $2(t){return e.createVNode(ga,e.mergeProps(t,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function j2(){return e.createVNode("div",{class:`${Ue.CSS_NAMESPACE}__spinner`},null)}const ba={info:R2,warning:I2,success:L2,error:$2,spinner:j2},U2=t=>t in ba;function W2({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return ba.spinner();if(r!==!1){if(ma(r))a=e.toRaw(r);else if(Bo(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?ba.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):si(r)||v2(r)?a=r:U2(n)&&(a=ba[n](i));return a}}const H2=()=>{};function q2(t,n,o=Ue.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function G2(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(pa.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||Ue.COLLAPSE_DURATION}),i=s.done||H2,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:y,onMouseleave:k}:{});function u(){const E=l.value.split(" ");h().addEventListener(ti.ENTRANCE_ANIMATION_END,k,{once:!0});const _=S=>{const w=h();S.target===w&&(w.dispatchEvent(new Event(ti.ENTRANCE_ANIMATION_END)),w.removeEventListener("animationend",_),w.removeEventListener("animationcancel",_),a.value===pa.Enter&&S.type!=="animationcancel"&&w.classList.remove(...E))},B=()=>{const S=h();S.classList.add(...E),S.addEventListener("animationend",_),S.addEventListener("animationcancel",_)};t.pauseOnFocusLoss&&m(),B()}function f(){if(!h())return;const E=()=>{const B=h();B.removeEventListener("animationend",E),s.collapse?q2(B,i,s.collapseDuration):i()},_=()=>{const B=h();a.value=pa.Exit,B&&(B.className+=` ${c.value}`,B.addEventListener("animationend",E))};o.value||(r.value?E():setTimeout(_))}function h(){return t.toastRef.value}function m(){document.hasFocus()||y(),window.addEventListener("focus",k),window.addEventListener("blur",y)}function g(){window.removeEventListener("focus",k),window.removeEventListener("blur",y)}function k(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function y(){n.value=!1}function p(E){E&&(E.stopPropagation(),E.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const E=Eo();o.value=E.findIndex(_=>_.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?y():k())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&g()}),{isIn:o,isRunning:n,hideToast:p,eventHandlers:d}}function X2(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const K2=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:du,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>W2(t)),s=e.computed(()=>[`${Ue.CSS_NAMESPACE}__toast`,`${Ue.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${Ue.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${Ue.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=G2({toastRef:n,loading:o,done:()=>{zt.remove(t.toastId)},...ru(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(X2(f)){const h=[];return f.title!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${Ue.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&h.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${Ue.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${Ue.CSS_NAMESPACE}__toast-text`},[h])}return ma(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):Bo(f)?f({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:f}):f}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:f=>{t.closeOnClick&&c(),t.onClick&&t.onClick(f)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${Ue.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${Ue.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${Ue.CSS_NAMESPACE}--animate-icon ${Ue.CSS_NAMESPACE}__zoom-enter`].join(" ")},[ma(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):Bo(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(z2,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),ma(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):Bo(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(F2,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),ya="vue3-toastify:url-change";let xa=0,sr;function Y2(){if(!(typeof window>"u")&&fa.lastUrl!==window.location.href){fa.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:cu().clearOnUrlChange!==!1,n=Object.values(yt).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&zt.dismiss(o.toastId);Ht.items=Ht.items.filter(o=>!t(o.toastProps))}}function J2(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(ya)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(ya)),a},()=>{t.pushState=n,t.replaceState=o}}function Q2(){if(typeof window>"u"||sr)return;const t=J2(),n=()=>Y2();window.addEventListener(ya,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),sr=()=>{t(),window.removeEventListener(ya,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),sr=void 0}}function Z2(){sr&&(sr(),fa.lastUrl="")}const eS=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:du,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>yt[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(xa+=1,Q2())}),e.onUnmounted(()=>{typeof window<"u"&&xa>0&&(xa-=1,xa===0&&Z2())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(K2,e.mergeProps({key:s},a),null)})])}});let ii=!1;const uu={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function fu(){const t=[];return Eo().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(da)&&t.push(n)}),t}function tS(t){const n=fu().length,o=t??0;return o>0&&n+Ht.items.length>=o}function nS(t){tS(t.limit)&&!t.updateId&&Ht.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function zn(t,n,o={}){if(ii)return;o=ha(cu(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=lu()),o={...o,...o.type==="loading"?uu:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=T2()),nS(o),fa.lastUrl=window.location.href,o.multiple?Ht.items.length?o.updateId&&ua(t,o):ua(t,o):(ii=!0,He.clearAll(void 0,!1),setTimeout(()=>{ua(t,o)},0),setTimeout(()=>{ii=!1},390)),o.toastId}const He=(t,n)=>zn(t,St.DEFAULT,n);He.info=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.INFO}),He.error=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.ERROR}),He.warning=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.WARNING}),He.warn=He.warning,He.success=(t,n)=>zn(t,St.DEFAULT,{...n,type:St.SUCCESS}),He.loading=(t,n)=>zn(t,St.DEFAULT,ha(n,uu)),He.dark=(t,n)=>zn(t,St.DEFAULT,ha(n,{theme:Co.DARK})),He.remove=t=>{t?zt.dismiss(t):zt.clear()},He.clearAll=(t,n)=>{e.nextTick(()=>{zt.clear(t,n)})},He.isActive=t=>{let n=!1;return n=fu().findIndex(o=>o.toastId===t)>-1,n},He.update=(t,n={})=>{setTimeout(()=>{const o=N2(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:lu()},i=s.render||a;delete s.render,zn(i,s.type,s)}},0)},He.done=t=>{He.update(t,{isLoading:!1,progress:1})},He.promise=oS;function oS(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=si(n)?He.loading(n,d):He.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(m,g,k)=>{if(g==null){He.remove(c);return}const y={type:m,...u,...a,data:k},p=si(g)?{render:g}:g;return c?He.update(c,{...y,...p,isLoading:!1}):He(p.render,{...y,...p,isLoading:!1}),k},h=Bo(t)?t():t;return h.then(m=>{f("success",r,m)}).catch(m=>{f("error",o,m)}),h}He.POSITION=rr,He.THEME=Co,He.TYPE=St,He.TRANSITIONS=u2;const rS={install(t,n={}){M2.useHandler=n.useHandler||(()=>{}),aS(n)}};typeof window<"u"&&(window.Vue3Toastify=rS);function aS(t={}){const n=ha(nu,t);P2(n)}const sS={v:"4.8.0",meta:{g:"LottieFiles AE ",a:"",k:"",d:"",tc:""},fr:25,ip:0,op:273,w:500,h:500,nm:"not_found",ddd:0,assets:JSON.parse('[{"id":"image_0","w":175,"h":173,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACtCAYAAADGWi9+AAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAYj0lEQVR4nO2dXVMb2ZnH/+cg1BIIkABjPF7bxFvZnamaqYHUrh1XqjbMxc7YV4Mucj3kEwzfIOwnCLnei+BP0PgmME5twWQry8DWFrh2qpKt3aRgXB4DtngRWKIlcc5eSGLUp7ul7qPWS7fO78rdWK1G+vP0c57zvAAKhUKhUCgUCoVCoVAoFAqFQqEIMqTTN9Au9Ofb0+B8CgzTICRJCZ8GAHAkOfBxnZeeEYJdAGAMewD2ALIHXO0hFttNfzJz2up7V9gTSvHqq5tTQN8sCKYp4dOc4+ctfLt9DuwCfAOUbqQ/fbDbwvdS1BAa8epfbc2Bk1kCPgfgXgdv5YwDG+BkBbH+FWWZW0egxauvbs4CdJ4QzAEY6fT92MGBZ0rIrSFw4tXXd5IwjHkCsgCPFjYej6E/EkF/fx80LQpKKQBgIB5zfI1hFHDFGAAgn78EAOTyBkrFEoqlkpe3P+McK+gjS8q18IfAiLfsx9JFt1ZW06IYiGvQotGyaPsjvt8TYwyXRgH5/CVyeeNa3I0gBF8zxhbTTx5t+H5TPUTXi7dGtF80+r+JwQEkBuMtE6sbLt7lcHGRRz5/6cYy73OChfRnD1facW9ho2vFq6/vJHFZWGok2ng8hpGhQSQSA9duQLdQFfLFuxxYxfWwQ1liObpSvPraNwsEZBEO7gGlFInBAYyNjnTMwnqBMYaLixwyx2d1rXF5cccW0k8e7bXv7oJLV4lXf749TRlfdto0oJQilRxCKjncdVbWLRfvcjg5Pa/nH59x8MX0458utfO+gkjXiFdf3VokBL+y+1kYRCuSy1/izdsTGEbB9ucVV2JeWWFnOi5efXVzihK64mRtU8khjI0mQyNakWz2op47ccY5WUg/ebDc5tsKBB0Vr766PU8IX4KNbxuPxzAxnoKmRTtwZ+2FMYbM8SlOTs9tf845niIWXVCbHGY6Jl59bXuJgH8pnqeUYmx0BKnkcCduq6MYRgEHRxlbV4IALxhnc8qN+IG2i7e8Q1ZYJsDn4s80LYr3Jm8EIoLQSt68PXaywmecklm1Q1emreLV13eS1Chs2Pm3qeQQboyPtvN2upqLdzkcHGbs4sPKD67QNvE6LcwopZgYT2F4ONGuW3Gkut1bzn/ovPUvFkv4/uCNrRvBOfllrwu4LeLVn29PE8Y3ICzMKKW4c/tm2xZlhlGAYRRQLJWQyxtgjDmGqmrpj0QQ6Y9cJ/XE4zHEahJ7WgljDEdvTpA9v7D8rNcF3HLx6qubU4TQXQjC1bQo7ty+2VIBFIslXLzLIZ83cPEu5/v1q8k/g4MDdTPT/ODgMKMELNBS8Tr5uK0UblWw2fN3rqyqX1S3rFPJoZY9SU5Os3jz9sRyvlcF3DLxtlu4ufwlstl3ttbJCwR4wYEpNJHc3h+JYGx0pCV+fDZ7gYOjjOU8p2Sm16IQrRPv2taKGA5rhXBz+Utkjs885tJiw0sRZbliAwDoLAimCTANF4nwrdrWdhBwz4XRWiJeuw0Iv4VrGAUcvT1pKNpycB8rANvwM+XwhyJPPmcXs66lFZbYzgcmwAumRWd7ZSfOd/FWtnx/W3uOUor7U7d9EW6jrdQK+xxkBfxqqR07UuXc4+IcJXyhXhm931vedgLmwLP044dzvrxBl+OreO0iC36Gw3L5SxweZurlxO5zThY7uXjRn29P44ov1EuiHxsdwdho0pf323/52rIw5Rz/kn7ycNGXN+hifBXvs7WtXdHyTE6M+fK4zByfInN85vTjjotWpFH5Ujwew+TEWNObIYwx7H/32vIH3QsLON/Ea5eP68eWL2MMr16/cfJtuz5xW1/dnKWELtm5E5RSvHfrRtMxYsMoYP/la/H0Ptei02H2f30Rb2UHbaf2nKZFce/OraauWy/LKmglM/VKm/x4OtnFgDnIb9KPHyw0deEuxhfxiu4CpRT37txq6pFoGAW8fHVon5jS5dbWiXplTn74wS9fHVqeUGF2H5pe/utr31hW2M0WRtYR7j6nZDaIwgWA9KcPdpkWneUcT8WfZY7PcHBo3XzwwuTEmCWiQxlfbuqiXUxTlldf30kSo7CHmkdhPB7Dnds3pa/pJNywxTArbsSvxfPNrhNs3YeQbh83Z3kvC5YSnonxlPTlnITLOZ5+/vhhqBYf6cc/XeKc/FI8f3J6jmxWfos7lRxGXFgAEsKX9PUdf2JzXYS0eMsxXXMYqJmkFMYYDo6sydec42n6ycN52fvsZtJPHizbCfjgKNNUFtzYqGVNOILLQugWbk1YXrpoOqK0qQXHq9fWpOswC7eKo4AP7aMsbhiIxzA8ZI5eEIKFsFlfKfE6WV3Z7d/M8alllUyAF2EXbhU7ATs9idzSC9ZX0vJara5stW81K0xgn2nRWakLBpSygM1RCMMoIHMs5+b390dCb309i1df30lW2oxeI2t1GWM4tIaHzjglc2FanLkl/eThPCH4uvbcyek5ci7TPUXsrW8xNEk73hVnGPMQEm9krW7m+NS6Jw++GNaguhtYNDoHwPQoOrSvIm6IvfXli83cXzfhWbyVjuTXJAblWosaRsGS1lhO5wvmBoRfpD+ZOeUE87XniqUSTk6zUtdLJYfEU/f059vTcnfXXXhSXaWiwFRBYPNocsWRtRbrDJyFakEhS/qzhysceFZ7LnN8hmLR0xgBAOUcE0v48oqH4nP2aDLpfO2RbAfyXP7SugcPvhiUJJu2UP5DNrkPdVJC65IaMVtfcc0SVDyJV/ylR4YGpd7ULrrQ6+6CSPrJoz3OYfpMsucXUtY3kRgQT43oX20FXsCuxVv5ZU0+gs2H0hBbq8vJoucL9QKx6BJ8sL7VsnwTLPjW173l5WS29lB2oZbNvhNP7YcxacQP0p/MnNpZX5nIQ2IwbjoOg+vgWn2VyZLXiB+GG4rFkrVgUFnd+thY3zOJxB1b1yHgUQdX4i3XY5mjDGLmkhtskk3OlNWtT/qTmVMOslx77rR+5bQtlFLrd3bFA219XVrevtnaI02LSkUZsudml0H8UhQO8CuT61AslaSSdsSnJaWYbeq+Oow78RKYHi8Dcc3zGxWLNh+48KUo7Ek/ebRHgBe152TaWonxXs7x8+burLO4Ei8l3CReLeo9Z1d0GcpZYyqu6xYGczlPLm94voZdlXKQ/V5X4hX/QmX83bzwYZdbMClcw7np8zKMglTUwer3IrzitfvLlPF3rYs1tuH5Ij1M5Sm1X3tOJtsspvULZ/iU9E11mMaWl5t/ORmra7e4UHN2vcM5NmqP3XbGrCUSMRueIC/aGouXmR8r/RHvVlcUr5izqnAL2ag9ujSKnq9gSdLhCGxyemPxEmL65fr7+zy/iZizW+6Pq/BMH0x5zjLhspgYcajT1bLbaSheS6RBojrYujIme54vooCYpM8Y87xoC9MYXM+/iWy5j5mrPc8XUQAohxhrjy8lrK/o+v3Q+T1YuFiwNe8TWR5vsVjPlvk0DUHTtX2RLpgx5wcNxSv6RH6MbOrF4kq/YNws3nZOPOo2wuMA9QocFr+3V2m5eHv5w1W0lpaLV1xQiAsOhUKWlotXXNlWBvQpFE3TevFaV7bSkyUVilrUgi1oCDuevYwb8Zrqp3o5NNMN+LHjGRYaipcQc2jmSqZnVkh2dLoRf3Y8g0lb3Iaw7Oh0A2JhgB9ZfkHd8WwoXsawV3ssk0Nq/YDprOeLKKpV3CaanaAJBHfH043l3Wv2TSxplCS4pScdhVIfMvwsxmff7v8FARfiNacvyhT+WabTQIlXCqEwQKYQ1jIijDRvnDqFC/Ga0xdLEo3exARoAPfsHoGK+oglO5qlHq0xor/LOAmkvwu4EK9Ya1YslaQSoK2POHMjE0V99PWdpLhYk8nwsz452V4Tt9VR3EYbTH6RTAK0pVEJCXarobZTKMzWHtobhMZYG7/w8FpeAOAwx3plIg6DQotNAnwepsk0LUdoSWppWeqCYtH61AxyFbdLy8s3ao9ku7VYAuohmkzTSioTmExz7xIJ71067WbdNXdnncWdeCndqD2UsbyA1VpQEo7ZCC1H+CO3bRbtAtHoMKGUPmi4Em+latWU4yAzG1ecTMOBj4PcK6tdiOOnZIQL2HxnxPxEDRqut4c5zL0WLi7ynt9M06LW3baQTKZpFXYTmGzGUzXEtrdZNLohfWNdgJe2/qZGb7Kugzj6ihB8oWK+zlBqHpUbj8ekogxiS1RC8HVQt4WruBdvrN8k3mKpJOU6DA8nbDKhzF+Qooy+ujkrxnZlrC5gfVIyoetkEHEt3nJ7efNgOxnXAbB+ARXrOyt1sRBDCF2uPe6PRCQXapeWlltiy9Qg4i0lUnAdLt7lpHJDU8lhi+9LCVVd0mvQ175ZgODr3rw5JnUtcQITIfg6DI29vYm37DpcRx0YY7i48O46UEotvi8HPq58YT2Pvro5RWCekhSPx6S2gxljFn+XsXDMAvEk3spcMJP1lR0pOjycsMk2I4sqdAZQSpchFKpOjKekrmUzcPtMXL8EFe+VFH3EMplGZuEG2H4hI5Tx5V7eNtZXtxbFRdrY6Ih0rdqJMPaKgywHPcpQxbN4058+2BWbQ4sfkFs0LWrrPuCy0JP+r766OUsIflV7rvwZyf0tZ7M20zJDNIFJqoaNMbZYe5zPX0rNRwCAsdGk1X0g+KLX/F/9+fY0IdTyOJ+ckFukAVaXjnM8DcNCrYqUeCuZSKY0yTdvT6RvYnJizBL7JSC/1le356UvGiD09Z0kYXwFgp87OTEm7S5kjk+t4THB5Qs60tXDnMBkGQ2jgKzETFygXET43q0blvOE8N+GXcD6+k6SGoUNCGGx4aEEhocTUtdkjFldOYLfiZ3Vg460eNOfPVwRfd/M8Zl0T4CBeMz2ERlmAVeFK/ZAjsdjmJSM6QJlq2v1dfEj6Qt2KU31bRB932KphMyx/EJ2eDhhWcAB4RSw/nx7mhiFXVG4mhbFbZunkFsMo+C0gP5AX9tWbkOV9JNHG+KW8cnpeVMtocZGkxgesj4uywLeWpa+cBehr27OEsY3ILgKmhbFnds3mxp6cnCUcfwZAf8yTHH05jvmcLYAIde33gfohsmbY7YJKITgi2dfbW0EOQ6sr24tEkLXISzO/BBu5vjUYjj6hOtRzkNjfYkfF9HXvlkgIL+uPZdKDuHG+GhT181mL5z+EM44wXz6s4eB2SnSVzenKKXLdpPW4/EYbt+60ZRwDaOA/ZevTedGhgZw/94kdr79q+k85+xHYQiZ+dKrLP34p0t2GxeyO29VhocTeM/+Sx0hHLq+trUShFxgfe2bBULorp1wh4cSTVtcxhi+f/3Gcn7mo/u4e3vcpnKbhKJ20LdGe4yxeYjuw2EGRYkmJbUkBgdw5/ZN23gnAT4nhO7qq1uL3ehK6KubsytrW3uVp5JlJTo5MdZUVKHKwWHGEtP98P27GBkqp0/ev3fT9DMKMt/0m3YBvrgNVfTV7XlC+G9rz/nhywFl65I5Pq23FX3GOZYQiy51eu9eX92cpZRachSqaFq0qQ2IWjLHp5adtPHRIfzsHz+4Ps7lDfz+D+ZC4bnHD3397juB77+Avrq1LJZpDw8lfLEwQDmx+tDG0tRwxkGWwa+W2unX6es7SVwW5yrFkvec/t/Y6Ih0roKI3ZqgP9KHf/75NPoj5uaGv/u3/0KxdHV9zCmZCfqmhf+Nc2PRBWIUpmvjl9V8Uj8EPBCP4d7dWzg5zTqlY44Q8C9B6JfP1rZeMPBlcL7SCiHr6ztJFAqzYJgjRuGLeqYgHo9hYjzlWydzwyjgyGZL/mcPPrAIFwBGhgfw9rjmqXV11XVullda8ujQVzenCKG7EPy8G+MppJLDvr1PsVhC5vjMkmztwD7n2ADIBvqwK2N19NXNKVA6DYZpSmGpL7OjPxLBzZtjvkwOrWIYBbx8dWjZRZv5sLxAs+OP//knk3g5Z58EuVsO0CLxApUdpHIg3pJsIrtn74RHEV9DgBcgOGUcp+JkyfJ/IMnqDAg3Qq0lHo8hlRyS7rHghJNw79+bxEfv33V8nRKvR+wWcEBrBAyUF3Vn2Qucnp7X84lbRrWTTSo51JJBJ07CvfPeOH7y0f26rxV9XgD/NPf44b/7fpNtpOUrTicB+7mIs8MwCsieXyCXN1o6wagq2EQi7ruVrcVJuJMTKTyc+XHd19pFGwjwgmnR2U5HZpqhLeGSTgm4CmMMufwl8vlLXBpF++4xLtG0KLRoFJrWjwHJBiBeyWYvcPT2xHLPI0MDjgu0Wv6yf4Bv//yd5XzQBdy2WJ+TgP2KA3uFMXbdZ7iemDUtCkop+iMRX4aXeMUujguULe5PPrrfULgA8Ps/vHDs7BlkAbc1UO0k4P5IORm9lwfiiTDGcHCYsd1id+PjVnGyurUEVcBt32VxikIA/ofSgophFPD96ze2i85GUYVacnkDG//xrbhQsyWIAu7IFqH+fHuaMr4sJmIDlSqCibGOPKK7ASc3AagfxxUplq7wx+0/4ezcbLnHRkccrx80AXdsf1tf30nCKCwT4HPxZ9WOOr1khQ2jgIOjjG1kpD/Sh589+OA60aYRTsKtpqnWSTUNlIA7npxhlwtcJR6PYWx0xNfdqW6jUcJRaiSBR//w964WZgDw+ugEO//9V4uroGlR3Ltz6/rYrYDLORuX00D3za/ouHiBaz94BQ4JLcND5dq2sLkSVdHWC9v1R/owOZHC305N1rW83716i5ffvzHnL1RwiujUEzBAvgf4MYAPTWeBF4yTpfSTB8uON9MmukK8QNWNKC4S8C+d/k9YRJzNXiBzfOZ5F3AgrmEgHsVYquxOFUtXyJ6/sxVslUahyPoCdqYb3IuuEW+Veou5KsNDiZZtwbaKci+FbCNLewZO/hWE/wJ10irdkkoOYWw02TCGHlQBd514q1RiwkuwCalV0bQoUiNDSCQG2r7J4ZZc/hLZ7LuGSUOc4yli0YUf/MzCAik3dnH8/Z2QWSvUi3KMDA2gWLqy3ejopIC7VrxANcHb3ZeYGBxAYjDeFUKu5lVcXOQbugac4ynAFu3yjcuulDFPQebrPYlqIYTg7t9MenoqOeVNjI8OYebD+9c1cLm8ge2d/7VEMTol4K4WbxWvligejyExGIemRdsSqSgWS5Vmg4brbvH1RGvHD6v+vimATxGKSXDMA9DE/0spdaz7E/GaqeYUhuuEgAMh3ipuS21E4vEYYlo/IpEINC2KWCVfQYZc/hKMMRhG4TpjzUOSj68lSvV2K90IWDbFslsEHCjx1qI/357GFV8gBHOQ8AuBck5FxEXkoipWWQjB14yR5VaEl2QF3ExuMNAdAg6seGvRv9qaA8NcM0L2G0LwNeN8pVX1c7V4FXCzwq3SaQGHQry1VCzyXKXGbBptEjMBXjCQDRC+gWh0o92LF7cC9ku4VTop4NCJV6QsZkwDfIpSzIIj6Xbl7sA+IdhjnOwCbA+c73bLtmkjAd+cGMXh0bFvwq3SKQGHXrz18DS4MBbbDUKySj0B29GscKt0QsA9Ld6w4lbAfgm3SrsFrMQbUhoJ2G/hVmmngJV4Q0xFwN9A2MholXCrtEvASrwhZ2Vt6xzAdZMMsQlfq2iHgLszm0XhC5UF6bVw+yN9eDDzd215b6fqDw58TI2CL93tlXjDDKUmgYwMD7iuyPCDVgtYiTfMcD5VexiJtD+Jv5UCVuINM5ybmgdmz5sbsyBLqwSsxBtmYjGTeHN5A3/+v1cduZVGApa5phJviEl/MnNazhv+gf/5yyt89+ptR+6nnoBlBhwq8YYetghh0M3Ot3/tOgHLDDhU4g056SeP9jgnC+L5Tgv4wcyPrZEPxhe9XEeJtwdIP3mwzDn5pXi+kwIeiGv48H1zMQwBPvcyV0+Jt0foRgE3O+BQibeH6EYBT06khDNk1u1rlXh7jG4T8K0Jc4iXALNuX6vE24N0k4DHRy2dQF2XbSnx9ijdJGBZlHh7mKALWIm3xwmygJV4FR0V8NvjrHjKvtufDUq8CgCdE/DrI3NBBQc23L5WiVdxTScEfHAkTq7nG25fq8SrMNFOAX/36q215y/nK25fr8SrsNAOARdLV/j2z/umcxx45qWvmxKvwpZWCrhaWWwZbkjJopfrKPEqHKkn4L/sH0hd06kknoP8Jv3pg12Hl9mi+jYoGuI0M3pyIoWP3r9rzQxzwGlGnGwvByVehSucBAyUO/DcvT1ul6eAYukKrw9PHGfEAdjnWnRapgmJEq/CNfUEXGV8dOj637l8wXaCUJVmu+co8So80WhaqVtqR3fJXkOJVyGFvrq1KDMnrjyfgy360ZBbiVchTXU6EwifqySROwl5n4OsgGLZa0ShHkq8Ct+oFE9OmU4GpKO8QqFQKBQKhUKhUCgUCoVCoVAoFAqFa/4fCbut2hEefs8AAAAASUVORK5CYII=","e":1},{"id":"image_1","w":85,"h":85,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAEE0lEQVR4nO2d/XXaMBTF72OB0AnqThA6Qd0JygalEzQj0A3aCUo3gAnqbEAmKNmATHD7hyTqEuMvycgW73cOJzYY83zzJMuS3pNgJJDMAWT2tQAwb/jKEcDe/RWRYjjruiGxfpjkEkBuX/eBTvsEI/QWQCEix0DnHS8klyS3JI+8DluSK5JNXj8tSGYk11cUsoojyQ3JLLYeXlgxNxGFvMT0xCU5p/HMsbPhFKoFmjozZjHvypHkQ2zdKqHxzm1kgXwoGLBK8G5S0bQvtwDuvK2JywuABxHZ+J5o5vNlmqLzG9MXFDDX8JPkd98T9fZUkhsAn30NGCk7AKu+Dw+9RE1cUMcTgLyPsJ1FJblHuMfKsdNL2E51qvXQWxEUMNdasGN7trWoN1Lkq7iHad20ppWo9i5/i4I6PlinakVjnWrbob89DEqJL23asbWi2rrkgDTaoSF4gblx7esOair+G6igZe5gNKnloqg0PfOfAhqUCvck13UHVBZ/LfaNvABYiMih6sNLnvoAFbSOOwAX+wheeartAvszoEEp8bFqFLfKU9eDm5IO66o3//NU9dJevPLWc09dXc2UdFidv3HuqUfoDaoPb8o9WSdPte1SFbQfq/LO7NIHSidW5Z1T8dei78079zAwA7ToB2LpNlzxz+PYkRS521BRw5G7DQEAkoxmSlq8F5H9zPbsK2HIAFP8s6hmpMUCUFFDcxJ1EdmQlJgDRtTxT3ydDhngOetPecVbQEUdBC3+A6CiDsAMZihaCYjWqQOgooblGTCiph8Uez0OgBG1dgab0okjoJ4amj2gnhqaA6Cd1KExndR25ymqKYngZlg7UbUK8OfRbThRO4W0KJWcNHSiFnHsSIrCbcwAwE6u2sWyJgGeyxEr5cdUrQL6synvlOdSafBEf96VgypOnmqrAPXW7uzOo1R0ero/9dPTreK/rmjQ1Hmsik7RkB8/2oX8qLe2ptJLAQ2j9OH9pWjqyuEU2xJYD2nRxPlRF57eFO9fAPgQ2qKJ8wwT7Huxc79p4G8FEzGs/KMxX1WtqPamNc4Eg3H41iZNc6u8VDZV21dfiybOTkSWzYd1SPZFcovbzVTRKelXF1HnMH2Gt5TsC+iRRa1TWrobFLZVdp9zOk37sf+tHLcxUOg8tPP4Xd+slHOYbsJU27C9M1ICPSeoichRRHKk2Uewg4eggOesPxFZAfiCdB4QvonIchQrWZBckNwPlYX7Chw41shHxl95og/fOfZ8/zQrUUwhPX1BclqBeSRza/jYKDjWot4WGnHHsIbKllMX8xyaVSseeN0b2oGmns+uea1RFvmyF1le5CvksM0j/i3yFWU2Y7SV08rQ3DAymIhutxRdBhvrWcEzzBiaW5LuALMknU4JTZW/U1qiUwiP8oYAAAAASUVORK5CYII=","e":1},{"id":"image_2","w":186,"h":242,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAADyCAYAAAD6Bd/wAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAPn0lEQVR4nO3dXVobR74G8LeqW60vGgkZFA/J2OZ54rkNZwXxDiY7GGYHnrOBISs4mbMCZwPnOCsYZwf2re05Mk6GsYUQSE2jr+6ucyGaMCBA6KtK1Pu7sUBSV7n00vp3qVoNEBERERGRScSiGqrVjp7ETrytlNoWSjw7a/3bRbVP2u1B4QMEPiioD0jw6unWxqtFNT7XoL+t1bellDtKiGdCqW/m2RYtrZ8g8NKJnZdbW2vH82pkLkF//7GxoyCeXw53PptBLuci4zpwHYms50LKhb2pkEa9foQkUegPYvT6ETq9AaIoufiQAMD/OImzu7W19mHW7c80Ze8/NnagsAvgcfo7v5hFseAhn80w1PRvoihB2OmjHfbQ70cX7/px1oGfSfLe1urbwnFepHtw15Xwi1mU/TzDTWPpdAcIwh6CsHf+OwX1vZu4P8yipJk6he/2DnYFxF8BQEqBkp9jwGliUZSgfniCTm8AAFBCvFFxvPOHrerrabY7cRprtaNyLOKX6cxJMe+h+mCFAaeZCDt91A9PkCRq+AuBP3/9aP3FpNubKJUXSxUpBdbXivCL2Un7QDRSkijUD08Qdvrpr378+vH6ziTbunPQz6YMfwaw6roSD9d9ZD13kraJxtJsneKo1Ul/nCjsdwr6xZB7nosvq6ssVWghgrCH+uFJ+uOdwy7HfWCtdlQWjvMCDDlp4BezqD5YSX/807u9g927PH/soMcifimU+sZ1JUNOWlwMu4D46/uPje/Gfe5YQX+3d7ALgW+lFHi47jPkpI1fzP428aHwY6129GSc590a9Le1+nY6T76+VuSBJ2lXfbACb5jD1VjEL8Z5zq1BP6vLUcx7nEIkY1QrxeENgW/HKWFuDPr7j42ddK78woEAkXZZz8VaKT/8QeG/b3v8zXv04QItlPwc63IyTqVUgOtKAPj9P/YOn9/02GuD/v5jYwfAY9eVqJQKs+0h0Yyk2VRQ/3nT464NuoJ4DoB1ORnNL2bP9+pnO+eRRgb9ba2+nS65Lfv5uXSQaFYuTDdee1A6MuhSyp10A6zNyXSrxVx684+12lF51GOuK12+A4BiwZtDt4hmy3VlOq+O2IlH7tWvBP3sk6bHwHDunGgZrP5Wvjwbdf+VoMdOvA0MT2QmWhZexklvPht1/5WgK6W2ASCX40f9tDzyufMd8+NRdfqVoKdfLpRxnct3ERktrdMjRNuX77t2Ht11xl7BS2QERwxnCIUjnly+72qaz0525ipFWjZpua2UenL5vmt325w/p/uE9QlZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysYeWJotxchCLvo9SPE6QVVyWg5z0Uu62KlmINj4GmYRgW9FXRw0AwxiGLdXaE7Oj2/6G0bJT+PjUrRqK9MMSLocaLw66fjC4NFy6wVdBCEXTxc91Ey5NuYtQc9ThQ+/rOJbj/S3RWaoSRR2K+3AcCIsGs/GGXI77f9ehutoHP7A+dMa9APmicMuQU+NQLtx13agh4nCs3Wqa7maYGSROGgGWrtg7agt4IOEk4dWiMIu1qnirUFPQh7upomDZJEaZ1V0xZ0TiXap9sbaGtb+6wL2WMQJdraZtBpYXTOvDDotDCFnL7rYmkLOr9/3T6OxquoaGvZ/+0iqGSJQk7f5Tw1Bj2rq2nSIOM6yGX1La3SGnSTlnHSfG1Uilrb13owulld1dk8LUgh72lfwag16IW8hy/WfZ1doDmTUuCrh1eub7v4fujuQKVUwPqa3rc1mo+M6+DxZsWIU+u0n3gBABuVFeSyGXw2YDknzUbJz+OLdd+IkAOGBB0YHpwW8h5Owi6ax6dcp76EpBTwizmU/RwKeX1TiaMYE3QAcKRAyc+fH7hw4dfykFJqnT68jbk9A4zbK9Dy0n4wSrQIDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUjv2Q0PrtuvM5Lai9aLptBIe8t/PvEZzXWjiNRyHnGfqOuUb3q9iI0W6doBR3dXdGm5OexUSnO/UJmp50+mq1TBGFvptvNuA5Kfg6VctGYiwAABgX9cyNAs3WquxvatYIOWkEH62tFbFRW5tLGPMd6EMVoHIVoBV1sVleN+epv7TV6nCjs7R8x5Jc0jkLs19sz3WacKNR+OVzIWA+iGHv7R8a8O2sP+udGwCtbXKMVdGYa9l8/HS/8kjn79bYRr6/WoNtej4+jFXRmUkcfNE+0Be6XT8eIE6Wl7ZS2oMeJwkHzRFfzS+VzI5jq+XGitJaGSaLQPA61tQ9oDPpJ2EWi+a98WQyieKp3vlbQ0T7Wuo/BtAV91tNa990049Vq6y8Pk0Rpfc0Z9CURTlFfm3LNVp0fAGqfdaHxTFp6mHQl7kGUaGubQb/nBgOTgq6vLwz6PZfNZnR34dy8lzXcRFvQpUHrIJbBpCExab1JxtW3X9XWctGQNRDLYpo1I6asN9H5mmsLul/M6mp6KU0zXiaMtZRC6x+ctqCX/LzWmm2ZZFxnqrCW/Lz2UrFSKmhtX+vB6Bfrvs7ml8a04+RIMbclv+PIuA4q5aK29gHNQfeLWZT8vM4uGK9SKsyk9KiUClrGWkqBrx6WtR8Ua59e3KyuMuzXKPn5mb7rLXqspRR4vFkx4vQ6/T3A8AXIuBKNI70r3Ewhz0qNedS1ixrrnOfid9WSESEHDAk6AGxUVlBezeOgGSKwdGWjlAJlP49KuTDXA/V5jnXOc1Ep6ymTbmJM0IHhQctmdRXAKk47fQyiGH2DPsKeFy/jIOtlFrr3uzzW3X6EOJ58LUouO+y/qTNpRgX9IlM+5LBBIe/d+/HWfjBKtAgMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBWO/ZHQQxRgM4nv/jbpexkHGdZA5+1eHacc6vdqcyV9UalTQ40SheRyiFXSNurT3omRcByU/h0q5OPdLocxyrC9eVMAvZlEpFYwLvTFBbwUdfGoEVl4AIDWIYjSOQjRbp9isluZ22cRm6xQHzZO5jHUQ9hCEPRTy3tnVNcz4vnQjavT9ehv79bbVIb8oSRR+/XSMz41g5tver7fxeQE7lNNOH//3yyG6vWiu7YxLe9A/NwK0go7ubhgp3fPOyn69vdCxThKFvf2mEWHXGvQg7KHZOtXZBeM1jkKcdvpTbycIe1p2KEmi8K96a+HtXqY16PN4a76P9uvtqbehc6y7/Wim70yT0Bb0VtCxcmZlEoMoRhD2Jn6+CWPdCrpa29cW9GleOBtNM14mjPUgimdSgk1KW9BDjf/pZTRNSEwIOqD3NdcWdE4l3s2kpUds0DgPosmvYzot7dOLNF+93kB3F87pPE5g0O+5TMaMTyYBzH1Zw00Y9CUhJwyJKR/BA0DW07fiRFvQTVv0Y7riFOOV0xiwi3LZjLa2tQV9XguW7qtpxqu0mp9hTyYjpdC6c9MW9JKfn/jt2DZSCqwUcxM/34Sx9os5O2t0RwpUSgVdzS+VjcrKVCHRPdZSCnyx7mtrH9B8MLpRWWGtfov0RIZpbVRWtNXqm9WS1r05YMCsy1cPy8YcLJkm57n4XbU0s+09+rKy8LHerK4acTymPeiOFHj0ZQUlX/8Bk0kqpQK2fv9gpnvCdKwXETwpBb56WDbmdTViV+pIgc3qKsp+DgczWn+9rAp5DxtrxbmVdM5ZAE87/bmMtTw7HljEea93YUTQU4W8h8d573ylW38Qo9ePjFqvMWsZ10HGlfAyDgp5b2Ef8Fwc6yDsIY6Ticc657mQUiCXzRhRpoxiVNBTw7PhzXjLu+8yrmPF7Jf2Gp1oERh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZIVRQW8BQK8fLbgrRNNJbriIwdWgK7y+7UlEJur34+GNBK8u33c16ALHANAfxPPtFdGMDeLrM3sl6ArqNcDShZZLkihEUQIAeLq18ery/Vf36Ge7/R736LREOr0BAEAJ8WbU/VeCnv419PvR+V8Ikek63WHQhVKvRt0/enpR4WcACC2+3ictl/OsiqsHosA1QRdCvASAdtibU7eIZqf3W/XR/vrR+stRjxkZdJnIFwDLF1oOraCb3vzf6x4zMuhbW2vHAH4EgGbrdOYdI5qVJFEIziqPJEl+uO5x1y4BUIl6AQBB2ONenYx1HHSGNxR+/sNW9fV1j7s26E+3Nl6lB6Xcq5OJoijBUWsYdKXU7k2PvXFRV/rkIOydT98QmaJxFA5vKPw86kOii24M+tmT/wYA9eYJ17+QMcJO/3xKMVHJ89sef+syXSdxdgG0oyj57S+ISKMoSlA/PAEAKKjvb6rNU2KcDb+rHTwTUvwdAKoPVuAXs1N1lGhSSaLwz3ob/X4EJcSbp48ebI/zvLFOvHi6tfFKQX0PAPXDE9brpE3jKER/uOCw7cbyu3GfN9YePfV+r/ECwJ+kFNisriLruXfrJdEU6ocnF+fM/2OckiV1p6ADwPsPjVcQ+FZKgfW1IssYmrskUWgchechh8Cfv360/uIu27jzOaOOcr4D8FOSKNQPTy5+/Eo0c2lNPk3Ih0+bUFrGAEAx76H6YAVSTrw5oivCTh/1w/Np7bZK1B9vmy+/zlTJ/Mfe4XMF9V8AwFKGZuVyqaKEeKPieOcuNfllU++C39bq28JxXgilvgGAfDaDtVIe+Vxm2k2TZZJE4TjooBV0L344+TcncXbPFhpObGa1xru9g10B8RcAq8Aw8P5Klnt4ulUUJWiH3X8LuBLiDeLk+aSlymUzLaprtaNyLOMfcFa7A8OSppj3UCx4yGczrOMJwPBkiW4vQjvspfPiqT0I7E5ywHmTuaSuVjsqRzJ6LiB2ADy+eJ/nucg4Ep7nABju+el+i+IEgyhGkij0+zF6g2jUuqmfIPDiujOEpjX33evbWn1bSrmjhHiW1vFEGH4j3CsIvHRi5+W0NfhtFl5HvKsdPJNSbidIygLiCRSeLLoPtHhKDM/OF0K8dmLn9dbW2ge9PSIiIiIiIp3+H/yNcCHjpRNmAAAAAElFTkSuQmCC","e":1},{"id":"image_3","w":216,"h":260,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAEECAYAAABKq/oNAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAeX0lEQVR4nO2dX3Ybx5XGv6puNEAIAkGR4vAokQnO2H41ZwXiDuysIM4GJjnZQJIV2LOCaHZg74DeAfwqKQFgOxoOBRIgBDXxp7tqHtAFNWmA+NdV1Q3c3zl+oAii22R/qFu37ncvQBAEQRAEQRAEQZiC2b4BItu8ql+ecodXpZSnDKwKieq010kmzzl4RwhRc+HWTk72OkZv1BIkMGIh6vV2JUBwCo6ziZAYXqz6fpKxH5mU50KIl5+fHNaSu9N0QQIjfsXr+rsz5rAqJE4hcQqGUwC7017LOYOXc+DlHHDGUMi7v3pNEAoEgUAQCgxHIYaj8P5LmgzsWy74y01b2UhgW0y93q6GTngahXenkrEqk/KLWa8v5F24DofrcBTy7lhUfPlHSAgJvz9CfxDA748ghFTf6krIb1zhfrspQiOBbQEqvOOcn0rI03nhnevwyarkec7kax0osXW6fQShUP/cBcMfP/3k4KWWixqEBLZhqPBOSlllkp0tGt4pEU0L8UzR84d3hSbxgyOdr7K8mpHAMkq93q4GCKpR0mFueBcXUiHvwnXHoV4a6XT76Lzvqy+7UsgvPzt5em7xllaGBJZy7oV31Sjp8GB457ocBc/VHt7pZDgK0Wr7HxMiDH/IYshIAksR0ZnSaSy8qwI4nvbatIV3OhBC4vrmFj1/OP6HDIqMBGaBVcK7uIjSHN7p4PrmFt3eYPxFxkRGAtPM6/q7s3vh3cykQzy8c92PmTxinABptf3xFxkSGQksIe6UDM0J7wBMzpHiKfFVzpS2iVbbn4SLQoj/zEIFCP1Fl+ReeFeVjJ1SeGeOy6sP8PsjAOg6wjlOewqfBPYAy4R3KumgwjuVDieSRQiJi1ZPZRe///T44Cvb9/QQJDD8qiL8FMAp5oR3d6odKLwzynAU4u3l+/EXDL/79JOD7+ze0Wy26qlYtiL8zh7J+5gSJ+wTO4xufnp8ULV8OzPZWIGtWhEer3Yg0osQEr/8X3dcKJzirGLmBXa/IhwLhnfrVoQT9oml7lO7imXmyUpzRThhj5/+9ybVq1gq46BpFeEhwl0GBonIOxR9NFB4t92UH+XHezGJrwC8tH0/97G6gi1r+MtSRThhhiAU+OWiCwBwhHNycrLXsHtHdzH2UR+J6SyWdHgRIgQkwCKdMzlenTalIpzQj3o2hqMQoROeIWWrmFaB1evtiuDia8HwdSjDL1R0Ny2829SKcEI/paKH65vbVIaJWp7mer1dDXn41xDh7wGARcIq5F0UPJfCOyJRYh/KZxZvYyqJ7sGUsAD8Xv1bIe+iVPRQLOQoHU5oo/GvcUli2vZhia1gr5vv/hoi/DOAx8B42S6X8rR3IoxQyLvoDwIECKoAGpZvZ8LaAqvX29XAEd+p7F8h7+LJ7g4JizCKl3PQHwQAxxmAc8u3M2Etgb2uvzsLefg9kyhzzvBkdwelopfUvRHEwqj9fFTNkxpWFtibn1pfQ+LvwPjT43D/ESUtCGuoiEkyVrV6I/dYSWBxcZWKHg72isneFUEsiRLYQ4UKNlh6ySFxEWmEczaJoF7VL1MTJi4lsNf1d2ckLiKtuO74ceYOz57A6vV2lXH2PUDiItJJwRvveKSUVbt38pGFBRay8CWAspdz8GR3R98dEcSKqBWMSXZm904+spDA/tG8+hMYXnDOcLj/iCoyiFQyOXtl06ds2mCuwOr1dkVC/g0AKo8LlIonUkusuOG4Xm9XbN6LYq5aQh5+C6BcyLsol/IGbokgVkeJLECQikTHgwKr19tVRIW7lccFE/dDEGuhBMZ5OjKJDwosqowf20zIp0VkALWFkUhHJnGmwKIY9ncArV5EdpgsBBLpXsFCJ/wKQJmayBBZQqXqH+o4ZpLZIeLYfk2JDSJTuA6fHCNFOQSrPLQH+xIAijs5Q7dCEMmgEh2hE1oPE6cK7HX93RmASQdcgsgSE+uKlOkUWOQKpdWLyCRpMl9OFZi6MbL9E1kkTebLqQJTN0bhIZFFVNY7DebL6StYrIENQWQRtTiofIK1+7B5cSL7jIIQg2GIwTDAYBggFOMuswXPRd5zsFPIIeea32q4LkcQCjCHVY1fPH4fNi9OZAchJPqRiAbDAKNA4HY8jHwq8e+Vih72K0XkPXOPW8Eb90m0bb4kgRG/wu+PEAQhRoGA3x9hMAzGM7hWpOcP0fOH2K8UsV8x44T3PNUEx675kgS2xdwP70aBwGAYaLveVcfHKAhxdPBY2zUUkwQds1uTSALbAuLhXRAI9IfBg+GdTrq9AXKuo30lix0x7dbr7crJyV5H6wVnQALbMOKrUTzUSxNXHR+loqd9T6bmhkXmy3OtF5vBrP/DJoDj4Sikw+aUMoqEcxvtkXSHd0lzef0Bz492tV5DCSwyX55rvdgMpgtMogGG4yAUJDDLpCm8S5Lb/gijINSawo+ZL63tw6YKTDJ5zsBeDIchigWqRzRFfCVKa3iXJD1/iL2yvhaAhbwLvAcg7XWZmiowxlgDEuhnKOTIEvHwLp7J2zZu+yOtAkuD+XL6ChbKBuMMwQZ/eppCnSOp8G7dM6VNItT8e1DmSyEk6vV21cbky6kC++zk6fmbZgtBSAJblG0L77KCGswXmS8bpq8/M08qGfuRSflFfxBQ0W8MlXRQ4d28kiHCLkpgkfnyO9PXn6kcJmUDwBfDUbi1AlMr0WAYUningYKB2sTJ3DBL5svZKxhkjYF9uQ1hYjy8ix/UEnrJe/qPgGKexnQJjDFWgwSGo9Dk/Whl2YpwQh+cM5SK+juWxaKvY+0Xm8JMgTmhUwt5mFmBJV0RTiTLXnnH2JQe1xl7w17X3519dvL03MhF1bVnfePkZK/xptmCEBJBKFLbPsB0RTixPjmXaz3/uo+Xc6yZLx/eZUr8AIYXQZAOgakUOIV32YVzhmeHZaMz5rycA78/stJO+2GBMTQAvLCdqu/2+pGXiBIPWYZzhudHu0adzcBH86UNgT24LDGwGgBrB86jIETzbQcXrR6JK+PsFHI4flYxLi7ArvnyQYEJIWqAnUziYBig+bZD+6mMUyp6+O3RLp4f7VppfgP82nxp8toPfpy4cGshzGcShZD4+eKGsn4ZIudyuK6DYiGHnMuR91wrq9UsCvlxExzT5ssHfwMnJ3udN83WDYBdk+bLf112SVwpZqeQQ8Fz4UZCKniu0aTFKkzCxHFb+HNj1537CokaGF6YMl/6/RFlB1NC3nPvrEZ5z7EW5q1LrF991eh1573AtPmy073Vfg3iLpwz5D13Et6pUG+TsGW+nCsw0+bLnj80cp1tZefeHikL4V0STKIvw+bLuQIToahxzo2YL30KDRPjbmiX7fAuCThnE/Plq/rl6ecnhzUT150rsM9PDmvKfCmE3IpPuyyhwjvVC34Tw7ukUN4w7vAqgHQIDPhovtxmb1gaUOFdznUmmTz6wFscG+bLhdRC5kuz3A/v1NfEetgwXy62ghkyXzpb9mkcD+/UmRKFd/qwYb5c7GNR4Bwcf9Fd0ZGPQp5NPGSOJxrioR5hDhvmy4UE5sJthAjRH+hP1ZeKHrq9gfbr6CJ+jkThXfpQ7bRNmS8X+ssr8yUA7ebL/UoxEwKj8C6buA432q9+8Y9WQ+bLnOtgr7yDdooqOuIrEYV32UaZLyXMTL5cXGAMNRgyX+5XihPnsknSXhFOrI9p8+XCTw8Da0hII9YV5Xz9+eJGm8iyWBFOrE+sZCpdAhNC1BhnxtzNSmRXHX+tcJHCOyJObHuza6Jf/cICs2G+5Jzh6ZNHqJQLuOr46PnDmSn8bagIJ5IhZr6sQnO/+oUFFpkvrUy+zLnOZHC23x9BCInBMJgIicI7YhlMmi+X28FHky9tjpZVq1Kp6Fm5PpF9YiVTVd3XWirfLpk8B0Bzw4hMowQmmf6axKUExhhrADT5ksg2kxVMyi90X2spgYlw3MaNVjAiyyjzJQC8ql9qXcWWEphygSrzJUFkFbWKReZLbSxd8yQZ+xHYrLFGxPahhv9F5kttLC0wJqW1br8EkRSuG7Vxk+xM53WWX8EgG4C9fvUEkQSxfvVVnddZvixejA/maAUjsowp8+XSAnPhNgAYMV8ShE5UouN1/d2ZrmssLbCoOPIGoDCRWI5REMLvj+78ZzMbrcLEyHyp5xor/VTUr344ClMx+ZJIH8rPFwRiMnh+lpjynou9cgHlUsHoPZowX64msMh8aapfPZFe4nOx43Oyl32Pi1YPVx0fzw7LxkyusX716VrBTJoviXQhhMRNr4+eP0x8Cs4oEGi+7eDooGRkNVOpep3my5XiOzX5kvZg28VVx8c/f7nGu+sPWkdMXbR66Pb62t5fcd98qeMaKwlMtbuiFWw7EEKi+baDq45vLClxef0Bo0D/86XS9ZH5MnHWyVA0AUrXbzpqnK/pBkRCSFx1fO3Xmfgax+bLxFldYHJstaYwcbP512XX2iD6bm+gfRWLTb7Usg9bWWBkvtx8ur2+9XG+ugcyxsyXVR3vv3I+lDFWMzn5clsRQk7OkdSZUpycy1Es5LRk3UyEaPPo+UPslXe0vb9u8+XKAhOhaHDOKdGRIPFzJL8/QhCEc8+UbjEOpS6vP2CvvIP9SjGxe1n2PEsHupMqnDO4DkcQCi2TL1cWmJp8KYSkyZdLMoqEcxtVO6iD2nVQSYGeP8Szw8dr935My6xsE/s/1x0LjDv8FAlPvlzryJwmX87nfsmQ7j3NYBig+baD42eVtURmIkW+CCY+uAueqyZfVpN+77VUEZkvSWC4WzK0aHinCyEk3l6+x/Oj3ZUf0DSEhwCMlE3pNF+ut4JBNhjYVu3D4uHdKAgxGIbW0tgPMRgGaHdvE9uT2aJgQGCxfvXVpN97vbuPJl9u6lnYMhXhaeSq42OvvLPSKpZzOdIwQOqRgQazsSa6x/V6u3JystdJ6r3XEpjqV5/1ao4kKsLTyk2vv1Kaexya2R2EqI4gTKAmXwYIEh3Mt5bAon71NwB2dU++TAJ1pqTCOxXqbTKrniOVih7eXX/QcEeL82/RPAIT6Jp8uX6Am1LzpUo0DIZhJsO7pFj1A0QNa7f1AbRX3jHqNdRlvlxfYCkxXyqfUrc3SGXSIYvsV4r45eLG+HXLpTyePnlk9Jq6zJfJCEzata70/CEuWu+3coXSSbGQMz4ve6+8Y1xcwB3z5Ysk33ftmE6G4z6JtgR20XqPt5ddEpcmnj55hHIpr/06paKH42cVK+ICxnswlW1N0ny59gr22cnT8zfNlhXbykXrPbo9u5mutJPEQa0afpjU71pNIy14LvKeE432tT/W18s5iU++TOoUrwnguD8IjFV09PwhiWsBktoXHx08RqmYx7vr3lJHGPlIRCppkuYZ2UpgSU6+TEoNNQDHplYxISQuWu+NXCvrJBnelYoeSsUnk4Y38exsPhrjWyzk7gyezxI6zJeJ/AYkZI2BfWlqH3bT69OeawF2ooc9acZC27wRvjrMl4kcXDHGjE5codBwPpwzHB2UbN9GplDbmyTNl4kITISiAZgTGJ1zzefoYH1P2DaiwsSk+tUnIjDlAlXmS534G17atC5q5drEEM4EE+uKw6pJvF9ytU0SPwDUK9EmO4Ucnh/tGu/xvknEJl9Wk3i/5HbADA0AL0ym6olxxflO1PSG5gSsj+epJjjJmC8TU4IyX+pO1efc9BQUm0adI43PlsYHtdQLJVliky8TSdUnt9QYMl/mXAecs41O08dFFD+oJfQTM1/uJmG+TExgJs2XpaK3Ean6+yVDrutQmJcCkjRfJiawuPlyOArjnwSJUy4VMieweJnQTiFH4V2KUQJLwnyZbDYiMl8GodAqsGIhZ9UM+BD3w7sslgxtO2ofJiHX3ocl+5c3aL78zWEZ//zl2tpeLB7euZGIKLzbDGLmy+q675W8wAyZLzlneH60i58vbrSLLEsV4cT6JGm+TFRgMpQNxs31Scx7Lp4f7eKi1UukfCrn8kmigcK77UWZL4WQqNfb1ZOTvcbK75XgfVkxXyqRtbu3aHdvF17NVKKBwjtiGsobFjrhKdYwXyb+8az61Zus6OCcYb9SxH6leMerpHCi/RKFd8SiKIFJKU8BfLfq+ySuACZlAxb71W+qV4kwS1Lmy8TrjiRkDaDRskS2Scp8mbjATJsvCUIHSZkvExeYEzokMGIjSMJ8mbjAVEpTCElhIpFpJvOb1zBf6vF+RObLYEMmlBDbyaTcb4122noENjZfZn6sEbHdKPNl6gTGwCiTSGSeJMyXWgQmhKBEB5F57psvV3kPLQJz4ZLAiI1Apesj8+XSaBFYZLO+AUhkRLaZhInjfvXL/3yC93IXQ+ZLIvvE52KryaRqwIRyNOwUctgtFYy7wGMlU9WVfj65W7mLZPKcgVmffEmkh/hc7Pjg+Yd/RmAUDNHzh3h3/QH7lSL2yjvGhLau+VKbwBhjDUjcqWontgchJHr+YDIjO6n2DlcdH91eH88Oy0a8epPoa0XzpbYmg2ryJR02bxejIMRF6z3e/HSFi1YP7e5t4r1TRoHAzxc3RmYUcM4mq+Wr+uXSiQ5tAvvs5Ok5QGdh20S310fzbcdIxy8hpLHRwWoV4w6vLvuzWtvkSsZ+BKiiYxvo9vq4aPWMNiEaBQJXHV/7dSbWFbl8lymtAovMl5Sq33B6/hAXrZ6Va7e7txgFep+vSdHvCuZLvSsYmS83njSM8+35Q63vPzkLw/IlU3onKYhxV1Rawczh90fo9vq46vi46vhod2+1zlS76vjW5wToFlis9cXxsj+rNc/pwm2ECElgGoifI8UPamfBOUOp6GG/Uky06c9Nr5/Ye62KiWyi63AEocDr+rszlcBb6Oc03hNOTvYab5qtifkyttQSCyKERP+eiFZJewsh0e0N0O0NJh241sXvj6yvXgCMZRKDUCxtvtR/UifxAxheBAEJbB7xMiE/qnbQ8fBcdXwMhgGODh6vVRGRxtkAuvByzjjUXtIbpl9gUb96mnz5kVEQYjAM76xKpge79/whLq97ODp4bPS6WWVV86X2J56BNSTkVu7DkgrvdNHtDZD3XOyVd2zfylrsGKh1jZVMpUtgQoga4/pHy9rmoYrwNHPV8a1UqSeJiUazse3N7jL96rULTE2+3JQVbJWK8DQjhMRNr7/SKpaWedmmOjkX8i76gwABgioW7FevXWDR5MsmgGPdky+TJB7eBYFItCI8bfT84UoCMxGazaNcyhubNXDPfHm+0M9ou5s4Eg2w9Aosq+FdUqz6wZFzHeQ919oKzjnD4ZOSsevFSqaqi/6MEYEp82UarCvKpzROg4eZDu+SRAi50j5sr1ywUoeoBjCa3DvG+tUvnOgwIrA0mC+FkEvPENsm+sNgJed5uVTATW9gNHxW4jI9HHGygi3Rr97ILlWE4zZutlawwTBA8207FXVzaWWdhMVvDsvGEh7lUh7//tsnViaPrmK+NPJb+fzkcFJVb/oBHwwD/Hxxs1V7qlVYJ1HAOcNvNa4oO4Uc9itFnPx2b+3qk3VZ1nxp7GNATb40OZhPCGlkSHrWSSIbmHMdPD/anVTwr/YePBo4794ZPJ8mCp671ORLYwKzMfny8tqswzarJHWOxDnD0yePUCkXcNXx0fOHU3//PBrpW4hEpAbPZwE3CoWZZGcLvV7nzcSRkDUG9qWpio5REBrpDZF1OGfYLRUSfc+c60xqHEf3jjwKnpvpqpFYv/rqIq83dxRv2HzZ6dr3KWWB/UpR6wOfi1Yn9V+WxQUsb740JjAXbgMw1wCn59PqNY9S0ct8oa8NVKJjkcmXxgQWFUfeAGZ6dFDW8GHynktWlRVRYSLnfG6q3my1poSR8zCdPSg2gb3yDo6fVTIfrtliUtEBWZ33WrMCG5svqU+iJcqlPI6fVfD0ySPbt5JpljFfGj0ON2W+LFg45U8bec+9M5kk69m7NLGM+dLok2jKfKlKWrbhDCzn8sk5UvygltDHMuZLo3+Jz06enr9ptoyk6ouFnPZ+eaZRK5EbCYlWJXssar608VHXBHCsuwlOuVTIrMDuh3c5l6euZGjb8XLOOJcwx3xpXmCR+VJ3mFgqelbNgIugSoZUeJelkqFtZ9HJl8YFZtJ8eXRQQvNtR/t1FmHn3h6Jwrtss6j50rjAGGM1U+bL8WFqyajjNh7epbUinFifRc2XxgUmQtHgnBurSSxHhaxJiyzLFeHE+nDOJv3qX9UvT5Xn8T7GBfb5yWFN9atftQ/EspRLBeQ9F5fXH1aytscTDXSmRChcdyww7vBTAOkQGGDHfJn3XDw/2p2M95nmVbpv+FNfE8Q0YubL6qzXWHl6mJQ1GDZfKpRtQuH3R5QGJ1ZiEfOlnRUMssHAUtHtl/ZNxKrESqaqs15jp/dxZL7c9H71xGYTa6J7XK+3K9NeY0Vgps2XBKELJbIAwdTzMCsCM22+JAhdzDNf2huPEZkv07API4hVmWe+tCewyHw5HJLAiOwyyYLPMF9aExgDawC0ghGbgeQsPUkOYGy+BGgPRmSbeTWJ1gT22cnTc4BWMCLbzCuZsz0DtAlQup7YXGwLjMJEYqOxKjAJSal6ItPMWxysCowxRgIjMs3EmS/xw7TvWxWYCEUDIIER2UXIh1sDWhWYcoEq8yVBZA1VKCGZPJ/2fdtJjsnSSqsYkUVUbxnGxoUT97EvMDZu2kipeiKLqOfWCZ3zad+3LjAJ2QAoVU9kj9gUn+as9tnWBUbmSyKr+LcTgc0chm5dYC5cGmlEZBK1gkkh0yuwk5O9DiLzJSU6iKwQ60rWVHW107AuMAAfJ19SmEhkhE63DwBgYN8+9Lp0CIzMl0SG6PlDtRh0ueAvH3ptugRGISKRcoSQk9VLQn4TbXFmkgqByXCcqieBEWmn2xuo1etnV7gPhodASgSmNom0ByPSTH8QoPN+vHqB4b/mrV5ASgQWQeZLIrUIIdFq++rL7z/95GBmaj5OmgRGmUQitVy0eurZbDrC+XrRn0uNwMh8SaSVVttXz2VXCPHVIqGhIjUCI/MlkUZabR89fwgAkEJ+OWvQ3ixSM/zKCZ1ayEMSGJEKhJC4vP7wMSfA8IeHKjZmkZoVTFUjCyFpH0ZYZTgKcdHqKXF1wfC7Tz85eLnKe6VGYAAm5stJnwOCMEy3N8BFqxffc71YNGM4jXQJjMyXhCX6gwBvL9/j+uZ2XMQr8YMjnONl91z3Sc0eDAAYWE1C/p5CRMIU6vA49qHeZWB/+Y/q/twqjUVIlcCEEDXG0zFalthchJDw+yN0e4P7z9r/OML50zJp+HmkSmAu3FqIcSZRCDm37zdBLEIQCgxHIYbDEH5/NO0D/H8c4fx1lu1/HVL3BL/+6arGpPzicP8RDSgnlqY/CDAchR9FFX1Y30cy9iOXeMkFf5nkinWfVK1gAMCkPAfwhX87IoERM5mIaBiiPwwQBOLh4x2JH8BQA0PNCZ3vdIoqTuoEJoR4yTn/Y6xjD7HFCCExHIXoD4I7q9IsJGM/MikbErLGGKs5oVPTEfotSupCRAB402w1ABwf7BVRKnq2b4cwxH0RzQrvIm4gUZNMnjPGGjKUjVUqLXSTuhUMGPc5kJDfdHsDEtgGEg/vlJAWCO8aDKwmhKi5cGumQrx1SeUKVq+3KyEPmwDKRwelj4OmiUxxP7wLQjGviKAJoKbCOxGKxroHvbZJpcAA4HXz3V8Z2F+8nINnh49t3w4xh4mIAoH+MFgovFNJh7SGd0mQWoHFV7Enuzsol/K2b4nA3TOleDp8JlF4JyEbEDjPUniXBKkVGAD8o3n1Jwn5DecMzw4fw3XSVTq5yajwLr5H2rbwLglSLTDg48FzIe/i6KBk+3Y2komIlgzvGFhDCFHb1PAuCVIvsHq9XQ15+COAcrmUx5PdHdu3lFkme6R71Q6ziM6UarHwrmHzTCmLpF5gAPDmp9bXkPg7ANDZ2Hzi4Z0S0dzwTqIRnSlReJcgmRAYALxptr4F8EeARBbnfni3aMkQhXdmyIzAAOBNs/USwO+B7RPZiuFdQ0LWKLyzR6YEBtwV2abuyRatCI+Ih3cNEYoahXfpIXMCA+6Gi4W8i4O9YiZT+KtWhKvwbtvOlLJIJgUGTBIf/w2gzDlD5XEhtYfR8fAuixXhxOpkVmAA8Kp+ecoc5yWT8gsA8HIOnuzuWK1d3MSKcGJ1Mi0wRVTx8TcAZWAcNpaKntYkyDZVhBOrsxECA8a1iwEP/sTA/gzgMQBwzlAs5FDcyaHguSv1+Fi3IpzCu+1mYwSmiAntawDH8e95OQdezoHr8Jlh5BLZu62pCCdWZ+MEFudV/fKUc/61ZOxM7dNWYssrwonV2WiBxanX25UAwSk4zhhYBRKnU18YCYlKhgiCIAiCIAiCIAgiW/w/zQ1m2VyA5iUAAAAASUVORK5CYII=","e":1},{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"magnify","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":42,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":90,"s":[8]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":121,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":134,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":164,"s":[53]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":183,"s":[53]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":219,"s":[53]},{"t":272,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[333.752,339.42,0],"to":[-26,-25,0],"ti":[-4.333,25,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":42,"s":[177.752,189.42,0],"to":[4.333,-25,0],"ti":[-25.667,-23.333,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[359.752,189.42,0],"to":[25.667,23.333,0],"ti":[4.667,-23.333,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":121,"s":[331.752,329.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":134,"s":[331.752,329.42,0],"to":[-28.333,4.667,0],"ti":[28.333,-4.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":164,"s":[161.752,357.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":183,"s":[161.752,357.42,0],"to":[0,-24.333,0],"ti":[-28.667,3,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":219,"s":[161.752,211.42,0],"to":[28.667,-3,0],"ti":[-28.667,-21.333,0]},{"t":272,"s":[333.752,339.42,0]}],"ix":2},"a":{"a":0,"k":[87.194,86.29,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"glass 2","parent":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"glass","parent":1,"td":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"paper","tt":1,"refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[125,125,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":0,"nm":"paper","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"paper_1","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[263.625,231.897,0],"ix":2},"a":{"a":0,"k":[92.771,120.853,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"paper_2","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[214.478,258.49,0],"ix":2},"a":{"a":0,"k":[107.933,130,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}]}]'),layers:[{ddd:0,ind:1,ty:0,nm:"not_found 2",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[250,250,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,w:500,h:500,ip:0,op:273,st:0,bm:0}],markers:[]},iS={key:0,class:"inline-block"},li=Ot(e.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(t){const n=t,o=e.computed(()=>n.icon?Gt[n.icon]:null),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const f={xs:"px-1.5 py-0.5 text-[10px] gap-1",sm:"px-2.5 py-0.5 text-xs gap-1.5",md:"px-3 py-1 text-sm gap-2",lg:"px-4 py-1.5 text-base gap-2.5"};return f[n.size]||f.sm}),s=e.computed(()=>{const f={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};return f[n.size]||f.sm}),i=e.computed(()=>{const f={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return f[n.size]||f.sm}),l=e.computed(()=>{const f={default:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",success:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",warning:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",info:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",outline:"bg-transparent border-border text-foreground",tonal:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",ghost:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",purple:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",pink:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",dark:"bg-gray-900 text-white border-transparent shadow-sm hover:bg-gray-950",light:"bg-gray-100 text-gray-900 border-gray-200 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700"};return f[n.variant]||f.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return Re(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>Re("inline-flex items-center font-semibold border transition-all duration-300 select-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(f,h)=>r.value?(e.openBlock(),e.createElementBlock("div",iS,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-42cc5d83"]]);var ka={exports:{}},lS=ka.exports,hu;function cS(){return hu||(hu=1,(function(t,n){(function(o,r){t.exports=r()})(lS,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(y){return r.apply(y,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,h,m;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.filter(function(y){return r.truthy(r.apply(f,y))}):[];if(l==="map")return h=r.apply(c[0],i),f=c[1],Array.isArray(h)?h.map(function(y){return r.apply(f,y)}):[];if(l==="reduce")return h=r.apply(c[0],i),f=c[1],m=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(h)?h.reduce(function(y,p){return r.apply(f,{current:p,accumulator:y})},m):m;if(l==="all"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(!r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="none"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!0;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!1;return!0}else if(l==="some"){if(h=r.apply(c[0],i),f=c[1],!Array.isArray(h)||!h.length)return!1;for(d=0;d<h.length;d+=1)if(r.truthy(r.apply(f,h[d])))return!0;return!1}}if(c=c.map(function(y){return r.apply(y,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var g=String(l).split("."),k=a;for(d=0;d<g.length;d++){if(!k.hasOwnProperty(g[d]))throw new Error("Unrecognized operation "+l+" (failed at "+g.slice(0,d+1).join(".")+")");k=k[g[d]]}return k.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(ka)),ka.exports}var dS=cS();const cn=il(dS),uS={class:"dcode-card animate-slide-up"},fS={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"},hS={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between items-start gap-4"},mS={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 xl:max-w-[15vw] md:max-w-[20vw] max-w-[30vw]"},pS={class:"relative w-full sm:w-64"},gS={key:0,class:"relative"},bS={class:"flex flex-col h-full"},yS={key:0,class:"flex-1 overflow-y-auto py-4"},xS={class:"grid grid-cols-1 gap-4 px-1"},kS={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},wS={class:"flex justify-end gap-2 w-full"},CS={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},ES={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},BS={class:"dcode-table w-full"},_S={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},SS=["onClick"],AS={key:0,class:"flex items-center justify-center w-full"},VS={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},DS={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},NS={key:0,class:"px-3 py-0.5"},MS={key:1},vS=["colspan"],PS={class:"flex flex-col items-center gap-2"},TS={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},OS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},FS={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},zS={key:0,class:"flex items-center justify-center"},IS={key:0,class:"px-3 py-0.5 !text-center"},RS={key:0,class:"flex items-center justify-center gap-1.5"},LS={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},$S=["colspan"],jS={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"},US={class:"flex items-center gap-4"},WS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},HS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},qS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},GS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},XS={class:"flex-shrink-0"},KS={class:"space-y-4"},YS={class:"text-gray-600 dark:text-gray-400"},JS={class:"grid grid-cols-1 gap-4 py-4 px-1"},QS={key:0,class:"mb-2 p-3 bg-amber-50 dark:bg-amber-900/20 border border-amber-100 dark:border-amber-900/30 rounded-lg flex items-center gap-3"},ZS={class:"p-1.5 bg-amber-100 dark:bg-amber-900/40 rounded-md text-amber-600 dark:text-amber-400"},eA={class:"flex flex-col gap-0.5"},tA={class:"text-[10px] font-bold uppercase tracking-wider text-amber-500/70 dark:text-amber-400/50"},nA={class:"text-xs text-amber-700 dark:text-amber-300 leading-relaxed font-medium transition-all"},oA={class:"flex items-end gap-2"},_o=e.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{default:()=>({})},configKey:{},tableConfig:{},dynamicColumns:{type:Boolean,default:!1},searchApiEndpoint:{},enableQuickSearch:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},ignorePermissions:{type:Boolean,default:!1},userPermissions:{default:null},permissionChecker:{type:Function,default:void 0},permissions:{default:void 0},checkPermission:{type:Function,default:void 0},menuPermissions:{default:()=>[]},dummyMode:{type:Boolean,default:!1}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var Zt,Pe,At,Vt,xt,vt;cn.add_operation("length",C=>C==null?0:typeof C=="string"||Array.isArray(C)?C.length:typeof C=="number"?String(C).length:typeof C=="object"?Object.keys(C).length:0),cn.add_operation("==",(C,I)=>C!==null&&typeof C=="object"&&"_isLogicValue"in C?C.id==I||C.code==I:I!==null&&typeof I=="object"&&"_isLogicValue"in I?I.id==C||I.code==C:C==I),cn.add_operation("!=",(C,I)=>C!==null&&typeof C=="object"&&"_isLogicValue"in C?!(C.id==I||C.code==I):I!==null&&typeof I=="object"&&"_isLogicValue"in I?!(I.id==C||I.code==C):C!=I);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=ft(),{locale:l}=$t.useI18n();let c={query:{},params:{},path:""};try{const C=In.useRoute();C?c=C:(At=(Pe=(Zt=s==null?void 0:s.appContext)==null?void 0:Zt.config)==null?void 0:Pe.globalProperties)!=null&&At.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:C=>{console.warn("Router push() logic called from fallback:",C),typeof C=="string"&&C.startsWith("/")&&(window.location.href=C)}};try{const C=In.useRouter();C?d=C:(vt=(xt=(Vt=s==null?void 0:s.appContext)==null?void 0:Vt.config)==null?void 0:xt.globalProperties)!=null&&vt.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),h=e.ref(r.perPage),m=e.ref({key:"",direction:"asc"}),g=e.ref([]),k=e.ref(!1),y=e.ref(0),p=e.ref({}),E=e.ref([]),_=e.ref(null),B=e.ref(!0),S=e.ref([]),w=e.ref([]),x=e.ref([]),b=e.ref(!1),A=e.ref(!1),V=e.ref({}),D=e.ref(null),N=e.ref(null),P=e.ref(null),v=e.ref([]),Q=e.computed(()=>{if(X.value.length===0)return!1;const C=X.value.map(I=>{const ne=ee.value.find($=>$.type==="CHECKBOX"),R=(ne==null?void 0:ne.keyCheckbox)||"id";return I[R]}).filter(I=>I!=null);return C.length===0?!1:C.every(I=>v.value.includes(I))}),j=e.computed(()=>{if(X.value.length===0)return!1;const C=ee.value.find($=>$.type==="CHECKBOX"),I=(C==null?void 0:C.keyCheckbox)||"id",ne=X.value.map($=>$[I]).filter($=>$!=null),R=ne.filter($=>v.value.includes($)).length;return R>0&&R<ne.length}),G=C=>{const I=ee.value.find($=>$.type==="CHECKBOX"),ne=(I==null?void 0:I.keyCheckbox)||"id",R=C[ne];return R!==void 0&&v.value.includes(R)},Y=C=>{const I=ee.value.find($=>$.type==="CHECKBOX"),ne=(I==null?void 0:I.keyCheckbox)||"id",R=X.value.map($=>$[ne]).filter($=>$!=null);if(C){const $=new Set([...v.value,...R]);v.value=Array.from($)}else v.value=v.value.filter($=>!R.includes($))},H=(C,I)=>{const ne=ee.value.find(re=>re.type==="CHECKBOX"),R=(ne==null?void 0:ne.keyCheckbox)||"id",$=C[R];$!=null&&(I?v.value.includes($)||v.value.push($):v.value=v.value.filter(re=>re!==$))};e.watch(v,C=>{var ne;a("update:selection",C);const I=Q.value||C.length>1;(ne=w.value)!=null&&ne.length&&w.value.forEach(R=>{var $;($=R.fieldActionGlobal)!=null&&$.length&&R.fieldActionGlobal.forEach(re=>{var Me,Ke;const be=R.endpoint||((Me=R.propsActionGlobal)==null?void 0:Me.endpointPropAction)||R.propsActionGlobal,Te=(Ke=be==null?void 0:be.keyParam)==null?void 0:Ke[0];(Te&&re.model===Te||!Te&&/^(id|ids|idAuditTrail)/i.test(re.model))&&I&&re.model&&(V.value[re.model]=C)})})},{deep:!0});const T=C=>Array.from({length:C}).map((I,ne)=>{const R={id:ne+1,no:ne+1};return ee.value.forEach($=>{$.key!=="no"&&$.key!=="action"&&$.type!=="ACTION"&&$.type!=="action"&&($.type==="CHECKBOX"?R[$.keyCheckbox||"id"]=ne+1:$.type==="BADGE"||$.type==="badge"||$.condition?R[$.key]=$.condition&&$.condition.length>0?$.condition[0].value:"Active":R[$.key]=`Data ${$.label} ${ne+1}`)}),R}),U=C=>C&&typeof C=="string"&&C.trim()?C:void 0,te=e.computed(()=>{var C,I,ne,R;return U((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiModule)||U((R=(ne=_.value)==null?void 0:ne.endpointGlobal)==null?void 0:R.apiModule)||r.apiModule}),Z=e.computed(()=>{var C,I,ne,R;return U((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiAction)||U((R=(ne=_.value)==null?void 0:ne.endpointGlobal)==null?void 0:R.apiAction)||r.apiAction}),K=e.computed(()=>{var C,I,ne,R;return U((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiMethod)||U((R=(ne=_.value)==null?void 0:ne.endpointGlobal)==null?void 0:R.apiMethod)||r.apiMethod||"POST"}),ae=e.computed(()=>{var C,I,ne,R;return U((I=(C=_.value)==null?void 0:C.endpoint)==null?void 0:I.apiUrl)||U((R=(ne=_.value)==null?void 0:ne.endpointGlobal)==null?void 0:R.apiUrl)||r.apiUrl}),ue=e.computed(()=>r.permissionBase||""),ke=e.computed(()=>!x.value||x.value.length===0?[]:[...x.value].sort((C,I)=>(C.seq||0)-(I.seq||0))),De=C=>{var re,be,Te;const I=(C==null?void 0:C.column)||((re=C==null?void 0:C.props)==null?void 0:re.column)||((be=C==null?void 0:C.propsFieldGlobal)==null?void 0:be.column)||((Te=C==null?void 0:C.propsFieldCustom)==null?void 0:Te.column);if(!I)return"col-span-1";const ne=I.toLowerCase(),$={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"}[ne]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${C==null?void 0:C.model}: type=${I}, returned=${$}`),$},Ce=()=>{let C=null;if(r.tableConfig&&(C=r.tableConfig),C){_.value=C,C.headers&&(E.value=C.headers.map(R=>{var be,Te,Ne,Me,Ke,Ie,We,Rt,dn,Ba;if(R.key==="action"||((be=R.custom)==null?void 0:be.type)==="ACTION"||((Te=R.custom)==null?void 0:Te.type)==="action"){const Lt=((Ne=R.custom)==null?void 0:Ne.actionCustom)||((Me=R.custom)==null?void 0:Me.action);return Lt&&(S.value=Lt.map(qt=>{const ct=qt.propsActionCustom||qt.props||{},_a=qt.propCustomMessage||{};return{permission:qt.permission,label:l.value==="id"?ct.labelID:ct.labelEN,tooltip:l.value==="id"?ct.tooltipID||ct.labelID:ct.tooltipEN||ct.labelEN,icon:ct.icon,variant:ct.variant||"ghost",bgColor:ct.bgColor,action:ct.actionType||ct.key,route:ct.route,path:ct.path,endpoint:ct.endpointPropAction,requiredCondition:qt.requiredCondition||!1,propCustomCondition:qt.propCustomCondition||[],fieldMapping:qt.fieldMapping||ct.fieldMapping||null,openDialog:qt.openDialog||!1,fieldActionCustom:(qt.fieldActionCustom||[]).map(Sa=>{const hi=Sa.propsFieldCustom||Sa.propsFieldGlobal||Sa.props||{};return{...Sa,props:{...hi,endpoint:hi.endpointComponent||hi.endpoint}}}),condition:qt.visibleRule||qt.propCustomCondition||ct.visibleRule||ct.propCustomCondition||null,requireConfirm:qt.requireConfirm||ct.requireConfirm||!1,confirmTitle:l.value==="id"?_a.titleID||ct.confirmTitleID||"Konfirmasi":_a.titleEN||ct.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?_a.messageID||ct.confirmMessageID||"Apakah Anda yakin?":_a.messageEN||ct.confirmMessageEN||"Are you sure?"}})),null}let $;const re=((Ke=R.custom)==null?void 0:Ke.conditionBadge)||((Ie=R.custom)==null?void 0:Ie.condition);return(((We=R.custom)==null?void 0:We.type)==="BADGE"||((Rt=R.custom)==null?void 0:Rt.type)==="badge")&&re&&($=re.map(Lt=>({value:Lt.value,label:l.value==="id"?Lt.labelID:Lt.labelEN,labelID:Lt.labelID,labelEN:Lt.labelEN,color:Lt.color||Lt.bgColor,variant:Lt.variant,logic:Lt.logic||Lt.conditionRule||null}))),{key:R.key,label:l.value==="id"?R.labelID:R.labelEN,width:R.width,align:R.align,sortable:!0,type:(dn=R.custom)==null?void 0:dn.type,condition:$,keyCheckbox:(Ba=R.custom)==null?void 0:Ba.keyCheckbox}}).filter(R=>R!==null));const I=C.filters||C.filter;I&&Array.isArray(I)&&(x.value=I.map(R=>({...R,props:R.propsFilters||R.props||{}})),x.value.forEach(R=>{p.value[R.model]=""}));const ne=C.actionTableGlobal||C.actionGlobal||C.action;console.log("[DEBUG] loadConfig rawActions:",ne),ne&&Array.isArray(ne)?(w.value=ne.map(R=>{const $=R.propsActionGlobal||R.props||{};return{key:$.key,permission:R.permission,label:l.value==="id"?$.labelID||"Action":$.labelEN||"Action",tooltip:l.value==="id"?$.tooltipID||$.labelID:$.tooltipEN||$.labelEN,icon:$.icon,variant:$.variant||"default",bgColor:$.bgColor,textColor:$.textColor,route:$.route,path:$.path,endpoint:$.endpointPropAction||R.endpoint,fieldMapping:R.fieldMapping||$.fieldMapping||null,visibleRule:R.visibleRule||$.visibleRule||R.propCustomCondition||$.propCustomCondition||null,openDialog:R.openDialog||!1,fieldActionGlobal:(R.fieldActionGlobal||R.field||[]).map(re=>{const be=re.propsFieldGlobal||re.props||{};return{...re,props:{...be,endpoint:be.endpointComponent||be.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",w.value)):console.log("[DEBUG] loadConfig no rawActions found"),C.pagination!==void 0&&(B.value=C.pagination)}};e.watch(()=>r.tableConfig,()=>{Ce()},{deep:!0,immediate:!0});const ee=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?E.value:r.columns||[]),z=e.computed(()=>r.hasActions||S.value.length>0),J=e.computed(()=>r.dummyMode?!1:te.value||ae.value?k.value:r.loading),se=e.computed(()=>!!te.value||!!ae.value),Be=e.computed(()=>[]),ve=C=>{if(console.log("[DEBUG] hasAction called:",{actionCode:C,permissionChecker:!!r.permissionChecker,effectivePath:ue.value}),r.menuPermissions&&r.menuPermissions.length>0){const I=c.path,ne=r.menuPermissions.find(R=>I.startsWith(R.path));if(ne&&ne.actions){const R=ne.actions.find($=>$.code===C.toUpperCase());return R?R.checked:!1}return!1}if(r.permissionChecker){const I=r.permissionChecker(ue.value,C);return console.log("[DEBUG] permissionChecker result:",I),I}return Be.value.some(I=>I.code===C)},Ge=(C,I)=>{if(C.condition)try{return cn.apply(C.condition,I)}catch(be){return console.warn("Row action jsonLogic error:",be),!1}if(!C.visibilityCondition)return!0;const{field:ne,operator:R,value:$}=C.visibilityCondition,re=Ae(I,ne);switch(R){case"equals":return re===$;case"notEquals":return re!==$;case"in":return Array.isArray($)&&$.includes(re);case"notIn":return Array.isArray($)&&!$.includes(re);case"greaterThan":return re>$;case"lessThan":return re<$;case"contains":return String(re).includes(String($));default:return!0}},Xe=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:w.value,ignorePermissions:r.ignorePermissions}),w.value.length===0)return w.value;const C=w.value.filter(I=>{if(I.visibleRule)try{const R=X.value[0]||{};if(!cn.apply(I.visibleRule,R))return!1}catch(R){console.warn("Header action visibility logic error:",R)}if(r.ignorePermissions)return!0;if(!I.permission)return console.log("[DEBUG] Action no permission, showing:",I.label),!0;if(r.checkPermission){const R=r.checkPermission(I.permission);return console.log("[DEBUG] Parent checkPermission result:",R),R}if(r.permissions){const R=r.permissions.includes(I.permission);return console.log("[DEBUG] Parent permissions check result:",R),R}const ne=ve(I.permission);return console.log("[DEBUG] Internal permission check:",{label:I.label,permission:I.permission,hasPerm:ne}),ne});return console.log("[DEBUG] Filtered header actions:",C.length),C}),et=e.computed(()=>S.value.length===0?S.value:S.value.filter(C=>r.ignorePermissions||!C.permission?!0:r.checkPermission?r.checkPermission(C.permission):r.permissions?r.permissions.includes(C.permission):ve(C.permission))),Fe=C=>et.value.filter(I=>Ge(I,C)),ut=(C,I)=>{var $,re;if(C.requiredCondition&&(($=C.propCustomCondition)==null?void 0:$.length)>0){const be=Ae(I,"status"),Te=C.propCustomCondition.find(Ne=>Ne.value===be);if(Te)return Te.bgColor||C.bgColor||"primary"}if(!C.dynamicColor||!C.colorCondition)return C.bgColor||"primary";const ne=Ae(I,C.colorCondition.field),R=(re=C.colorCondition.conditions)==null?void 0:re.find(be=>be.value===ne);return(R==null?void 0:R.bgColor)||C.bgColor||"primary"},bt=C=>{const I=(C||"left").toLowerCase();return I==="center"?"justify-center":I==="right"?"justify-end":"justify-start"},It={ToggleLeft:ce.ToggleLeft,SquarePen:ce.SquarePen,Trash2:ce.Trash2,Eye:ce.Eye,CheckCircle:ce.CheckCircle,Plus:ce.Plus,Download:ce.Download,RefreshCw:ce.RefreshCw,Search:ce.Search,SlidersHorizontal:ce.SlidersHorizontal},Mt=C=>C?Gt[C]?Gt[C]:It[C]||null:null,X=e.computed(()=>r.dummyMode?ee.value.length>0?T(10):[]:se.value?g.value.map((C,I)=>({...C,no:(f.value-1)*h.value+I+1})):me.value),fe=e.computed(()=>r.dummyMode?10:se.value?y.value:oe.value.length),_e=e.computed(()=>fe.value===0?0:(f.value-1)*h.value+1),$e=e.computed(()=>{const C=f.value*h.value;return C>fe.value?fe.value:C}),Ae=(C,I)=>{if(!(!C||!I))return I in C?C[I]:I.split(".").reduce((ne,R)=>ne&&ne[R],C)},oe=e.computed(()=>{if(se.value)return[];if(!u.value)return r.data;const C=u.value.toLowerCase();return r.data.filter(I=>ee.value.some(ne=>{const R=Ae(I,ne.key);return R==null?!1:String(R).toLowerCase().includes(C)}))}),de=e.computed(()=>se.value?[]:m.value.key?[...oe.value].sort((I,ne)=>{const R=Ae(I,m.value.key),$=Ae(ne,m.value.key);if(R===$)return 0;let re=0;return typeof R=="number"&&typeof $=="number"?re=R-$:re=String(R).localeCompare(String($)),m.value.direction==="asc"?re:-re}):oe.value),me=e.computed(()=>{if(se.value)return[];const C=(f.value-1)*h.value,I=C+h.value;return de.value.slice(C,I).map((ne,R)=>({...ne,no:C+R+1}))}),Ve=e.computed(()=>se.value?Object.values(p.value).some(C=>!!C):!!u.value),nt=[10,25,50,100],Bt=()=>{se.value&&(p.value={...p.value,keyword:u.value},f.value=1,mt())};let So;const Ca=()=>{r.enableQuickSearch&&(clearTimeout(So),So=setTimeout(()=>{Bt()},500))};let Ao;const no=()=>{clearTimeout(Ao),Ao=setTimeout(()=>{se.value&&mt()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&se.value&&Ca()});const mt=async()=>{if(!r.dummyMode&&se.value&&!(!te.value&&!ae.value))try{k.value=!0;const C={page:f.value,perPage:h.value,...p.value,...r.apiParams};u.value&&(C.keyword=u.value),Object.keys(C).forEach(ne=>{(C[ne]===""||C[ne]===null||C[ne]===void 0)&&delete C[ne]});let I;te.value?I=await i(te.value,Z.value,C):ae.value&&(I=await i(ae.value,K.value,C)),Ea(I)}catch(C){console.error("DataTable fetch error",C),k.value=!1}},Ea=C=>{console.log("DataTable handleResponseData:",C),C&&(r.dynamicColumns&&C.columns&&Array.isArray(C.columns)&&(E.value=C.columns.map(I=>({key:I.key||I.field||I.name,label:I.label||I.header||I.name,width:I.width,align:I.align||"LEFT",sortable:I.sortable!==!1,type:I.type,condition:I.condition,format:I.format}))),C.data&&Array.isArray(C.data)?(g.value=C.data,C.totalData?y.value=C.totalData:C.maxPage?y.value=C.maxPage*h.value:y.value=C.data.length*(C.maxPage||1)):Array.isArray(C)?(g.value=C,y.value=C.length):C.users?(g.value=C.users,y.value=C.users.length):C.items&&Array.isArray(C.items)?(g.value=C.items,y.value=C.total||C.totalItems||C.items.length):C.list&&Array.isArray(C.list)?(g.value=C.list,y.value=C.total||C.list.length):C.rows&&Array.isArray(C.rows)?(g.value=C.rows,y.value=C.count||C.total||C.rows.length):C.result&&Array.isArray(C.result)?(g.value=C.result,y.value=C.total||C.count||C.result.length):(console.warn("DataTable: Unknown response format",C),g.value=[],y.value=0)),k.value=!1};e.onUnmounted(()=>{clearTimeout(So),clearTimeout(Ao)});const oo=()=>{Object.keys(p.value).forEach(C=>{p.value[C]=""}),u.value="",f.value=1,mt()},ir=()=>{f.value=1,mt()},M=(C,I)=>{const ne=Ae(C,I.key);let R={variant:"secondary",class:"",label:ne};if(I.condition){const $=I.condition.find(re=>{if(re.logic||typeof re.value=="object"&&re.value!==null)try{const Te=re.logic||re.value;return cn.apply(Te,C)}catch(Te){return console.warn("Badge logic error:",Te),!1}const be=(Te,Ne)=>Te==null||Ne===void 0||Ne===null?!1:typeof Te=="string"&&typeof Ne=="string"?Te.toLowerCase().trim()===Ne.toLowerCase().trim():Te==Ne;if(be(re.value,ne)||typeof ne=="object"&&ne!==null&&(be(re.value,ne.code)||be(re.value,ne.id)))return!0;if(I.key.includes(".")){const Ne=I.key.split(".").slice(0,-1).join("."),Me=Ae(C,Ne);if(Me&&typeof Me=="object"&&(be(re.value,Me.code)||be(re.value,Me.id)))return!0}return!1});if($){$.variant&&(R.variant=$.variant);const be=(l.value||"en")==="id"?$.labelID:$.labelEN;if(R.label=be||$.label||(typeof ne=="object"?ne.name||ne.code:ne),$.color||$.bgColor){const Te=($.color||$.bgColor||"").toLowerCase(),Ne=R.variant==="outline",Me={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow",primary:"bg-primary-600 hover:bg-primary-700 border-transparent text-white shadow",secondary:"bg-neutral-500 hover:bg-neutral-600 border-transparent text-white shadow",danger:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow",destructive:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow"},Ke={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"},Ie={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};Ne?Ke[Te]&&(R.class=Ke[Te]):Ie[Te]?R.variant=Ie[Te]:Me[Te]&&(R.class=Me[Te])}}else R.label=typeof ne=="object"?(ne==null?void 0:ne.name)||(ne==null?void 0:ne.code)||"-":ne}else R.label=typeof ne=="object"?(ne==null?void 0:ne.name)||(ne==null?void 0:ne.code)||"-":ne;return R},O=C=>{m.value.key===C?m.value.direction=m.value.direction==="asc"?"desc":"asc":(m.value.key=C,m.value.direction="asc"),a("update:sort",m.value)},L=C=>{C!==f.value&&(f.value=C,se.value&&mt(),a("update:page",C))},F=C=>{h.value=C,f.value=1,se.value&&mt()},q=C=>{const I=Math.random()*15+75;if(C.width){const ne=parseInt(String(C.width));return ne<100?`${Math.floor(ne*(Math.random()*.2+.7))}px`:`${I}%`}return`${I}%`},le=()=>{u.value="",p.value={},f.value=1,mt()},he=C=>{var I;if(console.log("[DEBUG] handleHeaderAction called:",C),C.route&&!r.dummyMode){if(C.path){const ne=C.route.startsWith("/")?C.route:"/"+C.route;sessionStorage.setItem(`layout_${ne}`,C.path)}d==null||d.push(C.route)}else if(C.openDialog||r.dummyMode&&C.route){N.value=C,P.value=null,V.value={};const ne=C.fieldActionGlobal||C.field||[];ne.length&&ne.forEach(R=>{var be;const $=C.endpoint||((be=C.propsActionGlobal)==null?void 0:be.endpointPropAction)||C.propsActionGlobal,re=$!=null&&$.keyParam&&$.keyParam.length>0?$.keyParam[0]:null;re&&R.model===re||!re&&/^(id|ids|idAuditTrail)/i.test(R.model)?V.value[R.model]=v.value:V.value[R.model]||(V.value[R.model]="")}),A.value=!0}else a("action",{action:((I=C.propsActionCustom)==null?void 0:I.key)||C.key||"create",row:null,selection:v.value})},W=async(C,I)=>{var ne,R,$,re;if(C.requireConfirm){D.value={button:C,row:I},b.value=!0;return}if(C.openDialog){N.value=C,P.value=I,V.value={};const be=ee.value.find(Me=>Me.type==="CHECKBOX"),Te=(be==null?void 0:be.keyCheckbox)||"id";C.fieldActionCustom&&C.fieldActionCustom.forEach(Me=>{/^(id|ids|idAuditTrail)/i.test(Me.model)?V.value[Me.model]=[I[Te]]:C.action==="showToken"&&Me.model==="token"?V.value[Me.model]=I.token!==void 0?I.token:"":I[Me.model]!==void 0?V.value[Me.model]=I[Me.model]:V.value[Me.model]=""});const Ne=C.endpoint||((ne=C.propsActionGlobal)==null?void 0:ne.endpointPropAction)||((R=C.propsActionCustom)==null?void 0:R.endpointPropAction)||(($=C.props)==null?void 0:$.endpointPropAction);if(((re=Ne==null?void 0:Ne.apiMethod)==null?void 0:re.toUpperCase())==="GET"&&Ne.apiUrl){k.value=!0;const{apiUrl:Me}=ft(),Ke={};Ne.keyParam&&Array.isArray(Ne.keyParam)&&Ne.keyParam.forEach((Ie,We)=>{const Rt=Ne.model&&We===0?Ne.model:Ie;I[Ie]!==void 0&&(Ke[Rt]=I[Ie])}),Object.keys(Ke).length===0&&I.id&&(Ke.id=I.id),Me(Ne.apiUrl,"GET",Ke).then(Ie=>{let We=Ie;if(Ie&&Ie.data!==void 0?We=Ie.data:Ie&&Ie.result!==void 0&&(We=Ie.result),We!=null){if(typeof We=="string")V.value.hasOwnProperty("token")&&(V.value.token=We);else if(typeof We=="object"&&(We.item&&(We=We.item),Array.isArray(We)&&(We=We[0]||{}),Object.keys(We).forEach(Rt=>{V.value[Rt]=We[Rt]}),!V.value.token)){const Rt=Object.keys(We).find(dn=>dn.toLowerCase().includes("token"));if(Rt)V.value.token=We[Rt];else{const dn=Object.values(We).filter(Ba=>typeof Ba=="string");dn.length===1&&(V.value.token=dn[0])}}}A.value=!0}).catch(Ie=>{console.error("Fetch Data Failed",Ie)}).finally(()=>{k.value=!1});return}A.value=!0;return}ie(C,I)},ie=(C,I)=>{if(C.route){if(C.path){const $=C.route.startsWith("/")?C.route:"/"+C.route;sessionStorage.setItem(`layout_${$}`,C.path)}let ne=C.route;ne.includes(":")?ne=ne.replaceAll(/:([a-zA-Z0-9_]+)/g,($,re)=>I[re]||I.id||re):I.id&&(ne=`${ne.replace(/\/$/,"")}/${I.id}`);const R={};C.path&&(R.code=C.path),d==null||d.push({path:ne,query:R})}else if(C.endpoint&&C.endpoint.apiUrl){k.value=!0;const{apiUrl:ne}=ft(),R=C.endpoint.apiUrl,$=C.endpoint.apiMethod||"POST",re={},be=C.fieldMapping;if(be&&typeof be=="object"){const{locale:Te}=$t.useI18n(),Ne=Te.value||"en",Me=[];if(Object.entries(be).forEach(([Ke,Ie])=>{if(typeof Ie=="string"){const We=Ae(I,Ke);We!==void 0?re[Ie]=We:(console.warn(`[MAPPING-DEBUG] No matching source found for '${Ke}'`),Me.push(Ke))}}),Me.length>0){const Ke=Ne==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Ie=Ne==="id"?`Terdapat ketidaksesuaian skema pada field: ${Me.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${Me.join(", ")}. Please contact the development team.`;He.warning(`${Ke}: ${Ie}`,{autoClose:5e3,position:"top-right"})}}Object.keys(re).length===0&&I.id&&(re.id=I.id),ne(R,$,re).then(()=>{mt(),a("action",{action:C.action||"success",row:I})}).catch(Te=>{console.error("Action Failed",Te)}).finally(()=>{k.value=!1})}else a("action",{action:C.action,row:I})},Ee=()=>{D.value&&(ie(D.value.button,D.value.row),st())},je=()=>{var C,I,ne;if(N.value){const R=N.value,$=R.endpoint||((C=R.propsActionGlobal)==null?void 0:C.endpointPropAction)||R.propsActionGlobal;let re=($==null?void 0:$.model)||($!=null&&$.keyParam&&$.keyParam.length>0?$.keyParam[0]:null);if(!re){const Me=(R.fieldActionGlobal||R.fieldActionCustom||R.field||[]).find(Ke=>/^(id|ids|idAuditTrail)/i.test(Ke.model));re=Me?Me.model:"ids"}let be=null,Te=!1;if(P.value){const Ne=ee.value.find(Ie=>Ie.type==="CHECKBOX"),Me=(Ne==null?void 0:Ne.keyCheckbox)||"id",Ke=P.value[Me];if($!=null&&$.apiUrl){be={...V.value};const Ie=R.fieldMapping;Ie&&typeof Ie=="object"&&Object.entries(Ie).forEach(([We,Rt])=>{if(typeof Rt=="string"){const dn=Ae(P.value,We);dn!==void 0&&(be[Rt]=dn)}}),be[re]||(be[re]=[Ke]),Te=!0}}else $!=null&&$.apiUrl&&(be={...V.value},be[re]||(be[re]=v.value||[]),Te=!0);if(Te&&be&&($!=null&&$.apiUrl)){if(((I=$==null?void 0:$.apiMethod)==null?void 0:I.toUpperCase())==="GET"){A.value=!1,P.value||(v.value=[]);return}const{apiUrl:Ne}=ft(),Me=$.apiUrl,Ke=$.apiMethod||"POST";Ne(Me,Ke,be).then(()=>{A.value=!1,P.value||(v.value=[]),mt(),a("action",{action:"success",row:null})}).catch(Ie=>{console.error("Action Failed",Ie)})}else if(P.value){const Ne=ee.value.find(We=>We.type==="CHECKBOX"),Me=(Ne==null?void 0:Ne.keyCheckbox)||"id",Ke=P.value[Me],Ie={...V.value};Ie[re]||(Ie[re]=[Ke]),a("action",{action:N.value.action,row:Ie}),A.value=!1}else{const Ne={...V.value};Ne[re]||(Ne[re]=v.value);const Me={action:((ne=N.value.propsActionGlobal)==null?void 0:ne.key)||N.value.key,row:Ne,selection:v.value};a("action",Me),A.value=!1}}},tt=C=>{const I=V.value[C];I&&z_(String(I)).then(()=>{He.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(ne=>{console.error("Failed to copy",ne)})},st=()=>{b.value=!1,D.value=null},ot=e.computed(()=>D.value?D.value.button.confirmTitle||"Confirm":""),_t=e.computed(()=>D.value?D.value.button.confirmMessage||"Confirm":"");n({fetchData:mt,filters:p,resetFilters:oo,handleRefresh:le});const ge=e.ref(""),rt=C=>{if(!C)return"";const I=C.endpoint||C.endpointGlobal||{};return JSON.stringify({url:I.apiUrl||C.apiUrl,module:I.apiModule||C.apiModule,action:I.apiAction||C.apiAction,method:I.apiMethod||C.apiMethod,params:C.apiParams,socket:I.socket||C.socketEndpoint,socketParams:C.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){Ce();const C=rt(r.tableConfig);C!==ge.value&&(!ge.value&&se.value?(ge.value=C,mt()):(ge.value=C,se.value&&no()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{se.value&&mt()}),e.watch(()=>r.apiParams,()=>{se.value&&mt()},{deep:!0}),e.watch(()=>w.value,C=>{console.log("[DEBUG] headerActions changed:",C.length,"items");const I=Xe.value;console.log("[DEBUG] visibleHeaderActions evaluated:",I.length,"items")},{deep:!0}),e.onMounted(()=>{Ce(),se.value&&(r.tableConfig||(k.value=!0,mt()))}),(C,I)=>{var ne;return e.openBlock(),e.createElementBlock("div",uS,[e.createElementVNode("div",fS,[e.createElementVNode("div",hS,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",mS,[e.createElementVNode("div",pS,[e.createVNode(e.unref(ce.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(X_),{modelValue:u.value,"onUpdate:modelValue":I[0]||(I[0]=R=>u.value=R),placeholder:"Search...",style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:e.withKeys(Bt,["enter"])},null,8,["modelValue"])]),x.value.length>0?(e.openBlock(),e.createElementBlock("div",gS,[e.createVNode(H_,null,{trigger:e.withCtx(()=>[e.createVNode(Ye,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"})]),footer:e.withCtx(()=>[e.createElementVNode("div",wS,[e.renderSlot(C.$slots,"filter-footer",{fetch:mt,reset:oo})])]),default:e.withCtx(()=>[I[9]||(I[9]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",bS,[e.renderSlot(C.$slots,"filter-form",{filters:p.value},()=>[x.value.length>0?(e.openBlock(),e.createElementBlock("div",yS,[e.createElementVNode("div",xS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(R,$)=>(e.openBlock(),e.createElementBlock("div",{key:$,class:e.normalizeClass(De(R))},[e.createVNode(tu,{field:R,modelValue:p.value[R.model],"onUpdate:modelValue":re=>p.value[R.model]=re},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),x.value.length>0?(e.openBlock(),e.createElementBlock("div",kS,[e.createVNode(Ye,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:oo,disabled:J.value},null,8,["disabled"]),e.createVNode(Ye,{onClick:ir,disabled:J.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",CS)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ye,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"Refresh",class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:le,disabled:J.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(ce.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":J.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(R,$)=>(e.openBlock(),e.createBlock(Ye,{key:$,icon:R.icon,text:R.label,tooltip:R.tooltip,variant:R.variant,"bg-color":R.bgColor,"text-color":R.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:re=>he(R)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(C.$slots,"header-actions")],2)])]),e.createElementVNode("div",ES,[e.createElementVNode("table",BS,[e.createElementVNode("thead",_S,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,R=>(e.openBlock(),e.createElementBlock("th",{key:R.key,class:e.normalizeClass([R.align?`text-${R.align.toLowerCase()}`:"text-left",R.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:e.normalizeStyle(R.width?{width:R.width}:{}),onClick:$=>R.sortable&&O(R.key)},[R.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",AS,[e.createVNode(Cn,{"model-value":Q.value,indeterminate:j.value,"onUpdate:modelValue":I[1]||(I[1]=$=>Y(!!$)),onClick:I[2]||(I[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",bt(R.align)])},[e.createElementVNode("span",null,e.toDisplayString(R.label),1)],2))],14,SS))),128)),z.value?(e.openBlock(),e.createElementBlock("th",VS,[...I[10]||(I[10]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",DS,[J.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value,R=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${R}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,$=>{var re,be;return e.openBlock(),e.createElementBlock("td",{key:$.key,class:e.normalizeClass([$.align?`text-${$.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes($.type??"")||$.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((re=$.align)==null?void 0:re.toLowerCase())==="center"?"mx-auto":"",((be=$.align)==null?void 0:be.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes($.type??"")||$.condition?void 0:q($),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",NS,[...I[11]||(I[11]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):X.value.length===0?(e.openBlock(),e.createElementBlock("tr",MS,[e.createElementVNode("td",{colspan:ee.value.length+(z.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",PS,[e.createVNode(e.unref(wu.Vue3Lottie),{animationData:e.unref(sS),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",TS,e.toDisplayString(Ve.value?"No search results":"No data"),1),e.createElementVNode("p",OS,e.toDisplayString(Ve.value?"Try changing keywords":"No data added"),1)])])],8,vS)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(X.value,(R,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:$},[e.createElementVNode("tr",FS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,re=>(e.openBlock(),e.createElementBlock("td",{key:re.key,class:e.normalizeClass([re.align?`text-${re.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(C.$slots,`cell-${re.key}`,{row:R,value:Ae(R,re.key)},()=>[re.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",zS,[e.createVNode(Cn,{"model-value":G(R),"onUpdate:modelValue":be=>H(R,!!be),onClick:I[3]||(I[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):re.type==="badge"||re.type==="BADGE"||re.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[re.align?`justify-${re.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(li,{variant:M(R,re).variant,class:e.normalizeClass([M(R,re).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(M(R,re).label),1)]),_:2},1032,["variant","class"])],2)):re.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*h.value+$+1),1)],64)):re.type==="date"||re.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Ae(R,re.key)?e.unref(O_)(Ae(R,re.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(re.format?re.format(Ae(R,re.key)):Ae(R,re.key)),1)],64))])],2))),128)),z.value?(e.openBlock(),e.createElementBlock("td",IS,[e.renderSlot(C.$slots,"actions",{row:R,buttons:Fe(R),getButtonColor:ut,getIconComponent:Mt},()=>[Fe(R).length>0?(e.openBlock(),e.createElementBlock("div",RS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(R),(re,be)=>(e.openBlock(),e.createElementBlock("div",{key:be,class:"group relative"},[e.createVNode(Ye,{tooltip:re.tooltip||re.label,icon:re.icon,size:"icon",rounded:re.rounded||"sm",borderStyle:re.borderStyle||"none",variant:re.variant||"ghost","bg-color":ut(re,R),onClick:Te=>W(re,R)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),C.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",LS,[e.createElementVNode("td",{colspan:ee.value.length+(z.value?1:0),class:"px-0 py-0"},[e.renderSlot(C.$slots,"expanded-row",{row:R,index:$})],8,$S)])):e.createCommentVNode("",!0)],64))),128))])])]),!J.value&&X.value.length>0&&t.showPagination&&B.value?(e.openBlock(),e.createElementBlock("div",jS,[e.createElementVNode("div",US,[e.createVNode(e.unref(o2),{"model-value":String(h.value),"onUpdate:modelValue":I[4]||(I[4]=R=>F(Number(R)))},{default:e.withCtx(()=>[e.createVNode(e.unref(c2),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(d2),{placeholder:String(h.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(r2),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(nt,R=>e.createVNode(e.unref(s2),{key:R,value:String(R)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(R),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),I[16]||(I[16]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",WS,[I[12]||(I[12]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",HS,e.toDisplayString(_e.value),1),I[13]||(I[13]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",qS,e.toDisplayString($e.value),1),I[14]||(I[14]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",GS,e.toDisplayString(fe.value),1),I[15]||(I[15]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",XS,[e.createVNode(e.unref(K_),{total:fe.value,"items-per-page":h.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":L,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(Y_),{class:"flex items-center gap-1"},{default:e.withCtx(({items:R})=>[e.createVNode(e.unref(Q_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(n2),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R,($,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[$.type==="page"?(e.openBlock(),e.createBlock(e.unref(Z_),{key:re,value:$.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Jt),{class:"w-8 h-8 p-0 text-sm",variant:$.value===f.value?"default":"outline",disabled:$.value===f.value,onClick:be=>L($.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString($.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(J_),{key:$.type,index:re},null,8,["index"]))],64))),256)),e.createVNode(e.unref(t2),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(e2),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(ce.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(Fn,{modelValue:b.value,"onUpdate:modelValue":I[5]||(I[5]=R=>b.value=R),title:ot.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",onClick:st,text:"Cancel"}),e.createVNode(Ye,{variant:"default",onClick:Ee,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",KS,[e.createElementVNode("p",YS,e.toDisplayString(_t.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(Fn,{modelValue:A.value,"onUpdate:modelValue":I[8]||(I[8]=R=>A.value=R),title:((ne=N.value)==null?void 0:ne.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>{var R;return[e.createVNode(Ye,{variant:"outline",onClick:I[6]||(I[6]=$=>A.value=!1),text:"Cancel"}),t.dummyMode&&((R=N.value)!=null&&R.route)?(e.openBlock(),e.createBlock(Ye,{key:1,variant:"default",onClick:I[7]||(I[7]=$=>A.value=!1),text:e.unref(l)==="id"?"Tutup":"Close"},null,8,["text"])):(e.openBlock(),e.createBlock(Ye,{key:0,variant:"default",onClick:je,text:"Save"}))]}),default:e.withCtx(()=>{var R,$,re;return[e.createElementVNode("div",JS,[t.dummyMode&&((R=N.value)!=null&&R.route)?(e.openBlock(),e.createElementBlock("div",QS,[e.createElementVNode("div",ZS,[e.createVNode(e.unref(ce.Search),{class:"w-4 h-4"})]),e.createElementVNode("div",eA,[e.createElementVNode("span",tA,e.toDisplayString(e.unref(l)==="id"?"Info Navigasi":"Navigation Info"),1),e.createElementVNode("p",nA,e.toDisplayString(e.unref(l)==="id"?`Aksi ini akan mengarah ke rute: ${N.value.route}`:`This action will navigate to: ${N.value.route}`),1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((($=N.value)==null?void 0:$.fieldActionCustom)||((re=N.value)==null?void 0:re.fieldActionGlobal)||[],(be,Te)=>{var Ne,Me,Ke,Ie;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Te},[!be.isHidden&&!(t.dummyMode&&((Ne=N.value)!=null&&Ne.route))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(De(be))},[e.createElementVNode("div",oA,[e.createVNode(tu,{class:"flex-1 w-full",field:be,modelValue:V.value[be.model],"onUpdate:modelValue":We=>V.value[be.model]=We},null,8,["field","modelValue","onUpdate:modelValue"]),be.isCopyable||(Me=be.props)!=null&&Me.isCopyable||((Ke=N.value)==null?void 0:Ke.action)==="showToken"||((Ie=N.value)==null?void 0:Ie.action)==="copyToken"?(e.openBlock(),e.createBlock(Ye,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:We=>tt(be.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)],64)}),128))])]}),_:1},8,["modelValue","title"])])}}}),rA={key:0},aA=["value","name"],sA={key:1,class:"flex flex-col gap-1"},iA={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},lA=["src"],cA={key:1,class:"text-sm text-neutral-400 italic"},dA={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},uA={key:3,class:"text-xs text-neutral-400 italic"},ci=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=$t.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,y=>{s.value=y});const i={DCodeTextField:lo,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:wo,DCodeTextArea:wo,DCodeCheckbox:Cn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia,DCodeRadio:Ys,DCodeRadioCustom:Js,DCodeDynamicUploadList:Rs,DCodeMultiSelect:Ks,DCodeCurrencyField:Is,DCodePermissionMenu:Zs,DCodeTreePermissions:ei,DCodeCardCheckboxList:zs,DCodeBeforeAfter:Xa,DCodeListLabels:Ka},l=e.computed(()=>{const y=r.field.component;return i[y]||null}),c=e.computed(()=>{var p;const y=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return y.includes("image")||y.includes("upload")}),d=e.computed(()=>{var p;const y=((p=r.field.component)==null?void 0:p.toLowerCase())||"";return y.includes("switch")||y.includes("checkbox")}),u=e.computed(()=>{var _,B;const y=r.field.props||r.field.propsFieldGlobal||{},p=((_=r.dynamicLabels)==null?void 0:_.labelID)||y.labelID,E=((B=r.dynamicLabels)==null?void 0:B.labelEN)||y.labelEN;return o.value==="id"?p||E||r.field.model:E||p||r.field.model}),f=e.computed(()=>{const y=r.modelValue;return y==null||y===""?null:Array.isArray(y)?y.map(p=>typeof p=="object"&&p!==null?p.label||p.name||p.code||p.value||JSON.stringify(p):String(p)).join(", "):typeof y=="object"?y.label||y.name||y.code||y.value||y.id||JSON.stringify(y):String(y)}),h=(y,p)=>{const E={label:"",placeholder:""},_=(p==null?void 0:p.labelID)||y.labelID,B=(p==null?void 0:p.labelEN)||y.labelEN;(_||B)&&(E.label=o.value==="id"?_:B);const S=(p==null?void 0:p.placeholderID)||y.placeholderID,w=(p==null?void 0:p.placeholderEN)||y.placeholderEN;return(S||w)&&(E.placeholder=o.value==="id"?S:w),E},m=(y,p)=>{var B;if(!((B=y.endpoint)!=null&&B.apiUrl))return{};const E={};let _=!0;return Array.isArray(y.endpoint.keyParam)&&y.endpoint.keyParam.length>0&&y.endpoint.keyParam.forEach(S=>{const w=p?p[S]:null;w!=null&&w!==""?E[S]=w:_=!1}),_?{endpoint:{apiUrl:y.endpoint.apiUrl,apiMethod:y.endpoint.apiMethod||"GET"},...Object.keys(E).length?{apiParams:E}:{}}:{}},g=e.computed(()=>{var B,S,w;const y=r.field.props||r.field.propsFieldGlobal||{},p={},E=h(y,r.dynamicLabels);return E.label&&(p.label=E.label),E.placeholder&&(p.placeholder=E.placeholder),p.required=r.required!==void 0?r.required:y.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(x=>{y[x]!==void 0&&y[x]!==null&&(p[x]=y[x])}),p.minLength=((B=r.dynamicLength)==null?void 0:B.minLength)??y.minLength,p.maxLength=((S=r.dynamicLength)==null?void 0:S.maxLength)??y.maxLength,y.valueType&&(p.type=y.valueType),r.error&&(p.error=r.error),Object.assign(p,m(y,r.formData)),(w=y.endpointReference)!=null&&w.apiUrl&&(p.endpointReference=y.endpointReference),r.options&&r.options.length>0&&(p.items=r.options,p.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete p.endpoint,delete p.apiParams,delete p.apiUrl)),r.baseUrl&&(p.baseUrl=r.baseUrl),p}),k=y=>{s.value=y,a("update:modelValue",y)};return(y,p)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",rA,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,aA)])):t.viewOnly?(e.openBlock(),e.createElementBlock("div",sA,[e.createElementVNode("span",iA,e.toDisplayString(u.value),1),c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:f.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,lA)):(e.openBlock(),e.createElementBlock("span",cA,"-"))],64)):d.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",f.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},e.toDisplayString(f.value?"✓ Ya":"✗ Tidak"),3)):(e.openBlock(),e.createElementBlock("span",dA,e.toDisplayString(f.value||"-"),1))])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:2},g.value,{modelValue:s.value,"onUpdate:modelValue":[p[0]||(p[0]=E=>s.value=E),k]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",uA," Unknown field: "+e.toDisplayString(t.field.component),1))}}),fA={class:"w-full space-y-6"},hA={key:0,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},mA={key:0,class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},pA={key:0,class:"px-4 py-3"},gA={class:"text-sm font-semibold text-white"},bA={class:"px-4 py-3 flex items-center gap-2"},yA={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},xA={class:"flex items-center justify-center gap-1"},kA=["onClick"],wA=["onClick"],CA=["onClick"],EA={key:2,class:"w-full"},BA={class:"space-y-6 mt-4"},_A={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},SA={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},AA={key:1,class:"text-xs text-neutral-500"},VA={key:0,class:"flex items-center gap-2"},DA={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},NA={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},MA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},vA={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},PA={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},di=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){cn.add_operation("length",M=>M==null?0:typeof M=="string"||Array.isArray(M)?M.length:typeof M=="number"?String(M).length:typeof M=="object"?Object.keys(M).length:0),cn.add_operation("==",(M,O)=>{const L=F=>F&&typeof F=="object"&&F._isLogicValue;return M==null?O==null:O==null?M==null:L(M)&&L(O)?String(M.id)===String(O.id)||String(M.code)===String(O.code):L(M)?String(M.code)===String(O)||String(M.id)===String(O):L(O)?String(O.code)===String(M)||String(O.id)===String(M):typeof M=="boolean"&&typeof O=="string"?String(M)===O:typeof O=="boolean"&&typeof M=="string"?String(O)===M:String(M)===String(O)}),cn.add_operation("!=",(M,O)=>{const L=F=>F&&typeof F=="object"&&F._isLogicValue;return M==null&&O==null?!1:M==null||O===null||O===void 0?!0:L(M)&&L(O)?!(String(M.id)===String(O.id)||String(M.code)===String(O.code)):L(M)?!(String(M.code)===String(O)||String(M.id)===String(O)):L(O)?!(String(O.code)===String(M)||String(O.id)===String(M)):String(M)!==String(O)});const o=t,r=n,{t:a,locale:s}=$t.useI18n(),i=e.computed(()=>s.value),{apiUrl:l}=ft(),c=In.useRouter();let d="";const u=e.ref(!1),f=e.ref(null),h=e.computed(()=>o.schema||f.value),m=e.reactive({}),g=e.reactive({}),k=e.reactive({}),y=e.reactive({});e.reactive({});const p=e.reactive({visible:!1,title:"",message:"",action:null}),E=M=>{var O,L,F;return((O=M.propsForm)==null?void 0:O.key)||((L=M.propsTable)==null?void 0:L.key)||((F=M.propsWizard)==null?void 0:F.key)||M.id||"unknown-section"},_=M=>{var L;return(((L=M.propsWizard)==null?void 0:L.propsSteps)||[]).filter(F=>te(F)).map((F,q)=>{var W;let le=[];if(Array.isArray(F.sectionsWizard))le=F.sectionsWizard;else if(F.sectionsWizard&&typeof F.sectionsWizard=="object"){const ie=F.sectionsWizard;le=[{type:ie.type||(ie.fields?"FORM":ie.isDataTable?"TABLE":"UNKNOWN"),...ie}]}const he=U(F);return{key:F.key||`step-${q}`,title:he.title,description:he.description,icon:F.icon||void 0,sections:le,actions:((W=F.propsComponent)==null?void 0:W.actionComponent)||F.actionComponent||[]}})},B=M=>M?[...M].sort((O,L)=>(O.seq||0)-(L.seq||0)):[],S=(M,O)=>{var q;const L=O?V(O):D.value;return N((q=M.logic)==null?void 0:q.labelingRule,L,`LABEL-${M.model}`)||null},w=(M,O)=>{var q;const L=O?V(O):D.value;return N((q=M.logic)==null?void 0:q.lengthRule,L,`LENGTH-${M.model}`)||null},x=(M,O,L)=>{const F=M.props||M.propsFieldGlobal;if(!F)return null;const q=O==null?"":String(O);if(q==="")return null;const le=w(M,L),he=(le==null?void 0:le.minLength)??F.minLength,W=(le==null?void 0:le.maxLength)??F.maxLength;if(he&&q.length<he)return i.value==="id"?`Minimal ${he} karakter`:`Minimum ${he} characters`;if(W&&q.length>W)return i.value==="id"?`Maksimal ${W} karakter`:`Maximum ${W} characters`;if(F.regex)try{if(!new RegExp(F.regex).test(q))return F.regexMessage||(i.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${M.model}:`,F.regex)}return null},b=e.computed(()=>{var O;const M=new Map;return(O=h.value)!=null&&O.sections&&h.value.sections.forEach(L=>{var he,W;const F=L.propsForm||L.propsTable||L.props||{},q=E(L);(F.fields||L.fields||[]).forEach(ie=>{if(ie.model){const Ee=q?`${q}.${ie.model}`:ie.model;M.set(ie.model,{field:ie,path:Ee})}}),((he=L.type)==null?void 0:he.toUpperCase())==="WIZARD"&&((W=L.propsWizard)!=null&&W.propsSteps)&&L.propsWizard.propsSteps.forEach(ie=>{const Ee=ie.key||ie.id;(Array.isArray(ie.sectionsWizard)?ie.sectionsWizard:[ie.sectionsWizard].filter(Boolean)).forEach(tt=>{tt.fields&&tt.fields.forEach(st=>{if(st.model){const ot=Ee?`${Ee}.${st.model}`:st.model;M.set(st.model,{field:st,path:ot})}})})})}),M}),A=(M,O)=>{if(O==null||typeof O=="object"&&O._isLogicValue)return O;const L=b.value.get(M);if(!L)return O;const F=L.field,q=v[F.key];if(!q||!Array.isArray(q))return O;const he=(F.props||{}).itemValue||"id",W=q.find(ie=>String(ie[he])===String(O)||String(ie.id)===String(O)||String(ie.code)===String(O));return W&&W.code?{id:O,code:W.code,_isLogicValue:!0}:O},V=M=>{const O=(L,F)=>{if(L==null||typeof L=="object"&&L._isLogicValue||typeof L=="boolean")return L;if(typeof L=="number"||typeof L=="string")return F?A(F,L):L;if(typeof L=="object"&&!Array.isArray(L)){const q=(L==null?void 0:L.id)??(L==null?void 0:L.code)??(L==null?void 0:L.value)??(L==null?void 0:L.key)??L;return F&&(typeof q=="string"||typeof q=="number")?A(F,q):q}return L};return new Proxy(M,{get(L,F){if(typeof F!="string")return L[F];const q=b.value.get(F);if(q){const le=ae(L,q.path);if(le!=null)return O(le,F)}return O(L[F],F)},has(L,F){return typeof F!="string"?F in L:b.value.has(F)||F in L},ownKeys(L){return Array.from(new Set([...Object.keys(L),...b.value.keys()]))},getOwnPropertyDescriptor(L,F){return{enumerable:!0,configurable:!0}}})},D=e.computed(()=>V(m)),N=(M,O,L)=>M?Array.isArray(M)?M.find(F=>!F.condition||P(F.condition,O,L))||null:M:null,P=(M,O,L="LOGIC")=>{if(M==null||typeof M=="object"&&Object.keys(M).length===0)return!0;if(typeof M=="boolean")return M;if(typeof M=="object")try{const F=cn.apply(M,O);if(["VISIBLE","SEC","FILTER","LENGTH","CALC"].some(le=>L.includes(le))){const le=JSON.stringify(M),he=Object.keys(O).filter(W=>le.includes(`"${W}"`));console.log(`[DynamicForm][${L}] Rule: ${le} | Data: {${he.map(W=>`${W}: ${JSON.stringify(O[W])}`).join(", ")}} | Result: ${F}`)}return F}catch(F){return console.error(`[${L}] JsonLogic error:`,F),!1}try{return!!new Function("formData",`return ${M};`)(O)}catch{return!1}},v=e.reactive({}),Q=async M=>{const O=M.props||{},L=O.endpointReference||O.endpoint;if(!(!(L!=null&&L.apiUrl)||v[M.key])&&!(Array.isArray(L.keyParam)&&L.keyParam.some(F=>m[F]===null||m[F]===void 0||m[F]==="")))try{const F=await l(L.apiUrl,L.apiMethod||"GET",{page:1,perPage:100});let q=(F==null?void 0:F.data)||F;v[M.key]=Array.isArray(q)?q:q?[q]:[]}catch{v[M.key]=[]}},j=(M,O)=>{var ie;const L=M.props||{},F=v[M.key]||L.items||L.options||[];if(!((ie=M.logic)!=null&&ie.optionsFilterRule))return F;const q=O?V(O):D.value,le=N(M.logic.optionsFilterRule,q,`FILTER-${M.model}`);if(!le||!le.values)return F;const he=(le.values||[]).map(Ee=>String(Ee)),W=L.itemValue||"id";return F.filter(Ee=>Ee==null?!1:typeof Ee!="object"?he.includes(String(Ee)):[W,"code","id","value","key"].some(je=>{const tt=Ee[je];return tt!=null&&he.includes(String(tt))}))},G=M=>{if(!M||typeof M!="object")return[];if("var"in M)return[M.var];let O=[];return Object.values(M).forEach(L=>{Array.isArray(L)?L.forEach(F=>{O=O.concat(G(F))}):typeof L=="object"&&(O=O.concat(G(L)))}),O};e.watch(()=>h.value,M=>{if(!(M!=null&&M.sections))return;const O=new Set,L=F=>{F&&["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule"].forEach(q=>{const le=F[q];Array.isArray(le)?le.forEach(he=>he.condition&&G(he.condition).forEach(W=>O.add(W))):le&&G(le).forEach(he=>O.add(he))})};M.sections.forEach(F=>{var q,le,he,W,ie;L(F.logic||((q=F.propsForm)==null?void 0:q.logic)),F.type==="WIZARD"&&((he=(le=F.propsWizard)==null?void 0:le.propsSteps)==null||he.forEach(Ee=>L(Ee.logic))),(((W=F.propsForm)==null?void 0:W.fields)||F.fields||[]).forEach(Ee=>{var je;L(Ee.logic),(je=Ee.logic)!=null&&je.optionsFilterRule&&Q(Ee)}),F.type==="TABLE"&&((ie=F.propsTable)!=null&&ie.modelDatatable)&&(m[F.propsTable.modelDatatable]=m[F.propsTable.modelDatatable]||[])})},{immediate:!0});const Y=(M,O)=>{var le;const L=O?V(O):D.value,F=(le=M.logic)==null?void 0:le.visibleRule;if(!F)return!0;const q=N(F,L,`VISIBLE-${M.model}`);return!!(typeof q=="object"?P(q,L,`VISIBLE-${M.model}`):q)},H=(M,O)=>{var le,he;const L=O?V(O):D.value,F=(le=M.logic)==null?void 0:le.requiredRule;if(!F)return((he=M.props)==null?void 0:he.required)||!1;const q=N(F,L,`REQUIRED-${M.model}`);return!!(typeof q=="object"?"required"in q?q.required:P(q,L):q)},T=(M,O)=>{var le,he;const L=O?V(O):D.value,F=(le=M.logic)==null?void 0:le.disabledRule;if(!F)return((he=M.props)==null?void 0:he.disabled)||!1;const q=N(F,L,`DISABLED-${M.model}`);return!!(typeof q=="object"?"disabled"in q?q.disabled:P(q,L):q)},U=M=>{var le;const O=M.propsForm||M.propsTable||M.propsWizard||M.props||{};let L=i.value==="id"?O.titleID||M.titleID||M.labelID:O.titleEN||M.titleEN||M.labelEN,F=i.value==="id"?O.descriptionID||M.descriptionID:O.descriptionEN||M.descriptionEN;const q=N((le=M.logic||O.logic)==null?void 0:le.labelingRule,D.value,"LABEL-SEC");return q&&(L=i.value==="id"?q.labelID||q.titleID||q.title:q.labelEN||q.titleEN||q.title,F=i.value==="id"?q.descriptionID:q.descriptionEN),{title:L,description:F}},te=(M,O)=>{var he,W;if(!M)return!0;const L=M.propsForm||M.propsTable||M.propsWizard||M.props||{},F=(he=M.logic||L.logic)==null?void 0:he.visibleRule,q=O?V(O):D.value;if(F){const ie=N(F,q,"VISIBLE-SEC");return!!(typeof ie=="object"?P(ie,q,"VISIBLE-SEC"):ie)}if(M.type==="TABLE"&&((W=L.headers)!=null&&W.length))return!0;const le=L.fields||M.fields||[];return le.length===0||le.some(ie=>Y(ie,O))},Z=()=>{var M;if((M=h.value)!=null&&M.sections)for(let O=0;O<3;O++){let L=!1;if(h.value.sections.forEach(F=>{var q;(((q=F.propsForm)==null?void 0:q.fields)||F.fields||[]).forEach(le=>{var W;const he=(W=le.logic)==null?void 0:W.calculateRule;if(he&&typeof he=="object"){const ie=Object.keys(he)[0],Ee=P(he[ie],D.value,`CALC-${ie}`);Ee!==void 0&&m[ie]!==Ee&&(m[ie]=Ee,L=!0)}})}),!L)break}},K=e.computed(()=>{var O;if(!((O=h.value)!=null&&O.sections))return!1;if(Object.keys(g).length>0)return!0;const M=L=>L.some(F=>Y(F)&&H(F)&&(Array.isArray(m[F.model])?m[F.model].length===0:m[F.model]==null||m[F.model]===""));return h.value.sections.some(L=>{var F;return M(((F=L.propsForm)==null?void 0:F.fields)||L.fields||[])?!0:L.type==="WIZARD"?_(L).some(q=>M(q.sections.flatMap(le=>le.fields||[]))):!1})}),ae=(M,O)=>O?O.split(".").reduce((L,F)=>L==null?void 0:L[F],M):void 0,ue=(M,O,L)=>{const F=O.split(".");let q=M;for(let le=0;le<F.length-1;le++)q=q[F[le]]=q[F[le]]||{};q[F[F.length-1]]=L},ke=M=>{const O=e.toRaw(M);if(Array.isArray(O))return O.map(L=>ke(L));if(O&&typeof O=="object"){const L={};return Object.keys(O).forEach(F=>L[F]=ke(O[F])),L}return O},De=()=>{var L;if(!((L=h.value)!=null&&L.sections))return{...m};const M={},O=new Set;return h.value.sections.forEach(F=>{var he,W;if(!te(F))return;const q=E(F),le=(ie,Ee)=>{if(Y(ie)&&ie.model){const je=ae(m,Ee?`${Ee}.${ie.model}`:ie.model)??m[ie.model];M[ie.model]=ke(je)??null,O.add(ie.model)}};if((((he=F.propsForm)==null?void 0:he.fields)||F.fields||[]).forEach(ie=>{var Ee;return le(ie,q||((Ee=F.propsForm)==null?void 0:Ee.key))}),F.type==="WIZARD"&&_(F).forEach(ie=>ie.sections.forEach(Ee=>(Ee.fields||[]).forEach(je=>le(je,ie.key)))),(W=F.propsTable)!=null&&W.modelDatatable){const ie=F.propsTable.modelDatatable;M[ie]=ke(ae(m,q?`${q}.${ie}`:ie)??m[ie]),O.add(ie)}}),["id","_id"].forEach(F=>{m[F]!==void 0&&!O.has(F)&&(M[F]=ke(m[F]))}),M},Ce=(M,O)=>{const L=(M==null?void 0:M.data)!==void 0?M.data:M,F=Array.isArray(L)?L[0]:L;F&&Object.entries(O).forEach(([q,le])=>{const he=F[le]??F[q];he!==void 0&&ue(m,q,he)})},ee=()=>{var L;const M=[],O=F=>{F==null||F.forEach(q=>{var he;if(q.type==="TABLE"||q.propsTable){const W=q.propsTable||q;W.modelDatatable&&M.push({key:W.modelDatatable,subFields:(W.headers||[]).map(ie=>ie.key)})}(((he=q.propsForm)==null?void 0:he.fields)||q.fields||[]).forEach(W=>{var Ee,je;const ie=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(W.component);if(W.model&&((Ee=W.props)!=null&&Ee.multiple||((je=W.props)==null?void 0:je.valueType)==="array"||ie)){const tt=W.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];M.push({key:W.model,subFields:tt})}}),q.type==="WIZARD"&&_(q).forEach(W=>O(W.sections))})};return O((L=h.value)==null?void 0:L.sections),M},z=(M,O)=>{const L={},F=q=>q&&typeof q=="object"?q._isLogicValue?q.id:q.id??q.code??q.value??q:q;return Object.entries(O).forEach(([q,le])=>{if(typeof le=="string"){const he=M[q]??ae(m,q)??m[q];he!==void 0&&(L[le]=F(he))}else if(Array.isArray(le)&&le[0]){const he=le[0],W=Object.keys(he);let ie=M[q]??ae(m,q)??m[q];if(!Array.isArray(ie)||ie.length===0){const Ee=ee().find(je=>W.some(tt=>je.subFields.includes(tt)));if(Ee){const je=M[Ee.key]??ae(m,Ee.key)??m[Ee.key];Array.isArray(je)&&je.length>0&&(ie=je)}}Array.isArray(ie)&&(console.log(`[DynamicForm][MAPPING-SOURCE] ${q}:`,ke(ie)),L[q]=ie.map((Ee,je)=>{const tt={},st=ke(Ee);return Object.entries(he).forEach(([ot,_t])=>{const ge=st[ot]??st[_t]??Ee[ot]??Ee[_t]??null;tt[_t]=F(ge)}),tt}))}}),console.log("[DynamicForm][MAPPING-RESULT]",L),L},J=M=>{var O,L,F,q;M.requireConfirm?(p.title=i.value==="id"?((O=M.propCustomMessage)==null?void 0:O.titleID)||"Konfirmasi":((L=M.propCustomMessage)==null?void 0:L.titleEN)||"Confirm",p.message=i.value==="id"?((F=M.propCustomMessage)==null?void 0:F.messageID)||"Lanjutkan?":((q=M.propCustomMessage)==null?void 0:q.messageEN)||"Continue?",p.action=M,p.visible=!0):Be(M)},se=()=>{p.visible=!1,p.action&&Be(p.action)},Be=async M=>{var q,le;const O=M.propsActionGlobal||M.props||{},L=z(De(),O.fieldMapping||M.fieldMapping||{});r("action",M,L);const F=O.endpointPropAction||M.endpointPropAction||O.endpoint||M.endpoint;if((O.type==="SUBMIT"||O.type==="ACTION")&&(F!=null&&F.apiUrl)){const he=He.loading(i.value==="id"?"Memproses...":"Processing...");try{const W=await l(F.apiUrl,F.apiMethod||"POST",L),ie=(W==null?void 0:W.status)===!0||(W==null?void 0:W.success)===!0,Ee=(W==null?void 0:W.message)||(ie?i.value==="id"?"Sukses":"Success":i.value==="id"?"Gagal":"Failed");He.update(he,{render:Ee,type:ie?"success":"error",isLoading:!1,autoClose:ie?3e3:5e3}),ie?((O.fieldMapping||M.fieldMapping)&&Ce(W,O.fieldMapping||M.fieldMapping),r("success",W)):r("error",W)}catch(W){const ie=((le=(q=W.response)==null?void 0:q.data)==null?void 0:le.message)||W.message||(i.value==="id"?"Terjadi kesalahan":"An error occurred");He.update(he,{render:`Gagal: ${ie}`,type:"error",isLoading:!1,autoClose:5e3}),r("error",W)}}else O.type==="SUBMIT"&&r("submit",L);O.keyRedirect&&O.route&&c&&c.push(O.route)},ve=()=>{var O,L;let M=!0;return(L=(O=h.value)==null?void 0:O.sections)==null||L.forEach(F=>{var q;te(F)&&(((q=F.propsForm)==null?void 0:q.fields)||F.fields||[]).forEach(le=>{if(Y(le)){const he=x(le,m[le.model]);he&&(g[le.model]=he,M=!1)}})}),M},Ge=async()=>{var M,O;if(ve()){u.value=!0;try{const L=De(),F=(((M=h.value)==null?void 0:M.actions)||[]).find(le=>{var he;return le.type==="SUBMIT"||le.key==="SUBMIT"||((he=le.propsActionGlobal)==null?void 0:he.type)==="SUBMIT"}),q=(F==null?void 0:F.fieldMapping)||((O=F==null?void 0:F.propsActionGlobal)==null?void 0:O.fieldMapping);r("submit",q?z(L,q):L)}finally{u.value=!1}}},Xe=()=>r("cancel"),et=(M,O,L)=>{var le;const F=L?`${L}.${M}`:M;ue(m,F,O);const q=(le=b.value.get(M))==null?void 0:le.field;if(q){const he=x(q,O);he?g[M]=he:delete g[M]}r("update:model",De())},Fe=M=>!M.permission||(o.isEditMode?M.permission!=="CREATE":M.permission!=="UPDATE"),ut=M=>{var L,F;if((L=M.fields)!=null&&L.length)return M.fields;const O=(M.actionTableGlobal||[]).find(q=>q.permission==="CREATE"||(q.key||"").toLowerCase().includes("add"));return(F=O==null?void 0:O.fieldActionGlobal)!=null&&F.length?O.fieldActionGlobal:(M.headers||[]).filter(q=>q.key&&q.key!=="no").map(q=>({key:q.key,model:q.key,component:"DCodeTextField"}))},bt=M=>{var O;return!(M!=null&&M.apiUrl)&&!((O=M==null?void 0:M.endpointTable)!=null&&O.apiUrl)},It=M=>{if(!M)return!1;const O=(M.key||"").toLowerCase(),L=(M.permission||"").toUpperCase();return O==="detail"||O.includes("view")||L==="VIEW"},Mt=M=>Array.isArray(m[M.modelDatatable])?m[M.modelDatatable]:[],X=e.ref(!1),fe=e.ref(""),_e=e.ref("Plus"),$e=e.ref([]),Ae=e.reactive({}),oe=e.reactive({}),de=e.ref(""),me=e.ref(null),Ve=e.ref(!1),nt=e.ref(null),Bt=e.ref(!1),So=(M,O)=>{nt.value={propsTable:M,row:O},Bt.value=!0},Ca=()=>{if(!nt.value)return;const{propsTable:M,row:O}=nt.value;Bt.value=!1;const L=m[M.modelDatatable];if(Array.isArray(L)){const F=L.indexOf(O);if(F!==-1)L.splice(F,1);else{const q=JSON.stringify(O,(he,W)=>["no","_index"].includes(he)?void 0:W),le=L.findIndex(he=>JSON.stringify(he,(W,ie)=>["no","_index"].includes(W)?void 0:ie)===q);le!==-1&&L.splice(le,1)}r("update:model",De())}},Ao=(M,O)=>{Ae[M]=O;const L=$e.value.find(F=>F.model===M);if(L){const F=x(L,O);F?oe[M]=F:delete oe[M]}},no=(M,O,L)=>{de.value=M.modelDatatable||"",Ve.value=It(O),me.value=null,fe.value=i.value==="id"?O.labelID||"Tambah Data":O.labelEN||"Add Data",_e.value=O.icon||"Plus";const F=ut(M);$e.value=F,Object.keys(Ae).forEach(q=>delete Ae[q]),Object.keys(oe).forEach(q=>delete oe[q]),F.forEach(q=>Ae[q.model]=L?L[q.model]??null:null),X.value=!0},mt=(M,O)=>{const{action:L,row:F}=O;if(/delete|trash/i.test(L)){const ie=m[M.modelDatatable];if(Array.isArray(ie)){const Ee=ie.indexOf(F);if(Ee!==-1)ie.splice(Ee,1);else{const je=JSON.stringify(F,(st,ot)=>["no","_index"].includes(st)?void 0:ot),tt=ie.findIndex(st=>JSON.stringify(st,(ot,_t)=>["no","_index"].includes(ot)?void 0:_t)===je);tt!==-1&&ie.splice(tt,1)}}return}if(/detail|view/i.test(L)){no(M,{key:"detail",permission:"VIEW"},F);return}const q=M.modelDatatable||"";de.value=q,Ve.value=!1,fe.value=i.value==="id"?"Ubah Data":"Edit Data",_e.value="SquarePen";const le=m[q];let he=Array.isArray(le)?le.indexOf(F):-1;if(he===-1&&Array.isArray(le)){const ie=JSON.stringify(F,(Ee,je)=>["no","_index"].includes(Ee)?void 0:je);he=le.findIndex(Ee=>JSON.stringify(Ee,(je,tt)=>["no","_index"].includes(je)?void 0:tt)===ie)}me.value=he!==-1?he:null;const W=ut(M);$e.value=W,Object.keys(Ae).forEach(ie=>delete Ae[ie]),W.forEach(ie=>Ae[ie.model]=F[ie.model]??null),X.value=!0},Ea=()=>{let M=!0;if($e.value.forEach(L=>{const F=x(L,Ae[L.model]);F&&(oe[L.model]=F,M=!1)}),!M)return;const O=de.value;O&&(m[O]=m[O]||[],me.value!==null?m[O].splice(me.value,1,{...Ae}):m[O].push({...Ae}),X.value=!1,r("update:model",De()))},oo=new Map,ir=new Map;return e.watch(()=>({...m}),M=>{var le;if(!((le=h.value)!=null&&le.sections))return;Z();const O=V(M),L=he=>{he.forEach(W=>{var tt;const ie=E(W),Ee=te(W,M);(((tt=W.propsForm)==null?void 0:tt.fields)||W.fields||[]).forEach(st=>{const ot=st.model;if(!ot)return;const _t=ie?`${ie}.${ot}`:ot,ge=ae(m,_t),rt=Y(st,M)&&Ee;oo.get(ot)===!0&&rt===!1&&ge!==null&&ge!==void 0&&(console.log(`[DynamicForm][RESET-VISIBLE] ${ot} BEFORE:`,ke(ge)),ue(m,_t,Array.isArray(ge)?[]:null),console.log(`[DynamicForm][RESET-VISIBLE] ${ot} AFTER:`,ke(ae(m,_t)))),oo.set(ot,rt);const Pe=st.logic;if(Pe&&rt){const At={};let Vt=!1;["lengthRule","optionsFilterRule","visibleRule"].forEach(xt=>{const vt=Pe[xt];if(!vt)return;const C=N(vt,O,`${xt}-${ot}`),I=JSON.stringify(C);At[xt]=I;const ne=ir.get(ot);ne&&ne[xt]!==void 0&&ne[xt]!==I&&(Vt=!0)}),Vt&&ge!==null&&ge!==void 0&&(console.log(`[DynamicForm][RESET-LOGIC] ${ot} due to rule change | BEFORE:`,ke(ge)),ue(m,_t,Array.isArray(ge)?[]:null),console.log(`[DynamicForm][RESET-LOGIC] ${ot} AFTER:`,ke(ae(m,_t)))),ir.set(ot,At)}}),W.type==="WIZARD"&&_(W).forEach(st=>L(st.sections))})};L(h.value.sections);const F=De()||{},q=JSON.stringify(F);q!==d&&(d=q,console.log("[DynamicForm] Emitting update:model:",F),r("update:model",F))},{deep:!0,immediate:!0}),e.watch(()=>o.model,M=>{M&&Object.keys(M).length>0?JSON.stringify(M)!==d&&(console.log("[DynamicForm] Received new model data:",M),Object.keys(M).forEach(L=>{m[L]=M[L]}),console.log("[DynamicForm] Updated formData:",{...m})):console.log("[DynamicForm] Received empty or null model data")},{immediate:!0,deep:!0}),(M,O)=>{var L,F,q,le,he;return e.openBlock(),e.createElementBlock("div",fA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((L=h.value)==null?void 0:L.sections,(W,ie)=>{var Ee,je,tt,st,ot,_t;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[((Ee=W.type)==null?void 0:Ee.toUpperCase())==="FORM"&&W.propsForm&&te(W)?(e.openBlock(),e.createElementBlock("div",hA,[((je=W.type)==null?void 0:je.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",mA,[U(W).title?(e.openBlock(),e.createElementBlock("div",pA,[e.createElementVNode("h3",gA,e.toDisplayString(U(W).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",bA,[(tt=W.propsForm.actionSection)!=null&&tt.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(W.propsForm.actionSection,(ge,rt)=>{var Zt,Pe,At,Vt,xt,vt,C;return e.openBlock(),e.createElementBlock(e.Fragment,{key:rt},[Fe(ge)?(e.openBlock(),e.createBlock(Ye,{key:0,icon:ge.icon||((Zt=ge.propsActionGlobal)==null?void 0:Zt.icon),text:i.value==="id"?ge.labelID||((Pe=ge.propsActionGlobal)==null?void 0:Pe.labelID):ge.labelEN||((At=ge.propsActionGlobal)==null?void 0:At.labelEN),"bg-color":((xt=ge.bgColor||((Vt=ge.propsActionGlobal)==null?void 0:Vt.bgColor))==null?void 0:xt.toLowerCase())||"primary",variant:((C=ge.variant||((vt=ge.propsActionGlobal)==null?void 0:vt.variant))==null?void 0:C.toLowerCase())||"outline",size:"sm",onClick:I=>J(ge)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),ie===0?(e.openBlock(),e.createBlock(Ye,{key:1,size:"sm",icon:"List",text:e.unref(a)("common.back"),variant:"outline",onClick:Xe},null,8,["text"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",W.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B(W.propsForm.fields),ge=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ge.key},[Y(ge)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([ge.column==="FULL"&&W.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ci,{field:ge,"model-value":ae(m,E(W)?`${E(W)}.${ge.model}`:ge.model)??m[ge.model],"form-data":m,required:H(ge),disabled:T(ge),options:j(ge),error:g[ge.model],"dynamic-labels":S(ge),"dynamic-length":w(ge),"base-url":t.baseUrl,"onUpdate:modelValue":rt=>et(ge.model,rt,E(W))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])):((st=W.type)==null?void 0:st.toUpperCase())==="TABLE"&&W.propsTable&&te(W)?(e.openBlock(),e.createElementBlock("div",yA,[e.createVNode(_o,{"table-config":W.propsTable,data:Mt(W.propsTable),nested:!0,"show-pagination":W.propsTable.pagination??!0,"has-actions":bt(W.propsTable),onAction:ge=>mt(W.propsTable,ge)},e.createSlots({"header-actions":e.withCtx(()=>{var ge;return[(ge=W.propsTable.actionTableGlobal)!=null&&ge.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(W.propsTable.actionTableGlobal,(rt,Zt)=>{var Pe,At;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Zt},[rt.propsActionGlobal?(e.openBlock(),e.createBlock(Ye,{key:0,icon:rt.propsActionGlobal.icon,text:i.value==="id"?rt.propsActionGlobal.labelID||rt.labelID:rt.propsActionGlobal.labelEN||rt.labelEN,"bg-color":((Pe=rt.propsActionGlobal.bgColor)==null?void 0:Pe.toLowerCase())||"primary",variant:((At=rt.propsActionGlobal.variant)==null?void 0:At.toLowerCase())||"default",size:"sm",class:"h-8 shadow-none",onClick:Vt=>no(W.propsTable,rt)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):bt(W.propsTable)?(e.openBlock(),e.createBlock(Ye,{key:1,icon:"Plus",text:i.value==="id"?"Tambah Data":"Add Data","bg-color":"primary",variant:"default",size:"sm",class:"h-8 shadow-none",onClick:rt=>no(W.propsTable,{key:"add_data_auto",permission:"CREATE",labelID:"Tambah Data",labelEN:"Add Data",fieldActionGlobal:ut(W.propsTable)})},null,8,["text","onClick"])):e.createCommentVNode("",!0)]}),_:2},[bt(W.propsTable)?{name:"actions",fn:e.withCtx(({row:ge})=>[e.createElementVNode("div",xA,[e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-primary-600 hover:bg-primary-50 dark:hover:bg-primary-900/30",onClick:e.withModifiers(rt=>no(W.propsTable,{key:"detail",permission:"VIEW",labelID:"Detail",labelEN:"Detail",fieldActionGlobal:ut(W.propsTable)},ge),["stop"]),title:"Detail"},[...O[6]||(O[6]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})],-1)])],8,kA),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-warning-600 hover:bg-warning-50 dark:hover:bg-warning-900/30",onClick:e.withModifiers(rt=>mt(W.propsTable,{action:"edit",row:ge}),["stop"]),title:"Edit"},[...O[7]||(O[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.createElementVNode("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})],-1)])],8,wA),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-danger-500 hover:bg-danger-50 dark:hover:bg-danger-900/30",onClick:e.withModifiers(rt=>So(W.propsTable,ge),["stop"]),title:"Hapus"},[...O[8]||(O[8]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),e.createElementVNode("path",{d:"M10 11v6"}),e.createElementVNode("path",{d:"M14 11v6"}),e.createElementVNode("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"})],-1)])],8,CA)])]),key:"0"}:void 0]),1032,["table-config","data","show-pagination","has-actions","onAction"])])):((ot=W.type)==null?void 0:ot.toUpperCase())==="WIZARD"&&W.propsWizard&&te(W)?(e.openBlock(),e.createElementBlock("div",EA,[e.createVNode(Qs,{tabs:_(W),modelValue:k[E(W)],"onUpdate:modelValue":ge=>k[E(W)]=ge,"is-vertical":W.propsWizard.isVertical,"is-wizard":W.propsWizard.isWizard,"type-wizard":((_t=W.propsWizard.typeWizard)==null?void 0:_t.toLowerCase())||"icon",loading:u.value},e.createSlots({_:2},[e.renderList(_(W),ge=>({name:`tab-${ge.key}`,fn:e.withCtx(()=>{var rt,Zt;return[e.createElementVNode("div",BA,[ge.title||(rt=ge.actions)!=null&&rt.length?(e.openBlock(),e.createElementBlock("div",_A,[e.createElementVNode("div",null,[ge.title?(e.openBlock(),e.createElementBlock("h4",SA,e.toDisplayString(ge.title),1)):e.createCommentVNode("",!0),ge.description?(e.openBlock(),e.createElementBlock("p",AA,e.toDisplayString(ge.description),1)):e.createCommentVNode("",!0)]),(Zt=ge.actions)!=null&&Zt.length?(e.openBlock(),e.createElementBlock("div",VA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.actions,(Pe,At)=>{var Vt,xt,vt,C,I,ne,R;return e.openBlock(),e.createElementBlock(e.Fragment,{key:At},[Fe(Pe)?(e.openBlock(),e.createBlock(Ye,{key:0,icon:Pe.icon||((Vt=Pe.propsActionGlobal)==null?void 0:Vt.icon),text:i.value==="id"?Pe.labelID||((xt=Pe.propsActionGlobal)==null?void 0:xt.labelID):Pe.labelEN||((vt=Pe.propsActionGlobal)==null?void 0:vt.labelEN),"bg-color":((I=Pe.bgColor||((C=Pe.propsActionGlobal)==null?void 0:C.bgColor))==null?void 0:I.toLowerCase())||"primary",variant:((R=Pe.variant||((ne=Pe.propsActionGlobal)==null?void 0:ne.variant))==null?void 0:R.toLowerCase())||"tonal",size:"sm",onClick:$=>J(Pe)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.sections,(Pe,At)=>{var Vt,xt,vt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:At},[te(Pe)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[((Vt=Pe.type)==null?void 0:Vt.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",Pe.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B(Pe.fields),C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.key},[Y(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([C.column==="FULL"&&Pe.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ci,{field:C,"model-value":ae(m,E(Pe)?`${E(Pe)}.${C.model}`:C.model)??m[C.model],"form-data":m,required:H(C),disabled:T(C),options:j(C),error:g[C.model],"dynamic-labels":S(C),"dynamic-length":w(C),"base-url":t.baseUrl,"onUpdate:modelValue":I=>et(C.model,I,E(Pe))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((xt=Pe.type)==null?void 0:xt.toUpperCase())==="TABLE"||Pe.isDataTable?(e.openBlock(),e.createElementBlock("div",DA,[e.createVNode(_o,{"table-config":Pe.propsDataTableWizard||Pe.propsTable,data:Mt(Pe.propsDataTableWizard||Pe.propsTable),nested:!0,"show-pagination":((vt=Pe.propsDataTableWizard||Pe.propsTable)==null?void 0:vt.pagination)??!0,onAction:C=>mt(Pe.propsDataTableWizard||Pe.propsTable,C)},null,8,["table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",NA," Unknown section type: "+e.toDisplayString(Pe.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])]})}))]),1032,["tabs","modelValue","onUpdate:modelValue","is-vertical","is-wizard","type-wizard","loading"])])):e.createCommentVNode("",!0)],64)}),128)),y!=null&&y.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((q=(F=h.value)==null?void 0:F.ui)==null?void 0:q.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(he=(le=h.value)==null?void 0:le.actionGlobal)!=null&&he.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(h.value.actionGlobal,(W,ie)=>{var Ee,je,tt;return e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[W.propsActionGlobal&&Fe(W)?(e.openBlock(),e.createBlock(Ye,{key:0,icon:W.propsActionGlobal.icon,text:i.value==="id"?W.propsActionGlobal.labelID:W.propsActionGlobal.labelEN,"bg-color":((Ee=W.propsActionGlobal.bgColor)==null?void 0:Ee.toLowerCase())||"primary",variant:((je=W.propsActionGlobal.variant)==null?void 0:je.toLowerCase())||"default",loading:u.value,disabled:K.value&&(W.permission==="CREATE"||W.permission==="UPDATE"||((tt=W.propsActionGlobal)==null?void 0:tt.key)==="submit"),onClick:st=>J(W)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(Ye,{key:1,text:"Submit","bg-color":"primary",loading:u.value,disabled:K.value,onClick:Ge},null,8,["loading","disabled"]))],2)),e.createVNode(Fn,{modelValue:p.visible,"onUpdate:modelValue":O[1]||(O[1]=W=>p.visible=W),title:p.title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",text:e.unref(a)("common.cancel"),onClick:O[0]||(O[0]=W=>p.visible=!1)},null,8,["text"]),e.createVNode(Ye,{text:e.unref(a)("common.confirm"),onClick:se},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",MA,e.toDisplayString(p.message),1)]),_:1},8,["modelValue","title"]),e.createVNode(Fn,{modelValue:X.value,"onUpdate:modelValue":O[3]||(O[3]=W=>X.value=W),title:fe.value,icon:_e.value,"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",text:Ve.value?i.value==="id"?"Tutup":"Close":i.value==="id"?"Batal":"Cancel",onClick:O[2]||(O[2]=W=>X.value=!1)},null,8,["text"]),Ve.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ye,{key:0,text:"Save",onClick:Ea}))]),default:e.withCtx(()=>[$e.value.length?(e.openBlock(),e.createElementBlock("div",vA,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,W=>(e.openBlock(),e.createElementBlock("div",{key:W.key,class:e.normalizeClass(W.column==="FULL"?"md:col-span-2":"col-span-1")},[Y(W,Ae)?(e.openBlock(),e.createBlock(ci,{key:0,field:W,"model-value":Ae[W.model],"form-data":Ae,required:Ve.value?!1:H(W,Ae),disabled:Ve.value||T(W,Ae),"view-only":Ve.value,options:j(W,Ae),error:Ve.value?void 0:oe[W.model],"dynamic-labels":S(W,Ae),"dynamic-length":w(W,Ae),"base-url":t.baseUrl,"onUpdate:modelValue":ie=>Ao(W.model,ie)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"]),e.createVNode(Fn,{modelValue:Bt.value,"onUpdate:modelValue":O[5]||(O[5]=W=>Bt.value=W),title:i.value==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:e.withCtx(()=>[e.createVNode(Ye,{variant:"outline",text:i.value==="id"?"Batal":"Cancel",onClick:O[4]||(O[4]=W=>Bt.value=!1)},null,8,["text"]),e.createVNode(Ye,{variant:"default","bg-color":"danger",icon:"Trash2",text:i.value==="id"?"Hapus":"Delete",onClick:Ca},null,8,["text"])]),default:e.withCtx(()=>[e.createElementVNode("div",PA,e.toDisplayString(i.value==="id"?"Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.":"Are you sure you want to delete this row? This action cannot be undone."),1)]),_:1},8,["modelValue","title"])])}}});function mu(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const TA={class:"w-full space-y-6 animate-pulse"},OA={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},FA=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",TA,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",OA,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),zA={class:"w-full"},IA={class:"relative mx-auto min-h-[37.5rem]"},RA={key:"content",class:"w-full"},LA={class:"mb-6"},$A={class:"text-neutral-500 dark:text-neutral-400"},jA={key:"skeleton",class:"w-full"},UA={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},ui=Ot(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var D,N,P,v,Q,j,G,Y;const o=t,r=n,a=(N=(D=e.getCurrentInstance())==null?void 0:D.appContext)==null?void 0:N.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const H=In.useRoute();if(H&&Object.keys(H).length>0)s=H;else{const T=e.getCurrentInstance();(Q=(v=(P=T==null?void 0:T.appContext)==null?void 0:P.config)==null?void 0:v.globalProperties)!=null&&Q.$route&&(s=T.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:H=>{typeof window<"u"&&(typeof H=="string"?window.location.href=H:H&&H.path&&(window.location.href=H.path))},__isFallback:!0};try{const H=In.useRouter();if(H)i=H;else{const T=e.getCurrentInstance();(Y=(G=(j=T==null?void 0:T.appContext)==null?void 0:j.config)==null?void 0:G.globalProperties)!=null&&Y.$router&&(i=T.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=ft();let d;try{d=$t.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=mu(),f=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const h=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const H=s.path.match(/\/edit\/([^\/]+)$/);return H?H[1]:null}),m=e.ref({}),g=e.ref(null),k=e.ref(!0),y=e.ref(!1),p="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",E="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",_=e.ref(o.layoutCode),B=e.computed(()=>{var U;if(!g.value)return"";const H=((U=d==null?void 0:d.value)==null?void 0:U.toLowerCase())||"en";return(H==="en"||H.startsWith("en-")?g.value.titleEN:g.value.titleID)||g.value.title||o.layoutCode});e.watch(B,H=>{H&&u(H)},{immediate:!0});const S=(H,T="")=>{const U={};return!H||typeof H!="object"||Object.keys(H).forEach(te=>{const Z=H[te],K=T?`${T}.${te}`:te;Z&&typeof Z=="object"&&!Array.isArray(Z)&&!(Z instanceof Date)&&Object.assign(U,S(Z,K)),U[K]=Z}),U},w=async()=>{var H,T,U,te,Z,K;k.value=!0;try{let ae=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(ae=s.query.code||o.layoutCode);const ue="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",ke=ue?{Authorization:`Bearer ${ue}`}:{},De=`${p}${ae}`;let Ce=await l(De,"GET",null,ke);if(!Ce.status||!Ce.data||Array.isArray(Ce.data)&&Ce.data.length===0)try{const ee=`${E}${ae}`,z=await l(ee,"GET",null,ke);if(z.status){const J=Array.isArray(z.data)?z.data[0]:z.data;J&&J.code&&(ae=J.code,_.value=ae,Ce=await l(`${p}${ae}`,"GET",null,ke))}}catch(ee){console.warn("Failed to resolve layout code via datatable",ee)}if(Ce.status){g.value=Array.isArray(Ce.data)?Ce.data[0]:Ce.data;const ee={};if((H=g.value)!=null&&H.sections&&g.value.sections.forEach(z=>{((z.propsForm||z.props||{}).fields||z.fields||[]).forEach(Be=>{var Ge;const ve=Be.model||((Ge=Be.props)==null?void 0:Ge.model)||Be.key;ve&&(ee[ve]=null)})}),m.value=ee,k.value=!1,f.value&&h.value){y.value=!0;try{const z=(te=(U=(T=g.value.sections)==null?void 0:T[0])==null?void 0:U.propsForm)==null?void 0:te.endpointForm,J=g.value.endpointForm,se=z||J;if(se!=null&&se.apiUrl){const Be=se.apiUrl,ve=se.apiMethod||"GET",Ge=se.keyParam||[],Xe={};Ge.length>0?Ge.forEach(Fe=>{Xe[Fe]=h.value}):Xe.id=h.value;const et=await c(Be,ve,Xe);if(console.log(`[AutoLayoutForm] API Result for ${Be}:`,et),et.status){let Fe=Array.isArray(et.data)?et.data[0]:et.data;et.payload&&(Fe={...Fe,...et.payload}),console.log("[AutoLayoutForm] Successfully fetched record:",Fe);const ut=S(Fe);m.value={...m.value,...Fe,...ut},console.log("[AutoLayoutForm] Updated initialData:",m.value)}else console.warn("[AutoLayoutForm] Record API returned status: false",et)}else if((Z=g.value.endpointGlobal)!=null&&Z.apiUrl){const Be=g.value.endpointGlobal.apiUrl,ve=g.value.endpointGlobal.apiMethod||"GET",Ge={id:h.value},Xe=await c(Be,ve,Ge);if(Xe.status){const et=Array.isArray(Xe.data)?Xe.data[0]:Xe.data,Fe=S(et);m.value={...m.value,...et,...Fe}}}else{const Be=((K=g.value.endpoint)==null?void 0:K.detailUrl)||`/api/${_.value}/detail/${h.value}`,ve=await l(Be,"GET");if(ve.status){let Ge=Array.isArray(ve.data)?ve.data[0]:ve.data;if(ve.payload){const Fe={...ve.payload};if(Object.keys(Fe).forEach(ut=>{Ge[ut]!==void 0&&Ge[ut]!==null&&(Fe[ut]=Ge[ut])}),!("id"in Fe)&&Ge.id){const ut=Object.keys(Fe).find(bt=>bt.startsWith("id")&&bt.length>2&&!Fe[bt]);ut&&(Fe[ut]=Ge.id)}Ge=Fe}const Xe={...Ge};Object.keys(m.value).forEach(Fe=>{if(Xe[Fe]===void 0||Xe[Fe]===null){if(Fe.toLowerCase().startsWith("id")&&Fe.length>2){const bt=Fe.substring(2).toLowerCase(),It=Array.isArray(ve.data)?ve.data[0]:ve.data,Mt=Object.keys(It).find(X=>X.toLowerCase()===bt);Mt&&It[Mt]&&typeof It[Mt]=="object"&&"id"in It[Mt]&&(Xe[Fe]=It[Mt].id)}if(Fe==="idSupervisor"){const bt=Array.isArray(ve.data)?ve.data[0]:ve.data;bt.supervisorId&&(Xe[Fe]=bt.supervisorId)}}});const et=S(Xe);m.value={...m.value,...Xe,...et}}}}catch(z){console.error("Failed to fetch record data:",z)}finally{y.value=!1}}}}catch(ae){console.error("Failed to load form layout:",ae),k.value=!1}},x=H=>{const T=Object.keys(m.value||{}).filter(te=>m.value[te]!==null&&m.value[te]!==void 0),U=Object.keys(H||{}).filter(te=>H[te]!==null&&H[te]!==void 0);if(T.length>3&&U.length<T.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:T.length,incomingCount:U.length,data:H});return}console.log("[AutoLayoutForm] Allowing model update:",H),m.value=H,r("update:model",H)},b=async H=>{var T,U,te;try{const Z=(te=(U=(T=g.value.sections)==null?void 0:T[0])==null?void 0:U.propsForm)==null?void 0:te.endpointForm,K=g.value.endpointGlobal||g.value.endpoint,ae=(Z==null?void 0:Z.submitUrl)||(K==null?void 0:K.submitUrl)||`/api/generic/${o.layoutCode}`,ue=(Z==null?void 0:Z.submitMethod)||(K==null?void 0:K.submitMethod)||(f.value?"PUT":"POST"),ke=Object.values(H).some(Ce=>Ce instanceof File||Ce instanceof Blob);let De;ke?(De=new FormData,Object.keys(H).forEach(Ce=>{const ee=H[Ce];ee!=null&&(Array.isArray(ee)?ee.forEach(z=>De.append(`${Ce}[]`,z)):De.append(Ce,ee))})):(De={...H},f.value&&h.value&&!De.id&&(De.id=h.value)),await l(ae,ue,De),r("submit-success",De),i.back()}catch(Z){console.error("Submit failed:",Z)}},A=async(H,T,U)=>{if(H==="cancel"){V();return}const te=T.endpointPropAction||T.propsActionGlobal&&T.propsActionGlobal.endpointPropAction;if(te)try{k.value=!0;const Z=U?{...U}:{...m.value};f.value&&T.model&&h.value&&(Z[T.model]=h.value);const K=te.apiUrl,ae=te.apiMethod||"POST";(await c(K,ae,Z)).status&&(r("action-success",H,T,Z),i.back())}catch(Z){console.error("Action failed:",Z)}finally{k.value=!1}},V=()=>{r("cancel"),i.back()};return e.onMounted(()=>{w()}),e.watch(()=>o.model,H=>{H&&Object.keys(H).length>0&&(m.value={...m.value,...H})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(H,T)=>(e.openBlock(),e.createElementBlock("div",zA,[e.createElementVNode("div",IA,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!k.value&&g.value?(e.openBlock(),e.createElementBlock("div",RA,[e.createElementVNode("div",LA,[e.createElementVNode("p",$A,e.toDisplayString(g.value.description),1)]),e.createVNode(di,{schema:g.value,model:m.value,"is-edit-mode":f.value,loading:y.value,"onUpdate:model":T[0]||(T[0]=U=>x(U)),onSubmit:b,onCancel:V,onAction:A,class:"w-full"},null,8,["schema","model","is-edit-mode","loading"])])):k.value?(e.openBlock(),e.createElementBlock("div",jA,[e.createVNode(FA)])):(e.openBlock(),e.createElementBlock("div",UA," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-68c4216e"]]),WA={class:"h-full flex flex-col"},HA={key:1,class:"flex-1 flex items-center justify-center"},qA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},fi=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var S,w,x,b,A,V;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=ft();let i={query:{},params:{},path:""};try{const D=In.useRoute();D?i=D:(x=(w=(S=a==null?void 0:a.appContext)==null?void 0:S.config)==null?void 0:w.globalProperties)!=null&&x.$route&&(i=a.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:D=>{typeof window<"u"&&(typeof D=="string"?window.location.href=D:D&&D.path&&(window.location.href=D.path))}};try{const D=In.useRouter();D?l=D:(V=(A=(b=a==null?void 0:a.appContext)==null?void 0:b.config)==null?void 0:A.globalProperties)!=null&&V.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),f=e.ref(!0),h=e.ref(null),m="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",g=e.computed(()=>`${m}${o.layoutCode}`),{setPageTitle:k}=mu();let y;try{y=$t.useI18n().locale}catch{y=e.ref("en")}const p=()=>{if(u.value){const N=(y.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";k(N)}};e.watch(y,()=>{p()});const E=async()=>{f.value=!0;try{const D="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",N=D?{Authorization:`Bearer ${D}`}:{},P=await s(g.value,"GET",null,N);P.status&&(u.value=Array.isArray(P.data)?P.data[0]:P.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),p())}catch(D){console.error("Gagal Menampilkan Datatable:",D)}finally{f.value=!1}},_=D=>{D.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",D.action,D)},B=D=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",D);let N=D.route;const P=D.path;if(!N&&P){const Q=((i==null?void 0:i.path)||"").split("/");Q.length>=2&&(N=`/${Q[1]}/create`)}if(N||P){const v={...D.query||{},code:P||void 0};Object.keys(v).forEach(Q=>v[Q]===void 0&&delete v[Q]),console.log("[DEBUG] Emitting navigate to parent:",{route:N,query:v}),r("navigate",{route:N||"/form",query:v}),l&&!l.__isFallback&&l.push({path:N||"/form",query:v})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{E()}),(D,N)=>(e.openBlock(),e.createElementBlock("div",WA,[!f.value&&u.value?(e.openBlock(),e.createBlock(_o,{key:0,ref_key:"dtRef",ref:h,"api-url":g.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:_,onNavigate:B},{"header-actions":e.withCtx(()=>[...N[0]||(N[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",HA,[...N[1]||(N[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",qA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),pu=e.defineCustomElement(ui),gu=e.defineCustomElement(fi);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",pu),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",gu));const GA=[gr,Ii,Ye,yl,Xa,Ka,Vd,Cn,zs,Is,oa,Fn,Hd,ra,qd,Hs,Rs,Gd,Gs,aa,Xs,ko,Ks,sa,Xd,Kd,Ys,Js,ia,la,lo,wo,Zd,eu,Qs,Zs,ei,li,_o,ui,fi,di],bu={install(t,n={}){n&&Object.keys(n).length>0&&pi(n),GA.forEach(o=>{o.name&&t.component(o.name,o)})}};pe.AutoLayoutDatatable=fi,pe.AutoLayoutForm=ui,pe.DCodeAutoComplete=gr,pe.DCodeBadge=li,pe.DCodeBeforeAfter=Xa,pe.DCodeButton=Ye,pe.DCodeCard=yl,pe.DCodeCardCheckboxList=zs,pe.DCodeChart=Vd,pe.DCodeCheckbox=Cn,pe.DCodeCurrencyField=Is,pe.DCodeDatePicker=oa,pe.DCodeDialog=Fn,pe.DCodeDialogCloseBtn=Hd,pe.DCodeDropzone=ra,pe.DCodeDynamicUploadList=Rs,pe.DCodeFileField=qd,pe.DCodeFileResult=Hs,pe.DCodeIconDropdown=Gd,pe.DCodeImageCropperDialog=Gs,pe.DCodeImageField=aa,pe.DCodeImageResult=Xs,pe.DCodeInfiniteAutoComplete=Ii,pe.DCodeLabel=ko,pe.DCodeListLabels=Ka,pe.DCodeMultiSelect=Ks,pe.DCodeOtpInput=sa,pe.DCodePermissionMenu=Zs,pe.DCodeProgress=Xd,pe.DCodeProgressBar=Kd,pe.DCodeRadio=Ys,pe.DCodeRadioCustom=Js,pe.DCodeSlider=ia,pe.DCodeSwitch=la,pe.DCodeTextField=lo,pe.DCodeTextarea=wo,pe.DCodeTimelineWithIcons=Zd,pe.DCodeTreePermissions=ei,pe.DCodeUploadFile=eu,pe.DCodeWizard=Qs,pe.DataTable=_o,pe.DataTableComponent=_o,pe.DynamicForm=di,pe.DynamicUI=bu,pe.MicroDynamicDatatable=gu,pe.MicroDynamicForm=pu,pe.cn=Re,pe.default=bu,pe.setApiConfig=pi,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
95
|
+
`});return(_,w)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-2 w-full",e.unref(o).class]),"aria-busy":!1},[d.value?(e.openBlock(),e.createBlock(e.unref(tr),{key:0,for:c.value,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(d.value)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",DC,"*")):e.createCommentVNode("",!0)]),_:1},8,["for"])):e.createCommentVNode("",!0),e.createElementVNode("div",NC,[t.showValue?(e.openBlock(),e.createElementBlock("div",MC,[e.createElementVNode("span",TC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.min)+e.toDisplayString(a.valueSuffix),1),e.createElementVNode("span",PC,e.toDisplayString(h.value),1),e.createElementVNode("span",OC,e.toDisplayString(a.valuePrefix)+e.toDisplayString(t.max)+e.toDisplayString(a.valueSuffix),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",vC,[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-1/2 -translate-y-1/2 w-full h-full bg-gray-200 rounded-lg pointer-events-none",[t.size==="sm"?"h-2":t.size==="md"?"h-2.5":"h-3"]])},[e.createElementVNode("div",{class:e.normalizeClass(["absolute top-0 left-0 h-full rounded-lg transition-all",[t.color==="blue"?"bg-blue-500":t.color==="green"?"bg-green-500":t.color==="red"?"bg-red-500":t.color==="yellow"?"bg-yellow-500":t.color==="purple"?"bg-purple-500":"bg-gray-500"]]),style:e.normalizeStyle({width:`${p.value}%`})},null,6)],2),e.createElementVNode("input",{id:c.value,ref_key:"sliderRef",ref:s,type:"range",value:t.modelValue,min:t.min,max:t.max,step:t.step,disabled:t.disabled,placeholder:t.placeholder,class:e.normalizeClass(f.value),onInput:k,onChange:x,onMousedown:g,onMouseup:S,onTouchstart:g,onTouchend:S},null,42,FC)]),t.marks.length>0?(e.openBlock(),e.createElementBlock("div",zC,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.marks,y=>(e.openBlock(),e.createElementBlock("div",{key:y.value,class:"absolute flex flex-col items-center",style:e.normalizeStyle({left:`${B(y.value)}%`,transform:"translateX(-50%)"})},[w[0]||(w[0]=e.createElementVNode("div",{class:"w-1 h-2 bg-gray-400 rounded-full"},null,-1)),e.createElementVNode("span",RC,e.toDisplayString(y.label),1)],4))),128))])):e.createCommentVNode("",!0)]),l.value?(e.openBlock(),e.createElementBlock("div",IC,[w[1]||(w[1]=e.createElementVNode("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e.createTextVNode(" "+e.toDisplayString(t.error),1)])):e.createCommentVNode("",!0),E.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent("style"),{key:2},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(E.value),1)]),_:1})):e.createCommentVNode("",!0)],2)),[[e.vShow,u.value]])}}),$C={class:"grid gap-3"},jC={key:0,class:"ml-1 text-destructive"},UC={class:"inline-flex items-center gap-3"},WC=["id","name","aria-checked","aria-label","disabled"],HC={key:0,class:"absolute inset-0 flex items-center justify-center"},qC={class:"relative z-10 flex items-center gap-2"},GC=["id","name","aria-checked","aria-label","disabled"],XC={key:0,class:"absolute inset-0 flex items-center justify-center"},KC={name:"DCodeSwitch"},la=e.defineComponent({...KC,props:{modelValue:{type:Boolean,default:!1},label:{default:""},title:{default:"Title"},disabled:{type:Boolean,default:!1},size:{default:"medium"},color:{default:"primary"},loading:{type:Boolean,default:!1},labelPosition:{default:"right"},id:{},name:{},required:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},tooltipActiveText:{default:"Aktif"},tooltipInactiveText:{default:"Tidak Aktif"}},emits:["update:modelValue","change"],setup(t,{emit:n}){const o=t,r=n,a=e.computed({get:()=>o.modelValue,set:f=>{!o.disabled&&!o.loading&&(r("update:modelValue",f),r("change",f))}}),s=e.computed(()=>{switch(o.size){case"small":return"w-9 h-5";case"large":return"w-14 h-7";default:return"w-11 h-6"}}),i=e.computed(()=>{switch(o.size){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}}),l=e.computed(()=>{switch(o.size){case"small":return"translate-x-4";case"large":return"translate-x-7";default:return"translate-x-5"}}),c=e.computed(()=>{if(o.disabled)return"bg-gray-300";if(!a.value)return"bg-gray-200";switch(o.color){case"success":return"bg-green-500";case"warning":return"bg-yellow-500";case"danger":return"bg-red-500";default:return"bg-blue-500"}}),d=()=>{a.value=!a.value},u=e.computed(()=>a.value?o.tooltipActiveText:o.tooltipInactiveText);return(f,m)=>(e.openBlock(),e.createElementBlock("div",$C,[t.title?(e.openBlock(),e.createBlock(tr,{key:0,class:"text-sm font-medium"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",jC,"*")):e.createCommentVNode("",!0)]),_:1})):e.createCommentVNode("",!0),e.createElementVNode("div",UC,[e.createVNode(e.unref(pl),null,{default:e.withCtx(()=>[t.showTooltip?(e.openBlock(),e.createBlock(e.unref(ml),{key:0,"delay-duration":200},{default:e.withCtx(()=>[e.createVNode(e.unref(gl),{"as-child":""},{default:e.withCtx(()=>[e.createElementVNode("button",{type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",HC,[...m[0]||(m[0]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,WC)]),_:1}),e.createVNode(e.unref(hl),{side:"top","side-offset":8,class:e.normalizeClass(["animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 px-3 py-2 rounded-lg text-sm font-medium shadow-xl border-0",[a.value?"bg-green-600 dark:bg-green-500 text-white":"bg-gray-700 dark:bg-gray-600 text-white"]])},{default:e.withCtx(()=>[e.createElementVNode("span",qC,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block w-2 h-2 rounded-full animate-pulse",a.value?"bg-green-200":"bg-gray-300"])},null,2),e.createTextVNode(" "+e.toDisplayString(u.value),1)])]),_:1},8,["class"])]),_:1})):(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",id:t.id,name:t.name,"aria-checked":a.value?"true":"false","aria-label":t.label||"Toggle switch",disabled:t.disabled||t.loading,class:e.normalizeClass([s.value,c.value,"relative inline-flex items-center rounded-full transition-all duration-300 ease-in-out focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500","hover:scale-105 active:scale-95",{"cursor-not-allowed opacity-50":t.disabled,"cursor-wait":t.loading,"cursor-pointer":!t.disabled&&!t.loading}]),onClick:d},[e.createElementVNode("span",{class:e.normalizeClass([i.value,a.value?l.value:"translate-x-0.5","inline-block transform rounded-full bg-white shadow-lg transition-all duration-300 ease-in-out","hover:shadow-xl flex items-center justify-center"])},[t.loading?(e.openBlock(),e.createElementBlock("span",XC,[...m[1]||(m[1]=[e.createElementVNode("svg",{class:"animate-spin h-3 w-3 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e.createElementVNode("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e.createElementVNode("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-200 ease-out","enter-from-class":"scale-0 rotate-90 opacity-0","enter-to-class":"scale-100 rotate-0 opacity-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"scale-100 rotate-0 opacity-100","leave-to-class":"scale-0 -rotate-90 opacity-0"},{default:e.withCtx(()=>[a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.Check),{key:0,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-green-600 stroke-[3]"])},null,8,["class"])):!a.value&&!t.loading?(e.openBlock(),e.createBlock(e.unref(le.X),{key:1,class:e.normalizeClass([t.size==="small"?"w-2.5 h-2.5":t.size==="large"?"w-4 h-4":"w-3 h-3","text-gray-400 stroke-[3]"])},null,8,["class"])):e.createCommentVNode("",!0)]),_:1})],2)],10,GC))]),_:1})])]))}}),YC=["aria-busy"],JC={key:0,class:"h-4 w-32 rounded bg-gray-200 dark:bg-gray-700 animate-pulse"},QC=["for"],ZC={key:0,class:"ml-1 text-destructive"},eE={class:"relative w-full group"},tE=["id","value"],nE={key:0,class:"absolute top-1 right-2"},oE={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"},rE={key:1,class:"text-xs text-destructive"},yo=e.defineComponent({name:"DCodeTextarea",inheritAttrs:!1,__name:"DCodeTextarea",props:{modelValue:{},clearable:{type:Boolean},hideClearWhenEmpty:{type:Boolean,default:!0},textCase:{default:"none"},applyTextCaseToValue:{type:Boolean,default:!0},valueType:{default:"free"},allowSpaces:{type:Boolean,default:!0},allowChars:{},pattern:{},visible:{type:Boolean,default:!0},skeleton:{type:Boolean,default:!1},showCharCount:{type:Boolean,default:!0},returnNumber:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","clear"],setup(t,{emit:n}){const o=e.useAttrs(),r=n,a=t,s=e.computed(()=>o.label),i=e.computed(()=>a.visible??!0),l=Math.random().toString(36).slice(2,7),c=e.computed(()=>`app-textarea-${o.id||s.value||"field"}-${l}`),d=e.computed(()=>{const Y=o.required,v=o["aria-required"];return Y===""||Y===!0||Y==="true"||(v==="true"||v===!0)}),u=e.computed(()=>{const{label:Y,class:v,id:K,required:re,"aria-required":_e,...Re}=o;return Re}),f=e.computed(()=>{const Y=o.maxlength;let v=Number.NaN;return typeof Y=="number"?v=Y:typeof Y=="string"&&(v=Number.parseInt(Y,10)),Number.isFinite(v)&&v>0?v:-1}),m=Y=>f.value>0?Y.slice(0,f.value):Y,h=e.computed(()=>{const Y=a.modelValue;return Y==null||String(Y).length===0}),p=e.computed(()=>a.clearable?a.hideClearWhenEmpty?!h.value:!0:!1),k=e.ref(String(a.modelValue??""));e.watch(()=>a.modelValue,Y=>{const v=String(Y??"");v!==k.value&&(k.value=v)});const x=e.ref(!1),g=e.ref(!1),S=Y=>Y.split(/(\s+)/).map(v=>{if(v.trim()==="")return v;const K=v.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}).join(""),B=Y=>{const v=Y.toLowerCase(),K=v.search(new RegExp("\\p{L}","u"));return K<0?v:v.slice(0,K)+v.charAt(K).toUpperCase()+v.slice(K+1)},E=Y=>{switch(a.textCase){case"uppercase":return Y.toUpperCase();case"lowercase":return Y.toLowerCase();case"titlecase":return S(Y);case"sentencecase":return B(Y);case"none":default:return Y}},_=e.computed(()=>{switch(a.textCase){case"uppercase":return"uppercase";case"lowercase":return"lowercase";default:return"none"}}),w=Y=>{if(!Y)return null;const v=Array.isArray(Y)?Y.join(""):Y;return v?new Set(v):null},y=e.computed(()=>w(a.allowChars)),b=(Y,v)=>(Y.lastIndex=0,Y.test(v)),C=Y=>{if(Y===`
|
|
96
|
+
`)return a.valueType!=="number";if(a.valueType==="free")return!0;const v=Y===" ",K=/\d/.test(Y),re=new RegExp("\\p{L}","u").test(Y),_e=new RegExp("\\p{N}","u").test(Y);return a.valueType==="number"?K:a.valueType==="letter"?re||a.allowSpaces&&v:a.valueType==="letternumber"?re||_e||a.allowSpaces&&v:!0},V=Y=>{let v="";for(const K of Y){const re=!!y.value&&y.value.has(K);a.pattern&&!re&&!b(a.pattern,K)||!re&&!C(K)||(v+=K)}return v},D=Y=>{const v=V(Y),K=a.applyTextCaseToValue?E(v):v;return m(K)};let N=null;const P=Y=>{if(Y==="")return null;if(a.valueType==="number"&&a.returnNumber){const v=Y.replaceAll(`
|
|
97
|
+
`,""),K=Number(v);return Number.isFinite(K)?K:null}return Y},M=Y=>{k.value=Y,r("update:modelValue",P(Y))},X=(Y,v)=>{const K=m(v);g.value=!0,Y.value=K,M(K),queueMicrotask(()=>g.value=!1)},$=(Y,v)=>{const K=Y.selectionStart??Y.value.length,re=Y.selectionEnd??Y.value.length;if(f.value>0){const _e=Y.value.length-(re-K),Re=f.value-_e;if(Re<=0)return;v=v.slice(0,Re)}Y.setRangeText(v,K,re,"end"),X(Y,D(Y.value))},H=Y=>{var re;if(!N||x.value||g.value||!((re=Y.inputType)!=null&&re.startsWith("insert")))return;const v=Y.data;if(v==null)return;const K=D(v);K!==v&&(Y.preventDefault(),K.length>0&&$(N,K))},J=Y=>{var re;if(!N||x.value||g.value)return;const v=((re=Y.clipboardData)==null?void 0:re.getData("text"))??"",K=D(v);K!==v&&(Y.preventDefault(),K.length>0&&$(N,K))},te=async Y=>{if(!N||x.value||g.value)return;const v=Y.target,K=v.value??"",re=D(K);if(re===K){const _e=v.selectionStart??re.length,Re=v.selectionEnd??re.length;X(v,re),await e.nextTick();try{v.setSelectionRange(_e,Re)}catch{}M(re)}else{const _e=v.selectionStart??re.length,Re=v.selectionEnd??re.length;X(v,re),await e.nextTick();try{v.setSelectionRange(_e,Re)}catch{}}},T=()=>x.value=!0,L=()=>{if(x.value=!1,!N)return;const Y=N.value??"",v=D(Y);v===Y?M(v):X(N,v)};e.onMounted(()=>{if(N=document.getElementById(c.value),!N)return;N.addEventListener("beforeinput",H),N.addEventListener("paste",J),N.addEventListener("input",te),N.addEventListener("compositionstart",T),N.addEventListener("compositionend",L);const Y=N.value??"",v=D(Y);v===Y?M(v):X(N,v)}),e.onBeforeUnmount(()=>{N&&(N.removeEventListener("beforeinput",H),N.removeEventListener("paste",J),N.removeEventListener("input",te),N.removeEventListener("compositionstart",T),N.removeEventListener("compositionend",L),N=null)});const Z=()=>{k.value="",N&&(N.value=""),r("update:modelValue",null),r("clear")},Q=e.computed(()=>k.value.length),W=e.computed(()=>a.showCharCount?f.value>0:!1),ie=e.computed(()=>W.value&&Q.value>0),de=e.computed(()=>`${Q.value} / ${f.value}`),Ce=e.computed(()=>!!a.error),Ne=e.computed(()=>{const Y=o.rows,v=typeof Y=="number"?Y:Number.parseInt(String(Y??""),10);return Number.isFinite(v)&&v>0?v:3}),ge=e.computed(()=>({height:`${Ne.value*24+16}px`}));return(Y,v)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["flex flex-col gap-1 w-full",e.unref(o).class]),"aria-busy":a.skeleton},[a.skeleton?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("div",JC)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"w-full rounded-lg bg-gray-200 dark:bg-gray-700 animate-pulse",style:e.normalizeStyle(ge.value)},null,4)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[s.value?(e.openBlock(),e.createElementBlock("label",{key:0,for:c.value,class:"text-sm font-medium"},[e.createTextVNode(e.toDisplayString(s.value)+" ",1),d.value?(e.openBlock(),e.createElementBlock("span",ZC,"*")):e.createCommentVNode("",!0)],8,QC)):e.createCommentVNode("",!0),e.createElementVNode("div",eE,[e.createElementVNode("textarea",e.mergeProps({id:c.value,value:k.value},u.value,{style:`text-transform: ${_.value}; padding-right: ${p.value?"2.5rem":"0.75rem"} !important; padding-left: 0.75rem !important;`,class:["flex min-h-[120px] w-full rounded-lg border py-2 bg-white dark:bg-neutral-800 text-foreground dark:text-gray-300 border-gray-300 dark:border-neutral-700/50 focus:ring-1 focus:ring-neutral-400 dark:focus:ring-neutral-600 text-sm placeholder:text-muted-foreground focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50",Ce.value?"border-destructive focus-visible:ring-destructive focus:ring-destructive":""]}),null,16,tE),p.value?(e.openBlock(),e.createElementBlock("div",nE,[e.createElementVNode("button",{type:"button",class:"text-muted-foreground hover:text-foreground text-sm leading-none","aria-label":"Clear textarea",onClick:Z}," ✕ ")])):e.createCommentVNode("",!0),ie.value&&!Ce.value?(e.openBlock(),e.createElementBlock("p",oE,e.toDisplayString(de.value),1)):e.createCommentVNode("",!0)]),Ce.value?(e.openBlock(),e.createElementBlock("p",rE,e.toDisplayString(a.error),1)):e.createCommentVNode("",!0)],64))],10,YC)),[[e.vShow,i.value]])}}),Kd=e.defineComponent({__name:"Avatar",props:{class:{type:[Boolean,null,String,Object,Array]},size:{default:"sm"},shape:{default:"circle"}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.AvatarRoot),{class:e.normalizeClass(e.unref(ve)(e.unref(aE)({size:t.size,shape:t.shape}),n.class))},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["class"]))}}),Yd=e.defineComponent({__name:"AvatarFallback",props:{delayMs:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.AvatarFallback),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),Jd=e.defineComponent({__name:"AvatarImage",props:{src:{},referrerPolicy:{},crossOrigin:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.AvatarImage),e.mergeProps(n,{class:"h-full w-full object-cover"}),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),aE=wr("inline-flex items-center justify-center font-normal text-foreground select-none shrink-0 bg-secondary overflow-hidden",{variants:{size:{sm:"h-10 w-10 text-xs",base:"h-16 w-16 text-2xl",lg:"h-32 w-32 text-5xl"},shape:{circle:"rounded-full",square:"rounded-md"}}}),ca=e.defineComponent({__name:"Separator",props:{orientation:{default:"horizontal"},decorative:{type:Boolean,default:!0},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.Separator),e.mergeProps(e.unref(o),{class:e.unref(ve)("shrink-0 bg-border",n.orientation==="horizontal"?"h-px w-full":"w-px h-full",n.class)}),null,16,["class"]))}}),sE={class:"bg-card text-card-foreground"},iE={class:"pb-6 px-3"},lE={key:0,class:"flex justify-center p-8"},cE={key:1,class:"p-8 text-center text-red-500"},dE={key:2,class:"relative"},uE={class:"space-y-6"},fE={class:"rounded-xl border bg-card text-card-foreground shadow"},mE={class:"p-4"},hE={class:"flex items-center justify-between gap-3"},pE={class:"font-medium"},gE={class:"text-xs text-muted-foreground"},bE={class:"mt-1 text-sm text-muted-foreground"},yE={class:"text-foreground"},xE={class:"text-foreground"},kE={class:"mt-1 text-xs text-muted-foreground"},wE={key:0,class:"mt-3 flex items-center gap-2 text-sm"},CE={class:"flex items-center justify-between gap-3"},EE={class:"font-medium"},BE={class:"text-xs text-muted-foreground"},_E={class:"mt-2 text-sm text-muted-foreground"},SE={class:"flex flex-wrap items-center justify-between gap-3"},VE={class:"flex items-center gap-3"},AE={class:"leading-tight"},DE={class:"text-sm font-medium"},NE={class:"text-xs text-muted-foreground"},ME={class:"flex items-center gap-2"},TE={key:2,class:"flex flex-col gap-3 sm:flex-row sm:items-start"},PE={class:"h-16 w-16 shrink-0 rounded-lg bg-muted flex items-center justify-center"},OE=["src"],vE={class:"flex-1"},FE={class:"flex items-center justify-between gap-3"},zE={class:"font-medium"},RE={class:"text-xs text-muted-foreground"},IE={class:"mt-1 text-sm text-muted-foreground"},LE={class:"text-left sm:text-center"},$E={class:"text-xs text-muted-foreground"},jE={class:"text-left sm:text-center"},UE={class:"text-xs text-muted-foreground"},WE={class:"text-left sm:text-center"},HE={class:"text-xs text-muted-foreground"},qE={class:"flex items-center justify-between gap-3"},GE={class:"font-medium"},XE={class:"text-xs text-muted-foreground"},KE={class:"mt-2 text-sm text-muted-foreground"},YE={class:"mt-3 flex items-center gap-3"},JE={class:"text-sm font-medium"},QE={class:"flex items-start justify-between gap-3"},ZE={class:"font-medium"},eB={class:"mt-3 grid gap-2 text-sm"},tB={class:"flex items-center justify-between gap-3"},nB={class:"flex items-center gap-2 text-muted-foreground"},oB={class:"font-medium"},rB={class:"flex items-center justify-between gap-3"},aB={class:"flex items-center gap-2 text-muted-foreground"},sB={class:"font-medium"},iB={class:"flex items-center justify-between gap-3"},lB={class:"flex items-center gap-2 text-muted-foreground"},cB={class:"font-medium"},dB={class:"flex items-center justify-between"},uB={class:"flex items-center gap-2"},fB={class:"flex items-start justify-between gap-3"},mB={class:"flex items-center gap-2"},hB={class:"font-medium"},pB={class:"mt-2 text-sm text-muted-foreground"},gB={key:0,class:"mt-1 text-sm text-muted-foreground"},bB={class:"flex flex-wrap items-center justify-between gap-3"},yB={class:"flex items-center gap-2"},xB={class:"text-xs text-muted-foreground"},Qd=e.defineComponent({name:"DCodeTimelineWithIcons",__name:"DCodeTimelineWithIcons",props:{items:{},apiUrl:{},apiMethod:{}},setup(t){const o=st.useBreakpoints(st.breakpointsTailwind).smaller("md");e.ref(!1);const r=t,a=e.ref(!1),s=e.ref(null),i=e.ref([]),l=e.computed(()=>i.value.length>0?i.value:r.items&&r.items.length>0?r.items:[]),c=async()=>{if(r.apiUrl){a.value=!0,s.value=null;try{const f=await fetch(r.apiUrl,{method:r.apiMethod||"GET",headers:{"Content-Type":"application/json"}});if(!f.ok)throw new Error(`Error: ${f.status} ${f.statusText}`);const m=await f.json();Array.isArray(m)?i.value=m:m.data&&Array.isArray(m.data)?i.value=m.data:m.items&&Array.isArray(m.items)?i.value=m.items:i.value=[]}catch(f){console.error("Failed to fetch timeline items:",f),s.value=f.message||"Failed to fetch data"}finally{a.value=!1}}};e.onMounted(()=>{r.apiUrl&&c()}),e.watch(()=>r.apiUrl,()=>{r.apiUrl?c():i.value=[]});const d=f=>{switch(f){case"flight":return{Icon:le.PlaneIcon,Circle:"bg-primary/10 text-primary border-primary/30"};case"interview":return{Icon:le.ClockIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};case"product":return{Icon:le.ShoppingCartIcon,Circle:"bg-amber-500/10 text-amber-600 border-amber-500/30"};case"design":return{Icon:le.PencilIcon,Circle:"bg-sky-500/10 text-sky-600 border-sky-500/30"};case"server":return{Icon:le.ServerIcon,Circle:"bg-rose-500/10 text-rose-600 border-rose-500/30"};case"location":return{Icon:le.MapPinIcon,Circle:"bg-emerald-500/10 text-emerald-600 border-emerald-500/30"};default:return{Icon:le.Circle,Circle:"bg-primary/10 text-primary border-primary/30"}}},u=f=>f.split(" ").filter(Boolean).slice(0,2).map(m=>{var h;return(h=m[0])==null?void 0:h.toUpperCase()}).join("");return(f,m)=>{const h=e.resolveComponent("ShoppingCart"),p=e.resolveComponent("DCodeBadge"),k=e.resolveComponent("RefreshCcw"),x=e.resolveComponent("MapPin");return e.openBlock(),e.createElementBlock("div",sE,[m[8]||(m[8]=e.createElementVNode("div",{class:"flex flex-col space-y-1.5 py-6 px-3"},[e.createElementVNode("h3",{class:"leading-none tracking-tight text-lg font-medium"},"Timeline With Icons")],-1)),e.createElementVNode("div",iE,[a.value?(e.openBlock(),e.createElementBlock("div",lE,[...m[0]||(m[0]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):s.value?(e.openBlock(),e.createElementBlock("div",cE,e.toDisplayString(s.value),1)):(e.openBlock(),e.createElementBlock("div",dE,[m[7]||(m[7]=e.createElementVNode("div",{class:"absolute left-4 top-0 h-full w-px bg-border"},null,-1)),e.createElementVNode("div",uE,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,(g,S)=>(e.openBlock(),e.createElementBlock("div",{key:S,class:"relative pl-14"},[e.createElementVNode("div",{class:e.normalizeClass(["absolute left-0 top-2 flex h-8 w-8 items-center justify-center rounded-full border",d(g.type).Circle])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d(g.type).Icon),{class:"h-4 w-4"}))],2),e.createElementVNode("div",fE,[e.createElementVNode("div",mE,[g.type==="flight"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("div",hE,[e.createElementVNode("p",pE,e.toDisplayString(g.title),1),e.createElementVNode("p",gE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",bE,[e.createElementVNode("span",yE,e.toDisplayString(g.from),1),e.createVNode(e.unref(le.ArrowRight),{class:"mx-2 inline h-4 w-4"}),e.createElementVNode("span",xE,e.toDisplayString(g.to),1)]),e.createElementVNode("p",kE,e.toDisplayString(g.time),1),g.fileName?(e.openBlock(),e.createElementBlock("div",wE,[e.createVNode(e.unref(le.FileText),{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("span",null,e.toDisplayString(g.fileName),1)])):e.createCommentVNode("",!0)],64)):g.type==="interview"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",CE,[e.createElementVNode("p",EE,e.toDisplayString(g.title),1),e.createElementVNode("p",BE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",_E,e.toDisplayString(g.desc),1),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",SE,[e.createElementVNode("div",VE,[e.createVNode(e.unref(Kd),{class:"h-10 w-10"},{default:e.withCtx(()=>[g.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Jd),{key:0,src:g.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Yd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(g.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("div",AE,[e.createElementVNode("p",DE,e.toDisplayString(g.personName),1),e.createElementVNode("p",NE,e.toDisplayString(g.personRole),1)])]),e.createElementVNode("div",ME,[e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Phone),{class:"h-4 w-4"})]),_:1})])])],64)):g.type==="product"?(e.openBlock(),e.createElementBlock("div",TE,[e.createElementVNode("div",PE,[g.imgUrl?(e.openBlock(),e.createElementBlock("img",{key:0,src:g.imgUrl,class:"h-full w-full rounded-lg object-cover",alt:"product"},null,8,OE)):(e.openBlock(),e.createBlock(h,{key:1,class:"h-5 w-5 text-muted-foreground"}))]),e.createElementVNode("div",vE,[e.createElementVNode("div",FE,[e.createElementVNode("p",zE,e.toDisplayString(g.title),1),e.createElementVNode("p",RE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",IE,e.toDisplayString(g.desc),1),e.createElementVNode("div",{class:e.normalizeClass(["mt-4 grid gap-3",e.unref(o)?"grid-cols-1":"grid-cols-3"])},[e.createElementVNode("div",LE,[m[1]||(m[1]=e.createElementVNode("p",{class:"text-sm font-medium"},"Customer",-1)),e.createElementVNode("p",$E,e.toDisplayString(g.customer),1)]),e.createElementVNode("div",jE,[m[2]||(m[2]=e.createElementVNode("p",{class:"text-sm font-medium"},"Price",-1)),e.createElementVNode("p",UE,e.toDisplayString(g.price),1)]),e.createElementVNode("div",WE,[m[3]||(m[3]=e.createElementVNode("p",{class:"text-sm font-medium"},"Quantity",-1)),e.createElementVNode("p",HE,e.toDisplayString(g.qty),1)])],2)])])):g.type==="design"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",qE,[e.createElementVNode("p",GE,e.toDisplayString(g.title),1),e.createElementVNode("p",XE,e.toDisplayString(g.meta),1)]),e.createElementVNode("p",KE,e.toDisplayString(g.desc),1),e.createElementVNode("div",YE,[e.createVNode(e.unref(Kd),{class:"h-10 w-10"},{default:e.withCtx(()=>[g.avatarUrl?(e.openBlock(),e.createBlock(e.unref(Jd),{key:0,src:g.avatarUrl},null,8,["src"])):e.createCommentVNode("",!0),e.createVNode(e.unref(Yd),null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(g.personName??"")),1)]),_:2},1024)]),_:2},1024),e.createElementVNode("p",JE,e.toDisplayString(g.personName),1)])],64)):g.type==="server"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",QE,[e.createElementVNode("p",ZE,e.toDisplayString(g.title),1),e.createVNode(p,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.chipText??""),1)]),_:2},1024)]),e.createElementVNode("div",eB,[e.createElementVNode("div",tB,[e.createElementVNode("div",nB,[e.createVNode(e.unref(le.Globe),{class:"h-4 w-4"}),m[4]||(m[4]=e.createElementVNode("span",null,"IP Address",-1))]),e.createElementVNode("span",oB,e.toDisplayString(g.ip),1)]),e.createElementVNode("div",rB,[e.createElementVNode("div",aB,[e.createVNode(e.unref(le.Cpu),{class:"h-4 w-4"}),m[5]||(m[5]=e.createElementVNode("span",null,"CPU",-1))]),e.createElementVNode("span",sB,e.toDisplayString(g.cpu),1)]),e.createElementVNode("div",iB,[e.createElementVNode("div",lB,[e.createVNode(e.unref(le.CpuIcon),{class:"h-4 w-4"}),m[6]||(m[6]=e.createElementVNode("span",null,"Memory",-1))]),e.createElementVNode("span",cB,e.toDisplayString(g.memory),1)])]),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",dB,[e.createElementVNode("div",uB,[e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Share2),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(k,{class:"h-4 w-4"})]),_:1})])])],64)):g.type==="location"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.createElementVNode("div",fB,[e.createElementVNode("div",mB,[e.createVNode(x,{class:"h-4 w-4 text-muted-foreground"}),e.createElementVNode("p",hB,e.toDisplayString(g.title),1)]),e.createVNode(p,{variant:"destructive",class:"h-6"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(g.chipText),1)]),_:2},1024)]),e.createElementVNode("p",pB,e.toDisplayString(g.desc1),1),g.desc2?(e.openBlock(),e.createElementBlock("p",gB,e.toDisplayString(g.desc2),1)):e.createCommentVNode("",!0),e.createVNode(e.unref(ca),{class:"my-4"}),e.createElementVNode("div",bB,[e.createElementVNode("div",yB,[e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.Link),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.MessageSquare),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(Ht),{size:"icon",variant:"ghost"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.User),{class:"h-4 w-4"})]),_:1})]),e.createElementVNode("p",xB,"Due date: "+e.toDisplayString(g.due),1)])],64)):e.createCommentVNode("",!0)])])]))),128))])]))])])}}}),kB={class:"dcode-upload-file"},wB={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"},CB={key:0,class:"text-xs text-gray-500 mt-1"},EB=["accept"],BB={key:1,class:"text-xs text-red-600 mt-1"},Zd=e.defineComponent({name:"DCodeUploadFile",__name:"DCodeUploadFile",props:{label:{},accept:{},errorMessage:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=n,r=a=>{var i;const s=(i=a.target.files)==null?void 0:i[0];s&&o("update:modelValue",s)};return(a,s)=>(e.openBlock(),e.createElementBlock("div",kB,[t.label?(e.openBlock(),e.createBlock(bo,{key:0,label:t.label},null,8,["label"])):e.createCommentVNode("",!0),e.createElementVNode("div",wB,[e.createVNode(e.unref(le.UploadCloud),{class:"w-8 h-8 text-gray-400 mb-2"}),s[0]||(s[0]=e.createElementVNode("p",{class:"text-sm text-gray-600 dark:text-gray-400"},[e.createElementVNode("span",{class:"font-medium text-primary-600"},"Click to upload"),e.createTextVNode(" or drag and drop ")],-1)),t.accept?(e.openBlock(),e.createElementBlock("p",CB,e.toDisplayString(t.accept),1)):e.createCommentVNode("",!0),e.createElementVNode("input",{type:"file",class:"hidden",onChange:r,accept:t.accept},null,40,EB)]),t.errorMessage?(e.openBlock(),e.createElementBlock("p",BB,e.toDisplayString(t.errorMessage),1)):e.createCommentVNode("",!0)]))}}),_B=["onClick"],SB={key:1,class:"mr-2 text-xs font-bold shrink-0 opacity-50"},VB={class:"font-semibold text-sm whitespace-normal text-center leading-tight"},AB={key:1},DB={key:0,class:"text-white"},NB={key:1},MB={key:2},TB=["disabled","onClick"],PB={key:1,class:"mr-2 text-sm font-bold opacity-70"},OB={class:"whitespace-normal text-sm text-center leading-tight"},vB={class:"flex flex-col flex-1 min-w-0"},FB={class:"rounded-lg border bg-muted/30 px-4 py-3 text-sm text-muted-foreground flex items-center gap-2"},zB={class:"text-sm text-muted-foreground"},RB={class:"px-1"},IB=["disabled"],LB=["type"],$B=["disabled"],Qs=Dt(e.defineComponent({name:"DCodeWizard",__name:"DCodeWizard",props:{tabs:{},modelValue:{},defaultTab:{default:0},allowTabClick:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},cache:{type:Boolean,default:!0},autoFetchOnMount:{type:Boolean,default:!0},apiOptions:{type:[Object,Function],default:void 0},isVertical:{type:Boolean,default:!1},isWizard:{type:Boolean,default:!1},typeWizard:{default:"icon"},showNavigation:{type:Boolean,default:!0},submitText:{default:"Simpan"},loading:{type:Boolean,default:!1},isSubmit:{type:Boolean,default:!1}},emits:["update:modelValue","change","loaded","error"],setup(t,{emit:n}){const o=t,r=n,a=ct(),s=a==null?void 0:a.DCodeApi;typeof s!="function"&&console.error("[DCodeWizardTabs] useApi() must expose DCodeApi()");const i=e.ref(o.defaultTab),l=e.computed({get(){var y;if(typeof o.modelValue=="string"){const b=(y=o.tabs)==null?void 0:y.findIndex(C=>C.key===o.modelValue);if(b!==void 0&&b>=0)return b}return(typeof o.modelValue=="number"?o.modelValue:void 0)??i.value},set(y){var b;if(i.value=y,typeof o.modelValue=="string"){const C=(b=o.tabs)==null?void 0:b[y];C?r("update:modelValue",C.key):r("update:modelValue",y)}else r("update:modelValue",y)}}),c=e.computed(()=>{var y;return((y=o.tabs)==null?void 0:y.length)??0}),d=e.computed(()=>{var y;return(y=o.tabs)==null?void 0:y[l.value]});function u(y){return c.value<=0?0:Math.min(Math.max(y,0),c.value-1)}function f(y){return y?typeof y=="string"?$t[y]||null:y:null}const m=e.reactive({});function h(y){return m[y.key]||(m[y.key]={loaded:!1,loading:!1,data:null,error:null}),m[y.key]}function p(){if(o.apiOptions)return typeof o.apiOptions=="function"?o.apiOptions():o.apiOptions}function k(y){const b=y.endpoint||{};return{apiModule:y.apiModule||b.apiModule,apiAction:y.apiAction||b.apiAction,apiUrl:b.apiUrl,apiMethod:b.apiMethod||"GET",apiParams:y.apiParams}}function x(y){if(o.isWizard||!o.allowTabClick||o.disabled)return!1;const b=o.tabs[y];return!(!b||b.disabled)}async function g(y){if(typeof y.tab.fetchData=="function"){const M=await y.tab.fetchData(),X=(M==null?void 0:M.data)??M;return(X==null?void 0:X.data)??X}const b=k(y.tab);if(!(b.apiModule&&b.apiAction||b.apiUrl))return null;if(typeof s!="function")throw new Error("DCodeApi is not available");const V=p();let D;if(b.apiUrl)D=await s("","",V,{_url:b.apiUrl,_method:b.apiMethod,_data:b.apiParams??void 0});else{const M={...V,...b.apiParams};D=await s(b.apiModule,b.apiAction,M)}const N=(D==null?void 0:D.data)??D;return(N==null?void 0:N.data)??N}async function S(y,{force:b=!1}={}){const C=u(y),V=o.tabs[C];if(!V)return;const D=h(V);if(!(o.cache&&D.loaded&&!b)&&!D.loading){D.loading=!0,D.error=null;try{const N=await g({tabIndex:C,tab:V});D.data=N,D.loaded=!0,r("loaded",{tabIndex:C,tab:V,data:N})}catch(N){const P=typeof(N==null?void 0:N.message)=="string"&&N.message||typeof N=="string"&&N||"Failed to load tab data.";D.error=P,r("error",{tabIndex:C,tab:V,message:P})}finally{D.loading=!1}}}function B(y){const b=u(y);x(b)&&b!==l.value&&(l.value=b)}function E(y=l.value){return S(y,{force:!0})}function _(){const y=u(l.value-1);y!==l.value&&(l.value=y)}function w(){const y=u(l.value+1);y!==l.value&&(l.value=y)}return e.watch(()=>o.tabs,y=>{for(const b of y??[])h(b)},{immediate:!0}),e.watch(()=>l.value,async y=>{var C;const b=(C=o.tabs)==null?void 0:C[y];b&&r("change",{tabIndex:y,tab:b}),await S(y)},{immediate:!0}),e.watch(()=>o.autoFetchOnMount,async y=>{y&&await S(l.value)},{immediate:!0}),(y,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["w-full rounded-lg border bg-card text-card-foreground shadow-sm",{"flex flex-row":t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass(["flex flex-col space-y-1.5 p-6",{"w-64 border-r pr-0":t.isVertical,"pb-2":t.isWizard&&!t.isVertical}])},[e.createElementVNode("div",{class:e.normalizeClass({"mt-4":!t.isVertical||t.isWizard})},[t.isWizard?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["w-full relative flex overflow-visible rounded-lg",t.isVertical?"flex-col gap-2":""])},[t.isVertical?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(t.tabs,(C,V)=>(e.openBlock(),e.createElementBlock("div",{key:C.key,class:"relative z-10 box-border flex items-center gap-3 w-full pb-6 last:pb-0"},[e.createElementVNode("div",{class:e.normalizeClass(["w-8 h-8 rounded-full flex shrink-0 items-center justify-center font-bold text-sm border-2 transition-all bg-card",[V<l.value?"wizard-num-done":"",V===l.value?"wizard-num-active":V>l.value?"wizard-num-pending":""]])},[t.typeWizard==="icon"&&C.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(C.icon)),{key:0,class:"w-4 h-4"})):t.typeWizard==="number"||!C.icon&&t.typeWizard!=="none"?(e.openBlock(),e.createElementBlock("span",AB,[V<l.value?(e.openBlock(),e.createElementBlock("span",DB,"✓")):(e.openBlock(),e.createElementBlock("span",NB,e.toDisplayString(V+1),1))])):(e.openBlock(),e.createElementBlock("span",MB))],2),e.createElementVNode("span",{class:e.normalizeClass(["text-xs font-semibold whitespace-normal px-2 py-1 rounded transition-colors text-left",V===l.value?"wizard-text-active":"wizard-text-pending"])},e.toDisplayString(C.title),3)]))),128)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.tabs,(C,V)=>(e.openBlock(),e.createElementBlock("div",{key:C.key,onClick:D=>B(V),style:e.normalizeStyle({zIndex:t.tabs.length-V}),class:"relative flex-1 group"},[e.createElementVNode("div",{class:e.normalizeClass(["relative flex items-center justify-center min-h-[3rem] h-auto py-2 px-2 cursor-pointer transition-colors w-full",[V>0?"pl-8":"",V===l.value?"wizard-step-active":V<l.value?"wizard-step-done":"wizard-step-pending"]])},[t.typeWizard==="icon"&&C.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(C.icon)),{key:0,class:"w-4 h-4 mr-2 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",SB,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",VB,e.toDisplayString(C.title),1)],2),V<t.tabs.length-1?(e.openBlock(),e.createElementBlock("svg",{key:0,class:e.normalizeClass(["absolute top-0 -right-[15.5px] w-[16px] h-full transition-colors block z-10",[V===l.value?"wizard-svg-active":V<l.value?"wizard-svg-done":"wizard-svg-pending"]]),preserveAspectRatio:"none",viewBox:"0 0 16 48"},[...b[0]||(b[0]=[e.createElementVNode("polygon",{points:"0,0 16,24 0,48"},null,-1)])],2)):e.createCommentVNode("",!0)],12,_B))),128))],2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex w-full",t.isVertical?"flex-col gap-1":"flex-wrap border-b border-separate"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.tabs,(C,V)=>(e.openBlock(),e.createElementBlock("button",{key:C.key,type:"button",disabled:!x(V),onClick:D=>B(V),class:e.normalizeClass(["relative min-h-[3rem] h-auto py-2 flex items-center justify-center gap-2 px-4 transition-all rounded-none focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 wizard-btn-common",e.unref(ve)("border-b border-r",!t.isVertical&&V===t.tabs.length-1&&"border-r-0",V===l.value?"wizard-btn-active":"wizard-btn-pending",!x(V)&&"opacity-60 cursor-not-allowed",t.isVertical?"w-full justify-start border-r-0":"flex-1")])},[t.typeWizard==="icon"&&C.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f(C.icon)),{key:0,class:"h-4 w-4 shrink-0"})):t.typeWizard==="number"?(e.openBlock(),e.createElementBlock("span",PB,e.toDisplayString(V+1),1)):e.createCommentVNode("",!0),e.createElementVNode("span",OB,e.toDisplayString(C.title),1)],10,TB))),128))],2))],2)],2),t.isVertical?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(ca),{key:0})),e.createElementVNode("div",vB,[e.createElementVNode("div",{class:e.normalizeClass(["p-6 flex-1 min-w-0",{"pl-6":t.isVertical}])},[e.createVNode(e.Transition,{name:"wizard-fade",mode:"out-in"},{default:e.withCtx(()=>{var C,V,D,N;return[(e.openBlock(),e.createElementBlock("div",{key:((C=d.value)==null?void 0:C.key)||l.value,class:"w-full"},[d.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(V=m[d.value.key])!=null&&V.loading?e.renderSlot(y.$slots,"loading",{key:0,tab:d.value,tabIndex:l.value},()=>[e.createElementVNode("div",FB,[e.createVNode(e.unref(le.Loader2),{class:"w-4 h-4 animate-spin"}),b[1]||(b[1]=e.createTextVNode(" Loading... ",-1))])],!0):e.renderSlot(y.$slots,`tab-${d.value.key}`,{key:1,tab:d.value,tabIndex:l.value,data:(D=m[d.value.key])==null?void 0:D.data,loaded:(N=m[d.value.key])==null?void 0:N.loaded,reload:E},()=>[e.createElementVNode("div",zB,[b[2]||(b[2]=e.createTextVNode(" Slot ",-1)),e.createElementVNode("code",RB,"tab-"+e.toDisplayString(d.value.key),1),b[3]||(b[3]=e.createTextVNode(" belum dibuat. ",-1))])],!0)],64)):e.createCommentVNode("",!0)]))]}),_:3})],2),t.isWizard||t.showNavigation?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["flex items-center justify-between p-6 pt-0",{"pl-6":t.isVertical}])},[e.createElementVNode("button",{type:"button",onClick:_,disabled:l.value<=0,class:"relative inline-flex items-center justify-center gap-2 px-5 py-2.5 text-sm font-medium transition-all duration-300 rounded-lg bg-[#ffffff] border border-[#e2e8f0] text-[#334155] shadow-sm hover:bg-[#f8fafc] hover:text-[#0f172a] hover:-translate-y-0.5 hover:shadow disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#ffffff] disabled:hover:text-[#334155] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#18181b] dark:border-[#27272a] dark:text-[#d4d4d8] dark:hover:bg-[#27272a] dark:hover:border-[#3f3f46] dark:disabled:hover:bg-[#18181b] dark:disabled:hover:text-[#d4d4d8] focus:outline-none focus:ring-2 focus:ring-[#e2e8f0] focus:ring-offset-2 active:scale-95"}," Sebelumnya ",8,IB),l.value<c.value-1?(e.openBlock(),e.createElementBlock("button",{key:0,type:t.isSubmit?"submit":"button",onClick:w,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"}," Selanjutnya ",8,LB)):(e.openBlock(),e.createElementBlock("button",{key:1,type:"submit",disabled:t.loading,class:"relative inline-flex items-center justify-center gap-2 px-6 py-2.5 text-sm font-medium text-[#ffffff] transition-all duration-300 rounded-lg shadow-md bg-[#2563eb] hover:bg-[#1d4ed8] hover:shadow-lg hover:-translate-y-0.5 disabled:opacity-50 disabled:cursor-not-allowed disabled:shadow-none disabled:hover:bg-[#2563eb] disabled:hover:translate-y-0 disabled:active:scale-100 dark:bg-[#3b82f6] dark:hover:bg-[#2563eb] focus:outline-none focus:ring-2 focus:ring-[#2563eb] focus:ring-offset-2 active:scale-95"},[t.loading?(e.openBlock(),e.createBlock(e.unref(le.Loader2),{key:0,class:"w-4 h-4 mr-2 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.submitText),1)],8,$B))],2)):e.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-9e7a4e21"]]),jB={class:"permission-menu w-full space-y-4"},UB={class:"bg-neutral-50/50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-4"},WB={class:"flex items-center justify-between"},HB={class:"flex items-center gap-3 flex-1"},qB=["onClick"],GB={key:1,class:"w-7"},XB={key:2,class:"flex-shrink-0"},KB={class:"text-lg font-semibold flex-1"},YB={key:0,class:"p-4 bg-gray-50 dark:bg-zinc-900/50 border-b border-gray-200 dark:border-neutral-700"},JB={class:"text-xs font-semibold text-gray-600 dark:text-neutral-400 uppercase tracking-wide mb-3"},QB={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},ZB=["checked","disabled","onChange"],e2={class:"text-sm font-medium text-gray-700 dark:text-neutral-300 group-hover:text-blue-700 dark:group-hover:text-primary-400"},t2={key:0,class:"p-4 space-y-3 bg-gray-50 dark:bg-zinc-900/30"},n2={class:"text-sm font-semibold text-gray-700 dark:text-neutral-300 mb-3 flex items-center gap-2"},o2={class:"bg-neutral-50 dark:bg-neutral-900/30 border-b border-neutral-200/60 dark:border-neutral-700/30 text-neutral-900 dark:text-neutral-100 p-3"},r2={class:"flex items-center justify-between"},a2={class:"flex items-center gap-3 flex-1"},s2={key:0,class:"flex-shrink-0"},i2={class:"text-base font-semibold flex-1"},l2={key:1,class:"text-xs bg-white/20 px-2 py-1 rounded font-mono hidden sm:inline-block"},c2={class:"flex items-center gap-2 px-2.5 py-1 bg-white/20 hover:bg-white/30 rounded-lg cursor-pointer transition-colors"},d2=["checked","onChange"],u2={class:"text-xs font-medium"},f2={key:0,class:"p-3"},m2={class:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-6 gap-2 w-full"},h2=["checked","disabled","onChange"],p2={class:"text-xs font-medium text-gray-700 dark:text-neutral-300 group-hover:text-pink-700 dark:group-hover:text-pink-400"},Zs=Dt(e.defineComponent({__name:"DCodePermissionMenu",props:{menuList:{default:()=>[]},enableParentControl:{type:Boolean,default:!1},showIcons:{type:Boolean,default:!0},modelValue:{default:()=>[]},treeData:{default:()=>[]}},emits:["permission-change","menu-check","update:modelValue"],setup(t,{expose:n,emit:o}){const{t:r}=vt.useI18n(),a=t,s=o,i=e.computed(()=>a.menuList&&a.menuList.length>0?a.menuList:a.treeData||[]),l=e.ref(new Map),c=e.ref(new Set),d=(V=!0)=>{(N=>{N.forEach(P=>{P.permission.forEach(M=>{const X=`${P.id}-${M.id}-parent`,$=M.code==="VIEW"||M.name.toUpperCase()==="VIEW";l.value.has(X)||l.value.set(X,$||(V?P.checked??!1:!1))}),P.detail&&P.detail.length>0&&P.detail.forEach(M=>{M.permission.forEach(X=>{const $=`${M.id}-${X.id}-child`,H=X.code==="VIEW"||X.name.toUpperCase()==="VIEW";l.value.has($)||l.value.set($,H||(V?M.checked??!1:!1))})})})})(i.value)},u=()=>{console.log("[DCodePermissionMenu] initializeFromModelValue called. modelValue:",a.modelValue),l.value.clear(),d(!1),a.modelValue&&a.modelValue.length>0&&a.modelValue.forEach(V=>{const D=V.menuId,N=V.actionsIds;i.value.forEach(P=>{P.id===D&&N.forEach(M=>{const X=`${D}-${M}-parent`;l.value.set(X,!0)}),P.detail&&P.detail.length>0&&P.detail.forEach(M=>{M.id===D&&N.forEach(X=>{const $=`${D}-${X}-child`;l.value.set($,!0)})})})})};u(),e.watch(()=>a.modelValue,()=>{u()},{deep:!0}),e.watch(()=>i.value.length,(V,D)=>{D===0&&V>0&&u()});const f=V=>V.detail&&V.detail.length>0,m=V=>{c.value.has(V)?c.value.delete(V):c.value.add(V)},h=V=>c.value.has(V),p=(V,D,N=!1)=>{const P=`${V}-${D}-${N?"child":"parent"}`;return l.value.get(P)??!1},k=()=>{const V=w();s("update:modelValue",V.permissions)},x=(V,D,N,P=!1)=>{const M=N.target.checked,X=`${V}-${D}-${P?"child":"parent"}`;l.value.set(X,M),s("permission-change",V,D,M,!P),k()},g=V=>V.permission.filter(S),S=V=>V.code==="VIEW"||V.name.toUpperCase()==="VIEW",B=(V,D,N)=>{const P=N.target.checked;D.permission.forEach(M=>{if(S(M)){const $=`${D.id}-${M.id}-child`;l.value.set($,!0);return}const X=`${D.id}-${M.id}-child`;l.value.set(X,P)}),l.value=new Map(l.value),s("menu-check",D.id,P),k()},E=(V,D=!1)=>{const N=D?V.permission:g(V);return!N||N.length===0?!1:N.every(P=>{const M=`${V.id}-${P.id}-${D?"child":"parent"}`;return l.value.get(M)??!1})},_=()=>{const V={};return i.value.forEach(D=>{var N;V[D.id]={name:D.name,parentPermissions:D.permission.map(P=>({id:P.id,name:P.name,checked:p(D.id,P.id,!1)})),children:((N=D.detail)==null?void 0:N.map(P=>({id:P.id,name:P.name,permissions:P.permission.map(M=>({id:M.id,name:M.name,checked:p(P.id,M.id,!0)}))})))||[]}}),V},w=()=>{const V=[],D=(N,P=!1)=>{const M=[];N.permission.forEach(X=>{const $=`${N.id}-${X.id}-${P?"child":"parent"}`;(l.value.get($)??!1)&&M.push(X.id)}),M.length>0&&V.push({menuId:N.id,actionsIds:M})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{D(P,!0)})}),{permissions:V}};return n({getCurrentStates:_,getPermissionsForDatabase:w,getAllPermissionsWithStatus:()=>{const V=[],D=(N,P=!1)=>{const M=N.permission.map($=>{const H=`${N.id}-${$.id}-${P?"child":"parent"}`,J=l.value.get(H)??!1;return{id:$.id,name:$.name,checked:J}}),X=M.filter($=>$.checked).map($=>$.id);V.push({menuId:N.id,menuName:N.name,actionsIds:X,actions:M})};return i.value.forEach(N=>{D(N,!1),N.detail&&N.detail.length>0&&N.detail.forEach(P=>{D(P,!0)})}),{permissions:V}},permissionStates:l,expandAll:()=>{i.value.forEach(V=>{f(V)&&c.value.add(V.id)})},collapseAll:()=>{c.value.clear()}}),(V,D)=>(e.openBlock(),e.createElementBlock("div",jB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,N=>(e.openBlock(),e.createElementBlock("div",{key:N.id,class:e.normalizeClass(["dcode-card overflow-hidden",{"border-l-4 border-l-blue-500":f(N)}])},[e.createElementVNode("div",UB,[e.createElementVNode("div",WB,[e.createElementVNode("div",HB,[f(N)?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:P=>m(N.id),type:"button",class:"p-1 hover:bg-white/20 rounded-lg transition-colors"},[h(N.id)?(e.openBlock(),e.createBlock(e.unref(le.ChevronDown),{key:0,class:"w-5 h-5"})):(e.openBlock(),e.createBlock(e.unref(le.ChevronRight),{key:1,class:"w-5 h-5"}))],8,qB)):(e.openBlock(),e.createElementBlock("div",GB)),t.showIcons&&N.icon?(e.openBlock(),e.createElementBlock("span",XB,[e.createElementVNode("i",{class:e.normalizeClass([N.icon,"text-2xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h3",KB,e.toDisplayString(N.name),1)])])]),N.permission&&N.permission.length>0&&!f(N)?(e.openBlock(),e.createElementBlock("div",YB,[e.createElementVNode("h4",JB,e.toDisplayString(e.unref(r)("common.permissions"))+": ",1),e.createElementVNode("div",QB,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g(N),P=>(e.openBlock(),e.createElementBlock("label",{key:P.id,class:"flex items-center gap-2 px-3 py-2 bg-white dark:bg-neutral-800 border border-gray-200 dark:border-neutral-700/50 rounded-lg cursor-pointer hover:border-blue-400 dark:hover:border-primary-500 hover:bg-blue-50 dark:hover:bg-neutral-900/50 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:S(P)||p(N.id,P.id,!1),disabled:S(P),onChange:M=>x(N.id,P.id,M,!1),class:e.normalizeClass(["w-4 h-4 text-blue-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-blue-500 dark:focus:ring-blue-600",S(P)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,ZB),e.createElementVNode("span",e2,e.toDisplayString(P.name),1)]))),128))])])):e.createCommentVNode("",!0),e.createVNode(e.Transition,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0","enter-to-class":"opacity-100 max-h-[5000px]","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-[5000px]","leave-to-class":"opacity-0 max-h-0"},{default:e.withCtx(()=>[f(N)&&h(N.id)?(e.openBlock(),e.createElementBlock("div",t2,[e.createElementVNode("h4",n2,[D[0]||(D[0]=e.createElementVNode("span",{class:"w-1 h-4 bg-blue-500 rounded"},null,-1)),e.createTextVNode(" "+e.toDisplayString(e.unref(r)("common.subMenus")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.detail,P=>(e.openBlock(),e.createElementBlock("div",{key:P.id,class:"bg-white dark:bg-neutral-800 rounded-lg border border-gray-200 dark:border-neutral-700/50 overflow-hidden shadow-sm hover:shadow transition-shadow"},[e.createElementVNode("div",o2,[e.createElementVNode("div",r2,[e.createElementVNode("div",a2,[t.showIcons&&P.icon?(e.openBlock(),e.createElementBlock("span",s2,[e.createElementVNode("i",{class:e.normalizeClass([P.icon,"text-xl"])},null,2)])):e.createCommentVNode("",!0),e.createElementVNode("h5",i2,e.toDisplayString(P.name),1),P.path?(e.openBlock(),e.createElementBlock("span",l2,e.toDisplayString(P.path),1)):e.createCommentVNode("",!0),e.createElementVNode("label",c2,[e.createElementVNode("input",{type:"checkbox",checked:E(P,!0),onChange:M=>B(N,P,M),class:"w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600 cursor-pointer"},null,40,d2),e.createElementVNode("span",u2,e.toDisplayString(e.unref(r)("common.selectAll")),1)])])])]),P.permission&&P.permission.length>0?(e.openBlock(),e.createElementBlock("div",f2,[e.createElementVNode("div",m2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.permission,M=>(e.openBlock(),e.createElementBlock("label",{key:M.id,class:"flex items-center gap-2 px-2.5 py-1.5 bg-gray-50 dark:bg-zinc-900/50 border border-gray-200 dark:border-neutral-700 rounded-md cursor-pointer hover:border-pink-400 dark:hover:border-pink-500 hover:bg-pink-50 dark:hover:bg-pink-900/20 transition-all group"},[e.createElementVNode("input",{type:"checkbox",checked:S(M)||p(P.id,M.id,!0),disabled:S(M),onChange:X=>x(P.id,M.id,X,!0),class:e.normalizeClass(["w-3.5 h-3.5 text-pink-600 border-gray-300 dark:border-neutral-600 dark:bg-zinc-800 rounded focus:ring-pink-500 dark:focus:ring-pink-600",S(M)?"cursor-not-allowed opacity-75":"cursor-pointer"])},null,42,h2),e.createElementVNode("span",p2,e.toDisplayString(M.name),1)]))),128))])])):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0)]),_:2},1024)],2))),128))]))}}),[["__scopeId","data-v-40ddf81d"]]),g2={class:"space-y-4"},b2={key:0,class:"block text-sm font-medium text-neutral-700 dark:text-neutral-300 mb-2"},y2={key:0,class:"text-danger-500"},x2={key:1,class:"flex items-center justify-center p-8 bg-white dark:bg-gray-800 rounded-lg shadow"},k2={class:"text-neutral-600 dark:text-neutral-400"},w2={key:2,class:"p-6 bg-white dark:bg-gray-800 rounded-lg shadow text-center"},C2={class:"text-neutral-500 dark:text-neutral-400"},E2={key:3,class:"space-y-3"},B2={class:"flex items-center justify-between p-4 bg-neutral-50 dark:bg-neutral-800 border-b border-neutral-200 dark:border-neutral-700"},_2={class:"flex items-center gap-3"},S2={class:"font-medium text-gray-900 dark:text-gray-100 text-base"},V2={class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5"},A2={class:"flex items-center gap-2 text-sm font-medium"},D2={class:"px-2.5 py-1 rounded-full bg-primary-100 dark:bg-primary-900 text-primary-700 dark:text-primary-300"},N2={class:"p-4"},M2={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"},T2={class:"ml-2 flex-1 min-w-0"},P2=["for"],O2={key:0,class:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 line-clamp-2"},v2={key:4,class:"mt-1 text-xs text-danger-600"},ei=e.defineComponent({__name:"DCodeTreePermissions",props:{modelValue:{},label:{},required:{type:Boolean},disabled:{type:Boolean},error:{},treeData:{}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,{t:a}=vt.useI18n(),s=e.ref(!0),i=e.ref([]),l=e.ref({}),c=e.ref([]),d=e.ref({}),u=g=>{if(console.log(g),!g)return[];if(Array.isArray(g)&&g.length>0&&g[0].module&&Array.isArray(g[0].permissions))return g.map(S=>({menuId:S.menuId,module:S.module,label:S.label||S.module,permissions:S.permissions}));if(Array.isArray(g)&&g.length>0&&g[0].key){const S={};return g.forEach(B=>{const E=B.key,_=E&&E.includes(".")?E.split(".")[0]:"other";S[_]||(S[_]={menuId:0,module:_,label:_,permissions:[]}),S[_].permissions.push({id:B.id,key:B.key,label:B.label,description:B.description})}),Object.values(S)}if(Array.isArray(g)&&g.length>0&&g[0].id&&g[0].name&&Array.isArray(g[0].permission)){const S=[],B=(E,_="")=>{const w=_?`${_}.${E.name}`:E.name,y=w.toLowerCase().replace(/\s+/g,"_"),b=[];if(E.detail&&Array.isArray(E.detail)&&E.detail.forEach(C=>{b.push(C.id)}),E.permission&&E.permission.length>0){const C=E.permission.map(V=>({id:V.id,key:`${y}.${V.name.toLowerCase().replace(/\s+/g,"_")}`,label:`${V.name} ${E.name}`,description:`Permission to ${V.name.toLowerCase()} ${E.name.toLowerCase()}`}));S.push({menuId:E.id,module:y,label:E.name,permissions:C,subMenuIds:b.length>0?b:void 0})}E.detail&&Array.isArray(E.detail)&&E.detail.forEach(C=>{B(C,w)})};return g.forEach(E=>B(E)),S}return g.data?u(g.data):[]},f=async()=>{s.value=!0;try{let g;o.treeData&&o.treeData.length>0?g=o.treeData:g=[];const S=u(g);i.value=S;const B={},E=[],_={};S.forEach(y=>{y.permissions.forEach(b=>{const C=typeof b.id=="string"?parseInt(b.id):b.id;_[C]=y.menuId})});const w=new Set;o.modelValue&&Array.isArray(o.modelValue)&&o.modelValue.forEach(y=>{E.push(y.menuId),y.actionsIds&&Array.isArray(y.actionsIds)&&y.actionsIds.forEach(b=>w.add(b))}),S.forEach(y=>y.permissions.forEach(b=>{const C=typeof b.id=="string"?parseInt(b.id):b.id;B[C]=w.has(C)})),l.value=B,c.value=E,d.value=_}catch{i.value=[]}finally{s.value=!1}},m=g=>g.permissions.filter(S=>{const B=typeof S.id=="string"?parseInt(S.id):S.id;return l.value[B]}).length,h=g=>g.permissions.every(S=>{const B=typeof S.id=="string"?parseInt(S.id):S.id;return l.value[B]}),p=g=>{const S=m(g);return S>0&&S<g.permissions.length},k=e.ref(!1),x=(g,S)=>{k.value=!0,g.permissions.map(_=>typeof _.id=="string"?parseInt(_.id):_.id),g.permissions.forEach(_=>{const w=typeof _.id=="string"?parseInt(_.id):_.id;l.value[w]=S});let B=o.modelValue?[...o.modelValue]:[],E=[g.menuId];g.subMenuIds&&g.subMenuIds.length>0&&(E=[...E,...g.subMenuIds],g.subMenuIds.forEach(_=>{const w=i.value.find(y=>y.menuId===_);w&&w.permissions.forEach(y=>{const b=typeof y.id=="string"?parseInt(y.id):y.id;l.value[b]=S})})),S?E.forEach(_=>{const w=i.value.find(y=>y.menuId===_);if(w){const y=w.permissions.map(C=>typeof C.id=="string"?parseInt(C.id):C.id),b=B.findIndex(C=>C.menuId===_);b!==-1?B[b]={menuId:_,actionsIds:y}:B.push({menuId:_,actionsIds:y})}}):B=B.filter(_=>!E.includes(_.menuId)),c.value=B.map(_=>_.menuId),console.log("Full Result:",JSON.stringify(B,null,2)),r("update:modelValue",B),setTimeout(()=>{k.value=!1},100)};return e.watch(()=>o.modelValue,g=>{if(!g)return;const S=new Set,B=[];g.forEach(E=>{B.push(E.menuId),E.actionsIds&&Array.isArray(E.actionsIds)&&E.actionsIds.forEach(_=>S.add(_))}),Object.keys(l.value).forEach(E=>{const _=parseInt(E);l.value[_]=S.has(_)}),c.value=B}),e.watch(()=>o.treeData,g=>{g&&g.length>0&&f()},{deep:!0}),e.watch(l,(g,S)=>{if(k.value)return;if(Object.keys(g).map(E=>parseInt(E)).filter(E=>g[E]!==(S==null?void 0:S[E])).length>0){let E=o.modelValue?[...o.modelValue]:[];const _={};Object.keys(g).forEach(w=>{const y=parseInt(w);if(g[y]){const b=d.value[y];console.log(`Permission ${y} belongs to Menu ${b}`),b!==void 0&&(_[b]||(_[b]=[]),_[b].push(y))}}),Object.keys(_).forEach(w=>{const y=parseInt(w),b=_[y],C=E.findIndex(V=>V.menuId===y);C!==-1?E[C]={menuId:y,actionsIds:b}:E.push({menuId:y,actionsIds:b})}),E=E.filter(w=>_[w.menuId]&&_[w.menuId].length>0),c.value=E.map(w=>w.menuId),console.log("Result:",JSON.stringify(E,null,2)),r("update:modelValue",E)}},{deep:!0}),e.onMounted(f),(g,S)=>(e.openBlock(),e.createElementBlock("div",g2,[t.label?(e.openBlock(),e.createElementBlock("label",b2,[e.createTextVNode(e.toDisplayString(t.label)+" ",1),t.required?(e.openBlock(),e.createElementBlock("span",y2,"*")):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.value?(e.openBlock(),e.createElementBlock("div",x2,[e.createVNode(e.unref(le.Loader2),{class:"animate-spin text-primary-600 mr-2",size:24}),e.createElementVNode("span",k2,e.toDisplayString(e.unref(a)("common.loadingPermissions")),1)])):i.value.length===0?(e.openBlock(),e.createElementBlock("div",w2,[e.createElementVNode("p",C2,e.toDisplayString(e.unref(a)("common.noPermissions")),1)])):(e.openBlock(),e.createElementBlock("div",E2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,B=>(e.openBlock(),e.createElementBlock("div",{key:B.module,class:"bg-white dark:bg-neutral-800 rounded-lg border border-neutral-200/60 dark:border-neutral-700/50 shadow-sm hover:shadow-md transition-shadow"},[e.createElementVNode("div",B2,[e.createElementVNode("div",_2,[e.createVNode(gn,{modelValue:h(B),indeterminate:p(B),"onUpdate:modelValue":E=>x(B,!!E),disabled:t.disabled},null,8,["modelValue","indeterminate","onUpdate:modelValue","disabled"]),e.createElementVNode("div",null,[e.createElementVNode("div",S2,e.toDisplayString(B.label||B.module),1),e.createElementVNode("div",V2,e.toDisplayString(m(B))+" "+e.toDisplayString(e.unref(a)("common.from"))+" "+e.toDisplayString(B.permissions.length)+" "+e.toDisplayString(e.unref(a)("common.selected")),1)])]),e.createElementVNode("div",A2,[e.createElementVNode("div",D2,e.toDisplayString(m(B))+"/"+e.toDisplayString(B.permissions.length),1)])]),e.createElementVNode("div",N2,[e.createElementVNode("div",M2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.permissions,E=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:"flex items-start p-2 rounded hover:bg-gray-50 dark:hover:bg-gray-750 transition-colors"},[e.createVNode(gn,{modelValue:l.value[typeof E.id=="string"?parseInt(E.id):E.id],"onUpdate:modelValue":_=>l.value[typeof E.id=="string"?parseInt(E.id):E.id]=_,disabled:t.disabled,class:"flex-shrink-0"},null,8,["modelValue","onUpdate:modelValue","disabled"]),e.createElementVNode("div",T2,[e.createElementVNode("label",{for:`perm-${E.id}`,class:"text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer block"},e.toDisplayString(E.label||E.key),9,P2),E.description?(e.openBlock(),e.createElementBlock("p",O2,e.toDisplayString(E.description),1)):e.createCommentVNode("",!0)])]))),128))])])]))),128))])),t.error?(e.openBlock(),e.createElementBlock("p",v2,e.toDisplayString(t.error),1)):e.createCommentVNode("",!0)]))}}),F2=(t,n="short",o="id-ID")=>{const r=typeof t=="string"?new Date(t):t,a=c=>String(c).padStart(2,"0"),s=c=>`${a(c.getHours())}:${a(c.getMinutes())}:${a(c.getSeconds())}`,l={id:"id-ID",en:"en-GB"}[o]||o;return n==="time"?s(r):n==="datetime"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r):n==="long"?new Intl.DateTimeFormat(l,{day:"2-digit",month:"long",year:"numeric",hour:"2-digit",minute:"2-digit"}).format(r):new Intl.DateTimeFormat(l,{day:"2-digit",month:"short",year:"numeric"}).format(r)},z2=t=>new Promise((n,o)=>{const r=document.createElement("textarea");r.value=t,r.style.top="0",r.style.left="0",r.style.position="fixed",document.body.appendChild(r),r.focus(),r.select();try{document.execCommand("copy")?n():o(new Error("Copy command was unsuccessful"))}catch(a){o(a)}finally{document.body.removeChild(r)}}),R2=async t=>navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(t):z2(t),I2={key:0,class:"fixed inset-0 z-[100] flex justify-end"},L2={key:0,class:"relative w-full max-w-sm h-full bg-white dark:bg-slate-900 shadow-2xl flex flex-col border-l border-gray-200 dark:border-gray-800"},$2={class:"px-6 py-4 border-b border-gray-100 dark:border-gray-800 flex items-center justify-between"},j2={class:"text-lg font-semibold text-gray-900 dark:text-gray-100"},U2={key:0,class:"text-sm text-gray-500 dark:text-gray-400 mt-1"},W2={class:"flex-1 overflow-y-auto p-6 scrollbar-thin scrollbar-thumb-gray-200 dark:scrollbar-thumb-gray-800"},H2={class:"px-6 py-4 border-t border-gray-100 dark:border-gray-800 bg-gray-50/50 dark:bg-slate-900/50"},q2=e.defineComponent({__name:"DataFilterSheet",props:{title:{default:"Filter Data"},description:{default:"Masukan parameter pencarian untuk memfilter data."}},setup(t,{expose:n}){const o=e.ref(!1),r=()=>{o.value=!0,document.body.style.overflow="hidden"},a=()=>{o.value=!1,document.body.style.overflow=""};return n({open:r,close:a}),(s,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{onClick:r},[e.renderSlot(s.$slots,"trigger",{},()=>[e.createVNode(Ke,{variant:"outline",class:"gap-2",icon:"Search",text:"Pencarian"})])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[o.value?(e.openBlock(),e.createElementBlock("div",I2,[e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-opacity duration-300 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 bg-black/40 backdrop-blur-sm",onClick:a})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{appear:"","enter-active-class":"transition-transform duration-300 ease-out","enter-from-class":"translate-x-full","enter-to-class":"translate-x-0","leave-active-class":"transition-transform duration-200 ease-in","leave-from-class":"translate-x-0","leave-to-class":"translate-x-full"},{default:e.withCtx(()=>[o.value?(e.openBlock(),e.createElementBlock("div",L2,[e.createElementVNode("div",$2,[e.createElementVNode("div",null,[e.createElementVNode("h3",j2,e.toDisplayString(t.title),1),t.description?(e.openBlock(),e.createElementBlock("p",U2,e.toDisplayString(t.description),1)):e.createCommentVNode("",!0)]),e.createVNode(Ke,{variant:"ghost",size:"icon",onClick:a,icon:"X",class:"text-gray-400 hover:text-gray-600"})]),e.createElementVNode("div",W2,[e.renderSlot(s.$slots,"default")]),e.createElementVNode("div",H2,[e.renderSlot(s.$slots,"footer")])])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)]))]))}}),G2={key:0},X2=["value","name"],eu=e.defineComponent({__name:"DynamicFilterField",props:{field:{},modelValue:{}},emits:["update:modelValue"],setup(t,{emit:n}){const{locale:o}=vt.useI18n(),r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,u=>{s.value=u});const i={DCodeTextField:ao,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:yo,DCodeTextArea:yo,DCodeCheckbox:gn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia},l=e.computed(()=>{const u=r.field.component;return i[u]||null}),c=e.computed(()=>{const u=r.field.props,f={};return(u.labelID||u.labelEN)&&(f.label=o.value==="id"?u.labelID:u.labelEN),(u.placeholderID||u.placeholderEN)&&(f.placeholder=o.value==="id"?u.placeholderID:u.placeholderEN),u.required!==void 0&&(f.required=u.required),u.disabled!==void 0&&(f.disabled=u.disabled),u.readonly!==void 0&&(f.readonly=u.readonly),u.valueType&&(f.type=u.valueType),u.minLength!==void 0&&(f.minlength=u.minLength),u.maxLength!==void 0&&(f.maxlength=u.maxLength),u.min!==void 0&&(f.min=u.min),u.max!==void 0&&(f.max=u.max),u.options&&(f.options=u.options),u.endpoint&&(f.endpoint=u.endpoint),u.itemTitle&&(f.itemTitle=u.itemTitle),u.itemValue&&(f.itemValue=u.itemValue),u.returnObject!==void 0&&(f.returnObject=u.returnObject),u.clearable!==void 0&&(f.clearable=u.clearable),Object.keys(u).forEach(m=>{!["labelID","labelEN","placeholderID","placeholderEN"].includes(m)&&!f.hasOwnProperty(m)&&(f[m]=u[m])}),f}),d=u=>{s.value=u,a("update:modelValue",u)};return(u,f)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",G2,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,X2)])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:1},c.value,{modelValue:s.value,"onUpdate:modelValue":[f[0]||(f[0]=m=>s.value=m),d]}),null,16,["modelValue"]))}}),K2=e.defineComponent({__name:"Input",props:{defaultValue:{},modelValue:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:modelValue"],setup(t,{emit:n}){const o=t,r=n,a=st.useVModel(o,"modelValue",r,{passive:!0,defaultValue:o.defaultValue});return(s,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("input",{"onUpdate:modelValue":i[0]||(i[0]=l=>e.isRef(a)?a.value=l:null),class:e.normalizeClass(e.unref(ve)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o.class))},null,2)),[[e.vModelText,e.unref(a)]])}}),Y2=e.defineComponent({__name:"Pagination",props:{page:{},defaultPage:{},itemsPerPage:{},total:{},siblingCount:{},disabled:{type:Boolean},showEdges:{type:Boolean},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},emits:["update:page"],setup(t,{emit:n}){const o=t,r=n,a=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationRoot),e.mergeProps({"data-slot":"pagination"},e.unref(s),{class:o.class}),{default:e.withCtx(c=>[e.renderSlot(i.$slots,"default",e.normalizeProps(e.guardReactiveProps(c)))]),_:3},16,["class"]))}}),J2=e.defineComponent({__name:"PaginationContent",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationList),e.mergeProps({"data-slot":"pagination-content"},e.unref(o),{class:e.unref(ve)("flex flex-row items-center gap-1",n.class)}),{default:e.withCtx(s=>[e.renderSlot(r.$slots,"default",e.normalizeProps(e.guardReactiveProps(s)))]),_:3},16,["class"]))}}),Q2=e.defineComponent({__name:"PaginationEllipsis",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationEllipsis),e.mergeProps({"data-slot":"pagination-ellipsis"},e.unref(o),{class:e.unref(ve)("flex size-9 items-center justify-center",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default",{},()=>[e.createVNode(e.unref(le.MoreHorizontal),{class:"size-4"}),a[0]||(a[0]=e.createElementVNode("span",{class:"sr-only"},"More pages",-1))])]),_:3},16,["class"]))}}),Z2=e.defineComponent({__name:"PaginationFirst",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationFirst),e.mergeProps({"data-slot":"pagination-first",class:e.unref(ve)(e.unref(ro)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"First",-1))])]),_:3},16,["class"]))}}),e_=e.defineComponent({__name:"PaginationItem",props:{value:{},asChild:{type:Boolean},as:{},size:{default:"icon"},class:{type:[Boolean,null,String,Object,Array]},isActive:{type:Boolean}},setup(t){const n=t,o=st.reactiveOmit(n,"class","size","isActive");return(r,a)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationListItem),e.mergeProps({"data-slot":"pagination-item"},e.unref(o),{class:e.unref(ve)(e.unref(ro)({variant:"ghost",size:t.size}),t.isActive?"bg-[#0056a1] dark:bg-[#003d75] text-white hover:bg-[#0056a1]/90 dark:hover:bg-[#003d75]/90 hover:text-white":"",n.class)}),{default:e.withCtx(()=>[e.renderSlot(r.$slots,"default")]),_:3},16,["class"]))}}),t_=e.defineComponent({__name:"PaginationLast",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationLast),e.mergeProps({"data-slot":"pagination-last",class:e.unref(ve)(e.unref(ro)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Last",-1)),e.createVNode(e.unref(le.ChevronRightIcon))])]),_:3},16,["class"]))}}),n_=e.defineComponent({__name:"PaginationNext",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationNext),e.mergeProps({"data-slot":"pagination-next",class:e.unref(ve)(e.unref(ro)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Next",-1)),e.createVNode(e.unref(le.ChevronRightIcon))])]),_:3},16,["class"]))}}),o_=e.defineComponent({__name:"PaginationPrevious",props:{asChild:{type:Boolean},as:{},size:{default:"default"},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class","size"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.PaginationPrev),e.mergeProps({"data-slot":"pagination-previous",class:e.unref(ve)(e.unref(ro)({variant:"ghost",size:t.size}),"gap-1 px-2.5 sm:pr-2.5",n.class)},e.unref(r)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronLeftIcon)),s[0]||(s[0]=e.createElementVNode("span",{class:"hidden sm:block"},"Previous",-1))])]),_:3},16,["class"]))}}),r_=e.defineComponent({__name:"Select",props:{open:{type:Boolean},defaultOpen:{type:Boolean},defaultValue:{},modelValue:{},by:{type:[String,Function]},dir:{},multiple:{type:Boolean},autocomplete:{},disabled:{type:Boolean},name:{},required:{type:Boolean}},emits:["update:modelValue","update:open"],setup(t,{emit:n}){const o=t,r=n,a=Be.useForwardPropsEmits(o,r);return(s,i)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectRoot),e.normalizeProps(e.guardReactiveProps(e.unref(a))),{default:e.withCtx(()=>[e.renderSlot(s.$slots,"default")]),_:3},16))}}),a_=e.defineComponent({inheritAttrs:!1,__name:"SelectContent",props:{forceMount:{type:Boolean},position:{default:"popper"},bodyLock:{type:Boolean},side:{},sideOffset:{},sideFlip:{type:Boolean},align:{},alignOffset:{},alignFlip:{type:Boolean},avoidCollisions:{type:Boolean},collisionBoundary:{},collisionPadding:{},arrowPadding:{},hideShiftedArrow:{type:Boolean},sticky:{},hideWhenDetached:{type:Boolean},positionStrategy:{},updatePositionStrategy:{},disableUpdateOnLayoutShift:{type:Boolean},prioritizePosition:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},disableOutsidePointerEvents:{type:Boolean},class:{type:[Boolean,null,String,Object,Array]}},emits:["closeAutoFocus","escapeKeyDown","pointerDownOutside"],setup(t,{emit:n}){const o=t,r=n,a=st.reactiveOmit(o,"class"),s=Be.useForwardPropsEmits(a,r);return(i,l)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectPortal),null,{default:e.withCtx(()=>[e.createVNode(e.unref(Be.SelectContent),e.mergeProps({...e.unref(s),...i.$attrs},{class:e.unref(ve)("relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t.position==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",o.class)}),{default:e.withCtx(()=>[e.createVNode(e.unref(c_)),e.createVNode(e.unref(Be.SelectViewport),{class:e.normalizeClass(e.unref(ve)("p-1",t.position==="popper"&&"h-[--reka-select-trigger-height] w-full min-w-[--reka-select-trigger-width]"))},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3},8,["class"]),e.createVNode(e.unref(l_))]),_:3},16,["class"])]),_:3}))}}),s_={class:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center"},i_=e.defineComponent({__name:"SelectItem",props:{value:{},disabled:{type:Boolean},textValue:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectItem),e.mergeProps(e.unref(r),{class:e.unref(ve)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",n.class)}),{default:e.withCtx(()=>[e.createElementVNode("span",s_,[e.createVNode(e.unref(Be.SelectItemIndicator),null,{default:e.withCtx(()=>[e.createVNode(e.unref(le.Check),{class:"h-4 w-4"})]),_:1})]),e.createVNode(e.unref(Be.SelectItemText),null,{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3})]),_:3},16,["class"]))}}),l_=e.defineComponent({__name:"SelectScrollDownButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectScrollDownButton),e.mergeProps(e.unref(r),{class:e.unref(ve)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronDown))])]),_:3},16,["class"]))}}),c_=e.defineComponent({__name:"SelectScrollUpButton",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectScrollUpButton),e.mergeProps(e.unref(r),{class:e.unref(ve)("flex cursor-default items-center justify-center py-1",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createVNode(e.unref(le.ChevronUp))])]),_:3},16,["class"]))}}),d_=e.defineComponent({__name:"SelectTrigger",props:{disabled:{type:Boolean},reference:{},asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(t){const n=t,o=st.reactiveOmit(n,"class"),r=Be.useForwardProps(o);return(a,s)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectTrigger),e.mergeProps(e.unref(r),{class:e.unref(ve)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:truncate text-start",n.class)}),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default"),e.createVNode(e.unref(Be.SelectIcon),{"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronDown),{class:"w-4 h-4 opacity-50 shrink-0"})]),_:1})]),_:3},16,["class"]))}}),u_=e.defineComponent({__name:"SelectValue",props:{placeholder:{},asChild:{type:Boolean},as:{}},setup(t){const n=t;return(o,r)=>(e.openBlock(),e.createBlock(e.unref(Be.SelectValue),e.normalizeProps(e.guardReactiveProps(n)),{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},16))}}),or={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},xo={LIGHT:"light",DARK:"dark",COLORED:"colored",AUTO:"auto"},Et={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},f_={BOUNCE:"bounce",SLIDE:"slide",FLIP:"flip",ZOOM:"zoom",NONE:"none"},m_={dangerouslyHTMLString:!1,multiple:!0,position:or.TOP_RIGHT,autoClose:5e3,transition:"bounce",hideProgressBar:!1,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,className:"",bodyClassName:"",style:{},progressClassName:"",progressStyle:{},role:"alert",theme:"light"},h_={rtl:!1,newestOnTop:!1,toastClassName:""},tu={...m_,...h_};Et.DEFAULT;var $e=(t=>(t[t.COLLAPSE_DURATION=300]="COLLAPSE_DURATION",t[t.DEBOUNCE_DURATION=50]="DEBOUNCE_DURATION",t.CSS_NAMESPACE="Toastify",t))($e||{}),ti=(t=>(t.ENTRANCE_ANIMATION_END="d",t))(ti||{});const p_={enter:"Toastify--animate Toastify__bounce-enter",exit:"Toastify--animate Toastify__bounce-exit",appendPosition:!0},g_={enter:"Toastify--animate Toastify__slide-enter",exit:"Toastify--animate Toastify__slide-exit",appendPosition:!0},b_={enter:"Toastify--animate Toastify__zoom-enter",exit:"Toastify--animate Toastify__zoom-exit"},y_={enter:"Toastify--animate Toastify__flip-enter",exit:"Toastify--animate Toastify__flip-exit"},nu="Toastify--animate Toastify__none-enter";function ou(t,n=!1){var o;let r=p_;if(!t||typeof t=="string")switch(t){case"flip":r=y_;break;case"zoom":r=b_;break;case"slide":r=g_;break}else r=t;if(n)r.enter=nu;else if(r.enter===nu){const a=(o=r.exit.split("__")[1])==null?void 0:o.split("-")[0];r.enter=`Toastify--animate Toastify__${a}-enter`}return r}function x_(t){return t.containerId||String(t.position)}const da="will-unmount";function k_(t=or.TOP_RIGHT){return!!document.querySelector(`.${$e.CSS_NAMESPACE}__toast-container--${t}`)}function w_(t=or.TOP_RIGHT){return`${$e.CSS_NAMESPACE}__toast-container--${t}`}function C_(t,n,o=!1){const r=[`${$e.CSS_NAMESPACE}__toast-container`,`${$e.CSS_NAMESPACE}__toast-container--${t}`,o?`${$e.CSS_NAMESPACE}__toast-container--rtl`:null].filter(Boolean).join(" ");return wo(n)?n({position:t,rtl:o,defaultClassName:r}):`${r} ${n||""}`}function E_(t){var n;const{position:o,containerClassName:r,rtl:a=!1,style:s={}}=t,i=$e.CSS_NAMESPACE,l=w_(o),c=document.querySelector(`.${i}`),d=document.querySelector(`.${l}`),u=!!d&&!((n=d.className)!=null&&n.includes(da)),f=c||document.createElement("div"),m=document.createElement("div");m.className=C_(o,r,a),m.dataset.testid=`${$e.CSS_NAMESPACE}__toast-container--${o}`,m.id=x_(t);for(const h in s)if(Object.prototype.hasOwnProperty.call(s,h)){const p=s[h];m.style[h]=p}return c||(f.className=$e.CSS_NAMESPACE,document.body.appendChild(f)),u||f.appendChild(m),m}function ni(t){var n,o,r;const a=typeof t=="string"?t:((n=t.currentTarget)==null?void 0:n.id)||((o=t.target)==null?void 0:o.id),s=document.getElementById(a);s&&s.removeEventListener("animationend",ni,!1);try{rr[a].unmount(),(r=document.getElementById(a))==null||r.remove(),delete rr[a],delete ht[a]}catch{}}const rr=e.reactive({});function B_(t,n){const o=document.getElementById(String(n));o&&(rr[o.id]=t)}function oi(t,n=!0){const o=String(t);if(!rr[o])return;const r=document.getElementById(o);r&&r.classList.add(da),n?(S_(t),r&&r.addEventListener("animationend",ni,!1)):ni(o),It.items=It.items.filter(a=>a.containerId!==t)}function __(t){for(const n in rr)oi(n,t);It.items=[]}function ru(t,n){const o=document.getElementById(t.toastId);if(o){let r=t;r={...r,...ou(r.transition)};const a=r.appendPosition?`${r.exit}--${r.position}`:r.exit;o.className+=` ${a}`,n&&n(o)}}function S_(t){for(const n in ht)if(n===t)for(const o of ht[n]||[])ru(o)}function V_(t){const n=ko().find(o=>o.toastId===t);return n==null?void 0:n.containerId}function ri(t){return document.getElementById(t)}function A_(t){const n=ri(t.containerId);return n&&n.classList.contains(da)}function au(t){var n;const o=e.isVNode(t.content)?e.toRaw(t.content.props):null;return o??e.toRaw((n=t.data)!=null?n:{})}function D_(t){return t?It.items.filter(n=>n.containerId===t).length>0:It.items.length>0}function N_(){if(It.items.length>0){const t=It.items.shift();ua(t==null?void 0:t.toastContent,t==null?void 0:t.toastProps)}}const ht=e.reactive({}),It=e.reactive({items:[]});function ko(){const t=e.toRaw(ht);return Object.values(t).reduce((n,o)=>[...n,...o],[])}function M_(t){return ko().find(n=>n.toastId===t)}function ua(t,n={}){if(A_(n)){const o=ri(n.containerId);o&&o.addEventListener("animationend",ai.bind(null,t,n),!1)}else ai(t,n)}function ai(t,n={}){const o=ri(n.containerId);o&&o.removeEventListener("animationend",ai.bind(null,t,n),!1);const r=ht[n.containerId]||[],a=r.length>0;if(!a&&!k_(n.position)){const s=E_(n),i=e.createApp(tS,n);n.useHandler&&n.useHandler(i),i.mount(s),B_(i,s.id)}a&&!n.updateId&&(n.position=r[0].position),e.nextTick(()=>{n.updateId?Mt.update(n):Mt.add(t,n)})}const Mt={add(t,n){const{containerId:o=""}=n;o&&(ht[o]=ht[o]||[],ht[o].find(r=>r.toastId===n.toastId)||setTimeout(()=>{var r,a;n.newestOnTop?(r=ht[o])==null||r.unshift(n):(a=ht[o])==null||a.push(n),n.onOpen&&n.onOpen(au(n))},n.delay||0))},remove(t){if(t){const n=V_(t);if(n){const o=ht[n];let r=o.find(a=>a.toastId===t);ht[n]=o.filter(a=>a.toastId!==t),!ht[n].length&&!D_(n)&&oi(n,!1),N_(),e.nextTick(()=>{r!=null&&r.onClose&&(r.onClose(au(r)),r=void 0)})}}},update(t={}){const{containerId:n=""}=t;if(n&&t.updateId){ht[n]=ht[n]||[];const o=ht[n].find(s=>s.toastId===t.toastId),r=(o==null?void 0:o.position)!==t.position||(o==null?void 0:o.transition)!==t.transition,a={...t,disabledEnterTransition:!r,updateId:void 0};Mt.dismissForce(t==null?void 0:t.toastId),setTimeout(()=>{We(a.content,a)},t.delay||0)}},clear(t,n=!0){t?oi(t,n):__(n)},dismissCallback(t){var n;const o=(n=t.currentTarget)==null?void 0:n.id,r=document.getElementById(o);r&&(r.removeEventListener("animationend",Mt.dismissCallback,!1),setTimeout(()=>{Mt.remove(o)}))},dismiss(t){if(t){const n=ko();for(const o of n)if(o.toastId===t){ru(o,r=>{r.addEventListener("animationend",Mt.dismissCallback,!1)});break}}},dismissForce(t){if(t){const n=ko();for(const o of n)if(o.toastId===t){const r=document.getElementById(t);r&&(r.remove(),r.removeEventListener("animationend",Mt.dismissCallback,!1),Mt.remove(t));break}}}},T_=e.reactive({useHandler:void 0}),su=e.reactive({}),fa=e.reactive({});function iu(){return Math.random().toString(36).substring(2,9)}function P_(t){return typeof t=="number"&&!isNaN(t)}function si(t){return typeof t=="string"}function wo(t){return typeof t=="function"}function ma(...t){return e.mergeProps(...t)}function ha(t){return typeof t=="object"&&(!!(t!=null&&t.render)||!!(t!=null&&t.setup)||typeof(t==null?void 0:t.type)=="object")}function O_(t={}){su[`${$e.CSS_NAMESPACE}-default-options`]=t}function lu(){return su[`${$e.CSS_NAMESPACE}-default-options`]||tu}function v_(){const t=window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;return document.documentElement.classList.contains("dark")||t?"dark":"light"}var pa=(t=>(t[t.Enter=0]="Enter",t[t.Exit=1]="Exit",t))(pa||{});const cu={containerId:{type:[String,Number],required:!1,default:""},clearOnUrlChange:{type:Boolean,required:!1,default:!0},disabledEnterTransition:{type:Boolean,required:!1,default:!1},dangerouslyHTMLString:{type:Boolean,required:!1,default:!1},multiple:{type:Boolean,required:!1,default:!0},limit:{type:Number,required:!1,default:void 0},position:{type:String,required:!1,default:or.TOP_LEFT},bodyClassName:{type:String,required:!1,default:""},autoClose:{type:[Number,Boolean],required:!1,default:!1},closeButton:{type:[Boolean,Function,Object],required:!1,default:void 0},transition:{type:[String,Object],required:!1,default:"bounce"},hideProgressBar:{type:Boolean,required:!1,default:!1},pauseOnHover:{type:Boolean,required:!1,default:!0},pauseOnFocusLoss:{type:Boolean,required:!1,default:!0},closeOnClick:{type:Boolean,required:!1,default:!0},progress:{type:Number,required:!1,default:void 0},progressClassName:{type:String,required:!1,default:""},toastStyle:{type:Object,required:!1,default(){return{}}},progressStyle:{type:Object,required:!1,default(){return{}}},role:{type:String,required:!1,default:"alert"},theme:{type:String,required:!1,default:xo.AUTO},content:{type:[String,Object,Function],required:!1,default:""},toastId:{type:[String,Number],required:!1,default:""},data:{type:[Object,String],required:!1,default(){return{}}},type:{type:String,required:!1,default:Et.DEFAULT},icon:{type:[Boolean,String,Number,Object,Function],required:!1,default:void 0},delay:{type:Number,required:!1,default:void 0},onOpen:{type:Function,required:!1,default:void 0},onClose:{type:Function,required:!1,default:void 0},onClick:{type:Function,required:!1,default:void 0},isLoading:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:!1},toastClassName:{type:String,required:!1,default:""},updateId:{type:[String,Number],required:!1,default:""},contentProps:{type:Object,required:!1,default:null},expandCustomProps:{type:Boolean,required:!1,default:!1}},F_={autoClose:{type:[Number,Boolean],required:!0},isRunning:{type:Boolean,required:!1,default:void 0},type:{type:String,required:!1,default:Et.DEFAULT},theme:{type:String,required:!1,default:xo.AUTO},hide:{type:Boolean,required:!1,default:void 0},className:{type:[String,Function],required:!1,default:""},controlledProgress:{type:Boolean,required:!1,default:void 0},rtl:{type:Boolean,required:!1,default:void 0},isIn:{type:Boolean,required:!1,default:void 0},progress:{type:Number,required:!1,default:void 0},closeToast:{type:Function,required:!1,default:void 0}},z_=e.defineComponent({name:"ProgressBar",props:F_,setup(t,{attrs:n}){const o=e.ref(),r=e.computed(()=>t.hide?"true":"false"),a=e.computed(()=>({...n.style||{},animationDuration:`${t.autoClose===!0?5e3:t.autoClose}ms`,animationPlayState:t.isRunning?"running":"paused",opacity:t.hide||t.autoClose===!1?0:1,transform:t.controlledProgress?`scaleX(${t.progress})`:"none"})),s=e.computed(()=>[`${$e.CSS_NAMESPACE}__progress-bar`,t.controlledProgress?`${$e.CSS_NAMESPACE}__progress-bar--controlled`:`${$e.CSS_NAMESPACE}__progress-bar--animated`,`${$e.CSS_NAMESPACE}__progress-bar-theme--${t.theme}`,`${$e.CSS_NAMESPACE}__progress-bar--${t.type}`,t.rtl?`${$e.CSS_NAMESPACE}__progress-bar--rtl`:null].filter(Boolean).join(" ")),i=e.computed(()=>`${s.value} ${(n==null?void 0:n.class)||""}`),l=()=>{o.value&&(o.value.onanimationend=null,o.value.ontransitionend=null)},c=()=>{t.isIn&&t.closeToast&&t.autoClose!==!1&&(t.closeToast(),l())},d=e.computed(()=>t.controlledProgress?null:c),u=e.computed(()=>t.controlledProgress?c:null);return e.watchEffect(()=>{o.value&&(l(),o.value.onanimationend=d.value,o.value.ontransitionend=u.value)}),()=>e.createVNode("div",{ref:o,role:"progressbar","aria-hidden":r.value,"aria-label":"notification timer",class:i.value,style:a.value},null)}}),R_=e.defineComponent({name:"CloseButton",inheritAttrs:!1,props:{theme:{type:String,required:!1,default:xo.AUTO},type:{type:String,required:!1,default:xo.LIGHT},ariaLabel:{type:String,required:!1,default:"close"},closeToast:{type:Function,required:!1,default:void 0}},setup(t){return()=>e.createVNode("button",{class:`${$e.CSS_NAMESPACE}__close-button ${$e.CSS_NAMESPACE}__close-button--${t.theme}`,type:"button",onClick:n=>{n.stopPropagation(),t.closeToast&&t.closeToast(n)},"aria-label":t.ariaLabel},[e.createVNode("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},[e.createVNode("path",{"fill-rule":"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"},null)])])}}),ga=({theme:t,type:n,path:o,...r})=>e.createVNode("svg",e.mergeProps({viewBox:"0 0 24 24",width:"100%",height:"100%",style:{fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`}},r),[e.createVNode("path",{d:o},null)]);function I_(t){return e.createVNode(ga,e.mergeProps(t,{path:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}),null)}function L_(t){return e.createVNode(ga,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}),null)}function $_(t){return e.createVNode(ga,e.mergeProps(t,{path:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}),null)}function j_(t){return e.createVNode(ga,e.mergeProps(t,{path:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}),null)}function U_(){return e.createVNode("div",{class:`${$e.CSS_NAMESPACE}__spinner`},null)}const ba={info:L_,warning:I_,success:$_,error:j_,spinner:U_},W_=t=>t in ba;function H_({theme:t,type:n,isLoading:o,icon:r}){let a;const s=!!o||n==="loading",i={theme:t,type:n};if(s&&(r===void 0||typeof r=="boolean"))return ba.spinner();if(r!==!1){if(ha(r))a=e.toRaw(r);else if(wo(r)){const l=r;i.type=s?"loading":n,a=l(i),a=!a&&s?ba.spinner():a}else e.isVNode(r)?a=e.cloneVNode(r,i):si(r)||P_(r)?a=r:W_(n)&&(a=ba[n](i));return a}}const q_=()=>{};function G_(t,n,o=$e.COLLAPSE_DURATION){const{scrollHeight:r,style:a}=t,s=o;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${s}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(n,s)})})}function X_(t){const n=e.ref(!1),o=e.ref(!1),r=e.ref(!1),a=e.ref(pa.Enter),s=e.reactive({...t,appendPosition:t.appendPosition||!1,collapse:typeof t.collapse>"u"?!0:t.collapse,collapseDuration:t.collapseDuration||$e.COLLAPSE_DURATION}),i=s.done||q_,l=e.computed(()=>s.appendPosition?`${s.enter}--${s.position}`:s.enter),c=e.computed(()=>s.appendPosition?`${s.exit}--${s.position}`:s.exit),d=e.computed(()=>t.pauseOnHover?{onMouseenter:x,onMouseleave:k}:{});function u(){const S=l.value.split(" ");m().addEventListener(ti.ENTRANCE_ANIMATION_END,k,{once:!0});const B=_=>{const w=m();_.target===w&&(w.dispatchEvent(new Event(ti.ENTRANCE_ANIMATION_END)),w.removeEventListener("animationend",B),w.removeEventListener("animationcancel",B),a.value===pa.Enter&&_.type!=="animationcancel"&&w.classList.remove(...S))},E=()=>{const _=m();_.classList.add(...S),_.addEventListener("animationend",B),_.addEventListener("animationcancel",B)};t.pauseOnFocusLoss&&h(),E()}function f(){if(!m())return;const S=()=>{const E=m();E.removeEventListener("animationend",S),s.collapse?G_(E,i,s.collapseDuration):i()},B=()=>{const E=m();a.value=pa.Exit,E&&(E.className+=` ${c.value}`,E.addEventListener("animationend",S))};o.value||(r.value?S():setTimeout(B))}function m(){return t.toastRef.value}function h(){document.hasFocus()||x(),window.addEventListener("focus",k),window.addEventListener("blur",x)}function p(){window.removeEventListener("focus",k),window.removeEventListener("blur",x)}function k(){(!t.loading.value||t.isLoading===void 0)&&(n.value=!0)}function x(){n.value=!1}function g(S){S&&(S.stopPropagation(),S.preventDefault()),o.value=!1}return e.watchEffect(f),e.watchEffect(()=>{const S=ko();o.value=S.findIndex(B=>B.toastId===s.toastId)>-1}),e.watchEffect(()=>{t.isLoading!==void 0&&(t.loading.value?x():k())}),e.onMounted(u),e.onUnmounted(()=>{t.pauseOnFocusLoss&&p()}),{isIn:o,isRunning:n,hideToast:g,eventHandlers:d}}function K_(t){if(!t||typeof t!="object"||Array.isArray(t)||t.__v_isVNode)return!1;const n=t;return["title","content"].some(o=>o in n)}const Y_=e.defineComponent({name:"ToastItem",inheritAttrs:!1,props:cu,setup(t){const n=e.ref(),o=e.computed(()=>!!t.isLoading),r=e.computed(()=>t.progress!==void 0&&t.progress!==null),a=e.computed(()=>H_(t)),s=e.computed(()=>[`${$e.CSS_NAMESPACE}__toast`,`${$e.CSS_NAMESPACE}__toast-theme--${t.theme}`,`${$e.CSS_NAMESPACE}__toast--${t.type}`,t.rtl?`${$e.CSS_NAMESPACE}__toast--rtl`:void 0,t.toastClassName||""].filter(Boolean).join(" ")),{isRunning:i,isIn:l,hideToast:c,eventHandlers:d}=X_({toastRef:n,loading:o,done:()=>{Mt.remove(t.toastId)},...ou(t.transition,t.disabledEnterTransition),...t});function u(){const f=t.content;if(K_(f)){const m=[];return f.title!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-title",class:`${$e.CSS_NAMESPACE}__toast-text-title`},[f.title])),f.content!==void 0&&m.push(e.createVNode("div",{"data-testid":"toast-text-content",class:`${$e.CSS_NAMESPACE}__toast-text-content`},[f.content])),e.createVNode("div",{"data-testid":"toast-text-content-wrapper",class:`${$e.CSS_NAMESPACE}__toast-text`},[m])}return ha(f)?e.h(e.toRaw(f),{toastProps:e.toRaw(t),closeToast:c,data:t.data,...t.expandCustomProps?t.contentProps:{contentProps:t.contentProps||{}}}):wo(f)?f({toastProps:e.toRaw(t),closeToast:c,data:t.data}):t.dangerouslyHTMLString?e.h("div",{innerHTML:f}):f}return()=>e.createVNode("div",e.mergeProps({id:t.toastId,class:s.value,style:t.toastStyle||{},ref:n,"data-testid":`toast-item-${t.toastId}`,onClick:f=>{t.closeOnClick&&c(),t.onClick&&t.onClick(f)}},d.value),[e.createVNode("div",{role:t.role,"data-testid":"toast-body",class:`${$e.CSS_NAMESPACE}__toast-body ${t.bodyClassName||""}`},[a.value!=null&&e.createVNode("div",{"data-testid":`toast-icon-${t.type}`,class:[`${$e.CSS_NAMESPACE}__toast-icon`,t.isLoading?"":`${$e.CSS_NAMESPACE}--animate-icon ${$e.CSS_NAMESPACE}__zoom-enter`].join(" ")},[ha(a.value)?e.h(e.toRaw(a.value),{theme:t.theme,type:t.type}):wo(a.value)?a.value({theme:t.theme,type:t.type}):a.value]),e.createVNode("div",{"data-testid":"toast-content"},[u()])]),(t.closeButton===void 0||t.closeButton===!0)&&e.createVNode(R_,{theme:t.theme,closeToast:f=>{f.stopPropagation(),f.preventDefault(),c()}},null),ha(t.closeButton)?e.h(e.toRaw(t.closeButton),{closeToast:c,type:t.type,theme:t.theme}):wo(t.closeButton)?t.closeButton({closeToast:c,type:t.type,theme:t.theme}):null,e.createVNode(z_,{className:t.progressClassName,style:t.progressStyle,rtl:t.rtl,theme:t.theme,isIn:l.value,type:t.type,hide:t.hideProgressBar,isRunning:i.value,autoClose:t.autoClose,controlledProgress:r.value,progress:t.progress,closeToast:t.isLoading?void 0:c},null)])}}),ya="vue3-toastify:url-change";let xa=0,ar;function J_(){if(!(typeof window>"u")&&fa.lastUrl!==window.location.href){fa.lastUrl=window.location.href;const t=o=>typeof o.clearOnUrlChange=="boolean"?o.clearOnUrlChange:lu().clearOnUrlChange!==!1,n=Object.values(ht).reduce((o,r)=>(Array.isArray(r)&&o.push(...r),o),[]);for(const o of n)o.toastId&&t(o)&&Mt.dismiss(o.toastId);It.items=It.items.filter(o=>!t(o.toastProps))}}function Q_(){const{history:t}=window,n=t.pushState,o=t.replaceState;return t.pushState=function(...r){const a=n.apply(this,r);return window.dispatchEvent(new Event(ya)),a},t.replaceState=function(...r){const a=o.apply(this,r);return window.dispatchEvent(new Event(ya)),a},()=>{t.pushState=n,t.replaceState=o}}function Z_(){if(typeof window>"u"||ar)return;const t=Q_(),n=()=>J_();window.addEventListener(ya,n),window.addEventListener("popstate",n),window.addEventListener("hashchange",n),ar=()=>{t(),window.removeEventListener(ya,n),window.removeEventListener("popstate",n),window.removeEventListener("hashchange",n),ar=void 0}}function eS(){ar&&(ar(),fa.lastUrl="")}const tS=e.defineComponent({name:"ToastifyContainer",inheritAttrs:!1,props:cu,setup(t){const n=e.computed(()=>t.containerId),o=e.computed(()=>ht[n.value]||[]),r=e.computed(()=>o.value.filter(a=>a.position===t.position));return e.onMounted(()=>{typeof window<"u"&&(xa+=1,Z_())}),e.onUnmounted(()=>{typeof window<"u"&&xa>0&&(xa-=1,xa===0&&eS())}),()=>e.createVNode(e.Fragment,null,[r.value.map(a=>{const{toastId:s=""}=a;return e.createVNode(Y_,e.mergeProps({key:s},a),null)})])}});let ii=!1;const du={isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1};function uu(){const t=[];return ko().forEach(n=>{const o=document.getElementById(n.containerId);o&&!o.classList.contains(da)&&t.push(n)}),t}function nS(t){const n=uu().length,o=t??0;return o>0&&n+It.items.length>=o}function oS(t){nS(t.limit)&&!t.updateId&&It.items.push({toastId:t.toastId,containerId:t.containerId,toastContent:t.content,toastProps:t})}function On(t,n,o={}){if(ii)return;o=ma(lu(),{type:n},e.toRaw(o)),(!o.toastId||typeof o.toastId!="string"&&typeof o.toastId!="number")&&(o.toastId=iu()),o={...o,...o.type==="loading"?du:{},content:t,containerId:o.containerId||String(o.position)};const r=Number(o==null?void 0:o.progress);return!isNaN(r)&&r<0&&(o.progress=0),r>1&&(o.progress=1),o.theme==="auto"&&(o.theme=v_()),oS(o),fa.lastUrl=window.location.href,o.multiple?It.items.length?o.updateId&&ua(t,o):ua(t,o):(ii=!0,We.clearAll(void 0,!1),setTimeout(()=>{ua(t,o)},0),setTimeout(()=>{ii=!1},390)),o.toastId}const We=(t,n)=>On(t,Et.DEFAULT,n);We.info=(t,n)=>On(t,Et.DEFAULT,{...n,type:Et.INFO}),We.error=(t,n)=>On(t,Et.DEFAULT,{...n,type:Et.ERROR}),We.warning=(t,n)=>On(t,Et.DEFAULT,{...n,type:Et.WARNING}),We.warn=We.warning,We.success=(t,n)=>On(t,Et.DEFAULT,{...n,type:Et.SUCCESS}),We.loading=(t,n)=>On(t,Et.DEFAULT,ma(n,du)),We.dark=(t,n)=>On(t,Et.DEFAULT,ma(n,{theme:xo.DARK})),We.remove=t=>{t?Mt.dismiss(t):Mt.clear()},We.clearAll=(t,n)=>{e.nextTick(()=>{Mt.clear(t,n)})},We.isActive=t=>{let n=!1;return n=uu().findIndex(o=>o.toastId===t)>-1,n},We.update=(t,n={})=>{setTimeout(()=>{const o=M_(t);if(o){const r=e.toRaw(o),{content:a}=r,s={...r,...n,toastId:n.toastId||t,updateId:iu()},i=s.render||a;delete s.render,On(i,s.type,s)}},0)},We.done=t=>{We.update(t,{isLoading:!1,progress:1})},We.promise=rS;function rS(t,{pending:n,error:o,success:r},a){var s,i,l;let c;const d={...a||{},autoClose:!1};n&&(c=si(n)?We.loading(n,d):We.loading(n.render,{...d,...n}));const u={autoClose:(s=a==null?void 0:a.autoClose)!=null?s:!0,closeOnClick:(i=a==null?void 0:a.closeOnClick)!=null?i:!0,closeButton:(l=a==null?void 0:a.autoClose)!=null?l:null,isLoading:void 0,draggable:null,delay:100},f=(h,p,k)=>{if(p==null){We.remove(c);return}const x={type:h,...u,...a,data:k},g=si(p)?{render:p}:p;return c?We.update(c,{...x,...g,isLoading:!1}):We(g.render,{...x,...g,isLoading:!1}),k},m=wo(t)?t():t;return m.then(h=>{f("success",r,h)}).catch(h=>{f("error",o,h)}),m}We.POSITION=or,We.THEME=xo,We.TYPE=Et,We.TRANSITIONS=f_;const aS={install(t,n={}){T_.useHandler=n.useHandler||(()=>{}),sS(n)}};typeof window<"u"&&(window.Vue3Toastify=aS);function sS(t={}){const n=ma(tu,t);O_(n)}const iS={v:"4.8.0",meta:{g:"LottieFiles AE ",a:"",k:"",d:"",tc:""},fr:25,ip:0,op:273,w:500,h:500,nm:"not_found",ddd:0,assets:JSON.parse('[{"id":"image_0","w":175,"h":173,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK8AAACtCAYAAADGWi9+AAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAYj0lEQVR4nO2dXVMb2ZnH/+cg1BIIkABjPF7bxFvZnamaqYHUrh1XqjbMxc7YV4Mucj3kEwzfIOwnCLnei+BP0PgmME5twWQry8DWFrh2qpKt3aRgXB4DtngRWKIlcc5eSGLUp7ul7qPWS7fO78rdWK1G+vP0c57zvAAKhUKhUCgUCoVCoVAoFAqFQqEIMqTTN9Au9Ofb0+B8CgzTICRJCZ8GAHAkOfBxnZeeEYJdAGAMewD2ALIHXO0hFttNfzJz2up7V9gTSvHqq5tTQN8sCKYp4dOc4+ctfLt9DuwCfAOUbqQ/fbDbwvdS1BAa8epfbc2Bk1kCPgfgXgdv5YwDG+BkBbH+FWWZW0egxauvbs4CdJ4QzAEY6fT92MGBZ0rIrSFw4tXXd5IwjHkCsgCPFjYej6E/EkF/fx80LQpKKQBgIB5zfI1hFHDFGAAgn78EAOTyBkrFEoqlkpe3P+McK+gjS8q18IfAiLfsx9JFt1ZW06IYiGvQotGyaPsjvt8TYwyXRgH5/CVyeeNa3I0gBF8zxhbTTx5t+H5TPUTXi7dGtF80+r+JwQEkBuMtE6sbLt7lcHGRRz5/6cYy73OChfRnD1facW9ho2vFq6/vJHFZWGok2ng8hpGhQSQSA9duQLdQFfLFuxxYxfWwQ1liObpSvPraNwsEZBEO7gGlFInBAYyNjnTMwnqBMYaLixwyx2d1rXF5cccW0k8e7bXv7oJLV4lXf749TRlfdto0oJQilRxCKjncdVbWLRfvcjg5Pa/nH59x8MX0458utfO+gkjXiFdf3VokBL+y+1kYRCuSy1/izdsTGEbB9ucVV2JeWWFnOi5efXVzihK64mRtU8khjI0mQyNakWz2op47ccY5WUg/ebDc5tsKBB0Vr766PU8IX4KNbxuPxzAxnoKmRTtwZ+2FMYbM8SlOTs9tf845niIWXVCbHGY6Jl59bXuJgH8pnqeUYmx0BKnkcCduq6MYRgEHRxlbV4IALxhnc8qN+IG2i7e8Q1ZYJsDn4s80LYr3Jm8EIoLQSt68PXaywmecklm1Q1emreLV13eS1Chs2Pm3qeQQboyPtvN2upqLdzkcHGbs4sPKD67QNvE6LcwopZgYT2F4ONGuW3Gkut1bzn/ovPUvFkv4/uCNrRvBOfllrwu4LeLVn29PE8Y3ICzMKKW4c/tm2xZlhlGAYRRQLJWQyxtgjDmGqmrpj0QQ6Y9cJ/XE4zHEahJ7WgljDEdvTpA9v7D8rNcF3HLx6qubU4TQXQjC1bQo7ty+2VIBFIslXLzLIZ83cPEu5/v1q8k/g4MDdTPT/ODgMKMELNBS8Tr5uK0UblWw2fN3rqyqX1S3rFPJoZY9SU5Os3jz9sRyvlcF3DLxtlu4ufwlstl3ttbJCwR4wYEpNJHc3h+JYGx0pCV+fDZ7gYOjjOU8p2Sm16IQrRPv2taKGA5rhXBz+Utkjs885tJiw0sRZbliAwDoLAimCTANF4nwrdrWdhBwz4XRWiJeuw0Iv4VrGAUcvT1pKNpycB8rANvwM+XwhyJPPmcXs66lFZbYzgcmwAumRWd7ZSfOd/FWtnx/W3uOUor7U7d9EW6jrdQK+xxkBfxqqR07UuXc4+IcJXyhXhm931vedgLmwLP044dzvrxBl+OreO0iC36Gw3L5SxweZurlxO5zThY7uXjRn29P44ov1EuiHxsdwdho0pf323/52rIw5Rz/kn7ycNGXN+hifBXvs7WtXdHyTE6M+fK4zByfInN85vTjjotWpFH5Ujwew+TEWNObIYwx7H/32vIH3QsLON/Ea5eP68eWL2MMr16/cfJtuz5xW1/dnKWELtm5E5RSvHfrRtMxYsMoYP/la/H0Ptei02H2f30Rb2UHbaf2nKZFce/OraauWy/LKmglM/VKm/x4OtnFgDnIb9KPHyw0deEuxhfxiu4CpRT37txq6pFoGAW8fHVon5jS5dbWiXplTn74wS9fHVqeUGF2H5pe/utr31hW2M0WRtYR7j6nZDaIwgWA9KcPdpkWneUcT8WfZY7PcHBo3XzwwuTEmCWiQxlfbuqiXUxTlldf30kSo7CHmkdhPB7Dnds3pa/pJNywxTArbsSvxfPNrhNs3YeQbh83Z3kvC5YSnonxlPTlnITLOZ5+/vhhqBYf6cc/XeKc/FI8f3J6jmxWfos7lRxGXFgAEsKX9PUdf2JzXYS0eMsxXXMYqJmkFMYYDo6sydec42n6ycN52fvsZtJPHizbCfjgKNNUFtzYqGVNOILLQugWbk1YXrpoOqK0qQXHq9fWpOswC7eKo4AP7aMsbhiIxzA8ZI5eEIKFsFlfKfE6WV3Z7d/M8alllUyAF2EXbhU7ATs9idzSC9ZX0vJara5stW81K0xgn2nRWakLBpSygM1RCMMoIHMs5+b390dCb309i1df30lW2oxeI2t1GWM4tIaHzjglc2FanLkl/eThPCH4uvbcyek5ci7TPUXsrW8xNEk73hVnGPMQEm9krW7m+NS6Jw++GNaguhtYNDoHwPQoOrSvIm6IvfXli83cXzfhWbyVjuTXJAblWosaRsGS1lhO5wvmBoRfpD+ZOeUE87XniqUSTk6zUtdLJYfEU/f059vTcnfXXXhSXaWiwFRBYPNocsWRtRbrDJyFakEhS/qzhysceFZ7LnN8hmLR0xgBAOUcE0v48oqH4nP2aDLpfO2RbAfyXP7SugcPvhiUJJu2UP5DNrkPdVJC65IaMVtfcc0SVDyJV/ylR4YGpd7ULrrQ6+6CSPrJoz3OYfpMsucXUtY3kRgQT43oX20FXsCuxVv5ZU0+gs2H0hBbq8vJoucL9QKx6BJ8sL7VsnwTLPjW173l5WS29lB2oZbNvhNP7YcxacQP0p/MnNpZX5nIQ2IwbjoOg+vgWn2VyZLXiB+GG4rFkrVgUFnd+thY3zOJxB1b1yHgUQdX4i3XY5mjDGLmkhtskk3OlNWtT/qTmVMOslx77rR+5bQtlFLrd3bFA219XVrevtnaI02LSkUZsudml0H8UhQO8CuT61AslaSSdsSnJaWYbeq+Oow78RKYHi8Dcc3zGxWLNh+48KUo7Ek/ebRHgBe152TaWonxXs7x8+burLO4Ei8l3CReLeo9Z1d0GcpZYyqu6xYGczlPLm94voZdlXKQ/V5X4hX/QmX83bzwYZdbMClcw7np8zKMglTUwer3IrzitfvLlPF3rYs1tuH5Ij1M5Sm1X3tOJtsspvULZ/iU9E11mMaWl5t/ORmra7e4UHN2vcM5NmqP3XbGrCUSMRueIC/aGouXmR8r/RHvVlcUr5izqnAL2ag9ujSKnq9gSdLhCGxyemPxEmL65fr7+zy/iZizW+6Pq/BMH0x5zjLhspgYcajT1bLbaSheS6RBojrYujIme54vooCYpM8Y87xoC9MYXM+/iWy5j5mrPc8XUQAohxhrjy8lrK/o+v3Q+T1YuFiwNe8TWR5vsVjPlvk0DUHTtX2RLpgx5wcNxSv6RH6MbOrF4kq/YNws3nZOPOo2wuMA9QocFr+3V2m5eHv5w1W0lpaLV1xQiAsOhUKWlotXXNlWBvQpFE3TevFaV7bSkyUVilrUgi1oCDuevYwb8Zrqp3o5NNMN+LHjGRYaipcQc2jmSqZnVkh2dLoRf3Y8g0lb3Iaw7Oh0A2JhgB9ZfkHd8WwoXsawV3ssk0Nq/YDprOeLKKpV3CaanaAJBHfH043l3Wv2TSxplCS4pScdhVIfMvwsxmff7v8FARfiNacvyhT+WabTQIlXCqEwQKYQ1jIijDRvnDqFC/Ga0xdLEo3exARoAPfsHoGK+oglO5qlHq0xor/LOAmkvwu4EK9Ya1YslaQSoK2POHMjE0V99PWdpLhYk8nwsz452V4Tt9VR3EYbTH6RTAK0pVEJCXarobZTKMzWHtobhMZYG7/w8FpeAOAwx3plIg6DQotNAnwepsk0LUdoSWppWeqCYtH61AxyFbdLy8s3ao9ku7VYAuohmkzTSioTmExz7xIJ71067WbdNXdnncWdeCndqD2UsbyA1VpQEo7ZCC1H+CO3bRbtAtHoMKGUPmi4Em+latWU4yAzG1ecTMOBj4PcK6tdiOOnZIQL2HxnxPxEDRqut4c5zL0WLi7ynt9M06LW3baQTKZpFXYTmGzGUzXEtrdZNLohfWNdgJe2/qZGb7Kugzj6ihB8oWK+zlBqHpUbj8ekogxiS1RC8HVQt4WruBdvrN8k3mKpJOU6DA8nbDKhzF+Qooy+ujkrxnZlrC5gfVIyoetkEHEt3nJ7efNgOxnXAbB+ARXrOyt1sRBDCF2uPe6PRCQXapeWlltiy9Qg4i0lUnAdLt7lpHJDU8lhi+9LCVVd0mvQ175ZgODr3rw5JnUtcQITIfg6DI29vYm37DpcRx0YY7i48O46UEotvi8HPq58YT2Pvro5RWCekhSPx6S2gxljFn+XsXDMAvEk3spcMJP1lR0pOjycsMk2I4sqdAZQSpchFKpOjKekrmUzcPtMXL8EFe+VFH3EMplGZuEG2H4hI5Tx5V7eNtZXtxbFRdrY6Ih0rdqJMPaKgywHPcpQxbN4058+2BWbQ4sfkFs0LWrrPuCy0JP+r766OUsIflV7rvwZyf0tZ7M20zJDNIFJqoaNMbZYe5zPX0rNRwCAsdGk1X0g+KLX/F/9+fY0IdTyOJ+ckFukAVaXjnM8DcNCrYqUeCuZSKY0yTdvT6RvYnJizBL7JSC/1le356UvGiD09Z0kYXwFgp87OTEm7S5kjk+t4THB5Qs60tXDnMBkGQ2jgKzETFygXET43q0blvOE8N+GXcD6+k6SGoUNCGGx4aEEhocTUtdkjFldOYLfiZ3Vg460eNOfPVwRfd/M8Zl0T4CBeMz2ERlmAVeFK/ZAjsdjmJSM6QJlq2v1dfEj6Qt2KU31bRB932KphMyx/EJ2eDhhWcAB4RSw/nx7mhiFXVG4mhbFbZunkFsMo+C0gP5AX9tWbkOV9JNHG+KW8cnpeVMtocZGkxgesj4uywLeWpa+cBehr27OEsY3ILgKmhbFnds3mxp6cnCUcfwZAf8yTHH05jvmcLYAIde33gfohsmbY7YJKITgi2dfbW0EOQ6sr24tEkLXISzO/BBu5vjUYjj6hOtRzkNjfYkfF9HXvlkgIL+uPZdKDuHG+GhT181mL5z+EM44wXz6s4eB2SnSVzenKKXLdpPW4/EYbt+60ZRwDaOA/ZevTedGhgZw/94kdr79q+k85+xHYQiZ+dKrLP34p0t2GxeyO29VhocTeM/+Sx0hHLq+trUShFxgfe2bBULorp1wh4cSTVtcxhi+f/3Gcn7mo/u4e3vcpnKbhKJ20LdGe4yxeYjuw2EGRYkmJbUkBgdw5/ZN23gnAT4nhO7qq1uL3ehK6KubsytrW3uVp5JlJTo5MdZUVKHKwWHGEtP98P27GBkqp0/ev3fT9DMKMt/0m3YBvrgNVfTV7XlC+G9rz/nhywFl65I5Pq23FX3GOZYQiy51eu9eX92cpZRachSqaFq0qQ2IWjLHp5adtPHRIfzsHz+4Ps7lDfz+D+ZC4bnHD3397juB77+Avrq1LJZpDw8lfLEwQDmx+tDG0tRwxkGWwa+W2unX6es7SVwW5yrFkvec/t/Y6Ih0roKI3ZqgP9KHf/75NPoj5uaGv/u3/0KxdHV9zCmZCfqmhf+Nc2PRBWIUpmvjl9V8Uj8EPBCP4d7dWzg5zTqlY44Q8C9B6JfP1rZeMPBlcL7SCiHr6ztJFAqzYJgjRuGLeqYgHo9hYjzlWydzwyjgyGZL/mcPPrAIFwBGhgfw9rjmqXV11XVullda8ujQVzenCKG7EPy8G+MppJLDvr1PsVhC5vjMkmztwD7n2ADIBvqwK2N19NXNKVA6DYZpSmGpL7OjPxLBzZtjvkwOrWIYBbx8dWjZRZv5sLxAs+OP//knk3g5Z58EuVsO0CLxApUdpHIg3pJsIrtn74RHEV9DgBcgOGUcp+JkyfJ/IMnqDAg3Qq0lHo8hlRyS7rHghJNw79+bxEfv33V8nRKvR+wWcEBrBAyUF3Vn2Qucnp7X84lbRrWTTSo51JJBJ07CvfPeOH7y0f26rxV9XgD/NPf44b/7fpNtpOUrTicB+7mIs8MwCsieXyCXN1o6wagq2EQi7ruVrcVJuJMTKTyc+XHd19pFGwjwgmnR2U5HZpqhLeGSTgm4CmMMufwl8vlLXBpF++4xLtG0KLRoFJrWjwHJBiBeyWYvcPT2xHLPI0MDjgu0Wv6yf4Bv//yd5XzQBdy2WJ+TgP2KA3uFMXbdZ7iemDUtCkop+iMRX4aXeMUujguULe5PPrrfULgA8Ps/vHDs7BlkAbc1UO0k4P5IORm9lwfiiTDGcHCYsd1id+PjVnGyurUEVcBt32VxikIA/ofSgophFPD96ze2i85GUYVacnkDG//xrbhQsyWIAu7IFqH+fHuaMr4sJmIDlSqCibGOPKK7ASc3AagfxxUplq7wx+0/4ezcbLnHRkccrx80AXdsf1tf30nCKCwT4HPxZ9WOOr1khQ2jgIOjjG1kpD/Sh589+OA60aYRTsKtpqnWSTUNlIA7npxhlwtcJR6PYWx0xNfdqW6jUcJRaiSBR//w964WZgDw+ugEO//9V4uroGlR3Ltz6/rYrYDLORuX00D3za/ouHiBaz94BQ4JLcND5dq2sLkSVdHWC9v1R/owOZHC305N1rW83716i5ffvzHnL1RwiujUEzBAvgf4MYAPTWeBF4yTpfSTB8uON9MmukK8QNWNKC4S8C+d/k9YRJzNXiBzfOZ5F3AgrmEgHsVYquxOFUtXyJ6/sxVslUahyPoCdqYb3IuuEW+Veou5KsNDiZZtwbaKci+FbCNLewZO/hWE/wJ10irdkkoOYWw02TCGHlQBd514q1RiwkuwCalV0bQoUiNDSCQG2r7J4ZZc/hLZ7LuGSUOc4yli0YUf/MzCAik3dnH8/Z2QWSvUi3KMDA2gWLqy3ejopIC7VrxANcHb3ZeYGBxAYjDeFUKu5lVcXOQbugac4ynAFu3yjcuulDFPQebrPYlqIYTg7t9MenoqOeVNjI8OYebD+9c1cLm8ge2d/7VEMTol4K4WbxWvligejyExGIemRdsSqSgWS5Vmg4brbvH1RGvHD6v+vimATxGKSXDMA9DE/0spdaz7E/GaqeYUhuuEgAMh3ipuS21E4vEYYlo/IpEINC2KWCVfQYZc/hKMMRhG4TpjzUOSj68lSvV2K90IWDbFslsEHCjx1qI/357GFV8gBHOQ8AuBck5FxEXkoipWWQjB14yR5VaEl2QF3ExuMNAdAg6seGvRv9qaA8NcM0L2G0LwNeN8pVX1c7V4FXCzwq3SaQGHQry1VCzyXKXGbBptEjMBXjCQDRC+gWh0o92LF7cC9ku4VTop4NCJV6QsZkwDfIpSzIIj6Xbl7sA+IdhjnOwCbA+c73bLtmkjAd+cGMXh0bFvwq3SKQGHXrz18DS4MBbbDUKySj0B29GscKt0QsA9Ld6w4lbAfgm3SrsFrMQbUhoJ2G/hVmmngJV4Q0xFwN9A2MholXCrtEvASrwhZ2Vt6xzAdZMMsQlfq2iHgLszm0XhC5UF6bVw+yN9eDDzd215b6fqDw58TI2CL93tlXjDDKUmgYwMD7iuyPCDVgtYiTfMcD5VexiJtD+Jv5UCVuINM5ybmgdmz5sbsyBLqwSsxBtmYjGTeHN5A3/+v1cduZVGApa5phJviEl/MnNazhv+gf/5yyt89+ptR+6nnoBlBhwq8YYetghh0M3Ot3/tOgHLDDhU4g056SeP9jgnC+L5Tgv4wcyPrZEPxhe9XEeJtwdIP3mwzDn5pXi+kwIeiGv48H1zMQwBPvcyV0+Jt0foRgE3O+BQibeH6EYBT06khDNk1u1rlXh7jG4T8K0Jc4iXALNuX6vE24N0k4DHRy2dQF2XbSnx9ijdJGBZlHh7mKALWIm3xwmygJV4FR0V8NvjrHjKvtufDUq8CgCdE/DrI3NBBQc23L5WiVdxTScEfHAkTq7nG25fq8SrMNFOAX/36q215y/nK25fr8SrsNAOARdLV/j2z/umcxx45qWvmxKvwpZWCrhaWWwZbkjJopfrKPEqHKkn4L/sH0hd06kknoP8Jv3pg12Hl9mi+jYoGuI0M3pyIoWP3r9rzQxzwGlGnGwvByVehSucBAyUO/DcvT1ul6eAYukKrw9PHGfEAdjnWnRapgmJEq/CNfUEXGV8dOj637l8wXaCUJVmu+co8So80WhaqVtqR3fJXkOJVyGFvrq1KDMnrjyfgy360ZBbiVchTXU6EwifqySROwl5n4OsgGLZa0ShHkq8Ct+oFE9OmU4GpKO8QqFQKBQKhUKhUCgUCoVCoVAoFAqFa/4fCbut2hEefs8AAAAASUVORK5CYII=","e":1},{"id":"image_1","w":85,"h":85,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFUAAABVCAYAAAA49ahaAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAEE0lEQVR4nO2d/XXaMBTF72OB0AnqThA6Qd0JygalEzQj0A3aCUo3gAnqbEAmKNmATHD7hyTqEuMvycgW73cOJzYY83zzJMuS3pNgJJDMAWT2tQAwb/jKEcDe/RWRYjjruiGxfpjkEkBuX/eBTvsEI/QWQCEix0DnHS8klyS3JI+8DluSK5JNXj8tSGYk11cUsoojyQ3JLLYeXlgxNxGFvMT0xCU5p/HMsbPhFKoFmjozZjHvypHkQ2zdKqHxzm1kgXwoGLBK8G5S0bQvtwDuvK2JywuABxHZ+J5o5vNlmqLzG9MXFDDX8JPkd98T9fZUkhsAn30NGCk7AKu+Dw+9RE1cUMcTgLyPsJ1FJblHuMfKsdNL2E51qvXQWxEUMNdasGN7trWoN1Lkq7iHad20ppWo9i5/i4I6PlinakVjnWrbob89DEqJL23asbWi2rrkgDTaoSF4gblx7esOair+G6igZe5gNKnloqg0PfOfAhqUCvck13UHVBZ/LfaNvABYiMih6sNLnvoAFbSOOwAX+wheeartAvszoEEp8bFqFLfKU9eDm5IO66o3//NU9dJevPLWc09dXc2UdFidv3HuqUfoDaoPb8o9WSdPte1SFbQfq/LO7NIHSidW5Z1T8dei78079zAwA7ToB2LpNlzxz+PYkRS521BRw5G7DQEAkoxmSlq8F5H9zPbsK2HIAFP8s6hmpMUCUFFDcxJ1EdmQlJgDRtTxT3ydDhngOetPecVbQEUdBC3+A6CiDsAMZihaCYjWqQOgooblGTCiph8Uez0OgBG1dgab0okjoJ4amj2gnhqaA6Cd1KExndR25ymqKYngZlg7UbUK8OfRbThRO4W0KJWcNHSiFnHsSIrCbcwAwE6u2sWyJgGeyxEr5cdUrQL6synvlOdSafBEf96VgypOnmqrAPXW7uzOo1R0ero/9dPTreK/rmjQ1Hmsik7RkB8/2oX8qLe2ptJLAQ2j9OH9pWjqyuEU2xJYD2nRxPlRF57eFO9fAPgQ2qKJ8wwT7Huxc79p4G8FEzGs/KMxX1WtqPamNc4Eg3H41iZNc6u8VDZV21dfiybOTkSWzYd1SPZFcovbzVTRKelXF1HnMH2Gt5TsC+iRRa1TWrobFLZVdp9zOk37sf+tHLcxUOg8tPP4Xd+slHOYbsJU27C9M1ICPSeoichRRHKk2Uewg4eggOesPxFZAfiCdB4QvonIchQrWZBckNwPlYX7Chw41shHxl95og/fOfZ8/zQrUUwhPX1BclqBeSRza/jYKDjWot4WGnHHsIbKllMX8xyaVSseeN0b2oGmns+uea1RFvmyF1le5CvksM0j/i3yFWU2Y7SV08rQ3DAymIhutxRdBhvrWcEzzBiaW5LuALMknU4JTZW/U1qiUwiP8oYAAAAASUVORK5CYII=","e":1},{"id":"image_2","w":186,"h":242,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALoAAADyCAYAAAD6Bd/wAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAPn0lEQVR4nO3dXVobR74G8LeqW60vGgkZFA/J2OZ54rkNZwXxDiY7GGYHnrOBISs4mbMCZwPnOCsYZwf2re05Mk6GsYUQSE2jr+6ucyGaMCBA6KtK1Pu7sUBSV7n00vp3qVoNEBERERGRScSiGqrVjp7ETrytlNoWSjw7a/3bRbVP2u1B4QMEPiioD0jw6unWxqtFNT7XoL+t1bellDtKiGdCqW/m2RYtrZ8g8NKJnZdbW2vH82pkLkF//7GxoyCeXw53PptBLuci4zpwHYms50LKhb2pkEa9foQkUegPYvT6ETq9AaIoufiQAMD/OImzu7W19mHW7c80Ze8/NnagsAvgcfo7v5hFseAhn80w1PRvoihB2OmjHfbQ70cX7/px1oGfSfLe1urbwnFepHtw15Xwi1mU/TzDTWPpdAcIwh6CsHf+OwX1vZu4P8yipJk6he/2DnYFxF8BQEqBkp9jwGliUZSgfniCTm8AAFBCvFFxvPOHrerrabY7cRprtaNyLOKX6cxJMe+h+mCFAaeZCDt91A9PkCRq+AuBP3/9aP3FpNubKJUXSxUpBdbXivCL2Un7QDRSkijUD08Qdvrpr378+vH6ziTbunPQz6YMfwaw6roSD9d9ZD13kraJxtJsneKo1Ul/nCjsdwr6xZB7nosvq6ssVWghgrCH+uFJ+uOdwy7HfWCtdlQWjvMCDDlp4BezqD5YSX/807u9g927PH/soMcifimU+sZ1JUNOWlwMu4D46/uPje/Gfe5YQX+3d7ALgW+lFHi47jPkpI1fzP428aHwY6129GSc590a9Le1+nY6T76+VuSBJ2lXfbACb5jD1VjEL8Z5zq1BP6vLUcx7nEIkY1QrxeENgW/HKWFuDPr7j42ddK78woEAkXZZz8VaKT/8QeG/b3v8zXv04QItlPwc63IyTqVUgOtKAPj9P/YOn9/02GuD/v5jYwfAY9eVqJQKs+0h0Yyk2VRQ/3nT464NuoJ4DoB1ORnNL2bP9+pnO+eRRgb9ba2+nS65Lfv5uXSQaFYuTDdee1A6MuhSyp10A6zNyXSrxVx684+12lF51GOuK12+A4BiwZtDt4hmy3VlOq+O2IlH7tWvBP3sk6bHwHDunGgZrP5Wvjwbdf+VoMdOvA0MT2QmWhZexklvPht1/5WgK6W2ASCX40f9tDzyufMd8+NRdfqVoKdfLpRxnct3ERktrdMjRNuX77t2Ht11xl7BS2QERwxnCIUjnly+72qaz0525ipFWjZpua2UenL5vmt325w/p/uE9QlZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysYeWJotxchCLvo9SPE6QVVyWg5z0Uu62KlmINj4GmYRgW9FXRw0AwxiGLdXaE7Oj2/6G0bJT+PjUrRqK9MMSLocaLw66fjC4NFy6wVdBCEXTxc91Ey5NuYtQc9ThQ+/rOJbj/S3RWaoSRR2K+3AcCIsGs/GGXI77f9ehutoHP7A+dMa9APmicMuQU+NQLtx13agh4nCs3Wqa7maYGSROGgGWrtg7agt4IOEk4dWiMIu1qnirUFPQh7upomDZJEaZ1V0xZ0TiXap9sbaGtb+6wL2WMQJdraZtBpYXTOvDDotDCFnL7rYmkLOr9/3T6OxquoaGvZ/+0iqGSJQk7f5Tw1Bj2rq2nSIOM6yGX1La3SGnSTlnHSfG1Uilrb13owulld1dk8LUgh72lfwag16IW8hy/WfZ1doDmTUuCrh1eub7v4fujuQKVUwPqa3rc1mo+M6+DxZsWIU+u0n3gBABuVFeSyGXw2YDknzUbJz+OLdd+IkAOGBB0YHpwW8h5Owi6ax6dcp76EpBTwizmU/RwKeX1TiaMYE3QAcKRAyc+fH7hw4dfykFJqnT68jbk9A4zbK9Dy0n4wSrQIDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUjv2Q0PrtuvM5Lai9aLptBIe8t/PvEZzXWjiNRyHnGfqOuUb3q9iI0W6doBR3dXdGm5OexUSnO/UJmp50+mq1TBGFvptvNuA5Kfg6VctGYiwAABgX9cyNAs3WquxvatYIOWkEH62tFbFRW5tLGPMd6EMVoHIVoBV1sVleN+epv7TV6nCjs7R8x5Jc0jkLs19sz3WacKNR+OVzIWA+iGHv7R8a8O2sP+udGwCtbXKMVdGYa9l8/HS/8kjn79bYRr6/WoNtej4+jFXRmUkcfNE+0Be6XT8eIE6Wl7ZS2oMeJwkHzRFfzS+VzI5jq+XGitJaGSaLQPA61tQ9oDPpJ2EWi+a98WQyieKp3vlbQ0T7Wuo/BtAV91tNa990049Vq6y8Pk0Rpfc0Z9CURTlFfm3LNVp0fAGqfdaHxTFp6mHQl7kGUaGubQb/nBgOTgq6vLwz6PZfNZnR34dy8lzXcRFvQpUHrIJbBpCExab1JxtW3X9XWctGQNRDLYpo1I6asN9H5mmsLul/M6mp6KU0zXiaMtZRC6x+ctqCX/LzWmm2ZZFxnqrCW/Lz2UrFSKmhtX+vB6Bfrvs7ml8a04+RIMbclv+PIuA4q5aK29gHNQfeLWZT8vM4uGK9SKsyk9KiUClrGWkqBrx6WtR8Ua59e3KyuMuzXKPn5mb7rLXqspRR4vFkx4vQ6/T3A8AXIuBKNI70r3Ewhz0qNedS1ixrrnOfid9WSESEHDAk6AGxUVlBezeOgGSKwdGWjlAJlP49KuTDXA/V5jnXOc1Ep6ymTbmJM0IHhQctmdRXAKk47fQyiGH2DPsKeFy/jIOtlFrr3uzzW3X6EOJ58LUouO+y/qTNpRgX9IlM+5LBBIe/d+/HWfjBKtAgMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBWO/ZHQQxRgM4nv/jbpexkHGdZA5+1eHacc6vdqcyV9UalTQ40SheRyiFXSNurT3omRcByU/h0q5OPdLocxyrC9eVMAvZlEpFYwLvTFBbwUdfGoEVl4AIDWIYjSOQjRbp9isluZ22cRm6xQHzZO5jHUQ9hCEPRTy3tnVNcz4vnQjavT9ehv79bbVIb8oSRR+/XSMz41g5tver7fxeQE7lNNOH//3yyG6vWiu7YxLe9A/NwK0go7ubhgp3fPOyn69vdCxThKFvf2mEWHXGvQg7KHZOtXZBeM1jkKcdvpTbycIe1p2KEmi8K96a+HtXqY16PN4a76P9uvtqbehc6y7/Wim70yT0Bb0VtCxcmZlEoMoRhD2Jn6+CWPdCrpa29cW9GleOBtNM14mjPUgimdSgk1KW9BDjf/pZTRNSEwIOqD3NdcWdE4l3s2kpUds0DgPosmvYzot7dOLNF+93kB3F87pPE5g0O+5TMaMTyYBzH1Zw00Y9CUhJwyJKR/BA0DW07fiRFvQTVv0Y7riFOOV0xiwi3LZjLa2tQV9XguW7qtpxqu0mp9hTyYjpdC6c9MW9JKfn/jt2DZSCqwUcxM/34Sx9os5O2t0RwpUSgVdzS+VjcrKVCHRPdZSCnyx7mtrH9B8MLpRWWGtfov0RIZpbVRWtNXqm9WS1r05YMCsy1cPy8YcLJkm57n4XbU0s+09+rKy8LHerK4acTymPeiOFHj0ZQUlX/8Bk0kqpQK2fv9gpnvCdKwXETwpBb56WDbmdTViV+pIgc3qKsp+DgczWn+9rAp5DxtrxbmVdM5ZAE87/bmMtTw7HljEea93YUTQU4W8h8d573ylW38Qo9ePjFqvMWsZ10HGlfAyDgp5b2Ef8Fwc6yDsIY6Ticc657mQUiCXzRhRpoxiVNBTw7PhzXjLu+8yrmPF7Jf2Gp1oERh0sgKDTlZg0MkKDDpZgUEnKzDoZAUGnazAoJMVGHSyAoNOVmDQyQoMOlmBQScrMOhkBQadrMCgkxUYdLICg05WYNDJCgw6WYFBJysw6GQFBp2swKCTFRh0sgKDTlZg0MkKDDpZgUEnKzDoZIVRQW8BQK8fLbgrRNNJbriIwdWgK7y+7UlEJur34+GNBK8u33c16ALHANAfxPPtFdGMDeLrM3sl6ArqNcDShZZLkihEUQIAeLq18ery/Vf36Ge7/R736LREOr0BAEAJ8WbU/VeCnv419PvR+V8Ikek63WHQhVKvRt0/enpR4WcACC2+3ictl/OsiqsHosA1QRdCvASAdtibU7eIZqf3W/XR/vrR+stRjxkZdJnIFwDLF1oOraCb3vzf6x4zMuhbW2vHAH4EgGbrdOYdI5qVJFEIziqPJEl+uO5x1y4BUIl6AQBB2ONenYx1HHSGNxR+/sNW9fV1j7s26E+3Nl6lB6Xcq5OJoijBUWsYdKXU7k2PvXFRV/rkIOydT98QmaJxFA5vKPw86kOii24M+tmT/wYA9eYJ17+QMcJO/3xKMVHJ89sef+syXSdxdgG0oyj57S+ISKMoSlA/PAEAKKjvb6rNU2KcDb+rHTwTUvwdAKoPVuAXs1N1lGhSSaLwz3ob/X4EJcSbp48ebI/zvLFOvHi6tfFKQX0PAPXDE9brpE3jKER/uOCw7cbyu3GfN9YePfV+r/ECwJ+kFNisriLruXfrJdEU6ocnF+fM/2OckiV1p6ADwPsPjVcQ+FZKgfW1IssYmrskUWgchechh8Cfv360/uIu27jzOaOOcr4D8FOSKNQPTy5+/Eo0c2lNPk3Ih0+bUFrGAEAx76H6YAVSTrw5oivCTh/1w/Np7bZK1B9vmy+/zlTJ/Mfe4XMF9V8AwFKGZuVyqaKEeKPieOcuNfllU++C39bq28JxXgilvgGAfDaDtVIe+Vxm2k2TZZJE4TjooBV0L344+TcncXbPFhpObGa1xru9g10B8RcAq8Aw8P5Klnt4ulUUJWiH3X8LuBLiDeLk+aSlymUzLaprtaNyLOMfcFa7A8OSppj3UCx4yGczrOMJwPBkiW4vQjvspfPiqT0I7E5ywHmTuaSuVjsqRzJ6LiB2ADy+eJ/nucg4Ep7nABju+el+i+IEgyhGkij0+zF6g2jUuqmfIPDiujOEpjX33evbWn1bSrmjhHiW1vFEGH4j3CsIvHRi5+W0NfhtFl5HvKsdPJNSbidIygLiCRSeLLoPtHhKDM/OF0K8dmLn9dbW2ge9PSIiIiIiIp3+H/yNcCHjpRNmAAAAAElFTkSuQmCC","e":1},{"id":"image_3","w":216,"h":260,"u":"","p":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAAEECAYAAABKq/oNAAAACXBIWXMAAAABAAAAAQBPJcTWAAAAJHpUWHRDcmVhdG9yAAAImXNMyU9KVXBMK0ktUnBNS0tNLikGAEF6Bs5qehXFAAAeX0lEQVR4nO2dX3Ybx5XGv6puNEAIAkGR4vAokQnO2H41ZwXiDuysIM4GJjnZQJIV2LOCaHZg74DeAfwqKQFgOxoOBRIgBDXxp7tqHtAFNWmA+NdV1Q3c3zl+oAii22R/qFu37ncvQBAEQRAEQRAEQZiC2b4BItu8ql+ecodXpZSnDKwKieq010kmzzl4RwhRc+HWTk72OkZv1BIkMGIh6vV2JUBwCo6ziZAYXqz6fpKxH5mU50KIl5+fHNaSu9N0QQIjfsXr+rsz5rAqJE4hcQqGUwC7017LOYOXc+DlHHDGUMi7v3pNEAoEgUAQCgxHIYaj8P5LmgzsWy74y01b2UhgW0y93q6GTngahXenkrEqk/KLWa8v5F24DofrcBTy7lhUfPlHSAgJvz9CfxDA748ghFTf6krIb1zhfrspQiOBbQEqvOOcn0rI03nhnevwyarkec7kax0osXW6fQShUP/cBcMfP/3k4KWWixqEBLZhqPBOSlllkp0tGt4pEU0L8UzR84d3hSbxgyOdr7K8mpHAMkq93q4GCKpR0mFueBcXUiHvwnXHoV4a6XT76Lzvqy+7UsgvPzt5em7xllaGBJZy7oV31Sjp8GB457ocBc/VHt7pZDgK0Wr7HxMiDH/IYshIAksR0ZnSaSy8qwI4nvbatIV3OhBC4vrmFj1/OP6HDIqMBGaBVcK7uIjSHN7p4PrmFt3eYPxFxkRGAtPM6/q7s3vh3cykQzy8c92PmTxinABptf3xFxkSGQksIe6UDM0J7wBMzpHiKfFVzpS2iVbbn4SLQoj/zEIFCP1Fl+ReeFeVjJ1SeGeOy6sP8PsjAOg6wjlOewqfBPYAy4R3KumgwjuVDieSRQiJi1ZPZRe///T44Cvb9/QQJDD8qiL8FMAp5oR3d6odKLwzynAU4u3l+/EXDL/79JOD7+ze0Wy26qlYtiL8zh7J+5gSJ+wTO4xufnp8ULV8OzPZWIGtWhEer3Yg0osQEr/8X3dcKJzirGLmBXa/IhwLhnfrVoQT9oml7lO7imXmyUpzRThhj5/+9ybVq1gq46BpFeEhwl0GBonIOxR9NFB4t92UH+XHezGJrwC8tH0/97G6gi1r+MtSRThhhiAU+OWiCwBwhHNycrLXsHtHdzH2UR+J6SyWdHgRIgQkwCKdMzlenTalIpzQj3o2hqMQoROeIWWrmFaB1evtiuDia8HwdSjDL1R0Ny2829SKcEI/paKH65vbVIaJWp7mer1dDXn41xDh7wGARcIq5F0UPJfCOyJRYh/KZxZvYyqJ7sGUsAD8Xv1bIe+iVPRQLOQoHU5oo/GvcUli2vZhia1gr5vv/hoi/DOAx8B42S6X8rR3IoxQyLvoDwIECKoAGpZvZ8LaAqvX29XAEd+p7F8h7+LJ7g4JizCKl3PQHwQAxxmAc8u3M2Etgb2uvzsLefg9kyhzzvBkdwelopfUvRHEwqj9fFTNkxpWFtibn1pfQ+LvwPjT43D/ESUtCGuoiEkyVrV6I/dYSWBxcZWKHg72isneFUEsiRLYQ4UKNlh6ySFxEWmEczaJoF7VL1MTJi4lsNf1d2ckLiKtuO74ceYOz57A6vV2lXH2PUDiItJJwRvveKSUVbt38pGFBRay8CWAspdz8GR3R98dEcSKqBWMSXZm904+spDA/tG8+hMYXnDOcLj/iCoyiFQyOXtl06ds2mCuwOr1dkVC/g0AKo8LlIonUkusuOG4Xm9XbN6LYq5aQh5+C6BcyLsol/IGbokgVkeJLECQikTHgwKr19tVRIW7lccFE/dDEGuhBMZ5OjKJDwosqowf20zIp0VkALWFkUhHJnGmwKIY9ncArV5EdpgsBBLpXsFCJ/wKQJmayBBZQqXqH+o4ZpLZIeLYfk2JDSJTuA6fHCNFOQSrPLQH+xIAijs5Q7dCEMmgEh2hE1oPE6cK7HX93RmASQdcgsgSE+uKlOkUWOQKpdWLyCRpMl9OFZi6MbL9E1kkTebLqQJTN0bhIZFFVNY7DebL6StYrIENQWQRtTiofIK1+7B5cSL7jIIQg2GIwTDAYBggFOMuswXPRd5zsFPIIeea32q4LkcQCjCHVY1fPH4fNi9OZAchJPqRiAbDAKNA4HY8jHwq8e+Vih72K0XkPXOPW8Eb90m0bb4kgRG/wu+PEAQhRoGA3x9hMAzGM7hWpOcP0fOH2K8UsV8x44T3PNUEx675kgS2xdwP70aBwGAYaLveVcfHKAhxdPBY2zUUkwQds1uTSALbAuLhXRAI9IfBg+GdTrq9AXKuo30lix0x7dbr7crJyV5H6wVnQALbMOKrUTzUSxNXHR+loqd9T6bmhkXmy3OtF5vBrP/DJoDj4Sikw+aUMoqEcxvtkXSHd0lzef0Bz492tV5DCSwyX55rvdgMpgtMogGG4yAUJDDLpCm8S5Lb/gijINSawo+ZL63tw6YKTDJ5zsBeDIchigWqRzRFfCVKa3iXJD1/iL2yvhaAhbwLvAcg7XWZmiowxlgDEuhnKOTIEvHwLp7J2zZu+yOtAkuD+XL6ChbKBuMMwQZ/eppCnSOp8G7dM6VNItT8e1DmSyEk6vV21cbky6kC++zk6fmbZgtBSAJblG0L77KCGswXmS8bpq8/M08qGfuRSflFfxBQ0W8MlXRQ4d28kiHCLkpgkfnyO9PXn6kcJmUDwBfDUbi1AlMr0WAYUningYKB2sTJ3DBL5svZKxhkjYF9uQ1hYjy8ix/UEnrJe/qPgGKexnQJjDFWgwSGo9Dk/Whl2YpwQh+cM5SK+juWxaKvY+0Xm8JMgTmhUwt5mFmBJV0RTiTLXnnH2JQe1xl7w17X3519dvL03MhF1bVnfePkZK/xptmCEBJBKFLbPsB0RTixPjmXaz3/uo+Xc6yZLx/eZUr8AIYXQZAOgakUOIV32YVzhmeHZaMz5rycA78/stJO+2GBMTQAvLCdqu/2+pGXiBIPWYZzhudHu0adzcBH86UNgT24LDGwGgBrB86jIETzbQcXrR6JK+PsFHI4flYxLi7ArvnyQYEJIWqAnUziYBig+bZD+6mMUyp6+O3RLp4f7VppfgP82nxp8toPfpy4cGshzGcShZD4+eKGsn4ZIudyuK6DYiGHnMuR91wrq9UsCvlxExzT5ssHfwMnJ3udN83WDYBdk+bLf112SVwpZqeQQ8Fz4UZCKniu0aTFKkzCxHFb+HNj1537CokaGF6YMl/6/RFlB1NC3nPvrEZ5z7EW5q1LrF991eh1573AtPmy073Vfg3iLpwz5D13Et6pUG+TsGW+nCsw0+bLnj80cp1tZefeHikL4V0STKIvw+bLuQIToahxzo2YL30KDRPjbmiX7fAuCThnE/Plq/rl6ecnhzUT150rsM9PDmvKfCmE3IpPuyyhwjvVC34Tw7ukUN4w7vAqgHQIDPhovtxmb1gaUOFdznUmmTz6wFscG+bLhdRC5kuz3A/v1NfEetgwXy62ghkyXzpb9mkcD+/UmRKFd/qwYb5c7GNR4Bwcf9Fd0ZGPQp5NPGSOJxrioR5hDhvmy4UE5sJthAjRH+hP1ZeKHrq9gfbr6CJ+jkThXfpQ7bRNmS8X+ssr8yUA7ebL/UoxEwKj8C6buA432q9+8Y9WQ+bLnOtgr7yDdooqOuIrEYV32UaZLyXMTL5cXGAMNRgyX+5XihPnsknSXhFOrI9p8+XCTw8Da0hII9YV5Xz9+eJGm8iyWBFOrE+sZCpdAhNC1BhnxtzNSmRXHX+tcJHCOyJObHuza6Jf/cICs2G+5Jzh6ZNHqJQLuOr46PnDmSn8bagIJ5IhZr6sQnO/+oUFFpkvrUy+zLnOZHC23x9BCInBMJgIicI7YhlMmi+X28FHky9tjpZVq1Kp6Fm5PpF9YiVTVd3XWirfLpk8B0Bzw4hMowQmmf6axKUExhhrADT5ksg2kxVMyi90X2spgYlw3MaNVjAiyyjzJQC8ql9qXcWWEphygSrzJUFkFbWKReZLbSxd8yQZ+xHYrLFGxPahhv9F5kttLC0wJqW1br8EkRSuG7Vxk+xM53WWX8EgG4C9fvUEkQSxfvVVnddZvixejA/maAUjsowp8+XSAnPhNgAYMV8ShE5UouN1/d2ZrmssLbCoOPIGoDCRWI5REMLvj+78ZzMbrcLEyHyp5xor/VTUr344ClMx+ZJIH8rPFwRiMnh+lpjynou9cgHlUsHoPZowX64msMh8aapfPZFe4nOx43Oyl32Pi1YPVx0fzw7LxkyusX716VrBTJoviXQhhMRNr4+eP0x8Cs4oEGi+7eDooGRkNVOpep3my5XiOzX5kvZg28VVx8c/f7nGu+sPWkdMXbR66Pb62t5fcd98qeMaKwlMtbuiFWw7EEKi+baDq45vLClxef0Bo0D/86XS9ZH5MnHWyVA0AUrXbzpqnK/pBkRCSFx1fO3Xmfgax+bLxFldYHJstaYwcbP512XX2iD6bm+gfRWLTb7Usg9bWWBkvtx8ur2+9XG+ugcyxsyXVR3vv3I+lDFWMzn5clsRQk7OkdSZUpycy1Es5LRk3UyEaPPo+UPslXe0vb9u8+XKAhOhaHDOKdGRIPFzJL8/QhCEc8+UbjEOpS6vP2CvvIP9SjGxe1n2PEsHupMqnDO4DkcQCi2TL1cWmJp8KYSkyZdLMoqEcxtVO6iD2nVQSYGeP8Szw8dr935My6xsE/s/1x0LjDv8FAlPvlzryJwmX87nfsmQ7j3NYBig+baD42eVtURmIkW+CCY+uAueqyZfVpN+77VUEZkvSWC4WzK0aHinCyEk3l6+x/Oj3ZUf0DSEhwCMlE3pNF+ut4JBNhjYVu3D4uHdKAgxGIbW0tgPMRgGaHdvE9uT2aJgQGCxfvXVpN97vbuPJl9u6lnYMhXhaeSq42OvvLPSKpZzOdIwQOqRgQazsSa6x/V6u3JystdJ6r3XEpjqV5/1ao4kKsLTyk2vv1Kaexya2R2EqI4gTKAmXwYIEh3Mt5bAon71NwB2dU++TAJ1pqTCOxXqbTKrniOVih7eXX/QcEeL82/RPAIT6Jp8uX6Am1LzpUo0DIZhJsO7pFj1A0QNa7f1AbRX3jHqNdRlvlxfYCkxXyqfUrc3SGXSIYvsV4r45eLG+HXLpTyePnlk9Jq6zJfJCEzata70/CEuWu+3coXSSbGQMz4ve6+8Y1xcwB3z5Ysk33ftmE6G4z6JtgR20XqPt5ddEpcmnj55hHIpr/06paKH42cVK+ICxnswlW1N0ny59gr22cnT8zfNlhXbykXrPbo9u5mutJPEQa0afpjU71pNIy14LvKeE432tT/W18s5iU++TOoUrwnguD8IjFV09PwhiWsBktoXHx08RqmYx7vr3lJHGPlIRCppkuYZ2UpgSU6+TEoNNQDHplYxISQuWu+NXCvrJBnelYoeSsUnk4Y38exsPhrjWyzk7gyezxI6zJeJ/AYkZI2BfWlqH3bT69OeawF2ooc9acZC27wRvjrMl4kcXDHGjE5codBwPpwzHB2UbN9GplDbmyTNl4kITISiAZgTGJ1zzefoYH1P2DaiwsSk+tUnIjDlAlXmS534G17atC5q5drEEM4EE+uKw6pJvF9ytU0SPwDUK9EmO4Ucnh/tGu/xvknEJl9Wk3i/5HbADA0AL0ym6olxxflO1PSG5gSsj+epJjjJmC8TU4IyX+pO1efc9BQUm0adI43PlsYHtdQLJVliky8TSdUnt9QYMl/mXAecs41O08dFFD+oJfQTM1/uJmG+TExgJs2XpaK3Ean6+yVDrutQmJcCkjRfJiawuPlyOArjnwSJUy4VMieweJnQTiFH4V2KUQJLwnyZbDYiMl8GodAqsGIhZ9UM+BD3w7sslgxtO2ofJiHX3ocl+5c3aL78zWEZ//zl2tpeLB7euZGIKLzbDGLmy+q675W8wAyZLzlneH60i58vbrSLLEsV4cT6JGm+TFRgMpQNxs31Scx7Lp4f7eKi1UukfCrn8kmigcK77UWZL4WQqNfb1ZOTvcbK75XgfVkxXyqRtbu3aHdvF17NVKKBwjtiGsobFjrhKdYwXyb+8az61Zus6OCcYb9SxH6leMerpHCi/RKFd8SiKIFJKU8BfLfq+ySuACZlAxb71W+qV4kwS1Lmy8TrjiRkDaDRskS2Scp8mbjATJsvCUIHSZkvExeYEzokMGIjSMJ8mbjAVEpTCElhIpFpJvOb1zBf6vF+RObLYEMmlBDbyaTcb4122noENjZfZn6sEbHdKPNl6gTGwCiTSGSeJMyXWgQmhKBEB5F57psvV3kPLQJz4ZLAiI1Apesj8+XSaBFYZLO+AUhkRLaZhInjfvXL/3yC93IXQ+ZLIvvE52KryaRqwIRyNOwUctgtFYy7wGMlU9WVfj65W7mLZPKcgVmffEmkh/hc7Pjg+Yd/RmAUDNHzh3h3/QH7lSL2yjvGhLau+VKbwBhjDUjcqWontgchJHr+YDIjO6n2DlcdH91eH88Oy0a8epPoa0XzpbYmg2ryJR02bxejIMRF6z3e/HSFi1YP7e5t4r1TRoHAzxc3RmYUcM4mq+Wr+uXSiQ5tAvvs5Ok5QGdh20S310fzbcdIxy8hpLHRwWoV4w6vLvuzWtvkSsZ+BKiiYxvo9vq4aPWMNiEaBQJXHV/7dSbWFbl8lymtAovMl5Sq33B6/hAXrZ6Va7e7txgFep+vSdHvCuZLvSsYmS83njSM8+35Q63vPzkLw/IlU3onKYhxV1Rawczh90fo9vq46vi46vhod2+1zlS76vjW5wToFlis9cXxsj+rNc/pwm2ECElgGoifI8UPamfBOUOp6GG/Uky06c9Nr5/Ye62KiWyi63AEocDr+rszlcBb6Oc03hNOTvYab5qtifkyttQSCyKERP+eiFZJewsh0e0N0O0NJh241sXvj6yvXgCMZRKDUCxtvtR/UifxAxheBAEJbB7xMiE/qnbQ8fBcdXwMhgGODh6vVRGRxtkAuvByzjjUXtIbpl9gUb96mnz5kVEQYjAM76xKpge79/whLq97ODp4bPS6WWVV86X2J56BNSTkVu7DkgrvdNHtDZD3XOyVd2zfylrsGKh1jZVMpUtgQoga4/pHy9rmoYrwNHPV8a1UqSeJiUazse3N7jL96rULTE2+3JQVbJWK8DQjhMRNr7/SKpaWedmmOjkX8i76gwABgioW7FevXWDR5MsmgGPdky+TJB7eBYFItCI8bfT84UoCMxGazaNcyhubNXDPfHm+0M9ou5s4Eg2w9Aosq+FdUqz6wZFzHeQ919oKzjnD4ZOSsevFSqaqi/6MEYEp82UarCvKpzROg4eZDu+SRAi50j5sr1ywUoeoBjCa3DvG+tUvnOgwIrA0mC+FkEvPENsm+sNgJed5uVTATW9gNHxW4jI9HHGygi3Rr97ILlWE4zZutlawwTBA8207FXVzaWWdhMVvDsvGEh7lUh7//tsnViaPrmK+NPJb+fzkcFJVb/oBHwwD/Hxxs1V7qlVYJ1HAOcNvNa4oO4Uc9itFnPx2b+3qk3VZ1nxp7GNATb40OZhPCGlkSHrWSSIbmHMdPD/anVTwr/YePBo4794ZPJ8mCp671ORLYwKzMfny8tqswzarJHWOxDnD0yePUCkXcNXx0fOHU3//PBrpW4hEpAbPZwE3CoWZZGcLvV7nzcSRkDUG9qWpio5REBrpDZF1OGfYLRUSfc+c60xqHEf3jjwKnpvpqpFYv/rqIq83dxRv2HzZ6dr3KWWB/UpR6wOfi1Yn9V+WxQUsb740JjAXbgMw1wCn59PqNY9S0ct8oa8NVKJjkcmXxgQWFUfeAGZ6dFDW8GHynktWlRVRYSLnfG6q3my1poSR8zCdPSg2gb3yDo6fVTIfrtliUtEBWZ33WrMCG5svqU+iJcqlPI6fVfD0ySPbt5JpljFfGj0ON2W+LFg45U8bec+9M5kk69m7NLGM+dLok2jKfKlKWrbhDCzn8sk5UvygltDHMuZLo3+Jz06enr9ptoyk6ouFnPZ+eaZRK5EbCYlWJXssar608VHXBHCsuwlOuVTIrMDuh3c5l6euZGjb8XLOOJcwx3xpXmCR+VJ3mFgqelbNgIugSoZUeJelkqFtZ9HJl8YFZtJ8eXRQQvNtR/t1FmHn3h6Jwrtss6j50rjAGGM1U+bL8WFqyajjNh7epbUinFifRc2XxgUmQtHgnBurSSxHhaxJiyzLFeHE+nDOJv3qX9UvT5Xn8T7GBfb5yWFN9atftQ/EspRLBeQ9F5fXH1aytscTDXSmRChcdyww7vBTAOkQGGDHfJn3XDw/2p2M95nmVbpv+FNfE8Q0YubL6qzXWHl6mJQ1GDZfKpRtQuH3R5QGJ1ZiEfOlnRUMssHAUtHtl/ZNxKrESqaqs15jp/dxZL7c9H71xGYTa6J7XK+3K9NeY0Vgps2XBKELJbIAwdTzMCsCM22+JAhdzDNf2huPEZkv07API4hVmWe+tCewyHw5HJLAiOwyyYLPMF9aExgDawC0ghGbgeQsPUkOYGy+BGgPRmSbeTWJ1gT22cnTc4BWMCLbzCuZsz0DtAlQup7YXGwLjMJEYqOxKjAJSal6ItPMWxysCowxRgIjMs3EmS/xw7TvWxWYCEUDIIER2UXIh1sDWhWYcoEq8yVBZA1VKCGZPJ/2fdtJjsnSSqsYkUVUbxnGxoUT97EvMDZu2kipeiKLqOfWCZ3zad+3LjAJ2QAoVU9kj9gUn+as9tnWBUbmSyKr+LcTgc0chm5dYC5cGmlEZBK1gkkh0yuwk5O9DiLzJSU6iKwQ60rWVHW107AuMAAfJ19SmEhkhE63DwBgYN8+9Lp0CIzMl0SG6PlDtRh0ueAvH3ptugRGISKRcoSQk9VLQn4TbXFmkgqByXCcqieBEWmn2xuo1etnV7gPhodASgSmNom0ByPSTH8QoPN+vHqB4b/mrV5ASgQWQeZLIrUIIdFq++rL7z/95GBmaj5OmgRGmUQitVy0eurZbDrC+XrRn0uNwMh8SaSVVttXz2VXCPHVIqGhIjUCI/MlkUZabR89fwgAkEJ+OWvQ3ixSM/zKCZ1ayEMSGJEKhJC4vP7wMSfA8IeHKjZmkZoVTFUjCyFpH0ZYZTgKcdHqKXF1wfC7Tz85eLnKe6VGYAAm5stJnwOCMEy3N8BFqxffc71YNGM4jXQJjMyXhCX6gwBvL9/j+uZ2XMQr8YMjnONl91z3Sc0eDAAYWE1C/p5CRMIU6vA49qHeZWB/+Y/q/twqjUVIlcCEEDXG0zFalthchJDw+yN0e4P7z9r/OML50zJp+HmkSmAu3FqIcSZRCDm37zdBLEIQCgxHIYbDEH5/NO0D/H8c4fx1lu1/HVL3BL/+6arGpPzicP8RDSgnlqY/CDAchR9FFX1Y30cy9iOXeMkFf5nkinWfVK1gAMCkPAfwhX87IoERM5mIaBiiPwwQBOLh4x2JH8BQA0PNCZ3vdIoqTuoEJoR4yTn/Y6xjD7HFCCExHIXoD4I7q9IsJGM/MikbErLGGKs5oVPTEfotSupCRAB402w1ABwf7BVRKnq2b4cwxH0RzQrvIm4gUZNMnjPGGjKUjVUqLXSTuhUMGPc5kJDfdHsDEtgGEg/vlJAWCO8aDKwmhKi5cGumQrx1SeUKVq+3KyEPmwDKRwelj4OmiUxxP7wLQjGviKAJoKbCOxGKxroHvbZJpcAA4HXz3V8Z2F+8nINnh49t3w4xh4mIAoH+MFgovFNJh7SGd0mQWoHFV7Enuzsol/K2b4nA3TOleDp8JlF4JyEbEDjPUniXBKkVGAD8o3n1Jwn5DecMzw4fw3XSVTq5yajwLr5H2rbwLglSLTDg48FzIe/i6KBk+3Y2komIlgzvGFhDCFHb1PAuCVIvsHq9XQ15+COAcrmUx5PdHdu3lFkme6R71Q6ziM6UarHwrmHzTCmLpF5gAPDmp9bXkPg7ANDZ2Hzi4Z0S0dzwTqIRnSlReJcgmRAYALxptr4F8EeARBbnfni3aMkQhXdmyIzAAOBNs/USwO+B7RPZiuFdQ0LWKLyzR6YEBtwV2abuyRatCI+Ih3cNEYoahXfpIXMCA+6Gi4W8i4O9YiZT+KtWhKvwbtvOlLJIJgUGTBIf/w2gzDlD5XEhtYfR8fAuixXhxOpkVmAA8Kp+ecoc5yWT8gsA8HIOnuzuWK1d3MSKcGJ1Mi0wRVTx8TcAZWAcNpaKntYkyDZVhBOrsxECA8a1iwEP/sTA/gzgMQBwzlAs5FDcyaHguSv1+Fi3IpzCu+1mYwSmiAntawDH8e95OQdezoHr8Jlh5BLZu62pCCdWZ+MEFudV/fKUc/61ZOxM7dNWYssrwonV2WiBxanX25UAwSk4zhhYBRKnU18YCYlKhgiCIAiCIAiCIAgiW/w/zQ1m2VyA5iUAAAAASUVORK5CYII=","e":1},{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"magnify","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":42,"s":[75]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":90,"s":[8]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":121,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":134,"s":[32]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":164,"s":[53]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":183,"s":[53]},{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":219,"s":[53]},{"t":272,"s":[0]}],"ix":10},"p":{"a":1,"k":[{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":0,"s":[333.752,339.42,0],"to":[-26,-25,0],"ti":[-4.333,25,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.333,"y":0},"t":42,"s":[177.752,189.42,0],"to":[4.333,-25,0],"ti":[-25.667,-23.333,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":90,"s":[359.752,189.42,0],"to":[25.667,23.333,0],"ti":[4.667,-23.333,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":121,"s":[331.752,329.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":134,"s":[331.752,329.42,0],"to":[-28.333,4.667,0],"ti":[28.333,-4.667,0]},{"i":{"x":0.667,"y":0.667},"o":{"x":0.167,"y":0.167},"t":164,"s":[161.752,357.42,0],"to":[0,0,0],"ti":[0,0,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":183,"s":[161.752,357.42,0],"to":[0,-24.333,0],"ti":[-28.667,3,0]},{"i":{"x":0.667,"y":1},"o":{"x":0.167,"y":0},"t":219,"s":[161.752,211.42,0],"to":[28.667,-3,0],"ti":[-28.667,-21.333,0]},{"t":272,"s":[333.752,339.42,0]}],"ix":2},"a":{"a":0,"k":[87.194,86.29,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"glass 2","parent":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":20,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"glass","parent":1,"td":1,"refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[68.687,68.686,0],"ix":2},"a":{"a":0,"k":[42.065,42.066,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":0,"nm":"paper","tt":1,"refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[125,125,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":5,"ty":0,"nm":"paper","refId":"comp_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[250,250,0],"ix":2},"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"w":500,"h":500,"ip":0,"op":750,"st":0,"bm":0}]},{"id":"comp_1","layers":[{"ddd":0,"ind":1,"ty":2,"nm":"paper_1","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[263.625,231.897,0],"ix":2},"a":{"a":0,"k":[92.771,120.853,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"paper_2","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[214.478,258.49,0],"ix":2},"a":{"a":0,"k":[107.933,130,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":750,"st":0,"bm":0}]}]'),layers:[{ddd:0,ind:1,ty:0,nm:"not_found 2",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[250,250,0],ix:2},a:{a:0,k:[250,250,0],ix:1},s:{a:0,k:[100,100,100],ix:6}},ao:0,w:500,h:500,ip:0,op:273,st:0,bm:0}],markers:[]},lS={key:0,class:"inline-block"},li=Dt(e.defineComponent({name:"DCodeBadge",inheritAttrs:!1,__name:"DCodeBadge",props:{text:{default:""},variant:{default:"default"},size:{default:"sm"},icon:{},dot:{type:Boolean,default:!1},pill:{type:Boolean,default:!1},color:{},skeleton:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},class:{}},setup(t){const n=t,o=e.computed(()=>n.icon?$t[n.icon]:null),r=e.computed(()=>n.visible??!0),a=e.computed(()=>{const f={xs:"px-1.5 py-0.5 text-[10px] gap-1",sm:"px-2.5 py-0.5 text-xs gap-1.5",md:"px-3 py-1 text-sm gap-2",lg:"px-4 py-1.5 text-base gap-2.5"};return f[n.size]||f.sm}),s=e.computed(()=>{const f={xs:"w-1 h-1",sm:"w-1.5 h-1.5",md:"w-2 h-2",lg:"w-2.5 h-2.5"};return f[n.size]||f.sm}),i=e.computed(()=>{const f={xs:"w-2.5 h-2.5",sm:"w-3 h-3",md:"w-4 h-4",lg:"w-5 h-5"};return f[n.size]||f.sm}),l=e.computed(()=>{const f={default:"bg-primary text-primary-foreground border-transparent shadow hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground border-transparent hover:bg-secondary/80",destructive:"bg-destructive text-destructive-foreground border-transparent shadow hover:bg-destructive/80",success:"bg-success-500 text-white border-transparent shadow-sm hover:bg-success-600",warning:"bg-warning-500 text-white border-transparent shadow-sm hover:bg-warning-600",info:"bg-blue-500 text-white border-transparent shadow-sm hover:bg-blue-600",outline:"bg-transparent border-border text-foreground",tonal:"bg-primary/10 text-primary border-transparent hover:bg-primary/20",ghost:"bg-transparent text-muted-foreground border-transparent hover:bg-accent hover:text-accent-foreground",purple:"bg-purple-600 text-white border-transparent shadow-sm hover:bg-purple-700",pink:"bg-pink-600 text-white border-transparent shadow-sm hover:bg-pink-700",dark:"bg-gray-900 text-white border-transparent shadow-sm hover:bg-gray-950",light:"bg-gray-100 text-gray-900 border-gray-200 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-100 dark:border-gray-700"};return f[n.variant]||f.default}),c=e.computed(()=>({default:"bg-primary-foreground",secondary:"bg-secondary-foreground",destructive:"bg-destructive-foreground",success:"bg-white",warning:"bg-white",info:"bg-white",outline:"bg-primary",tonal:"bg-primary",ghost:"bg-muted-foreground"})[n.variant]||"bg-current"),d=e.computed(()=>{const f={xs:"h-4 w-10",sm:"h-5 w-14",md:"h-6 w-18",lg:"h-7 w-24"};return ve(f[n.size]||f.sm,"rounded animate-pulse bg-muted")}),u=e.computed(()=>ve("inline-flex items-center font-semibold border transition-all duration-300 select-none focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",n.pill?"rounded-full":"rounded-md",a.value,l.value,n.class));return(f,m)=>r.value?(e.openBlock(),e.createElementBlock("div",lS,[t.skeleton?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(d.value)},null,2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(u.value)},[t.dot?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["rounded-full animate-pulse",s.value,c.value])},null,2)):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),{key:1,class:e.normalizeClass(["flex-shrink-0",i.value]),"stroke-width":"2.5"},null,8,["class"])):e.createCommentVNode("",!0),e.renderSlot(f.$slots,"default",{},()=>[e.createElementVNode("span",null,e.toDisplayString(t.text),1)],!0)],2))])):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-42cc5d83"]]);var ka={exports:{}},cS=ka.exports,fu;function dS(){return fu||(fu=1,(function(t,n){(function(o,r){t.exports=r()})(cS,function(){Array.isArray||(Array.isArray=function(s){return Object.prototype.toString.call(s)==="[object Array]"});function o(s){for(var i=[],l=0,c=s.length;l<c;l++)i.indexOf(s[l])===-1&&i.push(s[l]);return i}var r={},a={"==":function(s,i){return s==i},"===":function(s,i){return s===i},"!=":function(s,i){return s!=i},"!==":function(s,i){return s!==i},">":function(s,i){return s>i},">=":function(s,i){return s>=i},"<":function(s,i,l){return l===void 0?s<i:s<i&&i<l},"<=":function(s,i,l){return l===void 0?s<=i:s<=i&&i<=l},"!!":function(s){return r.truthy(s)},"!":function(s){return!r.truthy(s)},"%":function(s,i){return s%i},log:function(s){return console.log(s),s},in:function(s,i){return!i||typeof i.indexOf>"u"?!1:i.indexOf(s)!==-1},cat:function(){return Array.prototype.join.call(arguments,"")},substr:function(s,i,l){if(l<0){var c=String(s).substr(i);return c.substr(0,c.length+l)}return String(s).substr(i,l)},"+":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)+parseFloat(i,10)},0)},"*":function(){return Array.prototype.reduce.call(arguments,function(s,i){return parseFloat(s,10)*parseFloat(i,10)})},"-":function(s,i){return i===void 0?-s:s-i},"/":function(s,i){return s/i},min:function(){return Math.min.apply(this,arguments)},max:function(){return Math.max.apply(this,arguments)},merge:function(){return Array.prototype.reduce.call(arguments,function(s,i){return s.concat(i)},[])},var:function(s,i){var l=i===void 0?null:i,c=this;if(typeof s>"u"||s===""||s===null)return c;for(var d=String(s).split("."),u=0;u<d.length;u++)if(c==null||(c=c[d[u]],c===void 0))return l;return c},missing:function(){for(var s=[],i=Array.isArray(arguments[0])?arguments[0]:arguments,l=0;l<i.length;l++){var c=i[l],d=r.apply({var:c},this);(d===null||d==="")&&s.push(c)}return s},missing_some:function(s,i){var l=r.apply({missing:i},this);return i.length-l.length>=s?[]:l}};return r.is_logic=function(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)&&Object.keys(s).length===1},r.truthy=function(s){return Array.isArray(s)&&s.length===0?!1:!!s},r.get_operator=function(s){return Object.keys(s)[0]},r.get_values=function(s){return s[r.get_operator(s)]},r.apply=function(s,i){if(Array.isArray(s))return s.map(function(x){return r.apply(x,i)});if(!r.is_logic(s))return s;var l=r.get_operator(s),c=s[l],d,u,f,m,h;if(Array.isArray(c)||(c=[c]),l==="if"||l=="?:"){for(d=0;d<c.length-1;d+=2)if(r.truthy(r.apply(c[d],i)))return r.apply(c[d+1],i);return c.length===d+1?r.apply(c[d],i):null}else if(l==="and"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),!r.truthy(u))return u;return u}else if(l==="or"){for(d=0;d<c.length;d+=1)if(u=r.apply(c[d],i),r.truthy(u))return u;return u}else{if(l==="filter")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.filter(function(x){return r.truthy(r.apply(f,x))}):[];if(l==="map")return m=r.apply(c[0],i),f=c[1],Array.isArray(m)?m.map(function(x){return r.apply(f,x)}):[];if(l==="reduce")return m=r.apply(c[0],i),f=c[1],h=typeof c[2]<"u"?r.apply(c[2],i):null,Array.isArray(m)?m.reduce(function(x,g){return r.apply(f,{current:g,accumulator:x})},h):h;if(l==="all"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(!r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="none"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!0;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!1;return!0}else if(l==="some"){if(m=r.apply(c[0],i),f=c[1],!Array.isArray(m)||!m.length)return!1;for(d=0;d<m.length;d+=1)if(r.truthy(r.apply(f,m[d])))return!0;return!1}}if(c=c.map(function(x){return r.apply(x,i)}),a.hasOwnProperty(l)&&typeof a[l]=="function")return a[l].apply(i,c);if(l.indexOf(".")>0){var p=String(l).split("."),k=a;for(d=0;d<p.length;d++){if(!k.hasOwnProperty(p[d]))throw new Error("Unrecognized operation "+l+" (failed at "+p.slice(0,d+1).join(".")+")");k=k[p[d]]}return k.apply(i,c)}throw new Error("Unrecognized operation "+l)},r.uses_data=function(s){var i=[];if(r.is_logic(s)){var l=r.get_operator(s),c=s[l];Array.isArray(c)||(c=[c]),l==="var"?i.push(c[0]):c.forEach(function(d){i.push.apply(i,r.uses_data(d))})}return o(i)},r.add_operation=function(s,i){a[s]=i},r.rm_operation=function(s){delete a[s]},r.rule_like=function(s,i){if(i===s||i==="@")return!0;if(i==="number")return typeof s=="number";if(i==="string")return typeof s=="string";if(i==="array")return Array.isArray(s)&&!r.is_logic(s);if(r.is_logic(i)){if(r.is_logic(s)){var l=r.get_operator(i),c=r.get_operator(s);if(l==="@"||l===c)return r.rule_like(r.get_values(s,!1),r.get_values(i,!1))}return!1}if(Array.isArray(i))if(Array.isArray(s)){if(i.length!==s.length)return!1;for(var d=0;d<i.length;d+=1)if(!r.rule_like(s[d],i[d]))return!1;return!0}else return!1;return!1},r})})(ka)),ka.exports}var uS=dS();const tn=sl(uS),fS={class:"dcode-card animate-slide-up"},mS={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"},hS={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between items-start gap-4"},pS={key:0,class:"flex flex-col sm:flex-row items-start sm:items-center gap-2 flex-1 xl:max-w-[15vw] md:max-w-[20vw] max-w-[30vw]"},gS={class:"relative w-full sm:w-64"},bS={key:0,class:"relative"},yS={class:"flex flex-col h-full"},xS={key:0,class:"flex-1 overflow-y-auto py-4"},kS={class:"grid grid-cols-1 gap-4 px-1"},wS={key:0,class:"sticky bottom-0 left-0 right-0 bg-transparent border-t border-neutral-200 dark:border-neutral-700 pt-4 flex gap-2"},CS={class:"flex justify-end gap-2 w-full"},ES={key:0,class:"font-medium text-sm text-neutral-600 dark:text-neutral-400"},BS={class:"overflow-auto custom-scrollbar relative max-h-[calc(100vh-17rem)]"},_S={class:"dcode-table w-full"},SS={class:"bg-primary-700 dark:bg-primary-900 sticky top-0 z-20 shadow-sm"},VS=["onClick"],AS={key:0,class:"flex items-center justify-center w-full"},DS={key:0,class:"px-3 py-2 text-xs font-medium text-white dark:text-neutral-100 uppercase tracking-wider"},NS={class:"bg-white dark:bg-zinc-900 divide-y divide-neutral-200 dark:divide-neutral-700"},MS={key:0,class:"px-3 py-0.5"},TS={key:1},PS=["colspan"],OS={class:"flex flex-col items-center gap-2"},vS={class:"text-base font-medium text-neutral-700 dark:text-neutral-300"},FS={class:"text-sm text-neutral-500 dark:text-neutral-400 mt-1"},zS={class:"hover:bg-zinc-50 dark:hover:bg-zinc-800/50 transition-colors duration-150"},RS={key:0,class:"flex items-center justify-center"},IS={key:0,class:"px-3 py-0.5 !text-center"},LS={key:0,class:"flex items-center justify-center gap-1.5"},$S={key:0,class:"bg-zinc-50/50 dark:bg-zinc-800/30"},jS=["colspan"],US={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"},WS={class:"flex items-center gap-4"},HS={class:"text-xs text-neutral-500 dark:text-neutral-400 font-medium"},qS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},GS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},XS={class:"text-neutral-900 dark:text-neutral-100 font-medium"},KS={class:"flex-shrink-0"},YS={class:"space-y-4"},JS={class:"text-gray-600 dark:text-gray-400"},QS={class:"grid grid-cols-1 gap-4 py-4 px-1"},ZS={key:0,class:"mb-2 p-3 bg-amber-50 dark:bg-amber-900/20 border border-amber-100 dark:border-amber-900/30 rounded-lg flex items-center gap-3"},eV={class:"p-1.5 bg-amber-100 dark:bg-amber-900/40 rounded-md text-amber-600 dark:text-amber-400"},tV={class:"flex flex-col gap-0.5"},nV={class:"text-[10px] font-bold uppercase tracking-wider text-amber-500/70 dark:text-amber-400/50"},oV={class:"text-xs text-amber-700 dark:text-amber-300 leading-relaxed font-medium transition-all"},rV={class:"flex items-end gap-2"},Co=e.defineComponent({name:"DataTable",__name:"DataTable",props:{columns:{default:()=>[]},data:{default:()=>[]},perPage:{default:10},loading:{type:Boolean,default:!1},hasActions:{type:Boolean,default:!1},nested:{type:Boolean,default:!1},apiModule:{},apiAction:{default:"list"},apiMethod:{},apiUrl:{},permissionBase:{},apiParams:{default:()=>({})},configKey:{},tableConfig:{},dynamicColumns:{type:Boolean,default:!1},searchApiEndpoint:{},enableQuickSearch:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},ignorePermissions:{type:Boolean,default:!1},userPermissions:{default:null},permissionChecker:{type:Function,default:void 0},permissions:{default:void 0},checkPermission:{type:Function,default:void 0},menuPermissions:{default:()=>[]},dummyMode:{type:Boolean,default:!1},baseUrl:{default:void 0}},emits:["update:search","update:sort","update:page","create","export","action","update:selection","navigate"],setup(t,{expose:n,emit:o}){var Ct,yn,So,vn,nn,xn;tn.add_operation("length",A=>A==null?0:typeof A=="string"||Array.isArray(A)?A.length:typeof A=="number"?String(A).length:typeof A=="object"?Object.keys(A).length:0),tn.add_operation("==",(A,R)=>A!==null&&typeof A=="object"&&"_isLogicValue"in A?A.id==R||A.code==R:R!==null&&typeof R=="object"&&"_isLogicValue"in R?R.id==A||R.code==A:A==R),tn.add_operation("!=",(A,R)=>A!==null&&typeof A=="object"&&"_isLogicValue"in A?!(A.id==R||A.code==R):R!==null&&typeof R=="object"&&"_isLogicValue"in R?!(R.id==A||R.code==A):A!=R);const r=t,a=o,s=e.getCurrentInstance(),{apiUrl:i}=ct(),{locale:l}=vt.useI18n();let c={query:{},params:{},path:""};try{const A=Fn.useRoute();A?c=A:(So=(yn=(Ct=s==null?void 0:s.appContext)==null?void 0:Ct.config)==null?void 0:yn.globalProperties)!=null&&So.$route&&(c=s.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let d={back:()=>console.warn("Router back() not available"),push:A=>{console.warn("Router push() logic called from fallback:",A),typeof A=="string"&&A.startsWith("/")&&(window.location.href=A)}};try{const A=Fn.useRouter();A?d=A:(xn=(nn=(vn=s==null?void 0:s.appContext)==null?void 0:vn.config)==null?void 0:nn.globalProperties)!=null&&xn.$router&&(d=s.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const u=e.ref(""),f=e.ref(1),m=e.ref(r.perPage),h=e.ref({key:"",direction:"asc"}),p=e.ref([]),k=e.ref(!1),x=e.ref(0),g=e.ref({}),S=e.ref([]),B=e.ref(null),E=e.ref(!0),_=e.ref([]),w=e.ref([]),y=e.ref([]),b=e.ref(!1),C=e.ref(!1),V=e.ref({}),D=e.ref(null),N=e.ref(null),P=e.ref(null),M=e.ref([]),X=e.computed(()=>{if(q.value.length===0)return!1;const A=q.value.map(R=>{const ee=Y.value.find(j=>j.type==="CHECKBOX"),F=(ee==null?void 0:ee.keyCheckbox)||"id";return R[F]}).filter(R=>R!=null);return A.length===0?!1:A.every(R=>M.value.includes(R))}),$=e.computed(()=>{if(q.value.length===0)return!1;const A=Y.value.find(j=>j.type==="CHECKBOX"),R=(A==null?void 0:A.keyCheckbox)||"id",ee=q.value.map(j=>j[R]).filter(j=>j!=null),F=ee.filter(j=>M.value.includes(j)).length;return F>0&&F<ee.length}),H=A=>{const R=Y.value.find(j=>j.type==="CHECKBOX"),ee=(R==null?void 0:R.keyCheckbox)||"id",F=A[ee];return F!==void 0&&M.value.includes(F)},J=A=>{const R=Y.value.find(j=>j.type==="CHECKBOX"),ee=(R==null?void 0:R.keyCheckbox)||"id",F=q.value.map(j=>j[ee]).filter(j=>j!=null);if(A){const j=new Set([...M.value,...F]);M.value=Array.from(j)}else M.value=M.value.filter(j=>!F.includes(j))},te=(A,R)=>{const ee=Y.value.find(oe=>oe.type==="CHECKBOX"),F=(ee==null?void 0:ee.keyCheckbox)||"id",j=A[F];j!=null&&(R?M.value.includes(j)||M.value.push(j):M.value=M.value.filter(oe=>oe!==j))};e.watch(M,A=>{var ee;a("update:selection",A);const R=X.value||A.length>1;(ee=w.value)!=null&&ee.length&&w.value.forEach(F=>{var j;(j=F.fieldActionGlobal)!=null&&j.length&&F.fieldActionGlobal.forEach(oe=>{var De,qe;const be=F.endpoint||((De=F.propsActionGlobal)==null?void 0:De.endpointPropAction)||F.propsActionGlobal,Ve=(qe=be==null?void 0:be.keyParam)==null?void 0:qe[0];(Ve&&oe.model===Ve||!Ve&&/^(id|ids|idAuditTrail)/i.test(oe.model))&&R&&oe.model&&(V.value[oe.model]=A)})})},{deep:!0});const T=A=>Array.from({length:A}).map((R,ee)=>{const F={id:ee+1,no:ee+1};return Y.value.forEach(j=>{j.key!=="no"&&j.key!=="action"&&j.type!=="ACTION"&&j.type!=="action"&&(j.type==="CHECKBOX"?F[j.keyCheckbox||"id"]=ee+1:j.type==="BADGE"||j.type==="badge"||j.condition?F[j.key]=j.condition&&j.condition.length>0?j.condition[0].value:"Active":F[j.key]=`Data ${j.label} ${ee+1}`)}),F}),L=A=>A&&typeof A=="string"&&A.trim()?A:void 0,Z=e.computed(()=>{var A,R,ee,F;return L((R=(A=B.value)==null?void 0:A.endpoint)==null?void 0:R.apiModule)||L((F=(ee=B.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiModule)||r.apiModule}),Q=e.computed(()=>{var A,R,ee,F;return L((R=(A=B.value)==null?void 0:A.endpoint)==null?void 0:R.apiAction)||L((F=(ee=B.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiAction)||r.apiAction}),W=e.computed(()=>{var A,R,ee,F;return L((R=(A=B.value)==null?void 0:A.endpoint)==null?void 0:R.apiMethod)||L((F=(ee=B.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiMethod)||r.apiMethod||"POST"}),ie=e.computed(()=>{var A,R,ee,F;return L((R=(A=B.value)==null?void 0:A.endpoint)==null?void 0:R.apiUrl)||L((F=(ee=B.value)==null?void 0:ee.endpointGlobal)==null?void 0:F.apiUrl)||r.apiUrl}),de=e.computed(()=>r.permissionBase||""),Ce=e.computed(()=>!y.value||y.value.length===0?[]:[...y.value].sort((A,R)=>(A.seq||0)-(R.seq||0))),Ne=A=>{var oe,be,Ve;const R=(A==null?void 0:A.column)||((oe=A==null?void 0:A.props)==null?void 0:oe.column)||((be=A==null?void 0:A.propsFieldGlobal)==null?void 0:be.column)||((Ve=A==null?void 0:A.propsFieldCustom)==null?void 0:Ve.column);if(!R)return"col-span-1";const ee=R.toLowerCase(),j={full:"col-span-1 md:col-span-2",half:"col-span-1",third:"col-span-1","two-thirds":"col-span-1 md:col-span-2",two_thirds:"col-span-1 md:col-span-2"}[ee]||"col-span-1";return console.log(`[DEBUG] getColumnClass for ${A==null?void 0:A.model}: type=${R}, returned=${j}`),j},ge=()=>{let A=null;if(r.tableConfig&&(A=r.tableConfig),A){B.value=A,A.headers&&(S.value=A.headers.map(F=>{var be,Ve,Ae,De,qe,Oe,je,Pt,on,Ba;if(F.key==="action"||((be=F.custom)==null?void 0:be.type)==="ACTION"||((Ve=F.custom)==null?void 0:Ve.type)==="action"){const Ot=((Ae=F.custom)==null?void 0:Ae.actionCustom)||((De=F.custom)==null?void 0:De.action);return Ot&&(_.value=Ot.map(Lt=>{const it=Lt.propsActionCustom||Lt.props||{},_a=Lt.propCustomMessage||{};return{permission:Lt.permission,label:l.value==="id"?it.labelID:it.labelEN,tooltip:l.value==="id"?it.tooltipID||it.labelID:it.tooltipEN||it.labelEN,icon:it.icon,variant:it.variant||"ghost",bgColor:it.bgColor,action:it.actionType||it.key,route:it.route,path:it.path,endpoint:it.endpointPropAction,requiredCondition:Lt.requiredCondition||!1,propCustomCondition:Lt.propCustomCondition||[],fieldMapping:Lt.fieldMapping||it.fieldMapping||null,openDialog:Lt.openDialog||!1,fieldActionCustom:(Lt.fieldActionCustom||[]).map(Sa=>{const mi=Sa.propsFieldCustom||Sa.propsFieldGlobal||Sa.props||{};return{...Sa,props:{...mi,endpoint:mi.endpointComponent||mi.endpoint}}}),condition:Lt.visibleRule||Lt.propCustomCondition||it.visibleRule||it.propCustomCondition||null,requireConfirm:Lt.requireConfirm||it.requireConfirm||!1,confirmTitle:l.value==="id"?_a.titleID||it.confirmTitleID||"Konfirmasi":_a.titleEN||it.confirmTitleEN||"Confirm",confirmMessage:l.value==="id"?_a.messageID||it.confirmMessageID||"Apakah Anda yakin?":_a.messageEN||it.confirmMessageEN||"Are you sure?"}})),null}let j;const oe=((qe=F.custom)==null?void 0:qe.conditionBadge)||((Oe=F.custom)==null?void 0:Oe.condition);return(((je=F.custom)==null?void 0:je.type)==="BADGE"||((Pt=F.custom)==null?void 0:Pt.type)==="badge")&&oe&&(j=oe.map(Ot=>({value:Ot.value,label:l.value==="id"?Ot.labelID:Ot.labelEN,labelID:Ot.labelID,labelEN:Ot.labelEN,color:Ot.color||Ot.bgColor,variant:Ot.variant,logic:Ot.logic||Ot.conditionRule||null}))),{key:F.key,label:l.value==="id"?F.labelID:F.labelEN,width:F.width,align:F.align,sortable:!0,type:(on=F.custom)==null?void 0:on.type,condition:j,keyCheckbox:(Ba=F.custom)==null?void 0:Ba.keyCheckbox}}).filter(F=>F!==null));const R=A.filters||A.filter;R&&Array.isArray(R)&&(y.value=R.map(F=>({...F,props:F.propsFilters||F.props||{}})),y.value.forEach(F=>{g.value[F.model]=""}));const ee=A.actionTableGlobal||A.actionGlobal||A.action;console.log("[DEBUG] loadConfig rawActions:",ee),ee&&Array.isArray(ee)?(w.value=ee.map(F=>{const j=F.propsActionGlobal||F.props||{};return{key:j.key,permission:F.permission,label:l.value==="id"?j.labelID||"Action":j.labelEN||"Action",tooltip:l.value==="id"?j.tooltipID||j.labelID:j.tooltipEN||j.labelEN,icon:j.icon,variant:j.variant||"default",bgColor:j.bgColor,textColor:j.textColor,route:j.route,path:j.path,endpoint:j.endpointPropAction||F.endpoint,fieldMapping:F.fieldMapping||j.fieldMapping||null,visibleRule:F.visibleRule||j.visibleRule||F.propCustomCondition||j.propCustomCondition||null,openDialog:F.openDialog||!1,fieldActionGlobal:(F.fieldActionGlobal||F.field||[]).map(oe=>{const be=oe.propsFieldGlobal||oe.props||{};return{...oe,props:{...be,endpoint:be.endpointComponent||be.endpoint}}})}}),console.log("[DEBUG] loadConfig headerActions set:",w.value)):console.log("[DEBUG] loadConfig no rawActions found"),A.pagination!==void 0&&(E.value=A.pagination)}};e.watch(()=>r.tableConfig,()=>{ge()},{deep:!0,immediate:!0});const Y=e.computed(()=>r.dynamicColumns||r.configKey||r.tableConfig?S.value:r.columns||[]),v=e.computed(()=>r.hasActions||_.value.length>0),K=e.computed(()=>r.dummyMode?!1:Z.value||ie.value?k.value:r.loading),re=e.computed(()=>!!Z.value||!!ie.value),_e=e.computed(()=>[]),Re=A=>{if(console.log("[DEBUG] hasAction called:",{actionCode:A,permissionChecker:!!r.permissionChecker,effectivePath:de.value}),r.menuPermissions&&r.menuPermissions.length>0){const R=c.path,ee=r.menuPermissions.find(F=>R.startsWith(F.path));if(ee&&ee.actions){const F=ee.actions.find(j=>j.code===A.toUpperCase());return F?F.checked:!1}return!1}if(r.permissionChecker){const R=r.permissionChecker(de.value,A);return console.log("[DEBUG] permissionChecker result:",R),R}return _e.value.some(R=>R.code===A)},ze=(A,R)=>{if(A.condition)try{return tn.apply(A.condition,R)}catch(be){return console.warn("Row action jsonLogic error:",be),!1}if(!A.visibilityCondition)return!0;const{field:ee,operator:F,value:j}=A.visibilityCondition,oe=Me(R,ee);switch(F){case"equals":return oe===j;case"notEquals":return oe!==j;case"in":return Array.isArray(j)&&j.includes(oe);case"notIn":return Array.isArray(j)&&!j.includes(oe);case"greaterThan":return oe>j;case"lessThan":return oe<j;case"contains":return String(oe).includes(String(j));default:return!0}},He=e.computed(()=>{if(console.log("[DEBUG] visibleHeaderActions:",{headerActions:w.value,ignorePermissions:r.ignorePermissions}),w.value.length===0)return w.value;const A=w.value.filter(R=>{if(R.visibleRule)try{const F=q.value[0]||{};if(!tn.apply(R.visibleRule,F))return!1}catch(F){console.warn("Header action visibility logic error:",F)}if(r.ignorePermissions)return!0;if(!R.permission)return console.log("[DEBUG] Action no permission, showing:",R.label),!0;if(r.checkPermission){const F=r.checkPermission(R.permission);return console.log("[DEBUG] Parent checkPermission result:",F),F}if(r.permissions){const F=r.permissions.includes(R.permission);return console.log("[DEBUG] Parent permissions check result:",F),F}const ee=Re(R.permission);return console.log("[DEBUG] Internal permission check:",{label:R.label,permission:R.permission,hasPerm:ee}),ee});return console.log("[DEBUG] Filtered header actions:",A.length),A}),Xe=e.computed(()=>_.value.length===0?_.value:_.value.filter(A=>r.ignorePermissions||!A.permission?!0:r.checkPermission?r.checkPermission(A.permission):r.permissions?r.permissions.includes(A.permission):Re(A.permission))),ot=A=>Xe.value.filter(R=>ze(R,A)),Ie=(A,R)=>{var j,oe;if(A.requiredCondition&&((j=A.propCustomCondition)==null?void 0:j.length)>0){const be=Me(R,"status"),Ve=A.propCustomCondition.find(Ae=>Ae.value===be);if(Ve)return Ve.bgColor||A.bgColor||"primary"}if(!A.dynamicColor||!A.colorCondition)return A.bgColor||"primary";const ee=Me(R,A.colorCondition.field),F=(oe=A.colorCondition.conditions)==null?void 0:oe.find(be=>be.value===ee);return(F==null?void 0:F.bgColor)||A.bgColor||"primary"},mt=A=>{const R=(A||"left").toLowerCase();return R==="center"?"justify-center":R==="right"?"justify-end":"justify-start"},pt={ToggleLeft:le.ToggleLeft,SquarePen:le.SquarePen,Trash2:le.Trash2,Eye:le.Eye,CheckCircle:le.CheckCircle,Plus:le.Plus,Download:le.Download,RefreshCw:le.RefreshCw,Search:le.Search,SlidersHorizontal:le.SlidersHorizontal},Tt=A=>A?$t[A]?$t[A]:pt[A]||null:null,q=e.computed(()=>r.dummyMode?Y.value.length>0?T(10):[]:re.value?p.value.map((A,R)=>({...A,no:(f.value-1)*m.value+R+1})):he.value),ue=e.computed(()=>r.dummyMode?10:re.value?x.value:ne.value.length),Ee=e.computed(()=>ue.value===0?0:(f.value-1)*m.value+1),Ue=e.computed(()=>{const A=f.value*m.value;return A>ue.value?ue.value:A}),Me=(A,R)=>{if(!(!A||!R))return R in A?A[R]:R.split(".").reduce((ee,F)=>ee&&ee[F],A)},ne=e.computed(()=>{if(re.value)return[];if(!u.value)return r.data;const A=u.value.toLowerCase();return r.data.filter(R=>Y.value.some(ee=>{const F=Me(R,ee.key);return F==null?!1:String(F).toLowerCase().includes(A)}))}),ce=e.computed(()=>re.value?[]:h.value.key?[...ne.value].sort((R,ee)=>{const F=Me(R,h.value.key),j=Me(ee,h.value.key);if(F===j)return 0;let oe=0;return typeof F=="number"&&typeof j=="number"?oe=F-j:oe=String(F).localeCompare(String(j)),h.value.direction==="asc"?oe:-oe}):ne.value),he=e.computed(()=>{if(re.value)return[];const A=(f.value-1)*m.value,R=A+m.value;return ce.value.slice(A,R).map((ee,F)=>({...ee,no:A+F+1}))}),Se=e.computed(()=>re.value?Object.values(g.value).some(A=>!!A):!!u.value),et=[10,25,50,100],St=()=>{re.value&&(g.value={...g.value,keyword:u.value},f.value=1,gt())};let bn;const Eo=()=>{r.enableQuickSearch&&(clearTimeout(bn),bn=setTimeout(()=>{St()},500))};let Bo;const Ca=()=>{clearTimeout(Bo),Bo=setTimeout(()=>{re.value&>()},1e3)};e.watch(u,()=>{r.enableQuickSearch&&re.value&&Eo()});const gt=async()=>{if(!r.dummyMode&&re.value&&!(!Z.value&&!ie.value))try{k.value=!0;const A={page:f.value,perPage:m.value,...g.value,...r.apiParams};u.value&&(A.keyword=u.value),Object.keys(A).forEach(ee=>{(A[ee]===""||A[ee]===null||A[ee]===void 0)&&delete A[ee]});let R;if(Z.value)R=await i(Z.value,Q.value,A);else if(ie.value){let ee=ie.value;if(r.baseUrl&&typeof ee=="string"&&!ee.startsWith("http")){const F=r.baseUrl.replace(/\/$/,""),j=ee.startsWith("/")?ee:`/${ee}`;ee=`${F}${j}`}R=await i(ee,W.value,A)}sr(R)}catch(A){console.error("DataTable fetch error",A),k.value=!1}},sr=A=>{console.log("DataTable handleResponseData:",A),A&&(r.dynamicColumns&&A.columns&&Array.isArray(A.columns)&&(S.value=A.columns.map(R=>({key:R.key||R.field||R.name,label:R.label||R.header||R.name,width:R.width,align:R.align||"LEFT",sortable:R.sortable!==!1,type:R.type,condition:R.condition,format:R.format}))),A.data&&Array.isArray(A.data)?(p.value=A.data,A.totalData?x.value=A.totalData:A.maxPage?x.value=A.maxPage*m.value:x.value=A.data.length*(A.maxPage||1)):Array.isArray(A)?(p.value=A,x.value=A.length):A.users?(p.value=A.users,x.value=A.users.length):A.items&&Array.isArray(A.items)?(p.value=A.items,x.value=A.total||A.totalItems||A.items.length):A.list&&Array.isArray(A.list)?(p.value=A.list,x.value=A.total||A.list.length):A.rows&&Array.isArray(A.rows)?(p.value=A.rows,x.value=A.count||A.total||A.rows.length):A.result&&Array.isArray(A.result)?(p.value=A.result,x.value=A.total||A.count||A.result.length):(console.warn("DataTable: Unknown response format",A),p.value=[],x.value=0)),k.value=!1};e.onUnmounted(()=>{clearTimeout(bn),clearTimeout(Bo)});const _o=()=>{Object.keys(g.value).forEach(A=>{g.value[A]=""}),u.value="",f.value=1,gt()},Ea=()=>{f.value=1,gt()},eo=(A,R)=>{const ee=Me(A,R.key);let F={variant:"secondary",class:"",label:ee};if(R.condition){const j=R.condition.find(oe=>{if(oe.logic||typeof oe.value=="object"&&oe.value!==null)try{const Ve=oe.logic||oe.value;return tn.apply(Ve,A)}catch(Ve){return console.warn("Badge logic error:",Ve),!1}const be=(Ve,Ae)=>Ve==null||Ae===void 0||Ae===null?!1:typeof Ve=="string"&&typeof Ae=="string"?Ve.toLowerCase().trim()===Ae.toLowerCase().trim():Ve==Ae;if(be(oe.value,ee)||typeof ee=="object"&&ee!==null&&(be(oe.value,ee.code)||be(oe.value,ee.id)))return!0;if(R.key.includes(".")){const Ae=R.key.split(".").slice(0,-1).join("."),De=Me(A,Ae);if(De&&typeof De=="object"&&(be(oe.value,De.code)||be(oe.value,De.id)))return!0}return!1});if(j){j.variant&&(F.variant=j.variant);const be=(l.value||"en")==="id"?j.labelID:j.labelEN;if(F.label=be||j.label||(typeof ee=="object"?ee.name||ee.code:ee),j.color||j.bgColor){const Ve=(j.color||j.bgColor||"").toLowerCase(),Ae=F.variant==="outline",De={success:"bg-green-500 hover:bg-green-600 border-transparent text-white shadow",warning:"bg-yellow-500 hover:bg-yellow-600 border-transparent text-white shadow",info:"bg-blue-500 hover:bg-blue-600 border-transparent text-white shadow",primary:"bg-primary-600 hover:bg-primary-700 border-transparent text-white shadow",secondary:"bg-neutral-500 hover:bg-neutral-600 border-transparent text-white shadow",danger:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow",destructive:"bg-red-500 hover:bg-red-600 border-transparent text-white shadow"},qe={success:"text-green-600 border-green-600 hover:bg-green-50",warning:"text-yellow-600 border-yellow-600 hover:bg-yellow-50",info:"text-blue-600 border-blue-600 hover:bg-blue-50",danger:"text-red-600 border-red-600 hover:bg-red-50",destructive:"text-red-600 border-red-600 hover:bg-red-50",primary:"text-primary-600 border-primary-600 hover:bg-primary-50",secondary:"text-neutral-600 border-neutral-600 hover:bg-zinc-50"},Oe={danger:"destructive",destructive:"destructive",secondary:"secondary",primary:"default",success:"success",warning:"warning",info:"info"};Ae?qe[Ve]&&(F.class=qe[Ve]):Oe[Ve]?F.variant=Oe[Ve]:De[Ve]&&(F.class=De[Ve])}}else F.label=typeof ee=="object"?(ee==null?void 0:ee.name)||(ee==null?void 0:ee.code)||"-":ee}else F.label=typeof ee=="object"?(ee==null?void 0:ee.name)||(ee==null?void 0:ee.code)||"-":ee;return F},ir=A=>{h.value.key===A?h.value.direction=h.value.direction==="asc"?"desc":"asc":(h.value.key=A,h.value.direction="asc"),a("update:sort",h.value)},O=A=>{A!==f.value&&(f.value=A,re.value&>(),a("update:page",A))},U=A=>{m.value=A,f.value=1,re.value&>()},I=A=>{const R=Math.random()*15+75;if(A.width){const ee=parseInt(String(A.width));return ee<100?`${Math.floor(ee*(Math.random()*.2+.7))}px`:`${R}%`}return`${R}%`},z=()=>{u.value="",g.value={},f.value=1,gt()},G=A=>{var R;if(console.log("[DEBUG] handleHeaderAction called:",A),A.route&&!r.dummyMode){if(A.path){const ee=A.route.startsWith("/")?A.route:"/"+A.route;sessionStorage.setItem(`layout_${ee}`,A.path)}d==null||d.push(A.route)}else if(A.openDialog||r.dummyMode&&A.route){N.value=A,P.value=null,V.value={};const ee=A.fieldActionGlobal||A.field||[];ee.length&&ee.forEach(F=>{var be;const j=A.endpoint||((be=A.propsActionGlobal)==null?void 0:be.endpointPropAction)||A.propsActionGlobal,oe=j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null;oe&&F.model===oe||!oe&&/^(id|ids|idAuditTrail)/i.test(F.model)?V.value[F.model]=M.value:V.value[F.model]||(V.value[F.model]="")}),C.value=!0}else a("action",{action:((R=A.propsActionCustom)==null?void 0:R.key)||A.key||"create",row:null,selection:M.value})},se=async(A,R)=>{var ee,F,j,oe;if(A.requireConfirm){D.value={button:A,row:R},b.value=!0;return}if(A.openDialog){N.value=A,P.value=R,V.value={};const be=Y.value.find(De=>De.type==="CHECKBOX"),Ve=(be==null?void 0:be.keyCheckbox)||"id";A.fieldActionCustom&&A.fieldActionCustom.forEach(De=>{/^(id|ids|idAuditTrail)/i.test(De.model)?V.value[De.model]=[R[Ve]]:A.action==="showToken"&&De.model==="token"?V.value[De.model]=R.token!==void 0?R.token:"":R[De.model]!==void 0?V.value[De.model]=R[De.model]:V.value[De.model]=""});const Ae=A.endpoint||((ee=A.propsActionGlobal)==null?void 0:ee.endpointPropAction)||((F=A.propsActionCustom)==null?void 0:F.endpointPropAction)||((j=A.props)==null?void 0:j.endpointPropAction);if(((oe=Ae==null?void 0:Ae.apiMethod)==null?void 0:oe.toUpperCase())==="GET"&&Ae.apiUrl){k.value=!0;const{apiUrl:De}=ct(),qe={};Ae.keyParam&&Array.isArray(Ae.keyParam)&&Ae.keyParam.forEach((Oe,je)=>{const Pt=Ae.model&&je===0?Ae.model:Oe;R[Oe]!==void 0&&(qe[Pt]=R[Oe])}),Object.keys(qe).length===0&&R.id&&(qe.id=R.id),De(Ae.apiUrl,"GET",qe).then(Oe=>{let je=Oe;if(Oe&&Oe.data!==void 0?je=Oe.data:Oe&&Oe.result!==void 0&&(je=Oe.result),je!=null){if(typeof je=="string")V.value.hasOwnProperty("token")&&(V.value.token=je);else if(typeof je=="object"&&(je.item&&(je=je.item),Array.isArray(je)&&(je=je[0]||{}),Object.keys(je).forEach(Pt=>{V.value[Pt]=je[Pt]}),!V.value.token)){const Pt=Object.keys(je).find(on=>on.toLowerCase().includes("token"));if(Pt)V.value.token=je[Pt];else{const on=Object.values(je).filter(Ba=>typeof Ba=="string");on.length===1&&(V.value.token=on[0])}}}C.value=!0}).catch(Oe=>{console.error("Fetch Data Failed",Oe)}).finally(()=>{k.value=!1});return}C.value=!0;return}fe(A,R)},fe=(A,R)=>{if(A.route){if(A.path){const j=A.route.startsWith("/")?A.route:"/"+A.route;sessionStorage.setItem(`layout_${j}`,A.path)}let ee=A.route;ee.includes(":")?ee=ee.replaceAll(/:([a-zA-Z0-9_]+)/g,(j,oe)=>R[oe]||R.id||oe):R.id&&(ee=`${ee.replace(/\/$/,"")}/${R.id}`);const F={};A.path&&(F.code=A.path),d==null||d.push({path:ee,query:F})}else if(A.endpoint&&A.endpoint.apiUrl){k.value=!0;const{apiUrl:ee}=ct(),F=A.endpoint.apiUrl,j=A.endpoint.apiMethod||"POST",oe={},be=A.fieldMapping;if(be&&typeof be=="object"){const{locale:Ve}=vt.useI18n(),Ae=Ve.value||"en",De=[];if(Object.entries(be).forEach(([qe,Oe])=>{if(typeof Oe=="string"){const je=Me(R,qe);je!==void 0?oe[Oe]=je:(console.warn(`[MAPPING-DEBUG] No matching source found for '${qe}'`),De.push(qe))}}),De.length>0){const qe=Ae==="id"?"Masalah Sinkronisasi Data":"Data Synchronization Issue",Oe=Ae==="id"?`Terdapat ketidaksesuaian skema pada field: ${De.join(", ")}. Harap hubungi tim pengembang.`:`Schema mismatch detected in fields: ${De.join(", ")}. Please contact the development team.`;We.warning(`${qe}: ${Oe}`,{autoClose:5e3,position:"top-right"})}}if(Object.keys(oe).length===0){const Ve=A.endpoint;Ve.model&&Ve.keyParam&&Array.isArray(Ve.keyParam)?Ve.keyParam.forEach(Ae=>{const De=Me(R,Ae);De!==void 0&&(oe[Ve.model]=De)}):R.id&&(oe.id=R.id)}ee(F,j,oe).then(()=>{gt(),a("action",{action:A.action||"success",row:R})}).catch(Ve=>{console.error("Action Failed",Ve)}).finally(()=>{k.value=!1})}else a("action",{action:A.action,row:R})},me=()=>{D.value&&(fe(D.value.button,D.value.row),Le())},ae=()=>{var A,R,ee;if(N.value){const F=N.value,j=F.endpoint||((A=F.propsActionGlobal)==null?void 0:A.endpointPropAction)||F.propsActionGlobal;let oe=(j==null?void 0:j.model)||(j!=null&&j.keyParam&&j.keyParam.length>0?j.keyParam[0]:null);if(!oe){const De=(F.fieldActionGlobal||F.fieldActionCustom||F.field||[]).find(qe=>/^(id|ids|idAuditTrail)/i.test(qe.model));oe=De?De.model:"ids"}let be=null,Ve=!1;if(P.value){const Ae=Y.value.find(Oe=>Oe.type==="CHECKBOX"),De=(Ae==null?void 0:Ae.keyCheckbox)||"id",qe=P.value[De];if(j!=null&&j.apiUrl){be={...V.value};const Oe=F.fieldMapping;Oe&&typeof Oe=="object"&&Object.entries(Oe).forEach(([je,Pt])=>{if(typeof Pt=="string"){const on=Me(P.value,je);on!==void 0&&(be[Pt]=on)}}),be[oe]||(be[oe]=j!=null&&j.model?qe:[qe]),Ve=!0}}else j!=null&&j.apiUrl&&(be={...V.value},be[oe]||(be[oe]=M.value||[]),Ve=!0);if(Ve&&be&&(j!=null&&j.apiUrl)){if(((R=j==null?void 0:j.apiMethod)==null?void 0:R.toUpperCase())==="GET"){C.value=!1,P.value||(M.value=[]);return}const{apiUrl:Ae}=ct(),De=j.apiUrl,qe=j.apiMethod||"POST";Ae(De,qe,be).then(()=>{C.value=!1,P.value||(M.value=[]),gt(),a("action",{action:"success",row:null})}).catch(Oe=>{console.error("Action Failed",Oe)})}else if(P.value){const Ae=Y.value.find(je=>je.type==="CHECKBOX"),De=(Ae==null?void 0:Ae.keyCheckbox)||"id",qe=P.value[De],Oe={...V.value};Oe[oe]||(Oe[oe]=[qe]),a("action",{action:N.value.action,row:Oe}),C.value=!1}else{const Ae={...V.value};Ae[oe]||(Ae[oe]=M.value);const De={action:((ee=N.value.propsActionGlobal)==null?void 0:ee.key)||N.value.key,row:Ae,selection:M.value};a("action",De),C.value=!1}}},ke=A=>{const R=V.value[A];R&&R2(String(R)).then(()=>{We.success("Berhasil disalin!",{autoClose:2e3,theme:"dark",pauseOnHover:!1})}).catch(ee=>{console.error("Failed to copy",ee)})},Le=()=>{b.value=!1,D.value=null},tt=e.computed(()=>D.value?D.value.button.confirmTitle||"Confirm":""),at=e.computed(()=>D.value?D.value.button.confirmMessage||"Confirm":"");n({fetchData:gt,filters:g,resetFilters:_o,handleRefresh:z});const Ze=e.ref(""),wt=A=>{if(!A)return"";const R=A.endpoint||A.endpointGlobal||{};return JSON.stringify({url:R.apiUrl||A.apiUrl,module:R.apiModule||A.apiModule,action:R.apiAction||A.apiAction,method:R.apiMethod||A.apiMethod,params:A.apiParams,socket:R.socket||A.socketEndpoint,socketParams:A.socketParams})};return e.watch(()=>r.tableConfig,()=>{if(r.tableConfig){ge();const A=wt(r.tableConfig);A!==Ze.value&&(!Ze.value&&re.value?(Ze.value=A,gt()):(Ze.value=A,re.value&&Ca()))}},{deep:!0,immediate:!0}),e.watch(()=>r.apiModule,()=>{re.value&>()}),e.watch(()=>r.apiParams,()=>{re.value&>()},{deep:!0}),e.watch(()=>w.value,A=>{console.log("[DEBUG] headerActions changed:",A.length,"items");const R=He.value;console.log("[DEBUG] visibleHeaderActions evaluated:",R.length,"items")},{deep:!0}),e.onMounted(()=>{ge(),re.value&&(r.tableConfig||(k.value=!0,gt()))}),(A,R)=>{var ee;return e.openBlock(),e.createElementBlock("div",fS,[e.createElementVNode("div",mS,[e.createElementVNode("div",hS,[t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",pS,[e.createElementVNode("div",gS,[e.createVNode(e.unref(le.Search),{class:"absolute left-2.5 top-2.5 h-4 w-4 text-neutral-500 dark:text-neutral-400"}),e.createVNode(e.unref(K2),{modelValue:u.value,"onUpdate:modelValue":R[0]||(R[0]=F=>u.value=F),placeholder:"Search...",style:{"padding-left":"2.25rem !important"},class:"h-9 bg-white/95 dark:bg-zinc-800/95 border-white/30 dark:border-neutral-700/50 text-neutral-900 dark:text-neutral-100 placeholder:text-neutral-500 dark:placeholder:text-neutral-400",onKeyup:e.withKeys(St,["enter"])},null,8,["modelValue"])]),y.value.length>0?(e.openBlock(),e.createElementBlock("div",bS,[e.createVNode(q2,null,{trigger:e.withCtx(()=>[e.createVNode(Ke,{variant:"secondary",icon:"SlidersHorizontal",tooltip:"Advance Search",class:"gap-2 h-9 w-full sm:w-auto justify-center bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-zinc-50 dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium"})]),footer:e.withCtx(()=>[e.createElementVNode("div",CS,[e.renderSlot(A.$slots,"filter-footer",{fetch:gt,reset:_o})])]),default:e.withCtx(()=>[R[9]||(R[9]=e.createElementVNode("hr",{class:"border-neutral-200 dark:border-neutral-700"},null,-1)),e.createElementVNode("div",yS,[e.renderSlot(A.$slots,"filter-form",{filters:g.value},()=>[y.value.length>0?(e.openBlock(),e.createElementBlock("div",xS,[e.createElementVNode("div",kS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(F,j)=>(e.openBlock(),e.createElementBlock("div",{key:j,class:e.normalizeClass(Ne(F))},[e.createVNode(eu,{field:F,modelValue:g.value[F.model],"onUpdate:modelValue":oe=>g.value[F.model]=oe},null,8,["field","modelValue","onUpdate:modelValue"])],2))),128))])])):e.createCommentVNode("",!0)]),y.value.length>0?(e.openBlock(),e.createElementBlock("div",wS,[e.createVNode(Ke,{variant:"outline",text:"Reset",tooltip:"Reset",rounded:"md",icon:"RefreshCw",onClick:_o,disabled:K.value},null,8,["disabled"]),e.createVNode(Ke,{onClick:Ea,disabled:K.value,rounded:"md",text:"Search",tooltip:"Search",icon:"Search"},null,8,["disabled"])])):e.createCommentVNode("",!0)])]),_:3})])):e.createCommentVNode("",!0)])),e.createElementVNode("div",{class:e.normalizeClass(["flex items-center gap-2 flex-wrap",{"w-full justify-between":t.nested}])},[t.nested?(e.openBlock(),e.createElementBlock("span",ES)):e.createCommentVNode("",!0),t.nested?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ke,{key:1,variant:"secondary",icon:"RefreshCw",text:"Refresh",tooltip:"Refresh",class:"gap-2 h-9 bg-white/95 dark:bg-zinc-800/95 text-neutral-700 dark:text-neutral-300 hover:bg-white dark:hover:bg-zinc-800 border border-white/30 dark:border-neutral-700/50 shadow-sm backdrop-blur-sm text-xs font-medium",onClick:z,disabled:K.value},{icon:e.withCtx(()=>[e.createVNode(e.unref(le.RefreshCw),{class:e.normalizeClass(["w-3.5 h-3.5",{"animate-spin":K.value}])},null,8,["class"])]),_:1},8,["disabled"])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(F,j)=>(e.openBlock(),e.createBlock(Ke,{key:j,icon:F.icon,text:F.label,tooltip:F.tooltip,variant:F.variant,"bg-color":F.bgColor,"text-color":F.textColor,class:"gap-2 h-9 shadow-lg shadow-primary-500/20 border-none text-xs font-medium",onClick:oe=>G(F)},null,8,["icon","text","tooltip","variant","bg-color","text-color","onClick"]))),128)),e.renderSlot(A.$slots,"header-actions")],2)])]),e.createElementVNode("div",BS,[e.createElementVNode("table",_S,[e.createElementVNode("thead",SS,[e.createElementVNode("tr",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,F=>(e.openBlock(),e.createElementBlock("th",{key:F.key,class:e.normalizeClass([F.align?`text-${F.align.toLowerCase()}`:"text-left",F.sortable?"cursor-pointer select-none":"","px-3 py-2 text-xs font-black text-white dark:text-neutral-100 uppercase tracking-wider transition-colors duration-150"]),style:e.normalizeStyle(F.width?{width:F.width}:{}),onClick:j=>F.sortable&&ir(F.key)},[F.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",AS,[e.createVNode(gn,{"model-value":X.value,indeterminate:$.value,"onUpdate:modelValue":R[1]||(R[1]=j=>J(!!j)),onClick:R[2]||(R[2]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","indeterminate"])])):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-2 w-full",mt(F.align)])},[e.createElementVNode("span",null,e.toDisplayString(F.label),1)],2))],14,VS))),128)),v.value?(e.openBlock(),e.createElementBlock("th",DS,[...R[10]||(R[10]=[e.createElementVNode("div",{class:"flex items-center justify-center w-full"}," Actions ",-1)])])):e.createCommentVNode("",!0)])]),e.createElementVNode("tbody",NS,[K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,F=>(e.openBlock(),e.createElementBlock("tr",{key:`skeleton-${F}`},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,j=>{var oe,be;return e.openBlock(),e.createElementBlock("td",{key:j.key,class:e.normalizeClass([j.align?`text-${j.align.toLowerCase()}`:"text-left","px-3 py-0.5"])},[e.createElementVNode("div",{class:e.normalizeClass(["bg-gradient-to-r from-neutral-200 via-neutral-300 to-neutral-200 dark:from-neutral-700 dark:via-neutral-600 dark:to-neutral-700 animate-shimmer",[["badge","BADGE"].includes(j.type??"")||j.condition?"h-5 rounded-full w-20":"h-4 rounded-md",((oe=j.align)==null?void 0:oe.toLowerCase())==="center"?"mx-auto":"",((be=j.align)==null?void 0:be.toLowerCase())==="right"?"ml-auto":""]]),style:e.normalizeStyle({width:["badge","BADGE"].includes(j.type??"")||j.condition?void 0:I(j),backgroundSize:"200% 100%"})},null,6)],2)}),128)),t.hasActions?(e.openBlock(),e.createElementBlock("td",MS,[...R[11]||(R[11]=[e.createElementVNode("div",{class:"flex items-center justify-center gap-1.5"},[e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-75"}),e.createElementVNode("div",{class:"w-9 h-9 bg-zinc-200 dark:bg-zinc-700 rounded-xl animate-pulse delay-150"})],-1)])])):e.createCommentVNode("",!0)]))),128)):q.value.length===0?(e.openBlock(),e.createElementBlock("tr",TS,[e.createElementVNode("td",{colspan:Y.value.length+(v.value?1:0),class:"text-center py-16"},[e.createElementVNode("div",OS,[e.createVNode(e.unref(wu.Vue3Lottie),{animationData:e.unref(iS),height:200,width:200},null,8,["animationData"]),e.createElementVNode("div",null,[e.createElementVNode("p",vS,e.toDisplayString(Se.value?"No search results":"No data"),1),e.createElementVNode("p",FS,e.toDisplayString(Se.value?"Try changing keywords":"No data added"),1)])])],8,PS)])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(q.value,(F,j)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:j},[e.createElementVNode("tr",zS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.value,oe=>(e.openBlock(),e.createElementBlock("td",{key:oe.key,class:e.normalizeClass([oe.align?`text-${oe.align.toLowerCase()}`:"text-left","px-3 py-0.5 text-sm text-neutral-900 dark:text-neutral-100"])},[e.renderSlot(A.$slots,`cell-${oe.key}`,{row:F,value:Me(F,oe.key)},()=>[oe.type==="CHECKBOX"?(e.openBlock(),e.createElementBlock("div",RS,[e.createVNode(gn,{"model-value":H(F),"onUpdate:modelValue":be=>te(F,!!be),onClick:R[3]||(R[3]=e.withModifiers(()=>{},["stop"]))},null,8,["model-value","onUpdate:modelValue"])])):oe.type==="badge"||oe.type==="BADGE"||oe.condition?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["flex items-center gap-1.5 flex-wrap md:flex-nowrap",[oe.align?`justify-${oe.align.toLowerCase()}`:"justify-start"]])},[e.createVNode(li,{variant:eo(F,oe).variant,class:e.normalizeClass([eo(F,oe).class,"whitespace-nowrap truncate max-w-[150px] inline-block"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(eo(F,oe).label),1)]),_:2},1032,["variant","class"])],2)):oe.key==="no"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createTextVNode(e.toDisplayString((f.value-1)*m.value+j+1),1)],64)):oe.type==="date"||oe.type==="DATE"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createTextVNode(e.toDisplayString(Me(F,oe.key)?e.unref(F2)(Me(F,oe.key),"long"):"-"),1)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createTextVNode(e.toDisplayString(oe.format?oe.format(Me(F,oe.key)):Me(F,oe.key)),1)],64))])],2))),128)),v.value?(e.openBlock(),e.createElementBlock("td",IS,[e.renderSlot(A.$slots,"actions",{row:F,buttons:ot(F),getButtonColor:Ie,getIconComponent:Tt},()=>[ot(F).length>0?(e.openBlock(),e.createElementBlock("div",LS,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot(F),(oe,be)=>(e.openBlock(),e.createElementBlock("div",{key:be,class:"group relative"},[e.createVNode(Ke,{tooltip:oe.tooltip||oe.label,icon:oe.icon,size:"icon",rounded:oe.rounded||"sm",borderStyle:oe.borderStyle||"none",variant:oe.variant||"ghost","bg-color":Ie(oe,F),onClick:Ve=>se(oe,F)},null,8,["tooltip","icon","rounded","borderStyle","variant","bg-color","onClick"])]))),128))])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),A.$slots["expanded-row"]?(e.openBlock(),e.createElementBlock("tr",$S,[e.createElementVNode("td",{colspan:Y.value.length+(v.value?1:0),class:"px-0 py-0"},[e.renderSlot(A.$slots,"expanded-row",{row:F,index:j})],8,jS)])):e.createCommentVNode("",!0)],64))),128))])])]),!K.value&&q.value.length>0&&t.showPagination&&E.value?(e.openBlock(),e.createElementBlock("div",US,[e.createElementVNode("div",WS,[e.createVNode(e.unref(r_),{"model-value":String(m.value),"onUpdate:modelValue":R[4]||(R[4]=F=>U(Number(F)))},{default:e.withCtx(()=>[e.createVNode(e.unref(d_),{class:"h-8 w-[70px] bg-white dark:bg-zinc-800 border-neutral-200 dark:border-neutral-700"},{default:e.withCtx(()=>[e.createVNode(e.unref(u_),{placeholder:String(m.value)},null,8,["placeholder"])]),_:1}),e.createVNode(e.unref(a_),null,{default:e.withCtx(()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(et,F=>e.createVNode(e.unref(i_),{key:F,value:String(F)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(F),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["model-value"]),R[16]||(R[16]=e.createElementVNode("div",{class:"h-5 w-px bg-zinc-300 dark:bg-zinc-600"},null,-1)),e.createElementVNode("span",HS,[R[12]||(R[12]=e.createTextVNode(" Showing ",-1)),e.createElementVNode("span",qS,e.toDisplayString(Ee.value),1),R[13]||(R[13]=e.createTextVNode(" to ",-1)),e.createElementVNode("span",GS,e.toDisplayString(Ue.value),1),R[14]||(R[14]=e.createTextVNode(" of ",-1)),e.createElementVNode("span",XS,e.toDisplayString(ue.value),1),R[15]||(R[15]=e.createTextVNode(" items ",-1))])]),e.createElementVNode("div",KS,[e.createVNode(e.unref(Y2),{total:ue.value,"items-per-page":m.value,"sibling-count":1,"show-edges":"",page:f.value,"onUpdate:page":O,class:"scale-90 origin-right"},{default:e.withCtx(()=>[e.createVNode(e.unref(J2),{class:"flex items-center gap-1"},{default:e.withCtx(({items:F})=>[e.createVNode(e.unref(Z2),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:opacity-50 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronsLeft),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(o_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronLeft),{class:"h-4 w-4"})]),_:1}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F,(j,oe)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[j.type==="page"?(e.openBlock(),e.createBlock(e.unref(e_),{key:oe,value:j.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(e.unref(Ht),{class:"w-8 h-8 p-0 text-sm",variant:j.value===f.value?"default":"outline",disabled:j.value===f.value,onClick:be=>O(j.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(j.value),1)]),_:2},1032,["variant","disabled","onClick"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(e.unref(Q2),{key:j.type,index:oe},null,8,["index"]))],64))),256)),e.createVNode(e.unref(n_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronRight),{class:"h-4 w-4"})]),_:1}),e.createVNode(e.unref(t_),{class:"w-8 h-8 p-0 flex items-center justify-center border border-neutral-200 dark:border-neutral-700 rounded-md bg-white dark:bg-zinc-800 text-neutral-900 dark:text-neutral-100 hover:bg-zinc-100 dark:hover:bg-zinc-700 disabled:cursor-not-allowed"},{default:e.withCtx(()=>[e.createVNode(e.unref(le.ChevronsRight),{class:"h-4 w-4"})]),_:1})]),_:1})]),_:1},8,["total","items-per-page","page"])])])):e.createCommentVNode("",!0),e.createVNode(Pn,{modelValue:b.value,"onUpdate:modelValue":R[5]||(R[5]=F=>b.value=F),title:tt.value,icon:"AlertCircle","max-width":450,persistent:!1},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",onClick:Le,text:"Cancel"}),e.createVNode(Ke,{variant:"default",onClick:me,text:"Yes"})]),default:e.withCtx(()=>[e.createElementVNode("div",YS,[e.createElementVNode("p",JS,e.toDisplayString(at.value),1)])]),_:1},8,["modelValue","title"]),e.createVNode(Pn,{modelValue:C.value,"onUpdate:modelValue":R[8]||(R[8]=F=>C.value=F),title:((ee=N.value)==null?void 0:ee.label)||"Action",icon:"AlertCircle","max-width":450},{actions:e.withCtx(()=>{var F;return[e.createVNode(Ke,{variant:"outline",onClick:R[6]||(R[6]=j=>C.value=!1),text:"Cancel"}),t.dummyMode&&((F=N.value)!=null&&F.route)?(e.openBlock(),e.createBlock(Ke,{key:1,variant:"default",onClick:R[7]||(R[7]=j=>C.value=!1),text:e.unref(l)==="id"?"Tutup":"Close"},null,8,["text"])):(e.openBlock(),e.createBlock(Ke,{key:0,variant:"default",onClick:ae,text:"Save"}))]}),default:e.withCtx(()=>{var F,j,oe;return[e.createElementVNode("div",QS,[t.dummyMode&&((F=N.value)!=null&&F.route)?(e.openBlock(),e.createElementBlock("div",ZS,[e.createElementVNode("div",eV,[e.createVNode(e.unref(le.Search),{class:"w-4 h-4"})]),e.createElementVNode("div",tV,[e.createElementVNode("span",nV,e.toDisplayString(e.unref(l)==="id"?"Info Navigasi":"Navigation Info"),1),e.createElementVNode("p",oV,e.toDisplayString(e.unref(l)==="id"?`Aksi ini akan mengarah ke rute: ${N.value.route}`:`This action will navigate to: ${N.value.route}`),1)])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(((j=N.value)==null?void 0:j.fieldActionCustom)||((oe=N.value)==null?void 0:oe.fieldActionGlobal)||[],(be,Ve)=>{var Ae,De,qe,Oe;return e.openBlock(),e.createElementBlock(e.Fragment,{key:Ve},[!be.isHidden&&!(t.dummyMode&&((Ae=N.value)!=null&&Ae.route))?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(Ne(be))},[e.createElementVNode("div",rV,[e.createVNode(eu,{class:"flex-1 w-full",field:be,modelValue:V.value[be.model],"onUpdate:modelValue":je=>V.value[be.model]=je},null,8,["field","modelValue","onUpdate:modelValue"]),be.isCopyable||(De=be.props)!=null&&De.isCopyable||((qe=N.value)==null?void 0:qe.action)==="showToken"||((Oe=N.value)==null?void 0:Oe.action)==="copyToken"?(e.openBlock(),e.createBlock(Ke,{key:0,icon:"Copy",variant:"outline",class:"h-10 w-10 p-0 flex-shrink-0",tooltip:"Salin",onClick:je=>ke(be.model)},null,8,["onClick"])):e.createCommentVNode("",!0)])],2)):e.createCommentVNode("",!0)],64)}),128))])]}),_:1},8,["modelValue","title"])])}}});tn.add_operation("length",t=>t==null?0:typeof t=="string"||Array.isArray(t)?t.length:typeof t=="number"?String(t).length:typeof t=="object"?Object.keys(t).length:0),tn.add_operation("==",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null?n==null:n==null?t==null:o(t)&&o(n)?String(t.id)===String(n.id)||String(t.code)===String(n.code):o(t)?String(t.code)===String(n)||String(t.id)===String(n):o(n)?String(n.code)===String(t)||String(n.id)===String(t):typeof t=="boolean"&&typeof n=="string"?String(t)===n:typeof n=="boolean"&&typeof t=="string"?String(n)===t:String(t)===String(n)}),tn.add_operation("!=",(t,n)=>{const o=r=>r&&typeof r=="object"&&r._isLogicValue;return t==null&&n==null?!1:t==null||n===null||n===void 0?!0:o(t)&&o(n)?!(String(t.id)===String(n.id)||String(t.code)===String(n.code)):o(t)?!(String(t.code)===String(n)||String(t.id)===String(n)):o(n)?!(String(n.code)===String(t)||String(n.id)===String(t)):String(t)!==String(n)});function aV(t,n){const{t:o,locale:r}=vt.useI18n(),a=e.computed(()=>r.value),{apiUrl:s}=ct(),i=Fn.useRouter();let l="";const c=e.ref(!1),d=e.ref(null),u=e.computed(()=>t.schema||d.value),f=e.computed(()=>{var O;if((O=t.selectedTokenCore)!=null&&O.address)return t.selectedTokenCore.address;if(t.baseUrl)return t.baseUrl}),m=O=>{if(!O||typeof O!="string"||O.startsWith("http"))return O;const U=f.value;if(!U)return O;const I=U.replace(/\/$/,""),z=O.startsWith("/")?O:`/${O}`;return`${I}${z}`},h=e.computed(()=>{const O={},U=u.value;return U!=null&&U.sections&&U.sections.forEach(I=>{var G,se,fe;(((G=I.propsForm)==null?void 0:G.fields)||((se=I.propsTable)==null?void 0:se.fields)||((fe=I.props)==null?void 0:fe.fields)||[]).forEach(me=>{var ae,ke,Le,tt,at,Ze,wt,Ct,yn,So,vn;if(me.component==="DCodeRadioCustom"){const nn=((ae=me.props)==null?void 0:ae.name)||"default-group";O[nn]||(O[nn]=[]);let xn=((Le=(ke=me.props)==null?void 0:ke.endpoint)==null?void 0:Le.apiUrl)||((tt=me.props)==null?void 0:tt.apiUrl);xn=m(xn),O[nn].push({key:me.key,value:(at=me.props)==null?void 0:at.value,label:((Ze=me.props)==null?void 0:Ze.labelID)||((wt=me.props)==null?void 0:wt.labelEN)||me.key,model:me.model||me.key,apiUrl:xn,apiMethod:((yn=(Ct=me.props)==null?void 0:Ct.endpoint)==null?void 0:yn.apiMethod)||((So=me.props)==null?void 0:So.apiMethod),icon:(vn=me.props)==null?void 0:vn.icon,name:nn})}})}),O}),p=e.reactive({}),k=e.reactive({}),x=e.reactive({}),g=e.reactive({}),S=e.reactive({}),B=e.reactive({visible:!1,title:"",message:"",action:null}),E=O=>{var U,I,z;return((U=O.propsForm)==null?void 0:U.key)||((I=O.propsTable)==null?void 0:I.key)||((z=O.propsWizard)==null?void 0:z.key)||O.id||"unknown-section"},_=O=>{var I;return(((I=O.propsWizard)==null?void 0:I.propsSteps)||[]).filter(z=>W(z)).map((z,G)=>{var me;let se=[];if(Array.isArray(z.sectionsWizard))se=z.sectionsWizard;else if(z.sectionsWizard&&typeof z.sectionsWizard=="object"){const ae=z.sectionsWizard;se=[{type:ae.type||(ae.fields?"FORM":ae.isDataTable?"TABLE":"UNKNOWN"),...ae}]}const fe=Q(z);return{key:z.key||`step-${G}`,title:fe.title,description:fe.description,icon:z.icon||void 0,sections:se,actions:((me=z.propsComponent)==null?void 0:me.actionComponent)||z.actionComponent||[]}})},w=O=>O?[...O].sort((U,I)=>(U.seq||0)-(I.seq||0)):[],y=(O,U)=>{var G;const I=U?N(U):P.value;return M((G=O.logic)==null?void 0:G.labelingRule,I,`LABEL-${O.model}`)||null},b=(O,U)=>{var G;const I=U?N(U):P.value;return M((G=O.logic)==null?void 0:G.lengthRule,I,`LENGTH-${O.model}`)||null},C=(O,U,I)=>{const z=O.props||O.propsFieldGlobal;if(!z)return null;const G=U==null?"":String(U);if(G==="")return null;const se=b(O,I),fe=(se==null?void 0:se.minLength)??z.minLength,me=(se==null?void 0:se.maxLength)??z.maxLength;if(fe&&G.length<fe)return a.value==="id"?`Minimal ${fe} karakter`:`Minimum ${fe} characters`;if(me&&G.length>me)return a.value==="id"?`Maksimal ${me} karakter`:`Maximum ${me} characters`;if(z.regex)try{if(!new RegExp(z.regex).test(G))return z.regexMessage||(a.value==="id"?"Format tidak valid":"Invalid format")}catch{console.warn(`[DynamicForm] Invalid validation regex for field ${O.model}:`,z.regex)}return null},V=e.computed(()=>{var U;const O=new Map;return(U=u.value)!=null&&U.sections&&u.value.sections.forEach(I=>{var fe,me;const z=I.propsForm||I.propsTable||I.props||{},G=E(I);(z.fields||I.fields||[]).forEach(ae=>{if(ae.model){const ke=G?`${G}.${ae.model}`:ae.model;O.set(ae.model,{field:ae,path:ke})}}),((fe=I.type)==null?void 0:fe.toUpperCase())==="WIZARD"&&((me=I.propsWizard)!=null&&me.propsSteps)&&I.propsWizard.propsSteps.forEach(ae=>{const ke=ae.key||ae.id;(Array.isArray(ae.sectionsWizard)?ae.sectionsWizard:[ae.sectionsWizard].filter(Boolean)).forEach(tt=>{tt.fields&&tt.fields.forEach(at=>{if(at.model){const Ze=ke?`${ke}.${at.model}`:at.model;O.set(at.model,{field:at,path:Ze})}})})})}),O}),D=(O,U)=>{if(U==null||typeof U=="object"&&U._isLogicValue)return U;const I=V.value.get(O);if(!I)return U;const z=I.field,G=$[z.key];if(!G||!Array.isArray(G))return U;const fe=(z.props||{}).itemValue||"id",me=G.find(ae=>String(ae[fe])===String(U)||String(ae.id)===String(U)||String(ae.code)===String(U));return me&&me.code?{id:U,code:me.code,_isLogicValue:!0}:U},N=O=>{const U=(I,z)=>{if(I==null||typeof I=="object"&&I._isLogicValue||typeof I=="boolean")return I;if(typeof I=="number"||typeof I=="string")return z?D(z,I):I;if(typeof I=="object"&&!Array.isArray(I)){const G=(I==null?void 0:I.id)??(I==null?void 0:I.code)??(I==null?void 0:I.value)??(I==null?void 0:I.key)??I;return z&&(typeof G=="string"||typeof G=="number")?D(z,G):G}return I};return new Proxy(O,{get(I,z){if(typeof z!="string")return I[z];const G=V.value.get(z);if(G){const se=Ce(I,G.path);if(se!=null)return U(se,z)}return U(I[z],z)},has(I,z){return typeof z!="string"?z in I:V.value.has(z)||z in I},ownKeys(I){return Array.from(new Set([...Object.keys(I),...V.value.keys()]))},getOwnPropertyDescriptor(I,z){return{enumerable:!0,configurable:!0}}})},P=e.computed(()=>N(p)),M=(O,U,I)=>O?Array.isArray(O)?O.find(z=>!z.condition||X(z.condition,U,I))||null:O:null,X=(O,U,I="LOGIC")=>{if(O==null||typeof O=="object"&&Object.keys(O).length===0)return!0;if(typeof O=="boolean")return O;if(typeof O=="object")try{const z=tn.apply(O,U);if(["VISIBLE","SEC","FILTER","LENGTH","CALC"].some(se=>I.includes(se))){const se=JSON.stringify(O),fe=Object.keys(U).filter(me=>se.includes(`"${me}"`));console.log(`[DynamicForm][${I}] Rule: ${se} | Data: {${fe.map(me=>`${me}: ${JSON.stringify(U[me])}`).join(", ")}} | Result: ${z}`)}return z}catch(z){return console.error(`[${I}] JsonLogic error:`,z),!1}try{return!!new Function("formData",`return ${O};`)(U)}catch{return!1}},$=e.reactive({}),H=async O=>{const U=O.props||{},I=U.endpointReference||U.endpoint;if(!(!(I!=null&&I.apiUrl)||$[O.key])&&!(Array.isArray(I.keyParam)&&I.keyParam.some(z=>p[z]===null||p[z]===void 0||p[z]==="")))try{const z=m(I.apiUrl),G=await s(z,I.apiMethod||"GET",{page:1,perPage:100});let se=(G==null?void 0:G.data)||G;$[O.key]=Array.isArray(se)?se:se?[se]:[]}catch{$[O.key]=[]}},J=(O,U)=>{var ae;const I=O.props||{},z=$[O.key]||I.items||I.options||[];if(!((ae=O.logic)!=null&&ae.optionsFilterRule))return z;const G=U?N(U):P.value,se=M(O.logic.optionsFilterRule,G,`FILTER-${O.model}`);if(!se||!se.values)return z;const fe=(se.values||[]).map(ke=>String(ke)),me=I.itemValue||"id";return z.filter(ke=>ke==null?!1:typeof ke!="object"?fe.includes(String(ke)):[me,"code","id","value","key"].some(Le=>{const tt=ke[Le];return tt!=null&&fe.includes(String(tt))}))},te=O=>{if(!O||typeof O!="object")return[];if("var"in O)return[O.var];let U=[];return Object.values(O).forEach(I=>{Array.isArray(I)?I.forEach(z=>{U=U.concat(te(z))}):typeof I=="object"&&(U=U.concat(te(I)))}),U};e.watch(()=>u.value,O=>{if(!(O!=null&&O.sections))return;const U=new Set,I=z=>{z&&["visibleRule","requiredRule","disabledRule","optionsFilterRule","lengthRule","calculateRule"].forEach(G=>{const se=z[G];Array.isArray(se)?se.forEach(fe=>fe.condition&&te(fe.condition).forEach(me=>U.add(me))):se&&te(se).forEach(fe=>U.add(fe))})};O.sections.forEach(z=>{var G,se,fe,me,ae;I(z.logic||((G=z.propsForm)==null?void 0:G.logic)),z.type==="WIZARD"&&((fe=(se=z.propsWizard)==null?void 0:se.propsSteps)==null||fe.forEach(ke=>I(ke.logic))),(((me=z.propsForm)==null?void 0:me.fields)||z.fields||[]).forEach(ke=>{var Le;I(ke.logic),(Le=ke.logic)!=null&&Le.optionsFilterRule&&H(ke)}),z.type==="TABLE"&&((ae=z.propsTable)!=null&&ae.modelDatatable)&&(p[z.propsTable.modelDatatable]=p[z.propsTable.modelDatatable]||[])})},{immediate:!0});const T=(O,U)=>{var se;const I=U?N(U):P.value,z=(se=O.logic)==null?void 0:se.visibleRule;if(!z)return!0;const G=M(z,I,`VISIBLE-${O.model}`);return!!(typeof G=="object"?X(G,I,`VISIBLE-${O.model}`):G)},L=(O,U)=>{var se,fe;const I=U?N(U):P.value,z=(se=O.logic)==null?void 0:se.requiredRule;if(!z)return((fe=O.props)==null?void 0:fe.required)||!1;const G=M(z,I,`REQUIRED-${O.model}`);return!!(typeof G=="object"?"required"in G?G.required:X(G,I):G)},Z=(O,U)=>{var se,fe;const I=U?N(U):P.value,z=(se=O.logic)==null?void 0:se.disabledRule;if(!z)return((fe=O.props)==null?void 0:fe.disabled)||!1;const G=M(z,I,`DISABLED-${O.model}`);return!!(typeof G=="object"?"disabled"in G?G.disabled:X(G,I):G)},Q=O=>{var se;const U=O.propsForm||O.propsTable||O.propsWizard||O.props||{};let I=a.value==="id"?U.titleID||O.titleID||O.labelID:U.titleEN||O.titleEN||O.labelEN,z=a.value==="id"?U.descriptionID||O.descriptionID:U.descriptionEN||O.descriptionEN;const G=M((se=O.logic||U.logic)==null?void 0:se.labelingRule,P.value,"LABEL-SEC");return G&&(I=a.value==="id"?G.labelID||G.titleID||G.title:G.labelEN||G.titleEN||G.title,z=a.value==="id"?G.descriptionID:G.descriptionEN),{title:I,description:z}},W=(O,U)=>{var fe,me;if(!O)return!0;const I=O.propsForm||O.propsTable||O.propsWizard||O.props||{},z=(fe=O.logic||I.logic)==null?void 0:fe.visibleRule,G=U?N(U):P.value;if(z){const ae=M(z,G,"VISIBLE-SEC");return!!(typeof ae=="object"?X(ae,G,"VISIBLE-SEC"):ae)}if(O.type==="TABLE"&&((me=I.headers)!=null&&me.length))return!0;const se=I.fields||O.fields||[];return se.length===0||se.some(ae=>T(ae,U))},ie=()=>{var O;if((O=u.value)!=null&&O.sections)for(let U=0;U<3;U++){let I=!1;if(u.value.sections.forEach(z=>{var G;(((G=z.propsForm)==null?void 0:G.fields)||z.fields||[]).forEach(se=>{var me;const fe=(me=se.logic)==null?void 0:me.calculateRule;if(fe&&typeof fe=="object"){const ae=Object.keys(fe)[0],ke=X(fe[ae],P.value,`CALC-${ae}`);ke!==void 0&&p[ae]!==ke&&(p[ae]=ke,I=!0)}})}),!I)break}},de=e.computed(()=>{var U;if(!((U=u.value)!=null&&U.sections))return!1;if(Object.keys(k).length>0)return!0;const O=I=>I.some(z=>T(z)&&L(z)&&(Array.isArray(p[z.model])?p[z.model].length===0:p[z.model]==null||p[z.model]===""));return u.value.sections.some(I=>{var z;return O(((z=I.propsForm)==null?void 0:z.fields)||I.fields||[])?!0:I.type==="WIZARD"?_(I).some(G=>O(G.sections.flatMap(se=>se.fields||[]))):!1})}),Ce=(O,U)=>U?U.split(".").reduce((I,z)=>I==null?void 0:I[z],O):void 0,Ne=(O,U,I)=>{const z=U.split(".");let G=O;for(let se=0;se<z.length-1;se++)G=G[z[se]]=G[z[se]]||{};G[z[z.length-1]]=I},ge=O=>{const U=e.toRaw(O);if(Array.isArray(U))return U.map(I=>ge(I));if(U&&typeof U=="object"){const I={};return Object.keys(U).forEach(z=>I[z]=ge(U[z])),I}return U},Y=()=>{var I;if(!((I=u.value)!=null&&I.sections))return{...p};const O={},U=new Set;return u.value.sections.forEach(z=>{var fe,me;if(!W(z))return;const G=E(z),se=(ae,ke)=>{if(T(ae)&&ae.model){const Le=Ce(p,ke?`${ke}.${ae.model}`:ae.model)??p[ae.model];O[ae.model]=ge(Le)??null,U.add(ae.model)}};if((((fe=z.propsForm)==null?void 0:fe.fields)||z.fields||[]).forEach(ae=>{var ke;return se(ae,G||((ke=z.propsForm)==null?void 0:ke.key))}),z.type==="WIZARD"&&_(z).forEach(ae=>ae.sections.forEach(ke=>(ke.fields||[]).forEach(Le=>se(Le,ae.key)))),(me=z.propsTable)!=null&&me.modelDatatable){const ae=z.propsTable.modelDatatable;O[ae]=ge(Ce(p,G?`${G}.${ae}`:ae)??p[ae]),U.add(ae)}}),["id","_id"].forEach(z=>{p[z]!==void 0&&!U.has(z)&&(O[z]=ge(p[z]))}),O},v=(O,U)=>{const I=(O==null?void 0:O.data)!==void 0?O.data:O,z=Array.isArray(I)?I[0]:I;z&&Object.entries(U).forEach(([G,se])=>{const fe=z[se]??z[G];fe!==void 0&&Ne(p,G,fe)})},K=()=>{var I;const O=[],U=z=>{z==null||z.forEach(G=>{var fe;if(G.type==="TABLE"||G.propsTable){const me=G.propsTable||G;me.modelDatatable&&O.push({key:me.modelDatatable,subFields:(me.headers||[]).map(ae=>ae.key)})}(((fe=G.propsForm)==null?void 0:fe.fields)||G.fields||[]).forEach(me=>{var ke,Le;const ae=["DCodeDynamicUploadList","DCodeUploadList","DCodeDataTable","DCodeDynamicFormList"].includes(me.component);if(me.model&&((ke=me.props)!=null&&ke.multiple||((Le=me.props)==null?void 0:Le.valueType)==="array"||ae)){const tt=me.component.includes("Upload")?["id","filename","document","typeDocument","idDocumentType"]:["id"];O.push({key:me.model,subFields:tt})}}),G.type==="WIZARD"&&_(G).forEach(me=>U(me.sections))})};return U((I=u.value)==null?void 0:I.sections),O},re=(O,U)=>{const I={},z=G=>G&&typeof G=="object"?G._isLogicValue?G.id:G.id??G.code??G.value??G:G;return Object.entries(U).forEach(([G,se])=>{if(typeof se=="string"){const fe=O[G]??Ce(p,G)??p[G];fe!==void 0&&(I[se]=z(fe))}else if(Array.isArray(se)&&se[0]){const fe=se[0],me=Object.keys(fe);let ae=O[G]??Ce(p,G)??p[G];if(!Array.isArray(ae)||ae.length===0){const ke=K().find(Le=>me.some(tt=>Le.subFields.includes(tt)));if(ke){const Le=O[ke.key]??Ce(p,ke.key)??p[ke.key];Array.isArray(Le)&&Le.length>0&&(ae=Le)}}Array.isArray(ae)&&(console.log(`[DynamicForm][MAPPING-SOURCE] ${G}:`,ge(ae)),I[G]=ae.map((ke,Le)=>{const tt={},at=ge(ke);return Object.entries(fe).forEach(([Ze,wt])=>{const Ct=at[Ze]??at[wt]??ke[Ze]??ke[wt]??null;tt[wt]=z(Ct)}),tt}))}}),console.log("[DynamicForm][MAPPING-RESULT]",I),I},_e=O=>{var U,I,z,G;O.requireConfirm?(B.title=a.value==="id"?((U=O.propCustomMessage)==null?void 0:U.titleID)||"Konfirmasi":((I=O.propCustomMessage)==null?void 0:I.titleEN)||"Confirm",B.message=a.value==="id"?((z=O.propCustomMessage)==null?void 0:z.messageID)||"Lanjutkan?":((G=O.propCustomMessage)==null?void 0:G.messageEN)||"Continue?",B.action=O,B.visible=!0):ze(O)},Re=()=>{B.visible=!1,B.action&&ze(B.action)},ze=async O=>{var G,se;const U=O.propsActionGlobal||O.props||{},I=re(Y(),U.fieldMapping||O.fieldMapping||{});n("action",O,I);const z=U.endpointPropAction||O.endpointPropAction||U.endpoint||O.endpoint;if((U.type==="SUBMIT"||U.type==="ACTION")&&(z!=null&&z.apiUrl)){const fe=We.loading(a.value==="id"?"Memproses...":"Processing..."),me=m(z.apiUrl);try{const ae=await s(me,z.apiMethod||"POST",I),ke=(ae==null?void 0:ae.status)===!0||(ae==null?void 0:ae.success)===!0,Le=(ae==null?void 0:ae.message)||(ke?a.value==="id"?"Sukses":"Success":a.value==="id"?"Gagal":"Failed");We.update(fe,{render:Le,type:ke?"success":"error",isLoading:!1,autoClose:ke?3e3:5e3}),ke?((U.fieldMapping||O.fieldMapping)&&v(ae,U.fieldMapping||O.fieldMapping),n("success",ae)):n("error",ae)}catch(ae){const ke=((se=(G=ae.response)==null?void 0:G.data)==null?void 0:se.message)||ae.message||(a.value==="id"?"Terjadi kesalahan":"An error occurred");We.update(fe,{render:`Gagal: ${ke}`,type:"error",isLoading:!1,autoClose:5e3}),n("error",ae)}}else U.type==="SUBMIT"&&n("submit",I);U.keyRedirect&&U.route&&i&&i.push(U.route)},He=()=>{var U,I;let O=!0;return(I=(U=u.value)==null?void 0:U.sections)==null||I.forEach(z=>{var G;W(z)&&(((G=z.propsForm)==null?void 0:G.fields)||z.fields||[]).forEach(se=>{if(T(se)){const fe=C(se,p[se.model]);fe&&(k[se.model]=fe,O=!1)}})}),O},Xe=async()=>{var O,U;if(He()){c.value=!0;try{const I=Y(),z=(((O=u.value)==null?void 0:O.actions)||[]).find(se=>{var fe;return se.type==="SUBMIT"||se.key==="SUBMIT"||((fe=se.propsActionGlobal)==null?void 0:fe.type)==="SUBMIT"}),G=(z==null?void 0:z.fieldMapping)||((U=z==null?void 0:z.propsActionGlobal)==null?void 0:U.fieldMapping);n("submit",G?re(I,G):I)}finally{c.value=!1}}},ot=()=>n("cancel"),Ie=(O,U,I)=>{var se;const z=I?`${I}.${O}`:O;Ne(p,z,U);const G=(se=V.value.get(O))==null?void 0:se.field;if(G){const fe=C(G,U);fe?k[O]=fe:delete k[O]}n("update:model",Y())},mt=O=>!O.permission||(t.isEditMode?O.permission!=="CREATE":O.permission!=="UPDATE"),pt=O=>{var I,z;if((I=O.fields)!=null&&I.length)return O.fields;const U=(O.actionTableGlobal||[]).find(G=>G.permission==="CREATE"||(G.key||"").toLowerCase().includes("add"));return(z=U==null?void 0:U.fieldActionGlobal)!=null&&z.length?U.fieldActionGlobal:(O.headers||[]).filter(G=>G.key&&G.key!=="no").map(G=>({key:G.key,model:G.key,component:"DCodeTextField"}))},Tt=O=>{var U;return!(O!=null&&O.apiUrl)&&!((U=O==null?void 0:O.endpointTable)!=null&&U.apiUrl)},q=O=>{if(!O)return!1;const U=(O.key||"").toLowerCase(),I=(O.permission||"").toUpperCase();return U==="detail"||U.includes("view")||I==="VIEW"},ue=O=>Array.isArray(p[O.modelDatatable])?p[O.modelDatatable]:[],Ee=e.ref(!1),Ue=e.ref(""),Me=e.ref("Plus"),ne=e.ref([]),ce=e.reactive({}),he=e.reactive({}),Se=e.ref(""),et=e.ref(null),St=e.ref(!1),bn=e.ref(null),Eo=e.ref(!1),Bo=(O,U)=>{bn.value={propsTable:O,row:U},Eo.value=!0},Ca=()=>{if(!bn.value)return;const{propsTable:O,row:U}=bn.value;Eo.value=!1;const I=p[O.modelDatatable];if(Array.isArray(I)){const z=I.indexOf(U);if(z!==-1)I.splice(z,1);else{const G=JSON.stringify(U,(fe,me)=>["no","_index"].includes(fe)?void 0:me),se=I.findIndex(fe=>JSON.stringify(fe,(me,ae)=>["no","_index"].includes(me)?void 0:ae)===G);se!==-1&&I.splice(se,1)}n("update:model",Y())}},gt=(O,U)=>{ce[O]=U;const I=ne.value.find(z=>z.model===O);if(I){const z=C(I,U);z?he[O]=z:delete he[O]}},sr=(O,U,I)=>{Se.value=O.modelDatatable||"",St.value=q(U),et.value=null,Ue.value=a.value==="id"?U.labelID||"Tambah Data":U.labelEN||"Add Data",Me.value=U.icon||"Plus";const z=pt(O);ne.value=z,Object.keys(ce).forEach(G=>delete ce[G]),Object.keys(he).forEach(G=>delete he[G]),z.forEach(G=>ce[G.model]=I?I[G.model]??null:null),Ee.value=!0},_o=(O,U)=>{const{action:I,row:z}=U;if(/delete|trash/i.test(I)){const ae=p[O.modelDatatable];if(Array.isArray(ae)){const ke=ae.indexOf(z);if(ke!==-1)ae.splice(ke,1);else{const Le=JSON.stringify(z,(at,Ze)=>["no","_index"].includes(at)?void 0:Ze),tt=ae.findIndex(at=>JSON.stringify(at,(Ze,wt)=>["no","_index"].includes(Ze)?void 0:wt)===Le);tt!==-1&&ae.splice(tt,1)}}return}if(/detail|view/i.test(I)){sr(O,{key:"detail",permission:"VIEW"},z);return}const G=O.modelDatatable||"";Se.value=G,St.value=!1,Ue.value=a.value==="id"?"Ubah Data":"Edit Data",Me.value="SquarePen";const se=p[G];let fe=Array.isArray(se)?se.indexOf(z):-1;if(fe===-1&&Array.isArray(se)){const ae=JSON.stringify(z,(ke,Le)=>["no","_index"].includes(ke)?void 0:Le);fe=se.findIndex(ke=>JSON.stringify(ke,(Le,tt)=>["no","_index"].includes(Le)?void 0:tt)===ae)}et.value=fe!==-1?fe:null;const me=pt(O);ne.value=me,Object.keys(ce).forEach(ae=>delete ce[ae]),me.forEach(ae=>ce[ae.model]=z[ae.model]??null),Ee.value=!0},Ea=()=>{let O=!0;if(ne.value.forEach(I=>{const z=C(I,ce[I.model]);z&&(he[I.model]=z,O=!1)}),!O)return;const U=Se.value;U&&(p[U]=p[U]||[],et.value!==null?p[U].splice(et.value,1,{...ce}):p[U].push({...ce}),Ee.value=!1,n("update:model",Y()))},eo=new Map,ir=new Map;return e.watch(()=>({...p}),O=>{var se;if(!((se=u.value)!=null&&se.sections))return;ie();const U=N(O),I=fe=>{fe.forEach(me=>{var tt;const ae=E(me),ke=W(me,O);(((tt=me.propsForm)==null?void 0:tt.fields)||me.fields||[]).forEach(at=>{const Ze=at.model;if(!Ze)return;const wt=ae?`${ae}.${Ze}`:Ze,Ct=Ce(p,wt),yn=T(at,O)&&ke;eo.get(Ze)===!0&&yn===!1&&Ct!==null&&Ct!==void 0&&(console.log(`[DynamicForm][RESET-VISIBLE] ${Ze} BEFORE:`,ge(Ct)),Ne(p,wt,Array.isArray(Ct)?[]:null),console.log(`[DynamicForm][RESET-VISIBLE] ${Ze} AFTER:`,ge(Ce(p,wt)))),eo.set(Ze,yn);const vn=at.logic;if(vn&&yn){const nn={};let xn=!1;["lengthRule","optionsFilterRule","visibleRule"].forEach(A=>{const R=vn[A];if(!R)return;const ee=M(R,U,`${A}-${Ze}`),F=JSON.stringify(ee);nn[A]=F;const j=ir.get(Ze);j&&j[A]!==void 0&&j[A]!==F&&(xn=!0)}),xn&&Ct!==null&&Ct!==void 0&&(console.log(`[DynamicForm][RESET-LOGIC] ${Ze} due to rule change | BEFORE:`,ge(Ct)),Ne(p,wt,Array.isArray(Ct)?[]:null),console.log(`[DynamicForm][RESET-LOGIC] ${Ze} AFTER:`,ge(Ce(p,wt)))),ir.set(Ze,nn)}}),me.type==="WIZARD"&&_(me).forEach(at=>I(at.sections))})};I(u.value.sections);const z=Y()||{},G=JSON.stringify(z);G!==l&&(l=G,console.log("[DynamicForm] Emitting update:model:",z),n("update:model",z))},{deep:!0,immediate:!0}),e.watch(()=>t.model,O=>{O&&Object.keys(O).length>0?JSON.stringify(O)!==l&&(console.log("[DynamicForm] Received new model data:",O),Object.keys(O).forEach(I=>{p[I]=O[I]}),console.log("[DynamicForm] Updated formData:",{...p})):console.log("[DynamicForm] Received empty or null model data")},{immediate:!0,deep:!0}),{t:o,locale:a,i18nLocale:r,apiUrl:s,router:i,isSubmitting:c,internalSchema:d,activeSchema:u,resolvedBaseUrl:f,resolveEndpointUrl:m,radioGroups:h,formData:p,errors:k,wizardState:x,inlineState:g,fieldErrors:S,confirmDialog:B,getSectionKey:E,getWizardTabs:_,sortedFields:w,resolveFieldLabels:y,resolveFieldLength:b,validateField:C,fieldMap:V,resolveValueIdentifier:D,getNormalizedData:N,normalizedData:P,resolveActiveRule:M,evaluateLogic:X,rawItemsCache:$,prefetchFieldItems:H,getFilteredItems:J,extractVars:te,isFieldVisible:T,isFieldRequired:L,isFieldDisabled:Z,resolveSectionLabels:Q,isSectionVisible:W,applyCalculations:ie,isSubmitDisabled:de,getDeepValue:Ce,setDeepValue:Ne,deepRaw:ge,getCleanPayload:Y,handleResponseMapping:v,getFormArrayModels:K,applyFieldMapping:re,handleGlobalButtonClick:_e,confirmAction:Re,performAction:ze,validateAll:He,handleSubmit:Xe,handleCancel:ot,handleFieldUpdate:Ie,isActionVisible:mt,resolveTableFields:pt,isTemporaryTable:Tt,isActionViewOnly:q,tableRows:ue,tableDialogOpen:Ee,tableDialogTitle:Ue,tableDialogIcon:Me,tableDialogFields:ne,tableRowFormData:ce,tableRowErrors:he,activeTableKey:Se,editingRowIndex:et,tableDialogViewOnly:St,confirmDeletePending:bn,confirmDeleteOpen:Eo,confirmTableDelete:Bo,executeTableDelete:Ca,handleTableRowUpdate:gt,openTableRowDialog:sr,handleDataTableAction:_o,saveTableRow:Ea}}const sV={key:0},iV=["value","name"],lV={key:1,class:"flex flex-col gap-1"},cV={class:"text-xs font-medium text-neutral-500 dark:text-neutral-400"},dV=["src"],uV={key:1,class:"text-sm text-neutral-400 italic"},fV={key:2,class:"text-sm text-neutral-800 dark:text-neutral-100 font-medium"},mV={key:3,class:"text-xs text-neutral-400 italic"},ci=e.defineComponent({__name:"DynamicFormField",props:{field:{},modelValue:{default:null},formData:{default:()=>({})},required:{type:Boolean,default:!1},options:{default:()=>[]},error:{default:null},dynamicLabels:{default:null},dynamicLength:{default:null},baseUrl:{default:void 0},viewOnly:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:n}){let o=e.ref("en");try{o=vt.useI18n().locale}catch{}const r=t,a=n,s=e.ref(r.modelValue);e.watch(()=>r.modelValue,x=>{s.value=x});const i={DCodeTextField:ao,DCodeAutoComplete:gr,DCodeDatePicker:oa,DCodeTextarea:yo,DCodeTextArea:yo,DCodeCheckbox:gn,DCodeSwitch:la,DCodeOtpInput:sa,DCodeImageField:aa,DCodeSlider:ia,DCodeRadio:Ys,DCodeRadioCustom:Js,DCodeDynamicUploadList:Is,DCodeMultiSelect:Ks,DCodeCurrencyField:Rs,DCodePermissionMenu:Zs,DCodeTreePermissions:ei,DCodeCardCheckboxList:zs,DCodeBeforeAfter:Xa,DCodeListLabels:Ka},l=e.computed(()=>{const x=r.field.component;return i[x]||null}),c=e.computed(()=>{var g;const x=((g=r.field.component)==null?void 0:g.toLowerCase())||"";return x.includes("image")||x.includes("upload")}),d=e.computed(()=>{var g;const x=((g=r.field.component)==null?void 0:g.toLowerCase())||"";return x.includes("switch")||x.includes("checkbox")}),u=e.computed(()=>{var B,E;const x=r.field.props||r.field.propsFieldGlobal||{},g=((B=r.dynamicLabels)==null?void 0:B.labelID)||x.labelID,S=((E=r.dynamicLabels)==null?void 0:E.labelEN)||x.labelEN;return o.value==="id"?g||S||r.field.model:S||g||r.field.model}),f=e.computed(()=>{const x=r.modelValue;return x==null||x===""?null:Array.isArray(x)?x.map(g=>typeof g=="object"&&g!==null?g.label||g.name||g.code||g.value||JSON.stringify(g):String(g)).join(", "):typeof x=="object"?x.label||x.name||x.code||x.value||x.id||JSON.stringify(x):String(x)}),m=(x,g)=>{const S={label:"",placeholder:""},B=(g==null?void 0:g.labelID)||x.labelID,E=(g==null?void 0:g.labelEN)||x.labelEN;(B||E)&&(S.label=o.value==="id"?B:E);const _=(g==null?void 0:g.placeholderID)||x.placeholderID,w=(g==null?void 0:g.placeholderEN)||x.placeholderEN;return(_||w)&&(S.placeholder=o.value==="id"?_:w),S},h=(x,g)=>{const S=x.endpoint||{};if(!S.apiUrl)return{};const B={};let E=!0;if(Array.isArray(S.keyParam)&&S.keyParam.length>0&&S.keyParam.forEach(w=>{const y=g?g[w]:null;y!=null&&y!==""?B[w]=y:E=!1}),!E)return{};let _=S.apiUrl;if(r.baseUrl&&typeof _=="string"&&!_.startsWith("http")){const w=r.baseUrl.replace(/\/$/,""),y=_.startsWith("/")?_:`/${_}`;_=`${w}${y}`}return{endpoint:{apiUrl:_,apiMethod:S.apiMethod||"GET"},...Object.keys(B).length?{apiParams:B}:{}}},p=e.computed(()=>{var E,_,w;const x=r.field.props||r.field.propsFieldGlobal||{},g={},S=m(x,r.dynamicLabels);if(S.label&&(g.label=S.label),S.placeholder&&(g.placeholder=S.placeholder),g.required=r.required!==void 0?r.required:x.required??!1,["disabled","readonly","clearable","returnObject","itemTitle","itemValue","maxValue","minValue","sizeFile","typeFile","treeData","menuList","enableParentControl","showIcons","dataBefore","dataAfter"].forEach(y=>{x[y]!==void 0&&x[y]!==null&&(g[y]=x[y])}),g.minLength=((E=r.dynamicLength)==null?void 0:E.minLength)??x.minLength,g.maxLength=((_=r.dynamicLength)==null?void 0:_.maxLength)??x.maxLength,x.valueType&&(g.type=x.valueType),r.error&&(g.error=r.error),Object.assign(g,h(x,r.formData)),(w=x.endpointReference)!=null&&w.apiUrl){let y=x.endpointReference.apiUrl;if(r.baseUrl&&typeof y=="string"&&!y.startsWith("http")){const b=r.baseUrl.replace(/\/$/,""),C=y.startsWith("/")?y:`/${y}`;y=`${b}${C}`}g.endpointReference={...x.endpointReference,apiUrl:y}}return r.options&&r.options.length>0&&(g.items=r.options,g.options=r.options,r.field.component!=="DCodeDynamicUploadList"&&(delete g.endpoint,delete g.apiParams,delete g.apiUrl)),r.baseUrl&&(g.baseUrl=r.baseUrl),g}),k=x=>{s.value=x,a("update:modelValue",x)};return(x,g)=>t.field.isHidden?(e.openBlock(),e.createElementBlock("div",sV,[e.createElementVNode("input",{type:"hidden",value:s.value,name:t.field.model},null,8,iV)])):t.viewOnly?(e.openBlock(),e.createElementBlock("div",lV,[e.createElementVNode("span",cV,e.toDisplayString(u.value),1),c.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[f.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:f.value,class:"h-16 w-16 rounded-md object-cover border border-neutral-200",alt:""},null,8,dV)):(e.openBlock(),e.createElementBlock("span",uV,"-"))],64)):d.value?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["inline-flex items-center gap-1 text-sm font-medium",f.value?"text-green-600 dark:text-green-400":"text-neutral-400"])},e.toDisplayString(f.value?"✓ Ya":"✗ Tidak"),3)):(e.openBlock(),e.createElementBlock("span",fV,e.toDisplayString(f.value||"-"),1))])):l.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(l.value),e.mergeProps({key:2},p.value,{modelValue:s.value,"onUpdate:modelValue":[g[0]||(g[0]=S=>s.value=S),k]}),null,16,["modelValue"])):(e.openBlock(),e.createElementBlock("div",mV," Unknown field: "+e.toDisplayString(t.field.component),1))}}),hV={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},pV={key:0,class:"flex items-center justify-between mb-2 bg-primary-700 dark:bg-primary-900 border-b border-primary-500/30"},gV={key:0,class:"px-4 py-3"},bV={class:"text-sm font-semibold text-white"},yV={class:"px-4 py-3 flex items-center gap-2"},xV=e.defineComponent({__name:"DynamicFormSection",props:{section:{},sIdx:{}},setup(t){const n=e.inject("dynamicFormContext"),{resolveSectionLabels:o,isActionVisible:r,handleGlobalButtonClick:a,locale:s,t:i,handleCancel:l,sortedFields:c,isFieldVisible:d,getDeepValue:u,formData:f,getSectionKey:m,isFieldRequired:h,isFieldDisabled:p,getFilteredItems:k,errors:x,resolveFieldLabels:g,resolveFieldLength:S,resolvedBaseUrl:B,handleFieldUpdate:E}=n;return(_,w)=>{var y,b;return e.openBlock(),e.createElementBlock("div",hV,[((y=t.section.type)==null?void 0:y.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",pV,[e.unref(o)(t.section).title?(e.openBlock(),e.createElementBlock("div",gV,[e.createElementVNode("h3",bV,e.toDisplayString(e.unref(o)(t.section).title),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",yV,[(b=t.section.propsForm.actionSection)!=null&&b.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.section.propsForm.actionSection,(C,V)=>{var D,N,P,M,X,$,H;return e.openBlock(),e.createElementBlock(e.Fragment,{key:V},[e.unref(r)(C)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:C.icon||((D=C.propsActionGlobal)==null?void 0:D.icon),text:e.unref(s)==="id"?C.labelID||((N=C.propsActionGlobal)==null?void 0:N.labelID):C.labelEN||((P=C.propsActionGlobal)==null?void 0:P.labelEN),"bg-color":((X=C.bgColor||((M=C.propsActionGlobal)==null?void 0:M.bgColor))==null?void 0:X.toLowerCase())||"primary",variant:((H=C.variant||(($=C.propsActionGlobal)==null?void 0:$.variant))==null?void 0:H.toLowerCase())||"outline",size:"sm",onClick:J=>e.unref(a)(C)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.createCommentVNode("",!0),t.sIdx===0?(e.openBlock(),e.createBlock(Ke,{key:1,size:"sm",icon:"List",text:e.unref(i)("common.back"),variant:"outline",onClick:e.unref(l)},null,8,["text","onClick"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["p-4 grid gap-4",t.section.propsForm.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c)(t.section.propsForm.fields),C=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C.key},[e.unref(d)(C)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([C.column==="FULL"&&t.section.propsForm.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ci,{field:C,"model-value":e.unref(u)(e.unref(f),e.unref(m)(t.section)?`${e.unref(m)(t.section)}.${C.model}`:C.model)??e.unref(f)[C.model],"form-data":e.unref(f),required:e.unref(h)(C),disabled:e.unref(p)(C),options:e.unref(k)(C),error:e.unref(x)[C.model],"dynamic-labels":e.unref(g)(C),"dynamic-length":e.unref(S)(C),"base-url":e.unref(B),"onUpdate:modelValue":V=>e.unref(E)(C.model,V,e.unref(m)(t.section))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)])}}}),kV={class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},wV={class:"flex items-center justify-center gap-1"},CV=["onClick"],EV=["onClick"],BV=["onClick"],_V=e.defineComponent({__name:"DynamicTableSection",props:{section:{}},setup(t){const n=e.inject("dynamicFormContext"),{tableRows:o,isTemporaryTable:r,handleDataTableAction:a,locale:s,openTableRowDialog:i,resolveTableFields:l,confirmTableDelete:c,resolvedBaseUrl:d}=n;return(u,f)=>(e.openBlock(),e.createElementBlock("div",kV,[e.createVNode(Co,{"table-config":t.section.propsTable,data:e.unref(o)(t.section.propsTable),nested:!0,"show-pagination":t.section.propsTable.pagination??!0,"has-actions":e.unref(r)(t.section.propsTable),"base-url":e.unref(d),onAction:f[1]||(f[1]=m=>e.unref(a)(t.section.propsTable,m))},e.createSlots({"header-actions":e.withCtx(()=>{var m;return[(m=t.section.propsTable.actionTableGlobal)!=null&&m.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(t.section.propsTable.actionTableGlobal,(h,p)=>{var k,x;return e.openBlock(),e.createElementBlock(e.Fragment,{key:p},[h.propsActionGlobal?(e.openBlock(),e.createBlock(Ke,{key:0,icon:h.propsActionGlobal.icon,text:e.unref(s)==="id"?h.propsActionGlobal.labelID||h.labelID:h.propsActionGlobal.labelEN||h.labelEN,"bg-color":((k=h.propsActionGlobal.bgColor)==null?void 0:k.toLowerCase())||"primary",variant:((x=h.propsActionGlobal.variant)==null?void 0:x.toLowerCase())||"default",size:"sm",class:"h-8 shadow-none",onClick:g=>e.unref(i)(t.section.propsTable,h)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128)):e.unref(r)(t.section.propsTable)?(e.openBlock(),e.createBlock(Ke,{key:1,icon:"Plus",text:e.unref(s)==="id"?"Tambah Data":"Add Data","bg-color":"primary",variant:"default",size:"sm",class:"h-8 shadow-none",onClick:f[0]||(f[0]=h=>e.unref(i)(t.section.propsTable,{key:"add_data_auto",permission:"CREATE",labelID:"Tambah Data",labelEN:"Add Data",fieldActionGlobal:e.unref(l)(t.section.propsTable)}))},null,8,["text"])):e.createCommentVNode("",!0)]}),_:2},[e.unref(r)(t.section.propsTable)?{name:"actions",fn:e.withCtx(({row:m})=>[e.createElementVNode("div",wV,[e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-primary-600 hover:bg-primary-50 dark:hover:bg-primary-900/30",onClick:e.withModifiers(h=>e.unref(i)(t.section.propsTable,{key:"detail",permission:"VIEW",labelID:"Detail",labelEN:"Detail",fieldActionGlobal:e.unref(l)(t.section.propsTable)},m),["stop"]),title:"Detail"},[...f[2]||(f[2]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"})],-1)])],8,CV),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-warning-600 hover:bg-warning-50 dark:hover:bg-warning-900/30",onClick:e.withModifiers(h=>e.unref(a)(t.section.propsTable,{action:"edit",row:m}),["stop"]),title:"Edit"},[...f[3]||(f[3]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),e.createElementVNode("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})],-1)])],8,EV),e.createElementVNode("button",{class:"h-8 w-8 rounded flex items-center justify-center text-danger-500 hover:bg-danger-50 dark:hover:bg-danger-900/30",onClick:e.withModifiers(h=>e.unref(c)(t.section.propsTable,m),["stop"]),title:"Hapus"},[...f[4]||(f[4]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"3 6 5 6 21 6"}),e.createElementVNode("path",{d:"M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6"}),e.createElementVNode("path",{d:"M10 11v6"}),e.createElementVNode("path",{d:"M14 11v6"}),e.createElementVNode("path",{d:"M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2"})],-1)])],8,BV)])]),key:"0"}:void 0]),1032,["table-config","data","show-pagination","has-actions","base-url"])]))}}),SV={class:"w-full"},VV={class:"space-y-6 mt-4"},AV={key:0,class:"flex items-center justify-between border-b border-neutral-100 dark:border-neutral-800 pb-2 mb-4"},DV={key:0,class:"text-sm font-medium text-neutral-800 dark:text-neutral-200"},NV={key:1,class:"text-xs text-neutral-500"},MV={key:0,class:"flex items-center gap-2"},TV={key:1,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 bg-white dark:bg-zinc-900 overflow-hidden"},PV={key:2,class:"p-4 border border-dashed border-neutral-300 rounded-lg text-xs text-neutral-400"},OV=e.defineComponent({__name:"DynamicWizardSection",props:{section:{}},setup(t){const n=e.inject("dynamicFormContext"),{getWizardTabs:o,wizardState:r,getSectionKey:a,isSubmitting:s,isActionVisible:i,locale:l,handleGlobalButtonClick:c,isSectionVisible:d,sortedFields:u,isFieldVisible:f,getDeepValue:m,formData:h,isFieldRequired:p,isFieldDisabled:k,getFilteredItems:x,errors:g,resolveFieldLabels:S,resolveFieldLength:B,resolvedBaseUrl:E,handleFieldUpdate:_,tableRows:w,handleDataTableAction:y}=n;return(b,C)=>{var V;return e.openBlock(),e.createElementBlock("div",SV,[e.createVNode(Qs,{tabs:e.unref(o)(t.section),modelValue:e.unref(r)[e.unref(a)(t.section)],"onUpdate:modelValue":C[0]||(C[0]=D=>e.unref(r)[e.unref(a)(t.section)]=D),"is-vertical":t.section.propsWizard.isVertical,"is-wizard":t.section.propsWizard.isWizard,"type-wizard":((V=t.section.propsWizard.typeWizard)==null?void 0:V.toLowerCase())||"icon",loading:e.unref(s)},e.createSlots({_:2},[e.renderList(e.unref(o)(t.section),D=>({name:`tab-${D.key}`,fn:e.withCtx(()=>{var N,P;return[e.createElementVNode("div",VV,[D.title||(N=D.actions)!=null&&N.length?(e.openBlock(),e.createElementBlock("div",AV,[e.createElementVNode("div",null,[D.title?(e.openBlock(),e.createElementBlock("h4",DV,e.toDisplayString(D.title),1)):e.createCommentVNode("",!0),D.description?(e.openBlock(),e.createElementBlock("p",NV,e.toDisplayString(D.description),1)):e.createCommentVNode("",!0)]),(P=D.actions)!=null&&P.length?(e.openBlock(),e.createElementBlock("div",MV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.actions,(M,X)=>{var $,H,J,te,T,L,Z;return e.openBlock(),e.createElementBlock(e.Fragment,{key:X},[e.unref(i)(M)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:M.icon||(($=M.propsActionGlobal)==null?void 0:$.icon),text:e.unref(l)==="id"?M.labelID||((H=M.propsActionGlobal)==null?void 0:H.labelID):M.labelEN||((J=M.propsActionGlobal)==null?void 0:J.labelEN),"bg-color":((T=M.bgColor||((te=M.propsActionGlobal)==null?void 0:te.bgColor))==null?void 0:T.toLowerCase())||"primary",variant:((Z=M.variant||((L=M.propsActionGlobal)==null?void 0:L.variant))==null?void 0:Z.toLowerCase())||"tonal",size:"sm",onClick:Q=>e.unref(c)(M)},null,8,["icon","text","bg-color","variant","onClick"])):e.createCommentVNode("",!0)],64)}),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.sections,(M,X)=>{var $,H,J;return e.openBlock(),e.createElementBlock(e.Fragment,{key:X},[e.unref(d)(M)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(($=M.type)==null?void 0:$.toUpperCase())==="FORM"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["grid gap-4",M.layoutColumns>1?"grid-cols-1 md:grid-cols-2":"grid-cols-1"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u)(M.fields),te=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:te.key},[e.unref(f)(te)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([te.column==="FULL"&&M.layoutColumns>1?"md:col-span-2":"col-span-1"])},[e.createVNode(ci,{field:te,"model-value":e.unref(m)(e.unref(h),e.unref(a)(M)?`${e.unref(a)(M)}.${te.model}`:te.model)??e.unref(h)[te.model],"form-data":e.unref(h),required:e.unref(p)(te),disabled:e.unref(k)(te),options:e.unref(x)(te),error:e.unref(g)[te.model],"dynamic-labels":e.unref(S)(te),"dynamic-length":e.unref(B)(te),"base-url":e.unref(E),"onUpdate:modelValue":T=>e.unref(_)(te.model,T,e.unref(a)(M))},null,8,["field","model-value","form-data","required","disabled","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])],2)):e.createCommentVNode("",!0)],64))),128))],2)):((H=M.type)==null?void 0:H.toUpperCase())==="TABLE"||M.isDataTable?(e.openBlock(),e.createElementBlock("div",TV,[e.createVNode(Co,{"table-config":M.propsDataTableWizard||M.propsTable,data:e.unref(w)(M.propsDataTableWizard||M.propsTable),nested:!0,"show-pagination":((J=M.propsDataTableWizard||M.propsTable)==null?void 0:J.pagination)??!0,onAction:te=>e.unref(y)(M.propsDataTableWizard||M.propsTable,te)},null,8,["table-config","data","show-pagination","onAction"])])):(e.openBlock(),e.createElementBlock("div",PV," Unknown section type: "+e.toDisplayString(M.type),1))],64)):e.createCommentVNode("",!0)],64)}),128))])]})}))]),1032,["tabs","modelValue","is-vertical","is-wizard","type-wizard","loading"])])}}}),vV={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},FV={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4 py-2"},zV={class:"py-2 text-sm text-neutral-600 dark:text-neutral-400"},RV=e.defineComponent({__name:"DynamicFormDialogs",setup(t){const n=e.inject("dynamicFormContext"),{confirmDialog:o,t:r,confirmAction:a,tableDialogOpen:s,tableDialogTitle:i,tableDialogIcon:l,tableDialogFields:c,isFieldVisible:d,tableRowFormData:u,tableDialogViewOnly:f,isFieldRequired:m,isFieldDisabled:h,getFilteredItems:p,tableRowErrors:k,resolveFieldLabels:x,resolveFieldLength:g,resolvedBaseUrl:S,handleTableRowUpdate:B,locale:E,saveTableRow:_,confirmDeleteOpen:w,executeTableDelete:y}=n;return(b,C)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(Pn,{modelValue:e.unref(o).visible,"onUpdate:modelValue":C[1]||(C[1]=V=>e.unref(o).visible=V),title:e.unref(o).title,icon:"AlertTriangle","max-width":450},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:e.unref(r)("common.cancel"),onClick:C[0]||(C[0]=V=>e.unref(o).visible=!1)},null,8,["text"]),e.createVNode(Ke,{text:e.unref(r)("common.confirm"),onClick:e.unref(a)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",vV,e.toDisplayString(e.unref(o).message),1)]),_:1},8,["modelValue","title"]),e.createVNode(Pn,{modelValue:e.unref(s),"onUpdate:modelValue":C[3]||(C[3]=V=>e.isRef(s)?s.value=V:null),title:e.unref(i),icon:e.unref(l),"max-width":700},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:e.unref(f)?e.unref(E)==="id"?"Tutup":"Close":e.unref(E)==="id"?"Batal":"Cancel",onClick:C[2]||(C[2]=V=>s.value=!1)},null,8,["text"]),e.unref(f)?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Ke,{key:0,text:"Save",onClick:e.unref(_)},null,8,["onClick"]))]),default:e.withCtx(()=>[e.unref(c).length?(e.openBlock(),e.createElementBlock("div",FV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),V=>(e.openBlock(),e.createElementBlock("div",{key:V.key,class:e.normalizeClass(V.column==="FULL"?"md:col-span-2":"col-span-1")},[e.unref(d)(V,e.unref(u))?(e.openBlock(),e.createBlock(ci,{key:0,field:V,"model-value":e.unref(u)[V.model],"form-data":e.unref(u),required:e.unref(f)?!1:e.unref(m)(V,e.unref(u)),disabled:e.unref(f)||e.unref(h)(V,e.unref(u)),"view-only":e.unref(f),options:e.unref(p)(V,e.unref(u)),error:e.unref(f)?void 0:e.unref(k)[V.model],"dynamic-labels":e.unref(x)(V,e.unref(u)),"dynamic-length":e.unref(g)(V,e.unref(u)),"base-url":e.unref(S),"onUpdate:modelValue":D=>e.unref(B)(V.model,D)},null,8,["field","model-value","form-data","required","disabled","view-only","options","error","dynamic-labels","dynamic-length","base-url","onUpdate:modelValue"])):e.createCommentVNode("",!0)],2))),128))])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","title","icon"]),e.createVNode(Pn,{modelValue:e.unref(w),"onUpdate:modelValue":C[5]||(C[5]=V=>e.isRef(w)?w.value=V:null),title:e.unref(E)==="id"?"Konfirmasi Hapus":"Confirm Delete",icon:"Trash2","max-width":440},{actions:e.withCtx(()=>[e.createVNode(Ke,{variant:"outline",text:e.unref(E)==="id"?"Batal":"Cancel",onClick:C[4]||(C[4]=V=>w.value=!1)},null,8,["text"]),e.createVNode(Ke,{variant:"default","bg-color":"danger",icon:"Trash2",text:e.unref(E)==="id"?"Hapus":"Delete",onClick:e.unref(y)},null,8,["text","onClick"])]),default:e.withCtx(()=>[e.createElementVNode("div",zV,e.toDisplayString(e.unref(E)==="id"?"Apakah Anda yakin ingin menghapus data ini? Tindakan ini tidak dapat dibatalkan.":"Are you sure you want to delete this row? This action cannot be undone."),1)]),_:1},8,["modelValue","title"])]))}}),IV={class:"w-full space-y-6"},di=e.defineComponent({__name:"DynamicForm",props:{schema:{},model:{default:()=>({})},isEditMode:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},baseUrl:{default:void 0},selectedTokenCore:{default:null}},emits:["submit","cancel","action","update:model","success","error"],setup(t,{emit:n}){const a=aV(t,n);e.provide("dynamicFormContext",a);const{activeSchema:s,isSectionVisible:i,inlineState:l,isActionVisible:c,locale:d,isSubmitting:u,isSubmitDisabled:f,handleGlobalButtonClick:m,handleSubmit:h}=a;return(p,k)=>{var x,g,S,B,E,_;return e.openBlock(),e.createElementBlock("div",IV,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((x=e.unref(s))==null?void 0:x.sections,(w,y)=>{var b,C,V;return e.openBlock(),e.createElementBlock(e.Fragment,{key:y},[((b=w.type)==null?void 0:b.toUpperCase())==="FORM"&&w.propsForm&&e.unref(i)(w)?(e.openBlock(),e.createBlock(xV,{key:0,section:w,sIdx:Number(y)},null,8,["section","sIdx"])):((C=w.type)==null?void 0:C.toUpperCase())==="TABLE"&&w.propsTable&&e.unref(i)(w)?(e.openBlock(),e.createBlock(_V,{key:1,section:w},null,8,["section"])):((V=w.type)==null?void 0:V.toUpperCase())==="WIZARD"&&w.propsWizard&&e.unref(i)(w)?(e.openBlock(),e.createBlock(OV,{key:2,section:w},null,8,["section"])):e.createCommentVNode("",!0)],64)}),128)),(g=e.unref(l))!=null&&g.global?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(((B=(S=e.unref(s))==null?void 0:S.ui)==null?void 0:B.actionsClass)||"flex items-center gap-2 flex-wrap pt-4 border-t border-neutral-100 dark:border-neutral-800")},[(_=(E=e.unref(s))==null?void 0:E.actionGlobal)!=null&&_.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(e.unref(s).actionGlobal,(w,y)=>{var b,C,V;return e.openBlock(),e.createElementBlock(e.Fragment,{key:y},[w.propsActionGlobal&&e.unref(c)(w)?(e.openBlock(),e.createBlock(Ke,{key:0,icon:w.propsActionGlobal.icon,text:e.unref(d)==="id"?w.propsActionGlobal.labelID:w.propsActionGlobal.labelEN,"bg-color":((b=w.propsActionGlobal.bgColor)==null?void 0:b.toLowerCase())||"primary",variant:((C=w.propsActionGlobal.variant)==null?void 0:C.toLowerCase())||"default",loading:e.unref(u),disabled:e.unref(f)&&(w.permission==="CREATE"||w.permission==="UPDATE"||((V=w.propsActionGlobal)==null?void 0:V.key)==="submit"),onClick:D=>e.unref(m)(w)},null,8,["icon","text","bg-color","variant","loading","disabled","onClick"])):e.createCommentVNode("",!0)],64)}),128)):(e.openBlock(),e.createBlock(Ke,{key:1,text:"Submit","bg-color":"primary",loading:e.unref(u),disabled:e.unref(f),onClick:e.unref(h)},null,8,["loading","disabled","onClick"]))],2)),e.createVNode(RV)])}}}),LV={"aria-label":"Breadcrumb"},$V={class:"flex flex-wrap items-center text-sm md:text-base"},jV={class:"truncate max-w-[100px] sm:max-w-[150px] md:max-w-none"},mu=e.defineComponent({__name:"Breadcrumb",props:{items:{},showHomeIcon:{type:Boolean,default:!0},iconSize:{default:18},separatorSize:{default:16},separatorType:{default:"chevron"},strokeWidth:{default:2}},setup(t){const n=t,o=le.Home,r=n.separatorType==="slash"?le.Slash:le.ChevronRight;return(a,s)=>(e.openBlock(),e.createElementBlock("nav",LV,[e.createElementVNode("ol",$V,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,(i,l)=>(e.openBlock(),e.createElementBlock("li",{key:l,class:"flex items-center"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.to?"router-link":"span"),{to:i.to,class:e.normalizeClass(["inline-flex items-center gap-1.5 transition-all duration-200 rounded-lg font-medium",i.to?"text-gray-700 dark:text-gray-300 hover:text-primary-600 dark:hover:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-900/20 cursor-pointer":"dark:text-gray-100 bg-primary-50 dark:bg-primary-900/30 text-primary-700"])},{default:e.withCtx(()=>[i.icon||l===0&&t.showHomeIcon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.icon||e.unref(o)),{key:0,size:t.iconSize,class:e.normalizeClass(["flex-shrink-0",i.to?"text-gray-500 dark:text-gray-400 group-hover:text-primary-600 dark:group-hover:text-primary-400":"text-primary-600 dark:text-primary-400",i.iconClass||""]),"stroke-width":t.strokeWidth},null,8,["size","class","stroke-width"])):e.createCommentVNode("",!0),e.createElementVNode("span",jV,e.toDisplayString(i.label),1)]),_:2},1032,["to","class"])),l<t.items.length-1?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(r)),{key:0,size:t.separatorSize,class:"mx-1.5 text-gray-300 dark:text-gray-700 flex-shrink-0"},null,8,["size"])):e.createCommentVNode("",!0)]))),128))])]))}});function hu(){return{setPageTitle:o=>{typeof document<"u"&&(document.title=o||document.title),typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:page-title",{detail:{title:o},bubbles:!0,composed:!0}))},setBreadcrumb:o=>{typeof window<"u"&&window.dispatchEvent(new CustomEvent("micro:breadcrumb",{detail:{items:o},bubbles:!0,composed:!0}))}}}const UV={class:"w-full space-y-6 animate-pulse"},WV={class:"p-4 grid grid-cols-1 md:grid-cols-2 gap-4"},HV=e.defineComponent({__name:"AutoLayoutSkeleton",setup(t){return(n,o)=>(e.openBlock(),e.createElementBlock("div",UV,[o[2]||(o[2]=e.createElementVNode("div",{class:"h-6 w-48 bg-neutral-200 dark:bg-neutral-700 rounded-md"},null,-1)),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(2,r=>e.createElementVNode("div",{key:r,class:"rounded-xl border border-neutral-200 dark:border-neutral-700 overflow-hidden"},[o[1]||(o[1]=e.createElementVNode("div",{class:"px-4 py-3 bg-neutral-200 dark:bg-neutral-700"},[e.createElementVNode("div",{class:"h-4 w-32 bg-neutral-300 dark:bg-neutral-600 rounded"})],-1)),e.createElementVNode("div",WV,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(6,a=>e.createElementVNode("div",{key:a,class:e.normalizeClass(a>4?"md:col-span-2":"col-span-1")},[...o[0]||(o[0]=[e.createElementVNode("div",{class:"h-3 w-24 bg-neutral-200 dark:bg-neutral-700 rounded mb-2"},null,-1),e.createElementVNode("div",{class:"h-10 w-full bg-neutral-200 dark:bg-neutral-700 rounded-lg"},null,-1)])],2)),64))])])),64)),o[3]||(o[3]=e.createElementVNode("div",{class:"flex items-center gap-2"},[e.createElementVNode("div",{class:"h-9 w-24 bg-neutral-300 dark:bg-neutral-600 rounded-lg"}),e.createElementVNode("div",{class:"h-9 w-20 bg-neutral-200 dark:bg-neutral-700 rounded-lg"})],-1))]))}}),qV={class:"w-full"},GV={class:"relative mx-auto min-h-[37.5rem]"},XV={key:"content",class:"w-full"},KV={class:"mb-6"},YV={class:"text-neutral-500 dark:text-neutral-400"},JV={key:"skeleton",class:"w-full"},QV={key:"error",class:"flex items-center justify-center p-20 text-red-500 w-full"},ui=Dt(e.defineComponent({name:"AutoLayoutForm",__name:"AutoLayoutForm",props:{layoutCode:{},isEditMode:{type:Boolean},model:{},selectedTokenCore:{}},emits:["submit-success","cancel","action-success","update:model"],setup(t,{emit:n}){var N,P,M,X,$,H,J,te;const o=t,r=n,a=(P=(N=e.getCurrentInstance())==null?void 0:N.appContext)==null?void 0:P.app;a&&!a._context.provides[Symbol.for("vue-router-route-location")]&&a.provide(Symbol.for("vue-router-route-location"),{query:{},params:{},path:""});let s={query:{},params:{},path:""};try{const T=Fn.useRoute();if(T&&Object.keys(T).length>0)s=T;else{const L=e.getCurrentInstance();($=(X=(M=L==null?void 0:L.appContext)==null?void 0:M.config)==null?void 0:X.globalProperties)!=null&&$.$route&&(s=L.appContext.config.globalProperties.$route)}}catch{console.warn("useRoute not available, using fallback")}let i={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:T=>{typeof window<"u"&&(typeof T=="string"?window.location.href=T:T&&T.path&&(window.location.href=T.path))},__isFallback:!0};try{const T=Fn.useRouter();if(T)i=T;else{const L=e.getCurrentInstance();(te=(J=(H=L==null?void 0:L.appContext)==null?void 0:H.config)==null?void 0:J.globalProperties)!=null&&te.$router&&(i=L.appContext.config.globalProperties.$router)}}catch{console.warn("useRouter not available, using fallback")}const{apiUrl:l,DCodeApi:c}=ct();let d;try{d=vt.useI18n().locale}catch{d=e.ref("en")}const{setPageTitle:u}=hu(),f=e.computed(()=>o.isEditMode!==void 0?o.isEditMode:s.params&&"id"in s.params?!0:s.path?/\/edit\/[^\/]+$/.test(s.path):!1);e.watchEffect(()=>{console.log("isEditModeisEditMode",f.value)});const m=e.computed(()=>{if(s.params&&"id"in s.params)return s.params.id;if(!s.path)return null;const T=s.path.match(/\/edit\/([^\/]+)$/);return T?T[1]:null}),h=e.ref({}),p=e.ref(null),k=e.ref(!0),x=e.ref(!1),g="https://dcodedynamic.skyworx.co.id/api/auto-layout/form/form-dynamic?code=",S="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",B=e.ref(o.layoutCode),E=e.computed(()=>{var Z;if(!p.value)return"";const T=((Z=d==null?void 0:d.value)==null?void 0:Z.toLowerCase())||"en";return(T==="en"||T.startsWith("en-")?p.value.titleEN:p.value.titleID)||p.value.title||o.layoutCode});e.watch(E,T=>{T&&u(T)},{immediate:!0});const _=(T,L="")=>{const Z={};return!T||typeof T!="object"||Object.keys(T).forEach(Q=>{const W=T[Q],ie=L?`${L}.${Q}`:Q;W&&typeof W=="object"&&!Array.isArray(W)&&!(W instanceof Date)&&Object.assign(Z,_(W,ie)),Z[ie]=W}),Z},w=T=>{var W;if(!T||typeof T!="string"||T.startsWith("http"))return T;const L=(W=o.selectedTokenCore)==null?void 0:W.address;if(!L)return T;const Z=L.replace(/\/$/,""),Q=T.startsWith("/")?T:`/${T}`;return`${Z}${Q}`},y=async()=>{var T,L,Z,Q,W,ie;k.value=!0;try{let de=o.layoutCode;s&&s.query&&typeof s.query=="object"&&"code"in s.query&&(de=s.query.code||o.layoutCode);const Ce="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",Ne=Ce?{Authorization:`Bearer ${Ce}`}:{},ge=w(`${g}${de}`);let Y=await l(ge,"GET",null,Ne);if(!Y.status||!Y.data||Array.isArray(Y.data)&&Y.data.length===0)try{const v=w(`${S}${de}`),K=await l(v,"GET",null,Ne);if(K.status){const re=Array.isArray(K.data)?K.data[0]:K.data;re&&re.code&&(de=re.code,B.value=de,Y=await l(w(`${g}${de}`),"GET",null,Ne))}}catch(v){console.warn("Failed to resolve layout code via datatable",v)}if(Y.status){p.value=Array.isArray(Y.data)?Y.data[0]:Y.data;const v={};if((T=p.value)!=null&&T.sections&&p.value.sections.forEach(K=>{((K.propsForm||K.props||{}).fields||K.fields||[]).forEach(Re=>{var He;const ze=Re.model||((He=Re.props)==null?void 0:He.model)||Re.key;ze&&(v[ze]=null)})}),h.value=v,k.value=!1,f.value&&m.value){x.value=!0;try{const K=(Q=(Z=(L=p.value.sections)==null?void 0:L[0])==null?void 0:Z.propsForm)==null?void 0:Q.endpointForm,re=p.value.endpointForm,_e=K||re;if(_e!=null&&_e.apiUrl){const Re=_e.apiUrl,ze=_e.apiMethod||"GET",He=_e.keyParam||[],Xe={};He.length>0?He.forEach(Ie=>{Xe[Ie]=m.value}):Xe.id=m.value;const ot=await c(w(Re),ze,Xe);if(console.log(`[AutoLayoutForm] API Result for ${Re}:`,ot),ot.status){let Ie=Array.isArray(ot.data)?ot.data[0]:ot.data;ot.payload&&(Ie={...Ie,...ot.payload}),console.log("[AutoLayoutForm] Successfully fetched record:",Ie);const mt=_(Ie);h.value={...h.value,...Ie,...mt},console.log("[AutoLayoutForm] Updated initialData:",h.value)}else console.warn("[AutoLayoutForm] Record API returned status: false",ot)}else if((W=p.value.endpointGlobal)!=null&&W.apiUrl){const Re=p.value.endpointGlobal.apiUrl,ze=p.value.endpointGlobal.apiMethod||"GET",He={id:m.value},Xe=await c(w(Re),ze,He);if(Xe.status){const ot=Array.isArray(Xe.data)?Xe.data[0]:Xe.data,Ie=_(ot);h.value={...h.value,...ot,...Ie}}}else{const Re=((ie=p.value.endpoint)==null?void 0:ie.detailUrl)||`/api/${B.value}/detail/${m.value}`,ze=await l(w(Re),"GET");if(ze.status){let He=Array.isArray(ze.data)?ze.data[0]:ze.data;if(ze.payload){const Ie={...ze.payload};if(Object.keys(Ie).forEach(mt=>{He[mt]!==void 0&&He[mt]!==null&&(Ie[mt]=He[mt])}),!("id"in Ie)&&He.id){const mt=Object.keys(Ie).find(pt=>pt.startsWith("id")&&pt.length>2&&!Ie[pt]);mt&&(Ie[mt]=He.id)}He=Ie}const Xe={...He};Object.keys(h.value).forEach(Ie=>{if(Xe[Ie]===void 0||Xe[Ie]===null){if(Ie.toLowerCase().startsWith("id")&&Ie.length>2){const pt=Ie.substring(2).toLowerCase(),Tt=Array.isArray(ze.data)?ze.data[0]:ze.data,q=Object.keys(Tt).find(ue=>ue.toLowerCase()===pt);q&&Tt[q]&&typeof Tt[q]=="object"&&"id"in Tt[q]&&(Xe[Ie]=Tt[q].id)}if(Ie==="idSupervisor"){const pt=Array.isArray(ze.data)?ze.data[0]:ze.data;pt.supervisorId&&(Xe[Ie]=pt.supervisorId)}}});const ot=_(Xe);h.value={...h.value,...Xe,...ot}}}}catch(K){console.error("Failed to fetch record data:",K)}finally{x.value=!1}}}}catch(de){console.error("Failed to load form layout:",de),k.value=!1}},b=T=>{const L=Object.keys(h.value||{}).filter(Q=>h.value[Q]!==null&&h.value[Q]!==void 0),Z=Object.keys(T||{}).filter(Q=>T[Q]!==null&&T[Q]!==void 0);if(L.length>3&&Z.length<L.length/2){console.warn('[AutoLayoutForm] Circuit breaker triggered: Ignoring likely erroneous "empty" update from child.',{currentCount:L.length,incomingCount:Z.length,data:T});return}console.log("[AutoLayoutForm] Allowing model update:",T),h.value=T,r("update:model",T)},C=async T=>{var L,Z,Q;try{const W=(Q=(Z=(L=p.value.sections)==null?void 0:L[0])==null?void 0:Z.propsForm)==null?void 0:Q.endpointForm,ie=p.value.endpointGlobal||p.value.endpoint,de=(W==null?void 0:W.submitUrl)||(ie==null?void 0:ie.submitUrl)||`/api/generic/${o.layoutCode}`,Ce=(W==null?void 0:W.submitMethod)||(ie==null?void 0:ie.submitMethod)||(f.value?"PUT":"POST"),Ne=Object.values(T).some(Y=>Y instanceof File||Y instanceof Blob);let ge;Ne?(ge=new FormData,Object.keys(T).forEach(Y=>{const v=T[Y];v!=null&&(Array.isArray(v)?v.forEach(K=>ge.append(`${Y}[]`,K)):ge.append(Y,v))})):(ge={...T},f.value&&m.value&&!ge.id&&(ge.id=m.value)),await l(w(de),Ce,ge),r("submit-success",ge),i.back()}catch(W){console.error("Submit failed:",W)}},V=async(T,L,Z)=>{if(T==="cancel"){D();return}const Q=L.endpointPropAction||L.propsActionGlobal&&L.propsActionGlobal.endpointPropAction;if(Q)try{k.value=!0;const W=Z?{...Z}:{...h.value};f.value&&L.model&&m.value&&(W[L.model]=m.value);const ie=Q.apiUrl,de=Q.apiMethod||"POST";(await c(w(ie),de,W)).status&&(r("action-success",T,L,W),i.back())}catch(W){console.error("Action failed:",W)}finally{k.value=!1}},D=()=>{r("cancel"),i.back()};return e.onMounted(()=>{y()}),e.watch(()=>o.model,T=>{T&&Object.keys(T).length>0&&(h.value={...h.value,...T})},{immediate:!0,deep:!0}),e.onUnmounted(()=>{u("")}),(T,L)=>(e.openBlock(),e.createElementBlock("div",qV,[e.createElementVNode("div",GV,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx(()=>[!k.value&&p.value?(e.openBlock(),e.createElementBlock("div",XV,[e.createElementVNode("div",KV,[e.createElementVNode("p",YV,e.toDisplayString(p.value.description),1)]),e.createVNode(di,{schema:p.value,model:h.value,"is-edit-mode":f.value,loading:x.value,"selected-token-core":o.selectedTokenCore,"onUpdate:model":L[0]||(L[0]=Z=>b(Z)),onSubmit:C,onCancel:D,onAction:V,class:"w-full"},null,8,["schema","model","is-edit-mode","loading","selected-token-core"])])):k.value?(e.openBlock(),e.createElementBlock("div",JV,[e.createVNode(HV)])):(e.openBlock(),e.createElementBlock("div",QV," Failed to load form configuration for "+e.toDisplayString(o.layoutCode),1))]),_:1})])]))}}),[["__scopeId","data-v-3c619a9c"]]),ZV={class:"h-full flex flex-col"},eA={key:1,class:"flex-1 flex items-center justify-center"},tA={key:2,class:"flex-1 flex items-center justify-center text-red-500"},fi=e.defineComponent({name:"AutoLayoutDatatable",__name:"AutoLayoutDatatable",props:{layoutCode:{},userPermissions:{},permissionBase:{},checkPermission:{type:Function}},emits:["action","navigate"],setup(t,{emit:n}){var _,w,y,b,C,V;const o=t,r=n,a=e.getCurrentInstance(),{apiUrl:s}=ct();let i={query:{},params:{},path:""};try{const D=Fn.useRoute();D?i=D:(y=(w=(_=a==null?void 0:a.appContext)==null?void 0:_.config)==null?void 0:w.globalProperties)!=null&&y.$route&&(i=a.appContext.config.globalProperties.$route)}catch{console.warn("useRoute not available, using fallback")}let l={back:()=>{typeof window<"u"&&window.history&&window.history.length>1&&window.history.back()},push:D=>{typeof window<"u"&&(typeof D=="string"?window.location.href=D:D&&D.path&&(window.location.href=D.path))}};try{const D=Fn.useRouter();D?l=D:(V=(C=(b=a==null?void 0:a.appContext)==null?void 0:b.config)==null?void 0:C.globalProperties)!=null&&V.$router&&(l=a.appContext.config.globalProperties.$router)}catch{console.warn("useRouter not available, using fallback")}const c=e.inject("hasActionAccess",()=>!1),d=e.inject("userPermissions",null),u=e.ref(null),f=e.ref(!0),m=e.ref(null),h="https://dcodedynamic.skyworx.co.id/api/auto-layout/datatable/form-dynamic?code=",p=e.computed(()=>`${h}${o.layoutCode}`),{setPageTitle:k}=hu();let x;try{x=vt.useI18n().locale}catch{x=e.ref("en")}const g=()=>{if(u.value){const N=(x.value==="id"?u.value.titleID:u.value.titleEN)||u.value.title||"Datatable";k(N)}};e.watch(x,()=>{g()});const S=async()=>{f.value=!0;try{const D="eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJDQkFTIiwiaWF0IjoxNzcyNDU5MzQ0LCJkYXRlIjoiMDIwMzIwMjYiLCJjb2RlIjoidGVzdGVyIiwidXJsRm9ybSI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvZm9ybSIsInVybEFjdGlvbiI6Ii9hcGkvY2Jhcy9lbmRwb2ludHMvYWN0aW9uIiwidXJsRGF0YXRhYmxlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9kYXRhdGFibGUiLCJ1cmxQYXRoIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9wYXRoIiwidXJsUmVmZXJhbmNlIjoiL2FwaS9jYmFzL2VuZHBvaW50cy9yZWZlcmVuY2UifQ.JGIUTL0GEAp34zanY6dqLKg7jOLHwKzataY271JStsE",N=D?{Authorization:`Bearer ${D}`}:{},P=await s(p.value,"GET",null,N);P.status&&(u.value=Array.isArray(P.data)?P.data[0]:P.data,console.log("[DEBUG] AutoLayoutDatatable config loaded:",u.value),g())}catch(D){console.error("Gagal Menampilkan Datatable:",D)}finally{f.value=!1}},B=D=>{D.action==="add"&&console.log("[AutoLayoutDatatable] Add action triggered"),console.log("Aksi:",D.action,D)},E=D=>{console.log("[DEBUG] AutoLayoutDatatable handleNavigate:",D);let N=D.route;const P=D.path;if(!N&&P){const X=((i==null?void 0:i.path)||"").split("/");X.length>=2&&(N=`/${X[1]}/create`)}if(N||P){const M={...D.query||{},code:P||void 0};Object.keys(M).forEach(X=>M[X]===void 0&&delete M[X]),console.log("[DEBUG] Emitting navigate to parent:",{route:N,query:M}),r("navigate",{route:N||"/form",query:M}),l&&!l.__isFallback&&l.push({path:N||"/form",query:M})}else console.warn("[DEBUG] No route or path provided for navigation")};return e.onMounted(()=>{S()}),(D,N)=>(e.openBlock(),e.createElementBlock("div",ZV,[!f.value&&u.value?(e.openBlock(),e.createBlock(Co,{key:0,ref_key:"dtRef",ref:m,"api-url":p.value,"api-method":"GET","table-config":u.value,"permission-base":o.permissionBase||"","dummy-mode":["datatable-create","datatable-edit"].includes(o.layoutCode),"user-permissions":o.userPermissions||e.unref(d),"permission-checker":e.unref(c),checkPermission:o.checkPermission,onAction:B,onNavigate:E},{"header-actions":e.withCtx(()=>[...N[0]||(N[0]=[])]),_:1},8,["api-url","table-config","permission-base","dummy-mode","user-permissions","permission-checker","checkPermission"])):f.value?(e.openBlock(),e.createElementBlock("div",eA,[...N[1]||(N[1]=[e.createElementVNode("i",{class:"mdi mdi-loading mdi-spin text-4xl text-primary-600"},null,-1)])])):(e.openBlock(),e.createElementBlock("div",tA," Failed to load configuration for "+e.toDisplayString(o.layoutCode),1))]))}}),pu=e.defineCustomElement(ui),gu=e.defineCustomElement(fi);typeof customElements<"u"&&(customElements.get("micro-dynamic-form")||customElements.define("micro-dynamic-form",pu),customElements.get("micro-dynamic-datatable")||customElements.define("micro-dynamic-datatable",gu));const nA=[gr,zi,Ke,bl,Xa,Ka,Vd,gn,zs,Rs,oa,Pn,Wd,ra,Hd,Hs,Is,qd,Gs,aa,Xs,bo,Ks,sa,Gd,Xd,Ys,Js,ia,la,ao,yo,Qd,Zd,Qs,Zs,ei,li,Co,ui,fi,di,mu],bu={install(t,n={}){n&&Object.keys(n).length>0&&pi(n),nA.forEach(o=>{o.name&&t.component(o.name,o)})}};pe.AutoLayoutDatatable=fi,pe.AutoLayoutForm=ui,pe.Breadcrumb=mu,pe.DCodeAutoComplete=gr,pe.DCodeBadge=li,pe.DCodeBeforeAfter=Xa,pe.DCodeButton=Ke,pe.DCodeCard=bl,pe.DCodeCardCheckboxList=zs,pe.DCodeChart=Vd,pe.DCodeCheckbox=gn,pe.DCodeCurrencyField=Rs,pe.DCodeDatePicker=oa,pe.DCodeDialog=Pn,pe.DCodeDialogCloseBtn=Wd,pe.DCodeDropzone=ra,pe.DCodeDynamicUploadList=Is,pe.DCodeFileField=Hd,pe.DCodeFileResult=Hs,pe.DCodeIconDropdown=qd,pe.DCodeImageCropperDialog=Gs,pe.DCodeImageField=aa,pe.DCodeImageResult=Xs,pe.DCodeInfiniteAutoComplete=zi,pe.DCodeLabel=bo,pe.DCodeListLabels=Ka,pe.DCodeMultiSelect=Ks,pe.DCodeOtpInput=sa,pe.DCodePermissionMenu=Zs,pe.DCodeProgress=Gd,pe.DCodeProgressBar=Xd,pe.DCodeRadio=Ys,pe.DCodeRadioCustom=Js,pe.DCodeSlider=ia,pe.DCodeSwitch=la,pe.DCodeTextField=ao,pe.DCodeTextarea=yo,pe.DCodeTimelineWithIcons=Qd,pe.DCodeTreePermissions=ei,pe.DCodeUploadFile=Zd,pe.DCodeWizard=Qs,pe.DataTable=Co,pe.DataTableComponent=Co,pe.DynamicForm=di,pe.DynamicUI=bu,pe.MicroDynamicDatatable=gu,pe.MicroDynamicForm=pu,pe.cn=ve,pe.default=bu,pe.setApiConfig=pi,Object.defineProperties(pe,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|